Skip to content

fix: make autonomous replan examples satisfy durable vision rules - #7190

Open
loopx-agent wants to merge 3 commits into
mainfrom
codex/replan-authoring-guidance
Open

loopx-agent wants to merge 3 commits into
mainfrom
codex/replan-authoring-guidance

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

An autonomous replan that updates acceptance_summary while retaining the Goal objective previously received a continue example that the existing durable-change validator rejects. The shared Vision authoring owner now requests an autonomous outcome=replan example and explains which durable changes require it. Unchanged reviews still allow continue/no_change; ordinary completion guidance and validation/authority rules remain unchanged.

The review also identified that accepting the sparse example could replace a complete existing Vision and drop direction, role scope and continuation intent. Autonomous guidance now explicitly states that JSON replaces the complete packet: reuse the current Agent's full packet and vision_patch, overlay only deliberately reviewed fields and the fresh path_delta, and preserve other fields and state. path_delta.retained prose does not merge omitted fields. Known current data is reused; canonical status/history supplies missing current data, never reconstruction from a summary.

This is a guidance fix in the existing owner. JSON retains full-replacement semantics and inline writes retain merge semantics. The sparse example remains useful for a new baseline, but is explicitly not an update packet for an existing Vision. No new API, storage, authority, confirmation gate or parallel policy is introduced. All three autonomous projections reuse the same owner, including receipt-bound settlement and external-progress review.

Validation at the repaired source:

  • Before this correction, new real File and SQLite cases independently reproduced a successful write followed by loss of six prior fields in cold status. The retained failure evidence is distinct from the passing repaired cases.
  • All 11 Python CLI cases pass. Real quota should-run → returned authoring procedure → refresh-state → separate cold status/index reads preserve the full existing seven-field patch, current state and original Goal. Sparse initial baselines remain valid. Changing the summary while forcing continue still rejects before an append; unchanged continue/no_change remains accepted.
  • All 50 focused TypeScript tests and the complete control-plane typecheck pass. Coverage includes full-packet authoring, preserved state/Todo intent, unchanged sparse replacement semantics, identity/private-text/budget refusals, and all existing replan projections.
  • Standard diff-selected premerge passes: five direct checks and 13 selected checks, no failures or advisories. Diff hygiene and RFC bilingual checks pass.
  • The three changed publication candidates pass the scoped public-boundary scan, with one existing non-literal credential-reference warning. The broader loopx check still reports two unrelated local Goal canonical-authority errors; it is not reported as globally green.

Compact authoring JSON measures 2,361 bytes ordinary and 3,031 bytes autonomous at this head. The prior submitted autonomous object was 2,542 bytes; the complete-packet safety guidance adds 489 bytes. No output or vision budget was relaxed. The qualified benefit is a valid evidence update that preserves known intent when the returned procedure is followed. Installed adoption, actual model compliance and total retry/model-cost improvement remain unqualified. No active Goal, benchmark worker, model job or external message was changed by validation.

The earlier submitted-head dependency-lock CI failure is historical evidence; this repair integrates current main, and no new remote CI qualification is claimed. New-head independent review and runtime merge authorization remain separate.

中文摘要:修复自动复盘的写作指引:修改持久字段须用 replan;JSON 是整包替换,必须从当前 Agent 的完整 Vision 出发,仅覆盖本次有意修改的字段和新证据路径,不能把稀疏示例或 retained 文字当作自动合并。File/SQLite 冷读验证方向、角色、持续策略及其他既有字段保留,原拒绝、预算、权限和普通提示语义均保留。

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

REQUEST_CHANGES — [P2] 自动复盘示例写回时应保留完整既有 Vision。 精确 head cf10d316375ba729cbb8983c708046397be4ea45。当前单字段修复有效,但完整既有状态下的写回丢字段,需先修复这一用法。

动机

需要保持原目标、更新验收证据并继续推进的自动复盘 Agent。原先自动复盘返回 continue 示例,修改验收摘要后被现有持久字段校验拒绝;新示例改为 replan,单字段 Vision 可以成功写回,但完整既有 Vision 的方向、角色范围和持续推进策略会被稀疏 JSON 覆盖掉。独立 File 和 SQLite 实路均复现:只有验收摘要的场景从拒绝变成成功;已有四个持久字段时,新示例成功保存的 Vision 却只剩 acceptance_summary。本次不要求修改 Goal 目标、增加确认或重写 JSON writer;要求自动复盘指引能够安全保留未打算改变的既有 Vision 字段。

不修复会让 Agent 在“反复被拒绝”与“写入成功但丢失原有方向/角色/持续策略”之间切换。应在同一个现有写作 owner 内给出完整、安全的证据更新路径,不需要新增规划任务或向用户再索取已知字段。

