mirror of
https://github.com/garrytan/gstack.git
synced 2026-08-31 10:20:42 +02:00
Six paid PTY tests wrote their expected plan artifact to a FIXED shared
/tmp path ('/tmp/gstack-test-plan-<mode>.md') and rmSync'd it in
finally — under --retry 1, EVALS_JOBS>1, or two concurrent worktrees, a
sibling's cleanup deletes this run's artifact and the D19 'agent did
not produce expected plan file' assertion fires spuriously. Each test
now mkdtemps its own dir, interpolates the unique path into the agent
prompt (fixture-sourced prompts get a replaceAll + drift guard that
throws if the fixture's literal ever moves), and cleans up its own dir.
The 18 cwd:-into-the-live-repo sites were audited: all deliberate
(skill registry + hermetic pre-trusted dir, in-repo gen renders, git
history reads, slug resolution) — each now carries a
'// LIVE-REPO CWD: <reason>' comment so the next audit can tell
deliberate from accidental.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
/**
|
|
* /plan-devex-review AskUserQuestion floor regression (gate, paid, real-PTY).
|
|
*
|
|
* See test/skill-e2e-plan-eng-finding-floor.test.ts for the contract.
|
|
*/
|
|
|
|
import { test } from 'bun:test';
|
|
import { describeE2ETier } from './helpers/e2e-gate';
|
|
import { runPlanSkillFloorCheck } from './helpers/claude-pty-runner';
|
|
import { FORCING_FLOOR_DEVEX } from './fixtures/forcing-finding-seeds';
|
|
|
|
const describeE2E = describeE2ETier('gate');
|
|
|
|
describeE2E('/plan-devex-review AskUserQuestion floor (gate)', () => {
|
|
test(
|
|
'seeded forcing finding causes the agent to fire at least one AskUserQuestion',
|
|
async () => {
|
|
const obs = await runPlanSkillFloorCheck({
|
|
skillName: 'plan-devex-review',
|
|
slashCommand: '/plan-devex-review',
|
|
followUpPrompt: FORCING_FLOOR_DEVEX,
|
|
// LIVE-REPO CWD: PTY session needs the repo cwd — gstack skill
|
|
// registry + hermetic pre-trusted dir (hermetic-env trustedDirs).
|
|
cwd: process.cwd(),
|
|
timeoutMs: 600_000,
|
|
env: { QUESTION_TUNING: 'false', EXPLAIN_LEVEL: 'default' },
|
|
});
|
|
|
|
if (obs.outcome !== 'auq_observed') {
|
|
throw new Error(
|
|
`floor test FAILED: outcome=${obs.outcome} elapsed=${obs.elapsedMs}ms\n` +
|
|
`summary: ${obs.summary}\n` +
|
|
`--- evidence (last 3KB) ---\n${obs.evidence}`,
|
|
);
|
|
}
|
|
},
|
|
660_000,
|
|
);
|
|
});
|