Skip to content

test(OMN-10400): prove orchestrated merge sweep and session baseline - #465

Merged
jonahgabriel merged 33 commits into
mainfrom
jonah/omn-10400-real-surfaces-cli-output
Apr 30, 2026
Merged

jonahgabriel merged 33 commits into
mainfrom
jonah/omn-10400-real-surfaces-cli-output

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Ticket

OMN-10400

Summary

  • Add a packaged orchestrated merge-sweep workflow proof that runs compute -> triage -> effects -> outcome classify -> reducer.
  • Fix CI reruns by extracting the GitHub Actions workflow run id from check URLs instead of the job id.
  • Strengthen session_orchestrator market baseline from a phase-1 CLI smoke to deterministic Phase 2 scoring plus Phase 3 dispatch artifact compilation.
  • Add Codex runtime request adapter proofs for every market-owned baseline surface: aislop_sweep, pr_lifecycle_orchestrator/merge-sweep, pr_polish, local_review, coderabbit_triage, session_bootstrap, session_orchestrator, and ticket_pipeline.
  • Update ticket_pipeline focused tests for the typed CLI report shape and regenerate the market skill baseline at 8/8 working.

Live proof

  • uv run python scripts/run_orchestrated_merge_sweep_workflow.py --repos OmniNode-ai/omnimarket --execute
  • Result after fix: ci_rerun=1, armed=2, failed=0, terminal_emitted=True.

Runtime adapter coverage now in baseline

  • aislop_sweep: adapter dispatch scans a controlled repo and returns real findings.
  • pr_lifecycle_orchestrator / merge-sweep: adapter dispatch runs the real PR lifecycle FSM with deterministic sub-handlers and writes merge-sweep/<run_id>/result.json.
  • pr_polish: adapter dispatch runs the pure polish FSM to done.
  • local_review: adapter dispatch runs the pure review FSM to done.
  • coderabbit_triage: adapter dispatch runs real CodeRabbit classification over deterministic GraphQL review-thread shapes.
  • session_bootstrap: adapter dispatch runs the real handler, writes contract snapshot and cron IDs.
  • session_orchestrator: adapter dispatch runs the real handler, scores fixture Linear tickets, compiles dispatch specs, and writes durable session artifacts.
  • ticket_pipeline: adapter dispatch runs PRE_FLIGHT plus compile-only IMPLEMENT and honestly stops at unwired LOCAL_REVIEW.

Verification

  • Adapter naming correction: renamed active API from PatternBBrokerClient to CodexRuntimeRequestAdapter, removed the misleading public broker type names, and updated source plus packaged Codex skill shims to describe the handler/adapter path.
  • uv run ruff format --check src/omnimarket/adapters/codex/runtime_client.py tests/test_codex_runtime_client.py tests/test_codex_plugin_shims.py scripts/generate_adapters.py src/omnimarket/adapters/codex/topics.py -> passed
  • uv run ruff check src/omnimarket/adapters/codex/runtime_client.py tests/test_codex_runtime_client.py tests/test_codex_plugin_shims.py scripts/generate_adapters.py src/omnimarket/adapters/codex/topics.py -> passed
  • uv run pytest tests/test_codex_runtime_client.py tests/test_install_codex_skills.py tests/test_codex_plugin_shims.py -q -> 37 passed
  • uv run pytest tests/test_codex_runtime_client.py tests/test_golden_chain_ticket_pipeline.py tests/test_market_skill_smokes.py -q -> 52 passed
  • uv run pytest tests/test_codex_runtime_client.py tests/test_golden_chain_coderabbit_triage.py tests/test_market_skill_smokes.py -q -> 61 passed
  • uv run pytest tests/test_codex_runtime_client.py tests/unit/nodes/node_pr_lifecycle_orchestrator/test_main_cli.py tests/test_golden_chain_pr_lifecycle_orchestrator.py tests/test_market_skill_smokes.py -q -> 61 passed
  • uv run pytest tests/test_codex_runtime_client.py src/omnimarket/nodes/node_session_orchestrator/tests/test_handler_session_orchestrator.py tests/test_market_skill_smokes.py -q -> 60 passed
  • uv run mypy --strict src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/handlers/handler_triage.py src/omnimarket/nodes/node_session_orchestrator/handlers/handler_session_orchestrator.py src/omnimarket/market_skill_baseline.py
  • uv run python scripts/run_market_skill_baseline.py --strict --json-out docs/reference/2026-04-28-market-skill-baseline.json --markdown-out docs/reference/2026-04-28-market-skill-baseline.md -> 8 working / 0 degraded / 0 failing
  • uv run ruff check tests/test_codex_runtime_client.py src/omnimarket/market_skill_baseline.py && uv run ruff format --check tests/test_codex_runtime_client.py src/omnimarket/market_skill_baseline.py

Summary by CodeRabbit

  • New Features

    • Standalone orchestrated merge-sweep executable with live/plan modes and PR polish execution.
    • Full CLI reporting surface: typed CLI report model, renderers (text/json/yaml/markdown), registry, and output-config args.
    • Session orchestrator: deterministic Linear fixture scoring.
  • Bug Fixes

    • More accurate CI status tri-state (pass/failed/pending) for classification and gating.
  • Documentation

    • Market skill baseline timestamps and focused test targets updated.
  • Tests

    • Large suite of end-to-end and unit tests covering workflows, CLI outputs, and classification logic.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jonahgabriel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 8 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 10b89142-782b-469b-93a6-ece7fdc2ccfe

