Skip to content

Commit 87eed19

Browse files
committed
feat(traces): release 0.42.36 with two protocol budget constants
Declare TracesProtocolLimits::MAX_OBJECT_BYTES and MAX_METADATA_BYTES. They are not config fields. MTR-76 stays in progress until its tag Docker result is recorded. Signed-off-by: ELi Ma <eli@patch.sh>
1 parent ebfcd69 commit 87eed19

11 files changed

Lines changed: 60 additions & 22 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.35"
3+
version = "0.42.36"
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/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ One line of purpose and the key entries per section; full comments and defaults
104104
- **`[agent_capture]`**: optional Agent Session Capture API for sessions, events, checkpoints, transcripts, and file-operation records; it is independent of Git push. Configure `enabled`, `tenant_id` / `deployment_id`, and `[[agent_capture.ingest_tokens]]` (name / token / paths). Available only in storage-only mode; enabling requires explicit `git.push_auth` and at least one separate ingest token. See the [Agent Capture configuration and API reference](./refactoring/agent-capture.md) (Chinese).
105105
- **`[storage_events]`**: outbound events for committed writes (default off). `enabled` (requires storage-only), `installation_id` (required, never auto-generated), numeric bounds for concurrency / timeouts / graceful shutdown, `[[storage_events.targets]]` (id / https url / `secret_ref` HMAC / events / filter lists). The commented sample and `config validate` describe supported values and validation.
106106
- **`[github_sync]`**: GitHub outbound sync (default off). `enabled`, `ssh_host` / `ssh_user` / `ssh_host_key`, `ssh_key_ref` (a SecretRef string — never put the private key itself here), four timeouts, `[[github_sync.bindings]]` (id / path / remote). See [`config.toml`](../config/config.toml) for the full schema.
107-
- **`[traces]`**: traces archive switch, default `enabled = false` in every sample profile. `server_id` is an operator UUID and is required only when enabled; the process never generates it. `scope` is an optional operator label. Changing any of these requires a restart. Protocol budgets are not config fields. The contract is [`refactoring/traces.md`](./refactoring/traces.md).
107+
- **`[traces]`**: traces archive switch, default `enabled = false` in every sample profile. `server_id` is an operator UUID and is required only when enabled; the process never generates it. `scope` is an optional operator label. Changing any of these requires a restart. Protocol budgets are not config fields. The code now fixes `TracesProtocolLimits::MAX_OBJECT_BYTES` at 67108864 and `TracesProtocolLimits::MAX_METADATA_BYTES` at 1048576; the rest of the contract table is still declared by later cards. The contract is [`refactoring/traces.md`](./refactoring/traces.md).
108108

109109
## 5. Fail-closed startup validation
110110

‎docs/configuration.zh.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mega2 --config /etc/mega2/config.toml config secret check redis.url \
104104
- **`[agent_capture]`**:可选 Agent Session Capture 接口,保存会话、事件、checkpoint、transcript 与文件操作记录;它独立于 Git push。`enabled` + `tenant_id` / `deployment_id` + `[[agent_capture.ingest_tokens]]`(name / token / paths)。仅 storage-only 可用;开启需显式 `git.push_auth` 与至少一个独立 ingest token。配置和 API 见 [`refactoring/agent-capture.md`](./refactoring/agent-capture.md)。
105105
- **`[storage_events]`**:已提交写入的出站事件(默认关)。`enabled`(要求 storage-only)、`installation_id`(必填、不自动生成)、并发 / 超时 / 优雅关闭数值界、`[[storage_events.targets]]`(id / https url / `secret_ref` HMAC / events / 过滤器列表)。冻结校验规则见 [`refactoring/config.md`](./refactoring/config.md) 与 [`refactoring/storage-events.md`](./refactoring/storage-events.md)。
106106
- **`[github_sync]`**:GitHub 出站同步(默认关)。`enabled`、`ssh_host` / `ssh_user` / `ssh_host_key`、`ssh_key_ref`(SecretRef 字符串,勿写私钥本体)、四个超时、`[[github_sync.bindings]]`(id / path / remote)。见 [`refactoring/github-sync.md`](./refactoring/github-sync.md)。
107-
- **`[traces]`**:traces 归档开关。所有示例 profile 的 `enabled` 都是 `false`。`server_id` 是操作者写入的 UUID,只在启用时必填,进程不会自行生成。`scope` 是可选的操作者标签。这三项变更都需要重启。协议预算不是配置字段。契约见 [`refactoring/traces.md`](./refactoring/traces.md)。
107+
- **`[traces]`**:traces 归档开关。所有示例 profile 的 `enabled` 都是 `false`。`server_id` 是操作者写入的 UUID,只在启用时必填,进程不会自行生成。`scope` 是可选的操作者标签。这三项变更都需要重启。协议预算不是配置字段。代码目前把 `TracesProtocolLimits::MAX_OBJECT_BYTES` 固定为 67108864,把 `TracesProtocolLimits::MAX_METADATA_BYTES` 固定为 1048576;契约表里的其余常量仍由后续卡声明。契约见 [`refactoring/traces.md`](./refactoring/traces.md)。
108108

