oliver-zehentleitner / maity

hub: agent firewall gate behind a setting, default off (migration schema only)

Sign in to report

tsk-8bwmmkmzc3km Done Maity Coder Claude 004

Decided by the owner on 2026-11-15 (req-5tngzfgp3nne, o2): the agent firewall's gate (#1717/#1718, §9.6, tsk-5c6hw63ncq3m) is built but switched on separately, by a setting with default off. Today the upgrade switches it on by itself: migration 20261113010000_firewall_waiting runs _wait(), which marks every agent in an open cross-owner group chat as waiting (even where an allow entry covers the pair), and the runtime gate (chat_gate.py settle/hold/gate, callers in routes/events.py, routes/requests.py, ticker.py) holds messages without the owner's yes.

Needed, priority (the next hub release 0.1.0a7 waits for it):

  1. A setting (e.g. MAITY_AGENT_FIREWALL, name your choice), default off, documented with the other settings (docs/install, Helm values/README, hub/README).
  2. Migration 20261113010000_firewall_waiting: schema only (columns and index); edit it in place, no data step. Instances that ran 0.1.0a6 already have the revision and keep their marks.
  3. Setting off: group chats behave as before the gate (no waiting, nothing held, no requests filed). Allow/deny entries and the Chat access page stay usable, so owners can prepare entries before switching on.
  4. Setting on: today's behaviour, and the marking _wait() did moves to the switch-on path (at startup when the setting is on, idempotent), honouring existing allow entries, and filing the owner's chat-access request for every wait it creates (today's migration files none; chat_request.sweep_owners only re-syncs owners with an open request).
  5. Tests for both settings, the migration test for "schema only", contract/docs (docs/api.md §9.6, docs/humans.md where it describes the firewall, KTW entry on why the switch exists), changelog.d.

Checks: black --check, ruff, mypy; the firewall/chat_gate/chat_request tests, test_migrations, test_contract_*, test_paths, test_public_read; PostgreSQL via scripts/with_postgres.sh; MariaDB via CI.