/** * WT-W2 (DES-walkthrough-proof §4.6, §4.9): the walkthrough half of the acceptance gate. * * A walkthrough's evidence lives in its PROOF ROOT (`//`), written only * by the jailed `walkthrough_review` Tool. Crew trusts a proof root only through its SEAL: the last * `WALKTHROUGH-SEAL {...}` line of that unit's persisted output, which the engine captured and no * seat can reach. At every read: * * 1. the seal is parsed (`bundle_sha`, `overall`, `chapters: [{key, verdict}]`; a seal that does * not agree with itself — `overall: PASS` over a chapter it lists as not passing — is refused); * 2. `bundle_sha` is recomputed from disk: the sha256 of the UTF-8 text made of one line * ` \n` per regular file under the proof root, * except the top-level `app/` and `data/` subtrees, sorted by path (byte order). A symbolic * link anywhere outside those two subtrees is refused. Reproducible with the shell: * `find . -path ./app -prune -o -path ./data -prune -o -type f -print | sed 's|^\./||' | * LC_ALL=C sort | while read -r f; do shasum -a 256 "$f"; done | shasum -a 256`; * 3. the proof root's own ledger (`/.wicked-qe/`) must hold a verdict stamped with this * crew run and step, and the newest stamped verdict per chapter (by take, then time) must equal * the sealed chapter verdict. * * Any mismatch denies "walkthrough evidence changed after it was sealed" (deny-dominates). A sealed * walkthrough that did not PASS denies, naming its chapters. Nothing here writes. */ import type { WalkthroughStepState } from 'wicked-crew-api-types'; import type { SessionView } from '../core/types.js'; export declare const SEAL_PREFIX = "WALKTHROUGH-SEAL "; /** The fields of a seal acceptance reads. */ export interface WalkthroughSeal { tree: string; storyline_sha: string | null; bundle_sha: string; overall: string; chapters: Array<{ key: string; verdict: string; }>; edited_by: string | null; } /** The LAST seal line of a recorder's output, parsed; `null` when there is none or it is malformed. */ export declare function parseSeal(output: string | null): WalkthroughSeal | null; /** Recompute a proof root's `bundle_sha` (see the module header for the exact form). */ export declare function computeBundleSha(proofRoot: string): Promise<{ ok: true; sha: string; files: number; } | { ok: false; error: string; }>; /** One walkthrough step's acceptance. */ export interface WalkthroughGate { stepId: string; /** The seal was found AND every check against the files on disk held. */ sealed: boolean; /** Sealed, PASS overall, every chapter PASS, and the ledger agrees. */ satisfied: boolean; reason: string; /** The sealed overall verdict; `null` when there is no usable seal. */ overall: string | null; /** (WT-W3) The tree the seal binds, for the deliver card's "checked at "; `null` when there is no seal. */ tree: string | null; /** The sealed chapters with what each proves (from the bundle-verified `result.json`). */ chapters: Array<{ key: string; verdict: string; proves: string[]; }>; } /** Resolve one walkthrough step's gate from its proof root and its recorder's persisted output. */ export declare function resolveWalkthroughGate(opts: { runId: string; stepId: string; proofRoot: string | null; output: string | null; }): Promise; /** * The accepted plan's floor override removed the walkthrough pair (§4.9): end-to-end testing is the * operator's, so every finished creator step reads `owned_by_you` — and the acceptance read carries * the walkthrough block even though no `walkthrough_review` step is left to resolve (#791). */ export declare function pairRemovedByOverride(view: SessionView): boolean; /** * `checkState` per creator step (§4.9), computed, never stored. `newest` is the newest walkthrough's * gate (only a SEALED one proves anything); `atSec` per chapter is not sealed, so it is `null` here. * One row per creator step that is proved by a sealed chapter or passed its own gate. */ export declare function walkthroughCheckStates(view: SessionView, newest: WalkthroughGate | null): WalkthroughStepState[]; //# sourceMappingURL=walkthrough-acceptance.d.ts.map