Skip to content

fix(vision): restore history-to-writeback roundtrips - #7922

Merged
huangruiteng merged 1 commit into
mainfrom
codex/vision-history-roundtrip-20261102
Nov 2, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/vision-history-roundtrip-20261102

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

从 loopx history 读回当前 Agent 的完整 Vision、修改验收证据再交给 refresh-state --agent-vision-json 时,索引中的 stride_decision: null 会触发 must be an object,导致正常续写被拒绝。现将 null 与省略字段统一解释为“未提供决策”;开启 stride 的评审仍必须提交有效、绑定当前来源的决策。

  • Outcome basis: 可复现的原生 CLI 恢复缺陷;关联 controller/executor RFC C5 中既有单会话 authoring 的兼容性。
  • Before → after: 基线 214afbb62 的两个 File/SQLite history 续写用例失败且未追加记录;候选在完整读回后可续写并保留已有目标、角色、验收和继续策略。
  • Intended base: main。无需新建 issue 或后继任务。

Author Declaration

  • Written by: model_agent — OpenAI GPT-6 (Codex).
  • Specification: docs/reference/protocols/goal-vision-replan-contract-v0.md 与 docs/architecture/rfcs/controller-executor-unified-contract-v0.md,检查基线 214afbb6222c4f0b410a6a1cc084d0262e91925f。本 PR 只修复上述可复现的兼容性缺口。
Criterion Disposition Symbol / path Evidence
当前完整 Vision 可保留原有承诺后续写 implemented normalizeStrideDecision File/SQLite status/history 原生 CLI 回归
缺省值不代替开启 stride 所需的有效决策 implemented 既有 Vision prepare / replan owner 六类评审的开启拒绝与 off 正例;非法 proposal 拒绝
错误输入不追加历史,预算和来源校验继续有效 implemented 既有 typed validator 无写入反例、原有 budget/Host/replan 恢复测试
  • Self-check: 完整审阅四个改动文件,执行下列源码与打包验收;独立评审、安装采用及长程收益未认定完成。

Scope And Continuation

  • Complete within this scope: 一个既有可选字段 codec 修复、真实读回续写回归、可搜索的 self-repair 诊断。
  • Bounded simplification applied: 历史 read codec 删除重复的空值分支,复用同一个 typed normalizer;Python 索引形状无需迁移或重写。
  • C1/C5 的统一契约切换、双会话采用及完整效果/成本资格继续按原 RFC;本修复可单独评审与回退。

Validation

  • Tested revision: fefb624cb761059093d7d14d952ea65b382c7c24;生产基线 214afbb6222c4f0b410a6a1cc084d0262e91925f。
  • Run state: finished.
  • Input classes: synthetic, public_fixture.
Check kind Result Public-safe evidence / limitation
regression_parity passed tests/control_plane/test_vision_budget_cli.py::test_projected_autonomous_example_updates_evidence_without_changing_goal -k 'history and True':基线两例均因 null codec 拒绝;修复后通过。TS 负反事实也在基线复现同一错误。
real_entrypoint / real_backend passed tests/control_plane/test_vision_budget_cli.py:15 通过,覆盖原生 status/history→续写、完整意图保留与非法输入不追加。临时 File 与 SQLite 3.53.4(Node 24.21.0),非 live 状态。
unit passed stride_policy.test.ts + vision_checkpoint.test.ts:59 通过、0 跳过;null/省略保持无决策,开启 stride 时仍拒绝缺失决策。
integration passed test_vision_checkpoint_runtime.py、test_required_vision_closeout_behavior.py、test_refresh_state_replan_gate.py、test_host_vision_recovery.py、test_stride_comparison_followthrough_cli.py:103 通过。
integration passed npm run test:control-plane:5888 通过、77 条件跳过、0 失败;真实 PostgreSQL 集成环境未配置,当前 stride/Vision 用例无跳过。
real_entrypoint / real_backend passed uv build --wheel 后在源码目录外执行打包 CLI:File/SQLite 两条 history→续写→冷读路径通过,每 backend 五种非法 proposal 均不追加历史;wheel 的 owner 字节与候选一致。
static passed TypeScript typecheck、所改 Python 文件 Ruff、diff check、diff-scoped vocabulary advisory(0 个受支持的新 carrier,保留工具范围限制)、四文件 public-boundary scan。
static passed 作者 CQR cqr_ba6fd06b6b55ea0f320f 已验证匹配该 head 与所记录 base;不代替独立评审。
integration passed 标准 canary premerge --from-git-diff --git-diff-base origin/main:5 direct + 13 selected 全通过,0 failure/warning/skip/manual hold;相同 head 的严格 CQR 同时验证有效。

作者质量凭据:4 个改动文件;scope fingerprint ba6fd06b6b55ea0f320f7a2139c1677ecc816d5b482af1c73bc578cf9cefbac4;safe-fix 允许但未在质量评审阶段应用(0 次);0 blocker/warning/advisory。基于 4494c85d36cc1f4a5731a46b9d065970d3457761 记录并验证。

准备阶段的失败保留:首轮 TS 夹具缺少独立进展条件,补齐语义 oracle 后基线才复现真实 null 拒绝;首轮打包夹具缺少重规划路径证据,被现有规则拒绝,按实际返回契约修正后通过。直接 setup.py 构建因缺构建依赖未执行,改用隔离 uv build;隐式路由扫描在扫描前拒绝,显式路由扫描通过。生产校验未因这些失败放宽。

  • Coverage and gaps: 共享 codec 的成功/拒绝、默认 off/启用策略、File/SQLite 原生及打包边界已覆盖;完整 Python suite、真实 PostgreSQL 集成和已安装 App/MCP journey 未重跑。远端 CI 与独立评审另行核验;不包含安装、canary 推广或净长程收益结论。

Frontend / Visual Evidence

  • UI impact: none。沿现有 JSON authoring 与 typed owner 修复元数据兼容性;没有布局、控件或新配置。
  • Before / After / first viewport / attention review / craft review: N/A;无视觉变更。
  • Source data: none.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Control plane
  • Capability or extension (self-repair guidance)

Technical Direction

  • Existing C5 single-session authoring compatibility; no claim of RFC cutover completion.

Shared-authority RFC fixture impact

N/A:未改变 authority store、迁移、provider 路由或协调投影规则。

Boundary Checklist

  • 无私有状态、原始轨迹、凭据、内部链接或本地路径进入 diff / PR。
  • 未启动或重复维护者 benchmark 工作。
  • 变更围绕已复现的恢复缺陷。
  • 没有修改 English/Chinese RFC pair。
  • UI impact 为 none。
  • 提交包含 DCO sign-off。

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@huangruiteng
huangruiteng merged commit 144bccd into main Nov 2, 2026
13 of 34 checks passed
@huangruiteng
huangruiteng deleted the codex/vision-history-roundtrip-20261102 branch November 2, 2026 17:30
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.

2 participants