Repository navigation
feat(scripts): end every result run with a verdict and sharpen remedies - #324
Merged
Merged
Conversation
added 2 commits
November 18, 2026 15:52
A review of past sessions found agents piping check output through tail or grep, losing the exit status and missing unavailable rows. Every command printing a Result table now ends with one verdict line, naming its exit status and a count per state, from libs/result.sh's EXIT trap; summarize ends the same way. The same review found remedies that misled. Generated-By trailers were typed in a dozen spellings, so attribute-commit --check now refuses one that is not a model ID at commit-msg, and the Co-Authored-By fallback spells the display name as an ID. adr-index exits 0 when its rewrite runs by hand, failing only under pre-commit. doctor's remedy under a global core.hooksPath now installs the hooks, where pre-commit install refuses. payload-parity prints the cp that mirrors a pair when exactly one copy changed. The Go audit names the Go release that clears a failure found only in the local standard library, which CI's stable Go never reports. commitlint's ignores are functions a YAML config cannot hold, so a hand-written merge takes the default-ignored "Merge <what> into <branch>" shape, now documented and tested. Generated-By: claude-opus-5-5
attribute-commit --check refused a merge, revert or fixup commit with no trailer, which commitlint's trailer-exists skips; a missing trailer is now left to commitlint, and --check refuses only a malformed value. Its ID shape admits other vendors' IDs (qwen3-coder:30b, ...@20250805, a provider path, uppercase) and still refuses spaces and a [suffix]. The display-name fallback trims a hyphen left at either end by stray spacing. payload-parity mirrored a staged deletion with a cp from the deleted copy; it now prints the git rm that mirrors it. doctor's hooksPath remedy quotes the shim paths, so it runs from a clone whose path holds a space. The verdict line is formatted once, by result_verdict in libs/result.sh, which summarize now calls for the command it ran. The retrofit hook probe accepts any Generated-By once the Co-Authored-By is gone, since a session with a known model writes the model rather than the slug. Generated-By: claude-opus-5-5
Owner
Author
|
Code review: standard scan, clean. Axes: Standards+Spec, Correctness/Logic Reviewed-Head: 18b1b06 |
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.
Intent
From an operator-requested review of past session transcripts: 5,231 script runs and hook firings, checked to see whether the scripts work and where they could be widened.
The scripts' verdicts were sound, but agents misread them. They cut output short with
tailorgrep, which lost the exit status and theunavailablerows. Several remedies also pointed the wrong way. After this change:<cmd> exited <status>: <count per state>;Generated-Bytrailer must be shaped as a model ID;adr-indexrun by hand does not break an&&chain;doctor's remedy works under a globalcore.hooksPath;payload-parityprints the mirroringcp, orgit rmfor a deletion, when only one copy of a pair changed;scripts/cleanmoves its "Add project-specific cleanup" hint from every run's output into a comment, andscripts/detect's usage saysprobelists which checks exist.Read first
scripts/libs/result.sh:99:result_verdict, andresult_exit_verdictwith its guarded EXIT trap. Every Result-table command inherits it;summarizecallsresult_verdictfor the command it ran.scripts/attribute-commit:163: the--checkbranch, wired as theattribution-checkcommit-msg hook in both.pre-commit-config.yamlcopies.scripts/libs/detect.sh:677:_govulncheck_moduleand_govulncheck_stdlib_note.scripts/payload-parity:88:staged_editandmirror_command, which printsgit rmwhen the edited copy is a staged deletion.scripts/doctor:95: the remedy undercore.hooksPath.apps/github-repository-template/src/base-repo/file underscripts/and.github/is a byte copy of the root's (payload-paritypasses).apps/repo-builder/src/scripts/retrofit.py's hook probe accepts anyGenerated-Byonce theCo-Authored-Byis gone.Decisions
result.sh, not fromtally.tallyis also called mid-script (for example insecuritybefore the audit), so it cannot be the last line. The trap is installed only when no EXIT trap exists, so it never clobbers a script's or the test harness's cleanup. The suites print their own totals instead.--checkaccepts any vendor's ID shape (^[A-Za-z0-9][A-Za-z0-9._:@/-]*$), not a list of Claude models. A list would refuse the next model, and the shape admitsqwen3-coder:30b,...@20250805and provider paths while refusing spaces and[1m]. It checks shape, not that the model exists.trailer-exists, which skips merge, revert and fixup subjects on its default ignore list;--checkrefusing it too broke a person's localgit merge.Co-Authored-Byfallback slugs the display name rather than dropping it, so a commit made without the commit-model hook still lands, with a searchable trailer.ignoresforMerge #N: title. commitlint's ignores are functions, which YAML cannot hold, and a JS config would bring back thepackage.jsonthe YAML exists to avoid. The default-ignoredMerge <what> into <branch>shape is documented and tested instead.SKIP=no-commit-to-branchandshellcheck -xare unchanged.scripts/checkalready sets the skip. Measured,-xcosts nothing: 53 files took 16.43s serially without it and 16.45s with it. The real cost is about 0.8s per script that sourcesdetect.sh, and parallelism already brings the hook to 8.5s.Out of scope
doctorflagnode_modulesthat is out of date withpackage-lock.json, from the same review: not requested.--verboseis given: not requested.Verified
scripts/check→scripts/check exited 0: 0 FAIL, 0 unavailable, 5 not-applicable, 26 passscripts/tests/capabilities-test→ 81 passed, with new cases for a stdlib-only Go failure (note printed) and a module failure (no note).scripts/tests/commitlint-test→ 7 passed;Merge feature/x into mainis accepted andMerge #12: titlerefused.scripts/tests/attribute-commit-test→ 33 passed (vendor IDs, a trailer-less merge, no end hyphen);scripts/tests/payload-parity-test→ 22 (a deletion mirrors asgit rm);scripts/tests/precommit-hooks-test→ 10 (the hooksPath remedy now runs from a path with a space);scripts/tests/result-gate-test→ 12;scripts/tests/summarize-test→ 10;scripts/tests/adr-index-test→ 17.-k Hooks→ 11 passed.govulncheckrun under go1.24.4 printedfixed by go1.25.8. Rerunning withGOTOOLCHAIN=go1.25.8+autoexited 0 withNo vulnerabilities found.doctor's printed hooksPath remedy, run in a scratch clone, installed every hook, and a commit through them succeeded.Not verified
sedfor the fallback'sy///lowercasing and thesort -Vin the Go note. Both ran only on GNU coreutils.doctorremedy on macOS, and with a local, rather than global,core.hooksPath.Merge danger
Door: two-way. A revert restores every script, and nothing is stored or migrated.
Blast radius:
attribution-checkrefuses aGenerated-Bythat is not a model ID. Hand-typed display names such asClaude Opus 5.5stop passing.scripts/summarize's parser.