Repository navigation
[6234] 假附件缓存标注供应商并在ready前确认落盘 - #4767
Merged
PinkMagicFly merged 2 commits intoOct 27, 2026
Merged
Conversation
PinkMagicFly
deleted the
pigmagicfly/6234/attachment-fake-cache-supplier
branch
October 27, 2026 08:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Mogan 内置假附件插件完成两件事(配套任务文档见 LiiiLabs/dev-agent
devel/6234.stem):result.json在载荷[1]中写入supplier=fake,明确数据来自假插件;命中刷新保留缓存原文[1](不重造 content、不丢原 supplier)。extract/<yyyymm>/<sha256>/result.json,确认[0].id等于本次 sha256 且[1]与本次应保存的完整载荷一致;首次写入与命中刷新共用同一条确认路径,任一失败返回带原 taskId 的 error 事件(附件缓存写入失败,请重试),不得 ready。实现要点
attachment-fresh-entry成为新缓存[1]的唯一构造点;attachment-cache-put!三参签名不变,写盘后返回本次应保存的[1](expected-payload,只是预期值,不代替落盘确认)。attachment-cache-payload-stored?:只读当月目标文件,比较解析后的 JSON 结构(非文本);文件缺失、非法 JSON、非二元 vector、id 不符、payload 不符均返回#f;只读不写、不删坏缓存、不重试。fake-attachment-ready-event:put → 回读确认 → ready/error;写入抛异常仍由fake-attachment-ingest既有 catch 兜底为同款 error。tm-llm.scm仅更新契约注释。不变项
%attachment请求协议不变。content,不读取、不回显 supplier。测试
实际执行的命令与结果(macOS arm64,releasedbg):
新增/扩展用例(
chat-protocol-test.scm):result.json断言[1].supplier=="fake"、[0].id正确、content 为假提取文本。#t;文件不存在 / 非法 JSON / 非二元 vector / id 不符 / content 不符 / supplier 不符或缺失 / 只有上月文件均#f。attachment-cache-put!替换为正常返回但不写文件,ingest 必须 error、不得 ready——证明实现不是只检查 put 返回值。GUI 手动验收步骤见 dev-agent
devel/6234.stem3.1 节,待人工执行。范围边界
🤖 Generated with Claude Code