Repository navigation
fix(verify): accept only the resolver launcher and equalize the Reflect fixture openers (#152) - #164
Conversation
…ct fixture openers (#152) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Queue ready pull requestsAutomatically queue non-draft pull requests targeting main after verify, Unfret, and live-gate pass on the head.
🟢 🚦 Auto-queueWhen all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
|
Live evidence: Open Pstack
|
|
✅ Accepted riskAccepted by ericlitman: GH-152 (authority 48fa77b) 🟡 Medium · Chat ID never Advisories (1)
DetailsRun: @unfret review · @unfret status · @unfret help |
There was a problem hiding this comment.
🛑 1 blocking finding
🟡 Medium · Quoted concatenation still admits the `.ts` script
Check
| const installed = join(f.location, RESOLVER), bound = `[\\s'"\`;&|()<>]`; | ||
| const names = [installed, await realpath(installed)].map(name => | ||
| new RegExp(`(?:^|${bound})${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?=$|${bound})`)); |
There was a problem hiding this comment.
🟡 Medium · Quoted concatenation still admits the .ts script
For a command such as bun <launcher>''.ts <chat-id>, the shell concatenates the adjacent fragments and executes <launcher>.ts. The regex nevertheless matches <launcher> because a quote is treated as an unconditional boundary; when the script returns the expected JSON, c.assert passes, so script-only evidence can still clear the tightened Reflect gate.
…a closing quote (#152) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Live evidence: Open Pstack
|
There was a problem hiding this comment.
🛑 2 blocking findings
🟡 Medium · `(` counted as a word end admits a zsh glob onto the .ts script
🟡 Medium · Backtick concatenation still admits script-only evidence
Check
| // A closing quote ends it only before a real boundary, so `launcher''.ts` does not match either. | ||
| const installed = join(f.location, RESOLVER), end = `(?:$|[\\s;&|()<>])`, bound = `[\\s'"\`;&|()<>]`; | ||
| const names = [installed, await realpath(installed)].map(name => | ||
| new RegExp(`(?:^|${bound})${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?=${end}|['"\`]${end})`)); |
There was a problem hiding this comment.
🟡 Medium · Backtick concatenation still admits script-only evidence
The lookahead treats a backtick followed by whitespace as a pathname boundary. With CODEX_HOME pointing at the prepared fixture, "bun :.ts " executes only .ts because the command substitution produces no text. Nevertheless, the regex matches, and c.assert accepts the genuine script output and records resolver-ran/opening-verified. Reproduced at this head: script-only execution can still pass the Reflect live-gate assertions despite the launcher-only requirement. Also reported for this defect: - Backtick command substitution still lets the .ts script pass (.claude/skills/verify-open-pstack/features/recipes.ts:182): Line 182 treats a backtick right after the launcher as a closing quote whenever whitespace follows it. Trigger: a Codex command such as CODEX_HOME=<home> bun <launcher> + " echo .ts" + <chat-id>. The regex matches, because the name is preceded by a space and the lookahead sees a backtick followed by a space. In bash or zsh, however, that backtick opens a command substitution whose output .ts joins the same word, so bun executes <launcher>.ts. The script prints the same expected JSON that the launcher delegates to, so Bun.deepEquals passes and the case records resolver-ran from script-only execution. This is the same false acceptance as the carried ''.ts demand. The '' and "" forms are now rejected, but the backtick member of the quote class ['"\]is not. - Backtick substitution still admits the.tsscript (.claude/skills/verify-open-pstack/features/recipes.ts:182): The boundary treats a backtick followed by(as a valid end of the launcher pathname. Thusbun (printf .ts) matches this regex, but the shell substitutes.tsand actually executes.ts. Because that script produces the same resolver JSON, script-only evidence can still satisfy c.assert and incorrectly clear the Reflect live gate. - Backtick concatenation still admits script-only evidence (.claude/skills/verify-open-pstack/features/recipes.ts:182): With CODEX_HOME set to the fixture, the command "bun <launcher> printf .ts` " executes .ts, not the launcher. The new lookahead nevertheless matches because it treats the opening backtick followed by whitespace as a pathname boundary. Reproducing this command returns the expected JSON and makes c.assert record resolver-ran, so script-only execution can still satisfy the launcher-only Reflect live-gate check.
…script (#166) Co-Authored-By: Claude Opus 5.5 <[email protected]>
#152) Co-Authored-By: Claude Opus 5.5 <[email protected]>
The panel reads REVIEW.md at the merge base. This branch started at 748a9bc, before REVIEW.md merged in a41d063 (#153), so its reviews judged findings without the repository's stated usage. Step-back decision, 2026-10-12. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Live evidence: Open Pstack
|
There was a problem hiding this comment.
🛑 6 blocking findings
🔴 High · Native shell quoting rejects a valid launcher lookup
🟡 Medium · Rejects valid Claude reads through bounded discovery
🟡 Medium · Authorized Grep transcript reads no longer count
🟡 Medium · Available-case read check passes on an echoed report with no read
🟡 Medium · Expected-hash diagnostics pass without inspecting the opener
🟡 Medium · Chat ID never checked: a variable holding the launcher admits the .ts script
Check
| // A parent Read or Bash call names this run's transcript and its output shows the file's opener or its SHA-256. | ||
| const name = basename(transcript(f)), shown = [text, sha256(text)]; | ||
| if (!record.tools.some(tool => tool.parent === null && !tool.failed && (tool.name === 'Read' || tool.name === 'Bash') && | ||
| String(tool.input.file_path ?? tool.input.command ?? '').includes(name) && shown.some(value => tool.result?.includes(value)))) { |
There was a problem hiding this comment.
🟡 Medium · Rejects valid Claude reads through bounded discovery
With the generated fixture, head -n 500 '<fixture>/transcript-home/projects/fixture'/*.jsonl reads the transcript and returns its opening record, including the fresh nonce. Even with a correct result.json, this condition rejects the session because the shell source contains a glob rather than the discovered filename. Reproduction passes the base nonce check but now throws reflect-transcript-not-read. This bounded per-project read follows the active-transcript mapping yet falsely fails the honest-run gate required by REVIEW.md. Also reported for this defect: - Grep or glob reads of the transcript newly fail (.claude/skills/verify-open-pstack/features/recipes.ts:191-192): The prompt names only the transcript directory, but the check now requires a Read or Bash call whose input contains .jsonl. Consider an honest session that reads through the Grep tool (pattern on the user record, path set to the directory, content mode) or runs ls
head -n 500 "$project_dir"/*.jsonl reads the recipe's generated transcript and returns its opener and run nonce. Even with a correct result.json and the required fallback digest, this guard rejects it because the command input does not contain the UUID filename literally. Reproduced for both cases: base passes, head throws reflect-transcript-not-read. The active-transcript mapping permits bounded discovery within the named project directory, and REVIEW.md requires a correct gate decision on every honest run.
Also affects:
✅ Fixed in the latest commit.| if (!record.tools.some(tool => tool.parent === null && !tool.failed && tool.result?.includes(nonce))) throw new Error('reflect-transcript-not-read'); | ||
| // A parent Read or Bash call names this run's transcript and its output shows the file's opener or its SHA-256. | ||
| const name = basename(transcript(f)), shown = [text, sha256(text)]; | ||
| if (!record.tools.some(tool => tool.parent === null && !tool.failed && (tool.name === 'Read' || tool.name === 'Bash') && |
There was a problem hiding this comment.
🟡 Medium · Authorized Grep transcript reads no longer count
Grep is pre-authorized by CLAUDE_TOOLS. A completed top-level call with the generated transcript as path, pattern: ".", output_mode: "content", and head_limit: 500 returns the opening user record and run nonce. With a correct report, that read passes the base assertion but now fails reflect-transcript-not-read solely because this condition admits only Read or Bash. This independently rejects an honest native transcript read and violates REVIEW.md's correct-gate-on-every-honest-run requirement.
| // Only whitespace, or one closing quote and whitespace, may follow it before the chat ID, so `launcher''.ts` does not match. | ||
| const installed = join(f.location, RESOLVER), bound = `[\\s'"\`;&|()<>]`; | ||
| const names = [installed, await realpath(installed)].map(name => | ||
| new RegExp(`(?:^|${bound})${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?=\\s|['"]\\s)`)); |
There was a problem hiding this comment.
🔴 High · Native shell quoting rejects a valid launcher lookup
For the documented invocation CODEX_HOME='<home>' "<launcher>" "<chat-id>", Codex's shell quoting renders the inner double quotes as \" in the recorded /bin/zsh -lc command. The character immediately after the launcher is therefore a backslash, which this lookahead rejects. Executing the lookup returns the exact expected resolver JSON, but replaying its completed event throws reflect-resolver-not-run; the base assertion passes. This falsely fails an honest Reflect live gate, contrary to REVIEW.md's correct-decision requirement. Also reported for this defect: - Shlex-escaped double quote after the launcher rejects an honest lookup (.claude/skills/verify-open-pstack/features/recipes.ts:181): Codex records the -lc script with shlex quoting. A script containing a single quote and no $ or backtick is wrapped in double quotes, and each inner double quote becomes backslash-quote. The PR's recorded form /bin/zsh -lc "CODEX_HOME='' '' " is that rendering. The documented invocation with a double-quoted launcher, e.g. CODEX_HOME="" "" | jq '.', is therefore recorded with a backslash right after the launcher path. Neither \s nor ['"]\s matches a backslash, and no other occurrence exists. A real launcher run with the expected JSON fails reflect-resolver-not-run. The removed substring check accepted this form, so this is a new false live-gate failure on an honest run. - Native Codex quote rendering rejects valid launcher calls (.claude/skills/verify-open-pstack/features/recipes.ts:183): For the documented invocation CODEX_HOME='<home>' "<launcher>" "<chat-id>", Codex's shlex_join renderer wraps the shell argument in double quotes and escapes its inner quotes. The recorded pathname therefore ends with a backslash-escaped quote, which this lookahead rejects. Replaying genuine launcher output reproduces reflect-resolver-not-run despite successful execution. The base substring check accepted it; this change falsely fails the live gate for an honest documented lookup.
Also affects:
✅ Fixed in the latest commit.| const name = basename(transcript(f)), shown = [text, sha256(text)]; | ||
| if (!record.tools.some(tool => tool.parent === null && !tool.failed && (tool.name === 'Read' || tool.name === 'Bash') && | ||
| String(tool.input.file_path ?? tool.input.command ?? '').includes(name) && shown.some(value => tool.result?.includes(value)))) { |
There was a problem hiding this comment.
🟡 Medium · Available-case read check passes on an echoed report with no read
In locate-transcript, shown holds the prompt's own opener and its SHA-256, both computable without opening the file. Any Bash command whose text contains .jsonl qualifies, including the command that writes the report. Trigger: after only an ls of the directory, Claude runs tee /result.json with a heredoc holding status resolved, path .../.jsonl, line 2, characters 54 and the sha256 of the prompt opener. The input names the transcript, tee echoes the hash, and result.json matches, so the case passes although the transcript was never read. #166 requires this report-without-read session to fail. The old nonce-in-output check rejected it, and the new test covers only the Write tool.
✅ Fixed in the latest commit.| // A parent Read or Bash call names this run's transcript and its output shows the file's opener or its SHA-256. | ||
| const name = basename(transcript(f)), shown = [text, sha256(text)]; | ||
| if (!record.tools.some(tool => tool.parent === null && !tool.failed && (tool.name === 'Read' || tool.name === 'Bash') && | ||
| String(tool.input.file_path ?? tool.input.command ?? '').includes(name) && shown.some(value => tool.result?.includes(value)))) { |
There was a problem hiding this comment.
🟡 Medium · Expected-hash diagnostics pass without inspecting the opener
In locate-transcript, the expected opener and its hash are already derivable from the prompt. A successful parent Bash scan that inspects only the metadata record and prints a want chars … sha … diagnostic satisfies this substring check without inspecting the opening user message. With a correct-looking result.json, reproduction records opening-verified; the base nonce check rejected the same output. This admits a failed opening verification through the live gate without requiring deliberately forged tool output.
| // Only whitespace, or one closing quote and whitespace, may follow it before the chat ID, so `launcher''.ts` does not match. | ||
| const installed = join(f.location, RESOLVER), bound = `[\\s'"\`;&|()<>]`; | ||
| const names = [installed, await realpath(installed)].map(name => | ||
| new RegExp(`(?:^|${bound})${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?=\\s|['"]\\s)`)); |
There was a problem hiding this comment.
🟡 Medium · Chat ID never checked: a variable holding the launcher admits the .ts script
The lookahead (?=\s|['"]\s) only requires whitespace, or a quote then whitespace, after the launcher. Nothing checks that the chat ID follows, although the comment, the test title and the PR contract all say it must. Trigger: Codex runs R='', then on the next line CODEX_HOME='' bun "$R.ts" , for example as a fallback after the candidate's launcher failed. The assignment matches as '' plus a newline. Bun executes only .ts, its stdout deep-equals expected, and resolver-ran is recorded. A broken launcher can therefore still clear the Reflect gate on script-only evidence, which #152 is meant to stop.
Now at .claude/skills/verify-open-pstack/features/recipes.ts:181
… or tool output (#152, #166) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Live evidence: Open Pstack
|
There was a problem hiding this comment.
🛑 1 blocking finding
🟡 Medium · Chat ID never checked: a variable holding the launcher admits the .ts script
Check
|
Waived as pre-accepted on head "Chat ID never checked: a variable holding the launcher admits the .ts script" depends on #152's first criterion, that the Codex evidence accepts only the launcher. Eric accepted that criterion as unmet on 2026-10-12, and #152 now records it as retired. The live gate cannot attest which executable ran without parsing shell, which the PR #151 step-back decision rules out. The launcher's isolation from project Bun config and The advisory "Exact-report check accepts an extra |
|
Waived as pre-accepted on head "Chat ID never checked: a variable holding the launcher admits the .ts script" depends on #152's first criterion, that the Codex evidence accepts only the launcher. Eric accepted that criterion as unmet on 2026-10-12, and #152 now records it as retired. The live gate cannot attest which executable ran without parsing shell, which the PR #151 step-back decision rules out. The launcher's isolation from project Bun config and The advisory "Exact-report check accepts an extra |
Merge Queue Status
This pull request spent 9 seconds in the queue, including 1 second running CI. Required conditions to merge
|
REVIEW.md scopes out failures that need the model under test to evade a recipe on purpose. AGENTS.md parks tickets born from waived findings until the failure is seen in real use. The verifier feature map states the recipe rule PR ericlitman#164 converged on: prove a read with a fixture value the model cannot derive, not with command text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Two fixes to the Reflect live-gate recipe, on the same verifier files.
Step-back decisions (2026-10-12). Three heads tried to prove the lookups from command text and tool output. Each tightening rejected honest runs, and each loosening let claims through.
uuid. Thatuuidis the run's nonce, and it appears nowhere else: not in the prompt, the file name, the metadata records or the file size..envis proven byresolve-codex-transcript.test.ts:313. Eric accepted verify-open-pstack: accept only the resolver launcher in the Reflect recipe, and give the fixture openers equal length #152's first criterion as unmet on 2026-10-12.This branch also merged
main, so the review readsREVIEW.mdat the merge base.Evidence
reflect-transcript-not-readafter correct hash-only reads.After:
Read,GlobplusGrep, and a hash-onlyBashread.uuid, fails.uuidremoved from the expected reports, four Claude tests fail.9a92f68. The verifier runs from this candidate head with--feature claude:skill-invocation:reflect --feature codex:skill-invocation:reflect --self-test.Merge Danger
Door: two-way
Blast Radius: verifier
Only the repository-local verifier changes. A real Claude session that reads the opener but omits or misreports the
uuidnow fails its Reflect case. The live run measures that.Acceptance criteria
result.jsonis correct, when the recipe asserts, then it passes." Met for a correct report, which now includes theuuid. The hash-only read case is in the accepting test.result.jsonwithout reading the transcript, when the recipe asserts, then it fails." Met; see Evidence.claude:skill-invocation:reflectandcodex:skill-invocation:reflectwith--self-testfrom the candidate head. See Evidence.Gate results
My run on the committed head
9a92f68, every command withMASTRA_TELEMETRY_DISABLED=1:bun install --frozen-lockfile(poteto-mode scripts)bun run testbun run typecheck(strict)bun install --frozen-lockfile --ignore-scripts(verifier)PSTACK_STATIC_ONLY=1 bash tests/skill-collision-repro.sh(includes the verifier's tests and typecheck)claude plugin validate plugins/pstackNot verified
uuidcorrectly. The live run is the first measurement, and a miss reopens the decision.REVIEW.md.Closes #152
Closes #166
🤖 Generated with Claude Code