/** * Phase 0 Spike fixtures — synthetic baseline chains for the * internalization progressive-disclosure value verification. * * SPIKE-ONLY. This module is deliberately isolated: * - it is imported by Spike tests only (task 1.1 self-check, task 1.2 driver); * - it is NOT exported from any barrel (`internalization/index.ts` untouched); * - it imports **types only**, so it adds no production runtime dependency; * - it performs no I/O (core is pure logic — AGENTS.md `antipattern-core-io`). * * Why the chain starts at the diagnostician chain and not at dreamer * (design §4.7.1 / F13): `diag_router` is dreamer's predecessor on the task * graph edge, so it is the only data source for the `pain.summary.*` / * `diagnosis.summary.*` fields the `pain_to_dreamer` diagnosis segment needs. * A chain that started at dreamer could only exercise 2 of the 3 segments. * * Every `contentJson` shape below is taken from the real output type in the * repo — no invented fields: * diag_rootcause → `DiagRootCauseOutputV1` (diagnostician/diag-rootcause-output.ts) * diag_distiller → `DiagDistillerOutputV1` (diagnostician/diag-distiller-output.ts) * diag_router → `DiagnosticianOutputV1` (diagnostician-output.ts) * dreamer → `DreamerOutputV1` (dreamer-output.ts) * philosopher → `PhilosopherOutputV1` (philosopher-output.ts) * scribe → `ScribeOutputV1` (scribe-output.ts) * artificer → `ArtificerRuleOutput` (artificer-output.ts) * evaluator → `EvaluatorOutputV2` (evaluator-output.ts) * * The evaluator hop carries only fields that exist today (V1 + optional * `codeReview`). `painCoverage` / `compressionFidelity` are Layer 2 additions * and are intentionally absent — the expected defect lives in fixture metadata * (`expectedDefect`), never inside the LLM-shaped payload, so a Spike assertion * cannot trivially read the answer out of the artifact it is judging (ERR-088). * * @see .kiro/specs/internalization-progressive-disclosure/design.md §12 Phase 0, §16.3 * @see Requirement 12.2 */ import type { DiagRootCauseOutputV1 } from '../../diagnostician/diag-rootcause-output.js'; import type { DiagDistillerOutputV1 } from '../../diagnostician/diag-distiller-output.js'; import type { DiagnosticianOutputV1 } from '../../diagnostician-output.js'; import type { DreamerOutputV1 } from '../dreamer-output.js'; import type { PhilosopherOutputV1 } from '../philosopher-output.js'; import type { ScribeOutputV1 } from '../scribe-output.js'; import type { ArtificerRuleOutput } from '../artificer-output.js'; import type { EvaluatorOutputV2 } from '../evaluator-output.js'; /** The 8 stages that carry a summary in Layer 0 (design §6.1). */ export type SpikeStageKind = 'diag_rootcause' | 'diag_distiller' | 'diag_router' | 'dreamer' | 'philosopher' | 'scribe' | 'artificer' | 'evaluator'; /** * Stage order along the synthetic chain. Mirrors `DIAGNOSTICIAN_EDGES` * followed by `ALLOWED_EDGES` (design F5 / F14). */ export declare const SPIKE_STAGE_ORDER: readonly SpikeStageKind[]; export type SpikeChainId = /** 缺陷链 A:scribe 原则文本完全丢失 dreamer 的 riskLevel 维度 */ 'defect_a_risk_level_dropped' /** 缺陷链 B:scribe 把 dreamer 的具体动作模糊为抽象表述 */ | 'defect_b_action_abstracted' /** 对照链:无缺陷,用于识别「任何输入都报缺失」的假阳性 */ | 'control_no_defect'; /** The 5 dreamer dimensions the pipeline is supposed to carry forward. */ export type DreamerDimension = 'badDecision' | 'betterDecision' | 'rationale' | 'riskLevel' | 'strategicPerspective'; /** * The defect a chain encodes, stated independently of the artifacts. * * The Spike driver (task 1.2) compares the summary-level evaluator's finding * against this — it is the expected answer, not an input to any stage. */ export type SpikeExpectedDefect = { readonly kind: 'none'; } | { /** A dimension present at dreamer is absent from the scribe principle text. */ readonly kind: 'missing_dimension'; readonly segment: 'dreamer_to_scribe'; readonly dimension: DreamerDimension; } | { /** Concrete actions at dreamer became an abstract phrase at scribe. */ readonly kind: 'action_abstracted'; readonly segment: 'dreamer_to_scribe'; readonly concreteActions: readonly string[]; readonly abstractedAs: string; }; /** One hop of a synthetic chain: artifact identity + the stage's contentJson. */ export interface SpikeChainHop { readonly stage: SpikeStageKind; readonly artifactId: string; readonly taskId: string; /** * Stage identity source of truth. Per F1, `artifactKind` cannot identify a * stage (artificer writes `'principle'` too), so consumers must read this. */ readonly taskKind: SpikeStageKind; /** * The artifact id of the predecessor **on the task graph edge** * (design §6.1). `null` only at the chain head. */ readonly edgePredecessorArtifactId: string | null; readonly contentJson: TContent; } export interface SpikeChain { readonly chainId: SpikeChainId; /** Short human-readable label for Spike output. */ readonly label: string; readonly expectedDefect: SpikeExpectedDefect; readonly diagRootCause: SpikeChainHop; readonly diagDistiller: SpikeChainHop; readonly diagRouter: SpikeChainHop; readonly dreamer: SpikeChainHop; readonly philosopher: SpikeChainHop; readonly scribe: SpikeChainHop; readonly artificer: SpikeChainHop; readonly evaluator: SpikeChainHop; } /** Ordered hops of a chain. `contentJson` stays `unknown` (rc-1). */ export declare function spikeChainHops(chain: SpikeChain): readonly SpikeChainHop[]; /** The three concrete actions dreamer prescribes. Defect chain B loses these. */ export declare const CONCRETE_ACTIONS: readonly string[]; /** The abstract phrase defect chain B substitutes for the concrete actions. */ export declare const ABSTRACTED_PHRASE = "\u7406\u89E3\u67B6\u6784"; /** The dreamer risk level. Defect chain A loses this dimension entirely. */ export declare const DREAMER_RISK_LEVEL = "high"; /** 缺陷链 A:scribe 原则文本完全丢失 dreamer 的 `riskLevel` 维度。 */ export declare const SPIKE_CHAIN_DEFECT_A: SpikeChain; /** 缺陷链 B:scribe 把 dreamer 的具体动作模糊为抽象表述。 */ export declare const SPIKE_CHAIN_DEFECT_B: SpikeChain; /** 对照链:无缺陷。用于识别「任何输入都报缺失」的假阳性。 */ export declare const SPIKE_CHAIN_CONTROL: SpikeChain; export declare const SPIKE_CHAINS: readonly SpikeChain[]; /** One inconsistency between a hop's lineage field and the hop it should name. */ export interface SpikeLineageViolation { readonly chainId: SpikeChainId; readonly stage: SpikeStageKind; /** Dotted path of the offending field, e.g. `sourceTrace.scribeArtifactId`. */ readonly field: string; readonly expected: string; readonly actual: string; } /** * Collect every lineage inconsistency in a chain. * * Only fields that actually exist on the real output types are checked, and each * check names the concrete field and the hop it must point at — so a failure * reports *which* field of *which* stage drifted, not merely "chain invalid" * (ERR-088: the assertion signal must identify the intended path uniquely). * * Checked invariants: * - `taskKind` equals `stage` (F1: stage identity comes from taskKind, never artifactKind) * - each hop's `edgePredecessorArtifactId` is the previous hop on the task graph edge * - `contentJson.taskId` equals the hop's own `taskId` (every stage except * `diag_router`, whose output carries no `taskId` — PRI-272 removed it) * - `diag_distiller.sourceRootCauseArtifactId` → rootcause artifact * - `diag_router` carries Stage A's `rootCause`/`evidence` and Stage B's * `confidence` (the invariants `diag-router-runner.postFetchTransform` injects) * - `dreamer.contextRefs` contains the router artifact * - `philosopher.sourceDreamerArtifactId` → dreamer artifact * - scribe / artificer / evaluator top-level source ids and every * `sourceTrace.*` id point at the actual upstream artifacts */ export declare function findSpikeLineageViolations(chain: SpikeChain): readonly SpikeLineageViolation[]; /** * Throw with a per-field report when a chain's lineage is inconsistent. * * Used by the fixture self-check test and available to the Spike driver so a * corrupted fixture fails loud instead of silently weakening the Spike (rc-9). */ export declare function assertSpikeChainLineageConsistent(chain: SpikeChain): void; //# sourceMappingURL=progressive-disclosure-spike-fixtures.d.ts.map