feat(ql3): plan sealed reconciliation bundles

This commit is contained in:
whyour
2026-08-21 18:06:27 +08:00
parent 4012f54a50
commit 46a7dc7496
16 changed files with 3078 additions and 43 deletions
+16 -13
View File
@@ -11,17 +11,20 @@
最新增量证据(2026-08-21):
- D-390/ADR-0483契约已冻结,待实现):`reconciliation_captured` 只证明原始字节可恢复,不授予自动回灌。下一切片先把 capture
manifest/receipt 升为 v2:逻辑名保持内容无关,payload 改用 SQLite 可识别的固定 `target.sqlite* / legacy.sqlite* /
recovery.sqlite` 名称,terminal asset/directory 收敛为 `0400/0500`,并把 activation source/target baseline SHA-256 纳入 lineage。
main-only 使用 immutable readonly;只有 WAL+SHM 完整配对且无 journal 时使用普通 readonly,打开前后必须重验全部 asset;hot
journal、不完整 sidecar 或漂移不执行 SQLite recovery,直接 `manual_required`。既有 Local Owner 增加独立
`reconciliation.plan.prepare|commit|verify`,以 `reconciliation_captured → reconciliation_plan_prepared → reconciliation_planned`
CAS fence 发布固定八领域的 bounded count/digest/disposition plan。plan 不保存 row value、command、Secret、credential、日志或业务
标识,不产生 `import_ready/rollback_ready/legacy_ready`unknown schema、不可逆 Run/history、Secret custody、target-only Package/AI
未映射 Legacy facts 必须保守。实现继续进入 `deployment/reconciliation/sealed-bundle|planning/`,单 handle、64 KiB builder、Edge/
Standalone 2/8 MiB cache,不新增 package/dependency/binary/daemon 或 Local SQLite mutation authority import。本条在 Linux/Docker
readonly hash-stability、crash replay、完整 package/backend、架构/release 与十四档 artifact 门完成前保持 Proposed。
- D-390/ADR-0483已接受):既有 Local Owner 已实现密封 capture 的严格只读消费与独立
`reconciliation.plan.prepare|commit|verify`。capture v2 使用 SQLite 可识别的固定 `target.sqlite* / legacy.sqlite* /
recovery.sqlite` 物理名和 `0400/0500` terminal sealmain-only 走 immutable readonlyWAL+SHM 完整配对走普通 readonlyhot
journal、不完整 sidecar 或任一 stat/hash/mode 漂移在 SQLite open 前稳定 `manual_required`。instance head 以
`reconciliation_captured → reconciliation_plan_prepared → reconciliation_planned` CAS fence 发布固定八领域的 bounded
count/digest/disposition planplan 不保存 row value、command、Secret、credential、日志、表名、路径或业务标识,也不产生
`import_ready/rollback_ready/legacy_ready`。实现内聚在 `deployment/reconciliation/sealed-bundle|planning/`,单 SQLite handle、
64 KiB hash/plan 上限、Edge/Standalone 2/8 MiB cache,不新增 package、dependency 或常驻对象。真实 Linux/Docker main-only
WAL+SHM readonly/hash-stability `2/2`,聚焦 `24 total / 22 pass / 2 conditional skip / 0 fail`Local Owner
`246 total / 239 pass / 7 conditional skip / 0 fail`tracked backend `1540 total / 1538 pass / 2 conditional skip / 0 fail`
18-package clean build/逐包测试、八项架构/发布审计和十四档 artifact audit 全通过。workspace 仍为 18 packagesLocal Owner
`146 source / 145 nested / 1 root binary entry`;基础 Edge/Standalone closure 仍为 319 files、58 modules,不含一次性 plan authority。
下一切片 D-391 应定义消费 exact plan digest 的私有逐对象诊断、人工裁决与审批协议;它仍不能借 plan 获得自动 import 或 rollback
authority。
- D-389/ADR-0482(已接受):target stopped 后的 `reconciliation_required` 不能直接逆迁移或覆盖 2.x source;既有 Local Owner
已实现独立 `reconciliation.capture.prepare|commit|verify`,只允许 exact stopped reconciliation head,以 instance CAS 建立唯一
capture fence,并把 target main/sidecars、Legacy source main/sidecars、activation recovery 与内容无关 lineage 以固定 64 KiB
@@ -36,8 +39,8 @@
`141 source / 140 nested / 1 root binary entry`;基础 Edge/Standalone artifact 仍为 `2,611,978 / 2,612,056` bytes、319 files、
58 modules,证明一次性 capture authority 未进入低配常驻闭包。Application+AI 为 `4,529,710 / 4,529,842` bytesMCP 为
`7,337,910 / 7,338,018` bytes,均 compatible。独立 PostgreSQL 18.6 arm64 HA Docker 基线继续以 timeline `1 → 2`、146
gates 和无 finding 的 evidence audit 通过,但不把本机 capture authority 带入 Cluster。后续 D-390 应定义消费 exact
bundle/head 的数据域 diff、冲突裁决与受审 plan,不能把 capture completion 当作 reconciliation completion。
gates 和无 finding 的 evidence audit 通过,但不把本机 capture authority 带入 Cluster。D-390 已完成 exact bundle/head 的只读
数据域 plancapture completion 与 plan completion 仍都不等于 reconciliation completion。
- D-388/ADR-0481(已接受):D-387 committed data receipt 只作为启动前置事实,不获得 activation/rollback authority。
adopted-only Application v4 在 signal、SQLite、Secret、Plugin、AI 前以 no-follow stable descriptor 验证
`commitPath/expectedCommitDigest/expectedReceiptDigest`;独立 `local.deployment.adopted.prepare|verify` 已覆盖 systemd、OpenRC、
@@ -1,6 +1,6 @@
# ADR-0483:密封 Reconciliation Bundle 的有界数据域计划
- 状态:ProposedD-390 契约冻结
- 状态:AcceptedD-390 已实现
- 日期:2026-08-21
- 关联 RFCQL-RFC-0001 D-05、D-06、D-17、D-64、D-87、D-184、D-259、D-383、D-389、D-390
- 关联 ADRADR-0064、ADR-0094、ADR-0095、ADR-0194、ADR-0201、ADR-0314、ADR-0315、ADR-0482
@@ -143,6 +143,29 @@ package、production dependency、binary、daemon、timer、watcher、listener
7. Edge 固定 2 MiB cache、Standalone 8 MiB cache;完整 Local Owner/backend/package、架构、release、十四档 artifact 与真实 Docker
readonly rehearsal 通过,基础 Edge closure 不增长。
## 实现与验证证据
D-390 已在既有 `@qinglong/local-owner-cli/src/deployment/reconciliation/` 内实现。`sealed-bundle/reader.ts` 只接受经 terminal
validator 验证的密封 capturemain-only 走 immutable readonlyWAL+SHM 完整配对走普通 readonlyhot journal、sidecar 不配对或
任一 stat/hash/mode 漂移均在 SQLite open 前失败关闭。`planning/` 以固定 contract、inventory、prepare/commit/verify 将 instance head
`reconciliation_captured` CAS 推进到 `reconciliation_plan_prepared`、再推进到 `reconciliation_planned`。plan 只包含固定八领域的
有界计数、digest、disposition 和保守 outcome,不保存表名、路径、row value、Secret、credential、命令或日志,也不产生 import authority。
实现没有新增 workspace package、production dependency、binary、daemon、listener、timer、watcher 或网络访问。workspace 仍为 18
packages`singleSourcePackages=[]``shallowSourcePackages=[]`Local Owner 为 `146 source / 145 nested / 1 root binary entry`,新增的
5 个源文件全部进入 `deployment/reconciliation/sealed-bundle|planning/`,没有回到 `src/` 根平铺。Edge/Standalone cache 固定为
2/8 MiBhash buffer 与 plan 上限均为 64 KiBschema/table 上限为 4,096/512。
验收结果:reconciliation 聚焦套件 `24 total / 22 pass / 2 conditional Docker skip / 0 fail`;真实 Linux/Docker main-only 与
WAL+SHM readonly/hash-stability rehearsal `2/2`;完整 Local Owner `246 total / 239 pass / 7 conditional skip / 0 fail`tracked
backend `1540 total / 1538 pass / 2 conditional skip / 0 fail`18-package clean build/逐包测试通过。Edge import、Cluster dependency、
package boundary、service-manager bridge、Local image、image release、release version 与 deployment-lock surface 审计均 compatible。
十四档 artifact audit 均 compatible。基础 Edge/Standalone 仍为 `2,611,978 / 2,612,056` bytes、319 files、58 modulesAdopted
仍为 `2,831,713 / 2,831,836` bytes、339 files、59 modulesApplication+AI 为 `4,529,710 / 4,529,842` bytes、516 files、
144 modulesMCP 为 `7,337,910 / 7,338,018` bytes、805 files、228 modules。一次性 plan authority 未进入基础常驻闭包,也没有被
Cluster/PostgreSQL 消费。
## 未包含
- 逐对象明细分页、人工冲突选择和审批;
+1 -1
View File
@@ -486,7 +486,7 @@
| [ADR-0480](./ADR-0480-authenticated-atomic-legacy-data-application.md) | 受认证、原子且可恢复的 Legacy Data Application | Accepted |
| [ADR-0481](./ADR-0481-committed-legacy-data-deployment-lineage.md) | Committed Legacy Data Receipt 的本机部署 Lineage | Accepted |
| [ADR-0482](./ADR-0482-stopped-local-sqlite-reconciliation-recovery-bundle.md) | 停止态 Local SQLite Reconciliation Recovery Bundle | Accepted |
| [ADR-0483](./ADR-0483-sealed-reconciliation-bundle-domain-plan.md) | 密封 Reconciliation Bundle 的有界数据域计划 | ProposedD-390 契约冻结) |
| [ADR-0483](./ADR-0483-sealed-reconciliation-bundle-domain-plan.md) | 密封 Reconciliation Bundle 的有界数据域计划 | Accepted |
## 规则