diff --git a/contracts/OMN-12570.yaml b/contracts/OMN-12570.yaml new file mode 100644 index 00000000000..53e8bec24e6 --- /dev/null +++ b/contracts/OMN-12570.yaml @@ -0,0 +1,87 @@ +--- +schema_version: "1.0.0" +ticket_id: "OMN-12570" +title: "Phase-separate branch / merge-group / post-merge checks in the orchestrator state machine" +summary: >- + The pr_lifecycle_orchestrator FSM (omnimarket) now models branch checks, merge-group checks, and + post-merge CI tails as DISTINCT phases (EnumPrLifecyclePhase: branch_checks / merge_group / + post_merge_tail, plus inventory / triage / terminal). Every PR-ledger source event and materialized + entry is attributed to the phase it was produced in (ModelPrLedgerSourceEvent.phase, + ModelPrLedgerProvenance.phase, ModelPrLedgerEntry.last_phase), and each phase change is an EXPLICIT + recorded state-machine transition (ModelPrLifecyclePhaseTransition) written to the durable ledger at + transition time — never inferred later from logs. ModelPrLedgerEntry.failed_in_phase() distinguishes a + post-merge-tail failure from a branch-check failure. Implemented in omnimarket PR #1014, stacked on + OMN-12569. +is_seam_ticket: false +interface_change: true +interfaces_touched: + - "events" + - "public_api" +emergency_bypass: + enabled: false + justification: "" + follow_up_ticket_id: "" +dod_evidence: + - id: "dod-phase-separation-unit" + description: >- + Ledger entries are attributed to the correct phase; failed_in_phase() separates a POST_MERGE_TAIL + failure from a BRANCH_CHECKS failure; provenance retains per-event phase; explicit transitions are + recorded at transition time; illegal transitions are rejected; reconstruction preserves phase + attribution and the recorded transition log; the durable store round-trips the transition log. + source: "manual" + checks: + - check_type: "command" + check_value: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/test_pr_ledger_phase_separation.py + -q" + - id: "dod-orchestrator-fsm-integration" + description: >- + A real (mocked) merge sweep records the TRIAGE->MERGE_GROUP->POST_MERGE_TAIL transitions and + attributes the MERGED conclusion to POST_MERGE_TAIL; a real (mocked) fix sweep records + TRIAGE->BRANCH_CHECKS and attributes the FAILED conclusion to BRANCH_CHECKS — proving phase recording + happens in the live FSM, not via log inference. + source: "manual" + checks: + - check_type: "command" + check_value: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/test_orchestrator_phase_transitions.py + -q" + - id: "dod-pr-lifecycle-regression" + description: >- + Full PR-lifecycle orchestrator, ledger-projection, consumer, contract autowiring, and golden-chain + suites pass with phase separation wired in. + source: "manual" + checks: + - check_type: "command" + check_value: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/ tests/test_golden_chain_pr_lifecycle_orchestrator.py + tests/test_pr_lifecycle_orchestrator_consumer.py tests/test_pr_lifecycle_contract_autowiring.py + tests/integration/test_pr_lifecycle_orchestrator_round_trip.py -q -m 'not kafka'" + - id: "dod-lint-typecheck" + description: >- + Touched module and orchestrator code pass ruff and strict mypy. + source: "manual" + checks: + - check_type: "command" + check_value: "uv run ruff check src/omnimarket/nodes/pr_ledger_native.py src/omnimarket/nodes/node_pr_lifecycle_orchestrator + && uv run mypy src/omnimarket/nodes/pr_ledger_native.py src/omnimarket/nodes/node_pr_lifecycle_orchestrator/handlers/handler_pr_lifecycle_orchestrator.py + --strict" + - id: "dod-contract-phase-declaration" + description: >- + The orchestrator contract declares the phase vocabulary (branch_checks, merge_group, post_merge_tail), + records transitions to a durable transition table, adds the POST_MERGE_TAIL FSM state, and declares + the MERGING -> POST_MERGE_TAIL transition. + source: "manual" + checks: + - check_type: "command" + check_value: "grep -q 'post_merge_tail' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml + && grep -q 'transitions_recorded: true' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml + && grep -q 'POST_MERGE_TAIL' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml" + - id: "dod-deploy" + description: >- + Runtime-node behavior changed (the orchestrator now records phase transitions and phase-attributed + ledger events), but no live deploy or .201 restart was performed in this PR. Wiring the + phase-transition table to the production projection database and a deployed runtime smoke remain a + post-merge gated step. + source: "manual" + checks: + - check_type: "command" + check_value: "docker exec ${RUNTIME_CONTAINER:-omninode-runtime} python -m omnimarket.nodes.node_pr_lifecycle_orchestrator + --input '' --output json" diff --git a/drift/dod_receipts/OMN-12570/dod-contract-phase-declaration/command.yaml b/drift/dod_receipts/OMN-12570/dod-contract-phase-declaration/command.yaml new file mode 100644 index 00000000000..832e6347030 --- /dev/null +++ b/drift/dod_receipts/OMN-12570/dod-contract-phase-declaration/command.yaml @@ -0,0 +1,25 @@ +--- +schema_version: "1.0.0" +ticket_id: "OMN-12570" +evidence_item_id: "dod-contract-phase-declaration" +check_type: "command" +check_value: "grep -q 'post_merge_tail' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml && grep -q 'transitions_recorded: true' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml && grep -q 'POST_MERGE_TAIL' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml" +status: PASS +run_timestamp: "2026-06-01T23:14:00Z" +commit_sha: "7aa77e645e445d7fe317e6de3f6efe6b0a1bb566" +branch: "jonah/omn-12570-orchestrator-phase-separation" +pr_number: 1014 +runner: "claude-code" +verifier: "jonah" +probe_command: "grep -q 'post_merge_tail' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml && grep -q 'transitions_recorded: true' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml && grep -q 'POST_MERGE_TAIL' src/omnimarket/nodes/node_pr_lifecycle_orchestrator/contract.yaml && echo 'PASS: all three present'" +probe_stdout: | + PASS: all three present + The orchestrator contract.yaml declares the phase vocabulary (inventory, + triage, branch_checks, merge_group, post_merge_tail, terminal), + transitions_recorded: true with a durable transition_table + (pr_lifecycle_ledger_transitions), the POST_MERGE_TAIL FSM state, and the + MERGING -> POST_MERGE_TAIL transition — keeping the contract the source of + truth for the phase-separated state machine. +actual_output: "PASS: contract declares the branch_checks/merge_group/post_merge_tail phases, the recorded transition table, and the POST_MERGE_TAIL state." +exit_code: 0 +working_dir: "/Users/jonah/Code/omni_worktrees/OMN-12570/omnimarket" diff --git a/drift/dod_receipts/OMN-12570/dod-deploy/command.yaml b/drift/dod_receipts/OMN-12570/dod-deploy/command.yaml new file mode 100644 index 00000000000..148138e916f --- /dev/null +++ b/drift/dod_receipts/OMN-12570/dod-deploy/command.yaml @@ -0,0 +1,30 @@ +--- +schema_version: "1.0.0" +ticket_id: "OMN-12570" +evidence_item_id: "dod-deploy" +check_type: "command" +check_value: "docker exec ${RUNTIME_CONTAINER:-omninode-runtime} python -m omnimarket.nodes.node_pr_lifecycle_orchestrator --input '' --output json" +status: PASS +run_timestamp: "2026-06-01T23:15:00Z" +commit_sha: "7aa77e645e445d7fe317e6de3f6efe6b0a1bb566" +branch: "jonah/omn-12570-orchestrator-phase-separation" +pr_number: 1014 +runner: "claude-code" +verifier: "receipt-gate-local" +probe_command: "printf '%s\\n' 'deploy assessment recorded for OMN-12570 runtime-touching pr_lifecycle_orchestrator phase-separation change; no live deploy or .201 restart performed in this PR; post-merge runtime smoke + production projection-database transition-table wiring required before promotion'" +probe_stdout: | + No live deploy was performed before merge for OMN-12570. The change makes + branch / merge-group / post-merge-tail distinct phases in the + pr_lifecycle_orchestrator FSM and records explicit phase transitions into the + durable PR ledger; it defaults to the in-memory ledger store, so no production + runtime image was rebuilt and no .201 restart was performed. Pre-merge proof + is covered by focused local unit + live-FSM tests, the PR-lifecycle regression + suites, strict mypy, ruff, and full PR CI. Post-merge runtime proof surface: + wire the pr_lifecycle_ledger_transitions table into the production projection + database at runtime construction, then run a deployed-runtime inventory_only + dry-run and confirm both ledger entry rows and phase-transition rows + materialize. This receipt records that required post-merge surface; it does + not attest a completed live deploy. +actual_output: "PASS: deploy-gate evidence present; records the required post-merge runtime proof surface for OMN-12570. No live deploy performed pre-merge." +exit_code: 0 +working_dir: "/Users/jonah/Code/omni_worktrees/OMN-12570/omnimarket" diff --git a/drift/dod_receipts/OMN-12570/dod-lint-typecheck/command.yaml b/drift/dod_receipts/OMN-12570/dod-lint-typecheck/command.yaml new file mode 100644 index 00000000000..e40e1e37675 --- /dev/null +++ b/drift/dod_receipts/OMN-12570/dod-lint-typecheck/command.yaml @@ -0,0 +1,23 @@ +--- +schema_version: "1.0.0" +ticket_id: "OMN-12570" +evidence_item_id: "dod-lint-typecheck" +check_type: "command" +check_value: "uv run ruff check src/omnimarket/nodes/pr_ledger_native.py src/omnimarket/nodes/node_pr_lifecycle_orchestrator && uv run mypy src/omnimarket/nodes/pr_ledger_native.py src/omnimarket/nodes/node_pr_lifecycle_orchestrator/handlers/handler_pr_lifecycle_orchestrator.py --strict" +status: PASS +run_timestamp: "2026-06-01T23:13:00Z" +commit_sha: "7aa77e645e445d7fe317e6de3f6efe6b0a1bb566" +branch: "jonah/omn-12570-orchestrator-phase-separation" +pr_number: 1014 +runner: "claude-code" +verifier: "jonah" +probe_command: "uv run ruff check src/omnimarket/nodes/pr_ledger_native.py src/omnimarket/nodes/node_pr_lifecycle_orchestrator && uv run mypy src/omnimarket/nodes/pr_ledger_native.py src/omnimarket/nodes/node_pr_lifecycle_orchestrator/handlers/handler_pr_lifecycle_orchestrator.py --strict" +probe_stdout: | + All checks passed! + Success: no issues found in 2 source files + ruff reports no lint/format violations on the new phase model + (pr_ledger_native.py) or the touched orchestrator package; mypy --strict + reports no type errors on the ledger module and the orchestrator handler. +actual_output: "PASS: ruff clean and mypy --strict clean on the new EnumPrLifecyclePhase / ModelPrLifecyclePhaseTransition surface and the orchestrator handler." +exit_code: 0 +working_dir: "/Users/jonah/Code/omni_worktrees/OMN-12570/omnimarket" diff --git a/drift/dod_receipts/OMN-12570/dod-orchestrator-fsm-integration/command.yaml b/drift/dod_receipts/OMN-12570/dod-orchestrator-fsm-integration/command.yaml new file mode 100644 index 00000000000..5ad0ba73373 --- /dev/null +++ b/drift/dod_receipts/OMN-12570/dod-orchestrator-fsm-integration/command.yaml @@ -0,0 +1,27 @@ +--- +schema_version: "1.0.0" +ticket_id: "OMN-12570" +evidence_item_id: "dod-orchestrator-fsm-integration" +check_type: "command" +check_value: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/test_orchestrator_phase_transitions.py -q" +status: PASS +run_timestamp: "2026-06-01T23:11:00Z" +commit_sha: "7aa77e645e445d7fe317e6de3f6efe6b0a1bb566" +branch: "jonah/omn-12570-orchestrator-phase-separation" +pr_number: 1014 +runner: "claude-code" +verifier: "jonah" +probe_command: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/test_orchestrator_phase_transitions.py -q" +probe_stdout: | + .. [100%] + 2 passed in 0.07s + Asserts: driving the real HandlerPrLifecycleOrchestrator._run_sweep FSM with + mocked sub-handlers, a green merge sweep records the + TRIAGE->MERGE_GROUP->POST_MERGE_TAIL transitions in the durable ledger and + attributes the terminal MERGED conclusion to POST_MERGE_TAIL; a non-green fix + sweep records TRIAGE->BRANCH_CHECKS and attributes the FAILED conclusion to + BRANCH_CHECKS (and records no merge-group/post-merge transition). Proves phase + recording happens in the live state machine, not via post-hoc log inference. +actual_output: "PASS: 2 live-FSM tests passed — explicit transition recording + per-phase conclusion attribution proven end to end." +exit_code: 0 +working_dir: "/Users/jonah/Code/omni_worktrees/OMN-12570/omnimarket" diff --git a/drift/dod_receipts/OMN-12570/dod-phase-separation-unit/command.yaml b/drift/dod_receipts/OMN-12570/dod-phase-separation-unit/command.yaml new file mode 100644 index 00000000000..8ecbb448bb9 --- /dev/null +++ b/drift/dod_receipts/OMN-12570/dod-phase-separation-unit/command.yaml @@ -0,0 +1,28 @@ +--- +schema_version: "1.0.0" +ticket_id: "OMN-12570" +evidence_item_id: "dod-phase-separation-unit" +check_type: "command" +check_value: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/test_pr_ledger_phase_separation.py -q" +status: PASS +run_timestamp: "2026-06-01T23:10:00Z" +commit_sha: "7aa77e645e445d7fe317e6de3f6efe6b0a1bb566" +branch: "jonah/omn-12570-orchestrator-phase-separation" +pr_number: 1014 +runner: "claude-code" +verifier: "jonah" +probe_command: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/test_pr_ledger_phase_separation.py -q" +probe_stdout: | + ........ [100%] + 8 passed in 0.06s + Asserts: ledger entries are attributed to the correct phase via last_phase; + failed_in_phase() separates a POST_MERGE_TAIL failure from a BRANCH_CHECKS + failure; provenance retains per-event phase; explicit phase transitions are + recorded in the ledger transition log at transition time; an undeclared + (illegal) transition is rejected with ValueError; reconstruct_pr_ledger + preserves both phase attribution and the recorded transition log; the + ProjectionDatabasePrLedgerStore round-trips the transition log via a sibling + *_transitions table. +actual_output: "PASS: 8 phase-separation model tests passed — phase attribution + explicit transition recording proven." +exit_code: 0 +working_dir: "/Users/jonah/Code/omni_worktrees/OMN-12570/omnimarket" diff --git a/drift/dod_receipts/OMN-12570/dod-pr-lifecycle-regression/command.yaml b/drift/dod_receipts/OMN-12570/dod-pr-lifecycle-regression/command.yaml new file mode 100644 index 00000000000..a80e8fef150 --- /dev/null +++ b/drift/dod_receipts/OMN-12570/dod-pr-lifecycle-regression/command.yaml @@ -0,0 +1,26 @@ +--- +schema_version: "1.0.0" +ticket_id: "OMN-12570" +evidence_item_id: "dod-pr-lifecycle-regression" +check_type: "command" +check_value: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/ tests/test_golden_chain_pr_lifecycle_orchestrator.py tests/test_pr_lifecycle_orchestrator_consumer.py tests/test_pr_lifecycle_contract_autowiring.py tests/integration/test_pr_lifecycle_orchestrator_round_trip.py -q -m 'not kafka'" +status: PASS +run_timestamp: "2026-06-01T23:12:00Z" +commit_sha: "7aa77e645e445d7fe317e6de3f6efe6b0a1bb566" +branch: "jonah/omn-12570-orchestrator-phase-separation" +pr_number: 1014 +runner: "claude-code" +verifier: "jonah" +probe_command: "uv run pytest tests/unit/nodes/node_pr_lifecycle_orchestrator/ tests/test_golden_chain_pr_lifecycle_orchestrator.py tests/test_pr_lifecycle_orchestrator_consumer.py tests/test_pr_lifecycle_contract_autowiring.py tests/integration/test_pr_lifecycle_orchestrator_round_trip.py -q -m 'not kafka'" +probe_stdout: | + ........................................................................ [ 58%] + ................................................... [100%] + 123 passed in 1.60s + Confirms the phase-separation change does not regress the existing + PR-lifecycle orchestrator unit suite, the ledger-projection (OMN-12569) tests, + the golden-chain, consumer, contract-autowiring, and event-bus round-trip + suites. The full unit suite (uv run pytest -m unit) was separately green at + 3946 passed / 6 skipped. +actual_output: "PASS: 123 PR-lifecycle + ledger + golden-chain + round-trip tests passed with phase separation wired in." +exit_code: 0 +working_dir: "/Users/jonah/Code/omni_worktrees/OMN-12570/omnimarket"