📥 Commits

Reviewing files that changed from the base of the PR and between 7c68399 and 3a51d98.

📒 Files selected for processing (40)
  • docs/reference/2026-04-28-market-skill-baseline.json
  • docs/reference/2026-04-28-market-skill-baseline.md
  • plugins/onex/skills/aislop-sweep/SKILL.md
  • plugins/onex/skills/coderabbit-triage/SKILL.md
  • plugins/onex/skills/local-review/SKILL.md
  • plugins/onex/skills/merge-sweep/SKILL.md
  • plugins/onex/skills/pr-polish/SKILL.md
  • plugins/onex/skills/session-bootstrap/SKILL.md
  • plugins/onex/skills/session-orchestrator/SKILL.md
  • plugins/onex/skills/ticket-pipeline/SKILL.md
  • scripts/generate_adapters.py
  • scripts/run_market_skill_baseline.py
  • scripts/run_orchestrated_merge_sweep_workflow.py
  • src/omnimarket/adapters/codex/README.md
  • src/omnimarket/adapters/codex/pr-lifecycle-orchestrator-instructions.md
  • src/omnimarket/adapters/codex/runtime_client.py
  • src/omnimarket/adapters/codex/skills/aislop-sweep/SKILL.md
  • src/omnimarket/adapters/codex/skills/coderabbit-triage/SKILL.md
  • src/omnimarket/adapters/codex/skills/local-review/SKILL.md
  • src/omnimarket/adapters/codex/skills/merge-sweep/SKILL.md
  • src/omnimarket/adapters/codex/skills/pr-polish/SKILL.md
  • src/omnimarket/adapters/codex/skills/session-bootstrap/SKILL.md
  • src/omnimarket/adapters/codex/skills/session-orchestrator/SKILL.md
  • src/omnimarket/adapters/codex/skills/ticket-pipeline/SKILL.md
  • src/omnimarket/adapters/codex/template.md
  • src/omnimarket/adapters/codex/topics.py
  • src/omnimarket/cli/reporting.py
  • src/omnimarket/market_skill_baseline.py
  • src/omnimarket/nodes/node_dispatch_worker/handlers/dispatch_record_writer.py
  • src/omnimarket/nodes/node_dispatch_worker/handlers/handler_dispatch_worker.py
  • src/omnimarket/nodes/node_merge_sweep_compute/__main__.py
  • src/omnimarket/nodes/node_merge_sweep_compute/handlers/handler_merge_sweep.py
  • src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/handlers/handler_triage.py
  • src/omnimarket/nodes/node_session_orchestrator/handlers/handler_session_orchestrator.py
  • tests/test_codex_plugin_shims.py
  • tests/test_codex_runtime_client.py
  • tests/test_market_skill_smokes.py
  • tests/test_no_cross_node_reach_in.py
  • tests/test_orchestrated_merge_sweep_workflow.py
  • tests/unit/nodes/node_ticket_pipeline/test_main_cli_outputs.py
📝 Walkthrough

Walkthrough

Adds a CLI reporting system with typed Pydantic models and multiple renderers, a new operator script to run the orchestrated merge-sweep workflow (with live effects and git worktree handling), tri-state PR required-check evaluation, PR-polish command emission, deterministic session orchestration fixtures, and broad test coverage and contract metadata.

Changes

