import type { ProbeOutcomeKind } from "./schema.js"; /** findStepForProbe 返回结构(probe 命中的 step 信息) */ export interface StepMatch { /** step 的 1-indexed 编号(对应 manual 文件 ## 执行状态 表的行号) */ stepIndex: number; /** step 的 desc 文本(去 "- [ ] " 前缀) */ desc: string; /** step 的 observe 列表(来自 ` - 验证参照:xxx, yyy` 行) */ observeNames: string[]; } /** writeProbeResult 返回结构 */ export interface WritebackResult { /** 匹配上的 step 数(0 = probe 名不在任何 step 的 observe 中) */ matchCount: number; /** 写回的 step 索引(1-indexed) */ stepIndexes: number[]; /** 因全部 observe 完成而勾选 checklist 的 step 索引(1-indexed) */ checkedSteps: number[]; /** 改后的文件内容(changed=false 时返回原 content) */ content: string; /** 是否真的改了文件 */ changed: boolean; /** 改后的 completed-probes 列表(含历史 + 本次) */ completedProbes: string[]; } /** 从 manual 内容里按 probe 名找匹配的 step。多个 step 有同一 observe 时取首个。 * 返回 null = probe 名不在任何 step 的 observe 中。 */ export declare function findStepForProbe(content: string, probeName: string): StepMatch | null; /** 写回 probe 结果到 manual 文件内容(同步,不读文件)。 * - 写执行状态表 `| N | — | |` → `| N | | |` * - 改 frontmatter 注释维护 completed probe 列表 * - 多 observe 同步:若 step 的全部 observe 都 in 列表 → checklist `- [ ]` → `- [x]` * - 幂等:同一 probe 跑两次 → 用最新覆盖原 message * - 边界: * - 找不到匹配 step → matchCount=0, changed=false(让 caller 走 warn 分支) * - 找不到执行状态表对应行 → 不改(保守:manual 损坏不擅自补) */ export declare function writeProbeResult(content: string, probeName: string, outcome: ProbeOutcomeKind, message: string): WritebackResult;