Skip to content

fix(context): accept parent pointers directly after --list - #8597

Merged
huangruiteng merged 3 commits into
mainfrom
codex/trajectory-context-navigation-20261111
Nov 13, 2026
Merged

huangruiteng merged 3 commits into
mainfrom
codex/trajectory-context-navigation-20261111

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

quota context-read --list /interaction_contract currently fails argument parsing. Callers must discover that indexing a parent requires a separate --select flag before retrying. Accept an optional exact JSON Pointer after --list by normalizing it to the existing index/selection arguments. Bare --list, repeated selectors, paging and digest checks retain their existing behavior.

  • Outcome basis: reproducible CLI ergonomics defect; no written specification, the request in this PR is the basis.
  • Intended base: main, implementation baseline 8e8a60df0fe6432483f1b41c3635909966b5d937.
  • Result: the formerly rejected parent-index command returns the same index and digest as --list --select POINTER in one invocation.

Author Declaration

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

Implemented against

Existing RFC 6901 selection, bounded page and source-digest contracts documented in docs/guides/context-delivery.md at the baseline above.

Criterion Disposition Symbol / path Test
Optional index target reuses existing selection implemented _ListContextFields in quota registration real CLI shorthand/explicit parity, mixed selectors
Exact pointer semantics and private body isolation implemented unchanged typed reader escaped names, empty root, / empty-name property, missing target
Digest-pinned bounded paging and no authority discovery implemented unchanged capture reader paged continuation, registry-independent and reference-reader suites

Scope And Continuation

Complete within the parent-index syntax scope. Python owns argument adaptation; the TypeScript selector, authority, retention observations and recovery rules are unchanged. Bilingual operator guidance and installed self-repair guidance explain exact parent/root syntax. No new domain contract, cache or provider path. This removes a reproducible failed invocation, not a claim of measured end-to-end model efficiency or task-quality uplift.

Validation

  • Tested revision: 6be0e64f4 (tests ran against the same behavior; the final annotation-only change passed mypy).
  • Run state: finished.
  • Input classes: synthetic, public_fixture.
Check kind Result Public-safe evidence / limitation
regression_parity passed New real-CLI regression fails before the change and passes after; shorthand and explicit forms return equal pages/digests.
real_entrypoint / integration passed python -m pytest -q tests/control_plane/test_context_capture_selection.py tests/control_plane/test_context_capture_registry_independence.py tests/control_plane/test_context_read_reference.py: 163 passed. Isolated process temporary directory; no active Goal mutations.
static passed Focused Ruff and mypy; git diff --check; five-file loopx check with an empty synthetic registry. Boundary scan has no errors; its only warning is the intentionally absent runtime directory.
static passed Bilingual RFC check; no paired RFC changed.

No provider, model, frontend or production-runtime throughput change is claimed. PostgreSQL qualification is not applicable to this argument-only reader change.

Frontend / Visual Evidence

  • UI impact: none. CLI help and guide text only; no visual surface or first viewport changed.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Control plane (CLI context reader)

Shared-authority RFC fixture impact

N/A: no authority, storage, promotion or compatibility-projection behavior changes.

Boundary Checklist

  • No private state, credentials, raw trajectories, internal links or local machine paths in the diff or PR.
  • Scoped to the reproduced parent-index command; no duplicate benchmark work.
  • No paired RFC or visual surface changed.
  • Commit includes a DCO sign-off.

Signed-off-by: huangruiteng <huangrt01@163.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

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 · max

本次评审对应提交 6be0e64f4f1e7a926d37c90b2301ee42427b50f4。

[P2] 保留前置裸 --list 的读取方式。 已有合法命令把裸 --list 放在 context-read 之前时,argparse 会把命令名当成指针;基线返回根目录,新提交报“--list is only supported by context-read”,连目录都读不到。 选项注册

动机 / Motivation

排查当前工作上下文的开发者和 Agent,常需要在同一份已固定摘要的捕获里快速定位字段。想找字段所在的父节点,操作者知道指针却必须另外加 --select;直接写 --list /interaction_contract 会报未知参数。新写法成功返回与 --list --select 相同的指针、摘要和索引,不返回字段正文。新写法走通,普通顺序与显式选择结果一致。本轮只验证读取语法、结果及恢复边界;不由索引推出模型已读、授权变化或端到端成本收益。原来可用的前置裸 --list 仍需兼容。

改动思路 / Approach

继续复用已有选择器、索引和摘要校验,不新增 reader 或运行时状态。问题局限在 CLI 选项归一化;应在这里区分指针与子命令。 让 --list 的新写法产生与原有 --select 相同的参数;目录、内容和摘要仍由原 reader 处理。CLI 只须识别真正的指针,不能把原有命令位置也当作值。

