pi-session-mcp 0.13.1 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/.pi-session-mcp-cli/config.js +21 -3
  2. package/.pi-session-mcp-cli/doctor.js +6 -2
  3. package/.pi-session-mcp-cli/skill-library.js +1 -1
  4. package/.pi-session-mcp-cli/writer-boundary.js +2 -1
  5. package/.pi-session-mcp-cli/writer-lifecycle.js +18 -4
  6. package/CHANGELOG.md +87 -0
  7. package/README.md +1 -1
  8. package/dist/capabilities.d.ts +13 -0
  9. package/dist/capabilities.js +17 -13
  10. package/dist/config.d.ts +3 -1
  11. package/dist/config.js +21 -3
  12. package/dist/doctor.d.ts +1 -1
  13. package/dist/doctor.js +6 -2
  14. package/dist/model-catalog.d.ts +40 -0
  15. package/dist/model-catalog.js +38 -0
  16. package/dist/profile-probe.d.ts +28 -0
  17. package/dist/profile-probe.js +164 -0
  18. package/dist/sdk-pi-adapter.d.ts +1 -1
  19. package/dist/sdk-pi-adapter.js +25 -6
  20. package/dist/setup-cli.d.ts +7 -0
  21. package/dist/setup-cli.js +36 -0
  22. package/dist/setup-main.js +10 -3
  23. package/dist/setup-probe-main.d.ts +14 -0
  24. package/dist/setup-probe-main.js +76 -0
  25. package/dist/setup-probe-result.d.ts +39 -0
  26. package/dist/setup-probe-result.js +62 -0
  27. package/dist/setup-writers-common.js +1 -1
  28. package/dist/skill-library.js +1 -1
  29. package/dist/writer-boundary.d.ts +1 -1
  30. package/dist/writer-boundary.js +2 -1
  31. package/dist/writer-guard.js +1 -1
  32. package/dist/writer-lifecycle.d.ts +1 -0
  33. package/dist/writer-lifecycle.js +18 -4
  34. package/dist/writer-relay.js +12 -1
  35. package/docs/acceptance.md +313 -1
  36. package/docs/adr/0012-leased-writer-pool.md +10 -6
  37. package/docs/adr/0013-hardened-read-only-profiles.md +30 -0
  38. package/docs/adr/0014-profile-probe-and-model-catalog.md +89 -0
  39. package/docs/client-setup.md +18 -12
  40. package/docs/doctor-design.md +1 -0
  41. package/docs/execution-modes.md +25 -3
  42. package/docs/installation.md +87 -0
  43. package/docs/isolation-setup.md +8 -2
  44. package/docs/roadmap.md +20 -1
  45. package/docs/skills.md +42 -25
  46. package/docs/sprints/2026-10-24-s8-writer-migration.md +5 -3
  47. package/docs/sprints/2026-10-29-s12-audit-fixes.md +172 -0
  48. package/docs/threat-model.md +10 -1
  49. package/docs/tool-contracts.md +1 -1
  50. package/package.json +1 -1
  51. package/skills/pi-session-orchestration/SKILL.md +1 -1
  52. package/skills/pi-session-profiles/SKILL.md +124 -0
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: pi-session-profiles
3
+ description: Use when you, as the controlling agent, create, change, tune, rename or retire an execution profile, or change which profiles a container repository selects. Covers inventory, candidate validation, a bounded provider probe, safe writer replacement and reporting. Do not use inside a Pi worker session.
4
+ ---
5
+
6
+ # Managing execution profiles
7
+
8
+ Carry out the request on this machine without asking for approval at each step.
9
+ A skill grants no rights. Use the documented configuration and writer rules,
10
+ not guessed providers, models or workarounds.
11
+
12
+ Find the installed package root as described in
13
+ [docs/skills.md](../../docs/skills.md). Read the relevant package-relative
14
+ documentation before changing anything:
15
+ [docs/installation.md](../../docs/installation.md),
16
+ [docs/skills.md](../../docs/skills.md),
17
+ [docs/execution-modes.md](../../docs/execution-modes.md) and
18
+ [docs/pi-extensions-design.md](../../docs/pi-extensions-design.md). Resolve these names from the package root, not from a client-installed skill
19
+ copy. They define profile fields, skill selection, extensions, sandbox shell
20
+ and container acceptance.
21
+
22
+ ## 1. Find the configuration
23
+
24
+ Use `PI_SESSION_MCP_CONFIG` from the environment without printing its value.
25
+ If unset, read that variable from the client's own registration of the
26
+ `pi-session-mcp` server. If neither supplies it, ask the operator. Never guess
27
+ the configuration path.
28
+
29
+ ## 2. Inventory
30
+
31
+ Run `pi-session-mcp-doctor --json` and
32
+ `pi-session-mcp-setup --list-models`. Read the configuration and the adjacent
33
+ `execution-modes.json`. Call `pi_capabilities_get` if the MCP server is
34
+ connected. Report unrelated Doctor errors; do not fix them as part of this task.
35
+
36
+ Never read Pi credential or model files. Never print environment values.
37
+ The offline catalog reports authentication presence, not credentials, and does
38
+ not list providers registered only by extensions.
39
+
40
+ ## 3. Work out the change
41
+
42
+ Translate the request into concrete profile entries and the intended profile
43
+ selection of affected container repositories. Pick providers and models only
44
+ from `--list-models` entries with configured authentication. Prefer the shape
45
+ of an existing working profile of the same kind. Ask only if the request leaves
46
+ an outcome-changing choice that the catalog and existing profiles do not settle;
47
+ otherwise decide and state the decision in the report. Select only worker
48
+ skills for a profile; the controller skills are never catalog entries, and
49
+ Doctor refuses them with `skill_controller_selected`.
50
+
51
+ Before deleting a profile, check every container repository's selection. If any
52
+ still selects it, stop and ask. Deleting an unselected profile needs no stop.
53
+
54
+ ## 4. Build and check a candidate
55
+
56
+ Write a distinctly named candidate beside the live configuration, in the same
57
+ directory and with the same file mode. Edit only the candidate. This preserves
58
+ relative-path resolution, the modes file and the skill override directory.
59
+ Point `PI_SESSION_MCP_CONFIG` at the candidate without echoing it, then run
60
+ `pi-session-mcp-doctor --json` and
61
+ `pi-session-mcp-setup --probe-profile <aliases>` (dry run), naming the changed
62
+ or new profiles. Fix and repeat. For affected container selections,
63
+ `container_profile_refused` must be absent.
64
+
65
+ Never hand-edit `execution-modes.json`; use the documented mode request.
66
+
67
+ ## 5. Probe the candidate
68
+
69
+ With the configuration variable still pointing at the candidate, run
70
+ `pi-session-mcp-setup --probe-profile <aliases> --apply`.
71
+ Each changed or new profile gets at most one provider turn without asking.
72
+ Failures with `providerTurn: false` cost nothing: fix them and re-probe.
73
+ Count `providerTurn: true` even when the probe fails. Stop and ask before a
74
+ second provider turn for the same profile, or any check costing money beyond
75
+ one PONG probe per changed profile. Never run a quality evaluation yourself.
76
+ Only `probe_passed` proves a profile works; never print the reply text.
77
+
78
+ The probe proves the profile on the host, not its acceptance by a container
79
+ writer. Doctor's container checks and provisioning still have to pass.
80
+
81
+ ## 6. Prepare writers
82
+
83
+ For each container repository whose selected profiles or settings change,
84
+ determine every writer's state using the documented read-only checks:
85
+ Doctor's `writer_dirty` and `writer_uncollected_bundle`, and
86
+ `pi-session-mcp-setup --writer <name> --collect` (dry run).
87
+ If a writer to remove or re-provision has uncollected work or a dirty clone,
88
+ stop and ask before anything goes live. Never run `--collect --apply` in this
89
+ workflow, and never discard work to get past a refusal.
90
+
91
+ Stop and report `writer_busy`, `podman_unavailable`, `registration_divergent`
92
+ or any other refused writer step; do not work around it. For writers that
93
+ hold no work, use `pi-session-mcp-setup --writer <name> --remove` before the
94
+ live write. Do not run host Git inside a writer clone.
95
+
96
+ ## 7. Go live
97
+
98
+ Back up the live configuration as a timestamped copy beside it, with the same
99
+ file mode. Replace the live file atomically by renaming the candidate onto it.
100
+ Point the configuration variable back at the live file and run
101
+ `pi-session-mcp-doctor --json`.
102
+
103
+ ## 8. Provision
104
+
105
+ For each affected container repository, repeat the mode request with the full
106
+ intended settings, not just changed fields:
107
+ `pi-session-mcp-setup --repo <alias> --mode container --profiles <aliases> --apply`.
108
+ This writes `execution-modes.json` and provisions writers. Preserve all intended
109
+ settings from the inventory as `docs/execution-modes.md` requires. Then run
110
+ `pi-session-mcp-setup --writer <name> --verify` for each writer and the documented
111
+ client-target verification for the host registration. Stop and report any
112
+ refused writer step instead of bypassing it.
113
+
114
+ ## 9. Report
115
+
116
+ Report changed profile aliases and field names, Doctor results, probe results,
117
+ usage or `unknown`, the number of provider turns, writer actions and the
118
+ backup's file name relative to the configuration directory. Include no secrets,
119
+ absolute paths, environment values or complete prompts.
120
+
121
+ Running controllers see the changes only after their MCP server restarts or an
122
+ MCP reconnect starts a new server process. If the operator's own instructions
123
+ require further steps beyond this machine, follow those instructions; do not
124
+ invent multi-machine actions.