%%{init: {"flowchart": {"wrappingWidth": 680}}}%%
flowchart TB
%% 依据:lpt-ai src/llm/recall.ts recallSharedRules 第 6–10 条与 recallPrompt()。
%% 文案为源码原文,仅插入换行;第 1–5 条见 prompt-shared-a.mmd。
classDef src fill:#ffe1e1,stroke:#c0392b,stroke-width:3.5px,color:#7b1414
classDef api fill:#e8f0fe,stroke:#1a56b0,stroke-width:1.2px,color:#111
classDef take fill:#e7f6ea,stroke:#2e8b57,stroke-width:1.2px,color:#14532d
classDef use fill:#f3f0fb,stroke:#6b4fa0,stroke-width:1.2px,color:#3b2a63
classDef origin fill:#fff3cd,stroke:#b8860b,stroke-dasharray:4 3,color:#664d03
classDef note fill:#f7f7f7,stroke:#999,stroke-dasharray:4 3,color:#333
classDef warn fill:#ffe1e1,stroke:#c0392b,stroke-width:2.2px,color:#7b1414
E["「入口」system 继续拼接第 6–10 条"]:::api
E --> R6["6. 引用只能来自输入 units,start/end 是 source 完整正文的 UTF16 半开绝对偏移
(中文一位,emoji通常两位),quote 必须是准确非空原文且不拆 surrogate。
表达依据用冻结节点 TITLE/NOTES 的局部 UTF16 偏移和准确原文。"]:::use
R6 --> R7["7. 所有字段必传,未知字段禁止;model 由服务填写,禁止自行填写。
JSON 总输出不超过 64KB,不为了补满上限重复内容。"]:::use
R7 --> R8["8. 顶层字段一个不少,只允许这七个:
schemaVersion、kind、analysisStatus、assessments、hints、findings、limitations。"]:::use
R8 --> R9["9. "schemaVersion":1;"kind":"HINT"#124;"CHECK";
"analysisStatus":"COMPLETE"#124;"PARTIAL"#124;"INSUFFICIENT";
limitations:string[](最多5条、每条不超过160字符,
没有内容也必须输出空数组 [])。"]:::use
R9 --> R10["10. assessments:[{unitId,status:"ANALYZED"#124;"EXCLUDED"#124;"UNANALYZED",
reason:string(不超过120字符),
exclusion:"OUT_OF_SCOPE"#124;"NOT_KNOWLEDGE"#124;null,
citations:[{unitId,start,end,quote}]}]。
EXCLUDED 必须给实质解释和本单位准确引用,其他 exclusion=null。"]:::use
R10 --> U["「源」system 之后是 user 消息
JSON.stringify({ type, ...params })
type 为 recall-hint 或 recall-check"]:::origin