Skip to content

Record the full object name in the mutation ledger - #155

Merged
thedavidmeister merged 2 commits into
mainfrom
fix-mutation-ledger-sha
Sep 16, 2026
Merged

thedavidmeister merged 2 commits into
mainfrom
fix-mutation-ledger-sha

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

audit/mutation-test-scans.json[0] records "commit": "b3bd859" — a 7-character prefix where the full 40-character object name belongs. This expands it. No other field changes.

Why a prefix is wrong here

The file is the adversarial-mutation-test skill's committed run record, appended by hand, and two automated consumers read it as evidence: the audit skill's Pass-2 gate and rain-org-health's roh-scan. Both feed the recorded value to git as the base for "what changed since the last mutation run". A prefix is not a stable name — it resolves only against a repo that happens to hold the object, and it stops resolving the moment the history grows a colliding one.

The expansion, verified

check result
git rev-parse b3bd859 b3bd859cf84f2dfd89a96721fd43ac02d8d1d88a
git rev-parse --disambiguate=b3bd859 one object — unambiguous today
git merge-base --is-ancestor <sha> origin/main exit 0 — on this history
git describe --tags <sha> v0.1.3-10-gb3bd859

That last line is the corroboration that this is the right tree rather than merely a tree: the record independently claims "publishedTag": "v0.1.3" and "commitsAheadOfTag": 10, and git describe agrees on both. The commit is the #46 merge, dated 2026-07-15, ahead of the record's 2026-07-20 timestamp.

QA

  • Discriminating tests: n/a in this repo — the diff is one field of a data file and this repo has no parser for it. The discriminating check is rainix-static mutation-ledger, added in Validate the hand-appended mutation ledger in shared CI rainix#385 with 29 unit tests and 9 bats tests there; it is the thing that will enforce this file from CI. Built from that branch and run against this clone:

    base (HEAD, "b3bd859"):  ERROR: audit/mutation-test-scans.json[0].commit: "b3bd859" is
                             not a 40-character lowercase-hex git commit — record the full
                             object name (`git rev-parse <ref>`), never a prefix     exit 1
    this branch:             mutation-ledger: clean                                  exit 0
    

    The base line is the fail-on-base evidence: the file was reverted to HEAD in the same clone and the check re-run, not reasoned about.

  • Mutations applied: n/a for this diff — a one-field data change has no code to mutate. The mutations proving the check discriminates were applied against a real ledger in its real clone in rainix#385 (9/9 killed; short-SHA, non-existent-SHA and non-ancestor-SHA each reported with a distinct message). The short-SHA mutant there is this exact defect.

  • Oracle: git, not the file. The full name comes from git rev-parse, and its correctness is cross-checked against two fields the record states independently of the SHA — publishedTag: v0.1.3 and commitsAheadOfTag: 10 — which git describe --tags reproduces as v0.1.3-10-gb3bd859. Ancestry is git merge-base --is-ancestor against origin/main, not a claim about it.

  • Category check: the defect is one record field carrying a prefix rather than an object name; covered. Deliberately not covered here: the other records' shape (there is only one), the summary contents (unverifiable after the fact, and not what is wrong), and the CI gate itself, which is rainix#385's scope rather than this repo's.

Landing note

Once rainlanguage/rainix#385 lands, this repo goes red on its next push until this merges. That is the gate working as designed rather than a regression.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN

Summary by CodeRabbit

  • Chores
    • Updated mutation-test scan metadata to record the complete commit identifier for improved traceability.

audit/mutation-test-scans.json[0] recorded "b3bd859", a 7-character
prefix. Two automated consumers read this file as evidence — the audit
skill's Pass-2 gate and rain-org-health's roh-scan — and both feed the
recorded value to git as the base for "what changed since the last run".
A prefix is not a stable name: it resolves only against a repo that
happens to hold the object, and it silently stops resolving if the
history ever grows a collision.

b3bd859 is unambiguous today and expands to
b3bd859, which is an ancestor of main.
`git describe` on it gives v0.1.3-10-gb3bd859, matching the record's own
publishedTag and commitsAheadOfTag, so this is the tree the run was over.
No other field changes.

rainix#385 adds a shared-CI gate that rejects a short SHA, so this repo
would go red on its next push without this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4ba0a292-3ab9-4a2c-9dfb-9da5f02fb850

📥 Commits

Reviewing files that changed from the base of the PR and between 6825210 and d35df5c.

📒 Files selected for processing (1)
  • audit/mutation-test-scans.json

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The mutation-test scan record now stores the full 40-character commit hash instead of the abbreviated 7-character hash.

Changes

Mutation scan metadata

Layer / File(s) Summary
Full commit hash update
audit/mutation-test-scans.json
The commit value changed from b3bd859 to b3bd859cf84f2dfd89a96721fd43ac02d8d1d88a.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0e03e

The metadata-only update is consistent with the stated commit identity and introduces no merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: recording the full commit object name in the mutation ledger.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-mutation-ledger-sha

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

rainix#385 landed after this branch's first CI run, so that run resolved
rainix-sol-static.yaml@main from before the gate existed and never
executed it. This retriggers so the fix is proven by the check that will
enforce it, rather than only by a local run of the same binary.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
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