feat(pi): install the coding agent for a side-by-side trial (task 0020) #12

Merged
alexion merged 1 commits from task-0020-pi-coding-agent-module into main 2026-07-21 19:49:16 -04:00
Owner

Task: .claude/tasks/0020-pi-coding-agent-module.md

Summary

Adds a directory-shaped pi module that enables the home-manager programs.pi-coding-agent integration for the primary user and freezes exactly one file, settings.json: the default provider set to Anthropic, the default model to Opus (claude-opus-4-8, read from Pi 0.80.7's own model-resolver catalogue), and enableAnalytics = false (the analytics key per Pi's docs/settings.md). No other upstream option is set, so home-manager renders only settings.json under ~/.pi/agent; the credential and all self-modification state are left unmanaged, so login survives rebuilds and removing Pi is a one-line enable flip. Enabled on neogaia alone.

Verified through the primary seam: config.modules.pi.enable and programs.pi-coding-agent.enable both evaluate true; the rendered settings.json is exactly the three intended keys; only settings.json is rendered under ~/.pi/agent; and checks.x86_64-linux.neogaia builds green with pi-coding-agent-0.80.7.

No deviations from the spec — every "Out of Scope" item (agent context/AGENTS.md, skills, extensions, keybindings, custom providers, a Pi-specific sudo guard) is left out.

Review

Overall: Low

  • Blast radius: Low — one new self-contained module plus a single enable line on one host, no shared code touched.
  • Reversibility: Low — pure additive Nix config, rollback is deleting the module and the enable line; no migrations or deletions.
  • Test coverage: Low — no tests, but it's declarative config validated by the build/eval, so the untested surface is minimal.
  • Sensitive domain: Low — references auth/credentials only to deliberately leave them unmanaged; no credential or permission logic is introduced.
  • Size & complexity: Low — ~40 lines, flat option + mkIf, no control flow.
  • Runtime criticality: Low — dev-only coding-agent tooling for a single user, not a production or hot path.

Standards and Spec: no unaddressed findings. Spec fidelity was clean. Standards flagged four comment-convention issues on the new module (a semicolon in a comment, an overloaded file-top header duplicating the inline rationale, and a cross-file clause on the model-id comment); all were fixed in this diff.

— Claude

Task: `.claude/tasks/0020-pi-coding-agent-module.md` ## Summary Adds a directory-shaped `pi` module that enables the home-manager `programs.pi-coding-agent` integration for the primary user and freezes exactly one file, `settings.json`: the default provider set to Anthropic, the default model to Opus (`claude-opus-4-8`, read from Pi 0.80.7's own `model-resolver` catalogue), and `enableAnalytics = false` (the analytics key per Pi's `docs/settings.md`). No other upstream option is set, so home-manager renders only `settings.json` under `~/.pi/agent`; the credential and all self-modification state are left unmanaged, so login survives rebuilds and removing Pi is a one-line `enable` flip. Enabled on `neogaia` alone. Verified through the primary seam: `config.modules.pi.enable` and `programs.pi-coding-agent.enable` both evaluate `true`; the rendered `settings.json` is exactly the three intended keys; only `settings.json` is rendered under `~/.pi/agent`; and `checks.x86_64-linux.neogaia` builds green with `pi-coding-agent-0.80.7`. No deviations from the spec — every "Out of Scope" item (agent context/`AGENTS.md`, skills, extensions, keybindings, custom providers, a Pi-specific sudo guard) is left out. ## Review **Overall: Low** - Blast radius: Low — one new self-contained module plus a single enable line on one host, no shared code touched. - Reversibility: Low — pure additive Nix config, rollback is deleting the module and the enable line; no migrations or deletions. - Test coverage: Low — no tests, but it's declarative config validated by the build/eval, so the untested surface is minimal. - Sensitive domain: Low — references auth/credentials only to deliberately leave them unmanaged; no credential or permission logic is introduced. - Size & complexity: Low — ~40 lines, flat option + `mkIf`, no control flow. - Runtime criticality: Low — dev-only coding-agent tooling for a single user, not a production or hot path. Standards and Spec: no unaddressed findings. Spec fidelity was clean. Standards flagged four comment-convention issues on the new module (a semicolon in a comment, an overloaded file-top header duplicating the inline rationale, and a cross-file clause on the model-id comment); all were fixed in this diff. — Claude
alexion reviewed 2026-07-21 19:44:49 -04:00
@@ -0,0 +17,4 @@
Pins the provider to Anthropic and the model to Opus so Pi runs the same
model as Claude Code, and disables analytics. Authentication reuses an
existing Claude subscription and is deliberately left unmanaged, so no
credential enters the repo and re-auth survives rebuilds'';
Author
Owner

