Repository navigation
fix(audit): credit a non-interactive flag only when the help declares it - #173
Open
brettdavies wants to merge 1 commit into
Open
brettdavies wants to merge 1 commit into
brettdavies wants to merge 1 commit into
Conversation
`p1-non-interactive` passes a tool whose bare call blocks or crashes when its `--help` shows a headless flag. It looked for eleven flag spellings and four spacing variants (`-y,`, `-y `, ` -p,`, ` -p `) as substrings of the help text, so opencode, whose bare call starts a TUI, passed on `--print-logs` containing `--print`. `--batch-size`, `--yes-i-really-mean-it`, a usage line, an example such as `foo -p "..."` and a sentence such as `Pass -y to skip` all passed the same way. The audit now asks the definition query for the same flags. The spacing variants are gone: `-y` and `-p` answer when declared as those letters. A single-dash word answers for its double-dash spelling in a help that declares no double-dash name. Each warn says what the bare call did and what was searched, for example `bare invocation timed out, so the binary may be waiting for interactive input, and no option definition in --help declares a non-interactive flag (one of: ...); usage lines are not read.` `run()` hands the bare call's outcome and the shared help probe to one core helper, which the tests call.
brettdavies
added this pull request to stack #166
October 8, 2026 21:58
This was referenced Oct 8, 2026
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.
Summary
p1-non-interactivepasses a tool whose bare call blocks or crashes when its--helpshows a headless flag. It looked for eleven flag spellings and four spacing variants (-y,,-y,-p,,-p) as substrings of the help text, so the help only had to contain the characters:--print-logs, which contains--print.--batch-sizeand--yes-i-really-mean-itcontain--batchand--yes.Usage: foo [--no-interactive] <file>), an example (foo -p "summarize this") and a sentence (Pass -y to skip the confirmation.) each matched.The audit now asks the definition query for the same flags. The spacing variants are gone:
-yand-panswer when declared as those letters. A single-dash word answers for its double-dash spelling in a help that declares no double-dash name, and beside double-dash names the warn says why it does not count.Each warn says what the bare call did and what was searched. The flag list is unchanged, and so are the other two ways to pass: a bare call that exits, or one that prints usage.
p1-non-interactiveis one of the four audits behind the scorecard'saudience, so a pass that becomes a warn is one more warn in that count.Changelog
Fixed
p1-non-interactivepassing a tool whose bare call blocks because its help contains a headless flag's characters: inside a longer flag (--print-logs,--batch-size), in a usage line, in an example, or in a sentence. A headless flag counts when an option definition declares it.p1-non-interactivemissing a headless flag in Goflaghelp, where-batchis printed with one dash.Changed
p1-non-interactivewarn evidence now says what the bare call did and what was searched, for examplebare invocation timed out, so the binary may be waiting for interactive input, and no option definition in --help declares a non-interactive flag (one of: ...); usage lines are not read.Type of Change
fix: Bug fix (non-breaking change which fixes an issue)Related Issues/Stories
docs/plans/2026-10-06-0034-fix-help-flag-names-across-frameworks-plan.md(unit U10, thenon_interactive.rsPR)p1-flag-existence), fix(audit): pass p7-quiet only when the help declares --quiet or -q #171, fix(audit): match a declared confirm flag against the definitions the help declares #170, fix(audit): find flag definitions at column 0, in box tables, and behind brackets #169, fix(audit): stop reading wrapped description lines as flag definitions #168, fix(audit): read names from a second column and descriptions after a marker #167, fix(audit): read every flag name a help declares whole #165, refactor(audit): look flags up through one model and one query #164, test(audit): pin what the flag parser reads from a capture of every help layout #163, feat(docker/score): compare two anc builds over the registry in one pinned image agentnative-site#455 (the corpus harness)Testing
Test Summary:
non_interactive.rs, through the core helperrun()calls.-p, --print,-y, --yesand--no-inputpass a bare call that timed out. Five helps that name a flag without declaring it do not, opencode 1.18.34's real--print-logsline among them. A Go-style-batchpasses in a help with no double-dash name. A find-style help that declares--helpbeside-printwarns and says-printdoes not count as--print. All three warn sentences are asserted whole. Therun()test for a declared flag now declares it on a definition line and crashes on the bare call.cargo test --test dogfoodpasses.Negatives observed failing. The new tests, run against the base (#172) with the audit restructured around the core helper and the substring markers still doing the match:
Expected moves. Written before the corpus run. Two rows:
p1-must-no-interactivep1-non-interactive--print-logscontaining--print, and no definition declares a headless flagp1-must-no-interactivep1-non-interactivebinary may be waiting for interactive inputto the sentence that also says what was searchedDerived, computed from the base scorecard:
audiencebadge.score_pctsummary.passsummary.warnopencode's band (75-79) and
badge.eligible(true) hold. Itsaudiencemoves because the new warn joins its existingp7-quietwarn: two warns among the four signal rows is mixed. No propagated row moves:p1-must-no-interactiveis no row's antecedent.How the prediction was made:
human-tuiprofile. That leaves datasette and opencode.--helpand hang on a bare call, audited with the base and head builds.Corpus before/after. Run after the table above was written. Base
972b5b34f5aa, head58497bf5f381. Imagesha256:05db16cf226cd14a93a2682aea41b72d3e6b4d240cadba006f2881d3ffa996b3, networkbridge. 98 tools selected, 95 scored under both builds, 3 rerun three times (datasette, mods, opencode).Moved rows (2)
p1-must-no-interactivep1-non-interactivehead: bare invocation timed out, so the binary may be waiting for interactive input, and no option definition in --help declares a non-interactive flag (one of: --no-interactive, --non-interactive, --batch, --headless, --yes, --no-input, --no-browser, --device-code, -y, -p, --print); usage lines are not read.
p1-must-no-interactivep1-non-interactivehead: bare invocation timed out, so the binary may be waiting for interactive input, and no option definition in --help declares a non-interactive flag (one of: --no-interactive, --non-interactive, --batch, --headless, --yes, --no-input, --no-browser, --device-code, -y, -p, --print); usage lines are not read.
Derived fields moved (4)
audiencebadge.score_pctsummary.passsummary.warnThe two moved rows and the four derived moves equal the expected moves. Each returned the same result in all four runs of each build, so the timeout behind both rows was stable. No row is unstable, no harness bug is flagged, and no tool failed to score under one build only.
modsp3-should-about-long-about, the one row on the A/A noise list, did not move (base runs pass, warn, pass, pass; head runs warn, warn, pass, pass).cursor,nvidia-smiandxai-grok-buildare absent from the image and ran under neither build.Files Modified
Modified:
src/audits/behavioral/non_interactive.rs:audit_non_interactiveis the core helper; the flag list is matched through the definition query; the spacing markers are removed.Created:
Renamed:
Deleted:
Breaking Changes
One registry tool loses a
p1-non-interactivepass it got from--print-logs, and itsaudiencelabel moves with it. The scorecard schema and JSON shape are unchanged.Deployment Notes
Checklist