Skip to content

docs(OMN-14587): fan out canon-shape ratchet baseline to omnibase_infra - #2300

Merged
jonahgabriel merged 4 commits into
devfrom
jonah/omn-14587-fan-out-canon-shape-ratchet-omn-1435514368-to-omnibase_infra
Jul 14, 2026
Merged

jonahgabriel merged 4 commits into
devfrom
jonah/omn-14587-fan-out-canon-shape-ratchet-omn-1435514368-to-omnibase_infra

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Evidence-Source: OCC#4143
Evidence-Ticket: OMN-14587

Summary

Generates and commits scripts/ci/canonical_handler_shape_baseline.py for
omnibase_infra by running omnibase_core's canon-shape classifier
(OMN-14355/14368) against this repo's node tree via the existing
--package/--src-root/--baseline fan-out flags — the exact command
OMN-14587 specifies:

uv run python <omnibase_core>/scripts/ci/canonical_handler_shape.py --update \
    --package omnibase_infra --src-root <omnibase_infra>/src \
    --baseline <omnibase_infra>/scripts/ci/canonical_handler_shape_baseline.py --full

Mirrors the omnimarket baseline (OMN-14368: 111 non-canonical / 350 total).
This is measurement only — no handler code changed.

Result: 115 node contract.yaml files scanned, 22 canonical, 93
non-canonical (baseline freezes the 93). Category breakdown: nonadaptable
45, op_method 25, empty 12, envelope_in_core 8, no_binding 3.

Note: 2 of the 115 scanned entries
(omnibase_infra.nodes.node_architecture_validator /
.node_architecture_validator.handlers, and the node_ledger_projection_compute
equivalent) are duplicate hits from a nested handlers/contract.yaml file
sitting alongside the node's own top-level contract.yaml — a data-quality
artifact worth a separate look, not fixed here.

Update (follow-on commit): CI-gate wiring

The original PR shipped baseline-generation only, deferring CI-gate wiring
to keep the change reviewable as pure measurement. This follow-on commit
(daeba345) closes that deferred deliverable: adds a "Canonical
handler-shape ratchet" step to the existing lint job (a required needs:
dependency of the required "CI Summary" check), mirroring the omnimarket
wiring (OMN-14372/#1751) exactly — same --full scan, same sibling-checkout
reuse pattern (.ci/omnibase_core, already cloned for Transport-mock lint /
OMN-13026), same "no pre-commit mirror yet" rationale (OMN-14563 tracks the
real fix: relocate the classifier into an installed omnibase_core module;
pre-commit try-repo empirically proved a manifest-only export doesn't
work).

Closes the "[ ] Wire it as an enforced CI gate" item in OMN-14587.

dod_evidence (CI-gate wiring, OMN-14587)

RED/GREEN proof, local, against the committed baseline
(scripts/ci/canonical_handler_shape_baseline.py):

  • RED (full scan, throwaway node node_zzz_canary_throwaway with a
    raw-dict handle(self, data: dict) -> dict): hard-fails "NEW
    non-canonical node(s)" — exit 1. The 93 baselined non-canonical nodes
    stayed WARN (non-blocking), not RED, confirming the shrink-only ratchet
    discriminates baselined debt from new regressions.
  • GREEN (full scan, throwaway removed): new=0 unproven_flips=0 warn=93 — exit 0.
  • pre-commit run --files .github/workflows/ci.yml — all applicable hooks
    pass.

CI enforcement not yet proven live: this repo's lint job (and every
other job) is gated behind occ-preflight, which fails on this PR pending
an OCC companion (Evidence-Source missing) — the same state as before this
commit. The new step has not executed in a green CI run yet. proof_class =
code-complete + locally-RED/GREEN, NOT enforcement-proven, pending the OCC
companion below.

OCC-COMPANION-NEEDED: omnibase_infra#2300 OMN-14587 (not authored here —
per 2026-07-13 operator decision, agents do not author OCC companions;
Codex owns all OCC).

Closes OMN-14587.

Test plan

  • scripts/ci/canonical_handler_shape.py --update --package omnibase_infra --src-root ... --baseline ... --full run against a fresh dev-based
    worktree; output confirmed 115 nodes / 22 canonical / 93 non-canonical.
  • Pre-commit hooks passed on the new file (SPDX header, ruff format/check,
    trailing whitespace, etc.).
  • CI-gate wiring: local RED/GREEN proof above; pre-commit run --files .github/workflows/ci.yml clean.
  • gh pr checks 2300 green — blocked on occ-preflight (OCC companion
    owed), not on this change's own content.

Summary by CodeRabbit

  • Chores
    • Added automated CI checks to detect newly introduced non-standard handler patterns.
    • Added a baseline to track existing handler-shape exceptions and prevent regression.

