Repository navigation
fix(context): scope acceptance reads to selected work - #6959
loopx-agent wants to merge 1 commit into
Conversation
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
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
在包含多个任务和多个负责人验收要求的 Goal 中,读取当前任务上下文并继续执行的 Agent 与操作者。
原先每个当前任务都收到全 Goal 的任务验收观测,重复携带其他任务的数据。当前提交只读取所选任务的观测,仍保留所有负责人的累计 Goal 要求、所选任务全文和未读 Goal 原文。
同一份 File/SQLite 规范状态的四组对照从 33 个任务观测缩到 1 个;实际 DSH 子进程仍收到完整 Goal 要求与所选任务尾部的停止条件,默认详细查询保持原样。
本次只资格化源码上下文读取,不宣称模型已采纳、整体 token 或延迟收益、安装态统一或完整 M7.4 已完成。
这里的收益是减少可确定推导的重复观测,同时把完整要求送到真实调用者。不是只证明 JSON 变小:另一个负责人的累计成果要求、所选任务末尾停止条件、原始 Goal 的必读入口和源丢失拒绝都要保留。验收观测缩到当前任务,也不意味着该 Agent 可以把其他负责人承接的 Goal 要求从总依据中删除。
M7.4 的完整 heartbeat/Turn 安装态采用和模型决策、总成本资格仍开放;既有前端红项继续保留独立质量限制。
改动思路
使用验收 owner 已有的精确 Todo 选择,并在同一私有读回中省略另有完整载体的重复正文,比另造角色过滤器、标题裁剪或提高传输上限更直接;完整 Goal 要求与默认详细接口继续由现有 owner 保留。
本 PR 的合理边界是既有上下文适配器的一次精确验收读取及私有传输投影;它没有改变验收资格、任务选择、原始 Goal 阅读义务或任何执行权限。
完整正文已由现有工作上下文或精确 detail 载体提供。若给新精确验收查询直接套用默认详细模式,会把同一长正文再传一次,因此私有调用选择不传重复的 todo/completion_requirements,公开详细查询的默认值仍是 true。这是同一个 owner 的两个投影用途,不是新状态、第二套验收规则或用户新配置。
操作者继续原有任务工作流,无需重新陈述已知信息、选择新模式、复制命令或确认摘要。既有上下文/验收设置和详情入口保留,源失败继续给原有恢复读回;本次没有新增用户操作、设置或首屏。实际既有 CLI/DSH 路径的内容读回和失败恢复已验证,未以“内部改动”为由忽略最终消费者。
| 需要保留的内容 | 改动前 | 当前同源观察 |
|---|---|---|
| 当前任务验收观测 | 同时传入33个任务 | 只传当前1个 |
| Goal 累计要求 | 两个负责人完整要求 | 完整保留,逐字段比较一致 |
| 当前长任务全文/停止条件 | 另有完整工作载体 | 继续保留,DSH 实际输入可见 |
| 默认详细查询 | 完整任务与验收详情 | 默认输出不变 |
| 原 Goal 源丢失 | 必读未完成,阻止依赖执行 | 同一拒绝与恢复路径保留 |
表格对应同一份规范状态的实际 native File/SQLite 与 DSH 观察,不证明模型理解或决策采用。
具体改动
对应 head 3bd3945,实际共同基线 b9e60c5。完整9个文件、+240/-9;生产3个文件+18/-6,测试3个文件+194/-3,文档3个文件+28。没有新增模块、CLI 参数、公共 schema 版本、store 或验收决策 owner;对既有 TypeScript owner 作小范围投影修改,Python 仍承担原适配 IO。
关键代码讲解
_source_content(goal_acceptance)把已经选定的todo_id传给现有验收查询,并仅在这条上下文读取中使用include_work_details=False。它不通过角色、正文或标题过滤,更不会剪裁 Goal Markdown 来推断意图。未读 Goal 原文仍留在required_reads。inspect_goal_acceptance的新私有参数默认 true,仅在 false 时携带省略请求;既有observe_goal_acceptance_oracles仍处理完整 contract。公开 CLI、其他详细调用者和已有验收/生命周期 owner 不因此换一套规则。inspectGoalAcceptance复用规范 store 中已有的精确 Todo 筛选,保持同一 GoalRef 和 authority revision。只省掉重复的 work details,projectGoalAcceptance继续投影完整累计 Goal 合同。四组基线/head 同源比较保留了其他负责人的要求与详细默认输出。- 私有 inspect 请求处理 验证这个字段必须是 boolean,缺省仍走原 true 语义,没有另加版本选择、角色启发式或宽松异常 fallback。超大任务的完整尾部由原工作载体保留,同时不会在该私有 RPC 中制造第二份超过传输大小的正文。
原始规范使用改动前的 required-work-context.md,spec_revision=b9e60c59f3c367a63755d97f4595d9c2eef91947;同时核对同一固定提交的 effect-interpreter RFC。本 PR 新文档与 checkpoint 是被审查内容,不能当作自身符合性的独立依据:
- Required work context:本次实现并验证所选任务观测精确化,保留完整累计依据、正文、User 义务、revision 和 Goal 必读;缺源仍阻止执行,内容读取不增加授权。
- Adopt one typed projection in real host renderers:本次提供这条原生上下文读取的实际增量;完整 heartbeat/Turn、packaged App、重入、late results 等迁移资格继续由既有 M7.4 stream 承接。
- Qualify the context shape and migration default:仍开放。四组相同输入中,验收源从7455/7467降至1929/1941个 UTF-8 字节,另两组从12571/12583降至3141/3153;分别减少5526或9430字节。这是受控内容测量,不是模型 token、总 IO、延迟、资源或决策质量证明,没有借此调高预算或修改迁移默认值。
对主干的风险
65项聚焦 native File/SQLite 测试通过,覆盖原 quota/context、所选工作要求、宿主上下文、决策捕获和验收 CLI/runtime。107项 TypeScript 验收 authority/runtime/oracle/legacy receipt 测试通过,23项既有 PostgreSQL 集成项跳过。本 PR 未改变 PostgreSQL authority store;这些跳过不冒充 PostgreSQL 资格,也不宣称它们通过。
独立对照固定同一份规范状态和 native 捕获,分别运行真正的基线与当前 source producer,再经真实 DSH 子进程检查签名输入与实际 prompt。四组33任务/两负责人输入保持完整 Goal contract;除有意选定的任务观测行外,其余验收内容逐字段一致,默认详细查询也相同。所选长正文的停止尾部和全文 Goal 必读保留;篡改其他负责人要求在 provider 前被拒绝。测试未启动模型或增加真实 Goal 的准入/spend。
把当前四项独立选择断言放到不可变基线,均在“33个任务而不是当前1个”的语义断言失败;不是依赖或 fixture 启动错误。当前相同断言通过。另以未改断言验证原有 source-loss/恢复用例,基线3项也通过:本 PR 将原测试中的不健康源退出码期望修正为原生已有的1,并继续要求 ok=false、status_health_ok=false、delivery disallowed、pending 必读与恢复。这没有放宽源失败门禁。两项超过私有传输大小的完整任务正文用例通过,证明不重复搬正文的边界。
standard canary 的6项直接检查、5项 catalog、8项风险 smoke 和1项公私边界检查通过,整体 exit0;双语 RFC 差异、语义词表与相关 Todo/状态投影回归均执行。未查询、轮询或等待 GitHub CI。
必跑前端命令 node apps/presentation/dashboard/src/features/personal-workspace/personal-workspace-contract.test.mjs 仍有既存红项:实际基线和当前 head 都 exit7,完整错误仅替换 checkout 根路径后相同,仍是 line378 的 “Personal workspace prefers the registered Goal display name”。测试和读取的 dashboard-page.tsx 字节一致,其因果路径不经过本次 source adapter/验收投影。因此 review 可独立归因为既存问题,仍保留其质量/合并限制,没有放松断言或把红项说成通过。
语义与 CI 对齐
当前变化按已有精确身份选择,不靠 prose、子串、Agent 名称或显示上限判断验收。累计 contract 中其他负责人要求没有因观测被限定而消失;source absence 也不能解释为不存在要求。完整正文/User/Goal 原读义务的 actor、先后、证据来源、停止和权限条件仍在同一内容链上。私有 boolean 是投影选项,不是可选遵守验收的开关;所有既有详细调用者保留原默认值。
这是有界整理:删除上下文路径里原来过宽的读取,直接复用 typed owner 的 exact selection;没有增加第二个 writer、缓存、DSL 或角色过滤器。相关兄弟记忆接线、工作证据分类和父里程碑安装态资格保持各自判断,不由这次 payload 变化自动完成。
我的整体评价
APPROVE,当前 head 没有阻塞发现。 这是可审查且范围相称的 justified_increment:减少确定冗余的同时,在实际 native 后端和宿主输入保留独立完整依据;既有详情、缺源拒绝与恢复没有被摘要替代。long_horizon=preserved 指任务要求与原责任保持,不代表已证明后续模型更有效率。
M7.4 的完整 heartbeat/Turn 安装态采用和模型决策、总成本资格仍开放;既有前端红项继续保留独立质量限制。
当前交付足以作为独立源码改进,不需为父里程碑远期项目另加本 PR 阻塞;后续仍按既有验收资格化。author-owned COMMENTED 不是 GitHub 的正式自批准,也不是 dismissal 或 merge 授权。既存红项与当前 merge readiness 需要单独读回。
English verdict: APPROVE at 3bd3945b8024865fc50e7a04753bd49e4fce0c91. The existing acceptance owner now scopes observations to selected work while preserving the full Goal basis, complete content carriers and default detailed inspection. Native File/SQLite, actual DSH and immutable-base counterexamples support the bounded source change. Keep the unrelated frontend/quality hold and unqualified installed/model/overall-cost acceptance separate.
Goal And Delivered Outcome
Selected-work Heartbeat/quota and Turn context still read every Goal task's acceptance-binding observation. The selected Todo then arrived through its own full source as well. This made an unrelated task inventory part of every execution context.
The IO adapter now passes the admitted Todo to the existing TypeScript acceptance inspector. That owner omits duplicate work details before RPC serialization, so a large Todo does not cross the bounded acceptance RPC unnecessarily. The complete Goal contract, configured scope, criteria, held work, cumulative outcomes and source revisions remain intact.
main; reviewed baseb9e60c59f3c367a63755d97f4595d9c2eef91947.Author Declaration
docs/reference/required-work-context.mdanddocs/architecture/rfcs/agent-loop-effect-interpreter-v0.md, at the base above.Scope And Continuation
This completes the selected acceptance-context IO slice. Todo-less reads, explicit full inspection and ordinary detailed completion reads keep their existing behavior. The new private Boolean affects read detail only; it grants no execution authority and preserves unbound/held observations.
The bounded refactoring pass reuses the current inspector and suppresses duplicate data in its existing owner. No module, configuration, frontend entrypoint or migration default is added. Real model outcomes, complete Turn costs and installed App/Lark adoption remain under the existing convergence work.
Validation
3bd3945b8024865fc50e7a04753bd49e4fce0c91.personal-workspace-contract.test.mjs: same display-name assertion and test blob, exit 7 on immutable base and head; no waiverThe existing source-loss test incorrectly required a successful CLI exit after the registered Goal source became unhealthy. It now requires the nonzero exit and unhealthy status, while retaining delivery refusal, pending full-read and recovery assertions. Original failures remain recorded.
The envelope's existing 8 KiB diagnostic remains exceeded in these rich fixtures; its limit and warning are unchanged. Reduced binding bytes do not qualify overall efficiency or migration defaults.
Visual Evidence
Not applicable: no UI or first-screen change. Packaged evidence exercises the CLI/backend context path with protocol providers, not live model or installed application adoption.
Public Boundary And DCO
Only product code, focused reusable tests and paired contract checkpoints are included. No private Goal material, local paths, credentials, raw logs or generated assets. Commit is signed off. No merge, installation or release is performed.