Repository navigation
Conversation
Refs #904 check_release_tree.py now FAILs any shipped shell function whose whole body is a single call to another function with a positional parameter ($1..$9, ${1}..) spliced into a string argument. This is the shape that held three of scripts/log.sh's dispatch reporters at the Anthropic directory as COMMAND_SCRIPT_NOT_FOLLOWED until #899 r40 restored them to self-contained bodies; tests/test_dispatch_reporter_shape_898.py pinned it only for those three named functions, this generalizes the needle to any shipped function. Red test first (tests/test_single_line_delegate_positional_905.py), paired must-fire/must-not-fire controls, and confirmed today's log.sh and the real built release tree do not trip it. Also closes #904 parts 1 and 2 (not part 3, the session-start redesign): - part 1: a .claude/jit-context entry (paths/00-manual/hook-script-size-budget.md) fires on any edit under scripts/*.sh, stating the 128 KiB scanner limit, the 120 KiB release budget, and the scanner's known triggers (case, typed <<, naming another script by path, and this issue's positional-delegate shape). Proven to fire on scripts/log.sh and scripts/session-start-hook.sh edits and to stay silent on README.md. - part 2: confirmed the ordinary pytest job already gates this on every pull request via test_strip_shell_comments_900.py::test_this_repository_built_tree_has_no_check_failures, which builds the release tree and asserts zero check_release_tree.py offenders. No new CI job was needed; documented the gap in docs/releasing.md instead. Closes #905 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Refs #904 Self-review (Explore + oss:auditor spawned against the committed diff) found that _check_single_line_delegate_positional missed real instances of its own target shape: - a function declared with the `function` keyword, not only bare `name()` -- _FUNC_DEF_MULTI/_FUNC_DEF_SINGLE now accept an optional `function` prefix. - an unquoted positional splice (`other_func msg:$1`) -- the check now also scans bareword arguments after stripping quoted segments, not only double-quoted strings, while still exempting a bare `$1` standing alone as its own argument. - the hook-script-size-budget.md jit-context entry's `match: scripts/.*\.sh$` under-covered what check_release_tree.py's own _SCRIPT_DIRS actually scans (hooks/ and hooks.d/ ship real tracked .sh files too, e.g. hooks.d/after_save/50-git-backup.sh) -- widened to (scripts|hooks|hooks\.d)/.*\.sh$ and proven to fire on a hooks.d/*.sh edit. Also fixed, found independently while verifying the auditor's CRLF/ single-line-body report: a single physical-line function body (`name() { stmt; }`, the actual r38/r39 on-disk shape) and a CRLF- encoded .sh (this repo ships no .gitattributes, so nothing forces LF) both silently evaded the multi-line-only regex. Confirmed red against the prior committed version before fixing, via a direct re-exec of that version's check_tree over both fixtures. Six new paired must-fire/must-not-fire tests; full targeted suite (44 tests across this file + test_dispatch_reporter_shape_898.py + test_strip_shell_comments_900.py + test_release_branch_check_900.py) green. Not fixed, judged out of the needle's literal scope (whole body is a single CALL, not an assignment): `msg=$(other_func "text $1")` -- a variable assignment whose RHS is a command substitution calling another function is a related but distinct shape from "the function's whole body delegates," and extending to it risks new false positives/negatives without a second held-shape data point to pin against. Noted in the PR body rather than filed, since it is this diff's own code and not blocking. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Refs #904 Auditor review noted _check_single_line_delegate_positional had no try/except around data.decode("utf-8"), unlike its neighbor _check_shell_comments, which reports a non-UTF-8 file as an offender rather than letting the decode raise and crash the whole check_tree run. Mirrors that sibling's handling (one line, same message shape). Not a general fix: _check_launchers has the same gap and is out of this diff's scope. Co-Authored-By: Claude Sonnet 5 <[email protected]>
fdaviddpt
added a commit
that referenced
this pull request
Oct 6, 2026
* docs(trap.d): log round-1 v0.41.0 release-audit findings Gate 3's oss:release-auditor found two non-blocking (misreports) findings in the v0.40.0..HEAD delta (#911/#912): the #902 FATAL refusal is unreadable because log()'s own stderr fallback never fires once MEMORY_LOG_FILE is /dev/null, and the #902 changelog fragment overclaims mkdir-guard coverage since bootstrap-dirs.sh builds the same tree ahead of the guard on the slow path. Logged rather than filed per findings.md's misreports routing; /oss:curate decides later whether either becomes a rule. Co-Authored-By: Max <noreply> * docs(trap.d): clarify misreports routing note Co-Authored-By: Max <noreply>
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.
Adds a FAIL-grade needle to
.github/scripts/check_release_tree.pythat catches a shell function whose whole body is a single call to another function with a positional parameter ($1..$9,${1}..) spliced into a string argument -- the shape that heldscripts/log.sh's three dispatch reporters at the Anthropic directory asCOMMAND_SCRIPT_NOT_FOLLOWEDuntil #899 r40.Closes #905.
Also folds in #904 parts 1 and 2 (NOT part 3, the session-start structural redesign, which stays open and unaddressed here):
hook-script-size-budget.md) naming the 128 KiB scanner limit, the 120 KiB release budget, "shrink real code, never minify", and the known scanner triggers;docs/releasing.md, that the existing pytest job (test_strip_shell_comments_900.py::test_this_repository_built_tree_has_no_check_failures) already gates hook size pre-merge across the full 3-OS/4-interpreter matrix, so part 2 needed no new CI job.Refs #904.
Self-review (an Explore-type reviewer plus
oss:auditor, both spawned read-only against the first commit) found four real coverage gaps, all addressed: the jit-context match pattern under-coveredhooks.d/*.sh(fixed), the needle missed an unquoted positional splice (fixed), thefunctionkeyword declaration form was invisible to the regex (fixed), and twomisreports-class gaps -- a single-physical-line function body and CRLF line endings, both independently reproduced as red against the pre-fix committed source before being fixed. One related shape (msg=$(other_func "text $1"), a command-substitution assignment rather than a bare delegating call) was deliberately left out of scope, recorded as a reasoned decision in the commit message rather than filed separately.44 targeted tests green across the touched suite; full repository suite left to CI per this repo's own test_command discipline.
[AI-generated]