Skip to content

test(context): follow native machine capture manifests - #7680

Merged
loopx-agent merged 1 commit into
mainfrom
codex/machine-context-reader-20261029
Oct 29, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/machine-context-reader-20261029

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

The existing machine-level context integration stops at KeyError: eof for both File and SQLite because it treats the native file manifest as a reader page. This repair reads that immutable file through quota context-read, delivers only actual pages to the native hook, and checks contiguous UTF-8 byte coverage plus the original SHA-256 before continuing.

Author Declaration

Criterion Disposition Evidence
Read the original capture completely without another admission implemented Both File/SQLite cases reach full/delta observation, configuration invalidation and old-capture recovery
Incomplete content cannot count as a complete read implemented Offset continuity and full SHA-256; premature EOF injection is rejected
Actual model retention, adoption or whole-release qualification out_of_scope This is the existing synthetic CLI/host-hook fixture

Scope And Continuation

Complete within this test-repair scope. The original machine toggle, unsupported/explicit-off, immutable recovery, exactly-one guard and zero-spend checks remain. One existing test file changes; production code, configuration defaults, page size, budgets and settlement behavior are unchanged. No new helper module or smoke duplicates the existing scenario. Broader release qualification stays with the existing release workflow.

Validation

  • Tested revision: db662e9e406e2d79108ab0cd40741ce18d40f41a.
  • Run state: finished. Input classes: synthetic, public_fixture.
Check Result Evidence / limitation
Regression parity passed The same two machine cases fail on baseline at manifest eof and pass with the repaired reader
Existing machine + heartbeat transport suites passed 73 passed, 5 existing exclusions for explicit native Codex / loopback inference only; both changed cases passed
Existing byte-budget, no-retention manifest/receipt and fresh-turn cases passed 10 passed
Premature EOF counterexample passed A 3072-byte first page claiming completion is rejected by the full digest oracle
Static passed Changed-file Ruff and compile; repository-declared mypy: 17 files clean; whitespace and RFC-pair check
Public/private boundary passed The one changed file is clean
Exact-scope quality and standard premerge passed Quality receipt verified valid; no failed check or manual hold

The five exclusions remain exclusions. No live model, native Windows run, installed upgrade or whole-release success is claimed.

Frontend / Visual Evidence

UI impact: none — Python integration-test reader only. Visual evidence and shared-authority promotion fixtures: N/A.

Boundary Checklist

  • Public-safe diff and description; no private state or raw evidence included.
  • Existing focused fixture repaired; no benchmark work duplicated.
  • No RFC changed; paired-diff check passed.
  • DCO sign-off included.

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; runtime_reported; gpt-6.1-sol; OpenAI; reasoning_effort=max

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

动机 / Motivation

运行机器级上下文配置集成检查的维护者,会在 File 和 SQLite 两种隔离存储场景中遇到这个问题。

旧测试把文件索引当成正文页,读取 eof 时就报错,后面的配置切换、恢复和账务检查均未执行;新测试先实际读取文件,再逐页交给原生 hook。

两种存储场景都已读完并核对完整原文,继续通过原有的完整/增量、配置失效、旧文件恢复和单次记账检查。

本次只恢复既有集成测试的有效覆盖,未修改生产行为,也不据此声称真实模型保留、使用收益或整个版本已验收。

改动思路 / Approach

我先考虑了不改及仅补一个 eof 默认值:两者都不能让后续恢复断言实际读到原文。当前做法沿既有 CLI 读取原始文件,把真实页交给已有 hook;生产的读取、状态和记账 owner 都不变。完整范围只有原测试内部的循环,字节累计同时提供下一次 offset 与最后的完整性检查,没有引入新读取器或跨模块 wrapper。

具体改动 / Changes

规范依据为 docs/development/testing-and-quality.md 的 Progressive Context Qualification,固定修订 ed0972c3190ad9f0e864284bdb1d95bdefefb4a6。capture_identity 对应保留原 capture 与 settlement identity;complete_read 对应通过实际入口核对读取覆盖;outcome_benefit 属于本次测试修复之外的默认交付与实际收益资格,不据此判通过。

关键代码讲解

  • complete_reader:先调用原来的 quota context-read,核对页起点、累计 UTF-8 字节和后续游标,在 EOF 比较完整 SHA-256。原来的 3072 字节分页设置保持不变。
  • test_machine_on_reaches_real_guard_and_same_capture_readback_without_readmission:保留 full/warm、配置 off/on 后 generation 失效、旧 capture 读回、损坏配置恢复以及一个 guard receipt、零 spend、原 state 不变的断言。真实 File/SQLite 隔离场景现已走到这些后继检查。

对主干的风险 / Risks

最大的漏检风险是把部分正文当完整观察。已在真实 CLI fixture 上给首个 3072 字节页注入提前 EOF,新增摘要断言确实拒绝它。基线两个案例因索引缺少 eof 失败,最终源两者通过;相关原套件 73 PASS、5 项既有 explicit native Codex / loopback inference only 排除,另 10 项分页、文件索引及新工作 Turn 检查 PASS。Ruff、编译、声明 mypy 的 17 文件、公开边界扫描及标准预合并的 5 项直接检查 PASS;目录未额外选择 canary。精确 CQR 已验证有效。

完整差异仅测试文件,生产实现、默认配置、预算、权限和协议未变,没有新共享语义词汇。核对过最近 30 个同账号 PR 及相邻 7668、7673、7676 的消费者范围;这里修复现有机器配置场景,未新增同形 smoke。原有五项排除继续保留;不把合成 Host 事件等同真实模型保留,也不把本次覆盖补修等同整版发布验收。

我的整体评价 / Verdict

对这项已复现的测试断路,结论为 goal_achieved:其有用结果是重新执行原有配置与恢复检查。长程工作与用户体验维度均为 not_applicable,因为只更改测试消费者;tests/control_plane/test_context_machine_configuration.py 没有可视界面变化,无需截图。真实模型保留与整版发布使用体验不在本次测试修复范围。局部循环已经足够直接,无需另增兼容层,建议接受这个可单独回退的修复。

English verdict: APPROVE db662e9e406e2d79108ab0cd40741ce18d40f41a — the existing machine integration now reads complete native captures and rejects premature EOF; production behavior is unchanged.

@loopx-agent
loopx-agent merged commit 18137cf into main Oct 29, 2026
4 of 5 checks passed
@loopx-agent
loopx-agent deleted the codex/machine-context-reader-20261029 branch October 29, 2026 15: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.

1 participant