改动思路

写作投影复用同一 Vision owner 和既有 durable-field 列表是合适的;当前问题是把稀疏替换模板呈现为仅更新证据的可执行示例。修复限于自动复盘写作投影、保留字段的明确指引和完整既有 Vision 的实路回归,不需要改变现有 validator 或 full-replacement API。新增 local boolean 默认 false,只在三处已有自动复盘投影传 true;这避免把普通完成提示一并改成 replan。新文案从 validator 的四字段列表生成,能解释“Goal 目标没变也可能需要 replan”,这部分方向正确。

关键区别是:允许 replan 只说明持久字段的变化已显式声明,不会把稀疏 JSON 自动合并成完整旧 Vision。现有 --agent-vision-json 是替换路径,inline flags 才请求合并。把示例改为可接受之后,也必须教会调用方复用完整已知状态;path_delta.retained 的文字不会把缺失字段补回去。

具体改动

完整差异为五个文件 +98/-9:两个已有 TS owner 改参数、示例 outcome、rule 和三处调用;三个已有测试模块增加 canonical 初始化及回归。没有新增存储、CLI、schema 或权限,也没有改变 durable validator。Python 旧用例先迁移一次性夹具到真实 canonical authority,避免用旧 Markdown 展示冒充来源,这项维护是合适的。

依据修改前 docs/reference/protocols/goal-vision-replan-contract-v0.md,spec_revision 0d55a3d8a22f3dece6a135aa817ed5ec04a26a0a:valid-autonomous-authoring 已实现只有验收摘要场景的合法写回;ordinary-and-enforced-parity 已验证普通提示及现有拒绝规则;retained-agent-intent 尚未满足,完整既有 Agent 的方向、角色和持续策略不能仅因更新证据而消失。最新目标 7f01e00fa8a7951fbb7fe83e877e75c66391e204 只新增 PR review publication 检查,不改本次 Vision owner/writer/读者。

关键代码讲解

  • visionAuthoringContract(78、93–103) 保留只含 acceptance_summary 的示例,新增 true 分支令其 outcome=replan,并列出四个 durable 字段。普通输出完整比较与基线相同;自动对象由 2361 增至 2542 个 compact JSON 字节,增加 181 字节,未扩大任何现有限额。
  • writebackProjection(312) 在 fresh Vision 与 external-progress 路径复用 true 分支,lifecycleObligation 的 receipt-bound settlement 亦同。它们只选写作投影,不授予执行、结算或改写 Goal 的权力,其他 required gates 仍在。
  • buildVisionCheckpoint 的既有 durable 检查(741) 仍拒绝“字段变化却 continue”的输入。另一方面,JSON 调用仍用 merge_patch=false,因此新示例一旦通过,只有示例中实际存在的字段进入新 Vision;latest_agent_vision_from_runs 也取最新 packet,不从历史补齐。

[P2] 可执行示例会丢掉本来要保留的三个字段

独立实路先建立完整 Vision:vision_summary、role_scope、advancement_policy=repeat_until_closed、acceptance_summary 均非空。随后读取真实 quota should-run 给出的示例,只改摘要和证据引用,并在 retained 中明确保留原 role/objective/continuation。按当前指引提交 refresh-state --agent-vision-json:

同一场景 基线 当前 head
返回示例的 outcome continue replan
完整既有 Vision,证据更新写回 现有 gate 拒绝 accepted/appended
新冷记录中的 vision_patch 未接受新记录 只有 acceptance_summary
原 Goal 正文 保留 保留,但不能代表 Agent Vision 被保留

File 和 SQLite 都得到相同结果。实际新 JSON/Markdown/index 已冷读:方向、角色范围和 repeat 策略确实未写入;不是只看成功响应,也不是测试替身供应后置条件。当前新增用例仅以 acceptance_summary 初始化,没有其他字段可丢,因此能通过这一遗漏。

最小修复:明确 JSON 是整包替换,先复用当前完整 vision_patch 再改验收摘要,或提供等价的安全合并写作路径;增加完整既有 Vision 的 File/SQLite 写回及冷读回归。 对照中只把当前完整 patch 复制进同一 JSON 再改摘要,两种后端都能保留全部字段,说明可在现有作者路径内完成;这是修复方案的输入对照,不代表 PR 已修复。

对主干的风险

主要风险是成功写回掩盖已知角色意图和持续推进条件的消失。明确 JSON 整包替换与保留字段的义务即可避免,不应为此放宽 validator、修改现有 replacement API、增加确认或新增第二份状态 owner。也不把丢失的角色说明误称为获得了新权限:实际 permission/Goal scope 的既有检查没有改变。

