/** * Incident artifact type definitions (Sprint 19). * * All types are derived from zod schemas via z.infer — never written by hand * to avoid schema/type drift. Follow the pattern established in src/config/schema.ts. * * Schema locks (do NOT change without updating the corresponding skill): * - ObservationEntry: 5 fields locked by skills/bober.diagnose/SKILL.md lines 74-82. * - RunbookExecutionEntry: 7 camelCase fields locked by skills/bober.runbook/SKILL.md line 208. * - ChangeEntry.inverse: REQUIRED at zod level (not optional) — Sprint 21 rollback * awareness depends on every change having an inverse declared at write time. */ import { z } from "zod"; export type IncidentId = string; export declare const IncidentArtifactKindSchema: z.ZodEnum<["timeline", "observation", "hypothesis", "action", "change", "runbook-execution", "diagnosis", "postmortem"]>; export type IncidentArtifactKind = z.infer; export declare const TimelineEventSchema: z.ZodObject<{ /** ISO-8601 timestamp. */ timestamp: z.ZodString; /** Machine-readable event kind, e.g. 'incident_created', 'action_taken'. */ eventKind: z.ZodString; /** Which system produced this event. */ source: z.ZodEnum<["diagnoser", "deployer", "human", "observability", "system"]>; /** Human-readable summary of what happened. */ summary: z.ZodString; /** Optional relative path to the detail artifact (e.g. actions.jsonl). */ refPath: z.ZodOptional; }, "strip", z.ZodTypeAny, { summary: string; timestamp: string; source: "observability" | "human" | "diagnoser" | "deployer" | "system"; eventKind: string; refPath?: string | undefined; }, { summary: string; timestamp: string; source: "observability" | "human" | "diagnoser" | "deployer" | "system"; eventKind: string; refPath?: string | undefined; }>; export type TimelineEvent = z.infer; export declare const ObservationEntrySchema: z.ZodObject<{ timestamp: z.ZodString; /** Diagnosis phase: 1–4. */ phase: z.ZodNumber; observation: z.ZodString; source: z.ZodString; verified: z.ZodBoolean; }, "strip", z.ZodTypeAny, { timestamp: string; phase: number; verified: boolean; source: string; observation: string; }, { timestamp: string; phase: number; verified: boolean; source: string; observation: string; }>; export type ObservationEntry = z.infer; export declare const ActionEntrySchema: z.ZodObject<{ timestamp: z.ZodString; action: z.ZodString; blastRadius: z.ZodEnum<["safe", "risky"]>; requiresApproval: z.ZodBoolean; rationale: z.ZodOptional; }, "strip", z.ZodTypeAny, { timestamp: string; action: string; blastRadius: "safe" | "risky"; requiresApproval: boolean; rationale?: string | undefined; }, { timestamp: string; action: string; blastRadius: "safe" | "risky"; requiresApproval: boolean; rationale?: string | undefined; }>; export type ActionEntry = z.infer; export declare const ChangeEntrySchema: z.ZodObject<{ id: z.ZodString; type: z.ZodString; executedAt: z.ZodString; description: z.ZodString; /** REQUIRED. Describes how to undo this change. */ inverse: z.ZodObject<{ description: z.ZodString; command: z.ZodOptional; }, "strip", z.ZodTypeAny, { description: string; command?: string | undefined; }, { description: string; command?: string | undefined; }>; status: z.ZodEnum<["pending", "executed", "rolled-back", "rolled-back-failed", "failed"]>; }, "strip", z.ZodTypeAny, { type: string; status: "failed" | "executed" | "rolled-back" | "rolled-back-failed" | "pending"; description: string; id: string; executedAt: string; inverse: { description: string; command?: string | undefined; }; }, { type: string; status: "failed" | "executed" | "rolled-back" | "rolled-back-failed" | "pending"; description: string; id: string; executedAt: string; inverse: { description: string; command?: string | undefined; }; }>; export type ChangeEntry = z.infer; export declare const RunbookExecutionEntrySchema: z.ZodObject<{ timestamp: z.ZodString; runbookName: z.ZodString; stepNumber: z.ZodNumber; status: z.ZodEnum<["precondition_failed", "checkpoint_rejected", "execution_failed", "postcondition_failed_no_rollback", "rollback_failed", "recovered_via_rollback", "success"]>; preconditionResult: z.ZodEnum<["pass", "fail", "not_run"]>; postconditionResult: z.ZodEnum<["pass", "fail", "not_run"]>; rollbackTriggered: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "precondition_failed" | "execution_failed" | "postcondition_failed_no_rollback" | "rollback_failed" | "success" | "recovered_via_rollback" | "checkpoint_rejected"; timestamp: string; runbookName: string; stepNumber: number; preconditionResult: "pass" | "fail" | "not_run"; postconditionResult: "pass" | "fail" | "not_run"; rollbackTriggered?: boolean | undefined; }, { status: "precondition_failed" | "execution_failed" | "postcondition_failed_no_rollback" | "rollback_failed" | "success" | "recovered_via_rollback" | "checkpoint_rejected"; timestamp: string; runbookName: string; stepNumber: number; preconditionResult: "pass" | "fail" | "not_run"; postconditionResult: "pass" | "fail" | "not_run"; rollbackTriggered?: boolean | undefined; }>; export type RunbookExecutionEntry = z.infer; export declare const IncidentStatusSchema: z.ZodEnum<["investigating", "remediating", "monitoring", "resolved", "aborted"]>; export type IncidentStatus = z.infer; /** * Allowed phase transitions for the incident state machine (Sprint 24). * Keys are the FROM phase; values are the array of allowed TO phases. * * The re-open path (resolved → investigating) requires an explicit `reason` * — see transitionPhase() in src/incident/orchestrator.ts. * * `aborted` is terminal: it appears as a value in many keys (any phase may * abort) but never as a key — there are no transitions out of aborted. */ export declare const STATUS_TRANSITIONS: Readonly>; /** Convenience alias — orchestrator.ts uses 'phase' nomenclature; storage uses 'status'. */ export type IncidentPhase = IncidentStatus; /** * Snapshot of the VerifyResult that authorized the 'resolved' transition. * Either verified=true OR an overrideToken with a non-empty reason. Sprint 22. */ export declare const IncidentResolutionEvidenceSchema: z.ZodObject<{ verified: z.ZodBoolean; observedValue: z.ZodOptional; sampledAt: z.ZodOptional; evidencePath: z.ZodOptional; reason: z.ZodOptional; hint: z.ZodOptional; /** Set when transition was authorized via overrideToken. */ override: z.ZodOptional>; }, "strip", z.ZodTypeAny, { verified: boolean; observedValue?: number | undefined; sampledAt?: string | undefined; evidencePath?: string | undefined; reason?: string | undefined; hint?: string | undefined; override?: { at: string; reason: string; } | undefined; }, { verified: boolean; observedValue?: number | undefined; sampledAt?: string | undefined; evidencePath?: string | undefined; reason?: string | undefined; hint?: string | undefined; override?: { at: string; reason: string; } | undefined; }>; export type IncidentResolutionEvidence = z.infer; export declare const IncidentMetadataSchema: z.ZodObject<{ incidentId: z.ZodString; symptom: z.ZodString; createdAt: z.ZodString; status: z.ZodEnum<["investigating", "remediating", "monitoring", "resolved", "aborted"]>; severity: z.ZodOptional>; resolvedAt: z.ZodOptional; resolutionCriteria: z.ZodOptional; resolutionEvidence: z.ZodOptional; sampledAt: z.ZodOptional; evidencePath: z.ZodOptional; reason: z.ZodOptional; hint: z.ZodOptional; /** Set when transition was authorized via overrideToken. */ override: z.ZodOptional>; }, "strip", z.ZodTypeAny, { verified: boolean; observedValue?: number | undefined; sampledAt?: string | undefined; evidencePath?: string | undefined; reason?: string | undefined; hint?: string | undefined; override?: { at: string; reason: string; } | undefined; }, { verified: boolean; observedValue?: number | undefined; sampledAt?: string | undefined; evidencePath?: string | undefined; reason?: string | undefined; hint?: string | undefined; override?: { at: string; reason: string; } | undefined; }>>; postmortemPath: z.ZodOptional; }, "strip", z.ZodTypeAny, { createdAt: string; status: "aborted" | "investigating" | "remediating" | "monitoring" | "resolved"; incidentId: string; symptom: string; severity?: "S1" | "S2" | "S3" | "S4" | undefined; resolvedAt?: string | undefined; resolutionCriteria?: string | undefined; resolutionEvidence?: { verified: boolean; observedValue?: number | undefined; sampledAt?: string | undefined; evidencePath?: string | undefined; reason?: string | undefined; hint?: string | undefined; override?: { at: string; reason: string; } | undefined; } | undefined; postmortemPath?: string | undefined; }, { createdAt: string; status: "aborted" | "investigating" | "remediating" | "monitoring" | "resolved"; incidentId: string; symptom: string; severity?: "S1" | "S2" | "S3" | "S4" | undefined; resolvedAt?: string | undefined; resolutionCriteria?: string | undefined; resolutionEvidence?: { verified: boolean; observedValue?: number | undefined; sampledAt?: string | undefined; evidencePath?: string | undefined; reason?: string | undefined; hint?: string | undefined; override?: { at: string; reason: string; } | undefined; } | undefined; postmortemPath?: string | undefined; }>; export type IncidentMetadata = z.infer; export interface IncidentSummary { incidentId: string; symptom: string; createdAt: string; status: IncidentStatus; resolvedAt?: string; } export declare const PostmortemResultSchema: z.ZodObject<{ /** Absolute path to the written postmortem.md */ path: z.ZodString; /** The full markdown content (caller can stream to stdout for CLI show) */ content: z.ZodString; /** Number of secret-like strings redacted from artifacts during synthesis */ redactionCount: z.ZodNumber; /** True if 5-Whys synthesis produced fewer than 3 deterministic levels */ shallowWarning: z.ZodBoolean; /** Number of inline citations in the generated markdown */ citationCount: z.ZodNumber; }, "strip", z.ZodTypeAny, { path: string; content: string; shallowWarning: boolean; redactionCount: number; citationCount: number; }, { path: string; content: string; shallowWarning: boolean; redactionCount: number; citationCount: number; }>; export type PostmortemResult = z.infer; //# sourceMappingURL=types.d.ts.map