Repository navigation
test(explore): reconcile the archive linkage guard with the capped sqlite projection - #8136
Conversation
…lite projection Signed-off-by: Weimr2627 <134630546+Weimr2627@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max.
动机 / Motivation
维护 Explore 证据关联的贡献者会遇到一个重复失败的公共验证。
SQLite 已采用有界归档投影,正文留下查询指针;旧 smoke 却仍要求内联重复证据引用,导致真实数据仍可读时验证提前失败。
这次修复使既有 File 与 SQLite 两条归档验证都能完成,同时继续核实归档后的原始证据引用。
边界是修复一个现有验证消费者,不改生产投影、不恢复大块内联归档,也不证明整套 nightly 或长期收益。
改动思路 / Approach
没有阻塞问题,另有一项可直接收紧的 P3 断言建议。先读了原始 #1819 的关联保持契约、#8134 的问题与补充,以及不可变基线上的投影 owner,再判断补丁。源码明确把 SQLite 归档显示与 canonical record 分开:有界显示只留指针,完整记录仍由正常 Todo 读回提供;File 保持原内联断言。因此,仅调整这个既有 smoke 比扩大生产投影或删除归档检查更合适。
独立执行了指针中给出的 todo list --goal-id … --include-archived 查询,真实 SQLite 返回一个归档记录和原来的两项 Explore 引用。这里的断言不是用 pointer 存在代替数据存续,也没有把显示文件变成权威。现有 provider 投影、完整归档读取和 durable-link 测试分别保护相邻边界,未发现需要新增另一个 smoke 的理由。
具体改动 / Changes
准确 head 为 24ccac82d00ced2bedb53e72236f2b2aac091713,完整 diff 仅 examples/explore-todo-result-node-linkage-smoke.py +18/-1;没有生产或 fixture 改动。
spec_ref 为 https://github.com/loopx-project/loopx/issues/1819,spec_revision 为 a4370d644af3932b8c6aef62f8d161aed709dfc9,表示本次判断所核对的既有实现基线。原 issue 无条款编号,以下仅作映射:LINK-PRESERVE 保留 add、complete、archive、update/clear 后的显式引用;LINK-EXPLICIT 保留未知/反驳节点诊断和无关联任务原行为;LINK-NO-EFFECT 保留 diagnostic-only、零分数调整及不启动 Agent、不取得 claim/lease、不改 quota。这三项均由完整 smoke 的真实 CLI 生命周期和末尾 planner 断言通过。
关键内容讲解
SQLite 分支在 check_todo_lifecycle 中找到带当前 Goal 的唯一指针,核对计数和完整查询文本;File 分支继续要求内联 token。后面的 canonical Todo 读回仍要求 archive 状态和完整原引用,原有 clear 与 planner 诊断也继续执行。对已有 smoke 的这一个消费者做修复,保留了可单独回退和复现的边界。
对主干的风险 / Risks
P3:计数应匹配完整 token。 第 183 行用 "archived_count=1" in pointer[0],也会接受 archived_count=10。我在真实 CLI 完成归档后,只改动其临时显示文件的计数,整条 SQLite smoke 仍通过;改成 7 则被拒绝。建议匹配带字段边界的 token 或解析属性,并加入 10 的反例。这是新增的次要计数保护不够精确,不是已发现的 canonical 数据损坏;实际指针查询和引用保持均独立通过,故不作为本次合并阻塞。
PASS:准确基线的完整 smoke 在旧 SQLite 内联断言失败,当前 head 的 File/SQLite 全流程通过;独立跟随真实指针查询成功。临时投影中的缺失当前 Goal 指针、错误查询、File 引用缺失和计数 7 四个反例均被相应断言拒绝,未修改生产或活动 Goal。编译、diff hygiene、scoped CQR 与 quick premerge 通过。
原始 maintainability 检查仍 FAIL,完整 base/head JSON 仅去掉 checkout 路径后相同,保留既有 62/60 decision-points 失败;没有放宽阈值。没有查询、轮询或等待 CI。作者的历史 nightly 数字没有作为本次独立验收证据。
我的整体评价 / Verdict
goal_achieved 仅指这个可复现的 smoke 消费者漂移;long_horizon 为 preserved,现有证据关联、诊断与权限边界保留;user_experience 为 improved,贡献者可以完成原有验证,无新增配置或人工交互。P3 计数前缀漏检明确保留,推荐顺手收紧,未把它写成完整的计数敏感性通过。
这是对已有 322 行 smoke 的局部更新,没有新建临时 builder 或重复生命周期测试。视觉检查不适用:没有页面、布局或产品显示改动;未验证范围是其余 nightly、线上宿主采用和完整长期成本。批准与合并、安装、发布权限分开。
English verdict: APPROVE — 24ccac8 repairs a reproduced smoke-consumer mismatch while preserving File/SQLite linkage and diagnostics. Real pointer readback and negative controls pass. Tighten the nonblocking P3 count-prefix assertion; the independently matched ratchet failure remains failed.
| and f"goal_id={GOAL_ID}" in line | ||
| ] | ||
| assert len(pointer) == 1, archived | ||
| assert "archived_count=1" in pointer[0], pointer[0] |
There was a problem hiding this comment.
[P3] 请让归档计数匹配完整字段:"archived_count=1" 也会命中 archived_count=10。在真实 CLI 完成归档后,只将其临时投影中的计数从 1 改为 10,整条 SQLite smoke 仍通过;改为 7 则被此行拒绝。建议解析属性或匹配字段边界,并补充 10 的反例。实际 canonical 引用与指针查询均已独立通过,此项是非阻塞的测试敏感性建议。
Goal And Delivered Outcome
feat(control-plane): sqlite_v0 bounded active view projection, in-transaction auto-archive…, merged2026-11-02T18:20:05Z).examples/explore-todo-result-node-linkage-smoke.pyfails deterministically onmain.#7834capped the inlinesqlite_v0archive rows and replaced them with a pointer that names the readback (query="loopx todo list --goal-id <goal-id> --include-archived"), and it changedloopx/control_plane/todos/machine_section_projection.pyby +377/−5 without touching this shipped smoke. The smoke still demanded the pre-feat(control-plane): sqlite_v0 bounded active view projection, in-transaction auto-archive, and goal-scoped stale_source_registry #7834 inline repetition, so one consumer was left behind while the guarantee it protects still holds through the readback.sqlitearm raises at the inline-token assertion; after, bothfileandsqlitearms pass and thesqlitearm asserts the pointer (archived_count=1and the goal-scoped--include-archivedquery) instead. Proven by thesmokerow and the mutation rows below.loopx-project/loopx:main.Onset evidence, not guesswork
41356265689(2026-11-01T22:16:06Z)41557935873(2026-11-03T01:10:15Z) and41740364791#7834; this smoke got no commit in the window4d8b79692d13ea17a43d2369d35282b023be311eAuthor Declaration
Implemented against
loopx/control_plane/todos/machine_section_projection.pyformat_sqlite_archive_pointer_comment()at4d8b79692d13ea17a43d2369d35282b023be311e, as introduced by merged#7834; the linkage guarantee recorded in Explore planner: add explicit todo-to-result-node linkage before typed evidence scoring #1819.todo archive-completedunderfileauthorityexamples/explore-todo-result-node-linkage-smoke.py:189sqlite_v0through the pointer the projection emits:172-187:185explore_result_node_refs:193-194loopx/control_plane/todos/machine_section_projection.py#7834is the only in-window change to the projection, confirmed#8013's diff on that file is typing/castonly (+4/−3) so it is not already repairing this, and left the assertion order untouched elsewhere. Each new guard was poisoned once and every poison was caught (rows below); the file was restored byte-identical after each run. No production behavior, fixture data or provider semantics were changed.Scope And Continuation
sqlite_v0should still render archived rows inline — is a projection decision and stays with maintainers; if they rule the other way, this smoke change should be reverted rather than the projection kept.Validation
24ccac82d00ced2bedb53e72236f2b2aac091713integrationpassedPYTHONUTF8=1 python examples/explore-todo-result-node-linkage-smoke.py→explore-todo-result-node-linkage-smoke ok, bothfileandsqlitearms.regression_paritypassed4d8b79692d1the same command fails at the inline-token assertion (two local reruns, same line) and nightly records show green2026-11-01, red from2026-11-03; thefilearm passes on base, which is the positive control that the drop issqlite_v0-specific.regression_paritypassedarchived_count=1→7(line 183),len(pointer)==1→5(182), the readbackquerytoken (185), and thefilearm inline token (189). No poison survived, so no guard here is vacuous.staticpassedpython -m py_compile;git diff --check.unitnot_run#8134question of whether the projection should cap those rows. This workflow is intentionally not PR-required, so no hosted run is attached to this head.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
sqlite_v0bounded projection introduced by feat(control-plane): sqlite_v0 bounded active view projection, in-transaction auto-archive, and goal-scoped stale_source_registry #7834.Shared-authority RFC fixture impact
main.fileandsqlitearms both run; neither was added or removed.Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md). Fixture digests and temporary paths are omitted from the evidence above.none.Signed-off-bytrailer (git commit -s).