/** * revision-reopen.ts — revision reopen / 修订目标解析的单一核心实现 (PRI-629 提取)。 * * 此前 reopenTaskForRevision 是 InternalizationOrchestrator 的方法、rollout 的 * resolveRevisionTarget 是 runner 的私有方法 — PRI-629 的 Owner revise_once 需要 * 在 Console/CLI 侧复用同一能力,故提取为自由函数,orchestrator/runner 委托至此, * 保持单一来源 (P4 One Source of Truth)。 */ import type { TaskRecord } from '../task-status.js'; import type { RuntimeStateManager } from '../store/runtime-state-manager.js'; import type { PITaskRecord } from './peer-runner-contracts.js'; /** * PRI-629 P0 (SPEC §12): repair artificer 完成后 reopen 来源 evaluator 的 * epoch-aware causal identity。 * rc0 (首次完成) → `repair-` — 与历史格式兼容 * rcN (Owner revise_once 重开后再完成) → `repair--rc` * 语义: same epoch replay (crash/reconciliation 重放同一次完成) → 相同 * causeId → 真 no-op;Owner 授权的新修订轮 → revisionCount 已 +1 → 新 * causeId → 真 reopen。 */ export declare function buildRepairRevisionCauseId(task: PITaskRecord): string; export interface ReopenRevisionOptions { revisionFeedback?: string; replaceArtificerDependencyWith?: string; reason?: string; /** * P0-4 revision identity: 同一逻辑修订动作的稳定标识。相同 causeKey 对 * 已 reopen 目标重放 = 真正 no-op (不递增 revisionCount);不同 causeKey = * 新修订轮。生产调用方必须传。 */ revisionCauseId?: string; } /** * Reopen a terminal (succeeded / needs_human_review) task for a revision round: * status → pending, attemptCount reset, revisionCount++, optional feedback * injected, optional artificer dependency swap. * * Idempotent (INV-08): target already pending/retry_wait with the same * revisionCauseId → true no-op. Restart-safe: all state is durable. */ export declare function reopenTaskForRevision(stateManager: RuntimeStateManager, taskId: string, options?: ReopenRevisionOptions): Promise<{ ok: boolean; reason: string; }>; export interface RolloutRevisionTarget { taskId: string; kind: 'scribe' | 'artificer'; } /** * 解析 rollout needs_revision 的修订目标 (只读遍历 dep 链): * rollout → evaluator → artificer → scribe (code 链); * rollout → scribe (PRI-720 principle 语义链: scribe 是直接依赖)。 * code_tool_hook → artificer (规则实现); 其他 channel → scribe (走到底)。 * 与 RolloutReviewerRunner 的路由规则保持同一实现 (单一来源)。 */ export declare function resolveRolloutRevisionTarget(getTask: (taskId: string) => Promise, taskId: string, channel: string): Promise; //# sourceMappingURL=revision-reopen.d.ts.map