Repository navigation
chore(OMN-14340): ratchet protocols→models frozen ignores + hub growth-ratchet in omnibase_core - #1423
Conversation
…h-ratchet in omnibase_core
Operator ruling on protocols→models (OMN-3210 cycle family): no permanent
exception, no interim DTO relocation — the fix rides the RSD canonical rewrite.
This makes "no permanent exception" mechanically true in the interim WITHOUT
doing the deferred relocation, and adds a cheap growth-ratchet on the hub modules
to stop the tangle compounding. Does NOT touch protocols→models source.
The import-linter wildcard `ignore_imports` lines are permissive — they silently
allow NEW edges of a frozen class. This ratchet closes that gap:
- scripts/ci/check_import_ratchet.py: grimp enumerates the live direct edges; a
generated Python baseline (scripts/ci/import_ratchet_baseline.py) freezes the
allowed sets; any edge/importer not in the baseline hard-fails.
- protocols→models frozen at 65 (headline "no permanent exception" number).
- utils/mixins/protocols hub-inbound frozen (548/17/63); a NEW module importing
a hub hard-fails. Hubs are NOT dissolved (dissolution waits for the rewrite).
- Wired as CI gate (step added to the blocking `Import Layering Oracle` job) +
pre-commit hook (mirrors the lint-imports hook). Enforcement, not detection.
- .importlinter protocols→models ignore line tagged with the RSD-rewrite
retirement mechanism (regeneration) + owner + date.
- tests/unit/scripts/ci/test_check_import_ratchet.py: asserts no new edges,
frozen count 65, and synthetically proves the ratchet hard-fails on growth
(so it can't rot into a no-op).
dod_evidence:
- lint-imports: 4 kept, 0 broken (comment-only .importlinter change).
- ratchet: proven end-to-end + synthetic hard-fail on a new protocols→models edge
and a new hub importer; exit 0 clean.
- baseline: protocols→models=65, hub_inbound={utils:548, mixins:17, protocols:63}.
- mypy --strict (checker) clean; ruff format+check clean (generator is ruff-clean);
9 ratchet tests pass; pre-commit (changed files) exit 0 all hooks.
Refs OMN-3210
Closes OMN-14340
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…=hard-fail Operator decision 2026-07-10: a hard non-increasing ratchet on the 548-importer utils hub fires on most new files -> friction -> gets routed around (rubber-stamped baseline edits) -> not real enforcement (rule #5). utils is also scheduled for dissolution in the RSD rewrite, so a hard freeze on a doomed hub is low-value. - utils hub -> WARN only: net-new importers are logged to stderr and show in the baseline diff, but do NOT block (exit stays 0). Visibility preserved, zero merge friction. - mixins (17) + protocols (63) stay HARD-FAIL — low-churn, clearly worth it. - protocols->models frozen-at-65 HARD-FAIL unchanged. check_import_ratchet.py: split HARD_FAIL_HUBS=(mixins,protocols) vs WARN_HUBS=(utils); find_violations() covers hard families only; new find_warnings() surfaces utils. main() prints warnings (non-blocking) then hard violations (exit 1). Baseline header, pre-commit comment, and CI summary updated to reflect the tiering. Tests: utils-injection asserts WARN-not-fail (find_warnings hit, find_violations miss, main() exit 0); mixins/protocols-injection assert hard-fail; ratchet-can't-rot coverage retained. 12 tests pass. dod_evidence: end-to-end proof — utils new importer -> exit 0 + WARNING; mixins new importer -> exit 1 FAILED; cleanup -> exit 0. lint-imports 4/0; mypy --strict clean; ruff clean; pre-commit exit 0. Refs OMN-3210 Closes OMN-14340
Summary
Makes the operator's "no permanent exception" ruling on
protocols→models(the ~65-edge cycle family of epic OMN-3210) mechanically true in the interim, WITHOUT doing the deferred DTO relocation (which rides the RSD canonical rewrite). Also adds a tiered growth-ratchet on the hub modules to stop the tangle compounding.Does NOT touch
protocols→modelssource — enforcement/ratchet only.Closes OMN-14340 · Refs OMN-3210
Problem
The intra-core import-linter oracle freezes known back-edges as wildcard
ignore_importslines (e.g.omnibase_core.protocols.** -> omnibase_core.models.**). A wildcard ignore is permissive: it silently allows new edges of that class. So "frozen debt" can actually grow.Mechanism
scripts/ci/check_import_ratchet.pyuses grimp (import-linter's own graph builder) to enumerate the live direct edges and compares against a generated baseline (scripts/ci/import_ratchet_baseline.py).mixins(17) +protocols(63) → HARD-FAIL on a new importer. Low-churn, clearly worth it.utils(548) → WARN only (non-blocking, exit 0). A hard freeze on a 548-importer hub fires on most new files → friction → gets routed around (rubber-stamped baseline edits) → not real enforcement (rule feat: implement complete 4-node canary deployment architecture #5).utilsis also scheduled for dissolution in the RSD rewrite, so a hard freeze on a doomed hub is low-value. Net-newutilsimporters are still logged and show in the baseline diff — visibility preserved, zero merge friction..importlinterprotocols→models ignore line tagged with the RSD-rewrite retirement mechanism (regeneration) + owner + date.Import Layering Oraclejob (inherits thequality-gateneeds), plus animport-ratchetpre-commit hook.Retirement: the RSD rewrite regenerates these modules canonically (dissolving the protocols↔models cycle); the baseline drains to empty and this file + ratchet are deleted. Sanctioned downward re-freeze:
uv run python scripts/ci/check_import_ratchet.py --update.dod_evidence
lint-imports: 4 kept, 0 broken (comment-only.importlinterchange).utilsimporter → exit 0 + WARNING (surfaced, non-blocking); a newmixinsimporter → exit 1 FAILED; a synthetic protocols→models edge → exit 1; cleanup → exit 0. Unit tests assert each tier (utils = warn-not-fail incl.main()exit 0; mixins/protocols = hard-fail), so the gate can't rot into a no-op.protocols→models=65,hub_inbound={utils:548, mixins:17, protocols:63}.mypy --strict(checker) clean; ruff format+check clean (generator emits ruff-clean output —--updateneeds no manual format); 12 ratchet tests pass; pre-commit (changed files) exit 0, all hooks.Design note
The baseline is a generated
.pymodule (not YAML) to sidestep three yaml-hostile repo hooks (yamlfmt---, manual-yaml-prevention's ban onyaml.safe_load, SPDX-on-yaml). It's SPDX-clean, ruff-clean, class-free..importlinterchange is comment-only on the protocols block (no conflict).Evidence-Source: OCC#3858
Evidence-Commit: ead9fbe70d5780ab8afabc0d64438c649aa17a20
Evidence-Ticket: OMN-14340