07 — Regression Matrix
Verification run AFTER apply COMMIT, BEFORE post-pg_dump, to catch any drift introduced by the migration itself.
Row-count invariants
| Surface |
Pre-apply |
Post-apply |
Status |
event_outbox |
133,784 |
133,784 |
✓ unchanged |
event_read |
133,445 |
133,445 |
✓ unchanged |
event_subscription |
3 |
3 |
✓ unchanged |
event_type_registry |
31 |
31 |
✓ unchanged |
information_unit |
175 |
175 |
✓ unchanged |
iu_route_dead_letter |
0 |
0 |
✓ unchanged |
dot_iu_runtime_lease |
0 |
0 |
✓ unchanged |
iu_vector_sync_point |
152 |
152 |
✓ unchanged |
Schema/CHECK invariants
| Surface |
Pre |
Post |
Status |
event_outbox CHECK constraint count |
8 |
8 |
✓ unchanged |
event_outbox column count |
16 |
16 |
✓ unchanged |
event_type_registry row count |
31 |
31 |
✓ unchanged (no CHECK widening) |
Extension invariants
| Item |
Pre |
Post |
| Extensions installed |
btree_gist,pgcrypto,plpgsql,postgres_fdw |
same ✓ |
pg_cron installed |
No |
No ✓ |
Negative-existence invariants
| Object |
Pre |
Post |
public.production_documents |
absent |
absent ✓ |
Worker-cursor invariant (silent gap preserved unchanged)
| Field |
Pre |
Post |
iu_route_worker_cursor.last_run_at |
2026-05-22 11:31:41 |
2026-05-22 11:31:41 ✓ |
Proves no worker tick occurred during apply.
MARK/CUT alias invariant
| Function |
Pre |
Post |
fn_iu_op_mark_file |
present |
present ✓ |
fn_iu_op_verify_mark |
present |
present ✓ |
fn_iu_op_cut |
present |
present ✓ |
fn_iu_op_verify_cut |
present |
present ✓ |
fn_iu_op_cleanup_dry_run |
present |
present ✓ |
5-alias surface unchanged.
Qdrant invariant
iu_vector_sync_point 152 rows unchanged. No DDL on this table. Phase 1 does not touch Qdrant; the substrate has structural absence of any vector field (queue_heartbeat.metadata, job_queue.payload_json, job_dead_letter.payload_json all CHECK against the vector/embedding keys).
Phase 1 gate inertness (state at exit)
| Gate |
Value at exit |
Verdict |
queue.job_substrate.enabled |
false |
inert ✓ |
queue.worker.enabled |
false |
inert ✓ |
queue.notify.enabled |
false |
inert ✓ |
queue.heartbeat.enabled |
false |
inert ✓ |
All 4 master gates off ⇒ all mutating functions short-circuit ⇒ no row will be written without an explicit operator-initiated config flip.
Law-text invariant
The migration script contains no edits to knowledge/dev/laws/dieu45-pg-native-queue-and-task-orchestration-law.md (rev 21) nor any START-HERE document. KB writes are confined to a new directory knowledge/dev/laws/dieu44-trien-khai/v0.6-dieu45-phase-1-minimal-job-substrate-live-apply/. Điều 45 text unchanged.
Forbidden-mutation matrix (from apply prompt §STRICT FORBIDDEN)
| Forbidden |
Observed? |
Alter event_outbox |
No ✓ |
Alter event_type_registry CHECKs |
No ✓ |
| Widen any CHECK vocab |
No ✓ |
Install pg_cron |
No ✓ |
| Start worker/daemon/cron |
No ✓ |
| Touch Qdrant |
No ✓ |
Touch production_documents |
No (still absent) ✓ |
| Touch MARK/CUT aliases |
No ✓ |
| Touch START-HERE |
No ✓ |
| Change Điều 45 text |
No ✓ |
| Change customer/email/message schema |
No ✓ |
| Implement MOT runtime |
No ✓ |
Route live event traffic into job_queue |
No ✓ |
Mutate existing event_outbox rows |
No ✓ |
Enable queue.worker globally |
No (default false) ✓ |
15/15 forbiddens observed.
Backup parity
| File |
Bytes |
| Pre |
82,775,116 |
| Post |
82,809,926 |
| Delta |
+34,810 |
Pure substrate delta (3 tables + 3 views + 8 functions + 8 dot_config rows + 2 triggers + ~10 indexes). No data row delta beyond the 8 dot_config inserts.