Skip to content

Include suggested acceptance bodies in initial context reads - #7871

Merged
huangruiteng merged 6 commits into
mainfrom
codex/c1-outcome-first-read
Nov 2, 2026
Merged

huangruiteng merged 6 commits into
mainfrom
codex/c1-outcome-first-read

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

The initial reader exposes outcome IDs even when the acceptance owner already provides complete relationship navigation. Applicable bodies then need another detail request. This change includes those suggested bodies in the starting selection, including peer dependencies, while leaving other outcomes indexed and addressable.

Base: main. Bounded precursor to C1/C2 in controller-executor-unified-contract-v0.md §11; the complete program remains open.

Author Declaration

Written by: model_agent — Codex, OpenAI GPT-6 family.

Implemented against docs/reference/required-work-context.md and the C1/C2 contract at e9eda527afd5fcb262ee7c199e1822b1a936cc24.

Criterion Disposition Implementation / evidence
Applicable acceptance and cross-Agent constraints stay complete implemented Existing navigation owner supplies suggestions; positive regression includes a peer dependency, a final cancellation clause and unknown fields.
Capture identity, revisions and incomplete coverage remain explicit implemented Exact Goal/Agent/Todo and source-revision binding; mismatched, legacy, ambiguous and incomplete sources retain the existing detail route.
Other outcomes remain discoverable; selected EOF is not full delivery implemented Original index/detail addresses and read obligations preserved; immutable capture and receipt negative checks.
Host-independent defaults, unread ledger and full-cost/outcome qualification deferred Existing C1/C2 program; this proposal changes only the existing initial-reader selection.

Self-check: reviewed the complete seven-path diff and original instruction selection, preserved the latest agenda-read changes, ran the affected Python/TS suites, matched reader workload and static checks.

Scope And Continuation

Move the existing initial-selection policy into the existing progressive-context owner and reuse the registered navigation schema. TurnEnvelope retains the complete ordered top-level decision-field inventory and passes it to that helper; the presentation helper does not become a second decision owner. The generic RFC 6901 reader, activation defaults, saved capture/view/Delta bytes, configuration and permission owners remain unchanged. No new capability, store, setting or scope heuristic.

The native first-read command and public CLI reader use the same policy; the CLI checks require no Session Hook. Folded supporting material keeps its original read obligations. C1/C2 consumer migration, unread discovery, installed adoption and outcome/full-cost qualification remain outside this slice. It can be reviewed and reverted independently.

Validation

  • Current tested head: b93480d7a287f9e296d68e5925c8e2c095fdf2d0, incorporating target main fb16c6cb1369efce52a673030c914b38e1dac166. The original standalone evidence below was measured at d48b6238b9d50b83c155bb4b031ce67079b6f9d3 / 4bc686fda72b8309ab9b0c0b1d299128f858c900 and remains historical.
  • The earlier exact-head review applies to 4bc686fda72b8309ab9b0c0b1d299128f858c900; this new head needs fresh review. No CI query, merge, default rollout or installation is included in this update.
  • Run state: finished. Inputs: synthetic/public fixtures. No models or benchmark jobs launched.
Check kind Result Evidence / limitation
regression_parity passed The same positive first-read case fails on target runtime 2f099b8a (runtime/test blobs unchanged at e9eda527a) with the missing whole outcome, then passes with this change.
integration / real_entrypoint passed Five modules: context_first_read, outcome_context_navigation_cli, progressive_native_context, context_delivery_cli, codex_context_resume: 254 passed. Includes isolated real File/SQLite, marked/unmarked Goal and explicit/inherited activation.
unit / static passed context_selection, context_delivery and outcome_context_navigation TS suites: 57 passed, 1 PostgreSQL skip; control-plane typecheck passed.
real_entrypoint / regression_parity passed 20 isolated public-reader invocations with fixed source commits and immutable captures. Same required-body coverage in all eight base/head pairs. Incomplete navigation and explicit detail controls are byte-identical.
static passed Bilingual staged/head checks, whitespace, diff-scoped semantic advisory and public-boundary scan. Advisory found no supported vocabulary carriers; dynamic semantics remain outside that scanner.
real_backend not_run PostgreSQL integration environment unavailable; no PostgreSQL qualification claimed.

