Skip to content

Add AGENTS.md with Cursor Cloud development environment setup - #2

Merged
zy1233 merged 1 commit into
mainfrom
cursor/setup-dev-environment-725b
May 25, 2026
Merged

zy1233 merged 1 commit into
mainfrom
cursor/setup-dev-environment-725b

Conversation

@zy1233

@zy1233 zy1233 commented May 22, 2026

Copy link
Copy Markdown
Owner

Summary

Adds AGENTS.md with Cursor Cloud-specific development instructions for the pi-agent-core Python library.

What's included

  • Key commands table (install, test, run example)
  • Notes on environment gotchas (python3 vs python, ~/.local/bin PATH, no linter configured)
  • Confirmation that all tests use mock streams (no API keys needed)

Verification

All 9 tests pass and the mock example runs successfully:

test_and_example_output.log

Update script

pip install -e ".[dev]"

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

@zy1233
zy1233 marked this pull request as ready for review May 22, 2026 10:10
@zy1233
zy1233 merged commit 3483601 into main May 25, 2026
@zy1233
zy1233 deleted the cursor/setup-dev-environment-725b branch May 25, 2026 02:40
zy1233 added a commit that referenced this pull request Jul 3, 2026
Add AGENTS.md with Cursor Cloud development environment setup
zy1233 added a commit that referenced this pull request Oct 12, 2026
…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.
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.
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.

2 participants