具体改动 / Changes

关键代码讲解

以 docs/reference/required-work-context.md @ 8e8a60d 为准:PARENT-INDEX 与 POINTER-DIGEST 已验证;BARE-LIST-COMPAT 未满足。参数适配 把可选值加入原 selector;注册位置 用 nargs=? 取值。现有测试 验证命令名在前时的简写、转义、混合选择和空名称。英中指南与诊断指引继续区分根、空名称字段和缺失路径,不改变读前要求。索引分页沿用原始 capture 的完整摘要和字节游标,不读取正文。

对主干的风险 / Risks

相同 capture 和 SHA 下,旧版执行 quota --list context-read --capture-file CAPTURE --capture-sha256 SHA,返回根索引;新提交报错且没有内容。把 context-read 挪回前面或在两者间加入其他选项,同一提交又可读取。原因是裸选项现在吞掉子命令,默认退到 status 后被拒绝。

语义与 CI 对齐

真实 CLI 与 Effect 对照确认新简写的索引和摘要与旧显式写法相同;无字段正文,错误摘要拒绝。163 项 head 和 154 项基线用例通过;独立的旧参数顺序用例失败。diff、DCO 和双语检查通过,未查询托管 CI。

我的整体评价 / Verdict

可保留新的 parent 简写。请让裸 --list 在既有位置仍走原命令,并补前置、后置及多指针对照;无需变更 reader 或持久状态。本次只涉及 CLI 和操作说明,没有渲染界面改动。未验证真实模型消费或生产安装。

English verdict: REQUEST_CHANGES. At 6be0e64: the shorthand works, but bare --list before context-read now consumes the existing action. Preserve legacy order and rerun both forms.

…-8597-review-repair-20261113

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

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 · max

本次评审对应提交 560a07e0d5d6ede0ad6af2a8af53f46ef62c360c。

动机 / Motivation

从同一捕获定位当前上下文的 CLI 操作者与 Agent。以前需要 --list --select POINTER 才能列出父节点。旧审阅提交加入简写时,前置裸 --list 吞掉 context-read,使原本合法的根索引失败。当前提交让简写复用原索引,并恢复前置、后置、重复裸 --list 的行为。普通和完整 CLI 都返回相同的根索引,原摘要和分页保持。验证覆盖 macOS 两个真实 CLI 入口、合成捕获和固定摘要。未验证生产安装、托管 CI、模型阅读采用或端到端成本收益。

改动思路 / Approach

两个 CLI 入口共用小段参数转换;不另写 reader。只处理 quota argv;原捕获、权限和续页不变。 明确的指针才转换,裸 --list 仍是布尔项。这样不会把 context-read 当成值。

具体改动 / Changes

关键代码讲解

  1. 参数适配 只把明确的空根、斜线和等号简写交给已有 selector。
  2. 两条入口 共用这一转换;回归用例 保住旧根索引。
  3. 原阻塞 已按原输入验证:旧 head 6be0e64f4f1e7a926d37c90b2301ee42427b50f4 在两条入口均失败,当前 base 与新 head 的根索引一致。显式空字符串仍代表根,而斜线指向真实存在的空名称属性。

按 docs/reference/required-work-context.md 的 56fc2a1e8d3101a4a909b45b32bbdd32d54ab56f 版核对 PARENT-INDEX、POINTER-DIGEST、BARE-LIST-COMPAT,均满足。

对主干的风险 / Risks

显式与简写各沿生成的续读命令读取 8 页,重建字节一致的索引。错误摘要、未知指针和非 reader 动作均拒绝,无正文或 authority 写入。

语义与 CI 对齐

定向套件在 base 通过 154 项、head 通过 165 项;6 项直接与 19 项选定 premerge 检查通过。英中指南与诊断仍要求从同一捕获续读,索引不证明正文已读。

我的整体评价 / Verdict

APPROVE。原命令顺序的阻塞已修复,父节点简写和原读回契约都可用。本次评审覆盖现有宿主与 CLI 行为。验证覆盖 macOS 两个真实 CLI 入口、合成捕获和固定摘要。未验证生产安装、托管 CI、模型阅读采用或端到端成本收益。

English verdict: APPROVE. The reviewed head restores the original bare --list ordering and provides equivalent digest-bound parent indexing without changing authority or retention.

@huangruiteng
huangruiteng merged commit 4d474e3 into main Nov 13, 2026
33 of 38 checks passed
@huangruiteng
huangruiteng deleted the codex/trajectory-context-navigation-20261111 branch November 13, 2026 06: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