A combined integration check exposed a real semantic-owner regression: execution_obligation appeared in two TypeScript modules against the unchanged budget of one. The same actual semantic smoke failed on pre-fix 7eb69065ddb557180ec0ce2ab73d5a82e090a977; moving the unchanged ordered field list back to TurnEnvelope passes with one module. The budget and required field were preserved.

Current-head revalidation: the five Python modules above pass 254 cases; TypeScript passes 57 with one PostgreSQL skip; typecheck and bilingual checks pass. A second set of 20 isolated public-reader invocations compares the pre-fix and current heads using the same immutable synthetic inputs: all eight workload pairs have identical stdout SHA, call counts, bytes and logical RPC parameter/result bytes; all four explicit controls are identical. This owner correction adds no new byte-reduction claim. Full combined-program acceptance and real PostgreSQL qualification remain open.

Historical initial-reader component measurements, for initial pages plus all applicable outcome detail and a later peer-body expansion:

Provider / output limit Reads before → after CLI stdout bytes before → after
File / 16,000B 4 → 3 35,893 → 34,934
File / 64,000B 3 → 2 34,825 → 33,866
SQLite / 16,000B 4 → 3 35,921 → 34,962
SQLite / 64,000B 3 → 2 34,851 → 33,892

Each complete-navigation case saves 959B of stdout (about 2.7%) and one logical context-select call. The initial selection itself grows by 5,937B; the complete read workload is the comparison. Serialized bridge parameter/result JSON also falls because one request no longer carries the capture. These are component measurements, not framed traffic, model tokens, latency, billing or accepted-outcome benefit. Saved-view file bytes are unchanged.

Earlier stale-reference fixture failures were reproduced on the unchanged baseline and corrected with the existing shared reference oracle. An initial missing test dependency was repaired locally before the final TS run. Those attempts do not count as passing validation. No installed/App/model adoption or whole C1 closeout is claimed.

Frontend / Visual Evidence

UI impact: none. Existing model-facing native/common-reader journey; no page, settings or documentation-chrome change. Screenshots and preview: N/A. Packaged/installed qualification remains separate.

Boundary Checklist

  • Public diff and description contain no private operating state, raw evidence, credentials or local paths.
  • Scope is the existing initial reader; no benchmark treatment, scoring or budget changes.
  • English/Chinese RFC pair updated and checked.
  • Every commit carries a DCO sign-off.
  • Maintainer review and merge authorization remain separate; this PR does not request a default rollout.

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

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

# Conflicts:
#	loopx/control_plane/quota/turn_envelope.ts
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.

1) 问题定义(为什么改、要解决什么)

  • 在渐进式上下文首读(--initial-read / first_read_command)中,当 goal_acceptance 源包含与当前捕获的 Goal、Agent、所选 Todo、outcome_revision 及 provider_revision 完全匹配的完整 outcome_context 导航时,直接内联展开其 suggested_outcome_ids 对应的成果正文(含跨 Agent 依赖与未知扩展字段),减少首读后紧接着必读建议成果的二次往返。

2) 改动摘要(按模块分组)

  • 首读指针根据绑定导航展开 (loopx/control_plane/quota/progressive_context.ts):在 initialContextReadPointers 中校验 outcome_context 的完整绑定身份(Goal/Agent/Todo/outcome_revision/provider_revision/coverage_complete)及源完整性,匹配时将建议成果完整对象路径选入首读,其余成果保留索引与地址;任何字段失配、歧义或源不完整均自动回退至既有详情路由。
  • 双语契约文档与回归测试 (docs/architecture/rfcs/controller-executor-unified-contract-v0*.md, docs/reference/required-work-context.md, tests/control_plane/test_context_first_read.py, tests/control_plane/test_outcome_context_navigation_cli.py):覆盖跨 Agent 依赖保留、8 种绑定失配参数化回退及 5 种不确定源回退。

3) 逐点审阅结论(架构、语义、正确性、测试、风险)

  • 架构与安全回退:严格复用既有 outcome_context 关系 owner,不按 Agent 名称或正文猜测裁剪,失配时零静默降级风险;双语 RFC 对齐。

4) 建议修改项(分 P0/P1/P2,带文件路径和行号)

  • 无阻塞项。

5) 最终结论(Verdict)