Cohort / File(s) Summary
New CLI report models
src/omnimarket/models/cli_report.py
Adds immutable Pydantic CLI report models and enums for output format, verbosity, and status; models for steps, evidence, summaries, output config, and aggregate report.
CLI output system
src/omnimarket/cli/output/protocol.py, src/omnimarket/cli/output/registry.py, src/omnimarket/cli/output/handlers/handler_json.py, .../handler_yaml.py, .../handler_markdown.py, .../handler_text.py
Adds output handler protocol, registry, and four renderers (json/yaml/markdown/text); registry resolves handlers and errors on unknown formats.
CLI args & reporting adapters
src/omnimarket/cli/args.py, src/omnimarket/cli/reporting.py, src/omnimarket/cli/__init__.py, src/omnimarket/cli/output/__init__.py
Adds shared output/verbosity arg helpers and builders converting pipeline/merge-sweep results into ModelMarketCliReport; small package docstrings.
Orchestrated merge-sweep script
scripts/run_orchestrated_merge_sweep_workflow.py
New executable orchestrator that fetches PRs, runs compute->triage->reducer, optionally executes effects (auto-merge, CI rerun, rebase, polish), manages git worktrees for polish, classifies outcomes, and returns appropriate exit codes.
Node CLI entrypoints (rendering & exit codes)
src/omnimarket/nodes/node_merge_sweep_compute/__main__.py, src/omnimarket/nodes/node_ticket_pipeline/__main__.py
Entrypoints now accept argv injection, load contract metadata, support output args, build/render CLI reports, and return integer exit codes.
PR required-check tri-state
src/omnimarket/nodes/node_merge_sweep_compute/consumer.py, .../handlers/handler_merge_sweep.py
Replaces prior boolean with tri-state (pass/failed/pending); exposes required_checks_failed and required_checks_pending; classification and polish gating use new helper _checks_failed().
Triage orchestrator: PR polish emission
src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/handlers/handler_triage.py, .../models/model_triage_request.py, .../contract.yaml
Emit ModelPrPolishStartCommand for Track B when emit_pr_polish_commands true; request model gains emit_pr_polish_commands and dry_run; dedupe PR counts by (repo,pr_number); CI run ID parsing refactored and contract publish topics extended.
Sweep outcome typing & classification
src/omnimarket/nodes/node_sweep_outcome_classify/models/model_sweep_outcome.py, .../handlers/handler_outcome_classify.py
Adds EnumSweepOutcomeEventType, switches event_type fields to the enum, and adds PR_POLISH_COMPLETED classification using final_phase.
Session orchestrator determinism & state threading
src/omnimarket/nodes/node_session_orchestrator/handlers/handler_session_orchestrator.py, .../tests/test_handler_session_orchestrator.py
Adds local Linear fixture support for deterministic Phase 2 scoring; threads state_dir/parent session into dispatch workers; adds test coverage for fixture flow and state outputs.
Market skill baseline & docs
src/omnimarket/market_skill_baseline.py, docs/reference/...-market-skill-baseline.json, docs/reference/...-market-skill-baseline.md
Expands focused pytest targets to include Codex runtime E2E tests per skill; updates session orchestrator smoke outputs (dispatch_receipt_count) and ticket-pipeline reporting to use result_summary/steps.
Contracts & allowlist
contracts/OMN-10400.yaml, tests/test_no_cross_node_reach_in.py
Adds OMN-10400 contract describing the orchestrated merge-sweep workflow and evidence steps; updates cross-node reach-in allowlist baseline entry.
Tests — integration & unit
tests/test_codex_runtime_client.py, tests/test_orchestrated_merge_sweep_workflow.py, tests/test_golden_chain_*.py, tests/test_sweep_outcome_classify.py, tests/test_triage_*.py, tests/test_market_skill_smokes.py, tests/unit/cli/..., tests/unit/nodes/...
Large expansion of tests: end-to-end broker-worker installers, orchestrated workflow unit tests (worktree/prep/execute), triage/pr-polish/CI rerun tests, CLI output handler/unit tests, Pydantic model tests, and node CLI output format tests.
Minor docs/tests scaffolding
tests/unit/cli/__init__.py, tests/unit/cli/output/..., src/omnimarket/cli/output/handlers/__init__.py, src/omnimarket/cli/__init__.py
Adds module docstrings and test fixtures supporting new CLI/report tests.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Script as run_orchestrated_merge_sweep_workflow
    participant GitHub
    participant Compute as NodeMergeSweep
    participant Triage as TriageOrchestrator
    participant Reducer as MergeSweepStateReducer
    participant Effect as EffectHandlers
    participant Classify as SweepOutcomeClassify

    Caller->>Script: invoke (--repos, --execute?)
    Script->>GitHub: fetch branch protection & open PRs
    Script->>Compute: compute merge-sweep (ModelMergeSweepRequest)
    Compute-->>Script: ModelMergeSweepResult
    Script->>Triage: triage (emit commands)
    Triage-->>Script: command list (merge/ci/polish/etc)
    Script->>Reducer: reduce commands -> state
    Reducer-->>Script: ModelMergeSweepState

    alt --execute
        loop for each command
            Script->>Effect: execute effect async (auto-merge/ci-rerun/polish)
            Effect-->>Script: dispatch event
            Script->>Classify: classify event -> outcome
            Classify-->>Script: outcome enum
        end
    else dry-run
        Script->>Script: log planned commands
    end

    Script->>Script: summarize counts & exit with code
    Script-->>Caller: exit code (0/1)
Loading
sequenceDiagram
    participant Triage as TriageOrchestrator
    participant Request as ModelTriageRequest
    participant TrackB as Track B PR
    participant Polish as PRPolishHandler
    participant Classify as SweepOutcomeClassify

    Triage->>Request: inspect emit_pr_polish_commands & dry_run
    alt emit_pr_polish_commands == true
        Triage->>TrackB: evaluate required checks
        alt checks failed (terminal)
            Triage->>Polish: emit ModelPrPolishStartCommand (dry_run flag)
            Polish-->>Triage: ModelPrPolishCompletedEvent (extra.final_phase)
            Triage->>Classify: classify PR_POLISH_COMPLETED (final_phase)
            Classify-->>Triage: SUCCESS/FAILED/DEGRADED
        else checks not failed
            Triage->>Triage: skip polish emission
        end
    else
        Triage->>Triage: suppress polish emission
    end
    Triage->>Triage: deduplicate total_prs by (repo, pr_number)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 I scurry through branches, fetch and sweep,
Reports in JSON, YAML, Markdown to keep,
Tri-state checks nudge polish and run,
Fixtures deterministically score everyone,
Hooray — the merge-sweep blooms at dawn! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.87% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: proving/validating an orchestrated merge-sweep workflow and session baseline through tests and contract verification (OMN-10400).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-10400-real-surfaces-cli-output

Review rate limit: 0/5 reviews remaining, refill in 3 minutes and 8 seconds.

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

@jonahgabriel
jonahgabriel enabled auto-merge April 30, 2026 15:45
@github-actions

github-actions Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

⚠️ Hostile Reviewer — DEGRADED (informational)

Blocking findings (critical/error): 0
Total findings: 0
Models succeeded: none

