Skip to content

fix(verify): run the live gate headless with machine-checked recipes (#112) - #137

Merged
mergify[bot] merged 4 commits into
mainfrom
fix/issue-112-headless-verifier
Oct 4, 2026
Merged

mergify[bot] merged 4 commits into
mainfrom
fix/issue-112-headless-verifier

Conversation

@ericlitman

@ericlitman ericlitman commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Closes #112

What changed

verify-open-pstack now runs the live gate headless, with no human prompts. An agent runs verify.sh run --pr N [--self-test] --output <dir> from a non-TTY shell.

  • Driver. Each selected feature runs as one fresh native session on the exact-head installation. Claude runs claude -p with stream-json output, the candidate --plugin-dir, the installed pstack@open-pstack disabled for the session, and --permission-mode dontAsk with a fixed tool list. Codex runs codex exec --json against the run-owned CODEX_HOME installation, with approval_policy="never", --add-dir for the fixture and session-only hook trust. Sessions run one at a time in each harness.
  • Recipes. Every feature has a recipe in features/recipes.ts: a fixture, a prompt, and an assertion that the trusted parent evaluates against the native session record. A pass needs the candidate skill loaded in the native record, exit 0, and a concrete fixture effect from this session. A model's claim that it worked never counts. Claude shows skill loads as the replayed slash command or a Skill call. Codex shows them only in its session rollout, which the parent copies into the private evidence root.
  • Override recipes. Skills that would push, merge or post have overrides that run against a local fixture: fix-ci, babysit, make-pr-easy-to-review and automate-me. runner, setup, shipped-tools and project-skill have their own recipes. assets:codex fails as unsupported-native-consumer. A selected feature with no recipe fails before any session starts.
  • --runner-route. This repeatable option sets the routes the runner recipe dispatches, for example codex:gpt-6.1-sol@ultra for feat(models): make GPT-6.1 Sol the Sol default and admit ultra (#102) #115.
  • Deleted. The readline prompts, the PASS <feature> step, operator-typed fields and the /usr/bin/script capture are gone. The session() recorder streams stdout and stderr to private files and keeps them when a session fails.
  • Kept. Exact head and base pinning, provenance and tree-hash checks, setup snapshot with byte-exact restoration before publication, the private mode-0700 evidence root, one bounded comment plus live-gate on the exact SHA, and no PR state changes.

Scope decisions

  • I added only failure handling that real runs will hit, per Eric on 2026-10-04: each edge-case fix costs about $40 and 3+ hours.
  • I kept these tests: a missing recipe fails before launch, a failed assertion publishes no success, a model claim with no fixture file fails, and the recorder keeps output on failure.
  • I dropped tests and code for malformed or truncated streams, denied-tool detection, same-named daily skills, and new doctor flag checks.
  • shipped-tools exercises only log.sh. No current PR changes the other shipped tools.
  • Known side effect. While the Claude setup feature runs, the daily ~/.claude/pstack-models.md routes every role to Opus at high, for a few minutes. Restoration is byte-exact and runs before any publication. The operator-driven design had the same window.

Design: Astra (gpt-6-astra, high, read-only) reviewed the plan first. A pstack:pstack-opus-medium subagent built it in two commits: ef6cd9b, then fd1bbe3 for the babysit override. I added 241b1ba. In two stub tests, CI's Linux runner gave result.md a timestamp just before the recorded session start, so the stub now waits 20 ms before it writes. Real sessions run for seconds.

Unfret adjudication, head 241b1ba (20 findings)

Fixed in 5a996d8. Both are verdict-changing, and every full run hits them:

  • Automate-me contradiction (recipes.ts:114): the prompt asked for a SKILL.md write while the rule forbade editing any skill, so any shared-path PR could fail its gate. The rule now forbids skill edits only outside the fixture folder.
  • Codex setup leak (harness.ts:148): the Codex setup cases left an all-Opus sheet in the run's own CODEX_HOME for every later check. Setup features now run last. A new test fails without the reorder and passes with it.

Not fixed: recipe depth. Each of these 16 findings says some recipe asserts too little, so a broken candidate could pass. All of them are true. Fixing them means a bespoke behavior check per skill and per failure branch, which is the edge-case work Eric ruled out on 2026-10-04. They need Eric's exact-head waiver:

  • shipped-tools checks only log.sh
  • the runner output is not checked for PONG
  • runner failure branches are not exercised
  • the runner provider branch is fixed unless --runner-route is passed
  • not every log.sh field is checked
  • the CI fix is matched by text instead of running sh ci.sh
  • the make-pr check reads the ref, not the whole worktree
  • setup accepts an incomplete sheet
  • setup consumption accepts mismatched route text
  • the setup consumer is told to read the sheet
  • the default recipe accepts arbitrary result text
  • a generic result file counts as skill proof
  • the automate-me check uses an unanchored name regex
  • Codex default recipes keep the workspace-write sandbox, so external lanes drop out
  • a denied Claude tool does not fail a case
  • Claude skill loading is matched by command name

Not fixed: two Mediums.

  • Empty CLAUDE_CONFIG_DIR: fails-loudly. The setup case fails with ENOENT. It never false-passes, and nothing in our runs sets the variable empty.
  • Interrupt during the session file opens: pre-accepted. The trigger is a timing window the system does not create, and the fix would add a guard.

Verification

  • Bun tests, strict typecheck, static invariants, and plugin validation pass.
  • The exact candidate is installed in every affected harness.
  • The changed behavior passes from each real user surface.
  • The installed version, action, and observed result appear below.

Local gate on 5a996d8: all seven steps exit 0, and the verifier suite reports 102 pass, 0 fail.

Real smoke runs from this branch against candidate ce6e8c4. These ran the driver directly and published nothing. Each passed in Claude Code 2.1.289 and Codex CLI 0.160.0:

  • skill-invocation:bro: exit 0, skill loaded, and result.md written.
  • project-skill: exit 0, skill loaded, doctor ran, and canonical doctor.json pass.
  • skill-invocation:babysit: exit 0, skill loaded, result.md written, and sum.mjs fixed.

Not yet run live: the runner, setup and shipped-tools recipes, and the fix-ci, make-pr-easy-to-review and automate-me overrides. #115's run will exercise them.

Live evidence: an agent ran verify.sh run --pr 137 --self-test from this PR's head 5a996d8, from a non-TTY shell with stdin at /dev/null and no terminal. It exited 0. project-skill passed its machine-checked assertions in Claude Code 2.1.289 and Codex CLI 0.160.0, and the verifier set live-gate=success with this evidence comment. No person took part in the run.

🤖 Generated with Claude Code

@mergify

mergify Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 Queue ready pull requests

Automatically queue non-draft pull requests targeting main after verify, Unfret, and live-gate pass on the head.

  • -draft
  • check-success=Unfret
  • check-success=live-gate
  • check-success=verify

🟢 🚦 Auto-queue

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • -files~=^\.github/
  • base = main

@ericlitman

Copy link
Copy Markdown
Owner Author

Live evidence: Open Pstack

  • Candidate SHA: fd1bbe3cc6d835eb6a7d6dc58dbd637666f9ba32
  • Base SHA: ce6e8c48bb961520036020663c15f427bd8d20ad
  • Result: PASSED — all mapped features verified
  • Self-test: completed in both harnesses
  • Publisher revision: fd1bbe3cc6d835eb6a7d6dc58dbd637666f9ba32
  • Evidence-set SHA-256: 10d042a4ef4a4db4b5c9f9cd8bdab05c6eed33beb99a4070d9c86084d03d0a76
  • Installation (claude): CLI 2.1.289 (Claude Code), plugin 1.5.0, candidate fd1bbe3cc6d835eb6a7d6dc58dbd637666f9ba32, tree 1fd82564fffaf382f63b6c58cbf4cdd66718c2f1d75fb913a200c93d75961d24.
  • Installation (codex): CLI codex-cli 0.160.0, plugin 1.5.0, candidate fd1bbe3cc6d835eb6a7d6dc58dbd637666f9ba32, tree 1fd82564fffaf382f63b6c58cbf4cdd66718c2f1d75fb913a200c93d75961d24.
  • Observation (claude / project-skill): surface claude -p stream-json with the candidate plugin-dir; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 4f0971b6920c59e156887d1a8424b9ed549ae39eef95c4ade554f9caf6757be7; artifact-set SHA-256 6b6ca66601c4ad2c8f588524af990c9317f72decd0ed56d9ef36f4d34f3f3ce9.
  • Observation (codex / project-skill): surface codex exec --json with the run-owned candidate installation; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 09ec81c7664a819341b85dabe9bbeceeb3b494de0ad784bf7619e5dbe7306049; artifact-set SHA-256 c2380d661fbfcd9ab5836e806425ab8ed4e9145759f220f238840eaace9059a2.
  • Policy: every new head requires a fresh run; this verifier does not change PR state, queue, or merge.

@ericlitman
ericlitman marked this pull request as ready for review October 4, 2026 17:12
…ect (#112)

CI's Linux runner gave result.md an mtime just before the recorded session
start, so the written-this-session check failed in two tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ericlitman

Copy link
Copy Markdown
Owner Author

Live evidence: Open Pstack

  • Candidate SHA: 241b1bafe5158252f6be839d572f515c41e7b1e8
  • Base SHA: ce6e8c48bb961520036020663c15f427bd8d20ad
  • Result: PASSED — all mapped features verified
  • Self-test: completed in both harnesses
  • Publisher revision: 241b1bafe5158252f6be839d572f515c41e7b1e8
  • Evidence-set SHA-256: d9922d47dd40596e96dfc3c907d7595f031c9b425684fa710d5d2a92d30e7b92
  • Installation (claude): CLI 2.1.289 (Claude Code), plugin 1.5.0, candidate 241b1bafe5158252f6be839d572f515c41e7b1e8, tree 1fd82564fffaf382f63b6c58cbf4cdd66718c2f1d75fb913a200c93d75961d24.
  • Installation (codex): CLI codex-cli 0.160.0, plugin 1.5.0, candidate 241b1bafe5158252f6be839d572f515c41e7b1e8, tree 1fd82564fffaf382f63b6c58cbf4cdd66718c2f1d75fb913a200c93d75961d24.
  • Observation (claude / project-skill): surface claude -p stream-json with the candidate plugin-dir; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 998661e5266366a36ab4ca6dd41591655947464cb5ae6d85e1c469a859b56f20; artifact-set SHA-256 3315e5d6c6ad1ed50dd73c7b245868e64697260498e4e2b2c634c557425b48a0.
  • Observation (codex / project-skill): surface codex exec --json with the run-owned candidate installation; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 9473e20c8ca1b7d6292c23a6b0e86c321252b00ffd9cde86a769ffe73832e67c; artifact-set SHA-256 0ed80d22be8a6109bf7bb2753f10a029588a5779554f82adcc1f7d94ef7753f2.
  • Policy: every new head requires a fresh run; this verifier does not change PR state, queue, or merge.

@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 0/5

[High risk] Adds machine-checked test recipes to the verification system.

This PR is not safe to merge while the live gate can pass untested behavior and cannot run the selected Codex asset case.

Findings

  1. P1 Changed tools go untested ▶
  2. P1 Skill work goes unchecked ▶
  3. P1 New routes may not load ▶
  4. P1 Logo changes cannot pass ▶
  5. P1 Failing checks look fixed ▶

Summary

The live gate now runs Claude and Codex headlessly and uses feature recipes to check what each session did. It keeps private session evidence and still publishes results against the pinned exact SHA.

  • Adds fixture-based recipes for selected features, including local-only cases for skills with remote side effects.
  • Adds repeatable runner-route options and records machine-checked assertions in the evidence.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Classify changed files] --> B[Select features]
  B --> C[Run native sessions]
  C --> D[Check session records and fixture files]
  D --> E[Publish exact-head live gate]
Loading

Reviews (1) · Last reviewed commit: "fix(verify): exercise babysit headless a..."

if (feature === 'project-skill') return [projectSkill];
if (feature === 'runner') return runner(harness, routes);
if (feature === 'setup' || feature === 'skill-invocation:setup-pstack') return setup;
if (feature === 'shipped-tools') return [shippedTools];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Changed tools go untested

When orch, watch-pr, check-plan, or the worktree audit changes, the registry selects shipped-tools, but this recipe runs only log.sh. The gate can report success without running the changed tool. Add cases for those tools, or fail when a selected tool has no case.

Comment on lines +94 to +98
async function ciFixed(_record: SessionRecord, f: Fixture): Promise<Evidence> {
if (!/return\s+a\s*\+\s*b/.test(await readFile(join(f.dir, 'sum.mjs'), 'utf8'))) throw new Error('ci-not-fixed:sum.mjs');
return { assertions: ['fixed:sum.mjs'], files: [join(f.dir, 'sum.mjs')] };
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Skill work goes unchecked

The default skill-invocation case passes when the skill name appears in the session record and any nonempty result.md is written. For a changed skill such as architect, that does not show that its design workflow ran or produced its required output. The gate can pass on a short note instead of the changed behavior. Check the work required by each selected skill.

Comment on lines +178 to +183
const descriptors = (await readFile(sheet, 'utf8')).match(/\b(?:claude|codex|grok):[A-Za-z0-9._-]+@[a-z]+/g) ?? [];
if (!descriptors.length || descriptors.some(d => d !== SETUP_DESCRIPTOR)) throw new Error('sheet-descriptors-mismatch');
return { assertions: [...assertions, `sheet:${SETUP_DESCRIPTOR}`], files: [sheet] };
},
}, {
id: 'consume',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 New routes may not load

The setup cases check the sheet, then ask poteto-mode to read it directly. They never check the CLAUDE.md import or AGENTS.md block that makes the sheet available in normal sessions. If setup writes the sheet but misses that second write, both cases can pass while users keep their old routes. Check that setup also writes the parent integration.


/** Resolve a feature's cases, or fail with a named reason before any session starts. */
export function recipe(feature: string, harness: Harness, routes: string[] = []): Case[] {
if (feature === 'assets:codex') throw new Error('unsupported-native-consumer:assets:codex');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Logo changes cannot pass

A change to the Codex-consumed logo selects assets:codex, but recipe() always throws for that feature. A logo-only PR therefore fails the live gate before any native session starts. Add a case that checks the installed Codex consumer.

Comment on lines +104 to +106
return { assertions: ['history-unchanged'], files: [] };
}, async f => {
await taskRepository(f);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Failing checks look fixed

The fix-ci and babysit cases accept a source line matching return a + b but never run sh ci.sh. The live gate can pass even when the fixture's test still fails. Run that check after the edit and require it to succeed.

@unfret-eal

unfret-eal Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

✅ Accepted risk

Accepted by ericlitman: GH-112 (authority 48fa77b)

🔴 High · Runner defaults omit changed providers

🔴 High · Shipped-tool changes run only logging

🔴 High · Runner output is not checked for the promised response

🔴 High · Setup consumption accepts a mismatched route

🔴 High · Test setup integration instead of explicitly reading the sheet

🔴 High · Exercise runner validation and failure paths

🔴 High · Check the whole worktree in the review-guidance recipe

🔴 High · Allow external-provider skill workflows in Codex recipes

🔴 High · Reject incomplete setup sheets

🔴 High · Validate every requested log field

🔴 High · Automate-me accepts malformed skill files

🔴 High · Run the failing CI command when asserting the fix

🔴 High · Verify the Claude skill source, not only its command name

🔴 High · Default assertions accept incorrect answers

🔴 High · Generic fixtures do not exercise skill-specific behavior

🔴 High · Setup changed branches are reduced to one all-Opus scenario

🔴 High · Denied Claude tool calls do not fail the case

🔴 High · Mentioning a helper command counts as executing it

🔴 High · Runner cases do not require skill loading

🟡 Medium · Empty CLAUDE_CONFIG_DIR resolves to the wrong assertion path

🟡 Medium · Interrupts during file opens miss the child

Advisories (1)
  • Doctor does not probe the new headless launch flags
    Not blocking because: Doctor can report pass before an unsupported headless flag causes launch rejection. Nonzero session exits fail verification, preventing successful runtime evidence; the confirmed impact is delayed diagnosis and wasted preparation.
Details

Run: GET /unfret/run/panel:5a996d8bfff127821536a53c392ad83f02940994:PjaUzm0Q8xC:VCnOpZhh0-k.

@unfret review · @unfret status · @unfret help

@unfret-eal unfret-eal Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 20 blocking findings
🔴 High · All shipped-tool changes are verified through log.sh only
🔴 High · Runner output is not checked for the promised response
🔴 High · Test setup integration instead of explicitly reading the sheet
🔴 High · Exercise runner validation and failure paths
🔴 High · Validate every requested log field
🔴 High · Remove the contradictory automate-me prohibition
🔴 High · Run the failing CI command when asserting the fix
🔴 High · Fail a case when a tool invocation is denied or errors
🔴 High · Verify the Claude skill source, not only its command name
🔴 High · Restore Codex's run-owned setup configuration after the feature
🔴 High · Check the whole worktree in the review-guidance recipe
🔴 High · Reject incomplete setup sheets
🔴 High · Select the runner provider branch being changed
🔴 High · Allow external-provider skills to run from Codex recipes
🔴 High · Default skill recipes accept arbitrary result text
🔴 High · Validate automate-me output as a real skill file
🔴 High · Do not accept a generic result file as skill behavior proof
🔴 High · Setup consumption can report a mismatched route and pass
🟡 Medium · Treat an empty CLAUDE_CONFIG_DIR as the default home
🟡 Medium · Interrupt during session file opens leaves session unkilled
Check

if (feature === 'project-skill') return [projectSkill];
if (feature === 'runner') return runner(harness, routes);
if (feature === 'setup' || feature === 'skill-invocation:setup-pstack') return setup;
if (feature === 'shipped-tools') return [shippedTools];

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Shipped-tool changes run only logging

Changes to orch, watch-pr, check-plan, worktree audit, or bootstrap select shipped-tools, but this branch returns only the log.sh case. Successful logging can publish a passing gate while the changed tool and its required consumers never execute. Also reported for this defect: - Run the selected shipped tool, not always log.sh (.claude/skills/verify-open-pstack/features/recipes.ts:210): Every path in the tools registry is classified as shipped-tools, but this branch always returns the one logging recipe. A PR that breaks orch, watch-pr, check-plan, the worktree audit, or bootstrap can therefore pass after only show-me-your-work/log.sh runs, publishing success without exercising the changed tool. - Shipped-tool changes are verified only through log.sh (.claude/skills/verify-open-pstack/features/recipes.ts:210): Every registered tools path maps to shipped-tools, but this branch always returns the single logging case. If a PR breaks orch, watch-pr, check-plan, the worktree audit, or bootstrap.ts while log.sh remains healthy, neither harness invokes the changed tool and the verifier can publish a successful live gate. - All shipped-tool changes are verified through log.sh only (.claude/skills/verify-open-pstack/features/recipes.ts:210): Every shipped-tools selection returns the single logging case. A PR that breaks orch, watch-pr, check-plan, or the worktree audit is classified as shipped-tools, but this branch exercises only show-me-your-work/log.sh, allowing the unrelated logging check to publish success for the broken changed tool. Also reported for this defect: - shipped-tools recipe passes tool changes it never runs (.claude/skills/verify-open-pstack/features/recipes.ts:210): recipe('shipped-tools') always returns the single log.sh case. Classification maps every tools path to the one shipped-tools feature. That covers orch, watch-pr, check-plan, the worktree audit and bootstrap.ts. Scenario: a PR changes orch. The run invokes only show-me-your-work/log.sh, its TSV assertions pass, and the verifier publishes live-gate=success with "PASSED — all mapped features verified". The changed tool was never executed. This breaks the AGENTS.md gate ("the changed behavior passes a live test"). It also breaks the PR's own rule that a feature without a recipe fails before any session starts, which assets:codex follows. shipped-tools.md admits these tools "have no case yet", but the code returns success instead of failing closed. - Exercise the selected shipped tool, not always log.sh (.claude/skills/verify-open-pstack/features/recipes.ts:210): Any change under orch, watch-pr, check-plan, worktree-audit, or bootstrap is classified as shipped-tools, but this branch always returns only the show-me-your-work log case. Such a PR can receive a successful live gate while its changed tool is never invoked; bootstrap changes also miss both mandated consumers.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:210

if (receipt.status !== 'complete') throw new Error(`receipt-status:${receipt.status}`);
if (receipt.parent !== harness || receipt.provider !== provider || receipt.model !== model || receipt.effort !== effort || receipt.mode !== 'read-only') throw new Error('receipt-route-mismatch');
if (receipt.outputPath !== lane(f, 'output.md') || !(Date.parse(receipt.startedAt) >= record.started)) throw new Error('receipt-not-this-session');
return { assertions: ['runner-ran', 'receipt-complete', `route:${route}`, await written(record, lane(f, 'output.md'))], files: [lane(f, 'receipt.json'), lane(f, 'output.md')] };

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Runner output is not checked for the promised response

The runner case asks the child to return exactly PONG, but this assertion accepts any freshly written nonempty output. If prompt delivery or model output regresses to PUNG or an unrelated response while the launcher records a completed receipt, the runner live gate still passes. Also reported for this defect: - Check the runner's requested PONG output (.claude/skills/verify-open-pstack/features/recipes.ts:166): The child prompt requires the single word PONG, but the assertion accepts any nonempty output file. A regression that drops prompt delivery or returns unrelated output can still produce a complete receipt and receive successful live evidence. Also reported for this defect: - Runner output need not equal PONG (.claude/skills/verify-open-pstack/features/recipes.ts:166): A runner regression returning PUNG or unrelated text passes when its receipt is complete and the output file is fresh and nonempty. The requested PONG response is never checked before successful evidence is recorded. - Assert the runner's requested PONG response (.claude/skills/verify-open-pstack/features/recipes.ts:166): The case asks the child to return exactly PONG, but the assertion accepts any fresh nonempty output. A completed receipt with PUNG or unrelated output satisfies every check and can publish successful runner evidence despite broken prompt delivery or response handling. - Runner output is not checked for PONG (.claude/skills/verify-open-pstack/features/recipes.ts:166): The case requests the exact response PONG, but the assertion accepts any fresh nonempty output file. A child that receives the wrong prompt or writes PUNG can still produce a complete receipt and pass the runner live gate.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:166

},
}, {
id: 'consume',
prompt: f => `${invoke(f.harness, 'poteto-mode', `Do no engineering work. Read the configured pstack model sheet and write to ${join(f.dir, 'route.txt')} one line naming the descriptor configured for the "judgment and prose" role and the route this parent uses for it.`)} ${rules(f.dir)}`,

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Test setup integration instead of explicitly reading the sheet

The consumer is directly instructed to read pstack-models.md. If setup writes a valid sheet but fails to update Claude's CLAUDE.md import or Codex's AGENTS.md block, this fresh session can still read the file on demand and report the expected descriptor, so the broken normal user integration receives a passing gate. Also reported for this defect: - Explicit sheet reads bypass setup integration (.claude/skills/verify-open-pstack/features/recipes.ts:184): If setup writes the sheet but omits Claude's CLAUDE.md import or Codex's AGENTS.md configuration block, this consumer can still read the sheet because the prompt explicitly requests it. Both cases can pass despite broken normal configuration discovery. - Test setup integration instead of directly reading the sheet (.claude/skills/verify-open-pstack/features/recipes.ts:184): The consumer is explicitly told to read pstack-models.md. If setup writes the sheet but fails to add Claude's CLAUDE.md import or Codex's AGENTS.md block, both setup cases can still pass even though normal sessions do not load the configuration. - Setup integration is bypassed by explicitly reading the sheet (.claude/skills/verify-open-pstack/features/recipes.ts:184): The consuming session is directly instructed to read pstack-models.md. If setup writes a valid sheet but fails to add the normal Claude or Codex instruction-file integration, this prompted lookup still finds the descriptor and the broken installed setup passes.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:184


function runner(harness: Harness, routes: string[]): Case[] {
const chosen = routes.filter(route => !route.startsWith(`${harness}:`));
return (chosen.length ? chosen : [DEFAULT_ROUTES[harness]]).map((route, index) => {

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Exercise runner validation and failure paths

Every generated runner case supplies valid arguments and requires a complete receipt. A candidate that breaks same-provider rejection, invalid-argument handling, authentication failures, or malformed-output reporting still passes these success-only cases even though runner.md requires changed invalid and failure branches to be exercised. Also reported for this defect: - Runner validation and failure paths are never exercised (.claude/skills/verify-open-pstack/features/recipes.ts:152): All generated cases use valid arguments and require a successful complete receipt. A PR that breaks same-provider rejection, invalid-argument handling, authentication failures, or malformed-output reporting still passes because none of those changed branches is invoked. - Exercise runner validation and failure paths (.claude/skills/verify-open-pstack/features/recipes.ts:152): All generated runner cases use valid arguments and require a successful complete receipt. A candidate that breaks same-provider rejection, malformed-argument handling, authentication failures, or failure receipt generation still passes because none of those changed branches is invoked. - Runner failure branches receive no exercise (.claude/skills/verify-open-pstack/features/recipes.ts:158): Every generated case requests successful dispatch and requires a complete receipt. A candidate that stops rejecting same-provider requests or invalid arguments can pass every case; changed validation and failure behavior is never exercised as the runner contract requires.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:152

Also affects:

const slug = feature.replace(/[^a-z0-9-]/g, '-'), dir = join(home, 'fixtures', slug), records = join(receipt.artifactRoot, 'sessions', harness, slug);
for (const path of [dir, records]) await mkdir(path, { recursive: true, mode: 0o700 });
const fixture: Fixture = { harness, dir, workspace, location: installation.location, run: this.candidate(home),
configHome: harness === 'claude' ? env.CLAUDE_CONFIG_DIR ?? join(env.HOME!, '.claude') : env.CODEX_HOME! };

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Empty CLAUDE_CONFIG_DIR resolves to the wrong assertion path

The supported ${CLAUDE_CONFIG_DIR:-$HOME/.claude} behavior treats an empty variable as the default home, but nullish coalescing preserves ''. Setup then writes under $HOME/.claude while the assertion reads a relative pstack-models.md, causing a correct setup run to fail with ENOENT. Also reported for this defect: - Treat an empty CLAUDE_CONFIG_DIR as the default home (.claude/skills/verify-open-pstack/scripts/harness.ts:149): The supported config-home contract treats empty and unset values identically, but nullish coalescing preserves ''. With CLAUDE_CONFIG_DIR='', setup writes $HOME/.claude/pstack-models.md while this assertion looks for a relative pstack-models.md, causing a valid setup run to fail with ENOENT. - Empty Claude config homes resolve incorrectly (.claude/skills/verify-open-pstack/scripts/harness.ts:149): With CLAUDE_CONFIG_DIR set to an empty string, the supported default is HOME/.claude. Nullish coalescing instead preserves the empty value, so setup writes to the default home while its assertion reads relative pstack-models.md and rejects valid behavior with ENOENT. - Treat an empty CLAUDE_CONFIG_DIR as the default home (.claude/skills/verify-open-pstack/scripts/harness.ts:146): An empty CLAUDE_CONFIG_DIR is explicitly defined to resolve to $HOME/.claude, but nullish coalescing preserves ''. In that valid environment setup writes $HOME/.claude/pstack-models.md while the assertion reads relative pstack-models.md, causing the setup recipe to fail with ENOENT.

Now at .claude/skills/verify-open-pstack/scripts/harness.ts:146

Also affects:


function skillCase(skill: string, request: string, check?: (record: SessionRecord, fixture: Fixture) => Promise<Evidence>, prepare: (fixture: Fixture) => Promise<void> = taskRepository): Case {
return {
id: 'invoke',

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Allow external-provider skill workflows in Codex recipes

Generic cases do not request danger-full-access, so Codex runs them under workspace-write. Skills such as architect normally launch external Claude and Grok lanes that need network and external CLI state; those lanes can be blocked, reported as dropouts in result.md, and still satisfy the recipe. Also reported for this defect: - Default Codex cases block external lanes (.claude/skills/verify-open-pstack/features/recipes.ts:82): These cases leave codexSandbox unset, selecting workspace-write with approvals disabled. Architect, arena, how, interrogate, and swarm require external provider access; blocked lanes can produce a dropout report in result.md that still passes, yielding success without exercising their normal behavior. - Default Codex skill cases block external provider lanes (.claude/skills/verify-open-pstack/features/recipes.ts:83): Generic cases do not request danger-full-access, so Codex uses workspace-write with approvals disabled. Skills such as architect, arena, interrogate, how, and swarm can have their external Claude or Grok lanes blocked, yet write a dropout report to result.md and pass. - Allow external-provider skills to run from Codex recipes (.claude/skills/verify-open-pstack/features/recipes.ts:83): Default cases never set codexSandbox: 'danger-full-access'. Skills such as architect, arena, how, interrogate, and swarm normally launch Claude or Grok children from a Codex parent, so workspace-write can block their network and external CLI state; the skill may record dropouts and still write result.md, allowing the gate to pass without exercising those lanes.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:82-89

Also affects:

prepare,
prompt: f => `${invoke(f.harness, skill, `${request.replaceAll('$DIR', f.dir)} Write the skill's result to ${join(f.dir, 'result.md')}.`)} ${rules(f.dir)}`,
async assert(record, f) {
const assertions = [loaded(record, `pstack:${skill}`), await written(record, join(f.dir, 'result.md'))], paths = [join(f.dir, 'result.md')];

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Default assertions accept incorrect answers

An architect session can claim subtraction is correct and write that claim to result.md. Skill loading and file freshness both pass; no assertion checks the fixture's known answer, so incorrect behavior receives a successful live gate. Also reported for this defect: - Default recipes accept any result text (.claude/skills/verify-open-pstack/features/recipes.ts:87): The generic assertion proves only that the skill name appeared and a nonempty result.md was written. For example, architect can claim subtraction is correct or otherwise return the wrong answer and still receive a successful live gate. - Verify the default skill's result, not only file existence (.claude/skills/verify-open-pstack/features/recipes.ts:87-89): The default assertion accepts any freshly written nonempty result.md without checking its answer or effect. For the supplied sum task, architect can claim subtraction is correct and still receive successful live-gate evidence. - Default skill recipes accept arbitrary result text (.claude/skills/verify-open-pstack/features/recipes.ts:87): The assertion only proves that the skill loaded and created a nonempty result.md; it never checks the result against the fixture's known answer. For example, architect can claim that subtraction is correct, write that claim to the file, and still produce a successful live-gate observation.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:87

Also affects:

prompt: f => `${invoke(f.harness, 'automate-me', `My handle is fixture. There is no history to mine for this workspace, so skip mining. My answers to your questions: concise replies, and verify with tests before claiming done. Write the drafted skill to ${join(f.dir, '.claude/skills/fixture-mode/SKILL.md')}.`)} ${rules(f.dir)}`,
async assert(record, f) {
const path = join(f.dir, '.claude/skills/fixture-mode/SKILL.md'), assertions = [loaded(record, 'pstack:automate-me'), await written(record, path)];
if (!/name:\s*fixture-mode/.test(await readFile(path, 'utf8'))) throw new Error('mode-skill-unnamed');

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Automate-me accepts malformed skill files

A fresh file containing only name: fixture-mode satisfies this regex despite lacking YAML frontmatter and usable skill instructions. Malformed authored skill output can therefore receive successful automate-me evidence. Also reported for this defect: - Automate-me accepts an invalid skill file (.claude/skills/verify-open-pstack/features/recipes.ts:117): The unanchored regex accepts name: fixture-mode anywhere in arbitrary text. A fresh file containing only that line, without YAML frontmatter or usable skill instructions, satisfies the recipe and is reported as a valid authored skill. - Validate automate-me output as an actual skill file (.claude/skills/verify-open-pstack/features/recipes.ts:117-118): The unanchored regex accepts name: fixture-mode anywhere in arbitrary text. A malformed file with no YAML frontmatter or usable instructions, such as garbage name: fixture-mode, passes as a generated mode skill. - Validate automate-me output as a real skill file (.claude/skills/verify-open-pstack/features/recipes.ts:117): The unanchored regex accepts name: fixture-mode anywhere in arbitrary text. A malformed file without YAML frontmatter or usable skill instructions can therefore satisfy mode-skill and receive successful evidence.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:117

Also affects:

const skill = /^skill-invocation:([a-z][a-z0-9-]+)$/.exec(feature)?.[1];
if (!skill) throw new Error(`missing-recipe:${harness}/${feature}`);
return [overrides[skill] ?? skillCase(skill, 'Apply it to the task in $DIR/TASK.md.')];
}

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Generic fixtures do not exercise skill-specific behavior

Every non-overridden skill receives the same local sum task. For example, get-pr-comments runs in a repository with no remote or active PR and can write “no active PR” to result.md, passing without fetching or summarizing any comments. Also reported for this defect: - Generic fixtures skip required skill behavior (.claude/skills/verify-open-pstack/features/recipes.ts:213): A get-pr-comments change receives a local sum repository without a remote or active PR. Writing “no active PR” passes this fallback without fetching or summarizing any comments, allowing success without exercising the selected skill's required behavior. - Use fixtures that exercise each selected skill (.claude/skills/verify-open-pstack/features/recipes.ts:213): Every non-overridden skill receives the same local sum repository. For example, get-pr-comments has no remote or active PR, so it can write a “no active PR” result and pass without fetching or summarizing any review comments; the changed skill behavior is never exercised. - Do not accept a generic result file as skill behavior proof (.claude/skills/verify-open-pstack/features/recipes.ts:214): The fallback gives every non-overridden skill the same tiny sum task and accepts any nonempty result.md. For example, a get-pr-comments change runs in a repository with no remote; writing “no active PR” satisfies these assertions and can publish success without fetching or summarizing any comments.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:214

Also affects:

prompt: f => `${invoke(f.harness, 'poteto-mode', `Do no engineering work. Read the configured pstack model sheet and write to ${join(f.dir, 'route.txt')} one line naming the descriptor configured for the "judgment and prose" role and the route this parent uses for it.`)} ${rules(f.dir)}`,
async assert(record, f) {
const path = join(f.dir, 'route.txt'), assertions = [loaded(record, 'pstack:poteto-mode'), await written(record, path)];
if (!(await readFile(path, 'utf8')).includes(SETUP_DESCRIPTOR)) throw new Error('consumer-route-mismatch');

@unfret-eal unfret-eal Bot Oct 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Setup consumption accepts a mismatched route

The consumer check is only a substring search for the configured descriptor. Output such as configured: claude:opus@high; route used: codex:other@max passes even though the parent ignored the configured route. Also reported for this defect: - Setup accepts a mismatched consumed route (.claude/skills/verify-open-pstack/features/recipes.ts:187): Output such as configured: claude:opus@high; route used: codex:other@max satisfies this substring check. The consumer can ignore the configured route and still produce successful setup evidence. - Require the route actually used to match setup (.claude/skills/verify-open-pstack/features/recipes.ts:187-188): The consumer assertion is an unrestricted substring search. Output such as configured: claude:opus@high; route used: codex:wrong@max passes even though the parent ignored the configured route, yielding false successful setup evidence. - Setup consumption can report a mismatched route and pass (.claude/skills/verify-open-pstack/features/recipes.ts:187): The consumer assertion only requires route.txt to contain claude:opus@high. Output such as configured: claude:opus@high; route used: codex:other@max therefore passes even though the consuming skill ignored the configured route, yielding a false successful setup observation.

Now at .claude/skills/verify-open-pstack/features/recipes.ts:187

Also affects:

…ll (#112)

Unfret on 241b1ba: Codex setup left an all-Opus sheet in the run-owned
CODEX_HOME for every later check, and the automate-me prompt forbade the
skill write it asked for.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ericlitman

Copy link
Copy Markdown
Owner Author

Live evidence: Open Pstack

  • Candidate SHA: 5a996d8bfff127821536a53c392ad83f02940994
  • Base SHA: ce6e8c48bb961520036020663c15f427bd8d20ad
  • Result: PASSED — all mapped features verified
  • Self-test: completed in both harnesses
  • Publisher revision: 5a996d8bfff127821536a53c392ad83f02940994
  • Evidence-set SHA-256: 27ae51f4400e9d33a408ecf5fef74de8eb7bc3f8f52e2aa41e9d82f6991228e0
  • Installation (claude): CLI 2.1.289 (Claude Code), plugin 1.5.0, candidate 5a996d8bfff127821536a53c392ad83f02940994, tree 1fd82564fffaf382f63b6c58cbf4cdd66718c2f1d75fb913a200c93d75961d24.
  • Installation (codex): CLI codex-cli 0.160.0, plugin 1.5.0, candidate 5a996d8bfff127821536a53c392ad83f02940994, tree 1fd82564fffaf382f63b6c58cbf4cdd66718c2f1d75fb913a200c93d75961d24.
  • Observation (claude / project-skill): surface claude -p stream-json with the candidate plugin-dir; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 b110b761dc7c08737ed88a7ee562d2b1cae06259b573d8c393aa4a463c8c9723; artifact-set SHA-256 5e3a0fd27bfc09742559b2503269360a574445c3aa6ce1637f54b2793fa6f019.
  • Observation (codex / project-skill): surface codex exec --json with the run-owned candidate installation; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 aa6c5d4641183c9bc087066834a5034446f9202036349b2efe70089ffeac554a; artifact-set SHA-256 eb167e61bc95b7c9c0f8fbb7abdb9dd76783d820a5d1d131b5790f17fbeda5b7.
  • Policy: every new head requires a fresh run; this verifier does not change PR state, queue, or merge.

@unfret-eal unfret-eal Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 21 blocking findings
🔴 High · Runner defaults omit changed providers
🔴 High · Shipped-tool changes run only logging
🔴 High · Runner output is not checked for the promised response
🔴 High · Setup consumption accepts a mismatched route
🔴 High · Test setup integration instead of explicitly reading the sheet
🔴 High · Exercise runner validation and failure paths
🔴 High · Check the whole worktree in the review-guidance recipe
🔴 High · Allow external-provider skill workflows in Codex recipes
🔴 High · Reject incomplete setup sheets
🔴 High · Validate every requested log field
🔴 High · Automate-me accepts malformed skill files
🔴 High · Run the failing CI command when asserting the fix
🔴 High · Verify the Claude skill source, not only its command name
🔴 High · Default assertions accept incorrect answers
🔴 High · Generic fixtures do not exercise skill-specific behavior
🔴 High · Setup changed branches are reduced to one all-Opus scenario
🔴 High · Denied Claude tool calls do not fail the case
🔴 High · Mentioning a helper command counts as executing it
🔴 High · Runner cases do not require skill loading
🟡 Medium · Empty CLAUDE_CONFIG_DIR resolves to the wrong assertion path
🟡 Medium · Interrupts during file opens miss the child
Check

const setup: Case[] = [{
id: 'configure',
codexSandbox: 'danger-full-access',
prompt: f => `${invoke(f.harness, 'setup-pstack', `Use these answers and ask nothing else. Role assignments: change every role assigned to a model-matrix family to the Opus family, and keep inherit-parent and auto roles unchanged. Opus requested effort: high. I confirm every write. Write the setup report to ${join(f.dir, 'result.md')}.`)} Do not push, post, or contact GitHub.`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Setup changed branches are reduced to one all-Opus scenario

Every setup-related change runs the same successful all-Opus configuration. A PR that breaks unavailable-provider handling, harness-to-provider mapping, or another changed setup branch can still pass because that branch is never selected by the recipe.

const found = f.harness === 'claude' ? record.skills.includes('verify-open-pstack')
: (await Promise.all(record.skills.map(path => realpath(path).catch(() => '')))).includes(skill);
if (!found) throw new Error('skill-not-loaded:verify-open-pstack');
if (!record.commands.some(c => c.includes('verify.sh') && c.includes('doctor --candidate'))) throw new Error('doctor-not-run');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Mentioning a helper command counts as executing it

Command assertions use substring searches rather than establishing that the expected executable was invoked. The same pattern is used for project doctor, runner, and log.sh; a successful command that merely mentions the path, followed by manually written expected artifacts, can pass while the real helper remains broken.

if (receipt.status !== 'complete') throw new Error(`receipt-status:${receipt.status}`);
if (receipt.parent !== harness || receipt.provider !== provider || receipt.model !== model || receipt.effort !== effort || receipt.mode !== 'read-only') throw new Error('receipt-route-mismatch');
if (receipt.outputPath !== lane(f, 'output.md') || !(Date.parse(receipt.startedAt) >= record.started)) throw new Error('receipt-not-this-session');
return { assertions: ['runner-ran', 'receipt-complete', `route:${route}`, await written(record, lane(f, 'output.md'))], files: [lane(f, 'receipt.json'), lane(f, 'output.md')] };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Runner cases do not require skill loading

If Codex fails to resolve $pstack:poteto-mode but follows the prompt's explicit launcher command, a complete receipt and fresh output still pass. This assertion never checks record.skills, so direct CLI execution is accepted as proof of the required installed workflow.

@ericlitman

Copy link
Copy Markdown
Owner Author

Unfret waiver for head 5a996d8, accepted by Eric on 2026-10-04. Ticket GH-112 is GitHub issue #112.

Class Findings Basis
unconfirmed (recipe depth) 19 findings: runner defaults and provider lanes, runner PONG output, runner failure paths, runner skill loading, shipped tools only through log.sh, log field coverage, the CI fix matched by text, the make-pr worktree check, setup sheet completeness, setup consumption text, setup integration, the single all-Opus setup scenario, the default recipe accepting arbitrary text, generic fixtures, the automate-me file format, the Codex external-lane sandbox, denied Claude tools, Claude skill source by command name, and helper commands matched by substring Each says a recipe asserts less than a full behavior check, so a broken candidate could pass. None is traced to a real false pass. Closing them needs a bespoke check per skill and per failure branch, which Eric ruled out on 2026-10-04 because each edge-case fix costs about $40 and 3+ hours. The live gate still requires the candidate skill loaded in the native record, exit 0, and a fixture effect from that session.
fails-loudly Empty CLAUDE_CONFIG_DIR The setup case fails with ENOENT. It cannot false-pass.
pre-accepted Interrupt during the session file opens The trigger is a signal inside a timing window the system does not create, and the fix would add a guard.

The two verdict-changing findings from head 241b1ba were fixed in 5a996d8: the automate-me contradiction, and the Codex setup leak.

@mergify

mergify Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-04 18:27 UTC · Rule: default · triggered by merge protections
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-10-04 18:27 UTC · at d6c95c4105faf68163a2b9c23de5bdc190ffe2e7 · merge

This pull request spent 7 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify
mergify Bot merged commit d6c95c4 into main Oct 4, 2026
5 checks passed
andrewfree pushed a commit to andrewfree/open-pstack that referenced this pull request Oct 4, 2026
Bring in ericlitman/open-pstack main at d6c95c4: the repository verify
skill runs the live gate headless with machine-checked recipes (ericlitman#112).
No plugin files change, so 1.5.1-local.10 stays as installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Headless mode for verify-open-pstack: live-gate without a person in the loop

1 participant