Skip to content

Commit 69932cf

Browse files
committed
docs: record plan decision 10 (the session store of pi-shell is deleted) and r15
Decision 10, storage-layer part: the plan, the execution log (section 10.18, the pointer in appendix B.10, revision r15), the TUI baselines and the CHANGELOG now say that `session::storage` and `session::persistence` of `pi-shell` are gone, with the numbers (53 files under `tui/`, +190 / -14,166; `pi-shell` tests 1,056 -> 864; the sum of `reference_passed` 8,706 -> 8,514) and what was verified and what was not. Section 10.18 also holds the finding behind the test commit 332ba75: the consent test used the named serial key `GROK_HOME`, so it ran at the same time as the `session::worktree` tests and deleted the temporary home that their database lived in. The race is older than this PR (15 of 15 filtered runs fail at c74cc18). Plan D.9 now names one source of `worktrees.db` in the real home. `docs/baselines/tui-support.md` is regenerated (only the commit line changes). `scripts/tui_baseline.toml`: comment only (`pi-shell` 1,056 - 201 + 9 = 864).
1 parent 332ba75 commit 69932cf

7 files changed

Lines changed: 213 additions & 36 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
### Removed
1717

1818
- **The code in the TUI that read session files**: `materialize_startup` and its helpers, the pin of `--resume <title>` before the sandbox (`pin_local_resume_target`), the saved sandbox profile (`SandboxStartup`, `saved_resume_profile`), the check that a `--session-id` is free before `session/new`, the first-prompt fallback of the resume picker (it read `chat_history.jsonl`), the check of the session files in the picker's load, and the read of `<home>/sessions/.../plan.md` for the plan preview. `scripts/tui_baseline.py gates` has a new gate (`gates.session_disk_reads`): it fails when production code in `pi-pager` or `pi-pager-bin` calls the readers of the session store again.
19+
- **The session store of `pi-shell`, and the code that only it used (TUI)**: `pi-shell` still held the code that wrote and read the session files of the old Rust agent (`session::storage` and `session::persistence`). Since the change above, no code in `zypi` calls it. It is deleted. The code that only it used goes with it: the session signals, the plan-mode snapshot, the announcement state, the state types of goals and workflows, the wire tags for replay, the image checks of the load path, `fork_filter_chat`, and the tests of all of these. The compiler found this second group: after the first deletion it gave 41 `dead_code` warnings, and the ceiling is 0. Two helpers that clean a session title stay, because the pager uses them (`session::title`, with 8 unit tests). 14,166 lines go and 190 come, in 53 files under `tui/`. **No behaviour changes.** One test attribute changes (the consent test of `pi-shell` takes the default `serial` key, like the other tests that set `GROK_HOME`): two tests used different keys, so they could run at the same time, and the `session::worktree` test then failed with a SQLite I/O error. That race was already in `c74cc18`; after the deletion it showed in every full run of the suite. The tests of `pi-shell` go from 1,056 to 864, and the sum of `reference_passed` in `scripts/tui_baseline.toml` from 8,706 to 8,514. `[storage] cleanup_ttl_days` is still accepted in the configuration, but nothing reads it now (it cleaned the old session files); a later change takes it out. `gates.session_disk_reads` stays, as a guard against writing the store back.
1920

2021
## [0.5.0] - 2026-10-13
2122

‎docs/PLAN/PLAN-RUST-AGENT-RUNTIME-REMOVAL.md‎

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

‎docs/PLAN/archive/PLAN-RUST-AGENT-RUNTIME-REMOVAL-EXECUTION-LOG.md‎

Lines changed: 176 additions & 6 deletions
Large diffs are not rendered by default.

‎docs/baselines/archive/tui-history.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
## 3. 测试数字
1818

19-
第一段与表是 r5 的原文;后面五段是 r8、r9、r10、r11、r13 的追加,最后一段把测试数同第一次 Linux 运行相比。
19+
第一段与表是 r5 的原文;后面六段是 r8、r9、r10、r11、r13、r15 的追加,最后一段把测试数同第一次 Linux 运行相比。
2020