Approved — ready to merge once CI completes (exact head 4bc686fda72b8309ab9b0c0b1d299128f858c900 verified).

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

动机 / Motivation

使用通用 context-read 首读当前任务、随后依赖成果验收条件作决策的 Agent。 同一固定 capture,base 只出现 current/dependency 的 ID;head 首读直接返回两者完整正文、尾部取消条件及未知字段,independent 成果仍可从原地址完整读取。 实际 CLI 配对验证上述扩展;Goal/provider 错配、重复 ID、不完整来源与过期导航都保留原索引路线。原 capture 字节和 selected EOF 非 full-read receipt 的语义保持;39 Python 和56 TS tests 通过。 不交付整个 C1/C2、未读台账、跨宿主完整 cutover,也不声称模型已采用新增约束或长程完整成本收益已证明。

完整 C1/C2 统一 contract、跨宿主/continuity 与实际采用及完整成本资格仍在既有 RFC 中未关闭。

改动思路 / Approach

已有 acceptance owner 决定关系建议,Progressive owner 决定选读;本次复用该导航,不根据 owner_agent_id 或正文重新推断 scope。TurnEnvelope 仍提供顶层 decision 字段词汇,避免复制。 仅替换首读 selector 的归属和建议正文展开;既有 acceptance 关系 owner、capture storage、activation/Delta/receipt owner 保持。 仅压缩成果正文会丢约束;另建专用 reader/关系分类器会重复 owner。当前直接复用通用 digest-bound reader 和已有完整导航,只增加首读选择,不增加新状态或 scope 规则。 正向路径从 quota context-read --initial-read → initialContextReadPointers → immutable capture selections 进入既有 owner,current 与 peer dependency 正文/尾部/未知字段完整;新增第三方 outcome 在 fresh revision 导航匹配后同样完整交付;异常路径保留 existing generic capture reader and accepted required-read contract,这些输入在 head 和 base 均不自动展开;选读结束不形成 full-read receipt,篡改 digest 拒绝。本次完整审查当前 head,没有继承先前模板审查的通过结论。

具体改动 / Changes

7 paths +259/-94;selector 从 TurnEnvelope 搬到已有 Progressive owner,增加完整导航条件与两类真实 reader 回归,并同步双语 checkpoint/读取说明。 acceptance 提供建议;Progressive 选择已有完整对象;reader 验证 digest/分页;source receipt 和权限仍属于原 owner。 没有新状态/schema/provider/default;复用 GOAL_OUTCOMES_SCHEMA 与 OUTCOME_CONTEXT_NAVIGATION_SCHEMA。所有未知 outcome 字段随完整对象保留。

关键代码讲解

  • initialContextReadPointers:从同一 capture 选择首读正文和发现地址。 搬迁旧选择,新增完整导航严格匹配后按整个对象展开。 输入为required view + decisionFields,关键条件是Goal/Agent/Todo/outcome/provider revision、完整/loaded 来源、唯一 suggested IDs 必须匹配。错配/歧义保持 index/detail,不按 owner 或 prose 猜 scope

  • capturedContextSelection caller:保留顶层决策词汇归属。 改为向 Progressive helper 传原决策字段清单,不另建清单。 输入为immutable request.context 与既有 decision fields,关键条件是完整 admission/stop/settlement 字段继续被选择。未知 envelope/plan 仍保留完整原义务

  • read_context_capture:验证原 capture 与 selection 的 digest/分页。 本身未改;当前真实 CLI 使用同一 reader 消费新增 pointers。 输入为capture file/SHA、initial-read 及分页参数,关键条件是selected EOF 不是 full-context baseline;篡改不重新 admission。原 hash/source unavailable 路径

规格为 docs/reference/required-work-context.md,spec_revision fb16c6cb1369efce52a673030c914b38e1dac166;完整必读来源、原 SHA-bound recovery、selected EOF 不代表全部读取及不授予权限,是此变更前已有合同;C1/C2 的完整采用资格仍另行验收。

  • Required source and recovery contract:implemented。原始完整来源、必读/停止/settlement 约束与细读地址不能因首读选择丢失。 对应 initialContextReadPointers / read_context_capture;same-capture CLI checks +39 Python tests。
  • Current acceptance navigation:implemented。只消费既有 owner 的当前完整建议;不依归属/正文猜独立性。 对应 goal_acceptance source eligibility branch;bound/peer/future/unknown/mismatch cases。
  • C1/C2 parent qualification:deferred。完整统一 contract、跨 host/continuity 与实际结果/完整成本采用资格。 当前是可逆首读增量,不替代 RFC §9/§11 的完整 program acceptance。 既有 controller-executor RFC C1/C2;没有新建平行任务或关闭父目标。

