/** * Human-readable final-answer proof block (ID645) — render layer over GuardExecutionProof. * * Does NOT assemble or re-decide protection. It FAITHFULLY formats a machine * GuardExecutionProof (from buildExecutionProof) so an agent can embed it in a final * answer without overclaiming. * * Honesty rules: * - currently_authorized:null → "NOT EVALUATED (SKIPPED)" — never a soft pass * - currently_authorized:false → "NOT AUTHORIZED" — never "protected/verified" * - currently_authorized:true → "AUTHORIZED" only when receipt.verified; still surfaces limits * - limits block always appears (operative non-claims) — there is no opt-out; format:'plain' * compacts the markup and still renders every limit * * Does not modify execution-proof.ts or the proof shape. */ import type { GuardExecutionProof } from './execution-proof.js'; export type FinalAnswerProofFormat = 'markdown' | 'plain'; export type RenderFinalAnswerProofOptions = { /** * Output format. Default 'markdown'. * plain = no #/* markup (still line-oriented, limits as bullet-like lines with "- "). */ format?: FinalAnswerProofFormat; /** * Optional heading override. Default: "CodeRifts execution proof". */ title?: string; }; export type AttachProofToAgentResponseOptions = RenderFinalAnswerProofOptions & { /** * How to embed the rendered block. * - 'append_text' (default): append a string section to a string response, or set * `final_answer_proof` + `final_answer_proof_text` on object responses * - 'field_only': never mutate text; only attach structured fields on objects * (string responses become `{ text, final_answer_proof, final_answer_proof_text }`) */ mode?: 'append_text' | 'field_only'; /** * Separator before the appended block when mode is append_text and response is a string. * Default: "\n\n---\n\n" */ separator?: string; }; /** Coarse human status derived only from proof fields (never invents protection). */ export type FinalAnswerProofBanner = 'ENFORCED' | 'AUTHORIZED' | 'AUTHORIZED_AND_COMMITTED' | 'AUTHORIZED_NOT_COMMITTED' | 'NOT_AUTHORIZED' | 'NOT_EVALUATED_SKIPPED' | 'PREFLIGHTED_NOT_AUTHORIZED' | 'NO_PREFLIGHT'; /** * Map proof fields → a single banner label that is visibly different for * authorized / not-authorized / skipped / no-preflight. */ export declare function deriveProofBanner(proof: GuardExecutionProof): FinalAnswerProofBanner; /** * Render a GuardExecutionProof as a compact human-readable block. * Faithful to fields; never upgrades null/false authorization into "protected". */ export declare function renderFinalAnswerProof(proof: GuardExecutionProof, opts?: RenderFinalAnswerProofOptions): string; /** * Attach a rendered proof to a host response (framework-agnostic). * * Convention: * - String response + append_text → `response + separator + rendered` * - Object response → shallow copy with: * final_answer_proof: GuardExecutionProof (reference; not deep-cloned) * final_answer_proof_text: string (rendered block) * and, when mode is append_text and a stringish field exists (`text` | `content` | * `message` | `final_answer`), that field is appended with the block. * - field_only never mutates string fields; wraps bare strings in an object. * * Hosts that only want the string can call renderFinalAnswerProof directly. */ export declare function attachProofToAgentResponse(response: T, proof: GuardExecutionProof, opts?: AttachProofToAgentResponseOptions): T | (Record & { final_answer_proof: GuardExecutionProof; final_answer_proof_text: string; }); //# sourceMappingURL=final-answer-proof.d.ts.map