2121
**Linux(权威)**:手动 run 37389455793(`ac1d3ff`),`test` job 约 27 m;同一提交的 PR run 37389447358 结果相同。`macOS` 一栏的数是 `ac1d3ff` 上的本机轻量运行(`--test-threads=2`,只跑了 `pi-pager`);命令:`env -u NO_COLOR TERM=xterm-256color COLORTERM=truecolor`(沙箱默认的 `NO_COLOR=1`、`TERM=dumb` 会让约 10 个颜色 / 光标断言失败);`PI_HOME` 等变量由清单的 `unset_env` 清掉(`PI_HOME` 的优先级高于配置隔离测试自己设的 `GROK_HOME`,不清掉会让 `test_config_update_isolation` 失败)。**在 WSL 里跑**:克隆放在 ext4 上,不要放在 `/mnt/<盘>`(9p,权限位与时间戳的行为不是 Linux 的);登录脚本常会导出 `PI_HOME`(指向 Windows 一侧的配置目录),绕过执行器直接跑 `cargo test` 或测试二进制会读写那个目录——要么走执行器,要么先 `unset PI_HOME GROK_HOME` 并把 `HOME` 指到一次性目录。
2222

@@ -42,6 +42,8 @@
4242

4343
**`12349d3` 之后的变化(r13,WSL2 实测;分支 `feat/adr1-resolve-startup` 是 PR [#23](https://github.com/zy1233/pi-python/pull/23),分支 `refactor/adr1-drop-session-disk-reads` 是叠在它上面的 PR [#24](https://github.com/zy1233/pi-python/pull/24);两个的 CI 都通过)**:`main` 的 `12349d3` 上 CI 的数是 8,700 通过 / 0 失败 / 22 忽略(`pi-pager` 5,643:#18 加 19 个,#19 加 16 个;清单里 `reference_passed` 当时没改,和仍是 8,665)。PR #23 给 `pi-pager` 加了 32 个用例,5,643 → 5,675:`session_resolve_tests` 25 个、`app/mod.rs` 里 `bounded_resolve` 的 4 个、`python_agent_e2e` 的 3 个。整套 10 个 suite 在同一份克隆上用基线执行器跑了一遍(`506769b`,清环境,`PI_E2E_PYTHON` 与 `PI_E2E_REQUIRED=1`,WSL2,增量编译):**合计 8,730 通过 / 2 失败 / 22 忽略**。那 2 个失败是计时用例:`pi-shell` 的 `auth::manager::lock::tests::dropping_the_guard_silences_the_heartbeat_before_anyone_else_can_hold_the_lock`,与 `pi-pager-render` 里 `known_failures` 的 tmux 探测;那一次机器同时在编译,单独重跑都通过(`pi-shell` 的 `lock::tests` 21 通过 / 1 忽略;`tmux_probe::tests` 7 通过),所以只能说「负载下偶发」,没有查心跳用例的根因。**CI 对账**(PR #23,`506769b`,`TUI CI` [run 38889657279](https://github.com/zy1233/pi-python/actions/runs/38889657279)):10 个 suite 合计 **8,732 通过 / 0 失败 / 22 忽略**(= 8,700 + 32),`pi-pager` 5,675(13 忽略),那 2 个计时用例在 runner 上都通过;`cargo test` job 12 m 20 s,`Gates + cargo check` 3 m 22 s。PR #24 删了读会话文件的代码,`pi-pager` 5,675 → 5,649:少 26 个通过、1 个忽略(`session_startup.rs` 16 个、`cli.rs` 3 个、`session_title_resolve_tests.rs` 8 个;忽略的那个是 `materialize_resume_id_without_chat_still_resolves_on_disk`)。`pi-pager` 与 `pi-pager-bin` 两个 suite 在 PR #24 的代码上用基线执行器跑了一遍(WSL2,增量编译,6 m 39 s):`pi-pager` 5,649 通过 / 0 失败 / 12 忽略,`pi-pager-bin` 21 通过 / 0 失败。整套 10 个 suite 在最终提交(`9600cdf`)上又跑了一遍(清环境,`PI_E2E_PYTHON` 与 `PI_E2E_REQUIRED=1`,WSL2,增量编译,14 m 18 s):**合计 8,705 通过 / 1 个已知失败 / 21 忽略**,退出码 0;已知失败是 `pi-pager-render` 的 tmux 探测(`known_failures`),它在刚链接完的测试二进制的第一次运行里偶发失败(清单里的说明);其余 9 个 suite 都等于各自的 `reference_passed`。清单里 `pi-pager` 的 `reference_passed` 改成 5,649,十个 suite 的和是 8,706(= 8,665 + 35 + 32 − 26),`min_passed` 不变(5,300)。这两个 PR 在 `tui/` 里只改了 `pi-pager` 与 `pi-pager-bin`,其余 8 个 suite 的 crate 没有动。**CI 对账**(PR #24,`79e01ee`,`TUI CI` [run 38896545799](https://github.com/zy1233/pi-python/actions/runs/38896545799)):10 个 suite 合计 **8,706 通过 / 0 失败 / 21 忽略**(= 清单里 `reference_passed` 的和),`pi-pager` 5,649(12 忽略),`pi-pager-bin` 21,`pi-pager-render` 的 tmux 探测在 runner 上通过,本地那一次的已知失败没有再出现;`cargo test` job 16 m 31 s,`Gates + cargo check` 3 m 50 s。
4444

45+
**`c74cc18` 之后的变化(r15,WSL2 实测;分支 `refactor/delete-pi-shell-session-store` 是 PR [#26](https://github.com/zy1233/pi-python/pull/26),叠在 PR [#25](https://github.com/zy1233/pi-python/pull/25) 上)**:`c74cc18`(#25 的头)上,CI 的数是 8,706 通过 / 0 失败 / 21 忽略(`TUI CI` [run 39150839672](https://github.com/zy1233/pi-python/actions/runs/39150839672)),同清单里 `reference_passed` 的和。PR #26 删了 `pi-shell` 里的旧存储层(`session::storage`、`session::persistence`)与只有它们在用的代码,`pi-shell` 1,056 → 864(−192):删掉的文件里有 202 个测试属性,其中 1 个只在 macOS 上编译,所以 Linux 上少 201 个;新加 9 个(`session::title` 的 8 个,`GoalClassifierVerdict` 的 1 个)。其余 9 个 suite 没有变;清单里 `reference_passed` 的和 8,706 → 8,514,`pi-shell` 的 `min_passed` 1,000 → 820。整套 10 个 suite 在同一份克隆上用基线执行器跑了两遍(清环境,`PI_E2E_PYTHON` 与 `PI_E2E_REQUIRED=1`,WSL2,增量编译):压成一个提交之前的 WIP 提交 `43f291f` 上一遍(19 m 28 s),最后一个代码提交 `332ba75` 上一遍(16 m 24 s)。两遍的结果相同:**合计 8,513 通过 / 1 个已知失败 / 21 忽略**(那 1 个是 `pi-pager-render` 的 tmux 探测,清单按通过算它),`pi-pager` 5,649(12 忽略),`pi-shell` 864,其余各 suite 等于各自的 `reference_passed`。中间的提交 `5a39e09` 没有整套的数:那上面单跑 `pi-shell` 的 suite 失败过一次(863 通过 / 1 失败),整个 `--lib` 运行 20 次都失败同一个测试(`session::worktree::tests::resolve_worktree_by_id_or_path_existing_dir_returns_path`)。原因是 `consent` 测试与它的串行键不同,能同时运行;这个竞争在 `c74cc18` 里就有,`332ba75` 修了(一个属性),见计划 [§10.18](../../PLAN/archive/PLAN-RUST-AGENT-RUNTIME-REMOVAL-EXECUTION-LOG.md#1018-r15-追加删-pi-shell-的旧存储层决策-10)。`check`(门禁)在 `5a39e09` 与 `332ba75` 上各跑一遍,全过:依赖图 980,告警 0,残留词 `grok agent` 0 / `leader` 243 / `x.ai` 297。
46+
4547
对比第一次 Linux 运行(10,851 通过 / 75 忽略):少了 3,414 个通过,是随被删功能一起删的用例(`0e71894` 时是 7,478,即 −3,373:`pi-pager` −3,281,`pi-shell` −93,`pi-telemetry` −5;另有 `-p` 沙箱守卫新增的 9 个用例——`pi-shell` +3、`pi-pager-bin` +6——已含在净数里;其后 `5fcec14` 删 `chat_mode` 世界又少 21 个,`ac1d3ff` 删 worktree 对话框又少 20 个,都在 `pi-pager`);`min_passed` 取实测值下方 3–6 %,让今后无意的丢失会失败,有意的删除要改清单。
4648

4749
## 4. 去掉的 `skip`:`doctor_cmd::`

‎docs/baselines/tui-support.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This file is generated. Do not edit it by hand.
44

5-
- Command: `python scripts/tui_callgraph.py keep`. Commit: `2f33815`.
5+
- Command: `python scripts/tui_callgraph.py keep`. Commit: `332ba75`.
66
- Run the command again after a change that moves code between modules or crates.
77
- It replaces the hand-written list of examples in item 0.5 of
88
[`PLAN-RUST-AGENT-RUNTIME-REMOVAL.md`](../PLAN/PLAN-RUST-AGENT-RUNTIME-REMOVAL.md).

0 commit comments

Comments
 (0)