Repository navigation
Add the SQ-LOCK-01 executor: squabble relock - #164
Conversation
Repairs actions.lock records whose ref: repeats their own SHA, in the row's order (highest full-semver tag, else highest semver, else first tag, else the default or only branch that holds the commit); ties and no ref are referrals. Pure core in squabble-core (lockfix), thin CLI in squabble-cli (relock). Changes only the flagged ref: lines and re-checks its own result; a dry run unless --write and the guards say Apply (ESTATE_AUTOFIX); reusable callers are read from the repo's workflows and never rewritten; never claims the rule's check passed (the repo's lock gate on the PR is the check). First proof: its output for ZeroInflatedCounts.jl cicd-suite@0da816c0 is byte-identical to the hand repair in ZeroInflatedCounts.jl#22. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit details
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. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
…pository (#166) ## Summary The second step of the SQ-LOCK-01 executor (#164). `squabble relock` could repair a lock only from an evidence TSV that a person gathered by hand. `--gather` asks each flagged record's own repository instead, so the executor can run from a lock and its workflows alone. Still read-only on every repository, and still a dry run unless `--write` is given and the guards say Apply. Live check, no hand-made evidence: - ZeroInflatedCounts.jl's `hyperpolymath/cicd-suite@0da816c0…` (no tags; the commit is on `main`) gives `main`, byte-identical to the hand repair in ZeroInflatedCounts.jl#22. - ResidualEvidenceTypes.jl's `actions/upload-artifact@bbbca2dd…` (one tag at that SHA) gives `v7.0.0`. ## Changes - `crates/squabble-cli/src/relock_gather.rs` (new): `git ls-remote --tags` for the tags whose commit is the SHA (an annotated tag by its peeled `^{}` commit). Only when there is no tag: a blob-less fetch of all branch heads into a private temporary directory (removed on drop) and `for-each-ref --contains`. Also the default branch from `ls-remote --symref`. It never writes to the repository it asks and never to the lock. Tests run real git against a local fixture repository (annotated tag found by its peeled commit; branches named when there is no tag; a commit no branch holds is no evidence, not an error; an unreachable remote is an error). - `crates/squabble-cli/src/relock.rs`: `--gather` and `--remote-base`, exactly one of `--evidence` or `--gather`. A failed lookup prints `gather-failed` and leaves the record without evidence, so it is a referral, never a guess. - `docs/decisions/0004-first-line-rule-catalogue.adoc`: the executor section's evidence bullet, and the proof. ## Not in this PR Opening the fix PR is still a separate step that is not built. Nothing has been run on any repository other than as the read-only comparisons above, and no applier wave is widened by this. ## RSR Quality Checklist ### Required - [x] Tests pass (`cargo test`: 106 in the CLI crate, 215 in squabble-core) - [x] Code is formatted (`cargo fmt --check`) - [x] Linter is clean (`cargo clippy --all-targets -- -D warnings`) - [x] No banned language patterns - [x] No `unsafe` blocks - [x] No secrets, credentials, or `.env` files included - [x] SPDX headers present on the new file; no licence edits ### As Applicable - [x] Documentation updated (ADR 0004) --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU)_



Summary
The owner said to build the SQ-LOCK-01 executor (2026-11-14). Until now only the detector existed (
self_sha_lock_records); nothing repaired a lock.squabble relockrepairs the records whoseref:repeats their own SHA, using the order the catalogue row already gives.First proof: on ZeroInflatedCounts.jl's lock,
hyperpolymath/cicd-suite@0da816c0…(cicd-suite has no tags and holds the commit on itsmain), the executor's output is byte-identical to the hand repair in ZeroInflatedCounts.jl#22.Changes
crates/squabble-core/src/lockfix.rs(new, pure, no network):choose_ref(highest full-semver tag, else highest semver tag, else first tag, else the default or only branch that holds the commit; ties and no ref areRefusals),rewrite_refs(only the directref:line of a named record; line endings kept; an unwritable ref is refused),plan_lock_fix, andreusable_callers(job-level reusable callers from a workflow). Its own check,check_rewrite, fails closed: same line count, only the editedref:lines differ, edited records no longer flagged, refused ones still flagged.crates/squabble-cli/src/relock.rs(new):squabble relock --lock <file> --evidence <tsv> (--workflows <dir> | --callers <file>) [--attempts n] [--open-fix-pr] [--write]. A dry run unless--writeis given anddecide(theESTATE_AUTOFIXkill switch, two attempts per head, one open fix PR per rule) returns Apply. It writes through a temp file and a rename. Exit 0 all repaired, 4 some are referrals, 2 error.crates/squabble-core/src/rules.rs: four private helpers madepub(crate)for reuse, nothing else.docs/decisions/0004-first-line-rule-catalogue.adoc: a section on the executor.Two things worth a reviewer's eye
metadatastician/standards@6038…, a valid reusable-caller record whoseref:repeats its SHA by design. Had evidence existed for it, it would have been rewritten and broken the lock's closure. So callers now come from the repository's own workflows, and a run with neither--workflowsnor--callersis an error.check: not run here; the lock gate on the PR is the check. The rule's check is the repository's lock gate, run on the PR.Not in this PR
RSR Quality Checklist
Required
cargo test: 215 in squabble-core, 100 + 58 in the CLI crates)cargo fmt --check)cargo clippy --all-targets -- -D warnings)unsafeblocks.envfiles includedAs Applicable
Generated by Claude Code