Skip to content

test(OMN-13593): pin delegation_events.context_pack_hash migration vendoring guard - #2110

Merged
jonahgabriel merged 2 commits into
devfrom
jonah/omn-13593-delegation-context-pack-hash-migration-guard
Jun 26, 2026
Merged

jonahgabriel merged 2 commits into
devfrom
jonah/omn-13593-delegation-context-pack-hash-migration-guard

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

OMN-13593 — delegation_events projection 503: pin context_pack_hash migration vendoring guard

Closes the schema-drift class that DLQ'd 4 delegation projection topics on the stability lane with column "context_pack_hash" of relation "delegation_events" does not exist and returned HTTP 503 degraded.

Root cause: 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 verified applied on the dev lane (read-only psql probe of omnibase-infra-postgres):

  • omnidash_analytics.delegation_events HAS the context_pack_hash column (text)
  • node:node_projection_delegation:0020_delegation_context_pack_hash.sql is tracked in public.schema_migrations

So the migration applies correctly via the forward-migration runner; the stability-lane 503 is an image/warm-volume lag the redeploy workstream clears — not a source defect.

What this PR changes (source)

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 this exact drift on the next fresh deploy. This PR adds test_context_pack_hash_migration_vendored to TestVendoredViewMigrations, pinning the migration permanently so a fresh deploy always materializes the column.

  • Proven by TDD: FAILS with 0020_delegation_context_pack_hash.sql must be vendored when the migration is moved aside (the exact fresh-deploy failure mode), PASSES when vendored.
  • Asserts the file exists, the column add is idempotent (ADD COLUMN IF NOT EXISTS context_pack_hash TEXT NOT NULL DEFAULT '' — warm volumes reconcile), and the supporting index is present.
  • Full tests/unit/migrations/ green (41 passed, 1 skipped) in CI-equivalent env; mypy clean on the changed test file. Test-only diff.

DoD note

DoD item 3 (4 topics return HTTP 200 on fresh redeploy) is a runtime redeploy owned by the redeploy workstream on a lane running the full projection API stack (stability/prod). This PR lands the source-side permanent guard + the dev-lane root-cause proof; no prod/stability/judge runtime mutation here.

Evidence-Source: OCC#3144
Evidence-Ticket: OMN-13593

Paired OCC receipt PR: OmniNode-ai/onex_change_control#3144 (contracts/OMN-13593.yaml + PASS dod_receipts).

…ndoring guard

The 0020_delegation_context_pack_hash.sql node-owned migration (OMN-13407)
adds context_pack_hash to the canonical delegation_events table so the 4
delegation projection topics can read it. Without a vendoring guard, a future
sync-node-migrations.sh re-vendor or renumber could silently drop the migration
from the deployed forward tree — re-introducing the exact stability-lane drift
this ticket reports (HandlerProjectionDelegation DLQs every event with
'column context_pack_hash of relation delegation_events does not exist',
projection API returns HTTP 503 degraded on delegation/projection-delegation-events/
delegation.decisions/delegation.correlation-trace topics).

Adds test_context_pack_hash_migration_vendored to TestVendoredViewMigrations,
matching the existing 0017/0018/0019 vendoring-guard pattern: asserts the file
is vendored, the column add is idempotent (ADD COLUMN IF NOT EXISTS ... DEFAULT '')
so warm volumes reconcile, and the supporting index is present. Proven to FAIL
when the migration is absent and PASS when vendored (TDD).

Root cause is stability-lane-lag, not missing-migration-on-dev-HEAD: the migration
is present on dev-HEAD (#2065) and 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.
@jonahgabriel
jonahgabriel enabled auto-merge June 26, 2026 00:35
@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@jonahgabriel, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 44 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d90a8d6f-d643-4887-aba4-e92d80b4e9ea

📥 Commits

Reviewing files that changed from the base of the PR and between 6d99d5b and de96585.

📒 Files selected for processing (2)
  • docker/migrations/forward/nodes/node_projection_instruction_eval/0001_create_instruction_eval_aggregate_snapshots.sql
  • tests/unit/migrations/test_node_migration_discovery.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-13593-delegation-context-pack-hash-migration-guard

Comment @coderabbitai help to get the list of available commands.

@jonahgabriel
jonahgabriel added this pull request to the merge queue Jun 26, 2026
@jonahgabriel
jonahgabriel removed this pull request from the merge queue due to a manual request Jun 26, 2026
@jonahgabriel
jonahgabriel added this pull request to the merge queue Jun 26, 2026
Merged via the queue into dev with commit b946498 Jun 26, 2026
81 of 82 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-13593-delegation-context-pack-hash-migration-guard branch June 26, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant