Repository navigation
Commit 4fc028a
authored
feat(tui): plan 0.5 call graph tool and phase C closeout (acceptance probes, 7-page guide, notices; plan r11) (#13)
* feat(scripts): add tui_callgraph.py, the module-level call graph of the TUI workspace (plan 0.5)
The tool reads the Rust sources and reports which modules live code refers to.
It replaces the hand-written list of examples of what the support layer keeps.
Subcommands: crates, units, keep. 35 tests; each mutation of the tool fails them.
* feat(tui): keep THIRD-PARTY-NOTICES in step with Cargo.lock, rewrite NOTICE (plan C.3)
scripts/tui_notices.py finds the packages that ship in zypi (normal and build
dependency closure of pi-pager-bin, five targets) and fixes the notices file:
222 stale entries out, 44 missing entries in, hand-written sections kept.
The wording of a new entry is copied from the entries with the same license.
tui/NOTICE now names the product (zypi), says tui/ is a hard fork that does
not follow upstream, and lists the changes. The stale nfsserve entry in
third_party/ is gone. 62 tests.
* refactor(tui): C.2 - embedded user guide cut to the zypi pages, tutorial overlay removed, no per-start extraction
- docs: seven pages (getting started, slash commands, theming, sessions,
terminal support, permissions and safety, status line) written against
the code and agent.toml; sixteen pages of removed features deleted.
The status-line page says the row stays empty with the Python agent
(it is filled from a session-status update only the Rust agent sent).
- docs.rs: USER_GUIDE lists the seven pages; extract_user_guide_docs and
its call in pi-pager-bin are gone; two tests guard the pages (no old
product names, every file in the directory is listed).
- tutorial overlay (views/tutorial.rs, tutorial_docs.rs, docs/tutorial/)
removed: no entry point since A.3, and its pages described commands
zypi does not have.
- doc picker: the footer tip pointed at files zypi no longer writes.
- strings that pointed at ~/.grok/docs/user-guide/*.md (mcp.rs, glob.rs),
the zypi wrap help line that pointed at a README that does not exist,
and two comments.
* test(tui_pty): net_audit, status_line_probe and status_proxy_agent (plan C.1)
net_audit.py plays one turn under a pseudo-terminal and samples the sockets of zypi and of each process below it (/proc/<pid>/fd joined with /proc/<pid>/net/*). zypi must hold no connection to a non-loopback address and listen on none. --mock checks that the agent is silent too, --no-network runs it in an empty network namespace, and --model-from FILE plays one real turn (the agent must hold an established connection: the positive control; the output names no host, address or key). status_line_probe.py shows that the status row is not drawn with the plain Python agent and is drawn when status_proxy_agent.py adds the session_status message. Unit tests for the three run on Windows and Linux.
* docs: C.4 - config.toml constraint measured, TUI guide corrected, Phase 4 spec revised, P2 admission rule in DESIGN
AGENTS.md (pi-agent-cli) says what zypi really does with config.toml: strict types for the keys it knows (a top-level permission string, a [[models]] array and invalid TOML stop it with exit 1), unknown keys ignored; the agent falls back to config.toml only when agent.toml is missing. TUI-AND-CODE-AGENT.md: ACP link, real [model] keys (id, not model_id; no context_window; permission values ask|auto|always-approve; [skills] paths), the real slash commands, no model client / tool runner / MCP client in zypi, pointer to the network audit. Phase 4 spec section 1.3 #2 and section 3 get a revision note (runtime part of the shell is gone; pi-tools and pi-workspace still tie the pager to the tree; tui/ is a hard fork). DESIGN section 8.5 states the five-condition admission rule for pi/ extensions (plan P2).
* chore(tui): clear the stale 'grok agent' pointers and ratchet the leftover words (plan C.4)
The pi-shell README was the upstream Grok CLI manual (1,968 lines, an install script that installs the official CLI): replaced by a short note on what the crate is now. Doc comments and a label in pi-agent, pi-http, pi-tty-utils and pi-test-support no longer name a 'grok agent' command. pi-test-support's README now says that only EnvGuard, scaled, TestProcess/TestSandbox, env_parse and ResourceGrowth have users outside the crate (plan D.5). tui_baseline.py gets count_residue and a [gates.residue] ceiling per phrase: 'grok agent' 0, 'leader' 245, 'x.ai' 304 lines under tui/crates (the plan's literal zero cannot be met before phase D: the lines are the removed leader process, xAI endpoints in the auth, voice and update code, and the vendor-method filter itself). A test runs the same ratchet in the Python CI job.
* docs(tui): add the generated keep list and the leftover-word table, set the pi-pager baseline to 5,608
tui-support.md is the output of tui_callgraph.py keep (item 0.5). The tui.md section on leftover words classifies the 245 leader and 304 x.ai lines that the new residue gate holds as ceilings. pi-pager is 5,626 -> 5,608 after the embedded user guide change (item C.2); the other nine suites did not move (8,665 over ten suites, one local run on Linux).
* fix(scripts): make tui_callgraph.py precise enough to trust its dead list (plan 0.5)
Check: copy tui/, delete the files of every unit the tool calls dead, run
cargo check on the consumer crates. The first run listed 21 dead units and
4 of them were live:
- a path inside a string of an attribute (`serde(with = "crate::util::serde_base64")`):
`util::serde_base64`, `serde_helpers`
- a path that starts at a child module, with no `use` and no `crate::`
(`hub_auth::init_metrics()` in lib.rs): `hub_auth`, `hub_auth::proactive`
Both are references now. A third kind cannot be seen from the text: an impl
that code uses without a name (`types::error` holds the `impl From<TodoError>
for ToolError` that `?` calls). A dead unit with `impl` blocks for types it
does not define is listed apart as "check first", and the summary table gets
a column for it.
Result on 24907ef: 17 dead units, 6,190 lines. With all 17 deleted, cargo check
fails at exactly one unit (`types::error`, 5 errors, and it is in the "check
first" list); with that one kept, the check passes and shows one new warning
(an unused function in pi-hooks, which is a function, not a module).
Tests 35 -> 39. Each of the 17 mutations of the tool makes a test fail.
docs/baselines/tui-support.md is regenerated.
* docs: record r11 (call graph tool, phase C) in the plan, execution log, baselines and changelog
Plan: 0.5 and C.1-C.4 are done; decision 15 (the status line) and the phase D
candidates D.5-D.9 are new; index, status and revision text say r11. D.9: the
Rust test run does not isolate HOME, so some tests write the developer's real
~/.pi-python and /tmp. Execution log: section 10.14, appendix B.7 and the
revision log. Baselines: tui.md gets the r11 numbers and a keep-list section;
tui-history.md gets the r11 paragraph. CHANGELOG: the call graph tool, the
notices check, the network audit, the status line probe, the 7-page user
guide, NOTICE, the leftover-word ratchet, the config.toml notes. AGENTS.md:
the two new TUI tools, the new PTY scripts and the HOME warning.
Numbers: 10 suites 8,665 passed / 0 failed / 22 ignored (WSL2, one local run);
pytest Windows 2,510 and Linux 2,538 passed; Ruff 0.16.10 and 0.16.0 clean.
Nothing is pushed.1 parent df812d1 commit 4fc028a
87 files changed
Lines changed: 6366 additions & 15659 deletions
File tree
- docs
- PLAN
- archive
- baselines
- archive
- specs
- packages/pi-agent-cli
- pi_agent_cli
- scripts
- tests
- tui_pty
- tui
- crates/codegen
- pi-agent/src
- pi-http/src
- pi-pager-bin/src
- pi-pager
- docs
- tutorial
- user-guide
- src
- app
- dispatch/tests
- views
- prompt_widget
- pi-sandbox/src/deny
- pi-shell
- src/util/config
- pi-status-line/src
- pi-test-support
- src
- pi-tty-utils/src
- third_party
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
0 commit comments