Repository navigation
refactor(tui): delete the code that the session-store removal left unused in pi-shell (plan decision 10) - #27
Merged
Conversation
…pt that nothing loads Nothing in the tree names these 15 files any more (git grep by file name: no hit). The last code that loaded them was removed with the Rust agent runtime in 455527c (#7); the files stayed, and rustc cannot see a file that no `include_str!` names, so no warning reported them. pi-shell/src/session/templates/ (14 Markdown prompt templates for the goal mode) and pi-shell/src/session/workflows/deep_research.rhai (584 lines). 15 files, 1,033 lines. No Rust code changes.
…elpers of pi-shell The call graph (scripts/tui_callgraph.py units) reports both as dead: nothing in the consumer build (pi-pager-bin, pi-pager-minimal, pi-update) reaches them. rustc does not warn, because what they hold is `pub(crate)` or a re-export. session::worktree (359 lines): a glob re-export of pi_workspace::worktree, two `From` impls between the shell's WorktreeType and the workspace's (nothing calls them), and 24 tests of types and functions that live in pi-workspace (serde shapes, build_candidate_list, BackgroundCopyContext, resolve_worktree_by_id_or_path). session::helpers (3 files, 61 lines): comments, and two tests of string shapes. The two `resolve_worktree_by_id_or_path` tests were the ones that opened worktrees.db in whatever GROK_HOME held; they are gone with the unit. pi-shell tests: 864 -> 838. pi_workspace::worktree has no user left in pi-shell after this; that is left for plan D.8.
`[storage] cleanup_ttl_days` set how long old session files were kept. The code that read it went with the session store (#26), and the pager keeps no session file now. `StorageConfig` and the `storage` field of `Config` are deleted. A config file that still has the section loads. The section is reported as unrecognized, like any other unknown section: a new test pins that, and the "valid config" test no longer lists the section. `storage_mode` (the `--storage-mode` flag and `Config.storage_mode`) is a different setting. This change does not touch it.
`util::config::worktree` holds a `WorktreeType` enum (with `FromStr` and a `From` impl for `CreationMode`). Its one user was `session::worktree`, which the previous commit deletes. The baseline `check` shows it: the glob re-export of the module is an unused import (1 warning; the ceiling is 0). `pi-workspace` and `pi-workspace-types` have their own `WorktreeType` and do not use this one. The module has one test, `test_worktree_type_fromstr`; it goes with it. `pi-shell` has no other reference to `pi_fast_worktree` now, so that dependency goes in the next commit.
…e names Ten dependencies of `pi-shell` are not named in any source file of the crate outside comments (a text scan of `src/`, `tests/` and `build.rs`; the compiler has the last word): - `[dependencies]`: `urlencoding`, `base64`, `pi-fast-worktree`, `pi-compaction-transcript`, `pi-workflow`, `tdigests`, and `nix` (unix only). - `[dev-dependencies]`: `pretty_assertions`, `pi-test-utils`, `tokio-util`. Eight lost their last user in #26 (the session store). `pi-fast-worktree` lost its last users in `session::worktree` and `util::config::worktree` (this branch), and `tokio-util` in the tests of `session::worktree`. The dependency graph of `pi-pager-bin` goes from 980 to 970 packages on Linux: `pi-workflow` (a crate of this workspace; no other crate depends on it now) and nine packages from the registry (`tdigests`, `rhai`, `rhai_codegen`, `smartstring`, `thin-vec`, `const-random`, `const-random-macro`, `crunchy`, `tiny-keccak`). `Cargo.lock` loses `tdigests` and ten dependency lines. The other packages stay in the lock file, because `pi-workflow` is still a member of the workspace. `THIRD-PARTY-NOTICES` loses 5 entries (it lists the packages that ship on any platform; `tui_notices.py check`: 984 of 984).
…i-shell - `[gates.residue]`: `leader` 245 -> 243 and `x.ai` 304 -> 297. The deletions of #26 removed those lines; `check` has said "lower the ceiling" since then. - `[graph.max_nodes]`: 980 -> 970 packages on Linux (the dependency commit of this branch). - `pi-shell` `reference_passed`: 864 -> 838. The tests of `session::worktree` (24, Unix only), `session::helpers` (2) and `util::config::worktree` (1) are gone, and one test is new (a `[storage]` section is reported as unrecognized). The ten references add up to 8,488 (8,514 before). A local run on Linux (WSL2) gives: `check` with 0 warnings, 970 packages, `leader` 243 and `x.ai` 297; the ten test suites 8,487 passed and 1 failed (the known `tmux_probe` test of `pi-pager-render`); `tui_notices.py check` 984 of 984.
… store left in pi-shell) - CHANGELOG.md: the entry for the third cleanup of pi-shell (15 files, three modules, the [storage] setting, 10 dependencies). It also says that the earlier entry left `[storage] cleanup_ttl_days` for this one. - docs/baselines/tui.md: current baseline r16 (tests 8,488, graph 970, `leader` 243, `x.ai` 297) and a column r16 in the table of sizes. The numbers are from local runs (WSL2); the CI numbers of PR #27 follow in a later commit. - docs/baselines/archive/tui-history.md: the r16 paragraph, with the CI numbers of `7d82c27`. - docs/baselines/tui-support.md: made again (`pi-shell` has 7 dead units, 1,008 lines, not 9 and 1,388). - Plan: status r16, next steps, decision 10, D.2, D.8 (new candidates: 7 dead units, the crate `pi-workflow`, `Config.storage_mode`, about 88 files that no code loads), D.9, a new open item "races between tests", the index and the revision list. - Execution log: section 10.19, B.11 (how to repeat the checks) and the r16 revision entry.
…lines `CI` (run 39193752450) and `TUI CI` (run 39193752451) pass on 6bd7db5. `TUI CI`: 8,488 passed, 0 failed, 21 ignored; 970 packages in the graph; `leader` 243, `x.ai` 297; 0 warnings. These are the numbers that section 10.19 of the execution log expected, so only the "to be added" line and the timing bullet change, plus one sentence in each r16 entry. The cargo test job took 17 m 34 s and the gates job 4 m 24 s. The tests themselves took about 54 s of that time.
This was referenced Oct 19, 2026
Merged
zy1233
added a commit
that referenced
this pull request
Oct 25, 2026
…to #31 (plan r19) (#33) The owner asked for three things: merge the five open PRs (#27 to #31) into main with `gh stack`, set the V0.6 milestone from the present state, and pause development for 1 to 2 days. The merge is done (stack #32, `gh stack merge 32 --yes --squash`). main goes from 7d82c27 to b33017a with five squash commits. The tree of each commit is the tree of its PR head. CI and TUI CI pass on b33017a (8,490 passed, 0 failed, 22 skipped). The plan gets a new section "发布里程碑 V0.6": the scope (the 10 commits on main after v0.5.0), six exit conditions with their state, the known issues (two are new), and what is not in V0.6. It also gets the r19 status, the pause, and the fixed status of the places that still said "waiting for merge" for #25 to #28. The execution log gets section 10.22: the install of `gh stack` (the first download was cut short), the merge, the check of the trees, CI on main, the milestone, the pause, and what is not verified. The GitHub milestone v0.6.0 (#2) is created. It has no due date and no PRs, as v0.5.0. No condition is met yet. Only documents change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plan decision 10, follow-up. On 2026-10-19 the owner chose two items: delete the units that the call graph reports dead (
dead_units), and do a small cleanup (small_cleanup). #26 (merged as7d82c27) deleted the session store ofpi-shell. It left code that nothing uses. This PR deletes that code:session::worktreeandsession::helpers, which the call graph reports dead, andutil::config::worktree, which onlysession::worktreeused.[storage]setting (StorageConfig). It heldcleanup_ttl_days, which cleaned the session files of the old Rust agent. No code reads it.pi-shellthat no source file names.It also lowers three ceilings in
scripts/tui_baseline.tomlto the values that the gates measure.Production behaviour does not change. One thing a user can see: a
config.tomlthat still has a[storage]section loads as before, and the section is now reported as an unrecognized key (a warning, not an error).Base:
main(7d82c27). Not merged.Decision 10 has two more parts that this PR does not touch (the owner did not choose them):
load_mcp_servers/util/config/mcp.rs, andpi-pager/src/recent_dirs.rs.What each deletion rests on
7d82c27for the file name without its extension finds nothing outside the template directory. Nothing intui/namesdeep_research. (The Python packagepi-dynamic-workflowshas a workflow with the same name. It builds its script in Python and does not read this file.) The last commit that changed how often these names appear is455527c(Remove the Rust agent runtime from the TUI; keep /model via ACP config options #7). rustc cannot see a file that noinclude_str!names, so it gives no warning. This is a text search.session::worktreeandsession::helpers.scripts/tui_callgraph.py units --crate pi-shell --live pi-pager-bin pi-pager-minimal pi-updatereports them dead. rustc gives no warning: they holdpub(crate)items and one re-export. The two testsresolve_worktree_by_id_or_path_*insession::worktreeare the two that showed the race in refactor(tui): delete the session store of pi-shell (plan decision 10) #26. They are gone. The cause of that race (a namedserialkey does not exclude the default key) is not fixed by this. See "Not verified". The 24 tests of the module tested items ofpi_workspace::worktreethrough the re-exportpub(crate) use pi_workspace::worktree::*(request and response types,build_candidate_list,BackgroundCopyGuard,resolve_worktree_by_id_or_path). Those items stay inpi-workspace. After this change, no file intui/namespi_workspace::worktree.util::config::worktree. The firstcheckrun (on the commit that deletes the two units) gave one warning: an unused import ofworktree::*inutil/config/mod.rs. The only user of that module wassession::worktree. The next commit deletes the module. After it, the warning count is 0.[storage].[storage] cleanup_ttl_dayshas no reader. The new testa_removed_storage_section_is_reported_as_unrecognizedshows that a config with the section still loads and that the section is reported as an unrecognized key. I did not removeConfig.storage_modeand the hidden--storage-modeflag: they are another setting.src/,tests/andbuild.rsofpi-shellfor each name, not counting//comments (the search of refactor(tui): delete the session store of pi-shell (plan decision 10) #26 counted comments, so it missedbase64). The compiler checks each result: after the removal,checkandcargo check --workspace --testspass. On7d82c27the search finds 8 names (urlencoding,base64,pi-compaction-transcript,pi-workflow,tdigests,nix,pretty_assertions,pi-test-utils). After the two dead units go, 2 more (pi-fast-worktree,tokio-util) have no user. Ten packages leave the dependency graph:pi-workflow(a crate of this workspace) and nine registry packages (tdigests,rhai,rhai_codegen,smartstring,thin-vec,const-random,const-random-macro,crunchy,tiny-keccak).Evidence
7d82c27(main).TUI CI: 8,514 passed, 0 failed, 21 ignored; 980 packages in the graph;leader243 of 245,x.ai297 of 304.After:
scripts/tui_baseline.py check(WSL2). First run on the commit that deletes the two units (5 m 03 s): 1 warning, the unused import above. Second run on the source of the dependency commit (3 m 27 s): passes. The consumer build has 0 warnings,--workspace --testshas 0 errors, the graph has 970 packages,leaderis 243 andx.aiis 297, and the pager reads no session file.scripts/tui_notices.py check: 984 of 984. After the removal of the dependencies and beforeupdate --write, it reported 5 stale entries (rhai,rhai_codegen,smartstring,tdigests,thin-vec).scripts/tui_baseline.py test, WSL2, 23 m 56 s, incremental build) on the dependency commit8b146e7: 8,487 passed, 1 known failure (the tmux probe ofpi-pager-render, counted as passed by the manifest), 21 ignored.pi-shell838,pi-pager5,649, the other suites equal theirreference_passed. The later commits change only the manifest and documents. The test count adds up: 864 - 24 (session::worktree, Unix only) - 2 (session::helpers) - 1 (util::config::worktree) + 1 (the new test) = 838.zypiunder a pseudo-terminal (mock model):resume_matrix.py --strict16 PASS / 0 GAP / 0 FAIL,smoke.py23/23,exit_matrix.py12/12,print_exit.py,mode_probe.py,status_line_probe.py4/4,net_audit.py --mock13/13. The binary was built from the same source as8b146e7. refactor(tui): delete the session store of pi-shell (plan decision 10) #26 did not run these again, because its production code did not change. This PR deletes modules and one config field, so they ran again.StorageConfigand theConfig.storagefield back (the reverse of theconfig.rspart of6118888) and rana_removed_storage_section_is_reported_as_unrecognized. It fails (got: []:[storage]is a known section again, so nothing reports it). It passes on the clean tree. Only this one change was tried.pytest(real_llmdeselected) on1a8abee, the same counts as before this PR (it adds no Python test): Windows 2,559 passed, 39 skipped, 31 deselected; Linux (WSL2,rgonPATH) 2,568 passed, 30 skipped, 31 deselected.ruff check .andruff format --check .pass.6bd7db5, all green):CI(run 39193752450): Ruff, andpyteston Python 3.11, 3.12 and 3.13.TUI CI(run 39193752451): 8,488 passed, 0 failed, 21 ignored; 970 packages in the graph;leader243,x.ai297; 0 warnings. The numbers are the ones this PR expected. The runner has 4 vCPU and runs 4 test threads, so a greenTUI CIsays nothing about the races that show only at more threads (see "Not verified").zypi(the Rust and PTY runs are Linux only). Whetherpi-workspacehas its own tests for the cases that the 24 deletedsession::worktreetests covered (they compiled on Unix only). Other places with the same pattern as the race of refactor(tui): delete the session store of pi-shell (plan decision 10) #26 (serial(GROK_HOME)inpi-pager; the named keysforce_dark_wake_env,attribution_emit_countandheap_profile_hooksinpi-shell; tests that readGROK_HOMEand have noserialat all) were not checked. A separate test-only PR will do that. Whetherxai_grok_pager__*.snapfiles and the other files below are really unused is not verified.Not in this PR (found, not deleted)
A text scan found more code and files that nothing seems to use. They are candidates for plan D.8. Nothing was deleted, and nothing was compiled without them.
auth::flow,config::reloader,session::events(591 lines; it has animplforGoalClassifierVerdictTelemetry, so check it first),session::telemetry,session::unified_list,upload,upload::turn.pi-workflow: 9 files, 3,570 lines.tui/Cargo.tomllists it as a member. NoCargo.tomldepends on it.Config.storage_modeand the hidden--storage-modeflag: the flag goes intoStorageMode::resolve, and no.rsfile reads the result.pi-pager/tests/scenarios/(43 files, 70,628 B),pi-pager/npm/(24 files, 73,368 B; this is plan D.7),pi-pager/scripts/install-enterprise.ps1(12,460 B), 9 of the 11 logo files (10,147 B), 11 snapshots with the old crate namexai_grok_pager__*.snap(2,737 B).Merge Danger
Door: two-way
The change deletes code and files that nothing uses, one config field that nothing reads, and 10 dependencies that no source file names. A revert brings all of them back. No data and no wire format change.
Blast Radius: the
tui/tree ofpi-shell,Cargo.lock, the baseline manifest; people who build onpi_shellpi_shell::session::{worktree, helpers},pi_shell::util::config::WorktreeTypeor the fieldConfig.storagestops compiling. Nothing in this repository does: the consumer build andcargo check --workspace --testspass with 0 warnings.config.tomlwith[storage]keeps loading. The section is reported as an unrecognized key at start. A user who setcleanup_ttl_dayssees that warning and nothing else, because nothing read the value.Cargo.lockloses one package (tdigests) and 10 dependency lines.THIRD-PARTY-NOTICESloses 5 entries. The other 9 registry packages stay in the lock file becausepi-workflowis still a workspace member. The size of the release binary was not measured.leader243,x.ai297,pi-shell838 tests). A later change that adds a package, a warning or aleader/x.ailine fails the gate at once. That is what the ratchet is for.session::worktreeare gone (they ran on Unix only). The items they tested are still inpi-workspace. I did not compare these cases with the tests insidepi-workspace.main.