I can read code, no need to be this explicit in the comment. The first line is enough.

I can read code, no need to be this explicit in the comment. The first line is enough.
alexion marked this conversation as resolved
@@ -0,0 +25,4 @@
# settings.json is the only file here Pi writes at runtime, and only its
# analytics keys. Disabling analytics removes that write, so freezing the
# file never fights Pi's self-modification, which targets other paths.
Author
Owner

no need for this comment.

no need for this comment.
alexion marked this conversation as resolved
alexion reviewed 2026-07-21 19:46:45 -04:00
alexion left a comment
Author
Owner

Addressed both comments in 638c26c — thanks for the trims. Neither the option description nor the dropped comment earned their length; the code reads fine without them.

— Claude

Addressed both comments in 638c26c — thanks for the trims. Neither the option description nor the dropped comment earned their length; the code reads fine without them. — Claude
@@ -0,0 +17,4 @@
home-manager.users.${user}.programs.pi-coding-agent = {
enable = true;
settings = {
Author
Owner

Trimmed the option description to the first line: mkEnableOption "Pi, a terminal coding agent, configured via home-manager". The provider/model/analytics rationale is already legible from the settings block below.

— Claude

Trimmed the option description to the first line: `mkEnableOption "Pi, a terminal coding agent, configured via home-manager"`. The provider/model/analytics rationale is already legible from the `settings` block below. — Claude
@@ -0,0 +25,4 @@
};
};
};
}
Author
Owner

Dropped the comment entirely.

— Claude

Dropped the comment entirely. — Claude
alexion reviewed 2026-07-21 19:47:49 -04:00
@@ -0,0 +11,4 @@
user = config.user.name;
in
{
options.modules.pi.enable = lib.mkEnableOption "Pi, a terminal coding agent, configured via home-manager";
Author
Owner

this line is way too long?

this line is way too long?
alexion marked this conversation as resolved
alexion added 1 commit 2026-07-21 19:48:26 -04:00
Add a `pi` module that turns on the home-manager `programs.pi-coding-agent`
integration for the primary user and freezes a single settings.json: the
default provider set to Anthropic, the default model to Opus (claude-opus-4-8,
Pi's own catalogue id), and analytics disabled. Everything else in
~/.pi/agent — the credential and all self-modification state — is left
unmanaged, so login survives rebuilds and backing Pi out is a one-line enable
flip. Enabled on neogaia alone.
alexion force-pushed task-0020-pi-coding-agent-module from 638c26c09b to fc3380f8ce 2026-07-21 19:48:26 -04:00 Compare
alexion reviewed 2026-07-21 19:48:34 -04:00
alexion left a comment
Author
Owner

Line-length fixed in fc3380f.

— Claude

Line-length fixed in fc3380f. — Claude
@@ -0,0 +11,4 @@
user = config.user.name;
in
{
options.modules.pi.enable = lib.mkEnableOption ''
Author
Owner

Agreed. Wrapped it onto the '' multiline form the sibling claude-code module uses, so the description sits on its own line under the margin. Fixed in fc3380f.

— Claude

Agreed. Wrapped it onto the `''` multiline form the sibling `claude-code` module uses, so the description sits on its own line under the margin. Fixed in fc3380f. — Claude
alexion marked this conversation as resolved
alexion merged commit fc3380f8ce into main 2026-07-21 19:49:16 -04:00
alexion deleted branch task-0020-pi-coding-agent-module 2026-07-21 19:49:16 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alexion/dotfiles#12