Repository navigation
Run CI's checks before proposing results; allowlist propose's commands - #217
Merged
Merged
Conversation
The results bot verified seals, regenerated the replay namespaces and built the database twice, but never ran the suite or the format check, so #195, #204 and #206 opened ready and failed CI. The build job now runs ci.yml's own ruff and pytest lines (pinned word for word) and its no-drift check on the assembled tree, with no token and no step command files in reach. A failure no longer means a red ready PR: the PR opens as a draft whose body names the failing tests, files or paths, and a failing rebuild turns an open PR back into a draft. Nothing marks a PR ready. runs_pipeline_code matched shell names before quote removal, so b''ash and b\ash ran bash past it. It now lists every command bash would run from propose (substitutions, groups, compound commands, function bodies) and requires each command word, as written, to be one propose uses; what the parser does not model is flagged. Both bypasses are test cases. Review of 2443472, findings 2 and 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ctor
Bash evaluates an array subscript, a substring offset, ${!name}, $[...]
and an array literal's [index] as arithmetic, and arithmetic runs a
command substitution held in a value: with x='a[$(touch m)]', each of
${a[x]}, ${y:x}, ${!x}, a[x]=1, $[x] and a+=([x]=v) ran touch under bash
3.2, past the allowlist. Parameter expansions are now a name with at most
a literal default, alternative or error word, subscripts are @, * or
digits, and indices and $[...] are unmodelled, so flagged.
printf's format must be a literal that is not an option (quoted -v or an
expansion is still -v). git's options that run a program or write a file
are matched after quote removal and as abbreviations, and --output joins
them; gh may not open an editor or browser. The script-level shadowing
check also finds `name () {` and `function name` definitions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three checks listing 100 names of up to 300 characters could reach about 90,000 characters, past the 65,536 GitHub accepts for a pull request body, and the branch would already be pushed when gh pr create failed. Each check now lists at most 50 names of at most 200 characters (about 31,000 for all three), and an end-to-end test fails every check with 80 names of the longest listable length and checks the body still fits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The suite runs with $GITHUB_OUTPUT and the other command-file variables unset, which stops a test that writes one by name. A process that finds the files on the runner's disk can still write them; job 2 already takes every build output as build's word, checked for shape. The script comment, the release doc and a test comment claimed more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of cf8066b (GPT-6.1 Sol, CHANGES REQUESTED on the test-side detector only) found 14 inputs bash runs that the detector passed, each executed under bash 3.2, 5.2.37 and 5.3: [ -v 'a[$(cmd)]' ], an array redeclared from a quoted value, process substitution inside ${...}, brace-expanded printf -v, and git or gh options passed through variables, arrays, braces, backslash line breaks or short-option bundles. Its patch is applied as written: options are checked in every word, after a backslash line break is removed, and brace expansion, [ -v ] and a local declared twice are flagged. The claim is narrowed to options written as words; one assembled at run time is beyond any rule on words. git's -u is dropped from the rule: in git 2.55 it is --set-upstream. Function definitions now count wherever they start, and the script holds no eval, source or . to build one. A node id's brackets end at the first ] its message follows, so an unbalanced [ no longer glues the message on; the report's count bound is 10^9; a duplicate failure counts once. The build job reads what it outputs about the commit before the suite runs in its tree, and pauses workflow commands (::stop-commands:: with a token only it holds) around the checks' output. A rebuild that should be a draft turns its open pull request back into one before the push, not after, and every gh pr ready carries --undo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t words Sol's re-review of f936b49 asked for changes. The one production finding: the runner reads a workflow command only at the start of a line, so a suite that stopped mid-line left `::<token>::` on that line and later commands paused. The pause and the resume now each start a line of their own. The rest is the test-side detector, where it now refuses what it could not see, rather than listing more spellings: - `[` runs only as -n or -z and a word, or two words around = or !=. An operator held in a value or array ([ "$op" "$x" ]) ran test -v. - An argument with an expansion or a glob outside double quotes is flagged: bash turns it into words the text does not show (--web from a value, a default or a file name). A default now counts as a word. - Loops leave the model, so `while` and `until` are commands PROPOSE_RUNS does not list, and each declaration runs at most once. propose has none. - The script-wide pins read text after quote removal, so `c\<newline>at()`, e''val, 'source' and \. no longer pass them. Tests add the count's boundary, the nonce's generation and exposure, and a suite that stops mid-line, which close the review's surviving mutants. The docs state the summary-header limit beside the FAILED/ERROR one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mutation run on 9078c44 showed plain_test's check on split words could not fail, because disallowed already flags them for every command, so it goes. It also showed that weakening the pin on eval, source and . passed: the test asserted on the script and on examples through separate code. Both now go through runs_text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…..' words The review of d3770d6 found two detector misses. Both are test-side: propose uses neither. An array element splits as an argument does, unlike NAME=$x, so `local o='--web '; local a=($o)` hands gh --web, and `local a=(*)` does the same from a filename. Commands.array now raises Unlexed on an element that splits. A redirection can touch the builtin's word: `eval>x y` runs eval, and so do 'source'<x, \.<x and eval&>x, on bash 3.2, 5.2.37 and 5.3. Other characters that end the word leave it no arguments, so the boundary stays narrow: `grep -c .)`, which the script holds, must not match. $"eval" runs eval, and so do $'eval', $'\x65val' and $'\145val', which no normalising of quotes would read. The script holds no $'...' or $"...", so the script-wide pin now refuses both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review of 25f4c9b found two more spellings of eval that the pin missed, which propose does not use. Each runs on bash 3.2, 5.2.37 and 5.3: : 'x # ';eval y case x in x)eval y;; esac The first line of the pair sits inside a quote, so the second is code that only looks like a comment. Setting comment lines aside needs quote state, and shell_residue, which tracks it, refuses the script's heredoc. So runs_text now sets no line aside. That removes code, and a line that looks like a comment can no longer hide anything. The script's comments had two hits, both prose sentences ending in ")."; this rewords both and changes nothing else in the script. The left boundary now counts ), which also covers `x). y` and `x)source y`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 30, 2026 17:35
Contributor
Author
|
Merged at the reviewed head Gates at merge
Independent review (GPT-6.1 Sol, five rounds)
The last review covered only the final commit, by a stop rule set before it ran. Its one new input, a backtick substitution, sits under Known limits. |
This branch was successfully deployed
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.
This closes findings 3 and 2 of the GPT-6.1 Sol review of the results-PR stack (#199, #196, #201, #202). Both were non-blocking gaps. The report,
RESULTS_STACK_REVIEW.md, is copied to~/reviews/scorecard-results-stack-review/. Finding 1, the HF-token fetch order inci.yml, is a separate task.1. The results bot runs CI's own checks before it proposes (finding 3)
The App opened results PRs #195, #204 and #206 as ready, and each failed CI's
pytest · ruff formatjob. The builder verified seals, regenerated the replay namespaces and built the database twice. It never ran the suite or the format check.Now, after every check that stops the run, the
buildjob runsci.yml'spython-job lines on the assembled tree:uvx ruff format --check be nz scorecard_db tests pipeline;uv run --with pytest --with hypothesis --with pypdf --with pyyaml --with numpy --with psutil --with rfc8785==0.1.4 --with jsonschema pytest tests/ -q, withPYTHONPATH=.;git status --porcelain.A test pins both lines, and their environments, to
ci.ymlword for word.Permissions and token handling are unchanged. The checks run in
build, which hascontents: read, unpersisted credentials and no secret. Around them:GH_TOKENorGITHUB_TOKENis set.proposetakes everybuildoutput asbuild's word, checked for shape.::stop-commands::with a token only the script holds).buildoutputs about the commit is read before the checks run.A failure doesn't stop the run. Instead:
preflightsubcommand reports each check's exit status, how many things failed, and the first 50 listable names, as one line of JSON. The names are pytest's node ids from the last short test summary, ruff's files in either output format, and git's paths. Listable means printable ASCII, no backtick, no space at either end, at most 200 characters, so three full lists keep the body under GitHub's 65,536-character limit.proposepasses the report into the body, whereread_preflightrefuses any other shape.gh pr ready --undo) before the force-push. The builder never marks a PR ready.2. The detector checks an allowlist, not shell names (finding 2)
runs_pipeline_code's shell-name regex matched text before bash's quote removal, so{ …; } | b''ashand| b\ashgot past it and ran bash.The regex is gone.
Commandsreads the output ofshell_residue(#202's lexer, unchanged) and lists every simple command bash would run, in all of these places:ifbodies;{ }and( );$(…),<(…)and>(…);${ …; }and${|…;};Anything it doesn't model is flagged:
case, loops, arithmetic, array indices, an array element that splits, brace expansion, a parameter expansion beyond a name with a literal default, and a word after a compound command.proposehas no loop, so each declaration in it runs at most once.disallowedthen requires every command word, as written, to be inPROPOSE_RUNS. That set is exactly whatproposeruns, and a test pins the equality:git,gh,grep,cut,cat,printf,echo,:,[,local,exit,plan,pushgit. It also flags:localwith options or declaring a name twice, andprintfwithout a literal non-option format.[in any shape but-nor-zand a word, or two words around=or!=.test -vevaluates a subscript, and its operator can sit in a value or an array ([ "$op" "$x" ]), so the operator must be a literal and each operand one word.local NAME=$xstays allowed: bash doesn't split a scalar assignment.@/*subscript (${a[x]},${y:x},${!x},$[x],a[x]=,([x]=v)). Arithmetic expands a command substitution held in a value (x='a[$(cmd)]').proposeuses, andgit -cother than the credential helper.--upload-pack,--receive-pack,--exec,--output), and gh's--editor/--web. This covers arguments, variable values, array elements and defaults, however quoted, escaped (backslash line breaks included), abbreviated (git takes any unambiguous prefix) or bundled (-dw).>&2and>> "$GITHUB_STEP_SUMMARY".pushgit. Its definition is pinned, and it must sit at the top level before its calls.A function with an allowlisted name would shadow that program. So the test pins that no definition anywhere in the script has one, except
planandpushgit, and that the script contains noeval,sourceor.. Both pins read every line after quote removal, so quotes, backslashes and line continuations inside a word don't hide it, and neither does a line that only looks like a comment. A redirection touching the word (eval>x y) counts too, as does a case pattern's)before it. The script holds no$'...'or$"...", and a pin keeps it so, because those can spell any word in escapes ($'\x65val'). It also pinsplanand itsfieldhelper: the isolated runner's Python, running a fixed program that imports only json and sys.Both bypasses from the stack review are must-flag cases, as are the inputs the reviews of this PR found (below).
Invariants (each run as a test)
read_preflightaccepts unchanged.-,], extra lines) and when a parametrised id holds-or an unmatched[.Review
The GPT-6.1 Sol review (lane run
20261021-225349-pr217-review-3; report in~/reviews/scorecard-results-stack-review/pr217-review-3/) returned CHANGES REQUESTED. It confirmed the production change, the credential boundary, the shape check, the draft rule, the parsers, the size limits and CI-line equality. Fifteen of its 16 mutations were caught by the tests.It found 14 inputs the detector missed. Each was executed under bash 3.2, 5.2.37 (the CI runner's version) and 5.3. The current
proposeuses none of them.[ -v 'a[$(cmd)]' ];${…};printf {-v,PATH};The commit after the review applies the reviewer's patch and fixes its other findings:
eval/sourcepin;-udropped (in git 2.55 it is--set-upstream, not a program);The re-review at
f936b49c(lane run20261022-043621-pr217-rereview; report in~/reviews/scorecard-results-stack-review/pr217-rereview/) returned CHANGES REQUESTED and confirmed the earlier fixes. It had one production finding: the runner reads a workflow command only at the start of a line, so a suite that stopped mid-line left commands paused. The pause and resume now each start a line of their own.The rest were detector inputs, none of which
proposeuses.9078c449closes them by refusing what the detector can't see:[operator held in a value or an array, which the fixed[grammar closes;--webfrom a word that splits or from a default, which the rule on split words closes (the same rule covers globs);eval,sourceor., which quote removal before the pins closes.It also adds the count-boundary and nonce tests its mutation run asked for, and states the summary-header limit. The review's 71 executed inputs and these new ones are all flagged.
d3770d66then removes a check that a mutation run showed could not fail, and routes the script-wide pin through one helper its cases exercise.The review of
d3770d66(lane run20261030-105117-pr217-rereview-3; report in~/reviews/scorecard-results-stack-review/pr217-rereview-2.md) returned MERGE-SAFE WITH NITS. It confirmed every earlier finding closed, and that its four surviving mutants now die. It found two more detector inputs, neither used bypropose, and both executed under all three bash versions:local a=($opt)), which reached gh as--web;eval>x y), or spelled in a locale quote ($"eval").25f4c9b2closes both, and I probed the neighbouring spellings on the same three versions.eval&>x y,$'eval',$'\x65val'and$'\145val'all ran, so the pin refuses$'...'and$"..."outright rather than normalising them.The review of
25f4c9b2(lane run20261030-123210-pr217-rereview-4; report in~/reviews/scorecard-results-stack-review/pr217-rereview-3.md) returned MERGE-SAFE WITH NITS. It confirmed both fixes, that the merge brought in only main's changes, and that #218 and #219 break no assumption ofpreflight. It found two more spellings ofevalthat the pin missed, neither used bypropose: one on a line inside a quote that only looks like a comment, and one after a case pattern's).ed25ea09closes both. The pin now sets no line aside, because telling a comment from code needs quote state, andshell_residue, which tracks it, refuses the script's heredoc. The script's comments had two hits, both prose sentences ending in)., and this commit rewords them. It changes nothing else in the script.The review of
ed25ea09(lane run20261030-131859-pr217-rereview-5; report in~/reviews/scorecard-results-stack-review/pr217-rereview-4.md), scoped to that commit, returned MERGE-SAFE WITH NITS. It confirmed both fixes, and that the script's non-comment lines match25f4c9b2byte for byte. Its one new input, a backtick substitution, sits under Known limits: this PR stops the detector's rounds here, because each round since the first has found only spellingsproposedoesn't use.Known limits
propose's body and the helpers it calls. It doesn't read the script's top-level lines, which every job runs: variable settings, the request-id check and the dispatchcase.u=--w; u+=eb,n=ev; "${n}al") is beyond any rule on words.eval,sourceand.misses one inside a backtick substitution (x=`eval y`), which all three bash versions run.proposeholds no backticks, and the lexer refuses one in its body.verify-sealedand content-hash lines. A package in job 1 could claim the checks passed; CI on the PR reruns them.FAILEDorERRORas another node id, and one that is itself a summary header drops the ids before it. This changes only what is listed: a check's exit status, not its list, says whether it failed.Checks run
ed25ea09, merged with main at96dc07bb, which holds Run the UK replay's year workers that fit the runner's memory, and log memory around each event #218 and Run the real replay's variant code in the candidate sandbox #219.tests/test_uk_replay_results_pr.pyandtests/test_ci_gates.pywith-n 4, on the merged tree: 153 passed.uvx ruff format --check be nz scorecard_db tests pipelinepasses.d3770d66(~/reviews/scorecard-results-stack-review/pr217-mutation-4/): a named test fails on 17 of 18 mutants, with every baseline passing first. The mutant that drops the resume's leading newline fails the end-to-end case where the suite stops mid-line. The survivor removes the filter that keeps summary headers out of a property's messages; random text doesn't produce one, andtest_a_message_line_that_looks_like_a_summary_is_a_stated_limitpins that behaviour directly.25f4c9b2(~/reviews/scorecard-results-stack-review/pr217-mutation-5/): with the baseline passing,test_propose_runs_only_the_commands_it_listsfails on all five mutants of its new rules: allowing a split element, dropping either redirection boundary, dropping the$'...'pin, and widening the boundary to), which would flag the script's owngrep -c .).ed25ea09(same folder): with the baseline passing, the same test fails on all four mutants: dropping the left), setting comment lines aside again, dropping the$'...'pin, and widening the right boundary.axiom: n/a: CI and test tooling
🤖 Generated with Claude Code