Note: All reviewer models failed or were unavailable. Degraded results are informational during the pilot phase (OMN-8524) and do not block merge. Error: cli_review exited non-zero (all models failed or binary error)


Gate semantics (pilot phase)

Verdict Meaning Blocks merge?
passed No critical/error findings No
blocked CRITICAL or ERROR findings found Yes
degraded All models unavailable (infra) No (pilot)

Powered by omniintelligence.review_pairing.cli_review — node-based adversarial review via HandlerLlmCliSubprocess (OMN-8524)

@jonahgabriel jonahgabriel changed the title fix(OMN-10400): rerun failing workflow runs from check urls test(OMN-10400): prove orchestrated merge sweep and session baseline Apr 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/handlers/handler_triage.py (1)

355-383: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Gate reruns and rebases on terminal failures, not any non-pass state.

These branches still use not pr.required_checks_pass, so a B_POLISH payload with required_checks_pending=True can fan out a live CI rerun/rebase. The compute side now distinguishes terminal failure from pending; this orchestrator needs the same predicate or the tri-state fix is easy to bypass with older or manually-constructed inputs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/handlers/handler_triage.py`
around lines 355 - 383, The current branches for CI rerun/rebase use the brittle
predicate "not pr.required_checks_pass" which treats pending checks as failures;
update both conditional guards that now read "and not pr.required_checks_pass"
(the MERGEABLE+BLOCKED rerun path that calls _resolve_failing_run_id and returns
ModelCiRerunCommand, and the MERGEABLE+BEHIND rebase path) to explicitly require
terminal failure instead of any non-pass state—i.e., replace the predicate with
a tri-state-aware check such as "and pr.required_checks_failed" or "and (not
pr.required_checks_pass and not pr.required_checks_pending)" depending on which
property exists in the PR model so pending checks do not trigger reruns/rebases.
src/omnimarket/nodes/node_merge_sweep_compute/handlers/handler_merge_sweep.py (1)

465-489: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use the reducer’s emitted merge order here.

triage_records is created from track_a before the orchestrator runs, and lines 479-483 rebuild ordered from that same tuple. As written, use_lifecycle_ordering=True just round-trips the original Track A order instead of applying the lifecycle/reducer ordering.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/omnimarket/nodes/node_merge_sweep_compute/handlers/handler_merge_sweep.py`
around lines 465 - 489, The current code rebuilds ordered from triage_records
(which mirrors track_a) so use_lifecycle_ordering does not apply the
reducer/orchestrator merge ordering; change the construction to iterate the
reducer-emitted merge sequence (the merge_prs passed by the orchestrator /
recorded by _NoopMerge) instead of triage_records: keep the pr_lookup =
{(c.pr.repo, c.pr.number): c for c in track_a} and the seen set, then for each
entry in merge_prs (or whatever variable holds the reducer's MERGE intent order)
form the same key and append pr_lookup[key] when present, then finally append
any remaining track_a stragglers as before; ensure you reference the
reducer/orchestrator merge_prs variable rather than triage_records so
use_lifecycle_ordering actually applies the lifecycle order.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/reference/2026-04-28-market-skill-baseline.md`:
- Around line 3-5: Remove the regenerated, timestamped execution transcript and
any volatile capture state from the public baseline doc (e.g., strings like
`2026-04-30T16:49:31.241546+00:00`, `Baseline window: 2026-04-30`, and the `Repo
root: <omnimarket>` note); retain only stable, contract-level baseline facts and
descriptions. Move the detailed historical run output and any workspace/ticket
identifiers to a non-public/generated artifact or internal storage, and replace
the removed sections with a short note pointing to the internal artifact or
stating that transcripts are available privately.

In `@scripts/run_orchestrated_merge_sweep_workflow.py`:
- Around line 229-263: _prepare_polish_worktree currently always uses the global
REPO_ROOT and runs git operations there which breaks when repo != the local
checkout; change it to resolve the target checkout for the incoming repo (i.e.
call the existing repo→checkout resolver or add a new helper) and use that
checkout path in place of REPO_ROOT for the _pr_head call,
current_sha/_is_clean_worktree checks, _worktrees_for_branch lookup, and the git
_run fetch/worktree commands, or if you do not yet support multi-repo workspaces
add a hard guard at the top of _prepare_polish_worktree that raises if repo is
not the local repo name (e.g. not "omnimarket"); update references to REPO_ROOT
in this function to the resolved checkout Path so all branch/SHA checks and git
fetch/worktree operations act against the correct repository.
- Around line 371-406: The ModelPrPolishStartCommand branch currently prepares a
worktree and calls run_live_pr_polish even when execute is false; guard that
branch with the same execute short-circuit used below so planning/dry-run
doesn't perform git actions: before calling _prepare_polish_worktree, check the
execute flag (the same condition used by the existing "if not execute" block)
and if not executing just _log the planned command (use _log and _dump_model on
command) and return []; otherwise proceed to call _prepare_polish_worktree,
run_live_pr_polish, and always call _cleanup_polish_worktree in the finally
block as currently implemented.

In `@src/omnimarket/cli/reporting.py`:
- Around line 137-177: The report builder build_report_from_merge_sweep_result
currently hardcodes status = EnumMarketCliStatus.SUCCESS; change it to derive
the report status from result.status (e.g., map result.status == "error" to
EnumMarketCliStatus.FAILURE and result.status == "warning"/"partial" to an
appropriate enum value, otherwise SUCCESS) and use that mapped value when
constructing ModelMarketCliReport so the report status matches the actual
result.status.

In `@src/omnimarket/nodes/node_merge_sweep_compute/__main__.py`:
- Around line 101-112: The check-evaluation logic currently only treats
conclusion == "SUCCESS" as passing and misses legacy StatusContext success and
non-failing CheckRun conclusions; update the block that computes conclusion and
status (variables conclusion, status, and the surrounding loop that sets
failed/pending using failed_conclusions) so that it treats status == "SUCCESS"
as a passing check and treats conclusion in {"SUCCESS","NEUTRAL","SKIPPED"} as
passing as well (i.e., skip marking failed or pending when conclusion is one of
those), leaving failed_conclusions handling intact for explicit failure reasons.

In
`@src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/handlers/handler_triage.py`:
- Around line 545-548: The code only treats checks with conclusion == "FAILURE"
as failures when extracting details_url/run_id, but
node_merge_sweep_compute.consumer._required_check_state() treats
ACTION_REQUIRED, CANCELLED, FAILED, STARTUP_FAILURE, STALE, and TIMED_OUT as
terminal failures too; update the condition in the resolver(s) (the blocks using
check.get("conclusion"), details_url, and _run_id_from_details_url, including
the other resolver at the other occurrence) to test membership in a failure set
(e.g.
{"FAILURE","ACTION_REQUIRED","CANCELLED","FAILED","STARTUP_FAILURE","STALE","TIMED_OUT"})
so run/job resolution and failing-job-name scanning run for all terminal failure
conclusions.

In
`@src/omnimarket/nodes/node_session_orchestrator/handlers/handler_session_orchestrator.py`:
- Around line 1434-1448: The handler currently mutates process-wide os.environ
keys ONEX_STATE_DIR and ONEX_PARENT_SESSION_ID around calling
NodeDispatchWorker().handle(command), causing non-reentrancy and races; instead,
change HandlerSessionOrchestrator to stop touching os.environ and pass the
context explicitly into NodeDispatchWorker (e.g., construct
NodeDispatchWorker(state_dir=state_dir, parent_session_id=session_id) or call
NodeDispatchWorker().handle(command, state_dir=state_dir,
parent_session_id=session_id)), and update the NodeDispatchWorker class
(constructor and/or handle method) to accept and use those parameters internally
wherever it currently reads os.environ for
ONEX_STATE_DIR/ONEX_PARENT_SESSION_ID. Ensure no global env mutation remains in
handler_session_orchestrator while preserving existing behavior by using the
passed-in values.
- Around line 1050-1055: The code currently treats an empty result from
self._load_linear_fixture when ONEX_SESSION_ORCHESTRATOR_LINEAR_FIXTURE is set
as success by returning [], which silences setup failures; change the behavior
in the handler where fixture_path =
os.environ.get("ONEX_SESSION_ORCHESTRATOR_LINEAR_FIXTURE", "") is read so that
if fixture_path is set but self._load_linear_fixture(fixture_path) returns an
empty or falsy tickets list, the handler fails fast (raise a clear exception or
return an error status) instead of returning []—update the block around
fixture_path/_load_linear_fixture in handler_session_orchestrator.py to log an
explicit error including fixture_path and either raise a ValueError or propagate
an error state so Phase 2 does not complete successfully when the configured
fixture yields zero tickets.
- Around line 1142-1162: The fixture loader _load_linear_fixture currently only
validates the top-level container and can return nodes that break _score_tickets
which expects GraphQL-style nested objects (e.g., labels["nodes"],
children["nodes"]); update _load_linear_fixture to validate each node's shape
before returning: ensure each node is a dict and that required nested fields
like "labels" and "children" exist and are dicts with a "nodes" list (or coerce
simple lists into {"nodes": [...]}) and otherwise raise SessionLinearFetchError
or skip the malformed node so that _score_tickets never receives invalid shapes;
reference the function names _load_linear_fixture and _score_tickets when making
the change.

In `@tests/unit/nodes/node_ticket_pipeline/test_main_cli_outputs.py`:
- Around line 23-35: The subprocess.run call in
tests/unit/nodes/node_ticket_pipeline/test_main_cli_outputs.py should include a
timeout to avoid CI hangs; add a timeout parameter (e.g. timeout=30) to the
subprocess.run invocation that runs omnimarket.nodes.node_ticket_pipeline and
wrap the call in a try/except that catches subprocess.TimeoutExpired then fail
the test explicitly (raise or assert False with a clear message) so a hung CLI
produces a deterministic test failure rather than stalling CI.

---

Outside diff comments:
In
`@src/omnimarket/nodes/node_merge_sweep_compute/handlers/handler_merge_sweep.py`:
- Around line 465-489: The current code rebuilds ordered from triage_records
(which mirrors track_a) so use_lifecycle_ordering does not apply the
reducer/orchestrator merge ordering; change the construction to iterate the
reducer-emitted merge sequence (the merge_prs passed by the orchestrator /
recorded by _NoopMerge) instead of triage_records: keep the pr_lookup =
{(c.pr.repo, c.pr.number): c for c in track_a} and the seen set, then for each
entry in merge_prs (or whatever variable holds the reducer's MERGE intent order)
form the same key and append pr_lookup[key] when present, then finally append
any remaining track_a stragglers as before; ensure you reference the
reducer/orchestrator merge_prs variable rather than triage_records so
use_lifecycle_ordering actually applies the lifecycle order.

In
`@src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/handlers/handler_triage.py`:
- Around line 355-383: The current branches for CI rerun/rebase use the brittle
predicate "not pr.required_checks_pass" which treats pending checks as failures;
update both conditional guards that now read "and not pr.required_checks_pass"
(the MERGEABLE+BLOCKED rerun path that calls _resolve_failing_run_id and returns
ModelCiRerunCommand, and the MERGEABLE+BEHIND rebase path) to explicitly require
terminal failure instead of any non-pass state—i.e., replace the predicate with
a tri-state-aware check such as "and pr.required_checks_failed" or "and (not
pr.required_checks_pass and not pr.required_checks_pending)" depending on which
property exists in the PR model so pending checks do not trigger reruns/rebases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 938077f1-91f4-46d1-a2ff-7e50c0cda443

📥 Commits

Reviewing files that changed from the base of the PR and between 858c59e and c1abefe.

📒 Files selected for processing (54)
  • contracts/OMN-10400.yaml
  • docs/reference/2026-04-28-market-skill-baseline.json
  • docs/reference/2026-04-28-market-skill-baseline.md
  • scripts/run_orchestrated_merge_sweep_workflow.py
  • src/omnimarket/cli/__init__.py
  • src/omnimarket/cli/args.py
  • src/omnimarket/cli/output/__init__.py
  • src/omnimarket/cli/output/handlers/__init__.py
  • src/omnimarket/cli/output/handlers/handler_json.py
  • src/omnimarket/cli/output/handlers/handler_markdown.py
  • src/omnimarket/cli/output/handlers/handler_text.py
  • src/omnimarket/cli/output/handlers/handler_yaml.py
  • src/omnimarket/cli/output/protocol.py
  • src/omnimarket/cli/output/registry.py
  • src/omnimarket/cli/reporting.py
  • src/omnimarket/market_skill_baseline.py
  • src/omnimarket/models/cli_report.py
  • src/omnimarket/nodes/node_merge_sweep_compute/__main__.py
  • src/omnimarket/nodes/node_merge_sweep_compute/consumer.py
  • src/omnimarket/nodes/node_merge_sweep_compute/handlers/handler_merge_sweep.py
  • src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/contract.yaml
  • src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/handlers/handler_triage.py
  • src/omnimarket/nodes/node_merge_sweep_triage_orchestrator/models/model_triage_request.py
  • src/omnimarket/nodes/node_session_orchestrator/handlers/handler_session_orchestrator.py
  • src/omnimarket/nodes/node_session_orchestrator/tests/test_handler_session_orchestrator.py
  • src/omnimarket/nodes/node_sweep_outcome_classify/handlers/handler_outcome_classify.py
  • src/omnimarket/nodes/node_sweep_outcome_classify/models/model_sweep_outcome.py
  • src/omnimarket/nodes/node_ticket_pipeline/__main__.py
  • tests/test_codex_runtime_client.py
  • tests/test_golden_chain_merge_sweep.py
  • tests/test_golden_chain_merge_sweep_executor.py
  • tests/test_golden_chain_ticket_pipeline.py
  • tests/test_market_skill_smokes.py
  • tests/test_no_cross_node_reach_in.py
  • tests/test_orchestrated_merge_sweep_workflow.py
  • tests/test_sweep_outcome_classify.py
  • tests/test_triage_orchestrator.py
  • tests/test_triage_phase2_emit_rules.py
  • tests/unit/cli/__init__.py
  • tests/unit/cli/_fixtures.py
  • tests/unit/cli/output/__init__.py
  • tests/unit/cli/output/handlers/__init__.py
  • tests/unit/cli/output/handlers/test_handler_json.py
  • tests/unit/cli/output/handlers/test_handler_markdown.py
  • tests/unit/cli/output/handlers/test_handler_text.py
  • tests/unit/cli/output/handlers/test_handler_yaml.py
  • tests/unit/cli/output/test_registry.py
  • tests/unit/cli/test_args.py
  • tests/unit/cli/test_reporting.py
  • tests/unit/models/test_cli_report.py
  • tests/unit/nodes/node_merge_sweep_compute/__init__.py
  • tests/unit/nodes/node_merge_sweep_compute/test_main_cli_outputs.py
  • tests/unit/nodes/node_ticket_pipeline/__init__.py
  • tests/unit/nodes/node_ticket_pipeline/test_main_cli_outputs.py

Comment thread docs/reference/2026-04-28-market-skill-baseline.md Outdated
Comment thread scripts/run_orchestrated_merge_sweep_workflow.py Outdated
Comment thread scripts/run_orchestrated_merge_sweep_workflow.py
Comment thread src/omnimarket/cli/reporting.py Outdated
Comment thread src/omnimarket/nodes/node_merge_sweep_compute/__main__.py
Comment thread tests/unit/nodes/node_ticket_pipeline/test_main_cli_outputs.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/run_orchestrated_merge_sweep_workflow.py`:
- Around line 409-417: Polish evidence is being returned as a reducer outcome
which blocks later real remediation outcomes; stop emitting a reducible outcome
for polish by not returning the classified outcome from the polish handler.
Specifically, in run_orchestrated_merge_sweep_workflow.py replace the return of
_classify_outcome(_polish_completed_to_input(...)) (functions
_polish_completed_to_input and _classify_outcome) with an empty list (or
otherwise mark the result as non-reducer-only evidence) so
ModelPrPolishStartCommand/HandlerTriageOrchestrator polish events do not consume
the HandlerMergeSweepStateReducer dedup slot keyed by repo#pr_number.
- Around line 201-214: The function _worktrees_for_branch currently matches
branches by suffix (raw_branch.endswith(f"/{branch}")), which can incorrectly
match unrelated refs; update _worktrees_for_branch to compare the full ref
exactly (e.g., raw_branch == f"refs/heads/{branch}") so only worktrees whose
branch ref equals the exact ref are returned, and ensure any callers like
_prepare_polish_worktree use the corrected _worktrees_for_branch result.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7354c1d4-3183-46a4-b013-983ca3b36ed7

📥 Commits

Reviewing files that changed from the base of the PR and between c1abefe and 7c68399.

📒 Files selected for processing (4)
  • scripts/run_orchestrated_merge_sweep_workflow.py
  • src/omnimarket/nodes/node_merge_sweep_compute/handlers/handler_merge_sweep.py
  • tests/test_golden_chain_merge_sweep.py
  • tests/test_orchestrated_merge_sweep_workflow.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/omnimarket/nodes/node_merge_sweep_compute/handlers/handler_merge_sweep.py
  • tests/test_golden_chain_merge_sweep.py
  • tests/test_orchestrated_merge_sweep_workflow.py

Comment thread scripts/run_orchestrated_merge_sweep_workflow.py
Comment thread scripts/run_orchestrated_merge_sweep_workflow.py Outdated
@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Added the next Codex skill shim: pr-polish.

Scope:

  • Added source skill: src/omnimarket/adapters/codex/skills/pr-polish/SKILL.md
  • Added packaged plugin skill: plugins/onex/skills/pr-polish/SKILL.md
  • Updated plugin/source shim tests to include pr-polish and assert runtime-adapter dispatch-only behavior.

Proof:

  • uv run python scripts/run_codex_runtime_request.py --command-name pr_polish --payload '{"repo":"OmniNode-ai/omnimarket","pr_number":465,"dry_run":true,"no_push":true,"no_automerge":true}' --timeout-ms 300000 --compile-only -> emitted compiled pr_polish command payload.
  • uv run pytest tests/test_codex_plugin_shims.py tests/test_install_codex_skills.py -q -> 11 passed
  • uv run pytest tests/test_codex_runtime_client.py::test_pr_polish_pattern_b_runs_node_end_to_end -q -> 1 passed
  • uv run pytest tests/test_codex_runtime_client.py tests/test_install_codex_skills.py tests/test_codex_plugin_shims.py -q -> 37 passed
  • uv run ruff format --check tests/test_codex_plugin_shims.py && uv run ruff check tests/test_codex_plugin_shims.py -> passed

Commit: 9cd16c8 feat(OMN-10400): add pr polish codex skill

@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Added the next Codex skill shim: local-review.

Scope:

  • Added source skill: src/omnimarket/adapters/codex/skills/local-review/SKILL.md
  • Added packaged plugin skill: plugins/onex/skills/local-review/SKILL.md
  • Updated plugin/source shim tests to include local-review and assert runtime-adapter dispatch-only behavior.

Proof:

  • uv run python scripts/run_codex_runtime_request.py --command-name local_review --payload '{"correlation_id":"11111111-1111-4111-8111-111111111111","max_iterations":3,"required_clean_runs":2,"dry_run":true,"requested_at":"2026-04-30T17:45:00Z"}' --timeout-ms 300000 --compile-only -> emitted compiled local_review command payload.
  • uv run pytest tests/test_codex_runtime_client.py::test_local_review_pattern_b_runs_node_end_to_end tests/test_codex_plugin_shims.py tests/test_install_codex_skills.py -q -> 12 passed
  • uv run pytest tests/test_codex_runtime_client.py tests/test_install_codex_skills.py tests/test_codex_plugin_shims.py -q -> 37 passed
  • uv run ruff format --check tests/test_codex_plugin_shims.py && uv run ruff check tests/test_codex_plugin_shims.py -> passed

Commit: 7139f5d feat(OMN-10400): add local review codex skill

@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Added the next Codex skill shim: coderabbit-triage.

Scope:

  • Added source skill: src/omnimarket/adapters/codex/skills/coderabbit-triage/SKILL.md
  • Added packaged plugin skill: plugins/onex/skills/coderabbit-triage/SKILL.md
  • Updated plugin/source shim tests to include coderabbit-triage and assert runtime-adapter dispatch-only behavior.

Proof:

  • uv run python scripts/run_codex_runtime_request.py --command-name coderabbit_triage --payload '{"repo":"OmniNode-ai/omnimarket","pr_number":465,"correlation_id":"22222222-2222-4222-8222-222222222222","dry_run":true}' --timeout-ms 120000 --compile-only -> emitted compiled coderabbit_triage command payload.
  • uv run pytest tests/test_codex_runtime_client.py::test_coderabbit_triage_pattern_b_runs_node_end_to_end tests/test_codex_plugin_shims.py tests/test_install_codex_skills.py -q -> 12 passed
  • uv run pytest tests/test_codex_runtime_client.py tests/test_install_codex_skills.py tests/test_codex_plugin_shims.py -q -> 37 passed
  • uv run ruff format --check tests/test_codex_plugin_shims.py && uv run ruff check tests/test_codex_plugin_shims.py -> passed

Commit: 5febf2e feat(OMN-10400): add coderabbit triage codex skill

@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Added the final missing Codex skill shim in this pass: ticket-pipeline.

Scope:

  • Added source skill: src/omnimarket/adapters/codex/skills/ticket-pipeline/SKILL.md
  • Added packaged plugin skill: plugins/onex/skills/ticket-pipeline/SKILL.md
  • Updated plugin/source shim tests to include ticket-pipeline and assert runtime-adapter dispatch-only behavior.
  • Source and packaged plugin skill inventories now each contain 8 market skills: aislop-sweep, coderabbit-triage, local-review, merge-sweep, pr-polish, session-bootstrap, session-orchestrator, ticket-pipeline.

Proof:

  • uv run python scripts/run_codex_runtime_request.py --command-name ticket_pipeline --payload '{"correlation_id":"33333333-3333-4333-8333-333333333333","ticket_id":"OMN-10400","skip_test_iterate":false,"dry_run":true,"requested_at":"2026-04-30T17:48:00Z"}' --timeout-ms 600000 --compile-only -> emitted compiled ticket_pipeline command payload.
  • uv run pytest tests/test_codex_runtime_client.py::test_ticket_pipeline_pattern_b_runs_node_end_to_end tests/test_codex_plugin_shims.py tests/test_install_codex_skills.py -q -> 12 passed
  • uv run pytest tests/test_codex_runtime_client.py tests/test_install_codex_skills.py tests/test_codex_plugin_shims.py -q -> 37 passed
  • uv run ruff format --check tests/test_codex_plugin_shims.py && uv run ruff check tests/test_codex_plugin_shims.py -> passed
  • find src/omnimarket/adapters/codex/skills -mindepth 1 -maxdepth 1 -type d | wc -l -> 8
  • find plugins/onex/skills -mindepth 1 -maxdepth 1 -type d | wc -l -> 8

Commit: 3b73812 feat(OMN-10400): add ticket pipeline codex skill

@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Corrected focus back to actual market-skill end-to-end proof.

Ran the full market-owned skill baseline, not just Codex shim checks:

uv run python scripts/run_market_skill_baseline.py --strict --skills all --json-out docs/reference/2026-04-28-market-skill-baseline.json --markdown-out docs/reference/2026-04-28-market-skill-baseline.md

Result:

  • Working: 8
  • Degraded: 0
  • Failing: 0
  • Every market surface passed direct CLI smoke plus focused runtime proof:
    • aislop_sweep
    • pr_lifecycle_orchestrator
    • pr_polish
    • local_review
    • coderabbit_triage
    • session_bootstrap
    • session_orchestrator
    • ticket_pipeline

Committed refreshed durable evidence:
c81ba1c test(OMN-10400): refresh market skill end-to-end baseline

Note: the current baseline runner is batch-style and prints after completion. If we want the exact operator experience of logs as each node runs inline, the next concrete improvement should be a streaming market-skill proof runner rather than more skill packaging.

@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Added streaming market-skill proof output.

New behavior:

  • scripts/run_market_skill_baseline.py --stream prints each market skill as soon as its direct CLI smoke and focused runtime proof finish.
  • Output includes node, contract, terminal event, input drift result, CLI command/summary, runtime proof targets, and runtime proof output.

Proof run:
uv run python scripts/run_market_skill_baseline.py --stream --strict --skills all --json-out docs/reference/2026-04-28-market-skill-baseline.json --markdown-out docs/reference/2026-04-28-market-skill-baseline.md

Result:

  • Working: 8
  • Degraded: 0
  • Failing: 0

Additional checks:

  • uv run pytest tests/test_market_skill_smokes.py -q -> 9 passed
  • uv run ruff format --check src/omnimarket/market_skill_baseline.py scripts/run_market_skill_baseline.py tests/test_market_skill_smokes.py && uv run ruff check src/omnimarket/market_skill_baseline.py scripts/run_market_skill_baseline.py tests/test_market_skill_smokes.py -> passed

Commit: 7cc974f feat(OMN-10400): stream market skill proof output

@jonahgabriel

Copy link
Copy Markdown
Contributor Author

Pushed hardening fixes in 342284c, then merged origin/main in 3a51d98.

Local verification after the merge:

  • uv run ruff check ... on touched files: passed
  • uv run pytest tests/test_orchestrated_merge_sweep_workflow.py tests/test_market_skill_smokes.py tests/test_codex_runtime_client.py::test_session_orchestrator_pattern_b_runs_node_end_to_end tests/test_triage_phase2_emit_rules.py tests/test_triage_orchestrator.py src/omnimarket/nodes/node_session_orchestrator/tests/test_session_orchestrator_silent_zero.py tests/unit/nodes/node_ticket_pipeline/test_main_cli_outputs.py -q: 67 passed
  • uv run python scripts/run_market_skill_baseline.py --stream --strict --skills all --json-out docs/reference/2026-04-28-market-skill-baseline.json --markdown-out docs/reference/2026-04-28-market-skill-baseline.md: 8 working / 0 degraded / 0 failing

All previously open CodeRabbit review threads are resolved.

@jonahgabriel
jonahgabriel added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit 6199b1b Apr 30, 2026
25 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-10400-real-surfaces-cli-output branch April 30, 2026 20:38
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