Skip to content

fix(OMN-16376): occ-autobind keys evidence to the PR TITLE ticket, never the body - #2139

Merged
jonahgabriel merged 1 commit into
devfrom
jonah/omn-16376-fix-occ-autobind-keys-evidence-to-body-mentioned-ticket
Aug 25, 2026
Merged

jonahgabriel merged 1 commit into
devfrom
jonah/omn-16376-fix-occ-autobind-keys-evidence-to-body-mentioned-ticket

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

OccCompanionEmitter._extract_tickets keyed a minted OCC companion to the shared _extract_ticket_ids(body, title) result — body closing-keyword matches (Closes/Fixes/Resolves/Implements OMN-<n>) checked exclusively first, title only used as a fallback when the body has none.

The Receipt Gate's own identity check (_verify_ticket_identity Axis 1, omnibase_core/validation/validator_receipt_gate.py) requires the PR title — never the body — to reference whatever ticket the companion's Evidence-Ticket line names. A body-first extraction is therefore structurally unable to satisfy the gate it feeds whenever the body cites an unrelated ticket via a closing keyword — there is no configuration of title-ticket != body-ticket under which the mis-keyed companion can pass.

Live incident: omninode_infra PR #958 — title cited OMN-16368 (the actual ask); the body separately cited OMN-15757 as related context via a closing keyword. The autobind companion (onex_change_control#6847) was minted keyed to OMN-15757 and could never pass OMN-16368's Receipt Gate run. A second, hand-authored companion (#6848) was required and #6847 had to be superseded/closed as dead weight.

Fix

_extract_tickets now takes only title (the body parameter is removed) and delegates to _extract_ticket_ids("", title) — passing an empty body means the closing-keyword branch can never fire, so only the title-token fallback (TICKET_PATTERN, the SAME regex the gate itself uses) ever runs. The one call site in _emit_companion_sync is updated accordingly; the caller-supplied ticket_id fallback (used when the title cites no ticket at all) is unchanged.

Scope is intentionally narrow: only occ_companion_emitter.py's _extract_tickets and its single call site. node_occ_companion_compute and node_occ_observation_effect also call the shared _extract_ticket_ids(body, title) directly but are out of this ticket's scope (different producer surfaces; not implicated by the #958 incident).

Tests

  • TestExtractTicketsIsTitleOnly (new): direct assertions against _extract_tickets, including a positive-control assertion that the shared _extract_ticket_ids(body, title) helper — given the real OMN-9359 implement demo market skill runtime nodes #958 body — WOULD resolve to the wrong ticket (OMN-15757), proving the fix removes a real branch, not a hypothetical one.
  • TestFullEmitFlow.test_mints_for_title_ticket_not_a_body_mentioned_ticket (new): drives the real _emit_companion_sync end to end with the OMN-9359 implement demo market skill runtime nodes #958 shape (title=OMN-16368, body cites OMN-15757 via Closes) and asserts the minted contracts/OMN-16368.yaml + receipt tree exist while no contracts/OMN-15757.yaml or receipt tree for OMN-15757 is ever authored.

All 31 tests in test_occ_companion_emitter.py pass; full local governed pre-push suite (7793 passed, 45 skipped, 1 xfailed) is green.

Evidence-Ticket: OMN-16376
Evidence-Source: OCC#7057

…ver the body

_extract_tickets keyed a minted OCC companion to the shared
_extract_ticket_ids(body, title) result — body closing-keyword matches
exclusive, title only as fallback. The Receipt Gate's own identity check
(_verify_ticket_identity Axis 1) requires the PR TITLE, never the body,
to reference whatever ticket the companion's Evidence-Ticket names, so a
body-first extraction is structurally unable to satisfy the gate it feeds
whenever the body cites an unrelated ticket via a closing keyword.

Live incident: omninode_infra PR #958 (title cited OMN-16368; body cited
OMN-15757 as related context via a closing keyword) minted a companion
keyed to OMN-15757, which could never pass OMN-16368's Receipt Gate run —
a second, hand-authored companion was required and the wrong one closed
as dead weight.

Fix: _extract_tickets now takes only `title` and delegates to
_extract_ticket_ids("", title) — same title-token regex the gate itself
falls back to, body structurally excluded from the call.

Regression tests reproduce the exact OMN-16368/#958 shape (title=A,
body cites unrelated B via a closing keyword) both as a direct
_extract_tickets assertion and end-to-end through _emit_companion_sync,
asserting the minted contract/receipts key to A and that no
contracts/<B>.yaml or receipt tree for B is ever authored.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 50 minutes.

View limit details

Limit details: You’ve used the included review currently available. Your 125 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3155c7c6-6210-4c2d-b59e-7347da2c22d2

📥 Commits

Reviewing files that changed from the base of the PR and between 8b783eb and 010b3e9.

📒 Files selected for processing (2)
  • src/omnimarket/nodes/node_pr_lifecycle_fix_effect/handlers/occ_companion_emitter.py
  • tests/unit/nodes/node_pr_lifecycle_fix_effect/test_occ_companion_emitter.py

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

@github-actions

Copy link
Copy Markdown

✅ Architectural Review — PASSED

Errors: 0
Warnings: 0

What this checks

Rule Description
ARCH-TOPIC-001 No hardcoded Kafka topic strings in handler code
ARCH-DI-001 No event_bus=None bypass
ARCH-DI-002 No direct Handler instantiation outside workflow_runner/adapters
ARCH-DI-003 No reinvented DI containers
ARCH-TOPIC-002 contract.yaml topics follow `onex.{cmd

No architectural violations found.

Static architectural lint — no model inference (OMN-14176).

@github-actions

Copy link
Copy Markdown

✅ Hostile Reviewer — PASSED

Blocking findings (critical/error): 0
Total findings: 0
Models succeeded: qwen3-review,qwen3-review-b


Gate semantics

Verdict Meaning Blocks merge?
passed >=2 models succeeded, no critical/error findings No
blocked CRITICAL or ERROR findings found Yes
degraded Fewer than 2 models succeeded (infra unavailable/timeout) Yes (OMN-15110)

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

jonahgabriel pushed a commit to OmniNode-ai/onex_change_control that referenced this pull request Aug 25, 2026
…imarket#2139 (#7057)

* evidence(OMN-16376): author OCC companion for OmniNode-ai/omnimarket#2139

OCC companion by node_pr_lifecycle_fix_effect (OMN-13317 F1 / OMN-13990 / OMN-14285). Product PR head 010b3e94ff6cda456317bd33967480d6e0374d43.

* evidence(OMN-16376): self-bind OCC#7057 + rebind contract_sha256

---------

Co-authored-by: omnimarket-bot <bot@omninode.ai>
@jonahgabriel
jonahgabriel merged commit a2c364f into dev Aug 25, 2026
199 of 214 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-16376-fix-occ-autobind-keys-evidence-to-body-mentioned-ticket branch August 25, 2026 05:15
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