独立验证:当前 9 项 Python CLI、49 项相关 TypeScript 测试及完整 control-plane typecheck 通过;标准 premerge 的 5 个直接检查、13 个选中检查通过,整体仍有独立质量验收持有项。只有摘要的真实 File/SQLite 返回示例在不可变基线均拒绝、当前均成功;修改摘要却强改 continue 仍拒绝且 index 不变,不改 durable 字段时 continue/no_change 仍成功。普通 default/false 的完整对象与基线逐字段相同。

相对地,完整既有 Vision 的独立保留断言在当前两后端均失败,冷持久化支持该结论;完整 prior-patch 对照在两后端通过。该失败不是旧环境故障或可豁免项。所有夹具均为一次性 canonical File/SQLite;没有操作活动 Goal、真实模型或外部消息。首次补充探针因测试支持目录缺失未能收集,修正隔离导入路径后才取得上述实路结果;原收集失败保留,没有拿它当产品失败。

作者在 PR 正文记录了依赖锁相关 CI 失败与现有 #7185 修复;本次没有查询或等待 CI,不把该记录当独立绿灯。完整仓库、安装版、模型是否按指引构造完整补丁、总重试成本仍未资格验证。额外测量对象增长不等于已节省总输入或长期成本。

语义与 CI 对齐

既有 vocabulary 是 reuse_existing,四字段强制校验没有新增。新 replan 指引与 enforced gate 对齐,但“合法示例”仍未与保留既有 Agent 意图、JSON 替换语义对齐;P2 的真实触发、观察和最小修复如上。通过测试计数或 enum 一致不能消除这个实路失败。

我的整体评价

整体为 not_yet_proven/REQUEST_CHANGES:小范围既有 owner 复用和 ordinary parity 合理,单字段拒绝问题已解决;完整既有状态的安全更新仍缺失。long_horizon 与 user_experience 均为 regression:原目标文字留下,却可能丢掉已有角色和持续策略,带来不必要的恢复工作。没有新增界面、导航或确认轮次,也不需要以新增人类决策作为修复。

Only agent-consumed CLI writing guidance and tests change; no rendered page or layout changes. Installed-host/model adoption and total retry/cost benefit remain unverified. 重新评审需在当前 head 的后继修复中证明完整四字段 Vision 在同一真实 CLI/File/SQLite 路径冷读保留,同时保留现有 sparse 场景、invalid continue 拒绝和普通输出一致性。源码范围无需扩成新状态机或存储重写。

English verdict: REQUEST_CHANGES — cf10d31. P2: the newly accepted autonomous sparse JSON example replaces a complete prior Vision, dropping direction, role scope and repeat_until_closed despite a summary-only update intent. Reproduced through real quota/refresh and cold File/SQLite journals; constructing the same input from the full prior patch preserves all fields. The9CLI/49TS tests, typecheck and5direct/13selected checks pass, but their one-field prior state misses this case. Preserve existing writer semantics and repair the authoring guidance/full-state regression; no CI or merge qualification is claimed.

Comment thread loopx/control_plane/goals/vision_checkpoint.ts
…61024

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机

Agent 在保留原目标、角色和持续策略的自动复盘中,只更新本轮验收证据。 此前示例先因 continue 被拒绝;早期修复虽允许写入,却会用稀疏 JSON 丢掉既有字段。当前指引要求从完整当前包出发,只覆盖有意修改的字段与新路径证据。 真实 File/SQLite CLI 写回后的独立冷 status 和 index 保留全部七个既有字段及当前状态;改摘要却强用 continue 仍拒绝且不追加。 不修改 JSON 整包替换、inline 合并、权限、预算或原 Goal,也不宣称安装采用、模型遵从或总成本收益。

这能避免 Agent 在“合法证据更新被拒绝”与“写入成功但方向/角色/持续策略消失”之间切换。目标和字段已经可读时,无需向用户重新索取已知信息。修改前的具体丢字段反例及修复要求见原评审,本次重新判断完整 head,没有沿用旧结论。

改动思路

直接修复既有 Vision 写作 owner 和三处自动复盘投影足以解决实际缺陷;新增 writer、状态机或确认流程没有必要。 本 PR 完成自动复盘写作指引及完整既有状态的真实写回回归,保留现有替换和校验边界。 指引明确 JSON 是整包替换,path_delta.retained 只是审计说明,不会自动合并缺失字段。先复用当前 Agent 的完整包和 vision_patch,再叠加本次有意修改及新证据;只有当前包不可用时才读 canonical status/history,不从摘要猜测丢失意图。

该改动是有意修正 Agent 接收的写作语义,未弱化执行义务。更新持久验收字段仍须 replan;保持字段不变时仍允许 continue/no_change。普通完成提示没有同步加长,原默认/false 的完整输出与不可变基线逐字段完全相同。

具体改动