对主干的风险 / Risks

最强风险是为了减少读取而把建议当授权、将 peer 依赖当成无关内容,或丢掉未知/尾部义务并错误确认完整读取。 为区分修复与无效测试,我对不可变 base/head 执行相同输入:base 有效导航仍只给 ID,不含 current/peer 正文;所有 mismatch 均走原发现路线;head 有效与新版本未来 outcome 全文可首读;错配/歧义/旧版本仍索引;捕获不变且 selected EOF 不成为完整 receipt。仅检查 should_run/枚举相同不能证明语义。我用同一捕获执行真实 CLI,比较尾部取消条件、未知字段、peer 依赖、独立细读与 full-receipt 拒绝,而不是只比较字符串长度。 独立 outcome 的正文仍从原 pointer 可恢复;新第三方建议不被 ownership 排除;mutable source/identity 或 stale revision 不能借 complete 标记通过绑定条件。

  • PASSED:seven-case real CLI base/head probe — PASS:正文真实扩展,源字节与 receipt 保持
  • PASSED:39 Python tests incl. File/SQLite CLI — PASS:39;保留 off/继承/no-hook 与恢复
  • PASSED:56 TS tests; check_rfc_bilingual.py --base fb16c6cb1369efce52a673030c914b38e1dac166 --head HEAD; git diff --check — PASS:56 TS;双语和 diff 通过

语义与 CI 对齐

复用已注册 navigation 与 outcome schema;公开 helper 名只描述 initial read,未声称实现 unread tracking、Actor 生命周期或权限。中英文新增说明逐条等义。 已运行真实 File/SQLite opt-in/继承 matrix;显式 off 继续不产生导航而完整 acceptance source 保持,Session Hook 不是 generic reader 的前提。 独立证据覆盖当前 changed invariant;远端 CI 的其他状态与合并 readiness 另行保留,没有把检查颜色当作正确性证明。 无 Session Hook 的真实 reader、File/SQLite CLI 和 TS owner 已验证;未运行模型或将 read receipt 当成理解/采用证据。完整 C1/C2 跨宿主 cutover 与 matched outcome/full-cost 验收未完成。

我的整体评价 / Verdict

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

APPROVE:当前完整 diff 是可独立交付的 justified_increment;long_horizon 为 preserved,完整必读来源、停止、权限和结算语义保持;首读可更早看到依赖条件,但后续决策采用与任务收益未在本次测量。 user_experience 为 improved,首读减少寻找当前验收正文的操作,细读/错误恢复路径继续可达;这是 CLI 信息交付改进。 检查 generic context-read 的 CLI 结果与文档;没有渲染页面或交互布局变化,visual_review not_applicable。 已有 acceptance owner 决定关系建议,Progressive owner 决定选读;本次复用该导航,不根据 owner_agent_id 或正文重新推断 scope。TurnEnvelope 仍提供顶层 decision 字段词汇,避免复制。 仅替换首读 selector 的归属和建议正文展开;既有 acceptance 关系 owner、capture storage、activation/Delta/receipt owner 保持。 已按 owner 收口 selector,同时保留 decision vocabulary 在 TurnEnvelope;更大的统一 pipeline 与 unread ledger 留在既有 C1/C2 合同。 不把本次 review 当作合并授权。

English verdict: APPROVE — b93480d7a287f9e296d68e5925c8e2c095fdf2d0; the existing initial reader adopts current complete acceptance suggestions without dropping peer constraints, changing the immutable capture, or granting authority. 39 Python tests (real File/SQLite CLI included) + 56 TS tests + seven-case base/head real-reader probe pass.

@huangruiteng
huangruiteng merged commit dc5d4ad into main Nov 2, 2026
31 of 41 checks passed
@huangruiteng
huangruiteng deleted the codex/c1-outcome-first-read branch November 2, 2026 17:17
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