Skip to content

Commit 4a33d1f

Browse files
Merge v0.42.20 upstream into signed MST2 integration
2 parents 7afd1be + 25a53b7 commit 4a33d1f

7 files changed

Lines changed: 871 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.19"
3+
version = "0.42.20"
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/deploy-trunk.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ DELETE FROM mega_view_root_chain_scan;
487487

488488
`recycle-filter` 与 `rebuild-all` 都有显式事务。`COMMIT` 之前的语句失败时,psql 会停止并断开连接,事务不会提交。recycle-filter 只回收目标过滤器的派生提交映射与对象引用,保留对象以供后续清扫;rebuild-all 清掉全部派生状态。两者把过滤器置为回收态:`projected_seq = 0`,且 `ready_seq`、`warming_since` 为 NULL。worker 只为活跃视图(`ready_seq` 或 `warming_since` 非空)执行 catch_up,因此回收态视图会等待重新预热。clear-root-chain-scan 只清暂存表,不改视图状态;下一次根链扩展会按当前的 `main@/` 重新判定。
489489

490-
三段 SQL 都不用 `TRUNCATE`,不删除 `mega_view_filter`、`mega_view` 或 `mega_view_register_log`,也不改 `last_access_at` 与过滤器定义列。rebuild-all 是全表 `DELETE`,停服窗口随派生行数增长。恢复出口的具体操作由 HP-21 补写,本节不表示任何视图 URL 已可用。
490+
三段 SQL 都不用 `TRUNCATE`,不删除 `mega_view_filter`、`mega_view` 或 `mega_view_register_log`,也不改 `last_access_at` 与过滤器定义列。rebuild-all 是全表 `DELETE`,停服窗口随派生行数增长。本节只记录停服运维与恢复语义;视图 Git URL 的对象读取尚未开放。
491491

492492
投影停止时,首个失败点会以 ERROR 事件给出。除 message 外,停止告警字段为 `metric=view_projection_stops_total`、`filter_id`、`s`、`commit_id`、`reason`;当 reason 是 `row_absent` 或 `unparsable` 时还带 `tree_id`。例如:`metric=view_projection_stops_total s=7 reason=row_absent`。按 reason 处理:
493493

@@ -526,3 +526,11 @@ HTTP 服务即可从已提交水位继续。
526526
`GET /api/v1/views?name=agent%2Ftask-1` 按名字查询。名字含 `/` 时须百分号编码;省略 `version` 取最新版本,`&version=1` 可指定版本。响应只含 `filter_id`、`name` 与 `version`。
527527

528528
`GET /api/v1/views/metrics` 返回进程内原子计数与实时查询的 `view_cold_start_slots_in_use`。这些元数据端点不鉴权:视图不是路径级读权限边界(ADR-HP-05)。若 `/api/v1` 暴露给不可信网络,应在反向代理处对 `/api/v1/views` 限流;可热调低 `views.max_append_walk` 以限制每次滞后量查询的回走步数,代价是根链扩展的单次预算也降低。
529+
530+
### 13.3 回收态视图的恢复出口
531+
532+
停服执行 `recycle-filter` 或 `rebuild-all` 后,回收态视图有两个恢复出口:以同一 `filter_spec` 再次 `POST /api/v1/views`,或者由读者访问已启用的视图 URL 触发重新预热。再次注册计入该 token(或 `anonymous`)的注册速率,超限返回 429;读者访问不计速率。两个出口都占冷启动名额,并受 `max_filters` 约束。
533+
534+
名额不足时,注册返回 429;读者访问返回 503 与 `Retry-After`。释放名额,或热调高 `max_filters`、`max_concurrent_cold_starts` 后,可以再次访问。预热期间访问同样返回 503 与 `Retry-After`,就绪后恢复宣告。[`views.enabled`](configuration.md) 为 `false` 时访问返回 404,不触发预热。
535+
536+
`recycle-filter` 之后的视图历史与回收前相同;`rebuild-all` 之后的视图历史可能改变,需要公告。

‎docs/plan/plan-20261002.md‎

Lines changed: 28 additions & 18 deletions
Large diffs are not rendered by default.

‎docs/refactoring/history-projection.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
12. §6.1 的 SSH 错误写出点不能继续按事实基线的旧位置查找:`channel_eof` 在 `src/contract/git_protocol/ssh.rs:425` 固定发退出码 0,upload-pack 与 v2 错误的裸文本写出点见 `src/contract/git_protocol/ssh.rs:602`、`src/contract/git_protocol/ssh.rs:669`、`src/contract/git_protocol/ssh.rs:680`、`src/contract/git_protocol/ssh.rs:695`;此处的修正仅定位源码,不提前改变错误契约。
3939
13. 执行计划「测试」行把 `GIT_CLI_UNAVAILABLE` 标在 `tests/common/git_cli.rs` 约 L20、runner 不可用分支标在约 L440–448;端口分配改造后,常量在 `tests/common/git_cli.rs:21`,该分支在 `tests/common/git_cli.rs:482-537`,仍会在未启用宿主 opt-in 且容器不可用时 panic。
4040
14. 执行计划「文档」行的 `docs/refactoring/integration.md` 迁移覆盖锚点原为 L129–150;增加 compose 黑盒覆盖表后,迁移覆盖章节从 `docs/refactoring/integration.md:143-164` 开始,原行号不再定位该节。
41+
15. §6.1 第 3 层的读者触发重新预热未标(P1),但 §3.3、§7.5 与 §7.4 的阶段描述指向 P1。按执行计划 HP-21 与 ADR-HP-08,P0 实现读者触发的准入;本条只校准阶段归属,不改设计正文的算法与错误契约。
4142

4243
## 当前实现状态速览表
4344

0 commit comments

Comments
 (0)