完整 base-to-head 为五个文件:两个已有 TypeScript owner 和三个已有测试文件,+174/-9。相对上次 cf10d316375ba729cbb8983c708046397be4ea45,新增的是完整包保留指导、七字段冷读与状态/Todo 意图回归;真实文件写路、持久化和读取所有者没有重写。测试将旧 Markdown 夹具显式初始化为隔离 canonical authority,未把展示文件当权威来源。

先验规范为 docs/reference/protocols/goal-vision-replan-contract-v0.md,spec_revision 0d55a3d8a22f3dece6a135aa817ed5ec04a26a0a。valid-autonomous-authoring:已实现合法证据更新;ordinary-and-enforced-parity:普通输出与现有拒绝规则已验证;retained-agent-intent:完整既有方向、角色、持续策略、验收及辅助字段和 state 经真实 File/SQLite 冷读保留。规范是修改前版本;本次没有改写它以适配实现。

关键代码讲解

  • visionAuthoringContract:78 的 boolean 默认 false;true 分支给出合法 replan 示例、四个 durable 字段列表及完整包保留过程。字段列表直接复用原 validator 的常量,未增加新 vocabulary。
  • projectReplanSemantics / writebackProjection:324 在普通 fresh-path、external-progress 和 receipt-bound settlement 三条既有自动复盘投影中使用 true 分支。它提供写作建议,不授予结算或改 Goal 的权力。
  • buildVisionCheckpoint:873 继续执行既有预算、身份、路径和 durable-change 检查。稀疏 JSON 仍是替换;这是保持兼容的负例,不能把 API 暗改为 merge 来掩盖错误用法。

对主干的风险

原 P2 已在该 head 的返回指引和实际写路上核验解决:11 项 Python CLI 用例通过,含两后端×完整/稀疏初始状态、独立 status/index、invalid continue 无追加、unchanged continue/no_change;50 项 TypeScript 用例及类型检查通过,覆盖 state/Todo、身份、私有文本和预算。默认与 false 全对象对照相等。compact 作者对象为普通 2361 字节、自动 3031 字节;这笔额外指引成本已明确,没有放宽限额或据此声称净节省。

标准 premerge 的五项直接检查和十三项选中检查通过。另行执行的必需 mypy 在不可变 base ad6d2f6d3248cb9f612af7626046b689d8f654b0 与当前 head 均为 5239 个错误、615 个文件,完整 stdout 字节相同,签名 da58bf1e6c5a486518ed4b50b170da6da46e20ec07a80a897890633afae0bbcd。它保持 failed;精确 scope 的质量收据 cqr_579c400e6e38ae81c044 也保持 fail,不能以本次聚焦验证豁免合并资格。本 PR 未改变这些错误的 Python 产品路径,而真实新增不变量有独立正向与拒绝证据,因此与代码评审结论分开处理。未查询、轮询或等待远端 CI。

语义与 CI 对齐

本次复用已有状态、durable 字段、replan outcome 和 writer。新文字逐条保留 actor/scope、先读当前完整来源、字段替换、证据、继续及原停止条件;明确 retained 文字不是执行合并。若模型仍只提交稀疏示例,原 API 仍会替换,因此模型遵从没有被当作已证实。回滚只需撤销该既有 owner 的指导和三处显式调用,不牵涉存储迁移。

我的整体评价

APPROVE,交付判断为 goal_achieved,限定于本 PR 的写作指引修复。long_horizon 与 user_experience 在已测实际路径上 improved:证据更新可合法完成且保留已知意图,不增加确认或用户准备;原身份、预算、权限与未变字段继续受既有 owner 管理。直接修复既有 Vision 写作 owner 和三处自动复盘投影足以解决实际缺陷;新增 writer、状态机或确认流程没有必要。 本 PR 完成自动复盘写作指引及完整既有状态的真实写回回归,保留现有替换和校验边界。

仅检查 Agent 消费的 CLI 写作投影和真实 writer/readback,没有渲染页面或布局变更,无需截图。未验证范围:安装版实际采用、模型遵从及总重试/模型成本收益。质量收据仍因原有 mypy 失败而持有;代码批准不表示这些必需失败已经通过,也不授予合并权。结论绑定 627c02291946d5f42d982658be90feed9ef16e99,旧 P2 讨论保留,仅在验证已解决后收口。

English verdict: APPROVE — 627c02291946d5f42d982658be90feed9ef16e99. The existing autonomous authoring owner now requires a complete current Vision before deliberate replacement.11 real File/SQLite CLI cases,50TS,typecheck and5direct/13selected checks pass; unchanged ordinary output is exact. The full mypy failure is byte-identical to immutable base and remains a quality/merge hold. Installed/model adoption and total-cost benefit are unqualified.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant