Skip to content

fix(context): make progressive reads independent of native delta - #8044

Merged
huangruiteng merged 6 commits into
mainfrom
codex/progressive-delta-default-20261104
Nov 4, 2026
Merged

huangruiteng merged 6 commits into
mainfrom
codex/progressive-delta-default-20261104

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

An ordinary read-only quota query returned the full model packet when the caller supplied no native host or Turn. The CLI now presents the current requirements first and keeps the complete source reachable. Progressive presentation works without a synthetic Turn or native journal. Supported continuity hosts can independently reuse unchanged context. Explicit off continues to provide raw JSON to workers and schedulers.

The native journal records the exact returned bytes for a selected section. Missing ranges, changed data, foreign captures and compaction preserve the obligation to reread. The workspace settings use the same machine configuration transaction to control progressive reads and cross-turn delta independently.

Validation. On the synthetic File fixture the previous generic read returned 28,934 bytes. The new reference plus the recommended first read returned 16,277 bytes. Reading the entire required view cost 36,384 bytes including framing. Both File and SQLite exercised a real rejected artifact followed by acceptance of the corrected artifact. This measures delivered CLI bytes. Production token cost and benchmark outcome remain to be measured. The final branch passed 103 targeted tests covering the worker, initial reads, source recovery and single settlement. The explicit native binary suite is separately gated. Previously observed failures of the extracted heartbeat helper were fixed and rerun.

Manager delivery history is selected automatically for an eligible private reader. The settings screen exposes just progressive reads and cross-turn delta. Existing explicit legacy opt-outs are preserved. All 18 manager adapter tests passed, including restricted sessions, invalid or unavailable captures and legacy preferences.

Visual evidence. Packaged dashboard, isolated SQLite-backed settings. Previous screen followed by current desktop and 390 px viewport.

settings-after automatic-desktop automatic-narrow

Independent probing exposed a numeric identity collision when selecting a single array element. The read journal now consumes the selector owner's typed path directly. A native journal regression changes 1.0 to 1 at an array index, an object key named 0, and inside the whole array. The array-element case failed before the fix. Supporting-index discovery and full detail recovery are also exercised independently of first-page layout.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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: 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

没有声明原生宿主或 Turn、只想读取当前工作要求的 CLI 使用者。 原来普通只读查询默认内联约30KB完整材料;现在先提供当前目标、约束与同一快照的读取入口,支持材料按需展开,跨轮差分仍只由具备连续性的宿主使用。 在隔离 File 和 SQLite 经真实 CLI 读到完整当前要求和尾部约束,分页可回到同一完整源;显式关闭维持 raw JSON,查询不生成执行 Turn 或原生 journal。 不证明模型保留、token 计费节省、安装态采用或科学收益;保存配置不安装 hook,也不启动实验或新增执行权限。

改动思路 / Approach

复用同一 TypeScript progressive projection、selector 与现有 machine-config 事务,把宿主无关的渐进呈现和宿主连续性 Delta 分开;Python 只负责私有文件、实际字节核验和 CLI/Host IO。 当前 PR 交付普通 CLI 的渐进读取、同源恢复、原生选读观察和独立设置;安装态、真实模型/benchmark 效果仍是独立验收。

只把普通读取伪装成 Codex native 会引入不实连续性;另建 Python 分类或第二配置源则增加长期维护成本。因此保留既有 typed owner,完整原始快照先落盘,再选择当前 required view。真正的 native hook 才能观察受范围约束的选读;提示、目录和 EOF 都不能替代模型保留或工作授权。

具体改动 / Changes

关键代码讲解

  • apply_context_machine_options:将渐进呈现与 Delta 分开。普通 no-Turn 查询可以使用 AUTO,显式 off、环境 off、已有保存值和 raw scheduler 路径保持其原边界;不为读取创建 Turn。
  • capture_progressive_context:先保存完整 current source,再复用 TypeScript plan 生成 required view;支持材料仍由原路径和摘要读回。可选捕获 IO 失败返回完整当前输入。
  • verified_context_selection:重建并逐字节核验当前源、selection 和实际工具返回范围。partial、gap、伪造、foreign capture 与 child 事件不能得到观察完成;selected read 也不能变成 full-input baseline。
  • contextReadSectionDigests:当前 head 直接接 selector owner 的 (string | number)[],避免把数组下标 0 重解析成对象键字符串。原生 journal 的大整数、signed zero 和数字对象键对照均已复验。
  • setContextDelivery:两开关复用现有 preview/apply/readback。Delta off 不关闭渐进;保存失败保留原值,显式重试读回,既有 antigravity_mode=off 和其它 namespace 均保留。

