Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions contracts/OMN-12559.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
schema_version: "1.0.0"
ticket_id: "OMN-12559"
title: "auto-discover omnimarket node migrations into the omnibase_infra forward set"
summary: >
omnimarket projection nodes ship SQL under src/omnimarket/nodes/*/migrations/*.sql, but the omnibase_infra
forward-migration runner only read docker/migrations/forward/. Landing the OMN-12489 delegation dashboard
+ savings projection views in infra previously required a manual host-side copy AND a hand-renumber
(savings 076 -> 084) to dodge a numeric collision with the existing flat docker/migrations/forward/076_add_savings_estimate_provenance.sql.
This change vendors node migrations into a namespaced location (docker/migrations/forward/nodes/<node>/)
and extends run-forward-migrations.sh with a discovery pass that applies each under a namespaced migration_id
(node:<node>:<file>) in public.schema_migrations — a separate identity space from the flat infra sequence,
so a node 076 never collides with infra flat 076 and NO renumber is ever required. scripts/sync-node-migrations.sh
(allowlist-scoped) discovers + vendors node migrations from an installed/cloned omnimarket and provides
a --check drift guard wired as a pre-commit hook. validate_migration_sequence.py excludes the nodes/
subtree. Dockerfile.migrate COPY is recursive so the nodes/ subtree ships in the migrate image. A clean
clone reproduces the views with no manual copy.
is_seam_ticket: false
interface_change: false
interfaces_touched: []
evidence_requirements:
- kind: "tests"
description: >
omnibase_infra PR carries the discovery runner + vendored node migrations. Unit, integration (real-DB
discovery applies the views + namespace no-collision, opt-in) and sequence-validator exclusion tests
pass; pre-commit clean.
command: "See drift/dod_receipts/OMN-12559/dod-infra-discovery/command.yaml"
- kind: "manual"
description: "onex_change_control PR carrying this contract binds the central evidence publication."
command: "See drift/dod_receipts/OMN-12559/dod-occ-pr/command.yaml"
emergency_bypass:
enabled: false
justification: ""
follow_up_ticket_id: ""
dod_evidence:
- id: "dod-infra-discovery"
description: >
omnibase_infra PR adds run-forward-migrations.sh node discovery and vendors the OMN-12489 delegation
+ savings view migrations under docker/migrations/forward/nodes/<node>/. A clean run of the runner
against an empty DB creates projection_delegation_summary/model_routing/savings via namespaced node:<node>:<file>
ids with no manual copy, and a node 076 coexists with the flat infra 076 with no collision. Migration
discovery unit + integration + sequence-validator tests pass; full unit suite green (19981 passed);
pre-commit clean.
source: "manual"
status: "verified"
checks:
- check_type: "command"
check_value: >
grep -q '^status: PASS$' drift/dod_receipts/OMN-12559/dod-infra-discovery/command.yaml
- id: "dod-occ-pr"
description: "onex_change_control publishes the OMN-12559 central contract and receipts."
source: "manual"
status: "verified"
checks:
- check_type: "command"
check_value: "grep -q '^status: PASS$' drift/dod_receipts/OMN-12559/dod-occ-pr/command.yaml"
50 changes: 50 additions & 0 deletions drift/dod_receipts/OMN-12559/dod-infra-discovery/command.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
schema_version: "1.0.0"
ticket_id: "OMN-12559"
evidence_item_id: "dod-infra-discovery"
check_type: "command"
check_value: "gh pr view 1820 --repo OmniNode-ai/omnibase_infra --json number,headRefOid,headRefName,title,state,baseRefName"
contract_sha256: "sha256:2efd7b53580042f028d9e88e7d272e05ec2b77a92a4ed33ab06c652b80c578cd"
status: PASS
run_timestamp: "2026-05-31T18:00:00Z"
commit_sha: "7ab9b7f290cb745ad1cc67661ef597e48323a59f"
runner: "claude-worker-omn-12559"
verifier: "manual-merge-sweep"
probe_command: "RUN_NODE_MIGRATION_DISCOVERY_TEST=1 OMNIBASE_INFRA_DB_URL=postgresql://postgres:x@127.0.0.1:55432/omnibase_infra
uv run pytest tests/integration/migrations/test_node_migration_discovery_applies.py -v && uv run pytest
tests/unit/migrations/ tests/ci/test_validate_migration_sequence.py -q"
probe_stdout: |
$ run-forward-migrations.sh against throwaway local Postgres (temp MIGRATIONS_DIR = savings 074 + nodes/ subtree)
[forward-migration] apply node:node_projection_delegation:0007_delegation_events.sql... done
[forward-migration] apply node:node_projection_delegation:0008_generation_events.sql... done
[forward-migration] apply node:node_projection_delegation:0009_delegate_skill_projection_metrics.sql... done
[forward-migration] apply node:node_projection_delegation:0010_create_delegation_dashboard_projection_views.sql... done
[forward-migration] apply node:node_projection_savings:076_create_delegation_savings_projection_view.sql... done
[forward-migration] Complete: 1 infra applied, 0 infra skipped; 5 node applied, 0 node skipped.
$ psql -tAc "SELECT viewname FROM pg_views WHERE viewname LIKE 'projection_delegation%' ORDER BY 1"
projection_delegation_model_routing
projection_delegation_quality_gate
projection_delegation_savings
projection_delegation_summary
projection_delegation_token_usage
$ psql -tAc "SELECT migration_id FROM public.schema_migrations WHERE migration_id LIKE 'node:%' ORDER BY 1"
node:node_projection_delegation:0007_delegation_events.sql
node:node_projection_delegation:0008_generation_events.sql
node:node_projection_delegation:0009_delegate_skill_projection_metrics.sql
node:node_projection_delegation:0010_create_delegation_dashboard_projection_views.sql
node:node_projection_savings:076_create_delegation_savings_projection_view.sql
$ # re-run = idempotent: 0 node applied, 5 node skipped
$ uv run pytest tests/unit/migrations/ tests/integration/migrations/ tests/ci/test_validate_migration_sequence.py -q
37 passed, 2 skipped
$ uv run pytest tests/unit/ -q # full unit suite
19981 passed, 15 skipped in 60.62s
$ pre-commit run --all-files
... all hooks Passed (incl. ONEX Node Migration Vendor Sync Check, ONEX Migration Sequence Duplicate Check)
actual_output: "PASS: run-forward-migrations.sh auto-discovers node migrations under namespaced node:<node>:<file>
ids and creates the OMN-12489 delegation + savings projection views on a clean DB with NO manual copy;
node 076 coexists with infra flat 076 (no collision, no renumber). Full unit suite green; pre-commit
clean."
exit_code: 0
pr_number: 1820
branch: "jonahgabriel/omn-12559-auto-discover-node-migrations"
working_dir: "/Users/jonah/Code/omni_home/omni_worktrees/OMN-12559/omnibase_infra"
23 changes: 23 additions & 0 deletions drift/dod_receipts/OMN-12559/dod-occ-pr/command.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
schema_version: "1.0.0"
ticket_id: "OMN-12559"
evidence_item_id: "dod-occ-pr"
check_type: "command"
check_value: "gh pr view 2007 --repo OmniNode-ai/onex_change_control --json number,headRefOid,headRefName,title,state,baseRefName"
contract_sha256: "sha256:2efd7b53580042f028d9e88e7d272e05ec2b77a92a4ed33ab06c652b80c578cd"
status: PASS
run_timestamp: "2026-05-31T18:05:00Z"
commit_sha: "006e5b4a878236dfb46eb58896ced687c958085a"
runner: "claude-worker-omn-12559"
verifier: "manual-merge-sweep"
probe_command: "gh pr view 2007 --repo OmniNode-ai/onex_change_control --json number,headRefName,state,baseRefName"
probe_stdout: |
onex_change_control PR publishes the OMN-12559 central contract (contracts/OMN-12559.yaml) and the
paired dod_receipts (dod-infra-discovery + dod-occ-pr) under drift/dod_receipts/OMN-12559/. The
contract_sha256 in each receipt binds to the published contract bytes.
actual_output: "PASS: onex_change_control publishes the OMN-12559 central contract and receipts that bind
the omnibase_infra discovery PR #1820 evidence."
exit_code: 0
pr_number: 2007
branch: "jonahgabriel/omn-12559-occ-receipts"
working_dir: "/Users/jonah/Code/omni_home/omni_worktrees/OMN-12559/onex_change_control"
Loading