Skip to content

refactor(tui): remove the unused half of pi-test-support (plan D.5) - #63

Merged
zy1233 merged 2 commits into
refactor/tui-remove-dead-modulesfrom
refactor/tui-trim-test-support
Oct 31, 2026
Merged

zy1233 merged 2 commits into
refactor/tui-remove-dead-modulesfrom
refactor/tui-trim-test-support

Conversation

@zy1233

@zy1233 zy1233 commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Plan phase D.5. pi-test-support has seven modules that no test refers to. They are the mock inference server, the SSE builders, the ACP stdio clients, the headless runner and the counting server: test kit of the Rust agent runtime, which is gone. The workspace builds with its tests without them. They go, with the two helpers that only they called, and with the dependencies that only they needed.

 tui/crates/codegen/pi-test-support/
 ├── Cargo.toml                    # 11 dependencies go
 ├── README.md                     # written again
 └── src/
-    ├── mock_server.rs            # 2,259 lines
-    ├── sse.rs                    # 1,342
-    ├── inference_override.rs     #   678
-    ├── acp_client.rs             #   561
-    ├── headless.rs               #   361
-    ├── scripted.rs               #   174
-    ├── counting_server.rs        #    68
     ├── env.rs                    # grok_binary and git_workdir go; EnvGuard and env_parse stay
     ├── lib.rs                    # the re-exports of the removed modules go
     ├── process.rs                # stays: TestProcess
     ├── resources.rs              # stays: ResourceSnapshot
     └── sandbox.rs                # stays: TestSandbox

Two commits: the code, then the CHANGELOG.md entry. pi-test-support is a dev-dependency of pi-shell, pi-pager and pi-tools (publish = false).

Evidence

  • Before: 14 files in the crate. After: 7 files. 5,646 lines go and 27 come. 47 test functions go with the modules (31 in mock_server, 13 in sse, 3 in headless).
  • Before: pi-shell 838 passed and pi-pager 5,651 passed, 12 skipped (the references of the manifest).
    After: tui_baseline.py test (Linux, WSL2, nextest): pi-shell 838 passed, 0 failed, 1 skipped. pi-pager 5,651 passed, 0 failed, 12 skipped (includes python_agent_e2e). The 23 tests that remain in pi-test-support: 23 passed.
  • tui_baseline.py check on the branch: warnings 0, consumer build exit 0, cargo check --workspace --tests --locked exit 0, graph 970 packages (ceiling 970), residue leader 243/243 and x.ai 297/297 (unchanged: the ceilings stay).
  • A per-package build can differ from a workspace build, because cargo unifies features: tokio-util had the feature compat from this crate. cargo check --locked -p pi-tools --tests, and the suite builds of pi-shell and pi-pager, all pass.
  • tui_notices.py check: 984 packages ship, 984 entries, 0 missing, 0 stale. Cargo.lock loses 11 lines and no package.
  • This PR and refactor(tui): remove 16 dead modules, the MCP loaders and the folder-trust gate (plan D.8, decision 10) #62 together: a test merge of both branches (only CHANGELOG.md conflicts) has the same tui/Cargo.lock as cargo writes by itself (equal file hash), and tui_baseline.py check on it is all green: warnings 0, graph 970, leader 239/239, x.ai 282/282, cargo check --workspace --tests --locked exit 0.
  • ruff check . and ruff format --check . pass. No Python file changes.

Merge Danger

Door: two-way. One revert brings the files back.

Blast Radius: tests only. No crate that ships depends on pi-test-support, so zypi does not change.

CHANGELOG.md conflicts with #60, #61 and #62: all add a section under [Unreleased]. Keep all of them. There is no other conflict. This PR and #62 both change tui/Cargo.lock, in different places. The result of both merged is the lock that cargo writes by itself (same file hash), so the order does not matter.

`pi-test-support` had seven modules that no test of the workspace refers to: `mock_server` (an
inference server), `inference_override`, `scripted` and `sse` (what that server answers with),
`acp_client` (two ACP stdio clients), `headless` (a runner for `-p`) and `counting_server`.
That is 5,443 lines and 47 test functions. They were for the tests of the Rust agent runtime,
and that runtime is gone (plan phase D.8). The workspace builds with its tests without them,
so nothing uses them.

- `env.rs`: `grok_binary` (it finds or builds the pager binary for the removed clients) and
  `git_workdir` go. Only the removed modules called the first, and nothing called the second.
  `EnvGuard` and `env_parse` stay.
- `lib.rs`: the re-exports of the removed modules go. `scaled`, `EnvGuard`, `TestSandbox`,
  `TestProcess` and `ResourceSnapshot` with its sampler stay: tests of `pi-shell`, `pi-pager`
  and `pi-tools` use them.
- `Cargo.toml`: eleven dependencies go (`agent-client-protocol`, `anyhow`, `async-trait`, `axum`,
  `futures-util`, `pi-acp-lib`, `serde`, `serde_json`, `tokio-util`, `tracing`, and `reqwest`,
  a dev-dependency). `tui/Cargo.lock` loses 11 lines and no package.
- `README.md` is written again. The old one had 90 lines about the removed modules.

The crate is a dev-dependency of `pi-shell`, `pi-pager` and `pi-tools`, so `zypi` does not
change. The suites have the numbers of before: `pi-shell` 838, `pi-pager` 5,651.
An entry under Removed for the commit above: what goes, what stays, and the numbers.
@zy1233

zy1233 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Stack #66, bottom to top: #58, #59, #56, #57, #60, #61, #62, #63, #64, #65. One atomic squash merge (gh stack merge).

Position 8 of 10. Base: refactor/tui-remove-dead-modules (#62). Head adc3664 -> f457906. The code commit has the same patch. The CHANGELOG.md commit changed in one place: the bullet is now in the same ### Removed section as the bullet of #62. tui/Cargo.lock merged without a conflict and cargo metadata --locked accepts it.

@zy1233
zy1233 merged commit a624038 into main Oct 31, 2026
8 of 14 checks passed
@zy1233
zy1233 deleted the refactor/tui-trim-test-support branch October 31, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant