Repository navigation
feat(context): prioritize related outcomes through existing capture reads - #7560
Conversation
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
loopx-agent
left a comment
There was a problem hiding this comment.
动机
未发现阻断性问题。多 Agent Goal 的一次 quota 阅读会重复携带无关 peer 的完整成果正文;本提案将当前 Agent 及已登记关联工作必须阅读的成果保留展开,其余提供当前状态索引及原 capture 的精确正文入口。判断依据是 docs/architecture/rfcs/controller-executor-unified-contract-v0.md,spec_revision ffc90182bc2a896aa9980cf24dcf23a0e3276e3d;对应 criterion_id:Review freshness and recovery、Differential context、C2。这里资格化的是原生 quota 的有界源码增量,完整 C2 跨入口迁移和真实模型收益仍由后续工作验收。
改动思路
接受这条阶段边界:读范围由既有 acceptance owner 的完整 canonical snapshot 推导,展示与权限、准入和结算分开。关联闭包复用现有 Todo relations,兼顾共享 source/evidence、共同验收和失败/陈旧观测;关系、修订、必读或指导不可靠时保留全文。Python 负责 IO、摘要校验和分页,TypeScript 负责范围及 projection。这个组合提供可直接使用和回退的阅读路径,单独改格式或只按 owner 删除正文都不能满足要求;不需要等待全部 controller/executor 改造才能评审这一片。
具体改动
本次按真实 18b879a6ab58e0e853b272960c053e0170da519d 完整 20 文件、1251 增/52 删审阅;PR 正文的 c80/19 文件说明已过时,以下结论不继承它。新增 outcome_context_projection_v0 保留原 source capture、所有 required outcomes、当前索引和精确引用,只有计入索引/指导后的完整 UTF-8 展示确实更小时才采用。完整原件先持久化,派生 required-context.json 成为其自身 full/delta/recovery 基线。--outcome-ref 的完整正文页另绑定 selection_sha256,正文/index 阅读不会建立完整上下文保留凭证。
关键代码讲解
outcomeContextReadPlan(outcome_requirements.ts:241)从一个完整工作快照构造关系闭包;自己所有成果保留,缺 work、未绑定、全 Goal 检查或未解析关系扩大为完整读取。inspectGoalAcceptance返回同次 provider revision 与 acceptance digest,没有增加状态 authority。capturedOutcomeContext(outcome_context.ts:191)验证原来源、范围与精确指导后克隆展示;canonical 输入保持原样。未知字段/未完成 required read 不被压缩,原权限、停止和 settlement identity 继续可见。project_codex_context与capture_page_range将实际交付的派生文件用于原生恢复,拒把单个 outcome 的分页当完整 capture 已读;第二次发布失败回退完整原件。full delivery 也删除了没有消费者的重复 wire 写入。
独立本地结果:306 Python 通过、49 显式 native-Codex 场景因未配置二进制跳过;25 TS 通过,额外两项真实 SQLite quota 场景通过。相同冻结输入的实际 quota context-project 在 base/head 上关闭态及未知指导态完整内容相同,开启态由完整正文变为预期 required projection;File/SQLite 新增 own/peer 成果及新关联/缺失关联反例也经真实 owner 和 CLI 补验。Ruff、完整 control-plane typecheck、标准 premerge 的 6 direct/19 selected 均通过,严格 change-quality 记录有效。未查询或等待 CI。
对主干的风险
默认 off 和显式 TurnEnvelope 沿原完整来源;开启既有 context-delivery on 会改变普通 quota 的展示,因此需要按本文档完成原生 hook 加载,并保留历史及当前恢复文件。真实 Codex 保留/压缩、安装采用、PostgreSQL 端到端和模型长程完整成本未在本次资格化;49 跳过不算通过。关联闭包只证明已登记关系,不证明任意自然语言要求独立。没有持久 authority-store 写入算法改动,File/SQLite 实路和同输入关闭态已覆盖本片;未来跨入口 cutover 仍需其原定完整验证。无 UI 组件或页面改动,本片的用户路径是现有 CLI 的开关、读取、失败回退及原件恢复,未把字节减少宣称为 token/费用或任务收益。
我的整体评价
English verdict: APPROVE — exact head 18b879a6ab58e0e853b272960c053e0170da519d。作为可回退的 native-quota 阅读增量,原 owner、真实调用方、负例和当前检查支持交付;criterion Review freshness and recovery 在此范围实现,Differential context 的真实宿主资格与完整 C2 仍延期。没有要求作者在本 PR 完成父路线图,也没有把这次批准当合并、安装或科学资格。建议同步 PR 正文的当前 revision/文件数,属于非阻断说明修正。
本次检查现有 CLI、原生 capture 与恢复入口,没有渲染页面改动;无需截图。
Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max
…eads Co-authored-by: song <liusongstep@gmail.com> Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
18b879a to
93565f6
Compare
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max
APPROVE — 未发现当前阻塞问题。 结论绑定 head 152b2e1f3d341b8ffe68496858dd3d10c7f3e005、实际 merge base 6fa2cf5a2c8d0a036678d2376218d9c18c921409。上一候选 93565f68d90e95734161659ff7afe50211a525f1 的 Ruff F401 已由这一行修复消除;原失败保留,没有改记通过。旧 18b879a6ab58e0e853b272960c053e0170da519d 的已撤销批准不覆盖此次重写。
动机 / Motivation
在多 Agent Goal 中阅读当前任务验收材料的 Agent,需要先找到关联工作、共享证据及相反观察。
旧版只能从完整成果列表自行定位;本 head 根据已登记关系建议起点,同一 owner 的无关成果不自动加入,跨越短列表的依赖仍可发现。
真实 File/SQLite CLI 返回预期建议,同时保留全部三个成果、完整 peer 正文和原 acceptance;关闭态、普通 inventory 与 signed TurnEnvelope 没有导航。
该 PR 不裁掉完整 capture,不增加必读门或成果验收,不证明模型阅读、token 节省或长期收益。
File-first #7627/C2 integration, actual model reading and complete cost/outcome benefit remain with their existing owner; this navigation slice does not complete them.
改动思路 / Approach
建议由现有 TypeScript acceptance owner 从同一次 canonical snapshot 派生;Python 只传输并在 oracle 观测改变后撤去过期建议,复用 generic reader 比专属 outcome reader 更小。
本 PR 的边界是可选原生 quota 的 advisory outcome navigation;不改成果正文、canonical state、准入、结算、默认开关或 signed TurnEnvelope。
同一个 Agent 可以拥有互不相关的任务,不应仅凭 owner 扩大建议;不同 Agent 也可能共享 source、evidence 或验收。实现遍历完整 canonical Todo 图,复用 projectRelations/todoRef 及 resume normalization,按真实关系连通工作。失败、陈旧或不完整观察会扩大注意范围,不能隐藏成果或证明其他自然语言要求独立。已有 generic reader 可按同一 capture 的精确 selector 打开任意成果,无新增配置、信息填写或确认轮次。
| 同一冻结夹具,File/SQLite 各一组 | base | 新实现 |
|---|---|---|
| 同 owner 两项独立成果 | 无导航 | 只建议选定成果,另一项完整保留 |
| 跨 40 个中间 Todo 的关联 | 无导航 | 找到 peer 成果,未依赖短列表 |
| 关系目标缺失 | 无导航 | 建议全部成果、coverage=false、limitations |
导航只说明先看哪里;完整源和已有阅读、证据、停止与验收义务继续有效。
具体改动 / Changes
规范依据为变更前 docs/reference/required-work-context.md,spec_revision 6fa2cf5a2c8d0a036678d2376218d9c18c921409。完整 Goal/验收/工作保持、依赖决策前读取所需证据及关闭态不变,在此 head 均为 implemented。对应 criterion_id:All outcomes remain in goal_acceptance_contract.(全成果保留)、Read needed evidence before a decision, verification or review that depends on it.(原来源按需展开)、Context delivery off remains unchanged.(关闭态及 ordinary inventory/signed envelope 保持)。没有删除既有 full-capture 读取义务。
关键代码讲解
outcomeContextNavigation:使用完整任务索引、共同验收及精确 source/evidence 生成建议;owner 本身不是边。coverage_complete只描述已登记关系图,不能证明模型理解或任意要求相互独立。inspectGoalAcceptance:从一次loadAuthority得到完整 contract、导航 digest 和 provider revision;未知 context agent 扩大建议并记录限制,不写入状态或新增权限 owner。inspect_goal_acceptance:host oracle 观测前复制 contract;观测改变后撤去旧建议,包括原地修改。完整已观察验收仍保留,Python 不重算关系或验收资格。
完整提案九文件 +414/-7,production +143/-7、测试 +253、文档 +18。旧方案中的专属 --outcome-ref reader 与 mandatory scope 已撤去,本次按完整当前 diff 和真实 caller 独立判断。935→152 的全 diff 只删除新增测试里未使用的 from pathlib import Path;production、断言、夹具、依赖和合同相同,以下复用有明确失效核对。
对主干的风险 / Risks
最强反例是建议悄悄变成阅读门、按 owner 隐藏共享证据,或 oracle 变化后保留陈旧建议。真实 File/SQLite 对照使用 43 个任务、三个成果:同 owner 独立、跨 40 个节点和缺失关系六场景全部符合预期,完整 acceptance/provider revision 在每臂精确不变;generic selector 能读到 peer 最终正文。关闭态、普通 inventory 和 signed TurnEnvelope 均不收到导航。专门的 adapter 负例证明原地 oracle 变化会撤去旧建议。自制夹具早期格式、描述及未绑定选择错误保留为 harness 失败,未算作 PR 回归或资格。
在935已独立完成并按上述一行差异复用:92 项 Python(含 8 个 File/SQLite、marked/unmarked、explicit/inherited native 矩阵)、configured mypy、control-plane typecheck、standard premerge(6 direct、10 catalog、8 risk、1 public,零 hold),以及六场景同输入 base/head CLI。新152重新通过实际五文件 Ruff、quick premerge(6 direct、3 catalog、1 public,零 hold)和一个真实 SQLite inherited/unmarked 的完整 CLI、peer detail、stale-oracle 恢复用例。新 head 没有重复完整未变的数据库试验。
实际隔离 PostgreSQL 16.2 的导航/acceptance/oracle/legacy/refinement/store 验证为 537 PASS、1 SKIP;该 SKIP 是缺独立 service URL 的占位项,随后在另一新临时实例上补做实际 service integration,2 PASS、0 SKIP。原首次跳过未重写为全通过;两个实例均关闭清理,没有连接活动数据库。原935 F401 为真实 introduced failure,删除 unused import 后152同命令通过,未删除测试或放宽规则。
语义与 CI 对齐
outcome_context_navigation_v1 扩展既有 acceptance 读投影;typed relations/status 与通用 selector 复用,不引入关键词/prose classifier。建议不触发 admission、验证、模型或扣额;缺关系只扩大建议,guidance 不变成 enforced obligation。默认仍关闭,开启态增加建议已披露。wait_for_ci=false,未查询或等待远端 CI。已核最新 main 0a9a3a3884490e7af2c2f27c2f2136ae738460db:acceptance/navigation owner 无变化;原生 adapter 增量是本轮另行评审的 #7628 恢复发布顺序。未把两个分支的分别测试冒充合并组合已执行。
我的整体评价 / Verdict
这是可保留、可独立验证的有界增量;当前唯一校验缺口已修复。long_horizon 保持原权限、停止、验收和恢复,user_experience 通过原入口增加可读起点且不要求额外人工工作。完整图遍历与 host snapshot copy 仍有计算成本,没有匹配模型总成本实验,不以字节、建议出现或测试数量宣称收益。兼容保留当前 storage/capture/reader,无须再引入专属协议或新任务。
视觉核验不适用:检查了 CLI native context、generic reader 与已有 App activation caller,本 diff 没有 rendered UI/layout 改动。未验范围为正式安装、模型实际阅读/理解、#7627 file-first 最终组合与 token/费用/长程收益。APPROVE 仅针对当前 exact head,后续 closeout/readiness 和任何 merge 授权分别处理。
English verdict: APPROVE for the exact head; the introduced lint failure is fixed, with unchanged functional evidence explicitly revalidated for reuse and model-benefit limits retained.
Problem and result
A native context capture can accumulate outcomes for many tasks and agents. Ownership alone is a poor reading boundary: it can force unrelated material into the current work while overlooking shared constraints and contrary evidence. This proposal helps the agent choose where to begin without turning relationship metadata into a new reading or acceptance gate.
The existing acceptance owner now supplies optional outcome navigation for the selected work. All original outcomes, criteria and evidence stay in the same captured source. The agent can inspect relevant details through the existing generic
quota context-read --selectpath; the generic field index from #7627 adds discovery. A suggestion is not proof that other material is irrelevant or that the model has read it.Design and scope
off, ordinary acceptance inventory and the signed TurnEnvelope keep their existing behavior.This replaces the earlier PR's mandatory read-scope and specialized
--outcome-reftransport. It retains the original contribution's useful relationship-based discovery while aligning with autonomous progressive reading.outcome_context_navigation_v1is an optional acceptance projection, not persisted authority. Original contributor attribution is retained in the commit.Relationship to file-first context delivery
#7627 saves exact full/baseline/delta files and returns a compact discovery manifest instead of eagerly printing their bodies. This PR complements that path by suggesting useful acceptance material inside the saved source. It does not itself shrink the full source or prove lower token cost, better outcomes or completeness of model reading. Compaction, file baselines, admission and settlement semantics remain owned by the existing context lifecycle.
Validation
Limits and rollback
Registered relationships guide exploration; they cannot prove independence of arbitrary natural-language obligations. Goal intent, required criteria, permissions, stops and verification obligations still apply. Accepted outcomes and full model request costs require a separately matched experiment.
This is a reversible optional read projection. Disable context delivery through the existing control or revert the change; canonical acceptance data and existing reader compatibility remain intact. No installed-host adoption or benchmark benefit is claimed by source validation alone.
Exact-head validation update
Head
152b2e1f3d341b8ffe68496858dd3d10c7f3e005removes one unusedPathimport reported by independent review. Compared with93565f68d90e95734161659ff7afe50211a525f1, production code is unchanged. Changed-file Ruff and standard premerge were rerun on this head and passed. The earlier Ruff F401 remains a recorded failure, now repaired; earlier functional and PostgreSQL evidence above is from the unchanged implementation revision. Independent final review and merge readiness remain pending.