Repository navigation
Conversation
scripts/check_pinned_edits.py hashes the merge-base bytes of every file a branch modifies or deletes, finds every text file that pins that SHA-256, and classifies each pin at the head as stale, repinned or pinner_removed. Stale pins on frozen research/ and upstream/ files fail; living records are advisory unless --strict. On PR CrocSwap#6318 it reports 42 stale pins on four frozen files, including certificates/selected-result.json's source_certificate_sha256. On the last 30 main commits it reports none on frozen files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
scripts/check_pinned_edits.py, a standard-library static check for one class of PR intake failure: a branch rewrites bytes that other files pin by SHA-256. Existing guards (verify_selected_result.py,check_selected_ci_inputs.py) cover the selected record and its replay inputs. Neither covers the many research packages whoseSOURCES.json, receipts or READMEs pin a file.For each file the branch modifies or deletes, the script hashes the merge-base bytes and runs one
git grep -Fover the merge-base tree for the full digests. It then classifies each pinning file at the head:stale: the old digest is still present, so that check fails or describes bytes that no longer existrepinned: the pinner was rewritten, so byte checks pass, but frozen evidence may have changedpinner_removed: the pinner was deletedExit 1 only for a stale pin on a file under
research/orupstream/, the paths CONTRIBUTING/AGENTS declare frozen. Living records (selected record, task catalogue, docs, shared scripts) are routinely updated while older packages keep their digest as context, so their stale pins are advisory unless--strict. A short pointer is added todocs/research/pr-intake.md.Evidence (macOS, Python 3.14.8, main
2485805a6)c3fdf0b8certificates/selected-result.jsonsource_certificate_sha256,certificates/frontier6030-source.json,pr6030-audit/{INPUTS,SOURCE-REUSE}.jsonmain~30..mainREPINNED; 1,281 advisory living-record pinsIndependently of this script, main's
verify_selected_result.check()against the #6318 tree fails withSelected package inventory or bytes changed, and passes on main. About 10 s on the full checkout.tests/test_check_pinned_edits.py(6 tests, temporary git repos) covers: an unpinned edit, an in-place edit with three stale pinners, repinned/removed pinners, deletion beside a binary file, a living-record update (advisory vs--strict), and merge-base use after main moves. Passes underpython3 -Bandpython3 -O -B.Scope and limits
Static byte check of a single diff. It executes no contribution code and is not a replay, review or mathematical check. Only full lowercase 64-hex SHA-256 digests in text files are found. Abbreviated digests, other hashes and pins over decompressed or canonical payloads are missed, so an empty report does not prove frozen evidence is unchanged. The frozen-path rule is a prefix heuristic taken from repository policy. Not wired into CI; a maintainer could add it to the
planjob if wanted.Open next questions
research-packages.yml's plan job onpull_requestwould have flagged Retune P104 twin-rung-removal to the certified tuning ceiling (kappa 0.003125811556925) #6318, which has no CI runs. First step: decide whether advisory output belongs in the job summary.sha256:prefixed or uppercase forms if any package uses them. First step:git grep -c -E '[0-9A-F]{64}'.Related: review of #6318 posted there. Predecessor guards:
scripts/check_selected_ci_inputs.py(Sagar Thakrar),scripts/check_research_commit.py(ywz65).Prepared with substantial AI assistance (Claude Code, Anthropic). Apache-2.0.
🤖 Generated with Claude Code