feat(ql3): capture stopped reconciliation bundles

This commit is contained in:
whyour
2026-08-21 16:52:22 +08:00
parent a789c4a4d6
commit c341a92a18
16 changed files with 2837 additions and 33 deletions
+16 -10
View File
@@ -11,16 +11,22 @@
最新增量证据(2026-08-21):
- D-389/ADR-0482契约已冻结,待实现):target stopped 后的 `reconciliation_required` 不能直接逆迁移或覆盖 2.x source;
3.0 Run/TaskDefinition/Trigger/Secret/Plugin Package/AI facts 没有通用无损 Legacy 映射。下一切片先提供独立
`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 buffer
字节精确复制到 operator 显式提供的私有 capture root。payload、manifestreceipt 逐级 no-replace/fsync 发布,ENOSPC、partial
write、stage/link/manifest/receipt/head 和 commit-response-loss 均由同命令 exact replayverify 完全只读。bundle 不复制 keyring/
pepper,不打开 SQLite/checkpoint,不调用 Docker/init/socket/network,也不授予 import、rollback、Legacy start 或 target restart。
实现必须进入既有 Local Owner `deployment/reconciliation/`,不新增 package、dependency、binary 或常驻对象。后续数据域 diff、冲突
裁决和受审回灌必须消费 exact bundle/head 并另立 ADR;本条在实现、Linux/Docker rehearsal、完整 package/backend、架构、release 与
十四档 artifact 门完成前保持 Proposed。
- 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
buffer 字节精确复制到 operator 显式提供的私有 capture root。descriptor-bound copy、deterministic stage、hard-link no-replace、
file/directory fsync、manifest/receipt/head 分段提交覆盖 ENOSPC、partial write、retained stage、各崩溃窗口和 response lossterminal
commit replay/verify 不再读取 source。lineage proof 使用本地固定 schema/digest 的只读 evidence validator,没有为 Local SQLite 写
authority 放宽跨包 import。bundle 不复制 keyring/pepper,不打开 SQLite/checkpoint,不调用 Docker/init/socket/network,也不授予
import、rollback、Legacy start 或 target restart。真实 stopped Docker capture/independent verify `1/1`;聚焦套件
`27 total / 26 pass / 1 conditional skip / 0 fail`Local Owner `235 total / 229 pass / 6 conditional skip / 0 fail`tracked backend
`1540 total / 1538 pass / 2 conditional skip / 0 fail`backend build、18-package clean build/逐包测试、八项架构/发布门和十四档
artifact audit 全通过。workspace 仍为 18 packages、`singleSourcePackages=[]``shallowSourcePackages=[]`Local Owner 为
`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。
- 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-0482:停止态 Local SQLite Reconciliation Recovery Bundle
- 状态:ProposedD-389 契约冻结)
- 状态:Accepted
- 日期:2026-08-21
- 关联 RFCQL-RFC-0001 D-05、D-06、D-17、D-64、D-87、D-184、D-259、D-383、D-388、D-389
- 关联 ADRADR-0064、ADR-0194、ADR-0201、ADR-0314、ADR-0315、ADR-0476、ADR-0480、ADR-0481
@@ -49,6 +49,7 @@ reconciliation evidence、Application v4、activation、Legacy silence commitmen
```text
captureRoot 已存在、current-UID、0700、canonical、non-root 的目录
captureId UUID
applicationConfigPath deployment root 内固定的 local-application.json
expectedHeadDigest
expectedStoppedRecordDigest
preparedAtMs
@@ -166,6 +167,30 @@ package/import/artifact closure 必须保持零 Local reconciliation authority
8. 完整 Local Owner、backend、package、架构、distribution 和 release gate 通过;真实 stopped target bundle 在 Linux/Docker
rehearsal 中可由独立 verify 重建相同 digest。
## 实现与验证证据
D-389 已在既有 `@qinglong/local-owner-cli/src/deployment/reconciliation/` 内实现 prepare、commit、verify。实现使用固定 64 KiB
buffer、descriptor-bound stable copy、同目录 deterministic stage、hard-link no-replace publication、file/directory fsync 与 terminal
manifest/receipt/head 收敛;manifest 已发布、receipt 已发布、head 未推进和 commit response loss 均可在 source 不再存在时重放。
输入读取期间的 stat 或 sidecar 集合漂移、partial write、ENOSPC、retained stage、既有 asset 漂移和不同 commit time 重放均失败关闭。
最初的架构门发现 reconciliation proof 直接 import 了 Local SQLite data-application commit authority。实现没有扩充例外清单,而是
改为 reconciliation 内固定 schema、固定字段顺序和 digest 的只读 evidence validator;最终 Cluster dependency audit 无 finding
capture 也没有获得数据库写 authority。
验收结果:reconciliation/service-manager 聚焦套件 `27 total / 26 pass / 1 conditional Docker skip / 0 fail`;真实 stopped Docker
target capture 与独立 verify `1/1`;完整 Local Owner `235 total / 229 pass / 6 conditional skip / 0 fail`tracked backend
`1540 total / 1538 pass / 2 conditional skip / 0 fail`backend build 与 18-package clean build/逐包测试通过。Edge import、Cluster
dependency、package boundary、service-manager bridge、local image、image release、release version 和 deployment lock surface 审计均
compatible。workspace 仍为 18 packages`singleSourcePackages=[]``shallowSourcePackages=[]`Local Owner 为
`141 source / 140 nested / 1 root binary entry`,没有新增 dependency、binary、daemon、listener、timer 或 watcher。
十四档 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。一次性 capture authority 未进入基础常驻闭包。
独立 PostgreSQL 18.6 arm64 HA Docker 基线也以 timeline `1 → 2``146` gates 和无 finding 的 evidence audit 通过;它只证明本
切片没有破坏 Cluster 基线,不把 Local reconciliation authority 带入 Cluster。
## 未包含
- Task/Run/Trigger/Secret/Plugin Package/AI 等数据域 diff 与冲突裁决;
+1 -1
View File
@@ -485,7 +485,7 @@
| [ADR-0479](./ADR-0479-private-versioned-legacy-config-keyv-ssh-transformation.md) | 私有、版本化的 Legacy Config、Keyv 与 SSH 转换 | Accepted |
| [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 | ProposedD-389 契约冻结) |
| [ADR-0482](./ADR-0482-stopped-local-sqlite-reconciliation-recovery-bundle.md) | 停止态 Local SQLite Reconciliation Recovery Bundle | Accepted |
## 规则