feat(shared): add owner-bound resource references - #379
Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
合同是对的;和 #386/#382 叠文件时要注意
占有 ≠ 权限、symlink/穿越/generation fail-closed、Workflow final-result 标 partial-owner-value、没有新的 child tool,这些都对。
两点:
publish失败时catch { return [] }是对的(缺 refs 不是完成)。不要把「没有 refs」读成完整性。- 和 #386 抢
artifacts.ts/workflow.json。#386 用整份 manifest 字节判断 already-committed;这份若把resourceRefs写进同一文件,必须等 #386 改成 run id + 终态 + artifact digest,否则 leftover 收据会把更新后的 refs 盖掉。resolveOwnerFileResourceRef有测试但还没接到消费路径,保持这样就好,不要先当通用读工具。
可以跟在 #386 收据身份修好之后合。
tt-a1i
left a comment
There was a problem hiding this comment.
Exact-head review: 3949855
[P1] A resource reference can resolve successfully after its bytes have changed. extensions/shared/resource-reference.ts:161-171 computes revision from owner, path, byte length, and mtime only; resolveOwnerFileResourceRef() at lines 286-304 rechecks the same metadata. Replacing a file with different same-length bytes and restoring its original mtime therefore returns ok: true for a stale reference. I reproduced this with a four-byte file changed from aaaa to bbbb while preserving mtime.
The contract is meant to let consumers distinguish stale generation/revision and exact terminal evidence; filesystem timestamps are not an immutable byte identity. Please bind the reference to a content digest, or to an owner-provided immutable artifact revision whose write/publication lifecycle guarantees byte identity, and verify it on resolution. Add a same-size/same-mtime replacement regression.
Verification boundary: exact-head code review plus focused local reproduction; no production files were modified.
|
已按 review 修复并推送到 |
Problem
Direct Subagent, Workflow, and Background Terminal artifacts currently expose unrelated paths and ids with different completeness and lifetime semantics. Cross-capability consumers cannot tell what value a file is complete relative to, who owns it, whether its generation is stale, or whether receiving the path grants any authority.
Closes #157.
Value
Result details can now carry one compact, versioned reference shape while each producer keeps storage, cleanup, canonical state, and authorization. Consumers get explicit owner/generation/revision/lifetime/completeness metadata without adding a global router or another read tool.
Approach
Validation
bun run check— passed.Impact