Skip to content

feat(contracts): backfill golden_path and dod_evidence for all 7 existing contracts [OMN-7430] - #138

Merged
jonahgabriel merged 2 commits into
mainfrom
jonahgabriel/omn-7430-task-4-backfill-existing-7-contracts-with-golden_path-and
Apr 3, 2026
Merged

jonahgabriel merged 2 commits into
mainfrom
jonahgabriel/omn-7430-task-4-backfill-existing-7-contracts-with-golden_path-and

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Backfills all 7 existing contracts with dod_evidence containing executable checks [OMN-7430]
  • Adds golden_path to 5 seam tickets (OMN-3940, OMN-3944, OMN-3946, OMN-3947, OMN-5291)
  • 2 contracts correctly have no golden_path: OMN-3943 (internal reducer) and OMN-5168 (schema definition)
  • All 7 contracts validate against ModelTicketContract

Test plan

  • All 7 contracts validate via ModelTicketContract.model_validate()
  • 5 seam tickets have golden_path, 2 non-applicable have null with comments
  • All 7 contracts have dod_evidence >= 2 items

Part of epic OMN-7426

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added multiple golden-path end-to-end test scenarios covering command/event flows and schema/assertion checks.
  • Documentation
    • Added DoD evidence entries across contracts to capture QA checks (unit/integration test runs and static type checks) and manual verification steps.

…ting contracts [OMN-7430]

All 7 contracts now have dod_evidence with executable checks derived from
their Linear ticket requirements. 5 seam tickets have golden_path (OMN-3940,
OMN-3944, OMN-3946, OMN-3947, OMN-5291). 2 non-applicable contracts have
golden_path: null with comments (OMN-3943 internal reducer, OMN-5168 schema).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added golden_path scenarios and dod_evidence entries to multiple contract YAMLs, defining end-to-end input→output event mappings, fixture sources, correlation passthrough, schema/assertion checks, timeouts, and manual DoD checklists (pytest/mypy/CLI checks). No code/API signatures changed.

Changes

