import { type Static } from '@sinclair/typebox'; import type { GoldenTraceDecision } from '../golden-trace.js'; import type { RuleContextV2 } from './rule-context-v2.js'; /** * Artificer source trace — lineage back to upstream peer artifacts. */ export interface ArtificerSourceTrace { readonly scribeArtifactId: string; readonly philosopherArtifactId?: string; readonly dreamerArtifactId?: string; } /** * Artificer-generated golden trace case input (RuleHost MVP Activation, ADR-0014 * Amendment 2026-06-17 Decision 1). * * `expectedDecision` uses `GoldenTraceDecision` ('allow'|'block'|'propose_correction'), * NOT `RuleHostDecision`. The sandbox replay layer maps the two enums (see PRD * Decision 1 mapping table). `kind='positive'` requires `expectedDecision='allow'` * (mirrors `validateGoldenTraceCase` invariant in golden-trace.ts:116). */ export interface GoldenTraceCaseInput { readonly caseId: string; readonly kind: 'positive' | 'negative'; readonly toolName: string; readonly params: Record; readonly expectedDecision: GoldenTraceDecision; readonly expectedProposedParams?: Record; readonly expectedApplicationMode?: 'shadow' | 'live'; readonly ruleContext?: RuleContextV2; } /** * ArtificerRuleOutput — the UNIFIED Artificer output (PRI-439). * * Replaces the former V1/V2 dual-version system. `implementationCode` is now * MANDATORY; there is no plan-only (V1) acceptance path and no degradation. * Missing, invalid, or replay-failing RuleCode fails loud and creates no rule * artifact, approval, or activation. * * `meta`, `taskId`, lineage, and `generatedAt` are server-injected / model-filled * per the existing contract; the validator enforces their presence and consistency. * * PRI-484 (Phase 5): `requiresContextVersion?: 2` declares a v2 rule that may * inspect `input.context` and may carry `ruleContext` on its golden trace cases. * When absent, the rule is v1 and MUST NOT read input.context (validator rejects * any case-level ruleContext on a v1 rule). */ export interface ArtificerRuleOutput { readonly taskId: string; readonly sourceScribeArtifactId: string; readonly implementationCode: string; readonly goldenTraceCases: readonly GoldenTraceCaseInput[]; readonly affectedTools: readonly string[]; readonly implementationSummary: string; readonly risks: readonly string[]; readonly sourceTrace: ArtificerSourceTrace; readonly generatedAt: string; /** PRI-484 — declare v2 rule that reads input.context. Only `2` is supported. */ readonly requiresContextVersion?: 2; /** * PRI-490 — evidence references from BehaviorExamplePack, preserved through * the full artifact chain. Required when requiresContextVersion: 2; optional * for v1 rules (v1 does not require evidenceRefs). */ readonly evidenceRefs?: readonly string[]; } export declare const ArtificerSourceTraceSchema: import("@sinclair/typebox").TObject<{ scribeArtifactId: import("@sinclair/typebox").TString; philosopherArtifactId: import("@sinclair/typebox").TOptional; dreamerArtifactId: import("@sinclair/typebox").TOptional; }>; export declare const ArtificerRuleOutputSchema: import("@sinclair/typebox").TObject<{ taskId: import("@sinclair/typebox").TString; sourceScribeArtifactId: import("@sinclair/typebox").TString; implementationCode: import("@sinclair/typebox").TString; goldenTraceCases: import("@sinclair/typebox").TArray, import("@sinclair/typebox").TLiteral<"negative">]>; toolName: import("@sinclair/typebox").TString; params: import("@sinclair/typebox").TRecord; expectedDecision: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"allow">, import("@sinclair/typebox").TLiteral<"block">, import("@sinclair/typebox").TLiteral<"propose_correction">]>; expectedProposedParams: import("@sinclair/typebox").TOptional>; expectedApplicationMode: import("@sinclair/typebox").TOptional, import("@sinclair/typebox").TLiteral<"live">]>>; }>>; affectedTools: import("@sinclair/typebox").TArray; implementationSummary: import("@sinclair/typebox").TString; risks: import("@sinclair/typebox").TArray; sourceTrace: import("@sinclair/typebox").TObject<{ scribeArtifactId: import("@sinclair/typebox").TString; philosopherArtifactId: import("@sinclair/typebox").TOptional; dreamerArtifactId: import("@sinclair/typebox").TOptional; }>; generatedAt: import("@sinclair/typebox").TString; requiresContextVersion: import("@sinclair/typebox").TOptional>; evidenceRefs: import("@sinclair/typebox").TOptional>; }>; export type ArtificerRuleOutputTB = Static; export interface ArtificerValidationResult { readonly valid: boolean; readonly errors: readonly string[]; readonly errorCategory?: string; } export interface ArtificerValidator { /** Validate untrusted output. Accepts `unknown` — must perform runtime checks (ERR-001). */ validate(output: unknown, taskId: string, expectedSourceScribeArtifactId?: string): Promise; } export declare class DefaultArtificerValidator implements ArtificerValidator { validate(output: unknown, taskId: string, expectedSourceScribeArtifactId?: string): Promise; } //# sourceMappingURL=artificer-output.d.ts.map