Repository navigation
fix(context): load Vision authoring detail at writeback - #8047
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…machine reads Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; runtime_reported.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
需要先理解当前任务、随后才编写 Vision 结算包的 Agent。 旧首读同时携带完整 Vision 格式、预算与示例;现在首读保留当前操作、物质交付规则及继续条件,编写结算包时再从同一快照读完整表单。 真实 File/SQLite CLI 的首读保留表单以外每个结算叶节点和原始回执;标准表单可完整恢复,修改过的表单与未知计划仍全文可见。 仅源 checkout 与隔离真实 File/SQLite;没有 installed App、模型保留/采用、token/cache/计费或持续长程净收益证据。读取完整表单新增一次读取成本。
改动思路 / Approach
复用既有 TypeScript 首读选择器和 visionAuthoringContract;只在深度相等的标准 durable_writeback 表单上延后格式细节,Python 仅补充同源读取提示。它不复制字段预算或建立第二个 authoring owner。 本 PR 交付标准表单的首读减量与同一捕获的完整按需恢复;不改变 Vision 校验、执行授权或结算,也不声称模型采纳或净成本收益。
最强的反对理由是把格式延后后,Agent 可能在未读完整规则时直接写回。这里没有把大小预算作为删义务的理由:先保留 material closeout 和适用 continuation_review,明确要求编写 Vision 前读取完整对象;只有整个对象与当前标准完全相同才折叠。任何新增约束或未知计划仍完整呈现。更小的现有 owner 扩展已经足够,无须新设置、协议或副本状态。
具体改动 / Changes
关键代码讲解
initialContextReadPointers:仅对 durable_writeback 中深度等于visionAuthoringContract(false/true)的表单选择 schema、rule 和适用继续条件。未知 step 字段及非标准表单走原全文路径。_native_context_reference:当首读选到 Vision rule 时补充“编写前从此捕获读取完整对象”的导航;没有新增读权限、准入或结算操作。visionAuthoringContract:仍是唯一完整表单 owner,字段预算、示例和 autonomous 完整替换规则没有被复制或改写。
规格采用 docs/reference/required-work-context.md,固定 revision 4335a26e20b8b85b9862838b9f86dbbdbc36c4ab。Current settlement obligations 对应当前操作、未知字段和继续条件完整保留;Selected capture details 对应同一摘要绑定源的完整详情与读前条件。二者在本 head 均落实。完整5文件、50增1删已审阅;其中12行生产变化,其余为回归和既有机器 smoke 显式 raw 读取。
对主干的风险 / Risks
独立验证没有采用作者测试数作为验收:真实 File/SQLite Goal 先取得普通 lease,再创建一次捕获;逐页读取,比较表单外的每个结算叶节点,随后读取完整原表单。原始状态和捕获字节不变,原 Turn 回执仍为1,spend 为0。冻结同一源后分别在 base/head 执行 public CLI;新增未知操作、修改表单的 stop、未知 plan 都保持完整,未由折叠逻辑猜测权限或任务状态。
| 同一捕获的首读 content UTF-8 bytes | File | SQLite |
|---|---|---|
| base | 20,045 | 20,071 |
| head | 19,591 | 19,617 |
这组独立 workload 的首读正文减少454 bytes;再读完整表单增加3019正文 bytes。它与作者较大 workload 的1928-byte差值不是同一次测量,也不代表完整 stdout、token 或净成本节省。基线新选择 oracle 只在两个标准表单案例失败,四个未知/修改控制通过;head全部8项通过,base原行为控制6项通过。另有43 native、5 TypeScript、typecheck 和 standard premerge(6 direct、19 selected)全部通过;没有查询或等待远端 CI。
语义与 CI 对齐
复用既有 vocabulary 与 typed owner,没有新增权限或状态分类。首读时机是披露的呈现变化;完整 operation contract 在依赖前仍须读取,selected EOF 不代表全文保留。Raw/off 路径和 UI 没有改动;机器 smoke 的显式 off 避免把导航引用误当 raw guard 决策。未知形式与原始完整恢复保持兼容。
我的整体评价 / Verdict
未发现阻塞问题。对 long_horizon 与 CLI 使用体验的判断是有界改善:任务事实、停止条件与原身份保留,标准格式可按需完整恢复,不增加确认轮次。检查了两处生产文件及其 UI 调用边界,本 PR 没有渲染页面变化,visual review 不适用。仅源 checkout 与隔离真实 File/SQLite;没有 installed App、模型保留/采用、token/cache/计费或持续长程净收益证据。读取完整表单新增一次读取成本。 范围与维护成本相称;更完整的模型效果与安装态资格不能由此推断。未执行合并、dismiss 或 resolve。
English verdict: APPROVE a453de1; known Vision detail is deferred without losing active operations, continuation rules, unknown forms, or complete same-capture recovery.
A model reading its current task also received the complete Vision authoring form, even when it only needed admission and continuation rules. The first read now keeps the material-closeout rule and applicable continuation policy. When composing a Vision, the reader points to the complete authoring object in the same capture. Changed and unknown forms stay fully visible.
The same captured input produced 141,757 bytes of selected JSON on the base and 139,829 bytes on this branch. This is a first-read measurement. Retrieving the full form costs an additional read. The immutable source and explicit selection remain available.
Real File and SQLite CLI tests compare every other settlement leaf, retrieve the complete deferred form and verify the original receipt. All 43 first-read tests, five typed navigation tests and the TypeScript check passed. No new configuration or runtime permission.