Repository navigation
test(sqlite): qualify archived lifecycle and conversion retries - #6262
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=xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
评审 head:dcc9664af15d62d5329e088f00de205d70483dc9。没有阻塞发现;下述结论限于新增测试与 checkpoint,不代表 release 默认资格完成。
动机
SQLite 可逆试用的开发者在完成或替代任务后退出试用时需要保留当前历史。此前有界 CLI 证据只贯通开放任务与结算,无法发现已归档任务在双向转换后被历史重试复活或覆盖;本次加入完成、替代、归档后原操作重试的独立断言。源码及已安装 package 的真实隔离 File/SQLite 后端均保留最新记录、successor 与原结算,原重试不追加 authority revision。本 PR 只增加测试与资格 checkpoint,不改变运行时、默认配置或用户操作。打包 App 的对应交互、真实模型、自然试用、延迟/资源增长及正式 D2 仍保留各自未测或失败证据。
改动思路
只复用现有完整 CLI 和 canonical owner,以同一普通生命周期分别测试显式 File 与新 Goal 默认 SQLite。每条命令都在隔离进程重开真实后端,复制选定 package 并断言 import provenance;没有 mock 提供本次要证明的 migration/replay 结果。正常列表继续只展示 active 工作,历史记录通过既有精确 Todo context 读取,没有扩张产品列表或新增配置。
具体改动
关键内容讲解
两个路径全部审查:test_sqlite_authority_cli.py 新增一条两 provider 参数化旅程;既有 retirement cadence ledger 增补匹配的双语资格边界。测试先拒绝无 lease claim,取得真实 grant 后执行 claim/update,沿 should-run→refresh→owner 返回的 spend 命令结算,再完成和 supersede 任务、归档、双向迁移当前状态。随后重试原 add/update/complete/spend,断言记录和 authority revision 不变,恢复 quota 后原 Turn 仍已结算,run 历史只有一次 spend 和一次 validated_progress。
规范:docs/architecture/rfcs/ledger/shared-goal-authority-state-provider-v0/2026-09-28-retirement-cadence.md,不可变 revision df826263926651ab9c50acee182ef96e2a60ff4b,判断依据是变更前的矩阵。Mutation and ownership 与 Forward and reverse migration 的本次有界 CLI 组合通过;Installed consumers 的 App 交互继续 deferred;Cost and endurance 的资源增长、代表性自然使用与 D2 继续 deferred。新增 checkpoint 没有修改这些独立验收要求,也没有把同负载功能对照当成性能对照或重新开始旧 soak。
对主干的风险
测试/文档不改 runtime、CLI/API、持久化 schema、默认设置或 optional capability,因此新增 typed state/default-off/authority 合约并不适用;测试消费既有 hard_lease、archive 与 receipt 词汇。域无关产品义务保持原有含义,机器强制 claim 不是可忽略 guidance。没有新的 UI/Lark 入口,也不宣称本测试验收了它们。
源码完整 CLI 模块 9 passed;复制当前安装 package c51ec1a60、CPython 3.12.15 的两条新增 provider case 通过。源码使用 CPython 3.14.8;两者都是 macOS arm64、Node 24.21.0 / SQLite 3.53.4。19 项风险选择的 premerge 检查全部通过,覆盖语义全树、编译、Todo/readmodel、monitor 与 public boundary,无失败/skip/manual hold。按 packet 的 wait_for_ci=false,不查询或等待远端 CI。
保留早期 draft test 失败:误用 storage_selection 字段、漏掉 claim 的 actor/lease、把精确 archived context 当作列表。随后按已存在的 schema 与合法操作顺序修正;没有运行时代码修复、删减归档/重放断言或改绿预算。最终完整模块与独立安装 package 运行同时覆盖原不变量。最强遗漏仍是 App 的对应日常交互及长期资源行为,已明确不计入本批资格。
我的整体评价
APPROVE,交付判断 justified_increment。long_horizon 与 user_experience 都是 preserved:运行时与用户必经步骤不变,新测试保护跨 provider 的后续重试和历史保留,未把有界正确性夸大成自然持续使用。它形成了可独立复跑的真实组合回归,现有开放任务退出与底层 archive 测试不能替代归档后原操作的这一组合。
同作者 open PR 与既有覆盖已检索,本批没有同形测试拆分或单独临时 runner。已检查相关重构:用一条 provider 参数化旅程放在原 suite,保留已有不同负例;无新产品 decision owner 或无调用的 helper 层。source/installed qualification 与正式 release 继续由既有 R5/T4 工作推进,不因这条测试关闭父目标或扩大自动迁移权限。
English verdict: APPROVE - dcc9664; tests/docs-only paired real-CLI regression protects archived lifecycle and original retries through conversion. Source module 9 passed, installed-package paired cases 2 passed, 19 premerge checks passed; App/model/natural-use/cost and D2 remain separate.
The reversible SQLite trial needs ordinary terminal and replanning operations to survive conversion, including retries whose original Todo is now archived. Existing CLI coverage retains an open Todo and its settlement, but does not join completion, supersession and archival with current-state exit.
Add one paired real-CLI journey for the unconfigured SQLite candidate and explicit canonical File control. It checks unleased-claim refusal, leased work, once-only settlement, completion, supersession, exact archived readback and bidirectional conversion. Retrying original add/update/complete/spend commands must preserve current records and authority revision. The RFC checkpoint records the bounded result and keeps App/model/natural-use/performance qualification separate.
Validation:
c51ec1a60package, copied with asserted import provenance on CPython 3.12.15: both new provider cases passed.This changes tests and the R5/T4 checkpoint only. No runtime, storage defaults, optional capability, CLI/API or UI behavior changes. It establishes bounded functional recovery evidence, not elapsed D2 qualification or release-default approval. The related refactor pass kept the test in the existing real CLI suite; no new product decision owner or unused helper layer is needed.