import type { OutputLanguage } from '../language-directive.js'; export interface RolloutReviewerPromptBuilderInput { taskId: string; contextHash: string; /** Code-chain review source (PRI-720: required in code_chain mode). */ sourceEvaluatorArtifactId?: string; evaluatorArtifact?: unknown; /** PRI-720: defaults to the legacy code_chain review. */ reviewMode?: 'principle_semantic' | 'code_chain'; /** Principle semantic review source — the exact scribe principle artifact id. */ sourceScribeArtifactId?: string; /** Principle semantic review payload: scribe artifact contentJson (parsed). */ scribeArtifact?: unknown; /** * Owner's preferred language for review fields (PRI-714). When provided, * the rollout reviewer instruction carries a language directive so summary / * requiredChanges / rolloutRisks / safetyChecks / risks are written in the * owner's language. Undefined = no directive (backward compatible). */ outputLanguage?: OutputLanguage; } export interface RolloutReviewerPromptInput { taskId: string; contextHash: string; reviewMode?: 'principle_semantic' | 'code_chain'; sourceEvaluatorArtifactId?: string; evaluatorArtifact?: unknown; sourceScribeArtifactId?: string; scribeArtifact?: unknown; promptContractVersion: string; } export interface RolloutReviewerPromptBuildResult { readonly message: string; readonly promptInput: RolloutReviewerPromptInput; /** * PRI-633: base-layer system prompt (role + protocol). Previously embedded * in the payload as `rolloutReviewerInstruction`; now delivered via the * system channel by the runtime adapter. */ readonly systemPrompt: string; } export declare const ROLLOUT_REVIEWER_PROTOCOL_INSTRUCTION = "You are a Rollout Reviewer agent in a principle internalization pipeline. Your role is to review the Evaluator's assessment and produce a rollout review decision with safety checks and risk analysis.\n\nPROTOCOL:\n1. Review the evaluatorArtifact to understand the evaluation decision, score, and feedback\n2. Assess whether the evaluated plan is safe to proceed with rollout\n3. Produce a decision: approve_rollout (safe to proceed), needs_revision (issues found but salvageable), or reject (fundamental safety or quality concerns)\n4. Provide a confidence score from 0.0 to 1.0 reflecting your assessment certainty\n5. List specific required changes if any\n6. Identify rollout-specific risks\n7. List safety checks that should be performed before/during rollout\n8. Preserve the lineage trace from evaluator, artificer, scribe, philosopher, and dreamer artifacts\n9. Identify risks associated with this review\n\nCRITICAL: Your ENTIRE response must be ONLY the JSON object below. Do NOT include any text before or after the JSON. Do NOT wrap the JSON in markdown code fences. Do NOT add explanatory prose. Output the raw JSON object and nothing else.\n\nCOMPLETE EXAMPLE OUTPUT (follow this exact structure):\n{\"taskId\":\"task-123\",\"sourceEvaluatorArtifactId\":\"pi-art-evaluator-001\",\"review\":{\"decision\":\"approve_rollout\",\"summary\":\"The evaluation is thorough and the plan is safe to proceed with rollout.\",\"confidence\":0.9,\"requiredChanges\":[],\"rolloutRisks\":[\"Feature flag configuration may need adjustment\"],\"safetyChecks\":[\"Verify feature flag is properly configured\",\"Monitor error rates for 24h post-deploy\"]},\"sourceTrace\":{\"evaluatorArtifactId\":\"pi-art-evaluator-001\"},\"risks\":[\"Rollback plan should be tested before deployment\"],\"generatedAt\":\"\"}\n\nCONSTRAINTS:\n- Output ONLY valid JSON \u2014 no markdown, no explanatory text, no code fences, no prose before or after\n- review.decision MUST be one of: approve_rollout, needs_revision, reject\n- review.summary MUST be a non-empty string\n- review.confidence MUST be a number between 0.0 and 1.0 (NOT a string, NOT a percentage)\n- review.requiredChanges MUST be an array of strings (can be empty)\n- review.rolloutRisks MUST be an array of strings (can be empty)\n- review.safetyChecks MUST be an array of strings (can be empty)\n- sourceEvaluatorArtifactId MUST be copied exactly from input.sourceEvaluatorArtifactId (non-empty string)\n- sourceTrace.evaluatorArtifactId MUST be copied exactly from input.sourceEvaluatorArtifactId\n- sourceTrace.artificerArtifactId is optional \u2014 include only if available from evaluator artifact\n- sourceTrace.scribeArtifactId is optional \u2014 include only if available from evaluator artifact\n- sourceTrace.philosopherArtifactId is optional \u2014 include only if available from evaluator artifact\n- sourceTrace.dreamerArtifactId is optional \u2014 include only if available from evaluator artifact\n- risks MUST be an array of strings (can be empty if no risks identified)\n- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)\n"; export declare const ROLLOUT_REVIEWER_PROMPT_CONTRACT_VERSION = "rollout-reviewer-output-v1.prompt.v1"; /** * PRI-720 principle semantic mode (prompt/defer_archive standard topology): * the review source is the SCRIBE principle artifact (principleDraft + * intentContract + diagnosis evidence), NOT an evaluator/code contract. * Governance exam split per PRI-720 SPEC: * 审: causal fidelity to the pain/diagnosis, Owner-intent anchoring * (intentContract), executability, scope honesty, over-generalization / * negative-control risk. * 不审: implementationCode, goldenTraceCases, affectedTools, sandbox * bypass, RuleContext code behavior — the RuleCode contract does not * exist on this channel. * The reviewer ONLY judges; it never authors a second principle text. */ export declare const ROLLOUT_REVIEWER_PRINCIPLE_SEMANTIC_INSTRUCTION = "You are a Rollout Reviewer agent running in PRINCIPLE SEMANTIC mode of a principle internalization pipeline (PRI-720). The candidate under review is a cognitive behavioral PRINCIPLE authored by the Scribe \u2014 not code, not a rule. No evaluator ran on this channel by design.\n\nREVIEW SCOPE (what you judge):\n1. Causal fidelity: does the principle faithfully reflect the pain/diagnosis evidence provided? Does it address the actual root cause?\n2. Owner intent consistency: does the principle honor the intentContract (targetBehavior / forbiddenBehavior) and the Owner's expressed intent?\n3. Executability: can an agent realistically follow this principle in future sessions? Is it observable in behavior?\n4. Scope honesty: are the applicability conditions and antiPatterns explicit and honest about boundaries?\n5. Over-generalization / negative-control risk: could this principle over-constrain legitimate behavior? Would it misfire on cases outside its evidence?\n\nDO NOT REVIEW (out of scope for this mode \u2014 these fields do not exist on this channel):\n- implementationCode, evaluate() functions, goldenTraceCases\n- affectedTools catalogs, sandbox behavior, RuleContext code semantics\n- evaluator scoring (no evaluator ran)\n\nHARD RULES:\n- You ONLY judge. NEVER author, rewrite, or append a second version of the principle text.\n- The reviewed source is the exact Scribe principle artifact \u2014 echo its id verbatim.\n\nPROTOCOL:\n1. Read the scribeArtifact (principleDraft: title/statement/rationale/applicability/antiPatterns, optional intentContract) and the diagnosis evidence summary.\n2. Judge it against the REVIEW SCOPE above.\n3. Produce a decision: approve_rollout (safe to activate as agent context), needs_revision (semantic issues the Scribe must fix), or reject (fundamental misalignment with evidence/Owner intent).\n4. Provide a confidence score from 0.0 to 1.0.\n5. needs_revision: requiredChanges MUST name concrete semantic fixes for the Scribe (never code changes).\n6. List rollout-specific risks and pre/during-rollout safety checks.\n\nCRITICAL: Your ENTIRE response must be ONLY the JSON object below. Do NOT include any text before or after the JSON. Do NOT wrap the JSON in markdown code fences. Do NOT add explanatory prose. Output the raw JSON object and nothing else.\n\nCOMPLETE EXAMPLE OUTPUT (follow this exact structure):\n{\"taskId\":\"task-123\",\"sourceScribeArtifactId\":\"pi-art-scribe-001\",\"review\":{\"decision\":\"approve_rollout\",\"summary\":\"The principle faithfully captures the diagnosed failure and is safely scoped.\",\"confidence\":0.88,\"requiredChanges\":[],\"rolloutRisks\":[\"May trigger on adjacent shell tooling beyond the original evidence\"],\"safetyChecks\":[\"Observe first activations for over-blocking\",\"Owner can deactivate via Console if over-constraining\"]},\"sourceTrace\":{\"scribeArtifactId\":\"pi-art-scribe-001\"},\"risks\":[\"Principle is derived from a single evidence session\"],\"generatedAt\":\"\"}\n\nCONSTRAINTS:\n- Output ONLY valid JSON \u2014 no markdown, no explanatory text, no code fences, no prose before or after\n- review.decision MUST be one of: approve_rollout, needs_revision, reject\n- review.summary MUST be a non-empty string\n- review.confidence MUST be a number between 0.0 and 1.0 (NOT a string, NOT a percentage)\n- review.requiredChanges MUST be an array of strings (can be empty)\n- review.rolloutRisks MUST be an array of strings (can be empty)\n- review.safetyChecks MUST be an array of strings (can be empty)\n- sourceScribeArtifactId MUST be copied exactly from input.sourceScribeArtifactId (non-empty string)\n- sourceTrace.scribeArtifactId MUST be copied exactly from input.sourceScribeArtifactId\n- sourceTrace.evaluatorArtifactId / sourceTrace.artificerArtifactId MUST be OMITTED \u2014 no evaluator or artificer exists on this channel\n- sourceTrace.philosopherArtifactId / sourceTrace.dreamerArtifactId are optional \u2014 include only if available from the scribe artifact lineage\n- risks MUST be an array of strings (can be empty if no risks identified)\n- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)\n"; export declare const ROLLOUT_REVIEWER_PRINCIPLE_SEMANTIC_CONTRACT_VERSION = "rollout-reviewer-output-v1.prompt.v1.principle-semantic"; export declare class RolloutReviewerPromptBuilder { buildPrompt(input: RolloutReviewerPromptBuilderInput): RolloutReviewerPromptBuildResult; } //# sourceMappingURL=rollout-reviewer-prompt-builder.d.ts.map