Skip to content

feat(OMN-20304): canonical-file-shape ratchet carries a renamed file's baseline entry - #1843

Merged
jonahgabriel merged 1 commit into
devfrom
feat/OMN-20304-rename-aware-ratchet
Oct 2, 2026
Merged

jonahgabriel merged 1 commit into
devfrom
feat/OMN-20304-rename-aware-ratchet

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Ticket: OMN-20304
Ruling: 2026-10-02T00:39:29Z (lane: record-rename-ruling, operator: "yes on both")

Problem
canonical_file_shape check() compared paths only against the head baseline. A git rename of a baselined non-canonical file produced noncanonical-file on the new path, baseline-stale on the old entry, and baseline-growth refused the new path. Real case: omniclaude#2462 renames plugins/onex/skills/_bin/lab-onboarding.sh to omninode-dev-setup.sh.

Change
Renames are detected via git diff -M base..head (default similarity). A renamed path inherits its old path's entry from the BASE baseline. Two forms pass:

  1. Swap (preferred, documented in module docstring): old entry removed, new path added.
  2. Baseline untouched: old entry read as satisfied by the rename, new path covered; the next change must delete the stale entry.

baseline-stale does not fire for the old path of a detected rename. Nothing is inherited when no rename is detected, the old path is not in the base baseline, the new path is not a non-canonical code file, or the swap keeps the old entry and adds the new (growth). No bypass flag, no allowlist.

Tests
7 new tests in tests/unit/validators/test_canonical_file_shape.py:

  • swap passes
  • untouched passes
  • rename+edit passes
  • rename of unbaselined file fails noncanonical-file
  • rename plus extra script fails noncanonical-file
  • swap without detected rename fails baseline-growth
  • rename keeping old entry and adding new fails baseline-growth

4 of the 7 (swap, untouched, edit, extra-script) fail on the old validator. 51 pass with the change.

Checks

  • mypy --strict clean on the file
  • ruff clean
  • pre-commit passed with hooks on

Also
.pre-commit-config.yaml adds canonical_file_shape.py to the validate-no-manual-yaml exclude list (it reads yaml.safe_load of the target repo's pre-commit config, added in #1839; the hook flags the whole file once it is touched), with a comment.

Evidence-Ticket: OMN-20304
Evidence-Source: OCC#12259

Lab: host h202, lane rename-aware-ratchet, uv run pytest tests/unit/validators/test_canonical_file_shape.py -n 0 -q -> 51 passed (4 of the 7 new tests fail on the old validator); uv run mypy --strict on the validator -> no issues.

…s baseline entry

A git rename (diff -M, base..head) of a baselined non-canonical file now
inherits the old path's base-baseline entry: swap or untouched baseline both
pass; no rename, unbaselined source or net growth still fails.

CITE-AS: RULING 2026-10-02T00:39:29Z lane=record-rename-ruling
@jonahgabriel
jonahgabriel requested a review from a team as a code owner October 2, 2026 00:46
@jonahgabriel
jonahgabriel enabled auto-merge (squash) October 2, 2026 00:48
jonahgabriel pushed a commit to OmniNode-ai/onex_change_control that referenced this pull request Oct 2, 2026
…12259)

* evidence(OMN-20304): author OCC companion for OmniNode-ai/omnibase_core#1843

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

* evidence(OMN-20304): self-bind OCC#12259 + rebind contract_sha256

---------

Co-authored-by: omnimarket-bot <bot@omninode.ai>
@jonahgabriel
jonahgabriel merged commit 07a3f5f into dev Oct 2, 2026
403 of 431 checks passed
@jonahgabriel
jonahgabriel deleted the feat/OMN-20304-rename-aware-ratchet branch October 2, 2026 01:32
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