Cohort / File(s) Summary
Golden Path Contracts
contracts/OMN-3940.yaml, contracts/OMN-3946.yaml, contracts/OMN-3947.yaml, contracts/OMN-5291.yaml
Added golden_path sections describing E2E scenarios: input command/event topics with fixture references, correlation_id passthrough, expected output topics, schema_name and field assertions, timeout_ms: 30000, and infra settings (mock/real).
DOD Evidence Additions
contracts/OMN-3940.yaml, contracts/OMN-3943.yaml, contracts/OMN-3944.yaml, contracts/OMN-3946.yaml, contracts/OMN-3947.yaml, contracts/OMN-5168.yaml, contracts/OMN-5291.yaml
Added dod_evidence arrays with manual DoD items (dod-001 …) that include descriptive text and checks commands (pytest invocations, mypy --strict, CLI dry-run or file existence checks) targeting specific tests/modules/files.
Minor / Documentation-only YAML edits
contracts/.../*.yaml
All changes are confined to YAML contract content (no changes to exported/public code or type signatures).

Sequence Diagram(s)

sequenceDiagram
    participant Tester as Tester (fixture/runner)
    participant KafkaIn as Kafka Input Topic
    participant Service as Service / Consumer
    participant KafkaOut as Kafka Output Topic
    participant Validator as Schema/assertion check

    Tester->>KafkaIn: publish message (fixture, correlation_id)
    KafkaIn->>Service: deliver event/command
    Service->>Validator: validate schema & assertions
    alt assertions pass
        Service->>KafkaOut: emit output event (propagate correlation_id)
        KafkaOut->>Tester: tester observes expected topic & payload
    else assertion fail
        Service->>Tester: report failure / timeout
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through YAML fields tonight,

golden paths aglow in light,
checks and tests all set to run,
correlation threads neatly spun,
a rabbit's nod — the contracts hum. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: backfilling golden_path and dod_evidence across all 7 existing contracts, with a specific ticket reference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 jonahgabriel/omn-7430-task-4-backfill-existing-7-contracts-with-golden_path-and

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

@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 `@contracts/OMN-3946.yaml`:
- Around line 59-64: The DoD check named dod-002 currently uses check_type:
"file_exists" which only proves the file is present; change the check (in the
checks array for dod-002) to use check_type: "command" and supply a command that
actually parses ".github/workflows/artifact-reconciliation-webhook.yml" with a
YAML parser (for example yq, yamllint, or a small python script using PyYAML) so
the check fails on syntax errors; update the check_value to that command and
keep the descriptive text "GitHub Action workflow is syntactically valid" to
match the new behavior.
- Around line 71-73: The grep check under check_value uses the wrong key: change
the dict key from file to path so the grep check is {pattern: "SASL_SSL", path:
"scripts/publish_pr_webhook_event.py"}; update the entry referenced by
check_value in the contract (the grep check against
scripts/publish_pr_webhook_event.py) to use path instead of file so it conforms
to ModelTicketContract's expected grep schema.
🪄 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: 19c1b852-d365-4f1f-b10c-59f04c375d22

📥 Commits

Reviewing files that changed from the base of the PR and between 44d3eeb and 5590cc2.

📒 Files selected for processing (7)
  • contracts/OMN-3940.yaml
  • contracts/OMN-3943.yaml
  • contracts/OMN-3944.yaml
  • contracts/OMN-3946.yaml
  • contracts/OMN-3947.yaml
  • contracts/OMN-5168.yaml
  • contracts/OMN-5291.yaml

Comment thread contracts/OMN-3946.yaml
Comment thread contracts/OMN-3946.yaml
@jonahgabriel
jonahgabriel enabled auto-merge April 3, 2026 17:00
@jonahgabriel jonahgabriel changed the title feat(contracts): backfill golden_path and dod_evidence for all 7 existing contracts feat(contracts): backfill golden_path and dod_evidence for all 7 existing contracts [OMN-7430] Apr 3, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonahgabriel
jonahgabriel added this pull request to the merge queue Apr 3, 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: 3

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

Inline comments:
In `@contracts/OMN-5291.yaml`:
- Around line 40-41: The golden_path.input references an input topic
"onex.cmd.onex-change-control.validate-yaml.v1" and a fixture
"tests/fixtures/validate_yaml_trigger.json" that are not present in the Kafka
flow or repo; update the contract so the topic matches an existing, executable
Kafka topic used in the flow (or add a producer/route that emits to
"onex.cmd.onex-change-control.validate-yaml.v1") and ensure the fixture file
exists at tests/fixtures/validate_yaml_trigger.json (or change the fixture path
to the correct existing fixture); verify by running the golden path test that
the topic receives the message and the fixture is loadable.
- Around line 53-68: Add a new dod_evidence entry to this YAML to run the
validate-yaml CLI against the appropriate Pydantic schema: include a check with
check_type "command" and check_value "uv run validate-yaml --schema
ModelTicketContract <path-to-this-file>" (reference the existing dod_evidence
list and the ticket contract schema ModelTicketContract) so the contract file
explicitly records schema validation alongside the pytest and mypy checks.
- Around line 46-50: The contract currently references schema_name
"ModelGovernanceCheckCompleted" and asserts field "exit_code == 0", but the
emitter emits fields like "check_type", "target", "passed", "violation_count",
and "details"; update the schema_name and assertions to match the actual payload
— replace or rename "ModelGovernanceCheckCompleted" if wrong and remove the
"exit_code" assertion, then add assertions for the real fields (e.g., assert
"passed" is boolean or true/false as expected, "violation_count" is a
non-negative integer, "check_type" and "target" are strings, and "details"
exists/is an object or array) using the exact field names from the emitter so
the contract aligns with emitted events.
🪄 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: d53d7ed3-76af-4516-9968-0bc18e2de4ce

📥 Commits

Reviewing files that changed from the base of the PR and between 5590cc2 and bcd50a9.

📒 Files selected for processing (6)
  • contracts/OMN-3940.yaml
  • contracts/OMN-3943.yaml
  • contracts/OMN-3944.yaml
  • contracts/OMN-3946.yaml
  • contracts/OMN-5168.yaml
  • contracts/OMN-5291.yaml
✅ Files skipped from review due to trivial changes (2)
  • contracts/OMN-5168.yaml
  • contracts/OMN-3944.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • contracts/OMN-3943.yaml
  • contracts/OMN-3946.yaml
  • contracts/OMN-3940.yaml

Comment thread contracts/OMN-5291.yaml
Comment on lines +40 to +41
topic: "onex.cmd.onex-change-control.validate-yaml.v1"
fixture: "tests/fixtures/validate_yaml_trigger.json"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

golden_path.input is currently non-executable

Line 40 references an input topic that is not represented in the current Kafka flow, and Line 41 references a fixture path that is missing. This makes the golden path unverifiable in practice.

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

In `@contracts/OMN-5291.yaml` around lines 40 - 41, The golden_path.input
references an input topic "onex.cmd.onex-change-control.validate-yaml.v1" and a
fixture "tests/fixtures/validate_yaml_trigger.json" that are not present in the
Kafka flow or repo; update the contract so the topic matches an existing,
executable Kafka topic used in the flow (or add a producer/route that emits to
"onex.cmd.onex-change-control.validate-yaml.v1") and ensure the fixture file
exists at tests/fixtures/validate_yaml_trigger.json (or change the fixture path
to the correct existing fixture); verify by running the golden path test that
the topic receives the message and the fixture is loadable.

Comment thread contracts/OMN-5291.yaml
Comment on lines +46 to +50
schema_name: "ModelGovernanceCheckCompleted"
assertions:
- field: "exit_code"
op: "eq"
value: 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

golden_path.output schema/assertion do not match emitted event payload

Line 46 uses ModelGovernanceCheckCompleted, and Lines 48-50 assert exit_code == 0, but the emitter payload uses fields like check_type, target, passed, violation_count, and details (no exit_code). This will cause false contract expectations.

Suggested contract fix
   output:
     topic: "onex.evt.onex-change-control.governance-check-completed.v1"
     output_correlation_id_field: "correlation_id"
-    schema_name: "ModelGovernanceCheckCompleted"
+    schema_name: "GovernanceCheckCompleted" # replace with the actual existing model name
     assertions:
-      - field: "exit_code"
-        op: "eq"
-        value: 0
+      - field: "passed"
+        op: "eq"
+        value: true
+      - field: "violation_count"
+        op: "eq"
+        value: 0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
schema_name: "ModelGovernanceCheckCompleted"
assertions:
- field: "exit_code"
op: "eq"
value: 0
schema_name: "GovernanceCheckCompleted"
assertions:
- field: "passed"
op: "eq"
value: true
- field: "violation_count"
op: "eq"
value: 0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contracts/OMN-5291.yaml` around lines 46 - 50, The contract currently
references schema_name "ModelGovernanceCheckCompleted" and asserts field
"exit_code == 0", but the emitter emits fields like "check_type", "target",
"passed", "violation_count", and "details"; update the schema_name and
assertions to match the actual payload — replace or rename
"ModelGovernanceCheckCompleted" if wrong and remove the "exit_code" assertion,
then add assertions for the real fields (e.g., assert "passed" is boolean or
true/false as expected, "violation_count" is a non-negative integer,
"check_type" and "target" are strings, and "details" exists/is an object or
array) using the exact field names from the emitter so the contract aligns with
emitted events.

Comment thread contracts/OMN-5291.yaml
Comment on lines +53 to +68
dod_evidence:
- id: "dod-001"
description: "Governance emitter unit tests pass"
source: "manual"
linear_dod_text: "Unit tests cover all three emit functions, verify topic names, envelope structure,
and silent no-op"
checks:
- check_type: "test_passes"
check_value: "uv run pytest tests/ -k 'emitter or governance' -v"
- id: "dod-002"
description: "mypy strict passes on kafka module"
source: "manual"
linear_dod_text: "mypy --strict passes on kafka/ module"
checks:
- check_type: "command"
check_value: "uv run mypy src/onex_change_control/kafka/ --strict"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add explicit validate-yaml DoD evidence for schema compliance

The added dod_evidence only covers pytest and mypy. For this YAML artifact, include a validate-yaml CLI check against ModelTicketContract so contract compliance is explicitly evidenced.

Suggested DoD evidence addition
 dod_evidence:
   - id: "dod-001"
     description: "Governance emitter unit tests pass"
@@
   - id: "dod-002"
     description: "mypy strict passes on kafka module"
@@
       - check_type: "command"
         check_value: "uv run mypy src/onex_change_control/kafka/ --strict"
+  - id: "dod-003"
+    description: "Contract validates via validate-yaml CLI"
+    source: "manual"
+    linear_dod_text: "OMN-5291 contract validates against ModelTicketContract"
+    checks:
+      - check_type: "command"
+        check_value: "uv run validate-yaml contracts/OMN-5291.yaml"

As per coding guidelines, "{contracts,drift/day_close}/**/*.yaml: YAML artifact files must validate against the appropriate Pydantic schema (ModelTicketContract for ticket contracts, ModelDayClose for day close reports) using the validate-yaml CLI tool".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
dod_evidence:
- id: "dod-001"
description: "Governance emitter unit tests pass"
source: "manual"
linear_dod_text: "Unit tests cover all three emit functions, verify topic names, envelope structure,
and silent no-op"
checks:
- check_type: "test_passes"
check_value: "uv run pytest tests/ -k 'emitter or governance' -v"
- id: "dod-002"
description: "mypy strict passes on kafka module"
source: "manual"
linear_dod_text: "mypy --strict passes on kafka/ module"
checks:
- check_type: "command"
check_value: "uv run mypy src/onex_change_control/kafka/ --strict"
dod_evidence:
- id: "dod-001"
description: "Governance emitter unit tests pass"
source: "manual"
linear_dod_text: "Unit tests cover all three emit functions, verify topic names, envelope structure,
and silent no-op"
checks:
- check_type: "test_passes"
check_value: "uv run pytest tests/ -k 'emitter or governance' -v"
- id: "dod-002"
description: "mypy strict passes on kafka module"
source: "manual"
linear_dod_text: "mypy --strict passes on kafka/ module"
checks:
- check_type: "command"
check_value: "uv run mypy src/onex_change_control/kafka/ --strict"
- id: "dod-003"
description: "Contract validates via validate-yaml CLI"
source: "manual"
linear_dod_text: "OMN-5291 contract validates against ModelTicketContract"
checks:
- check_type: "command"
check_value: "uv run validate-yaml contracts/OMN-5291.yaml"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contracts/OMN-5291.yaml` around lines 53 - 68, Add a new dod_evidence entry
to this YAML to run the validate-yaml CLI against the appropriate Pydantic
schema: include a check with check_type "command" and check_value "uv run
validate-yaml --schema ModelTicketContract <path-to-this-file>" (reference the
existing dod_evidence list and the ticket contract schema ModelTicketContract)
so the contract file explicitly records schema validation alongside the pytest
and mypy checks.

Merged via the queue into main with commit 0ce64ce Apr 3, 2026
25 checks passed
@jonahgabriel
jonahgabriel deleted the jonahgabriel/omn-7430-task-4-backfill-existing-7-contracts-with-golden_path-and branch April 3, 2026 17:36
jonahgabriel added a commit that referenced this pull request May 26, 2026
…elf-extending-agent fixes (#1689)

Adds OCC contracts and receipt evidence for two onex-self-extending-agent tickets:

- OMN-11827: max_tokens truncation fix (PRs #136 merged, #138 open)
- OMN-12124: clean ADK auth error handling (PR #137 open)

These contracts unblock the receipt gate on those PRs — both reference OCC#<this PR>.
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