Add mkprobes hash --write to backfill the codebook sidecar - #6
Open
Loyale wants to merge 1 commit into
Open
Conversation
make-codebook writes <codebook>.hash, but only for codebooks it creates. A codebook made before that existed has none, and the only way to get one was a shell redirect - or re-running make-codebook, which would reassign every bit and orphan probes already designed against the old assignments. `--write` drops the sidecar beside the codebook already on disk, leaving the codebook byte-identical. Verified on a real 161-target panel. If a sidecar exists holding a different value, it is updated but the mismatch is reported: it means the codebook was edited after the sidecar was written, so anything designed in between matches neither hash. `hash` now uses hash_codebook_file, so the printed value, the sidecar and the provenance stamp all come from one implementation, and it takes exists=True rather than failing with a traceback on a missing path. Co-Authored-By: Claude Fable 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.
make-codebookwrites<codebook>.hash, but only for codebooks it creates. A codebook made before that landed has no sidecar — and the only ways to get one were a shell redirect, or re-runningmake-codebook, which reassigns every bit and would orphan probes already designed against the old assignments.--writedrops the sidecar beside the codebook already on disk:mkprobes hash panel_a/codebook.json --writeVerified against a real 161-target panel: sidecar written, codebook byte-identical, all 161 targets intact.
Details
hashnow useshash_codebook_file, so the printed value, the sidecar and the provenance stamp cannot drift apart.exists=Trueon the argument, so a missing path is a usage error rather than a traceback.Verification
331 tests with external tools, 329 without, at terminal widths 40 and 100. Docs build clean under
-W, checked by exit code.🤖 Generated with Claude Code