规格采用 docs/reference/required-work-context.md,固定 revision 4335a26e20b8b85b9862838b9f86dbbdbc36c4ab。Opt-in native reuse、Selected capture details 的同源恢复、数值原文和选读/保留区分已落实;Machine default 的既有显式关闭得到保留,新 all-host presentation 默认变化按当前请求单独披露。也核对了原 manager-runtime-profile 接受条款及本 PR 中英文配对差分;未把本次改写文档反过来当独立规格。

对主干的风险 / Risks

旧 b235562 的独立 native journal 探针发现数组标量身份碰撞:2**60+1 改为 2**60+2、-0.0 改为 0.0 后单元素摘要相同,而完整数组、对象键 "0" 的对照不同。问题局限于选读观察身份,未观察到原文损坏或权限绕过。当前 6f4cbced5537404243ee2b2547e7714cc52c1773 改用 selector 的 typed path;保留原失败记录,完全相同的独立探针在新 head 全11项通过,包括上述数值对照和 child/foreign/tamper/gap 反例。没有把仅一次绿色运行当作原问题已修;修复和失败路径有明确因果对应。

新 head 四个原生/渐进模块 224 PASS,独立 real CLI/native 探针 11 PASS,TypeScript 4 PASS、typecheck 和 standard premerge 均通过。标准门为6项直接检查、10项 catalog、8项 risk、1项 public boundary,0 hold。原 base 的同一冻结探针11项通过;旧 base 没有新增 selected-journal acknowledgment,未把它当新功能已验收。旧 b235 的360 PASS、8 optional native-binary SKIP 与构建证据只用于源码未变的设置、raw consumer 和入口边界;新 journal 及依赖路径重新执行。没有查询、轮询或等待远端 CI。

匹配 workload 的实际 stdout UTF-8 字节(含 framing) File SQLite
base 默认完整输入 / head 显式 off 30,365 30,403
head reference + 完整 recommended first read 18,105 18,153
head reference + 完整 required-view read 37,413 37,461

首读更省,读完整 required view 更贵;这是相同 fixture 工作量的 CLI 字节测量。它不证明 token 计费节省、模型采用、benchmark 分数或完整成本净收益。完整源、未知表单、尾部约束和原始操作身份仍可读取;任何缺失的必要事实都应先从同一快照补读,再执行有副作用的操作。

语义与 CI 对齐

既有 context vocabulary 扩展 AUTO/Delta 与派生 read observation,仍由共享 typed owner 管理。generic projection 没有引入 benchmark 或 PR 业务分类;Python 保留 provider/file IO。中英文 RFC、语义扫描、公开边界和 required native gate 已通过,未放松硬预算或把旧跳过改记为通过。

我的整体评价 / Verdict

实际 packaged 设置页只呈现渐进读取与跨轮差分两个开关;默认画面、完整 JSON 详情、窄屏帮助、保存失败与重试均已检查。关闭差分仍保留渐进;失败保持原值,重试与重载读回正确,legacy off 和 sibling namespace 不变。 页面和真实 machine-config API 观察在 b235562,当前头的所有 UI、构建输入、配置 API/normalizer/store 与 fixture 源码均相同;合成部分仅为其它工作区 shell。未验证 installed App、真实宿主、模型采用或完整成本净收益。

复用同一 TypeScript progressive projection、selector 与现有 machine-config 事务,把宿主无关的渐进呈现和宿主连续性 Delta 分开;Python 只负责私有文件、实际字节核验和 CLI/Host IO。 当前 PR 交付普通 CLI 的渐进读取、同源恢复、原生选读观察和独立设置;安装态、真实模型/benchmark 效果仍是独立验收。 后续工作的 current unread source 可在旧捕获删除后继续生成保留原尾部的真实本地产物;这证明有用的恢复切片,仍不等于长程模型净收益。当前未发现阻塞问题,范围与维护成本相称。原生 binary/installed/model 场景和任意未来 operation form 的首读完整覆盖未被本次结论宣称;完整同源恢复仍是安全路径。APPROVE 结论、GitHub formal self-approval 限制、merge readiness 和维护者 merge 权限分别判断。

English verdict: APPROVE 6f4cbce; stateless progressive reads preserve complete same-capture recovery and explicit-off isolation, and the original array-scalar identity counterexample now passes through the real native journal.

@huangruiteng
huangruiteng merged commit ce4cfc1 into main Nov 4, 2026
8 of 16 checks passed
@huangruiteng
huangruiteng deleted the codex/progressive-delta-default-20261104 branch November 4, 2026 16:36
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