Repository navigation
test(context): qualify delegation agenda through the console entrypoint - #7907
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 | model=gpt-6.1-sol | provider=OpenAI | runtime_reported | reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
在源码检出中核验委托提醒及其恢复路径的维护者和 Agent。 旧测试从仓库目录运行 Python 模块,继承错误包路径时也可能通过;新测试从临时项目调用该环境真实的 loopx 控制台,显式绑定检出并验证两轮提醒与恢复结果。 真实控制台在继承合成影子包时失败,正确绑定后 File/SQLite 的两轮提醒与恢复可读回,原协作收据字节不变。 不改变生产协作、调度或安装版本,不认证已安装宿主采用、Windows 控制台或长期净收益。
改动思路 / Approach
保留现有完整 delegation journey,将它的 guard 与 recovery 两处调用一起转到测试内 run_console。已有 canary_harness.run_json_cli_result 明确提供 module-mode,它的其他 caller 没有必要全部改成 console。这个十行 IO 适配只负责 argv、局部环境、超时和 JSON,不重复 quota、委托或捕获语义。自修复先区分来源 shadowing 与实际安装漂移,仍保留原安装授权/canary 边界。
具体改动 / Changes
完整审查 b3b89944b501fd55ac49cbb2640e2c830b8d490a 相对实际共同基线 6e947c79fdbe86ba5de460fd1b0acaed91a8ae06 的四文件、+45/-6;生产目录 diff 为空。规范 spec_ref=docs/development/testing-and-quality.md,spec_revision=6e947c79fdbe86ba5de460fd1b0acaed91a8ae06,修改前 Local Validation Environment 与 Refactor Real-Path Gate 分别要求来源一致及真实入口反例,两项均 implemented,不用这次新增说明自证。
run_console选择当前环境 scripts 目录中的真实控制台,在临时项目目录运行,并只给该子进程绑定当前 checkout。test_actual_cli_guards_and_host_envelopes_preserve_the_agenda保留 File/SQLite、host envelope/native files、两轮、冷/暖恢复及原收据字节不变的断言;done artifact 仍不能结清未回传答案。- 两份 self-repair 引用沿原 SKILL/安装路径可达,指导只改变来源诊断分支,不把源码验证改成全局安装或共享服务重启。
对主干的风险 / Risks
独立执行三整个 owning 模块 111 Python PASS、Ruff 和标准 premerge(5 direct、12 selected)通过;不可变 base 的原两模块 26 PASS。另在两版分别复现同一影子包下 module 从仓库启动成功、真实 console 从仓库外失败、显式绑定 console 恢复成功;这说明版本号或 module import 不能单独证明另一个进程的来源。
在私有内存中仅去掉新增 source binding,再运行相同真实 console、File/SQLite 与原两轮语义 fixture:两例都以 wrong source checkout 失败,固定绑定两例都通过。作者源码未改,反例能够区分错误实现;完整 owning suite 另覆盖 native-file 冷/暖读取。已有 generic helper 保留其他 caller 的原模式,未删除失败、回传或收据断言。
当前 main 的相关 roundtrip 变化只优化 source-history route hints/fallback,未改变本补丁的进程启动边界;未宣称合并后或已安装 qualification。没有查询、轮询或等待 CI。Windows console、本机安装采用和模型理解未在本轮验证,不能从这些通过结果推断长期收益。
我的整体评价 / Verdict
APPROVE;未发现当前完整提案的新增阻塞缺陷。 它补的是现有有用验收的实际入口,源码绑定、错误信号和业务语义一起验证,边界完整且可单独回滚。Applied:复用原 journey 和 skill 引用,仅为不同进程模式保留局部适配;无需另造测试框架或修改生产 owner。完整四文件只改变测试进程和开发/自修复说明,没有渲染页、布局、首屏或控件变化;实际检查了控制台 guard 与恢复读回。 真实已安装客户端、模型采用和长期净收益未验证;本 diff 没有渲染页面变化。 没有额外用户准备、确认或安装轮次;安装/采用仍沿原有授权单独判断。同账号按 COMMENTED 记录批准结论,不代表正式自批准或合并权限。
English verdict: APPROVE — exact head b3b89944b501fd55ac49cbb2640e2c830b8d490a; independent real-console, File/SQLite, recovery and source-sensitivity evidence covers this qualification slice. Installed-host adoption and Windows execution remain unverified.
Goal And Delivered Outcome
A checkout-level
python -m loopx.clitest can import the intended source while the environment's realloopxconsole still imports an older package through inheritedPYTHONPATH. This can make the unfinished-delegation agenda from #7857 appear absent during source qualification.The existing delegation integration journey now runs the real console from its disposable project directory and explicitly binds the checkout. A synthetic shadow package makes the journey fail if it inherits the wrong source. The existing File/SQLite, host-envelope/native-file, two-Turn, cold/warm recovery and unchanged-receipt assertions remain in place. Bilingual developer guidance and the existing self-repair routes explain the distinction.
main.model_agent.Implemented against
Specification:
AGENTS.mdanddocs/development/testing-and-quality.mdat6e947c79fdbe86ba5de460fd1b0acaed91a8ae06, source-checkout entrypoints and real-path qualification.Scope And Continuation
Complete within this source-qualification slice. The test-local subprocess function owns the console/environment/error boundary and is shared by guard and recovery reads; the generic module-mode canary helper remains available to its other callers. No production schema, provider selection or runtime behavior changes.
Packaged/installed App adoption, the broader delegation-list journey and latency qualification remain separate existing work. This PR does not claim those outcomes or close them. Its test/docs-only boundary is independently reviewable and reversible.
Validation
b3b89944b501fd55ac49cbb2640e2c830b8d490a.finished.synthetic,public_fixture.real_entrypoint,real_backend,regression_paritypassedenv -u PYTHONPATH uv run --extra test python -m pytest -q tests/test_delegation_turn_context.py tests/control_plane/test_context_first_read.py: 26 passed. Isolated File/SQLite (Node 24.21.0, SQLite 3.53.4); real console in all four provider/delivery combinations.regression_paritypassedstaticpassedintegrationpassedmanualnot_runFrontend / Visual Evidence
none; no product viewport or documentation chrome changes.Boundary Checklist