/** * PD_PROMPT_CAPACITY_V1 R-B3: prompt-channel version replacement support. * * Two focused capabilities over EXISTING authorities (no new store, no new * lifecycle states): * 1. `detectPromptReplacementTarget` — given the artifact an Owner just * approved, find the live prompt activation of a PRIOR artifact version of * the same principle (revision lineage via the existing * `isArtifactRevisionOf` predicate). Ambiguity fails closed: more than one * live match is an error the Owner resolves manually, never a guess and * never a batch migration over history. * 2. `buildOwnerRevisionArtifact` — assemble the new artifact version for an * Owner-submitted replacement statement: a clone of the approved scribe * artifact with ONLY principleDraft.statement replaced, new lineage, new * task identity (the (source_task_id, artifact_kind) unique index forbids * same-task upsert — that would overwrite the old approved artifact), and * validation through the REAL `DefaultScribeValidator` content contract — * never a direct `validated` stamp. */ import type { ActivationStatusRecord, PIArtifactSnapshot } from './activation-types.js'; export interface PromptReplacementTarget { supersededActivationId: string; supersededArtifactId: string; } export type PromptReplacementDetection = { ok: true; target: PromptReplacementTarget | null; } | { ok: false; error: string; nextAction: string; }; /** * Find the single live prompt activation whose artifact is a prior version of * `approvalArtifactId`'s principle. Returns target=null when the approval is * not a revision of anything live (plain activation), and ok=false when more * than one live activation matches (manual resolution required). */ export declare function detectPromptReplacementTarget(input: { approvalArtifactId: string; getArtifactById: (artifactId: string) => Promise; listPromptActivations: () => Promise; includeHistoricalTargets?: boolean; }): Promise; export interface OwnerRevisionArtifactDraft { artifactId: string; sourceTaskId: string; sourcePrincipleId?: string; lineageArtifactIds: string[]; contentJson: string; } export type OwnerRevisionBuildResult = { ok: true; draft: OwnerRevisionArtifactDraft; oldStatement: string; title: string; intentContract?: unknown; } | { ok: false; error: string; nextAction: string; }; /** * Build the new artifact version for an Owner-submitted statement. The old * approved artifact stays immutable (untouched); the new version carries * lineage back to it and keeps every non-statement field — the intent fields * are preserved verbatim and returned for the reviewable diff (the Owner is * the semantic judge of intent consistency; the validator enforces the * structural content contract). */ export declare function buildOwnerRevisionArtifact(input: { oldArtifact: PIArtifactSnapshot; newStatement: string; editedBy: string; now: string; }): Promise; /** Stable digest helper for revision payloads (audit/lineage display). */ export declare function revisionDigest(contentJson: string): string; //# sourceMappingURL=prompt-replacement.d.ts.map