Repository navigation
test(sqlite): qualify the OS/runtime matrix for the authority store - #9426
Conversation
Batch-3 final slice for issue loopx-project#4224: a test-only OS/runtime matrix qualification suite for the SQLite authority store, with every assertion bound to contracts documented in docs/reference/sqlite-authority-store.md. Rows: the qualified floor runtime (Node 22.22.3 / SQLite 3.51.3) holds the full store contract; a below-floor stock Node 22 runtime (v22.14.0 / SQLite 3.47.2) fails closed through the embedded-driver probe with typed provider_protocol_violation on every operation, no authority state and no File fallback; a newer-major runtime inside the documented envelope (v26.9.0 / SQLite 3.53.4) holds the same contract; one database serves across two qualified runtimes on the same host. runtime_identity reporting (node_version, sqlite_version, sqlite_source_id, sqlite_authority_qualified) is verified against independent raw-driver oracles per binary. macOS arm64 is the only local host; Linux adds coverage where CI pins the qualified runtime; other platforms stay disclosed gaps. Signed-off-by: Lihua <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)
[P2] 同一个 Node 会被记为跨运行时交接。 版本选择只比对 launcher 路径。实际两边的 Node 和 SQLite 完全相同,较新运行时与跨运行时交接仍报告通过。 以子进程实际报告的 runtime identity 证明两边不同。将精确参考环境与一般合格 runner 区分,未形成有效组合时明确跳过。 相关位置
动机 / Motivation
SQLite authority 的维护者需要核对同一数据库能否在支持的 Node 与 SQLite 组合之间读写和交接。 主干已有 authority store 与 admission 检查,尚无把实际运行版本、磁盘结果、交接读回放在一起的矩阵。 在 macOS arm64 上用三套实际 Node 运行候选矩阵,再用当前 runner 的同一实际 Node 作两启动入口的反例。 真实 Node 22.22.3/SQLite 3.51.3、22.14.0/3.47.2 和 24.21.0/3.53.4 组成的四行全部通过。 两个入口启动同一 Node 后,新增矩阵也把它记为较新运行时与跨运行时交接通过。 真实测试只覆盖 macOS arm64。未执行 Linux、Windows 和已安装生产环境的迁移与长时间 soak。
版本选择只比对 launcher 路径。实际两边的 Node 和 SQLite 完全相同,较新运行时与跨运行时交接仍报告通过。
改动思路 / Approach
存储操作由已有 SQLite authority store 处理,子进程提供驱动和存储读回,父进程验证。当前验收还应使用子进程身份判定不同运行时。 确认 macOS 上的四项本地行为,并让测试如实归属不同版本的覆盖。Linux、Windows、升级和更长时间的资格仍需后续证据。 以子进程实际报告的 runtime identity 证明两边不同。将精确参考环境与一般合格 runner 区分,未形成有效组合时明确跳过。 现有入口依据
具体改动 / Changes
精确 head 59ec1eb15ca934dcb03daf32a60e347845343621,比较基线 3347302d17195fc63fdb916f96fdd18fc00f0ebf。3 个文件 +909 行。新增矩阵和子进程测试夹具,加入现有 TypeScript 编译项目。目标分支与此 head 的 merge base 为 35cb1d7。 正常矩阵的运行时配对已核实。launcher 对照中只改变启动路径即可让第二套和交接被当作覆盖,实际身份未改变。
关键代码讲解
-
resolveBelowFloorBinary。验证旧版本命令行可运行测试 worker。 源码 -
resolveNewerMajorBinary。按最低支持 major 和启动路径挑选第二套运行时。 源码 -
assertIdentityRow。使用原始驱动值核对实际 SQLite identity。 源码 -
跨运行时交接。首次提交、第二套继续和首次运行时读回共用一个临时数据库。 源码 -
DISTINCT_RUNTIME_HANDOFF 尚未满足。运行时矩阵记录实际 Node 与 SQLite,跨运行时读回需要独立证实两端运行时不同。 定位
对主干的风险 / Risks
矩阵由受支持的较新 Node 运行,同时为另一个入口配置通常的 Node launcher。两个入口实际进入同一个 Node 二进制。 同一 macOS arm64 Node 24.21.0 经直接调用和 launcher 进入两条路径,矩阵得到 3 pass、1 skip,其中较新版本与异版本交接误通过。 检查位置
语义与 CI 对齐
四项实际 Node 矩阵、TS 类型检查、标准本地 premerge 和差异检查均通过。 同一 macOS arm64 Node 24.21.0 经直接调用和 launcher 进入两条路径,矩阵得到 3 pass、1 skip,其中较新版本与异版本交接误通过。 全矩阵已在真实 macOS arm64 的三个本地 Node 环境执行。未查询托管 CI 或主机外的 OS 结果。
我的整体评价 / Verdict
REQUEST_CHANGES。 确认 macOS 上的四项本地行为,并让测试如实归属不同版本的覆盖。Linux、Windows、升级和更长时间的资格仍需后续证据。 以子进程实际报告的 runtime identity 证明两边不同。将精确参考环境与一般合格 runner 区分,未形成有效组合时明确跳过。
English verdict: REQUEST_CHANGES. All four rows pass using the verified distinct Node runtimes on macOS, but the newer-runtime and handoff rows also pass when both launchers start the very same executable.
…er path Review round 1 on PR loopx-project#9426 (review 6052712851): a launcher alias of the suite runner's own executable could be selected as the 'newer runtime' and form the 'cross-runtime handoff' row, counting the same Node/SQLite pair twice as distinct coverage, and the runner row was attributed to the qualified floor even when a newer generic runtime served it. Runtime selection now probes every candidate through the spawned worker's identity reply (raw-driver sqlite_version/source_id plus the child's node_version, cross-checked against the launcher's own --version) and only a distinct reported serving pair may form the newer-major or handoff row; both rows re-verify distinctness in-test, assertion labels carry both reported pairs, the runner row distinguishes the documented reference floor (v22.22.3 / SQLite 3.51.3, pinnable via LOOPX_TEST_SQLITE_FLOOR_NODE) from a generic qualified runner, and an unformable distinct combination skips with 'no distinct qualifying second runtime available' plus per-candidate rejection reasons instead of passing. A new regression test builds a launcher symlink chain to the runner and asserts the refusal with the same-serving-pair reason, with a positive control requiring a genuinely distinct reported pair. Counterexample evidence on darwin/arm64: previous head with runner v26.9.0 plus a hardlink of the same inode as the override reported 4 pass / 0 skip (false distinct coverage); fixed head reports 2 pass / 3 honest skips with the identical-pair reason. Signed-off-by: Lihua <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)
动机 / Motivation
维护 SQLite authority store 的贡献者,需要确认同一数据库经两个实际运行时交接仍可读写,也需要确认旧驱动会按预期拒绝。 主干已有启动资格与 SQLite 存储验证,缺少将实际运行时身份和数据库交接放在一起的本地对照。上一提交按启动器路径选第二个运行时,同一个 Node 可被报成两种配置。 当同一运行时被误计为两个时,环境交接可以错误通过,后续评估会依赖实际没有测过的组合。 在 macOS arm64 用三个真实 Node 版本跑当前矩阵,并用同一个 Node 的包装启动器复验旧假通过。另把不匹配的已知版本作为参考环境的控制组。 参考环境 22.22.3/3.51.3、旧环境 22.14.0/3.47.2 和较新环境 24.21.0/3.53.4 组成矩阵,五项均通过。不同运行时在同一数据库交接并读回;低于门槛的环境返回拒绝。 两个入口指向同一 Node 时,新版明确跳过需第二个运行时的测试。 验证在 macOS arm64 的真实本地驱动及临时数据库执行。
改动思路 / Approach
隔离 worker 沿用现有 authority 接口,实际驱动负责创建与读取数据库。测试侧单独识别实际 runtime identity,并将同一记录内的不同版本交接作为覆盖条件。新增逻辑集中在本地测试用例和配套 worker。 补齐本机的真实 SQLite 运行时身份和交接验证。验收证据来自本轮测过的组合,平台覆盖与长期运行仍按各自证据判断。 保留原真实存储交接路径,从已启动子进程的 Node 与 SQLite 版本确认测试身份。维持参考环境和一般合格环境的分别归因。
具体改动 / Changes
精确头 051404206b92187db87b9e77655c469411633ee9,目标分支快照 3347302d17195fc63fdb916f96fdd18fc00f0ebf。3 个文件新增 1,097 行。完整覆盖只改测试和 TypeScript 测试配置,生产 SQLite store 无变更。 分叉基线为 35cb1d7,没有这个成套测试。上一头 59ec1eb 的同一 Node 包装路径产生跨运行时通过。本头明确跳过,独立真实三版本用例保持全部通过。
关键代码讲解
-
probeRuntime。以隔离子进程读取 Node、内嵌 SQLite 和 statement 关闭行为。 源码 -
isDistinctPair。使用子进程报告的 Node 与 SQLite 版本组合判断两边是否不同。 源码 -
selectSecondRuntime。检查启动器版本、候选能否运行以及身份,未组成有效组合时记录原因。 源码 -
跨运行时数据库交接。第二个进程接续真实数据库,再复核 head、收据和历史。 源码 -
SQLITE_RUNTIME_IDENTITY_HANDOFF 已满足。SQLite 资格由实际内嵌版本和文件行为证明。声称跨运行时的交接必须使用两个实际不同的已核验环境。 现有依据
对主干的风险 / Risks
设置第二个入口为一个普通包装启动器,使其与当前 runner 实际执行同一个 Node。 上一头四项全过,包含新版与交接。当前头报告两边都是 24.21.0/3.53.4,新版和交接两项明确跳过,新增别名测试也将其真实正对照标为缺少第二种运行时。 参考版本标错时已有对照也会明确跳过。 selected 与 unavailable 是测试内部选择结果。生产 authority 继续使用已有 runtime_identity 与失败状态。 测试只有观察到不同运行时才把其计入交接验证。无可用环境时跳过并显示原因。
语义与 CI 对齐
PASS — 真实三版本五项通过、同一版本包装回归和错误参考版本控制组通过。后两者按预期有跳过。TypeScript 检查、git diff --check 和标准本地 premerge 通过。 UNVERIFIED — Linux、Windows、已安装环境和长时 SQLite soak 未核验。
我的整体评价 / Verdict
APPROVE。 实际版本、旧驱动拒绝和数据库交接现在能分别作为本地证明,缺少真实运行时的行明确跳过。 补齐本机的真实 SQLite 运行时身份和交接验证。验收证据来自本轮测过的组合,平台覆盖与长期运行仍按各自证据判断。 剩余验证范围见上。
English verdict: APPROVE. One Node reached through two launchers no longer counts as two runtimes. All five checks pass with real, distinct macOS arm64 runtimes.
Signed-off-by: huangruiteng <[email protected]>
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · GPT-5 · OpenAI · self_reported
动机 / Motivation
维护 SQLite authority provider 的贡献者和发布负责人需要知道某个实际 Node/内嵌 SQLite 组合是否满足文档门槛,也需要验证同一数据库跨两个真实 runtime 交接后的身份与回读。
早期测试只比较 launcher 路径,同一 Node 经不同入口会被记为 newer-major 与 handoff 通过;当前 exact head 先让子进程报告实际 Node/SQLite pair,只有 pair 不同且 qualified 时才形成对应行。
在非 root 本机使用 Node 22.22.3/3.51.3、22.14.0/3.47.2、26.9.0/3.53.4 时,矩阵结果为 5 passed / 0 skipped;同一 executable 的 symlink chain 不能形成 distinct runtime coverage。
本 PR 不修改 loopx 生产代码,不声称 Windows 或 Linux 行已通过,不证明支持升级/回滚,也不把短时运行替代十天 soak。
改动思路 / Approach
The matrix reuses the real provider and adds only test orchestration and independent evidence.
It qualifies available runtime combinations and reports missing environments without claiming platform or long-soak coverage.
主路径是 node --test tests/control_plane_ts/sqlite_authority_runtime_matrix.test.ts。权威输入为 Spawned runtime identity, the production SQLite authority store and an authored commit ledger,决定边界由 The parent test owns qualification rows and oracles; the controlled worker only performs identity and store operations. 持有,结果是 A pinned Node binary creates or opens temporary authority databases and submits ledger commits; child replies and raw-driver reads are compared by the parent.,再由 Runtime identity, commit/head/receipt reads, audit results, raw-engine facts and exact byte comparisons 消费。The matrix must fail closed or skip with an explicit observed-runtime reason; it never substitutes File fallback or launcher-path inference.
具体改动 / Changes
按 docs/reference/sqlite-authority-store.md 的 revision 9fb45483422c1c5f03381615618aeefe21465f26 核对,actual-runtime-identity / below-floor-fail-closed / distinct-runtime-handoff 分别对应下面的行为与验证。
关键代码讲解
probeRuntime:Spawn the controlled worker and record the actual Node and raw-driver SQLite identity. Before distinctness could derive from launcher paths; now the probe records the serving pair, source id, finalization and platform.selectSecondRuntime:Select a distinct qualified second runtime using observed identity. Before aliases counted as distinct; now same Node/SQLite pairs are rejected with the observed pair.sqlite authority runtime matrix worker:Expose identity and store operations to the parent through a controlled newline protocol. This is the #9126-style subprocess boundary needed to run the same test under distinct Node binaries.
变更共 3 test/configuration files,1097 additions、0 deletions。Add a controlled runtime worker, a five-row real-runtime qualification matrix and its TypeScript compile inclusion.
actual-runtime-identity:The matrix selects and labels rows from a child's reported Node version and raw-driver SQLite version, not launcher paths.,当前为 implemented。below-floor-fail-closed:A stock older Node-22 runtime outside the admitted driver lines fails closed without creating authority state or falling back to File.,当前为 implemented。distinct-runtime-handoff:One database can be authored, continued and read back across two actually distinct qualified runtimes.,当前为 implemented。
对主干的风险 / Risks
最强回归场景是 The matrix claims a runtime combination it did not actually execute.。触发状态为 Two launcher paths resolve to the same Node executable or a pinned reference binary reports another pair.;Selection compares child-reported Node/SQLite identity, cross-checks launcher --version, and skips when no distinct qualified candidate remains.。影响范围是 SQLite runtime qualification evidence and the temporary databases created by the test.,可观察性来自 Per-row labels, observed Node/SQLite pair, skip reason, commit/receipt/audit assertions and raw-engine facts.,恢复路径是 The change is test-only and removable; operators install a genuinely distinct runtime to exercise optional rows.。
changed_invariant_positive=passed (5 passed, 0 failed, 0 skipped using Node 22.22.3/3.51.3, 22.14.0/3.47.2 and 26.9.0/3.53.4.);material_negative_or_failure=passed (The alias was rejected by observed serving pair; the positive control used a genuinely distinct runtime.);repository_required_checks=passed (Typecheck and diff checks passed; standard premerge passed all direct checks and 7/7 selected catalog canaries.);remote_ci_observation=pending (The new exact head has not yet completed hosted CI.)。
- PASSED · Reference, below-floor, newer-major, cross-runtime handoff and alias-negative rows.:5 passed, 0 failed, 0 skipped using Node 22.22.3/3.51.3, 22.14.0/3.47.2 and 26.9.0/3.53.4.
- PASSED · A symlink chain to the same executable cannot form a distinct runtime.:The alias was rejected by observed serving pair; the positive control used a genuinely distinct runtime.
- PASSED · TypeScript control-plane compilation, diff hygiene and risk-based premerge.:Typecheck and diff checks passed; standard premerge passed all direct checks and 7/7 selected catalog canaries.
- PENDING · Remote CI for the new exact head.:The new exact head has not yet completed hosted CI.
我的整体评价 / Verdict
长程效果判断为 improved:Qualification evidence now binds the actual serving runtime to disk state, identity and handoff, preventing false cross-runtime claims from launcher aliases.。用户体验判断为 improved:Maintainers receive accurate pass or disclosed-skip rows with exact runtime attribution instead of inferred platform claims.。视觉检查不适用,因为本次没有改变渲染界面或布局。
This is test-only evidence over the real authority store. The new head rejects launcher aliases and completes the full matrix on three actual runtime pairs; unsupported platforms and long soak remain explicit gaps.
English verdict: APPROVE at b3fbfe0. Runtime qualification now keys on reported Node/SQLite identity, rejects same-executable aliases, and passes the full matrix across three real runtime pairs.
Summary
Test-only delivery of the final batch-3 OS/runtime matrix row for the SQLite authority-store qualification tracked in #4224 (the ledger's remaining independent-evidence row after consumer lag #8367, backup/restore lineage #8482, concurrent CAS #8498 and disk-full injection #9126). Zero changes under
loopx/**.Every assertion binds to a contract
docs/reference/sqlite-authority-store.mdactually documents: the Node >=22.22.3 floor for both local providers, the qualification reference pair (Node 22.22.3 / SQLite 3.51.3), the actual embedded SQLite version + synchronous statement finalization probed "before creating or opening an authority database", the admitted WAL-reset release lines (3.51.3+ and later 3.x, 3.50.7+, 3.44.6+), fail-closed with no File fallback, the read-only identity probe that "opens no database file and creates no authority state", theruntime_identityfields (node_version,sqlite_version,sqlite_source_id(),sqlite_authority_qualified), the 64-commit checkpoint window, the byte-identical retry replay contract, and per-goal databases. No matrix row beyond the docs is invented.Runtime selection is identity-based (review round 1)
A second runtime only counts for the newer-major or cross-runtime rows when the spawned child's actually reported serving pair —
node_versionplus the raw-driversqlite_version, cross-checked against the launcher's own--version— differs from the runner's reported pair. Launcher paths are never consulted for distinctness, so one executable reached through several entrypoints (direct call, symlink chains, hardlinks) can never fabricate distinct coverage: the rows skip withno distinct qualifying second runtime available (runner reports <pair>; <per-candidate rejection reasons>). The runner row distinguishes the precise reference environment (reported v22.22.3 / SQLite 3.51.3, or a binary pinned viaLOOPX_TEST_SQLITE_FLOOR_NODE) from a generic qualified runner, recording the attribution in every assertion message. A pinned floor binary that does not report the reference identity skips with the observed pair.A dedicated regression test builds a launcher symlink chain to the runner inside the suite and asserts the selection refuses it with the same-serving-pair reason; a positive control then requires a genuinely distinct second runtime or skips with the same disclosed reason.
Matrix rows
Covered (all on macOS arm64, this author's only local host; identities below are the reported serving pairs):
5d9d3872911e2340) — the documented reference pairverifyAuthorityHistoryverified 65/2, raw-engine oracle (user_version=2, WAL journal, integrity ok), per-goal database separation,runtime_identityverified against independent raw-driver oracles, identity probe creates no authority state.c583851fc85e4618)failed/provider_protocol_violation; the refusal names the observed driver pair, the WAL-reset requirement and the 22.22.3 floor; no authority database created, store directory empty (no File-fallback artifacts), no success payload escapes. The doc's intentional rejection of older-Node-22 drivers that pass the statement-only probe.8bebc3d846767864), proven distinct from the runner pairNot covered (disclosed gaps, never passes):
LOOPX_TEST_SQLITE_BELOW_FLOOR_NODE/LOOPX_TEST_SQLITE_NEWER_MAJOR_NODEoverride discovery;LOOPX_TEST_SQLITE_FLOOR_NODEpins the reference binary).>=10days) and recovery lineage: unchanged ledger rows; the soak verdict remains with the owner per the 9d22.85h early-termination report, and recovery lineage was deferred by owner direction.Design notes
sqlite_authority_runtime_matrix_process.ts, spawned never imported, wire contract declared on both sides) executes every store operation under a pinned Node binary; the parent test holds the authored ledger and all assertions. The outer runner stays on the qualified 22.22.3 runtime; only the runtime-axis rows run other binaries in subprocesses.runtime_identityfields are checked against a rawnode:sqlitedriver query in the same child process plus the spawned binary's own--versionoutput; qualification is recomputed from the doc's admitted-release-lines rule restated in the test (nothasSqliteWalResetFix); engine facts come from a direct read-onlynode:sqliteconnection; byte comparisons use the authored ledger, never the worker's own output.LOOPX_TEST_REQUIRE_SQLITE_QUALIFIED.Validation
npm run typecheck:control-planeclean;git diff --checkclean; public/private boundary scan clean (no local absolute or soak paths in the committed tests).LOOPX_TEST_PYTHON=python3 PYTHONPATH=. uv run --extra test loopx canary premerge --from-git-diff --git-diff-base 35cb1d701(fresh upstream main merge base): all direct checks passed, 7/7 catalog canaries, 0 failures, 0 manual holds.Refs #4224.
Exact-head refresh on 2026-11-26:
b3fbfe0891020981e27b25dc034123e399f4d501on currentmainat9fb45483422c1c5f03381615618aeefe21465f26.npm run typecheck:control-planepassed; public-safe diff checks passed.