db: agent enrollment schema (M4-4a, migration 0021)
ci/woodpecker/pr/ci Pipeline was successful

Additive-only DDL per the merged design (docs/plans/
2026-08-29-agent-enrollment-command-design.md SS4): agents gains
nullable harness + enrolled_at (no backfill); new agent_audit_events
(append-only, seq identity, FK-free agent linkage, causation self-FK,
closed event-type CHECK), agent_outbox (hierarchy shape, one row per
event, closed status enum), agent_idempotency_fence (contract 3 SS4.3
shape: UNIQUE (operation, key), replay-mode CHECK, FK-free outcome
reference).

Schema-level witnesses in agent-enrollment.witness.test.ts (PGlite +
real-PostgreSQL legs): nullable enrollment columns, event-type CHECK,
per-agent seq ordering, deletion-safe linkage (events and fence rows
survive agent deletion; information_schema FK probes), causation and
outbox RESTRICT, fence uniqueness and mode CHECK. Command-level
witnesses land with M4-4b.
This commit is contained in:
fred
2026-08-29 20:25:38 -05:00
parent ee815a72b1
commit e4d5fa54b4
5 changed files with 6346 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+7
View File
@@ -148,6 +148,13 @@
"when": 1787963521142,
"tag": "0020_special_betty_brant",
"breakpoints": true
},
{
"idx": 21,
"version": "7",
"when": 1788053011351,
"tag": "0021_agent_enrollment",
"breakpoints": true
}
]
}