109109
## 5. 启动期 fail-closed 校验
110110

‎docs/plan/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@
5252
| [`plan-20260918.md`](plan-20260918.md) | 日期计划 | **已完成**(文件删移与 Tag 契约跟进。**FT-01..FT-09 全部 done/complete**:契约冻结(FT-01)、`is_directory` 文件删移(FT-02/03 → v0.10.45/v0.10.46;各自 docker 因 #13 path-dep 红,前滚 FIX 由 v0.11.0 证明)、GET `/tags/list` + POST 405(FT-04,v0.11.0)、`mega_tag.path`(FT-05,v0.11.1)、`(path, name)` 隔离(FT-06,v0.11.2)、compose 黑盒(FT-07,v0.11.3,docker job `35276552098`)、Libra pin 重钉(FT-08,`61679e5`)、索引与 60917 DEFER 改指(FT-09)。关闭 60917 `DEFER-LB-01/02/03` 与 `DEFER-LB-11` 隔离面;不关闭 `DEFER-LB-11` 目标归属(`DEFER-FT-02`)与 `DEFER-LB-04..10`。不新增 PT。不改 `../libra/**`) |
5353
| [`plan-20261001.md`](plan-20261001.md) | 日期计划 | **已完成**(storage-only OCI / Artifacts / Libra compose 黑盒:77 张非延后任务卡全部 `done/complete`;54 个稳定 case 逐案 PASS,其中默认栈 OCI 12/12、Artifacts 14/14、Libra 24/24,4 个 opt-in case 独立 PASS 并恢复默认栈;`interop-smoke`、共享 runner、opt-in helper 与产品修复已交付;`DEFER-DR-06` 已关闭。最后发布 `v0.41.72`,Docker job `111617454080` success。最终验证见计划「完成判据」;已知 macOS test-target linker warning 沿用此前用户确认的平台噪音例外) |
5454
| [`plan-20261002.md`](plan-20261002.md) | 日期计划 | **已完成**(36/36 卡完成)。历史投影视图 P0:HP-01…HP-25、HP-27…HP-35 与 FIX-HP-01 的实现、本地验收、复审及 34 个版本的提交/tag/人工 GitHub Release 已完成;HP-26 计划收口已完成(`done` / `complete`)。六张卡的历史 Docker D 组绿灯保留为事实;其余发布卡按模板 v2.2 的 `EX-HP-01` 延期 D 组,Docker 发布不作为本计划完成证据,其后续核对由 `DEFER-HP-20` 承接。设计契约见 [`../refactoring/history-projection.md`](../refactoring/history-projection.md);P1/P2 留在 PT-14。 |
55-
| [`plan-20261015.md`](plan-20261015.md) | 日期计划 | **2026-10-17 20:43:41 UTC:MTR-50 为 done/complete(v0.42.35,`e8bc7cb`,Docker run `39066690076` success)。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。下一张卡是 MTR-76。** 历史:**2026-10-17 20:22:35 UTC:MTR-50 当时为 in-progress/locally-accepted(v0.42.35,Docker D 未取得)。** 历史:**2026-10-17 19:11:57 UTC:MTR-04 为 done/complete(v0.42.34,`ce1fe9d`,Docker run `39060072328` success)。** 历史:**2026-10-17 17:02:25 UTC:MTR-72 为 done/complete(v0.42.33,`d6e3cb0`,Docker run `39051067466` success)。** 历史:**2026-10-17 16:10:00 UTC:VER-1..8 exit 0,全量尚未记入。** 历史:**2026-10-17:MTR-70 为 done/complete(v0.42.32,`35d5457`,Docker run `39045161292` success)。** 历史:**2026-10-17:MTR-03 为 done/complete(v0.42.31,`959c1e2`,Docker run `39039264618` success)。** 历史:**2026-10-17:MTR-02 为 done/complete(v0.42.30,Docker run `39034027014` success)。MTR-01 继承该 C/D,为 done/complete。** 历史:**2026-10-16:G-13 退出,FIX3 仍 blocked,恢复窗已执行,AC-1 未勾选,formal0/95。** 历史迁机WIP检查点(2026-10-15 17:20:26 UTC):按用户最新“提交mega2和libra所有内容、换机继续开发”要求,拟保存到 `handoff/scoped-traces-20261016`;这是明确的未发布工作保存,root仅将最新指令解释为原G13不推送窗口的传输范围变更,不是模板EX或正式任务发布。FIX3测试代码GREEN SHA `2b7cdd4ab78dd335dcd711be7d454aa30c11db34609a9c86ca43602b5eb60e4b`:受控旧10秒目标RED101、新180秒GREEN1/1、原exact1/1、默认module8/8、fmt0、strictClippy0;生产prefix未改、临时observer已撤回。C2具体DB机制未知,第四oracle归属仍是source/control-flow/runtime推断与root本地判断,own实施ER05/G13最终准入未取得。B8于17:13:38..17:13:42 UTC实际exit1,仅因plan-status引用空行尾空格触发native diff --check exit2;B报告SHA `57a4b782717c2a1295a7471094fb46b963ba06514a6ff1b102b9dbdbb45b4e20`、日志SHA `56c77d16bea5e9e872d657aa8ac09e6488f827ed21bc024f31ecd230c441401d`。3诊断/8AB名额已耗尽且STOP保留,不重跑、不重置、不晋升;FIX3现blocked/空,FIX4、MTR01及LTR01继续blocked,formal0/95与0/26。尾空格只作交接卫生修正,后续diff检查或交接审查不能补记原B8成功。版本保持0.42.27,不改main远端、不创建版本tag/Release。 [Libra对偶](../../../libra/docs/development/plan/plan-20261015.md);[共享契约](../refactoring/traces.md) |
55+
| [`plan-20261015.md`](plan-20261015.md) | 日期计划 | **2026-10-17 21:33:14 UTC:MTR-76 为 in-progress/locally-accepted(v0.42.36,Docker D 未取得)。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。** 历史:**2026-10-17 20:43:41 UTC:MTR-50 为 done/complete(v0.42.35,`e8bc7cb`,Docker run `39066690076` success)。** 历史:**2026-10-17 20:22:35 UTC:MTR-50 当时为 in-progress/locally-accepted(v0.42.35,Docker D 未取得)。** 历史:**2026-10-17 19:11:57 UTC:MTR-04 为 done/complete(v0.42.34,`ce1fe9d`,Docker run `39060072328` success)。** 历史:**2026-10-17 17:02:25 UTC:MTR-72 为 done/complete(v0.42.33,`d6e3cb0`,Docker run `39051067466` success)。** 历史:**2026-10-17 16:10:00 UTC:VER-1..8 exit 0,全量尚未记入。** 历史:**2026-10-17:MTR-70 为 done/complete(v0.42.32,`35d5457`,Docker run `39045161292` success)。** 历史:**2026-10-17:MTR-03 为 done/complete(v0.42.31,`959c1e2`,Docker run `39039264618` success)。** 历史:**2026-10-17:MTR-02 为 done/complete(v0.42.30,Docker run `39034027014` success)。MTR-01 继承该 C/D,为 done/complete。** 历史:**2026-10-16:G-13 退出,FIX3 仍 blocked,恢复窗已执行,AC-1 未勾选,formal0/95。** 历史迁机WIP检查点(2026-10-15 17:20:26 UTC):按用户最新“提交mega2和libra所有内容、换机继续开发”要求,拟保存到 `handoff/scoped-traces-20261016`;这是明确的未发布工作保存,root仅将最新指令解释为原G13不推送窗口的传输范围变更,不是模板EX或正式任务发布。FIX3测试代码GREEN SHA `2b7cdd4ab78dd335dcd711be7d454aa30c11db34609a9c86ca43602b5eb60e4b`:受控旧10秒目标RED101、新180秒GREEN1/1、原exact1/1、默认module8/8、fmt0、strictClippy0;生产prefix未改、临时observer已撤回。C2具体DB机制未知,第四oracle归属仍是source/control-flow/runtime推断与root本地判断,own实施ER05/G13最终准入未取得。B8于17:13:38..17:13:42 UTC实际exit1,仅因plan-status引用空行尾空格触发native diff --check exit2;B报告SHA `57a4b782717c2a1295a7471094fb46b963ba06514a6ff1b102b9dbdbb45b4e20`、日志SHA `56c77d16bea5e9e872d657aa8ac09e6488f827ed21bc024f31ecd230c441401d`。3诊断/8AB名额已耗尽且STOP保留,不重跑、不重置、不晋升;FIX3现blocked/空,FIX4、MTR01及LTR01继续blocked,formal0/95与0/26。尾空格只作交接卫生修正,后续diff检查或交接审查不能补记原B8成功。版本保持0.42.27,不改main远端、不创建版本tag/Release。 [Libra对偶](../../../libra/docs/development/plan/plan-20261015.md);[共享契约](../refactoring/traces.md) |

‎docs/plan/plan-20261015.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
- MTR-70 为 `done` / `complete`(2026-10-17 15:42:03 UTC)。发布提交 `35d545780ab79534e42bff3f719b6f3f7066acf7`,annotated tag `v0.42.32`,Release https://github.com/gitmono-dev/mega2/releases/tag/v0.42.32 。tag Docker run `39045161292` 的 amd64、arm64 与 job `docker` 均为 success。main Harbor run `39045116559` conclusion 为 cancelled,不代替该 tag Docker。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。下一张卡是 MTR-72。LTR-01 未开工。不推送 Libra,也不改 Libra 计划。
1919
- MTR-72 为 `done` / `complete`(2026-10-17 17:02:25 UTC)。发布提交 `d6e3cb0ec9b13486e203c6c5918db9e1e33da620`,annotated tag `v0.42.33`,Release https://github.com/gitmono-dev/mega2/releases/tag/v0.42.33 。tag Docker run `39051067466` 的 amd64、arm64 与 job `docker` 均为 success。main Harbor run `39051034098` 在收口时仍为 in_progress,不代替该 tag Docker。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。LTR-01 未开工。不推送 Libra,也不改 Libra 计划。
2020
- MTR-04 为 `done` / `complete`(2026-10-17 19:11:57 UTC)。发布提交 `ce1fe9de3e8548c08379f169cd7ac248000096cc`,annotated tag `v0.42.34`,Release https://github.com/gitmono-dev/mega2/releases/tag/v0.42.34 。tag Docker run `39060072328` 的 amd64、arm64 与 job `docker` 均为 success。main Harbor run `39060049106` conclusion 为 success,不代替该 tag Docker。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。LTR-01 未开工。不推送 Libra,也不改 Libra 计划。
21-
- MTR-50 为 `done` / `complete`(2026-10-17 20:43:41 UTC)。发布提交 `e8bc7cb2a8e8e7703f3e5adb039802df83c25bc7`,annotated tag `v0.42.35`,Release https://github.com/gitmono-dev/mega2/releases/tag/v0.42.35 。tag Docker run `39066690076` 的 amd64、arm64 与 job `docker` 均为 success。本收口不再次 bump。main Harbor run `39066628504` conclusion 为 success,不代替该 tag Docker。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。下一张卡是 MTR-76。LTR-01 未开工。不推送 Libra,也不改 Libra 计划。
21+
- MTR-50 为 `done` / `complete`(2026-10-17 20:43:41 UTC)。发布提交 `e8bc7cb2a8e8e7703f3e5adb039802df83c25bc7`,annotated tag `v0.42.35`,Release https://github.com/gitmono-dev/mega2/releases/tag/v0.42.35 。tag Docker run `39066690076` 的 amd64、arm64 与 job `docker` 均为 success。本收口不再次 bump。main Harbor run `39066628504` conclusion 为 success,不代替该 tag Docker。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。LTR-01 未开工。不推送 Libra,也不改 Libra 计划。
22+
- MTR-76 为 `in-progress` / `locally-accepted`(2026-10-17 21:33:14 UTC)。版本面 `0.42.36`。VER-1 `cargo test -p mega2 --lib config::tests::protocol_limits_76_ -- --test-threads=1` 为 1 passed / 0 failed,exit 0。fmt、clippy、`cargo build`、`cargo build --tests` 与 `source .env.test && cargo test --all` 均为 exit 0(全量 2026-10-17T20:58:15Z–21:31:15Z,库测试 2583 passed / 0 failed / 3 ignored)。Claude 转录 SHA256 `1b1e4d6e5e27c06a235a97ed8e1e77530b290514f673f7e7536990dfaea13a63`,Codex 转录 SHA256 `8f67bb204dd3b9e9533dc08fbd6da2bad8c300b2527f411446c96dcab6ed7131`,双方 `VERDICT: PASS`,P0=0,P1=0。推送、tag、Release 与 Docker D 尚未取得,不记 `done` / `complete`。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。LTR-01 未开工。不推送 Libra,也不改 Libra 计划。
2223

2324
### 本机现场
2425

@@ -1388,22 +1389,22 @@ AC1..4是发布前四前置source资格;AC5..8在合法bump之后、C③三门
13881389

13891390
**Task type:** `implementation`
13901391

1391-
**Lifecycle / Acceptance:** `pending` / 空
1392+
**Lifecycle / Acceptance:** `in-progress` / `locally-accepted`
13921393

13931394
**Description:** 首版固定预算;本卡只增加TracesProtocolLimits::MAX_OBJECT_BYTES, TracesProtocolLimits::MAX_METADATA_BYTES。 在既有src/config/model.rs首次声明pub零尺寸TracesProtocolLimits及本卡associated constants;不添加TracesConfig字段、serde/default或TOML配置入口。config/mod.rs已有pub use model::*,不用新父注册。 所有value源自唯一共享契约,不存在13个operator override;Config仅负责enabled/server/principal/scope等既有配置。50已注册的known_fields白名单不包含git_limits/query_defaults或这些预算scalar,已有unknown-field gate拒绝尝试override。实际consumer与capability mapper只读取这些同名常量,不能另写默认literal。
13941395

13951396
**Out of scope:** 本卡只负责声明行为;不重新实现22字段mapper或引入operator预算override;request limit/max_bytes自选与73 GIN维护预算保留。
13961397

1397-
**Current evidence:** src/config/mod.rs:30 pub use model::*、:707 mod tests;src/config/validate.rs:2118 known_fields(执行日刷新;此时53未执行,不引用未来DTO)。
1398+
**Current evidence:** **2026-10-17 21:33:14 UTC。** VER-1 `cargo test -p mega2 --lib config::tests::protocol_limits_76_ -- --test-threads=1` 为 1 passed / 0 failed,exit 0。`cargo +nightly fmt --all --check`、`cargo clippy --all-targets --all-features -- -D warnings`、`cargo build`、`cargo build --tests` 均为 exit 0。`source .env.test && cargo test --all` 于 2026-10-17T20:58:15Z 起跑、21:31:15Z 结束,TEST_ALL_EXIT 0。库测试 2583 passed / 0 failed / 3 ignored。版本面 `0.42.36`。`TracesProtocolLimits` 是零尺寸 enum,只声明 `MAX_OBJECT_BYTES = 67108864` 与 `MAX_METADATA_BYTES = 1048576`,不是 Config 字段,没有 serde 或 TOML 入口。`known_fields` 仍拒绝这两个键。ER-05:Claude 转录 SHA256 `1b1e4d6e5e27c06a235a97ed8e1e77530b290514f673f7e7536990dfaea13a63`(去掉末尾 `CLAUDE_EXIT:0`),Codex 转录 SHA256 `8f67bb204dd3b9e9533dc08fbd6da2bad8c300b2527f411446c96dcab6ed7131`(去掉末尾 `CODEX_EXIT:0`)。双方 `VERDICT: PASS`,P0=0,P1=0。书面接受 Claude 一条 P2,不在本发布修改:测试核对错误文本含字段名,不核对整句。推送、tag、Release 与 Docker D 尚未取得,不记 `done` / `complete`。FIX-MTR-03 的 AC-1 与 VER-5 未勾选。
13981399

13991400
**Acceptance criteria:**
14001401

1401-
- [ ] AC-1: TracesProtocolLimits::MAX_OBJECT_BYTES固定等于67108864。
1402-
- [ ] AC-2: TracesProtocolLimits::MAX_METADATA_BYTES固定等于1048576。
1402+
- [x] AC-1: TracesProtocolLimits::MAX_OBJECT_BYTES固定等于67108864。
1403+
- [x] AC-2: TracesProtocolLimits::MAX_METADATA_BYTES固定等于1048576。
14031404

14041405
**Verification:**
14051406

1406-
- [ ] VER-1: `cargo test -p mega2 --lib config::tests::protocol_limits_76_ -- --test-threads=1`(new;逐constant值及既有unknown-field override拒绝回归,nonzero,不需DB)。
1407+
- [x] VER-1: `cargo test -p mega2 --lib config::tests::protocol_limits_76_ -- --test-threads=1`(new;逐constant值及既有unknown-field override拒绝回归,nonzero,不需DB)。
14071408

14081409
**Dependencies:** `MTR-50`;当卡入口/源码自足可用,不等后置H3/H5或整仓release。
14091410

0 commit comments

Comments
 (0)