mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-16 01:45:29 +02:00
* feat: add a restricted and supervised Claude Code runner Preserve configured authentication and models while enforcing tool access, strict completion JSON, bounded output and process cleanup. Cover argv, failure handling, session metadata and Windows process containment. * feat: route outside reviews by harness and migrate wrapper installs Use Claude Code from Codex and Codex from other supported hosts, with shared invocation rendering, positive gate validation and per-phase provenance. Rename /claude to /claude-code, repair managed shared and copied installations safely, and generate native Kiro skills. Add installed-workflow, failure-injection and live cross-harness regression coverage. * test: recognize CEO mode labels without terminal spacing The paid workflow rendered SCOPEEXPANSION at option 4, but its driver required a literal space. Match the leading mode title without cursor-spacing artifacts and ignore adjacent preview text. Preserve missing-target failures and downstream posture assertions. * test: isolate plan-count fixtures before starting review workflows Seed the complete test plan in a private git repository before launching Claude, so a bare slash command cannot review the live workspace while a delayed fixture message remains queued. Preserve count thresholds, parsers and budgets. Add initial-context and installed-discovery tests, and retain startup/terminal diagnostics on failed evaluations. * test: stabilize review fixtures and Claude eval startup Preserve source boundaries in workflow judge inputs, isolate CEO mode plans, and wait for interactive trust input readiness. Keep startup failure evidence and retain existing models, budgets, and assertions. Co-Authored-By: OpenAI Codex <noreply@openai.com> * test: classify collapsed review modes and isolate seeded findings Keep review questions out of the setup count when terminal cursor positioning removes spaces. State existing webhook safeguards so the five-finding control measures its seeded defects without accidental extra security and concurrency gaps. Preserve question bands and the paired control. Co-Authored-By: OpenAI Codex <noreply@openai.com> * test: isolate browser daemon state across free shards Co-Authored-By: OpenAI Codex <noreply@openai.com> * test: stabilize native review counting and interactive navigation Co-Authored-By: OpenAI Codex <noreply@openai.com> * chore: prepare v1.82.0.0 release Co-Authored-By: OpenAI Codex <noreply@openai.com> * fix: eliminate browser and process-cleanup test flakes Pin every CI surface to Bun 1.4.0 to avoid extra-stdio finalizers closing reused live sockets. Add an isolated GC/listener regression that fails on Bun 1.3.13, and prevent coordinated rollback to an affected CI runtime. Check renderer cleanup against the render's own staging directory so concurrent renders cannot invalidate the assertion. Make the no-pgrep process-tree walk tolerate disappearing /proc entries, and synchronize its test fixture through child readiness and pipe EOF instead of sleeps. Validation: 9,157 passed, 31 skipped, zero failures across 556 files with retries disabled. Build, all-host generation freshness, and skill checks passed. All three races have failing-before/passing-after regressions. * fix: count completed native review questions in evals * fix: drive review navigation from confirmed native choices * fix: require complete section-loading eval reports * test: isolate telemetry HTTP transport from local assertions * fix: keep review input on the active native question * test: let tunnel revocation daemon choose an available port * test: allocate available ports for pairing and watchdog fixtures * fix: stabilize planning eval navigation and phase reporting * test: isolate installed runtime paths in planning evals * test: stabilize review evidence and concurrent refresh fixtures * fix: resolve design findings before editing the plan * fix: honor and persist disabled outside plan reviews * fix: preserve planning decisions and terminal evidence Load installed host reviews at autoplan phase entry and wait for completed reviewers and saved artifacts. Reuse approved remedies while preserving individual finding decisions. Drive interactive evals from the current terminal viewport, bind native questions across scrolling, and require complete native report evidence. Cover captured stale menus, permission lifecycles, setup classification, and disabled-review tool availability with deterministic regressions. Advance release metadata and the upgrade migration to the unclaimed 1.83.0.0 slot. * fix: drive native review questions and preserve current plans Use the native single-choice keyboard protocol and current terminal viewport, with per-question navigation inside packets and completed-call coverage. Keep permissions, multi-select menus, and Submit controls distinct. Send Autoplan reviewers the amended implementation plan, keep its review record separate, and supply retained application contracts in the chain fixture. Clarify individual DevEx decisions and complete CEO fix options; use one active plan destination for the section-loading report. * fix: preserve complete plan-review decisions * fix: recognize native plan dialogs and reviewer controls * fix: preserve review decisions and phase completion * fix: recognize completed reviews without losing findings * fix: preserve review continuity and native eval completion * test: fix native review completion and eval retry isolation * test: handle native review menus and complete eval fixtures * test: fix native review setup, completion, and isolation failures * test: limit native skill discovery to runtime assets * fix: bind Autoplan reviews to full ordered phase inputs * test: fix planning eval routing, counting, and timeout handling * chore: advance queued release to v1.84.0.0 * fix: preserve complete review inputs and planning decisions * fix: reconcile review approvals and preserve phase obligations * fix: preserve review obligations and unblock eval permissions Carry recorded Autoplan requirements into blind phase inputs, require Eng review approvals before exit, and exercise combined asynchronous flows in CEO reviews. Correct native finding and handoff classification and unblock repeated report edits using scoped request identities. * fix: retain plan requirements and complete native review dialogs * fix: complete native review prompts and retain plan references * fix: preserve review inputs and classify native eval evidence * fix: check competing completion orders in CEO reviews * fix: recognize review decisions and require phase methodology Require the current phase methodology before Autoplan snapshots. Correct substantive decision, closed handoff, and cache-finding classification, and honor the recommended implementation approach in native review dialogs. Add captured-transcript regressions without changing review thresholds, provider models, retries, or deadlines. * test: bind native review decisions and close completed handoffs * fix: complete review dialogs and verify methodology delivery * fix: preserve review evidence and unblock native eval prompts * fix: handle native review question completions * fix: recognize native review narration and controls * fix: count native review decisions and isolate eval fixtures * test: verify seeded review coverage and current artifact permissions * test: isolate model and brain-aware skill renders * fix: repair native workflow evaluation and clarify review steps * fix: stabilize workflow eval evidence and review guidance * test: repair native workflow observation and fixture isolation * fix: recognize completed workflow evidence and owned skill reads * test: repair seeded workflow delivery and completion evidence * test: recognize current review evidence across native forms * test: handle native review variants and permission redraws * fix: honor review preferences and recognize native eval evidence * test: recognize completed review decisions and queued permissions * test: match current review contracts and partial-line edits * test: recognize completed workflow evidence and bounded human waits * fix: preserve review entry gates and native eval interactions * fix: recognize native workflow evidence and preserve review gates * test: recognize current review evidence and preconfigure workflow fixtures * test: recognize completed review findings and scoped artifact permissions * fix: stabilize native workflow review and permission evidence * fix: recognize current review evidence and scoped edit confirmations Clarify Design and engineering review entry instructions and Design scoring. Recognize required legacy coverage and public Autoplan completion recaps. Bind the pending Edit confirmation to its exact file, ordered digest, and one-request approval when a preceding command display remains visible. Keep reviews within their existing size limits and preserve scope gates when extracting workflow fixtures from either supported preamble header. Keep failure outcomes, review thresholds, provider choices, and eval budgets. * fix: recover review workflow progress and eval evidence * fix: recognize valid review evidence and scope selection * test: fix review evidence parsing and repeated artifact prompts * test: recognize valid review decisions and pending native cards * fix(plan-eng-review): keep final navigation consistent with approved tasks * test: recognize valid review evidence and bind legacy diff requests * fix: stabilize review eval evidence and harness repair guidance * docs: update project documentation for v1.85.0.0 Co-Authored-By: OpenAI Codex <noreply@openai.com> * test: fix Windows CI fixtures and credential scan Rebase captured JSON values and filesystem evidence using the appropriate path convention. Compile native fake CLIs on Windows and synchronize pipe holder readiness, with cleanup retained when assertions fail. Assemble synthetic credential fixtures at runtime so the added-line scan keeps enforcing the same gate without flagging its own rejection controls. Discover generated skills directly for the empty-find regression check, avoiding a recursive scan through saved evaluation artifacts and dependencies. * fix: preserve source renders on Windows Compare canonical generator paths using native separators so an output sidecar pointing at the source cannot overwrite its skill or metadata. Keep the regression fixture isolated from the real checkout and expose freshness diagnostics before asserting subprocess status. Detach Windows drain-test pipe holders from the fake provider's automatic child cleanup while preserving the enclosing runner job and its assertions. * fix: clarify outside review fallback and CEO decisions Render one applicable own-harness fallback path and retain native review, disabled policy, and missing-coverage semantics. Align report field names and mode labels, and make the existing per-cut scope approval explicit. Regenerate skill outputs and keep the workflow judge's model, thresholds, and retry policy unchanged. * chore: move release to free version slot (v1.86.0.0) PR #2852 now claims v1.85.0.0. Align the release metadata and rename migration so upgrades from that version still receive it. Co-Authored-By: OpenAI Codex <noreply@openai.com> * fix: include engineering review prerequisites and restore branch context * fix: recognize coverage diagrams and clarify design review instructions * fix: preserve file identities and join Windows test processes --------- Co-authored-by: OpenAI Codex <noreply@openai.com>
301 lines
15 KiB
TypeScript
301 lines
15 KiB
TypeScript
/**
|
||
* /plan-ceo-review mode-routing E2E (periodic, paid, real-PTY).
|
||
*
|
||
* Asserts: when /plan-ceo-review reaches its Step 0F mode-selection
|
||
* AskUserQuestion and the user picks HOLD SCOPE or SCOPE EXPANSION,
|
||
* the downstream rendered output reflects that mode's distinctive
|
||
* posture language.
|
||
*
|
||
* Why this exists: existing tests verify that the question fires. Nothing
|
||
* verifies the answer actually routes. A regression where Step 0F shows
|
||
* the question but the agent ignores the choice (e.g. always defaults
|
||
* to EXPANSION) would not be caught by any prior test.
|
||
*
|
||
* Tier: periodic (not gate). Each run navigates 8-12 prior AskUserQuestions (telemetry,
|
||
* proactive, routing, vendoring, brain, office-hours, premise×3, approach)
|
||
* before reaching Step 0F. At ~30s per AskUserQuestion that's a 4-6 min navigation
|
||
* phase per case. The full 2-case suite runs ~12-15 min, $3-4. Too slow
|
||
* for gate-tier; weekly is fine.
|
||
*
|
||
* Mode coverage: HOLD SCOPE + SCOPE EXPANSION cover the two posture poles
|
||
* (rigor vs ambition). SELECTIVE EXPANSION and SCOPE REDUCTION are V2 once
|
||
* the navigation phase is shorter or has a deterministic fast-path through
|
||
* Step 0A/0C-bis.
|
||
*
|
||
* Posture assertions: each mode has distinct downstream language. The
|
||
* checks below are deliberately permissive — they catch the binary
|
||
* "did the mode posture even apply" question, not Opus-specific phrasing.
|
||
*
|
||
* HOLD SCOPE — "rigor" or "bulletproof" or "hold scope"
|
||
* SCOPE EXPANSION — "expansion" or "10x" or "delight" or "dream"
|
||
*/
|
||
|
||
import { test } from 'bun:test';
|
||
import { CAPTURE_LONG_MS } from './helpers/eval-budgets';
|
||
import { describeE2ETier } from './helpers/e2e-gate';
|
||
import {
|
||
launchClaudePty,
|
||
isNumberedOptionListVisible,
|
||
isPlanReadyVisible,
|
||
selectPtyNumberedOption,
|
||
planCountQuestionInput,
|
||
capturePlanCountQuestion,
|
||
type AskUserQuestionFingerprint,
|
||
type ClaudePtySession,
|
||
} from './helpers/claude-pty-runner';
|
||
import { hasNativePostAnswerCeoPosture, nextCeoModeNavigation, nextCeoPostureContinuation } from './helpers/ceo-mode-option';
|
||
import { createPlanCountFixture } from './helpers/plan-count-fixture';
|
||
import { readPlanCountTranscript, type NativePublicToolEvent, type PlanCountTranscript } from './helpers/plan-count-transcript';
|
||
import { readPendingQuestion, pendingQuestionRecorderStatus } from './helpers/plan-count-pending-question';
|
||
import { createPlanCountSnapshotWriter } from './helpers/plan-count-artifacts';
|
||
|
||
const describeE2E = describeE2ETier('periodic');
|
||
|
||
interface ModeCase {
|
||
mode: 'HOLD SCOPE' | 'SCOPE EXPANSION';
|
||
/** Regex applied to visible-since-mode-pick text. At least one must match. */
|
||
postureRe: RegExp;
|
||
}
|
||
|
||
const CASES: ModeCase[] = [
|
||
{ mode: 'HOLD SCOPE', postureRe: /\b(rigor|bulletproof|hold\s*scope|maximum\s+rigor)\b/i },
|
||
{ mode: 'SCOPE EXPANSION', postureRe: /\b(expansion|10x|delight|dream|cathedral|opt[\s-]?in)\b/i },
|
||
];
|
||
|
||
// Both cases review the same plan, available before the slash command starts.
|
||
// The checkout supplying skills must not become the implicit review target.
|
||
const PLAN = [
|
||
'# Plan: Add saved project views',
|
||
'',
|
||
'## Review request',
|
||
'Review this plan directly; skip optional /office-hours.',
|
||
'After I select a review mode, briefly explain in your own words how you will',
|
||
'apply that mode to this plan before asking the next review question.',
|
||
'',
|
||
'## Goal',
|
||
'Team members repeatedly recreate filters on a project task list. Let each',
|
||
'member save a named combination of filters and sort order and reopen it later.',
|
||
'',
|
||
'## Approach',
|
||
'- Add a saved_views table scoped to the project and member.',
|
||
'- Provide authenticated create, list, update, and delete endpoints.',
|
||
'- Add a view picker and a save action beside the existing task filters.',
|
||
'- Keep existing task access rules when applying a saved view.',
|
||
'',
|
||
'## Validation',
|
||
'- Test persistence, project access, and reopening a view after task changes.',
|
||
'- Measure whether members reuse saved views during a two-week pilot.',
|
||
].join('\n');
|
||
|
||
/**
|
||
* Navigate prior AskUserQuestions with the existing prerequisite skip, otherwise option 1,
|
||
* until we hit an AskUserQuestion whose
|
||
* options match one of the 4 mode names. Returns the option index
|
||
* matching `targetMode`, with the buffer marker pointing AT that AskUserQuestion.
|
||
*
|
||
* Throws if we don't reach the mode AskUserQuestion within `maxNav` prior AskUserQuestions or
|
||
* the overall budget.
|
||
*/
|
||
async function navigateToModeAskUserQuestion(
|
||
session: ClaudePtySession,
|
||
since: number,
|
||
targetMode: ModeCase['mode'],
|
||
cwd: string,
|
||
opts: { maxNav?: number; budgetMs?: number;
|
||
checkpoint?: (viewport: string, transcript: PlanCountTranscript | null) => void } = {},
|
||
): Promise<{ modeIndex: number; visibleAtMode: string; question: AskUserQuestionFingerprint }> {
|
||
// /plan-ceo-review's mode AskUserQuestion (Step 0F) sits behind several preamble
|
||
// and Step 0A-0C-bis gates: telemetry, proactive, routing, vendoring,
|
||
// brain privacy, office-hours offer, premise challenge (3 questions),
|
||
// approach selection. 12 hops is the conservative ceiling.
|
||
const maxNav = opts.maxNav ?? 12;
|
||
const budgetMs = opts.budgetMs ?? 420_000;
|
||
const start = Date.now();
|
||
let priorAnswered = 0;
|
||
const seenQuestions = new Set<string>();
|
||
|
||
while (Date.now() - start < budgetMs) {
|
||
if (session.exited()) {
|
||
throw new Error(
|
||
`claude exited (code=${session.exitCode()}) during nav.\n` +
|
||
`Last visible:\n${session.visibleSince(since).slice(-2000)}`,
|
||
);
|
||
}
|
||
await Bun.sleep(2000);
|
||
const visible = await session.currentScreen();
|
||
const transcript = session.hermeticConfigDir ? readPlanCountTranscript(session.hermeticConfigDir, cwd) : null;
|
||
opts.checkpoint?.(visible, transcript);
|
||
const pending = transcript?.calls.find(call => !call.answered && !call.failed) ??
|
||
(transcript ? readPendingQuestion(session.pendingQuestionFile, cwd, session.hermeticConfigDir, start, transcript) : undefined);
|
||
const action = nextCeoModeNavigation(visible, targetMode, seenQuestions, pending, session.visibleText());
|
||
if (action.kind === 'wait') continue;
|
||
// Native permission and multi-question Submit menus are controls, not
|
||
// review questions, so neither consumes the navigation question budget.
|
||
if (action.kind === 'permission' || action.kind === 'submission') {
|
||
session.send(action.input);
|
||
await Bun.sleep(1500);
|
||
continue;
|
||
}
|
||
if (action.kind === 'mode') {
|
||
return { modeIndex: action.index, visibleAtMode: visible, question: action.question };
|
||
}
|
||
|
||
// Follow the captured prerequisite choice; other navigation still uses option 1.
|
||
if (priorAnswered >= maxNav) {
|
||
throw new Error(
|
||
`Navigated ${maxNav} prior AskUserQuestions without reaching the mode AskUserQuestion. ` +
|
||
`Target: ${targetMode}. Last question: ${action.question.promptSnippet}\n` +
|
||
`Last list:\n${action.question.options.map(o => ` ${o.index}. ${o.label}`).join('\n')}`,
|
||
);
|
||
}
|
||
priorAnswered++;
|
||
const input = planCountQuestionInput(visible, action.question, action.index);
|
||
if (input.includes('\r')) await selectPtyNumberedOption(session, action.index);
|
||
else session.send(input);
|
||
// Give the agent a beat to advance before re-polling.
|
||
await Bun.sleep(2000);
|
||
}
|
||
throw new Error(
|
||
`Mode AskUserQuestion for "${targetMode}" not reached within ${budgetMs}ms; priorAnswered=${priorAnswered}.\n` +
|
||
`--- latest visible navigation (last 3KB) ---\n${session.visibleSince(since).slice(-3000)}`,
|
||
);
|
||
}
|
||
|
||
describeE2E('/plan-ceo-review mode routing (gate)', () => {
|
||
for (const c of CASES) {
|
||
test(
|
||
`mode "${c.mode}" routes to its distinctive posture`,
|
||
async () => {
|
||
const fixture = createPlanCountFixture(PLAN);
|
||
let session: ClaudePtySession | undefined;
|
||
const saveSnapshot = createPlanCountSnapshotWriter();
|
||
let lastSnapshotAt = 0;
|
||
let commandStartedAt = Date.now();
|
||
let selectionStartedAt: number | undefined;
|
||
let outcome = 'running';
|
||
let artifacts: {artifactDir?: string; artifactError?: string} = {};
|
||
const capture = (state: string, viewport: string, native: PlanCountTranscript | null, force = false) => {
|
||
if (!session || (!force && Date.now() - lastSnapshotAt < 30_000)) return;
|
||
artifacts = saveSnapshot({skillName:'plan-ceo-review-mode', cwd:fixture.cwd,
|
||
claudeConfigDir:session.hermeticConfigDir, raw:session.rawOutput(), visible:session.visibleText(), viewport,
|
||
observation:{state, targetMode:c.mode, commandStartedAt, selectionStartedAt, native,
|
||
pendingQuestionRecorder:pendingQuestionRecorderStatus(session.pendingQuestionFile, fixture.cwd, session.hermeticConfigDir),
|
||
pendingQuestion:native ? readPendingQuestion(session.pendingQuestionFile, fixture.cwd,
|
||
session.hermeticConfigDir, commandStartedAt, native) : undefined,
|
||
exitCode:session.exitCode(), retention:'Current raw/visible/viewport and parsed public native metadata; full parent JSONL retention is not guaranteed.'}});
|
||
lastSnapshotAt = Date.now();
|
||
};
|
||
try {
|
||
session = await launchClaudePty({
|
||
cwd: fixture.cwd,
|
||
permissionMode: 'plan',
|
||
timeoutMs: CAPTURE_LONG_MS,
|
||
seedSkills: true,
|
||
observeScreen: true,
|
||
observeSetupQuestions: true,
|
||
});
|
||
await Bun.sleep(8000);
|
||
const since = session.mark();
|
||
commandStartedAt = Date.now();
|
||
session.send('/plan-ceo-review\r');
|
||
|
||
const { modeIndex, visibleAtMode, question } = await navigateToModeAskUserQuestion(session, since, c.mode, fixture.cwd,
|
||
{checkpoint:(viewport,native)=>capture('navigating',viewport,native)});
|
||
|
||
// Native shortcuts accept immediately. Preserve the captured question
|
||
// identity; only the legacy prose-menu protocol needs Enter.
|
||
selectionStartedAt = Date.now();
|
||
const modeInput = planCountQuestionInput(visibleAtMode, question, modeIndex);
|
||
if (modeInput.includes('\r')) await selectPtyNumberedOption(session, modeIndex);
|
||
else session.send(modeInput);
|
||
const sincePick = session.mark();
|
||
|
||
// Wait for downstream evidence: either next AskUserQuestion or plan_ready or
|
||
// a posture-distinctive substring shows up.
|
||
const budgetMs = 240_000;
|
||
const start = Date.now();
|
||
let postureMatched = false;
|
||
let downstreamSnapshot = '';
|
||
let transcript: PlanCountTranscript = { status: 'missing', calls: [], assistantMessages: [] };
|
||
let continuedQuestion = false;
|
||
const seenDownstream = new Set<string>();
|
||
while (Date.now() - start < budgetMs) {
|
||
await Bun.sleep(2500);
|
||
if (session.exited()) {
|
||
throw new Error(
|
||
`claude exited (code=${session.exitCode()}) after mode "${c.mode}" option ${modeIndex}.\n` +
|
||
`Downstream:\n${session.visibleSince(sincePick).slice(-2000)}`,
|
||
);
|
||
}
|
||
downstreamSnapshot = session.visibleSince(sincePick);
|
||
const publicTools: NativePublicToolEvent[] = [];
|
||
transcript = session.hermeticConfigDir
|
||
? readPlanCountTranscript(session.hermeticConfigDir, fixture.cwd, event => publicTools.push(event))
|
||
: { status: 'error', calls: [], assistantMessages: [], error: 'No isolated mode transcript directory' };
|
||
if (hasNativePostAnswerCeoPosture(transcript, c.mode, c.postureRe, selectionStartedAt, publicTools)) {
|
||
postureMatched = true;
|
||
break;
|
||
}
|
||
const currentInput = await session.currentScreen();
|
||
capture('awaiting_posture', currentInput, transcript);
|
||
const pendingQuestion = readPendingQuestion(session.pendingQuestionFile, fixture.cwd,
|
||
session.hermeticConfigDir, selectionStartedAt, transcript);
|
||
const continuation = nextCeoPostureContinuation(currentInput, transcript,
|
||
c.mode, selectionStartedAt, seenDownstream, continuedQuestion, session.visibleText(), pendingQuestion);
|
||
if (continuation !== null) {
|
||
if (continuation === 'question') continuedQuestion = true;
|
||
if (continuation === 'permission') await selectPtyNumberedOption(session, 1);
|
||
else if (continuation === 'submission') session.send('\r');
|
||
else {
|
||
const pending = transcript.calls.find(call => !call.answered && !call.failed) ?? pendingQuestion;
|
||
const question = capturePlanCountQuestion(currentInput, new Set(), 0, false, pending)!;
|
||
const input = planCountQuestionInput(currentInput, question, 1);
|
||
if (input.includes('\r')) await selectPtyNumberedOption(session, 1);
|
||
else session.send(input);
|
||
}
|
||
continue;
|
||
}
|
||
// Don't bail early on plan_ready alone — the posture text may
|
||
// arrive as the agent finishes writing the plan. Only break
|
||
// once we either match posture or run the clock.
|
||
if (
|
||
isPlanReadyVisible(downstreamSnapshot) &&
|
||
isNumberedOptionListVisible(downstreamSnapshot) &&
|
||
!hasNativePostAnswerCeoPosture(transcript, c.mode, c.postureRe, selectionStartedAt, publicTools)
|
||
) {
|
||
// Plan-ready AND a follow-up AskUserQuestion are both visible but
|
||
// posture text has not appeared yet. Keep polling for a bit.
|
||
}
|
||
}
|
||
if (!postureMatched) {
|
||
throw new Error(
|
||
`Mode "${c.mode}" routing FAILED after sending option ${modeIndex}: no posture match for ${c.postureRe.source}.\n` +
|
||
`Native transcript: ${transcript.status}; ${transcript.calls.length} calls, ${transcript.assistantMessages.length} assistant messages; continuedQuestion=${continuedQuestion}.\n` +
|
||
`Artifacts: ${JSON.stringify(artifacts)}\n` +
|
||
`--- observed mode menu (last 3KB) ---\n${visibleAtMode.slice(-3000)}\n` +
|
||
`--- downstream visible since mode pick (last 3KB) ---\n` +
|
||
downstreamSnapshot.slice(-3000),
|
||
);
|
||
}
|
||
outcome = 'posture_confirmed';
|
||
} catch (error) {
|
||
outcome = 'failed';
|
||
throw error;
|
||
} finally {
|
||
try {
|
||
if (session) {
|
||
try {
|
||
capture(outcome, await session.currentScreen(), session.hermeticConfigDir
|
||
? readPlanCountTranscript(session.hermeticConfigDir, fixture.cwd) : null, true);
|
||
} finally { await session.close(); }
|
||
}
|
||
} finally {
|
||
fixture.cleanup();
|
||
}
|
||
}
|
||
},
|
||
CAPTURE_LONG_MS,
|
||
);
|
||
}
|
||
});
|