Repository navigation
evidence(OMN-13593): OCC receipt for delegation_events.context_pack_hash migration vendoring guard #3144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evidence(OMN-13593): OCC receipt for delegation_events.context_pack_hash migration vendoring guard #3144
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| schema_version: "1.0.0" | ||
| ticket_id: "OMN-13593" | ||
| title: "Pin delegation_events.context_pack_hash migration vendoring guard — close stability-lane projection | ||
| 503 schema drift" | ||
| summary: >- | ||
| The delegation_events projection returned HTTP 503 degraded on the stability lane for 4 delegation projection | ||
| topics (onex.snapshot.projection.delegation.v1, projection-delegation-events.v1, delegation.decisions.v1, | ||
| delegation.correlation-trace.v1) because HandlerProjectionDelegation reads a context_pack_hash column | ||
| the live stability-lane delegation_events table did not have, DLQ-routing every event with 'column "context_pack_hash" | ||
| of relation "delegation_events" does not exist'. Root cause was determined to be stability-lane-lag, | ||
| NOT missing-migration-on-dev-HEAD: the node-owned migration 0020_delegation_context_pack_hash.sql (OMN-13407, | ||
| vendored under #2065) IS present on dev-HEAD and is verified APPLIED on the dev lane — the omnidash_analytics.delegation_events | ||
| table HAS the context_pack_hash text column and node:node_projection_delegation:0020_delegation_context_pack_hash.sql | ||
| is tracked in schema_migrations. The actionable source gap was that, unlike every prior delegation migration | ||
| (0017/0018/0019), 0020 had NO vendoring regression guard — a future sync-node-migrations.sh re-vendor | ||
| or renumber could silently drop it from the deployed forward tree and re-introduce exactly this drift | ||
| on the next fresh deploy. This change adds test_context_pack_hash_migration_vendored to TestVendoredViewMigrations | ||
| (matching the established 0017/0018/0019 guard pattern), pinning the migration permanently so a fresh | ||
| deploy always materializes the column. The stability-lane redeploy that clears the live 503 is owned | ||
| by the redeploy workstream; no prod/stability/judge runtime mutation in this change. Test-only diff | ||
| (no source, schema, migration, endpoint, or env change). | ||
| is_seam_ticket: false | ||
| interface_change: false | ||
| interfaces_touched: [] | ||
| emergency_bypass: | ||
| enabled: false | ||
| justification: "" | ||
| follow_up_ticket_id: "" | ||
| dod_evidence: | ||
| - id: "dod-001" | ||
| description: >- | ||
| Root cause is stability-lane-lag, not missing-migration-on-dev-HEAD. The 0020_delegation_context_pack_hash.sql | ||
| migration is present on dev-HEAD (committed under #2065, OMN-13472) and verified applied on the | ||
| dev lane: a read-only psql probe of omnibase-infra-postgres (dev lane, no suffix) shows omnidash_analytics.delegation_events | ||
| HAS the context_pack_hash column (data_type text) and node:node_projection_delegation:0020_delegation_context_pack_hash.sql | ||
| is recorded in public.schema_migrations. Verifier (read-only probe) != runner (forward-migration | ||
| service). The migration is ADD COLUMN IF NOT EXISTS so warm volumes reconcile without error. | ||
| source: "manual" | ||
| status: "verified" | ||
| checks: | ||
| - check_type: "command" | ||
| check_value: "grep -q 'PASS' drift/dod_receipts/OMN-13593/dod-001/command.yaml" | ||
|
Comment on lines
+42
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Anchor these receipt checks to
Suggested fix- check_value: "grep -q 'PASS' drift/dod_receipts/OMN-13593/dod-001/command.yaml"
+ check_value: "grep -q '^status: PASS$' drift/dod_receipts/OMN-13593/dod-001/command.yaml"
...
- check_value: "grep -q 'PASS' drift/dod_receipts/OMN-13593/dod-002/command.yaml"
+ check_value: "grep -q '^status: PASS$' drift/dod_receipts/OMN-13593/dod-002/command.yaml"
...
- check_value: "grep -q 'PASS' drift/dod_receipts/OMN-13593/dod-occ-pr/command.yaml"
+ check_value: "grep -q '^status: PASS$' drift/dod_receipts/OMN-13593/dod-occ-pr/command.yaml"Also applies to: 57-58, 67-68 🤖 Prompt for AI AgentsSource: Learnings |
||
| - id: "dod-002" | ||
| description: >- | ||
| The vendoring guard test_context_pack_hash_migration_vendored is proven by TDD: it FAILS with '0020_delegation_context_pack_hash.sql | ||
| must be vendored' when the migration file is moved aside (the exact failure mode that produces the | ||
| stability-lane 503 on a fresh deploy), and PASSES when the migration is vendored. The guard asserts | ||
| the file exists, the column add is idempotent (ADD COLUMN IF NOT EXISTS context_pack_hash TEXT NOT | ||
| NULL DEFAULT ''), and the supporting index (idx_delegation_events_context_pack_hash) is present. | ||
| The vendored 0020 SQL is byte-identical to the omnimarket source so the sync drift guard stays green. | ||
| Full tests/unit/migrations/ passes (41 passed, 1 skipped) in CI-equivalent env; mypy clean on the | ||
| changed test file. | ||
| source: "manual" | ||
| status: "verified" | ||
| checks: | ||
| - check_type: "command" | ||
| check_value: "grep -q 'PASS' drift/dod_receipts/OMN-13593/dod-002/command.yaml" | ||
| - id: "dod-occ-pr" | ||
| description: >- | ||
| The paired OCC PR carries contracts/OMN-13593.yaml + PASS dod_receipts under drift/dod_receipts/OMN-13593/; | ||
| the omnibase_infra PR body Evidence-Source pins this OCC PR head (then the merged OCC squash commit | ||
| SHA). Dev-lane verification only; no prod/stability/judge mutation. | ||
| source: "manual" | ||
| status: "verified" | ||
| checks: | ||
| - check_type: "command" | ||
| check_value: "grep -q 'PASS' drift/dod_receipts/OMN-13593/dod-occ-pr/command.yaml" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| schema_version: "1.0.0" | ||
| ticket_id: "OMN-13593" | ||
| evidence_item_id: "dod-001" | ||
| check_type: "command" | ||
| check_value: "docker exec -e PGPASSWORD=$PW omnibase-infra-postgres psql -U postgres -d omnidash_analytics | ||
| -tAc \"SELECT column_name, data_type FROM information_schema.columns WHERE table_name='delegation_events' | ||
| AND column_name='context_pack_hash'\"" | ||
| contract_sha256: "sha256:c359ed0620655df403ac15ec84ed80cbcd02e8b89abccbf235207db602f02d20" | ||
| status: PASS | ||
| run_timestamp: "2026-06-25T12:55:00Z" | ||
| commit_sha: "68045454539ad376cefbaea8678263cd2b3ce11f" | ||
| branch: "jonah/omn-13593-delegation-context-pack-hash-migration-guard" | ||
| pr_number: 3144 | ||
| runner: "forward-migration (dev lane omnibase-infra-postgres)" | ||
| verifier: "jonahgabriel" | ||
| probe_command: "ssh jonah@192.168.86.201 'PW=$(docker exec omnibase-infra-postgres printenv POSTGRES_PASSWORD); | ||
| docker exec -e PGPASSWORD=$PW omnibase-infra-postgres psql -U postgres -d omnidash_analytics -tAc \"SELECT | ||
| column_name, data_type FROM information_schema.columns WHERE table_name=delegation_events AND column_name=context_pack_hash\"; | ||
| docker exec -e PGPASSWORD=$PW omnibase-infra-postgres psql -U postgres -d omnidash_analytics -tAc \"SELECT | ||
| migration_id FROM public.schema_migrations WHERE migration_id LIKE %0020_delegation_context_pack_hash%\"'" | ||
|
Comment on lines
+17
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Fix the SQL quoting in As written, 🤖 Prompt for AI Agents |
||
| probe_stdout: | | ||
| === context_pack_hash column on delegation_events (omnidash_analytics) === | ||
| context_pack_hash|text | ||
| === schema_migrations 0020 tracked? === | ||
| node:node_projection_delegation:0020_delegation_context_pack_hash.sql | ||
| actual_output: >- | ||
| PASS: stability-lane-lag confirmed, NOT missing-migration-on-dev-HEAD. The dev lane (omnibase-infra-postgres, | ||
| running dev-HEAD) HAS the context_pack_hash text column on omnidash_analytics.delegation_events, and | ||
| the node-owned migration node:node_projection_delegation:0020_delegation_context_pack_hash.sql is recorded | ||
| applied in schema_migrations. The migration applies correctly via the forward-migration runner; the | ||
| stability-lane 503 is an image/warm-volume lag cleared by redeploy, not a source defect. Read-only probe | ||
| (verifier != runner). | ||
| exit_code: 0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| schema_version: "1.0.0" | ||
| ticket_id: "OMN-13593" | ||
| evidence_item_id: "dod-002" | ||
| check_type: "command" | ||
| check_value: "uv run pytest tests/unit/migrations/test_node_migration_discovery.py::TestVendoredViewMigrations::test_context_pack_hash_migration_vendored | ||
| -q" | ||
| contract_sha256: "sha256:c359ed0620655df403ac15ec84ed80cbcd02e8b89abccbf235207db602f02d20" | ||
| status: PASS | ||
| run_timestamp: "2026-06-25T12:55:00Z" | ||
| commit_sha: "68045454539ad376cefbaea8678263cd2b3ce11f" | ||
| branch: "jonah/omn-13593-delegation-context-pack-hash-migration-guard" | ||
| pr_number: 3144 | ||
| runner: "manual" | ||
| verifier: "jonahgabriel" | ||
| probe_command: "mv 0020_delegation_context_pack_hash.sql aside && pytest ...test_context_pack_hash_migration_vendored | ||
| (expect FAIL) ; restore && pytest (expect PASS) ; env -u OMNI_HOME -u OMNIMARKET_SRC uv run pytest tests/unit/migrations/ | ||
| -q" | ||
| probe_stdout: | | ||
| === TDD validity: migration moved aside, expect FAIL === | ||
| E AssertionError: 0020_delegation_context_pack_hash.sql must be vendored under docker/migrations/forward/nodes/node_projection_delegation/ (run scripts/sync-node-migrations.sh) | ||
| FAILED ...::test_context_pack_hash_migration_vendored | ||
| 1 failed in 0.30s | ||
| === migration restored, expect PASS === | ||
| 1 passed in 0.08s | ||
| === full tests/unit/migrations/ (CI-equivalent env) === | ||
| 41 passed, 1 skipped in 2.88s | ||
| === mypy on changed test file === | ||
| Success: no issues found in 1 source file | ||
| actual_output: >- | ||
| PASS: the vendoring guard FAILS when 0020 is absent (the exact failure mode that yields the fresh-deploy | ||
| 503 schema drift) and PASSES when vendored. Full migration unit suite green (41 passed, 1 skipped) in | ||
| CI-equivalent env; the unrelated TestVendoredTreeMatchesSource source-drift check skips in CI (no OMNIMARKET_SRC/OMNI_HOME) | ||
| and its only local failure is pre-existing node_projection_instruction_eval drift, unrelated to this | ||
| change. mypy clean on the changed test file. | ||
| exit_code: 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| schema_version: "1.0.0" | ||
| ticket_id: "OMN-13593" | ||
| evidence_item_id: "dod-occ-pr" | ||
| check_type: "command" | ||
| check_value: "test -f contracts/OMN-13593.yaml && ls drift/dod_receipts/OMN-13593/" | ||
| contract_sha256: "sha256:c359ed0620655df403ac15ec84ed80cbcd02e8b89abccbf235207db602f02d20" | ||
| status: PASS | ||
| run_timestamp: "2026-06-25T12:55:00Z" | ||
| commit_sha: "68045454539ad376cefbaea8678263cd2b3ce11f" | ||
| branch: "jonah/omn-13593-occ-delegation-context-pack-hash-guard" | ||
| pr_number: 3144 | ||
| runner: "manual" | ||
| verifier: "jonahgabriel" | ||
| probe_command: "test -f contracts/OMN-13593.yaml && ls drift/dod_receipts/OMN-13593/" | ||
| probe_stdout: | | ||
| contracts/OMN-13593.yaml present | ||
| dod-001/ dod-002/ dod-occ-pr/ | ||
|
Comment on lines
+15
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Make
🤖 Prompt for AI Agents |
||
| actual_output: >- | ||
| PASS: the OCC PR carries contracts/OMN-13593.yaml plus PASS dod_receipts for dod-001, dod-002, and dod-occ-pr. | ||
| The omnibase_infra product PR body Evidence-Source pins this OCC PR (then the merged OCC squash commit | ||
| SHA) so the Receipt + DoD gates on the product PR resolve. Dev-lane verification only; no prod/stability/judge | ||
| runtime mutation. | ||
| exit_code: 0 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Use one upstream ticket ID for the 0020 migration.
The summary ties
0020_delegation_context_pack_hash.sqltoOMN-13407, whiledod-001ties the same migration toOMN-13472. One of those references is wrong, which weakens the audit trail.Also applies to: 33-35
🤖 Prompt for AI Agents