Evidence-Commit: 9d39582a61ee122f9afb3e627621f15a4268851e

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a frozen non-canonical handler-shape baseline and a lint CI gate that runs the canonical handler-shape classifier against omnibase_infra source and rejects new violations or baseline growth.

Changes

Handler-shape ratchet

Layer / File(s) Summary
Frozen handler-shape baseline
scripts/ci/canonical_handler_shape_baseline.py
Defines the documented ratchet rules and frozen NON_CANONICAL node-path tuple.
Lint enforcement
.github/workflows/ci.yml
Runs canonical_handler_shape.py in full mode using the baseline and current src tree, failing on newly introduced non-canonical nodes or baseline growth.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActionsLint
  participant CanonicalHandlerShape
  participant OmnibaseInfraSrc
  participant HandlerShapeBaseline
  GitHubActionsLint->>CanonicalHandlerShape: run full classification for omnibase_infra
  CanonicalHandlerShape->>OmnibaseInfraSrc: inspect handler-shape nodes
  CanonicalHandlerShape->>HandlerShapeBaseline: compare against NON_CANONICAL
  HandlerShapeBaseline-->>GitHubActionsLint: provide frozen baseline
  CanonicalHandlerShape-->>GitHubActionsLint: pass or fail on new nodes or baseline growth
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly summarizes the main change: extending the canon-shape ratchet baseline to omnibase_infra.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-14587-fan-out-canon-shape-ratchet-omn-1435514368-to-omnibase_infra

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

