Skip to content
Discussion options

You must be logged in to vote

取舍是:放弃"工作区评审中断后能续跑",换来"续跑时复用的 checkpoint 一定来自同一份输入"。

range/commit 能 resume,是因为输入可以钉在不可变的 commit 上。resume 前 ResolveIdentity 先把 --from/--to/--commit 解析成 SHA(SealedInput),在任何 session 创建之前用它比对父运行的 manifest;比对通过后,这次运行加载 diff、agent 用 git show <sha>:path 读文件,用的都是同一个 SHA,所以真正评审的就是准入时校验过的那份东西(identity.go#L17-L28,agent.go#L554-L580,注释原话是 "Workspace mode seals no head and is left alone")。

工作区没有这样的锚点:

  • diff 是 git diff HEAD 加未跟踪文件,"a workspace has no immutable head",没有东西可以冻结(diff/git.go#L128-L135)。
  • agent 读文件直接读磁盘(filereader.go#L66-L79)。如果放开 workspace resume,准入时算一次 diff,运行时再算一次、再从磁盘读文件,中间代码一改就对不上,而且发现不了,最后可能把两个状态下的结论拼进同一份报告。
  • 只比 diff 哈希也不够:同样的 diff 可以对应不同的上下文代码,#1510 讨论 --staged 时就是这么说的。真要支持,得先把工作区冻结成快照…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lizhengfeng101
Comment options

Answer selected by lizhengfeng101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants