import type { AgentWorktreeSpec, LoopTemplateSummary } from "../types.js"; /** * Builtin template metadata, prompt kit, and deterministic script assets. * * The copy-edited prose blocks (worktree policy, exact-todos-commands stanzas, * evidence rules, no-tmux stanzas) live here as composable named fragments; * per-template wording deltas are explicit parameters so drift stays visible * in one place. Rendered wording is contract-tested in templates.test.ts. */ export declare const TODOS_TASK_WORKER_VERIFIER_TEMPLATE_ID = "todos-task-worker-verifier"; export declare const EVENT_WORKER_VERIFIER_TEMPLATE_ID = "event-worker-verifier"; export declare const BOUNDED_AGENT_WORKER_VERIFIER_TEMPLATE_ID = "bounded-agent-worker-verifier"; export declare const TASK_LIFECYCLE_TEMPLATE_ID = "task-lifecycle"; export declare const PR_REVIEW_TEMPLATE_ID = "pr-review"; export declare const SCHEDULED_AUDIT_TEMPLATE_ID = "scheduled-audit"; export declare const KNOWLEDGE_REFRESH_TEMPLATE_ID = "knowledge-refresh"; export declare const REPORT_ONLY_TEMPLATE_ID = "report-only"; export declare const INCIDENT_RESPONSE_TEMPLATE_ID = "incident-response"; export declare const DETERMINISTIC_CHECK_CREATE_TASK_TEMPLATE_ID = "deterministic-check-create-task"; export declare const ROUTING_REMEDIATION_TEMPLATE_ID = "routing-remediation"; /** * Conversations channel that routing-health findings are reported to. * * Owner directive 2026-07-30 ("routine operational alerts are not tasks"): a routing * failure is a measurement, not a claim on someone's attention, so it must not be * filed as a todos task. Before that directive this template told the worker to * `todos task upsert` one blocker task per finding, and a single sweep on 2026-07-05 * emitted 2,817 of them — none ever assigned, actioned, or commented on. Findings now * go to a run evidence artifact plus ONE aggregate post on this channel. */ export declare const ROUTING_REMEDIATION_ALERT_CHANNEL = "open-loops"; /** * Instruction fragment forbidding a routing-health worker from turning findings into * todos rows. Owner directive 2026-07-30: the task store is for work someone intends * to do; a routing failure is a measurement and belongs in evidence plus one aggregate * channel post. */ export declare function ROUTING_HEALTH_ALERTS_ARE_NOT_TASKS_FRAGMENT(alertChannel: string, blockerReportPath: string): string; export type AgentWorkflowRole = "triage" | "planner" | "worker" | "verifier"; export declare const BUILTIN_TEMPLATE_SUMMARIES: LoopTemplateSummary[]; export declare const NO_TMUX_DISPATCH_FRAGMENT = "Do not dispatch or paste prompts into tmux panes. If additional work is required, create or update deduped todos tasks so task-created routing can start a fresh headless workflow."; export declare const WORKER_LEAVES_COMPLETION_FRAGMENT = "Do not mark the task complete in the worker step; the verifier step owns completion after independent validation."; export declare const VERIFIER_TINY_FIXES_FRAGMENT = "Do not make broad unrelated changes. Only apply tiny verification fixes when they are necessary and low risk; otherwise create follow-up tasks."; export declare const TASK_VERIFIER_DECISION_FRAGMENT = "If the work is valid, record verification evidence in todos and mark/leave the task in the correct completed state according to the todos CLI. If it is not valid, add precise follow-up tasks or comments and leave the original task open or blocked with clear evidence."; export declare const LIFECYCLE_VERIFIER_DECISION_FRAGMENT = "If the work is valid, record verification evidence in todos and mark/leave the task completed according to the todos CLI. If not valid, add precise follow-up tasks or comments and leave the original task open or blocked with clear evidence."; export declare const EVENT_VERIFIER_DECISION_FRAGMENT = "If the work is valid, record verification evidence in the relevant local system. If it is not valid, add precise follow-up tasks/comments and leave the event handling state open or blocked with clear evidence."; export declare const BOUNDED_VERIFIER_REVIEW_FRAGMENT = "Use fresh context. Review the worker result for correctness, regressions, missing tests, safety, runaway-agent risk, output bounds, and incomplete evidence."; export declare const BOUNDED_VERIFIER_DECISION_FRAGMENT = "If valid, record verification evidence. If invalid, create precise follow-up tasks or comments and leave the original work open. Do not make broad unrelated changes."; export declare const TASK_REVIEW_FOCUS = "correctness, regressions, missing tests, security, and incomplete requirements"; export declare const EVENT_REVIEW_FOCUS = "correctness, regressions, security, missing evidence, and incomplete requirements"; export type BuiltinFlow = "task" | "lifecycle" | "event" | "bounded"; export declare function roleFragment(role: string, flow: BuiltinFlow): string; /** * `/goal` header lines. The blank separator line is intentionally part of the * fragment; prompts assembled with `.filter(Boolean)` historically drop it and * that rendering is contract-tested, so composition must preserve both shapes. */ export declare function goalHeaderFragment(goal: string, role: string, flow: BuiltinFlow): string[]; /** * Bounded lifecycle steps must not open native Codewith `/goal` state. The * workflow itself already owns durability and sequencing; each agent step only * needs a finite role/objective header plus exact task evidence instructions. */ export declare function boundedStepHeaderFragment(objective: string, role: string, flow: BuiltinFlow): string[]; export declare function adversarialReviewFragment(inspect: string, focus: string): string; export declare const DEFAULT_VERIFIER_IDLE_TIMEOUT_MS: number; export declare function verifierIdleTimeoutMs(input: { verifierIdleTimeoutMs?: number; }): number | undefined; export declare function verifierRuntimeGuidance(input: { verifierIdleTimeoutMs?: number; }): string; export declare function todosInspectLine(todosProjectPath: string | undefined, taskId: string): string; export declare function todosStartLine(todosProjectPath: string | undefined, taskId: string): string; export declare function todosEvidenceLine(todosProjectPath: string | undefined, taskId: string, placeholder: string): string; export declare function todosVerificationLine(todosProjectPath: string | undefined, taskId: string): string; export type TaskEvidenceRole = "worker" | "verifier"; export declare function taskEvidenceMarker(role: TaskEvidenceRole, taskId: string, eventId?: string): string; export declare function todosTaskEvidenceLine(todosProjectPath: string | undefined, taskId: string, role: TaskEvidenceRole, marker: string, placeholder: string): string; export declare function todosDoneLine(todosProjectPath: string | undefined, taskId: string): string; /** Exact-todos-commands stanza: optional project pin, inspect, then role-specific command lines. */ export declare function todosExactCommandsFragment(todosProjectPath: string | undefined, taskId: string, commandLines: string[]): string[]; /** Worktree policy PROSE for agent guidance; enforcement is executor-native via target.worktree. */ export declare function worktreePrompt(plan: AgentWorktreeSpec): string; export declare function worktreeContextFragment(plan: AgentWorktreeSpec): Record; export declare function shellQuote(value: string): string; export interface RoutingRemediationScopeOptions { doctorProject?: string; tag?: string; status?: string; shard?: string; limit?: string; } export interface RoutingRemediationPreflightCommandOptions extends RoutingRemediationScopeOptions { todosProjectPath: string; doctorJsonPath?: string; doctorOutputPath: string; preflightOutputPath: string; maxRepairs: number; dryRun: boolean; idempotencyKey: string; applyCommand: string; /** Where blocker findings are written as evidence instead of being filed as tasks. */ blockerReportPath: string; /** Conversations channel the aggregate blocker summary is posted to. */ alertChannel?: string; } export declare function routingRemediationDoctorScopeArgs(opts: RoutingRemediationScopeOptions): string[]; export declare function routingRemediationDoctorCommand(opts: RoutingRemediationScopeOptions & { todosProjectPath: string; apply?: boolean; undoRecordPath?: string; }): string; export declare function routingRemediationPreflightCommand(opts: RoutingRemediationPreflightCommandOptions): string; export declare function sourceTaskGateCommand(todosProjectPath: string | undefined, taskId: string): string; export type LifecycleGateStage = "triage" | "planner"; export declare function lifecycleGateCommand(todosProjectPath: string | undefined, taskId: string, stage: LifecycleGateStage, goMarker: string, blockedMarker: string): string; export declare function taskEvidenceGateCommand(todosProjectPath: string | undefined, taskId: string, workerMarker: string, verifierMarker: string): string; export interface PrHandoffCommandOptions { artifactPath: string; taskId: string; todosProjectPath?: string; worktreeCwd: string; worktreeRoot: string; expectedBranch: string; } export declare function prHandoffCommand(opts: PrHandoffCommandOptions): string;