E: one word→program-name normalizer, pwsh positional + -Command, oracle matrix + PowerShell lanes, check 11 (F-460, closes #2) - #23
Merged
Conversation
…oracle's combination matrix and PowerShell lanes, check 11 items 4–7 (F-460, issue #2) GD-1 (hooks/gs-admin-guard.mjs): normalizeProg is the ONE normalizer (assignment strip → last path segment → case-fold + launcher suffix); isGsAdminWord derives from it, so every interpreter behind a PowerShell assignment ($x=iex '…', $x=bash -c '…', $x=powershell "…", $x=cmd /c '…') now asks. Sibling from the sweep: the assignment grammar admits every spelling PowerShell runs ($1=, ${1}=, $x.y=, $a[0]=) as ONE grammar shared with the computed-name branch (isAssignmentWord). The pwsh positional loop re-scans a positional that carried nothing AND a later -Command (issue #2 item 1; measured: the first positional is 5.1's command text, so the issue's flag-first order would have dropped a real ask), and skips a value-taking option's value (review round: -ExecutionPolicy Bypass "…" was a live bypass on every shipped version) through a pwsh entry in the value-option table; a positional that carried an invocation ends the search (one execution, one journal row). GD-2 (test/guard-oracle.mjs; ruling: the oracle's generator): assignment prefix × interpreter × option/positional matrix (51 PowerShell rows per lane, 8 bash), every PowerShell on the host as a lane (powershell.exe 5.1 + pwsh 7, {ps}-spelled nested rows, per-lane counts), an `on:` gate for claims measured on 5.1 only. This host: pre-fix hook 709 lines / 44 bypass / 80 failures; fixed 709 / 0 bypass / 62 over-ask. GD-3 (build/check-doc-drift.mjs check 11): PIN_CLAIMS table with an unrecognised-wording message (item 4); one wrap-tolerant anchor grammar located once, refusing an unterminated anchor (item 5); a blank line ends the callout truthfully, the message names the block range (item 6 — measured, not a defect); the block is the whole callout on lib.mjs's QUOTE_RE, refusing an anchor outside it (item 7). Fixtures 11b–11f in test-check-doc-drift.mjs, each red on the pre-change checker. Plugin 0.41.2 + CHANGELOG; README parsing-boundary bullet; guard-fixtures 20 new pins (17 red on the pre-fix hook); bus F-460 logged and FIXED (Class second-scanner).
Owner
Author
|
Dispatch evidence on the handoff tip 58b1330 (hb-20260916-02), quoted after completion: validate-plugin 35147717941 (PR) changes/validate (ubuntu)/manifests all success; docs-drift 35147717956 (PR) drift (full) success; dispatches 35147785798 (validate-plugin, all jobs success) and 35147788662 (docs-drift, full + stripped success). The pwsh 7 lane's first measurement, from the ubuntu job log: |
BradleyDB
added a commit
that referenced
this pull request
Sep 16, 2026
…0 logged + FIXED, hb-20260916-02, dispatches quoted green [skip ci]
…ed; oracle 709/0/62, 5.1 lane 98/0/7, pwsh 7.6.5 lane 98/0/20 in CI) [skip ci]
…916-02 (the [skip ci] verdict commit leaves dev's required drift (full) check unrun)
…02; the previous two tips carried the skip marker)
BradleyDB
added a commit
that referenced
this pull request
Sep 16, 2026
…-V), suites green on the verdict tip 963897d, unmerged [skip ci]
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.
What
Session E of the September round plan (GD-1, GD-2, GD-3 — issue #2 items 1–3 and 8, and check 11's items 4–7). Bus F-460 logged and FIXED on this branch (
Class: second-scanner). Plugin 0.41.2.hooks/gs-admin-guard.mjs).isGsAdminWordandnormalizeProgwere two normalizers; the assignment strip lived only in the first, so every interpreter behind a PowerShell assignment —$x=iex '…',$x=bash -c '…',$x=powershell "…",$x=cmd /c '…', and the${x}=/$env:X=spellings — ran the mutation with no ask and no journal row (PowerShell assigns the interpreter's output; measured on 5.1 through the oracle).normalizeProgis now the one normalizer (assignment strip → last path segment → case-fold + launcher suffix) andisGsAdminWordderives from it; the pipe-safety lint's consumer lookup and the nested-interpreter table go through the same function.[A-Za-z_][\w:]*), while the computed-name branch carried a second, broader assignment regex. PowerShell runs$1=gs-admin jo p save,${1}=…,$x.y=…and$a[0]=…(even when the property assignment then errors — measured), and all four were silent on dev. One grammar now ($-led word up to its first=), a superset of the old at the same position, so it can only add asks; the computed-name branch derives from it.powershell foo.ps1 -Command "…"never reached its flag. The issue recommended "flag path first, positional only as a fallback". Measured on 5.1 before choosing: the FIRST positional is the command text —powershell "gs-admin jo p save" -Command "echo hi"runs the mutation with-Command echo hias arguments — so that order would have dropped a real ask (tenet 3). Both the positional and the-Commandpayload are re-scanned now.foo.ps1 -Command "…"runs nothing on 5.1 (and-File s.ps1 -Command "…"hands-Commandto the script), so those asks are over-asks, the safe direction; the oracle's item-1 rows record it.test/guard-oracle.mjs; ruling: Bradley, 2026-09-16, after a decision-tree walk-through). Assignment prefix ($x=,${x}=,$env:X=,$1=,$x.y=,$a[0]=, the spaced control) × interpreter (bash/sh -c, option-after-flag, iex, iex -Command, Invoke-Expression,{ps} -Command, option-before-flag, positional, option-then-positional, positional-then--Command, cmd /c, eval) plus the item-1 rows, on the PowerShell lane; the$x=× interpreter crosses and the name-in-a-variable × payload crosses on the bash lane. Count: 51 PowerShell matrix rows per lane + 8 bash matrix rows (the PowerShell lane goes 47 → 98 rows, bash 603 → 611) (the full product is pruned where a prefix exercises only the prefix arm — the review's efficiency rule).powershell.exe(5.1) andpwsh(7), runs the PowerShell rows under each, spells nested-PowerShell rows with the lane's own executable ({ps}), and prints per-lane version + counts. Effect: the ubuntu leg a dev PR runs now judges the PowerShell rows under pwsh 7 (every GitHub-hosted image ships it) — before, they were skipped on every leg but Windows, so no PowerShell row was ever judged on a dev PR. Windows judges both. A row one version does not execute (7 reads a bare positional as a file path) is unjudged there and counted, not assumed.cmdExerows claim mustExecute on win32 only (thebash4pattern).build/check-doc-drift.mjs), each item reproduced by a fixture inbuild/test-check-doc-drift.mjsagainst the pre-change checker before the change (all five went red; log quoted in the review notes):PIN_CLAIMStable (universal / split); a block that talks about pinning in an unknown wording is reported as such, pointing at the table, never as "no claim at all".>quote lines (the old[^>]class refused a wrapped anchor outright as "no anchor"). The literal item-5 shape — a continuation line without>— did pass the first pattern and fail the second (block from index −1, every marker "missing"); that line also ends the callout in CommonMark, so it is red truthfully now, naming the block's line range.test/guard-fixtures.mjs(20 new; 17 red against the pre-fix hook); README parsing-boundary bullet extended (no residual closed — the JSON set is unchanged); CHANGELOG 0.41.2.powershell -ExecutionPolicy Bypass "gs-admin jo p save",-InputFormat Text …, and behind$x=) had its VALUE read as the positional payload, so the real one was never re-scanned; the value-option table gains apwshpredicate (value-taking parameters by prefix; valueless ones excluded so no payload can be skipped) shared by the flag loop andrescanFrom; (b) a regression this branch had introduced — with thebreakgone,powershell "gs-admin jo p save" -Command "gs-admin jo p save"journaled two rows for one execution; a positional that carried an invocation now ends the search. Plus: the oracle'son:lane gate (positive claims measured only on 5.1 are asserted on that lane; executed ⇒ guarded holds everywhere), matrix breadth as a data column, one duplicate row removed,isAssignmentWordnamed once,normalizeProgread once per word, stale "two scanners" comments corrected, workflow comment updated, check 11 on lib.mjs'sQUOTE_REwith unterminated-anchor and anchor-outside-callout refusals. Dismissed with reasons: pruning the${x}=full cross (the braces axis is the issue's own), the double PowerShell lane on Windows (ruling A), Linux-unrunnable rows counted as over-ask (that is what they are), the nestedpowershellspelling on pwsh-only hosts (a name the host lacks cannot be judged), a preamble marker satisfying the whole-callout block (item 7 by design), deriving the split claim from data (F-252's deliberate false-direction-only rule), merging green drift mutants, and the PowerShell start-up double spawn.Why
Issue #2 (re-homed from the private bus's F-253): silent misses on the safety surface, measured by mutation, plus check 11's brittleness. The class is
second-scanner(F-443): two readers re-deriving one grammar disagree exactly where it is subtle — here, which words are assignments and what a word's program name is.Review notes
Oracle counts (the judge of record —
test/guard-oracle.mjs, this Windows host: bash 5.x + Windows PowerShell 5.1; nopwshon this machine, so the 7 lane's first measurement is this PR's ubuntu suite):GUARD_ORACLE_HOOKagainst agit archiveof the dev plugin tree — a lone hook file fails open without its bundled catalog, which the first attempt proved):709 generated lines run (611 bash 5.x; 98 PowerShell rows × 1 lane(s) — powershell 5.1.26100.9444: 98 rows, 44 bypass, 3 over-ask); 44 bypass, 52 over-ask, 44 over-qualified, 9 documented residuals held— 80 failures; every bypass is a matrix row (14 under$x=and 14 under${x}=— the 12 assignment × interpreter crosses each plus the two value-option crosses — 3 under$env:X=, 3+1 under$1=, 3+1 under$x.y=, 3+1 under$a[0]=, 1 under${1}=).709 generated lines run (611 bash 5.x; 98 PowerShell rows × 1 lane(s) — powershell 5.1.26100.9444: 98 rows, 0 bypass, 7 over-ask); 0 bypass, 62 over-ask, 44 over-qualified, 9 documented residuals held— all checks passed.$x=forms,$x=eval, the two item-1 scripts).Pre-change drift-test run (
build/test-check-doc-drift.mjswithbuild/check-doc-drift.mjsfrom dev): 11b red "makes no claim about pinning at all" (item 4); 11c wrapped anchor red "carries no anchor"; 11c literal shape red with every marker missing; 11d red (same as after, the message differs); 11e red "readmeMarker no longer appears … zzz-above-anchor" (item 7). After: 129 checks green (11f, the unterminated-anchor refusal, added by the review round).Guard-fixtures against the pre-fix hook: 17 red (10 interpreter/positional pins, 4 assignment-sibling pins, 3 value-option pins; the single-row pin is green there because the old
breakkept one row), controls green; after: 697 green.Where to look first: the one normalizer and
ASSIGNMENT_PREFIX(hook ~lines 240–300); the pwsh positional loop (~1450); the oracle's lane detection and matrix (~110, ~545); check 11 (~1286–1400).Battery run locally, verbatim: guard-fixtures, guard-oracle, doc-lib-fixtures, contract-conformance, test-check-doc-drift, test-check-stale-facts, test-defect-classes, check-stale-facts, check-doc-drift, check-imports, check-instance-data,
npm run typecheck, plugin rebuild +git diff(no drift),claude plugin validate×2 (strict).Issue #2 disposition: items 1, 2, 3, 8 closed by this PR; items 4, 5, 7 fixed with fixtures; item 6 measured not a defect (pinned as the decision). All eight addressed →
Closes #2— the E-V verdict comments the oracle's counts on the issue..claude-plugin/plugin.jsonwith a CHANGELOG entry (0.41.2 — the hook's decisions change).hooks/gs-admin-guard.mjs. No "ask" became a "deny" or disappeared: the normalizer change is a superset match (every word that matched before matches now with the same remainder), the assignment grammar is a superset at the same position, and the positional branch re-scans MORE payloads, never fewer.test/guard-fixtures.mjsextended (16 pins) and the oracle's generator extended (the matrix + lanes).Closes #2