This repository has been archived on 2026-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
orchestrator/agent-team/agent_team/db
Adam Moussa 1b4d30e47f feat(agent-team): add pending_questions.kind discriminator + migration (Phase B1)
The plan-review gate (coming next) needs to tell its decision questions apart
from clarifier questions in the durable ledger. Add a `kind` column to
pending_questions (values 'clarify' | 'plan_decision').

- Fresh DBs: `kind TEXT NOT NULL DEFAULT 'clarify'` (+ CHECK) in the DDL.
- Live ledger: idempotent additive migration (SCHEMA_VERSION 3→4) — a guarded
  ALTER (PRAGMA table_info) run from both migrate() and init_db; legacy rows
  take the 'clarify' default, never null. (SQLite can't add a CHECK via ALTER,
  so the migrated column is NOT NULL DEFAULT only; value constraint is enforced
  on fresh DBs by the CHECK and on all writes by the typed helper.)
- ledger.post_question gains a keyword-only `kind="clarify"` (backward
  compatible — existing callers unchanged); PendingQuestion.from_row reads it.

Tests: fresh-DB column+default, idempotent init_db, legacy-DB backfill to
'clarify', plan_decision round-trip. 1396 passed.
2026-06-23 21:03:53 -04:00
..
__init__.py feat(agent-team): task_transitions ledger + graph node instrumentation 2026-06-23 17:15:08 -04:00
schema.py feat(agent-team): add pending_questions.kind discriminator + migration (Phase B1) 2026-06-23 21:03:53 -04:00
schema.sql feat(agent-team): add pending_questions.kind discriminator + migration (Phase B1) 2026-06-23 21:03:53 -04:00
transitions.py fix(agent-team): address GPT-4.1 cross-review findings on the dashboard surface 2026-06-23 17:19:04 -04:00