Test Runner added 3 commits July 13, 2026 22:31
Generate omnibase_infra's committed canonical_handler_shape_baseline.py by
running omnibase_core's classifier (OMN-14355/14368) against this repo's
node tree via the existing --package/--src-root/--baseline fan-out flags.
Mirrors the omnimarket baseline (OMN-14368) — no code changes, measurement
only. 115 nodes scanned, 22 canonical, 93 non-canonical (baseline freezes
the 93). CI-gate wiring (mirroring omnimarket's OMN-14372) is a follow-on,
not included here.
…ra CI gate

Follow-on to the baseline-only commit above (9f13cd6): adds the deferred
CI-gate wiring step, mirroring the omnimarket pattern (OMN-14372/#1751)
exactly. Adds a "Canonical handler-shape ratchet" step to the existing
`lint` job (a required `needs:` dependency of the required "CI Summary"
check via the ci-summary job's needs list), invoked via the sibling
omnibase_core checkout already cloned in this job for Transport-mock lint
(.ci/omnibase_core, OMN-13026) since the classifier lives at
omnibase_core's repo-root scripts/ci/, not the installed package. Runs
--full (not the default --scope changed) for the same cwd-mismatch reason
documented in #1751: the classifier's diff-scoped git-diff assumes cwd =
its own repo, wrong for a fan-out invocation against a sibling checkout.
--full is cheap here (~115 nodes, sub-second).

No pre-commit mirror: same infeasibility already verified empirically for
the omnimarket fan-out (OMN-14563, via `pre-commit try-repo` — language:python
resolves the wrong cwd, language:script has no dependency isolation). CI-only
enforcement matches the omnimarket precedent and several other gates already
in this job list.

dod_evidence (OMN-14587):
- RED (full scan, throwaway node_zzz_canary_throwaway with a raw-dict
  handle(data: dict)): hard-fails "NEW non-canonical node(s)" — exit 1.
- Baselined 93 non-canonical nodes stay WARN (non-blocking), not RED,
  throughout — shrink-only ratchet confirmed.
- GREEN (full scan, throwaway removed): new=0 unproven_flips=0 warn=93 —
  exit 0.

Closes the "[ ] Wire it as an enforced CI gate" deliverable in OMN-14587.
OCC companion owed to Codex (agents do not author OCC companions).

Test plan:
- [x] pre-commit run --files .github/workflows/ci.yml — all applicable
      hooks pass
- [x] YAML parses (python3 -c "import yaml; yaml.safe_load(...)")
- [x] Local RED/GREEN proof above, reproduced against the committed
      baseline (scripts/ci/canonical_handler_shape_baseline.py)
- [ ] gh pr checks green on CI (watching; occ-preflight expected red
      pending OCC companion, same as before this commit)
Rebases onto current origin/dev, which picked up OMN-14589's merged
canonicalization of node_coding_agent_invoke_effect (feat(OMN-14589):
canonicalize node_coding_agent_invoke_effect to def-B, a638cf7) — that
node flipped canonical shape in dev AFTER this PR's baseline was
generated, so the ratchet correctly read it as an unproven flip (no
adequacy receipt) rather than a stale-baseline mismatch.

Regenerates via the same command used to originally generate this
baseline (`--update --full`); the diff is exactly the removal of
`omnibase_infra.nodes.node_coding_agent_invoke_effect` from
NON_CANONICAL (93 -> 92) — nothing else changed, confirming this is pure
branch staleness, not a real regression. The other 5 rebased-past
commits (OMN-14594/14580/14597/14517/14605) touch no node contract or
handler files.

dod_evidence:
- Reproduced the CI failure locally pre-regen: "Baselined node(s)
  flipped to canonical shape WITHOUT an adequacy receipt" for exactly
  node_coding_agent_invoke_effect, new=0, matching the live Lint job
  failure on this PR.
- Post-regen: new=0 unproven_flips=0 warn=92, exit 0.
- Re-ran the throwaway RED/GREEN proof (node_zzz_canary_throwaway, raw
  dict handle()) against the regenerated baseline: RED (exit 1, "NEW
  non-canonical node(s)") -> removed -> GREEN (exit 0, new=0 warn=92).
- pre-commit run --files scripts/ci/canonical_handler_shape_baseline.py
  clean.

OCC companion for this PR's new head is owed to Codex (retargets the
existing companion after this rebase); not authored here.
@jonahgabriel
jonahgabriel force-pushed the jonah/omn-14587-fan-out-canon-shape-ratchet-omn-1435514368-to-omnibase_infra branch from daeba34 to d37ebb6 Compare July 14, 2026 05:34

@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

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

263-268: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the classifier checkout for reproducible enforcement.

This step executes code from the .ci/omnibase_core checkout, which uses ref: dev in the surrounding workflow. A moving branch can change classifier semantics without any change to this PR. Pin the checkout to an immutable commit and regenerate the baseline against that exact revision.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 263 - 268, Pin the `.ci/omnibase_core`
checkout used by the “Canonical handler-shape ratchet” step to an immutable
commit instead of the moving `dev` ref, then regenerate
`canonical_handler_shape_baseline.py` using that exact checkout revision so
enforcement remains reproducible.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 243-249: Update the CI comment describing the canonical
handler-shape baseline to report the final baseline count of 92 non-canonical
handlers instead of 93, while preserving the scanned total and keeping it
synchronized with the regenerated baseline.

In `@scripts/ci/canonical_handler_shape_baseline.py`:
- Around line 13-14: Update the generator source that produces the canonical
handler shape baseline so its docstring no longer claims pre-commit enforcement;
describe the classifier as CI-only, then regenerate
scripts/ci/canonical_handler_shape_baseline.py rather than editing the generated
file directly.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 263-268: Pin the `.ci/omnibase_core` checkout used by the
“Canonical handler-shape ratchet” step to an immutable commit instead of the
moving `dev` ref, then regenerate `canonical_handler_shape_baseline.py` using
that exact checkout revision so enforcement remains reproducible.
🪄 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: 76a5d0df-9c6d-40f9-9f72-fb3f47a95b27

📥 Commits

Reviewing files that changed from the base of the PR and between 9c349c1 and d37ebb6.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • scripts/ci/canonical_handler_shape_baseline.py

Comment thread .github/workflows/ci.yml Outdated
Comment thread scripts/ci/canonical_handler_shape_baseline.py Outdated
jonahgabriel added a commit to OmniNode-ai/onex_change_control that referenced this pull request Jul 14, 2026
…e fan-out (#4136)

* evidence(OMN-14587): OCC companion for omnibase_infra#2300 canon-shape fan-out

Independently-authored OCC evidence companion for
OmniNode-ai/omnibase_infra#2300 (OMN-14587) -- author != implementer,
per feedback_no_self_authored_evidence.

3 product-observing content reads pinned to #2300 head SHA
daeba34583fd4d3bc08dc738832bcf1a182fc72c, each RED-controlled against
omnibase_infra dev HEAD 80c26eaa122f0bdc025be2f179c8991a5d8c0d86:
- "Canonical handler-shape ratchet (OMN-14355 fan-out, OMN-14587)" CI
  step wired into the lint job
- canonical_handler_shape_baseline.py freezes exactly 93 NON_CANONICAL
  entries, matching the PR's cited scan (115/22/93)
- deploy assessment: PR diff touches no Dockerfile/compose/deploy asset

Net-new-file-only: adds contracts/OMN-14587.yaml + 3 receipts under
drift/dod_receipts/OMN-14587/; edits no existing file. Self-bind
receipt for this companion's own occ-preflight follows in a second
commit (deterministic commit_sha bind).

* evidence(OMN-14587): add self-bind receipt for OCC companion self-eligibility

Deterministic commit_sha bind (no PR-number prediction under concurrent
lanes): binds to C1 (0e2c388) which carries the contract + 3
product-observing receipts. Contract hash stays stable across both
commits (check_value greps only status: PASS).

* evidence(OMN-14587): refresh infra 2300 head receipts

* evidence(OMN-14587): self-bind OCC 4136 refresh
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