Skip to content

Commit d6bc166

Browse files
genednaclaude
andcommitted
feat: check declared checkpoint manifest resources
Verify each published checkpoint's declared parts, lengths, and content hash, and mark only that checkpoint invalid when they disagree. Co-Authored-By: Claude Code <noreply@anthropic.com> Signed-off-by: Eli Ma <eli@patch.sh>
1 parent 9777d98 commit d6bc166

13 files changed

Lines changed: 843 additions & 21 deletions

File tree

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mega2"
3-
version = "0.42.96"
3+
version = "0.42.97"
44
edition = "2024"
55
license = "MIT OR Apache-2.0"
66
description = "Monorepo engine and Git hosting server for AI agents: trunk-based storage, Git Smart HTTP, Git LFS, OCI registry, and Agent Session Capture"

‎docs/plan/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**MTR-51 本地验收(2026-11-05):** manifest 资源完整性在 `ceres::traces::manifest`,投影接入 `jupiter::service::trace_projection_service`。已声明资源按 part 顺序核对路径、OID、Git 类型和 `byte_len`,以及资源总长度和 content hash;任一不符只把该 checkpoint 标为 invalid,不删除归档。没有 `entries` 的 manifest 仍只做布局解析。稳定原因词加在 `parser.rs` 的 `InvalidCheckpoint` 上,与布局原因同一枚举,属同轴 ER-03,已写入本卡 I。VER-1 9 passed、VER-2 1 passed,真实 Libra H2 pack 的 checkpoint 仍解析成功。nightly fmt 与 strict clippy exit 0。全量 `source .env.test && cargo test --all` exit 0:24 targets、3208 passed、0 failed、3 ignored。`cargo build` 与 `cargo build --tests` 完成;macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.97`。签名提交、标注 tag、Release 和 main/tag D 尚未取得,不记 done。用户免交叉 Review,不记 Review PASS。`DEBT-MTR98-ROLLBACK-BOUND` 仍 open。以下旧段保留其时点。
2+
13
**MTR-14 本地验收(2026-11-05):** checkpoint 布局解析在 `ceres::traces::parser`,按 commit 投影在 `jupiter::service::trace_projection_service`。路径 ID 取 `checkpoint/<prefix>/<rest>` 的拼接,tree OID 取原始 Git tree 条目。解析失败只记 invalid,不删除归档。VER-1 2 passed、VER-2 3 passed,其中真实 Libra H2 pack 33 个对象、tip `d9bf5910abfdcd70f6ba5ec0ec1c69ba453075f7` 的三个 checkpoint 均解析成功。nightly fmt 与 strict clippy exit 0。全量 `source .env.test && cargo test --all` exit 0:24 targets、3198 passed、0 failed、3 ignored。`cargo build` 与 `cargo build --tests` 完成;macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.96`。签名提交 `beba781c90872f4c7025049069b7eb06ad19e019`、标注 tag `v0.42.96` 与 [Release](https://github.com/gitmono-dev/mega2/releases/tag/v0.42.96) 已核。main Harbor [42022843962](https://github.com/gitmono-dev/mega2/actions/runs/42022843962) 与 tag Docker [42022929350](https://github.com/gitmono-dev/mega2/actions/runs/42022929350) 的 amd64、arm64 和 manifest 均实际 success。Lifecycle 为 `done` / `complete`。用户免交叉 Review,不记 Review PASS。`DEBT-MTR98-ROLLBACK-BOUND` 仍 open。以下旧段保留其时点。
24

35
**FIX29 与 MTR12/H1 实际收口(2026-11-04 UTC):** FIX-MTR-29 `done/complete`:最终完整 C 五门 exit 0、0 warning,24 targets 3193 passed/0 failed/3 原 ignored;33 个实际 Local 根、528 项条件创建证明,首次后检保护原 277 库和当时 H1。C 收据 SHA256 `03ccdf3d837b3d29cb15de82b622857cbbe862554d26b8cdf11ea6e731a26198`。签名+DCO 提交 `4a0e26984d2e01c711be9f60550b085b91b15733`、原生签名标注 tag `v0.42.95` 和 [Release](https://github.com/gitmono-dev/mega2/releases/tag/v0.42.95) 已核;main Harbor [41857267478](https://github.com/gitmono-dev/mega2/actions/runs/41857267478) 与 tag Docker [41857329075](https://github.com/gitmono-dev/mega2/actions/runs/41857329075) 的 amd64、arm64 和 manifest 均实际 success,D 收据 SHA256 `d5bab2e576e9e5de0102f123cfecf25156f20f950af6bba33ff12606d98bba20`。原生 tag 验签成功;GitHub 显示 unknown_key,不冒称 GitHub Verified。用户免交叉 Review,不记 Review PASS。

‎docs/plan/plan-20261015.md‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**MTR-51 本地验收(2026-11-05):** manifest 资源完整性在 `ceres::traces::manifest`,投影接入 `jupiter::service::trace_projection_service`。已声明资源按 part 顺序核对路径、OID、Git 类型和 `byte_len`,以及资源总长度和 content hash;任一不符只把该 checkpoint 标为 invalid,不删除归档。没有 `entries` 的 manifest 仍只做布局解析。稳定原因词加在 `parser.rs` 的 `InvalidCheckpoint` 上,与布局原因同一枚举,属同轴 ER-03,已写入本卡 I。VER-1 9 passed、VER-2 1 passed,真实 Libra H2 pack 的 checkpoint 仍解析成功。nightly fmt 与 strict clippy exit 0。全量 `source .env.test && cargo test --all` exit 0:24 targets、3208 passed、0 failed、3 ignored。`cargo build` 与 `cargo build --tests` 完成;macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.97`。签名提交、标注 tag、Release 和 main/tag D 尚未取得,不记 done。用户免交叉 Review,不记 Review PASS。`DEBT-MTR98-ROLLBACK-BOUND` 仍 open。以下旧段保留其时点。
2+
13
**MTR-14 本地验收(2026-11-05):** checkpoint 布局解析在 `ceres::traces::parser`,按 commit 投影在 `jupiter::service::trace_projection_service`。路径 ID 取 `checkpoint/<prefix>/<rest>` 的拼接,tree OID 取原始 Git tree 条目。解析失败只记 invalid,不删除归档。VER-1 2 passed、VER-2 3 passed,其中真实 Libra H2 pack 33 个对象、tip `d9bf5910abfdcd70f6ba5ec0ec1c69ba453075f7` 的三个 checkpoint 均解析成功。nightly fmt 与 strict clippy exit 0。全量 `source .env.test && cargo test --all` exit 0:24 targets、3198 passed、0 failed、3 ignored。`cargo build` 与 `cargo build --tests` 完成;macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.96`。签名提交 `beba781c90872f4c7025049069b7eb06ad19e019`、标注 tag `v0.42.96` 与 [Release](https://github.com/gitmono-dev/mega2/releases/tag/v0.42.96) 已核。main Harbor [42022843962](https://github.com/gitmono-dev/mega2/actions/runs/42022843962) 与 tag Docker [42022929350](https://github.com/gitmono-dev/mega2/actions/runs/42022929350) 的 amd64、arm64 和 manifest 均实际 success。Lifecycle 为 `done` / `complete`。用户免交叉 Review,不记 Review PASS。`DEBT-MTR98-ROLLBACK-BOUND` 仍 open。以下旧段保留其时点。
24

35
**FIX29 与 MTR12/H1 实际收口(2026-11-04 UTC):** FIX-MTR-29 `done/complete`:最终完整 C 五门 exit 0、0 warning,24 targets 3193 passed/0 failed/3 原 ignored;33 个实际 Local 根、528 项条件创建证明,首次后检保护原 277 库和当时 H1。C 收据 SHA256 `03ccdf3d837b3d29cb15de82b622857cbbe862554d26b8cdf11ea6e731a26198`。签名+DCO 提交 `4a0e26984d2e01c711be9f60550b085b91b15733`、原生签名标注 tag `v0.42.95` 和 [Release](https://github.com/gitmono-dev/mega2/releases/tag/v0.42.95) 已核;main Harbor [41857267478](https://github.com/gitmono-dev/mega2/actions/runs/41857267478) 与 tag Docker [41857329075](https://github.com/gitmono-dev/mega2/actions/runs/41857329075) 的 amd64、arm64 和 manifest 均实际 success,D 收据 SHA256 `d5bab2e576e9e5de0102f123cfecf25156f20f950af6bba33ff12606d98bba20`。原生 tag 验签成功;GitHub 显示 unknown_key,不冒称 GitHub Verified。用户免交叉 Review,不记 Review PASS。
@@ -6558,7 +6560,7 @@ C4 只批准**一次**同源、同工具、同完整五门及资源根核的前
65586560

65596561
**Task type:** `implementation`
65606562

6561-
**Lifecycle / Acceptance:** `pending` / 空
6563+
**Lifecycle / Acceptance:** `in-progress` / `locally-accepted`(2026-11-05:VER-1 9/9、VER-2 1/1、nightly fmt、strict clippy、全量 24 targets 3208 passed/0 failed/3 ignored、`cargo build` 与 `cargo build --tests` 已过。macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.97`。签名提交、tag、Release 与 D 尚未取得,不记 done。用户免交叉 Review。)
65626564

65636565
**Description:** 自MTR-14拆出;已声明资源的完整性校验。 专有VER在I所列源模块内新增cfg(test) tests并直接调用本卡生产实现;DB例复用crate::jupiter::tests::test_db_connection及真实crate::jupiter::migration::apply_migrations(&db,true),不复制SQL/算法充当实现,不新增root service seam。纯配置/编码例无需数据库。 metadata/manifest原始字节已经87在Git发布前校验;本卡只消费该已验归档,不另承担1MiB大小门或增加隐藏AC。
65646566

@@ -6568,25 +6570,25 @@ C4 只批准**一次**同源、同工具、同完整五门及资源根核的前
65686570

65696571
**Acceptance criteria:**
65706572

6571-
- [ ] AC-1: manifest part顺序正确。
6572-
- [ ] AC-2: part路径符合manifest。
6573-
- [ ] AC-3: part OID符合manifest。
6574-
- [ ] AC-4: part Git类型符合manifest。
6575-
- [ ] AC-5: part byte_len符合manifest。
6576-
- [ ] AC-6: 资源总长度符合manifest。
6577-
- [ ] AC-7: content hash符合原文。
6578-
- [ ] AC-8: 任一资源校验失败标invalid。
6573+
- [x] AC-1: manifest part顺序正确。
6574+
- [x] AC-2: part路径符合manifest。
6575+
- [x] AC-3: part OID符合manifest。
6576+
- [x] AC-4: part Git类型符合manifest。
6577+
- [x] AC-5: part byte_len符合manifest。
6578+
- [x] AC-6: 资源总长度符合manifest。
6579+
- [x] AC-7: content hash符合原文。
6580+
- [x] AC-8: 任一资源校验失败标invalid。
65796581

65806582
**Verification:**
65816583

6582-
- [ ] VER-1: `source .env.test && cargo test -p mega2 --lib ceres::traces::manifest::tests::resource_integrity_ -- --test-threads=1`(new,所属源模块内cfg(test);实际生产函数与DB/IO oracle,必须nonzero执行)。
6583-
- [ ] VER-2: `source .env.test && cargo test -p mega2 --lib jupiter::service::trace_projection_service::tests::resource_integrity_projection_ -- --test-threads=1`(new,所属源模块内cfg(test);实际生产函数与DB/IO oracle,必须nonzero执行)。
6584+
- [x] VER-1: `source .env.test && cargo test -p mega2 --lib ceres::traces::manifest::tests::resource_integrity_ -- --test-threads=1`(new,所属源模块内cfg(test);实际生产函数与DB/IO oracle,必须nonzero执行)。
6585+
- [x] VER-2: `source .env.test && cargo test -p mega2 --lib jupiter::service::trace_projection_service::tests::resource_integrity_projection_ -- --test-threads=1`(new,所属源模块内cfg(test);实际生产函数与DB/IO oracle,必须nonzero执行)。
65846586

65856587
**Dependencies:** `MTR-14`;消费已受审前置产物。
65866588

65876589
**Deliverables:** N/A:所有产物列I。
65886590

6589-
**Implementation write set:** `src/ceres/traces/manifest.rs`、`src/ceres/traces/mod.rs`、`src/jupiter/service/trace_projection_service.rs`、`docs/refactoring/traces.md`、`docs/user-guide.zh.md`、`docs/user-guide.md`。
6591+
**Implementation write set:** `src/ceres/traces/manifest.rs`、`src/ceres/traces/parser.rs`、`src/ceres/traces/mod.rs`、`src/jupiter/service/trace_projection_service.rs`、`docs/refactoring/traces.md`、`docs/user-guide.zh.md`、`docs/user-guide.md`。
65906592

65916593
**Release write set:** `Cargo.toml(version)`、`Cargo.lock`。
65926594

@@ -6602,15 +6604,15 @@ C4 只批准**一次**同源、同工具、同完整五门及资源根核的前
66026604

66036605
**Performance budget:** 共享契约数字上限,预算超限明确失败/partial;不得无界原文扫描。
66046606

6605-
**Estimated scope:** `M`(2落点/3生产文件)。
6607+
**Estimated scope:** `M`(2落点/4生产文件;`parser.rs` 只扩展同一 `InvalidCheckpoint` 原因词)。
66066608

66076609
**Version increment:** `patch`
66086610

66096611
**Release boundary:** `independent`
66106612

66116613
**C/D coverage from:** `self`
66126614

6613-
**Granularity:** `type=implementation; axis=已声明资源的完整性校验; recovery=immutable-release按本卡恢复重跑VER; complete=yes; self-contained=yes; AC=8/8; VER=2/8; landing=2; prod-files=3; scope=M; deps=MTR-14; writeset=串行于MTR-14; release=independent; split-from=MTR-14; exception=N/A`
6615+
**Granularity:** `type=implementation; axis=已声明资源的完整性校验; recovery=immutable-release按本卡恢复重跑VER; complete=yes; self-contained=yes; AC=8/8; VER=2/8; landing=2; prod-files=4; scope=M; deps=MTR-14; writeset=串行于MTR-14; release=independent; split-from=MTR-14; exception=parser.rs同轴原因词`
66146616

66156617
### Task MTR-52: Capture schema解释范围
66166618

‎docs/plan/plan-long.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**MTR-51 本地验收(2026-11-05):** manifest 资源完整性在 `ceres::traces::manifest`,投影接入 `jupiter::service::trace_projection_service`。已声明资源按 part 顺序核对路径、OID、Git 类型和 `byte_len`,以及资源总长度和 content hash;任一不符只把该 checkpoint 标为 invalid,不删除归档。没有 `entries` 的 manifest 仍只做布局解析。稳定原因词加在 `parser.rs` 的 `InvalidCheckpoint` 上,与布局原因同一枚举,属同轴 ER-03,已写入本卡 I。VER-1 9 passed、VER-2 1 passed,真实 Libra H2 pack 的 checkpoint 仍解析成功。nightly fmt 与 strict clippy exit 0。全量 `source .env.test && cargo test --all` exit 0:24 targets、3208 passed、0 failed、3 ignored。`cargo build` 与 `cargo build --tests` 完成;macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.97`。签名提交、标注 tag、Release 和 main/tag D 尚未取得,不记 done。用户免交叉 Review,不记 Review PASS。`DEBT-MTR98-ROLLBACK-BOUND` 仍 open。以下旧段保留其时点。
2+
13
**MTR-14 本地验收(2026-11-05):** checkpoint 布局解析在 `ceres::traces::parser`,按 commit 投影在 `jupiter::service::trace_projection_service`。路径 ID 取 `checkpoint/<prefix>/<rest>` 的拼接,tree OID 取原始 Git tree 条目。解析失败只记 invalid,不删除归档。VER-1 2 passed、VER-2 3 passed,其中真实 Libra H2 pack 33 个对象、tip `d9bf5910abfdcd70f6ba5ec0ec1c69ba453075f7` 的三个 checkpoint 均解析成功。nightly fmt 与 strict clippy exit 0。全量 `source .env.test && cargo test --all` exit 0:24 targets、3198 passed、0 failed、3 ignored。`cargo build` 与 `cargo build --tests` 完成;macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.96`。签名提交 `beba781c90872f4c7025049069b7eb06ad19e019`、标注 tag `v0.42.96` 与 [Release](https://github.com/gitmono-dev/mega2/releases/tag/v0.42.96) 已核。main Harbor [42022843962](https://github.com/gitmono-dev/mega2/actions/runs/42022843962) 与 tag Docker [42022929350](https://github.com/gitmono-dev/mega2/actions/runs/42022929350) 的 amd64、arm64 和 manifest 均实际 success。Lifecycle 为 `done` / `complete`。用户免交叉 Review,不记 Review PASS。`DEBT-MTR98-ROLLBACK-BOUND` 仍 open。以下旧段保留其时点。
24

35
**FIX29 与 MTR12/H1 实际收口(2026-11-04 UTC):** FIX-MTR-29 `done/complete`:最终完整 C 五门 exit 0、0 warning,24 targets 3193 passed/0 failed/3 原 ignored;33 个实际 Local 根、528 项条件创建证明,首次后检保护原 277 库和当时 H1。C 收据 SHA256 `03ccdf3d837b3d29cb15de82b622857cbbe862554d26b8cdf11ea6e731a26198`。签名+DCO 提交 `4a0e26984d2e01c711be9f60550b085b91b15733`、原生签名标注 tag `v0.42.95` 和 [Release](https://github.com/gitmono-dev/mega2/releases/tag/v0.42.95) 已核;main Harbor [41857267478](https://github.com/gitmono-dev/mega2/actions/runs/41857267478) 与 tag Docker [41857329075](https://github.com/gitmono-dev/mega2/actions/runs/41857329075) 的 amd64、arm64 和 manifest 均实际 success,D 收据 SHA256 `d5bab2e576e9e5de0102f123cfecf25156f20f950af6bba33ff12606d98bba20`。原生 tag 验签成功;GitHub 显示 unknown_key,不冒称 GitHub Verified。用户免交叉 Review,不记 Review PASS。

‎docs/plan/plan-status.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**MTR-51 本地验收(2026-11-05):** manifest 资源完整性在 `ceres::traces::manifest`,投影接入 `jupiter::service::trace_projection_service`。已声明资源按 part 顺序核对路径、OID、Git 类型和 `byte_len`,以及资源总长度和 content hash;任一不符只把该 checkpoint 标为 invalid,不删除归档。没有 `entries` 的 manifest 仍只做布局解析。稳定原因词加在 `parser.rs` 的 `InvalidCheckpoint` 上,与布局原因同一枚举,属同轴 ER-03,已写入本卡 I。VER-1 9 passed、VER-2 1 passed,真实 Libra H2 pack 的 checkpoint 仍解析成功。nightly fmt 与 strict clippy exit 0。全量 `source .env.test && cargo test --all` exit 0:24 targets、3208 passed、0 failed、3 ignored。`cargo build` 与 `cargo build --tests` 完成;macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.97`。签名提交、标注 tag、Release 和 main/tag D 尚未取得,不记 done。用户免交叉 Review,不记 Review PASS。`DEBT-MTR98-ROLLBACK-BOUND` 仍 open。以下旧段保留其时点。
2+
13
**MTR-14 本地验收(2026-11-05):** checkpoint 布局解析在 `ceres::traces::parser`,按 commit 投影在 `jupiter::service::trace_projection_service`。路径 ID 取 `checkpoint/<prefix>/<rest>` 的拼接,tree OID 取原始 Git tree 条目。解析失败只记 invalid,不删除归档。VER-1 2 passed、VER-2 3 passed,其中真实 Libra H2 pack 33 个对象、tip `d9bf5910abfdcd70f6ba5ec0ec1c69ba453075f7` 的三个 checkpoint 均解析成功。nightly fmt 与 strict clippy exit 0。全量 `source .env.test && cargo test --all` exit 0:24 targets、3198 passed、0 failed、3 ignored。`cargo build` 与 `cargo build --tests` 完成;macOS `ld` `__eh_frame` 按 2026-09-26 决定不计警告。版本 `0.42.96`。签名提交 `beba781c90872f4c7025049069b7eb06ad19e019`、标注 tag `v0.42.96` 与 [Release](https://github.com/gitmono-dev/mega2/releases/tag/v0.42.96) 已核。main Harbor [42022843962](https://github.com/gitmono-dev/mega2/actions/runs/42022843962) 与 tag Docker [42022929350](https://github.com/gitmono-dev/mega2/actions/runs/42022929350) 的 amd64、arm64 和 manifest 均实际 success。Lifecycle 为 `done` / `complete`。用户免交叉 Review,不记 Review PASS。`DEBT-MTR98-ROLLBACK-BOUND` 仍 open。以下旧段保留其时点。
24

35
**FIX29 与 MTR12/H1 实际收口(2026-11-04 UTC):** FIX-MTR-29 `done/complete`:最终完整 C 五门 exit 0、0 warning,24 targets 3193 passed/0 failed/3 原 ignored;33 个实际 Local 根、528 项条件创建证明,首次后检保护原 277 库和当时 H1。C 收据 SHA256 `03ccdf3d837b3d29cb15de82b622857cbbe862554d26b8cdf11ea6e731a26198`。签名+DCO 提交 `4a0e26984d2e01c711be9f60550b085b91b15733`、原生签名标注 tag `v0.42.95` 和 [Release](https://github.com/gitmono-dev/mega2/releases/tag/v0.42.95) 已核;main Harbor [41857267478](https://github.com/gitmono-dev/mega2/actions/runs/41857267478) 与 tag Docker [41857329075](https://github.com/gitmono-dev/mega2/actions/runs/41857329075) 的 amd64、arm64 和 manifest 均实际 success,D 收据 SHA256 `d5bab2e576e9e5de0102f123cfecf25156f20f950af6bba33ff12606d98bba20`。原生 tag 验签成功;GitHub 显示 unknown_key,不冒称 GitHub Verified。用户免交叉 Review,不记 Review PASS。

0 commit comments

Comments
 (0)