pi-orchestrator-config 4.2.0 → 4.3.2

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 (100) hide show
  1. package/README.md +76 -67
  2. package/agents/code-reviewer-docs.md +11 -1
  3. package/agents/code-reviewer-guidelines.md +11 -1
  4. package/agents/code-reviewer-quality.md +11 -1
  5. package/agents/code-reviewer-security.md +11 -1
  6. package/agents/code-reviewer-spec.md +11 -1
  7. package/agents/git-expert.md +42 -3
  8. package/agents/github-expert.md +11 -0
  9. package/extensions/acpx-provider/runtime-models.ts +18 -6
  10. package/extensions/cli-provider/agents/claude.ts +3 -2
  11. package/extensions/cli-provider/agents/cursor.ts +3 -5
  12. package/extensions/cli-provider/agents/gemini.ts +3 -2
  13. package/extensions/cli-provider/discover.ts +7 -7
  14. package/extensions/cli-provider/index.ts +5 -0
  15. package/extensions/cli-provider/runtime-models.ts +18 -6
  16. package/extensions/cli-provider/session-reaper.ts +5 -7
  17. package/extensions/cli-provider/sessions.ts +4 -0
  18. package/extensions/cli-provider/shared/discover-cache.ts +17 -176
  19. package/extensions/coms/coms-p2p.ts +1719 -423
  20. package/extensions/coms/coms-shared.ts +261 -39
  21. package/extensions/coms/coms-wrapper.ts +100 -62
  22. package/extensions/coms/index.ts +8 -4
  23. package/extensions/coms/mixed-turn.ts +26 -0
  24. package/extensions/coms/probe-socket.ts +42 -0
  25. package/extensions/coms/themeMap.ts +0 -1
  26. package/extensions/image-gen/image-gen.ts +19 -1
  27. package/extensions/orchestrator/async-agents.ts +563 -102
  28. package/extensions/orchestrator/async-capability.ts +8 -8
  29. package/extensions/orchestrator/cron.ts +15 -9
  30. package/extensions/orchestrator/dreaming.ts +32 -25
  31. package/extensions/orchestrator/enforcement-helpers.ts +459 -17
  32. package/extensions/orchestrator/enforcement-rules.ts +5 -4
  33. package/extensions/orchestrator/enforcement.ts +80 -27
  34. package/extensions/orchestrator/extended-autocomplete.ts +7 -0
  35. package/extensions/orchestrator/git-helpers.ts +2 -2
  36. package/extensions/orchestrator/index.ts +78 -10
  37. package/extensions/orchestrator/markdown-transformer.ts +313 -0
  38. package/extensions/orchestrator/memory-embeddings.ts +36 -34
  39. package/extensions/orchestrator/memory-provenance.ts +29 -25
  40. package/extensions/orchestrator/memory-scoring.ts +23 -18
  41. package/extensions/orchestrator/memory-tools.ts +10 -3
  42. package/extensions/orchestrator/overlay-dashboard.ts +17 -5
  43. package/extensions/orchestrator/parse-model-override.ts +29 -0
  44. package/extensions/orchestrator/pi-config-review-state.ts +57 -33
  45. package/extensions/orchestrator/project-settings.ts +333 -127
  46. package/extensions/orchestrator/resolve-agent-model.ts +24 -13
  47. package/extensions/orchestrator/review-porcelain.ts +4 -0
  48. package/extensions/orchestrator/review-ui.ts +63 -15
  49. package/extensions/orchestrator/rule-placeholders.ts +411 -2
  50. package/extensions/orchestrator/rules.ts +80 -132
  51. package/extensions/orchestrator/settings-tui-helpers.ts +380 -0
  52. package/extensions/orchestrator/settings-tui-submenus.ts +647 -0
  53. package/extensions/orchestrator/settings-tui.ts +636 -0
  54. package/extensions/orchestrator/state-jsonl.ts +431 -0
  55. package/extensions/orchestrator/subagent-tool.ts +157 -59
  56. package/extensions/orchestrator/sync-limit.ts +23 -0
  57. package/extensions/orchestrator/task-lifecycle.ts +77 -67
  58. package/extensions/orchestrator/utils.ts +8 -5
  59. package/extensions/pidash/pidash.ts +193 -156
  60. package/extensions/pidiff/pidiff.ts +96 -38
  61. package/extensions/pidiff/spawn-lock.ts +62 -0
  62. package/extensions/pitasks/index.ts +430 -0
  63. package/extensions/pitasks/reminders.ts +37 -0
  64. package/extensions/pitasks/task-store.ts +467 -0
  65. package/extensions/pitasks/task-tools.ts +375 -0
  66. package/extensions/pitasks/task-widget.ts +181 -0
  67. package/extensions/pitasks/types.ts +38 -0
  68. package/extensions/providers/acpx-driver.ts +12 -2
  69. package/extensions/providers/built-in-drivers.ts +6 -6
  70. package/extensions/providers/claude-driver.ts +1 -1
  71. package/extensions/providers/cursor-cli-driver.ts +1 -1
  72. package/extensions/providers/gemini-driver.ts +1 -1
  73. package/extensions/providers/index.ts +144 -26
  74. package/extensions/providers/initialized-guard.ts +27 -0
  75. package/extensions/providers/restore-default-model.ts +596 -0
  76. package/extensions/providers/session-shutdown.ts +39 -0
  77. package/extensions/shared/coms-active.ts +23 -0
  78. package/extensions/shared/create-runtime-provider.ts +2 -0
  79. package/extensions/shared/daemon-manager.ts +0 -8
  80. package/extensions/shared/file-logger.ts +132 -25
  81. package/extensions/shared/logger.ts +50 -0
  82. package/extensions/shared/models-dev.ts +421 -0
  83. package/extensions/shared/oneshot.ts +116 -0
  84. package/extensions/shared/resolve-binary.ts +191 -0
  85. package/extensions/shared/types.ts +3 -0
  86. package/package.json +9 -3
  87. package/prompts/coderabbit-rate-limit.md +2 -0
  88. package/rules/00-orchestrator-core.md +3 -0
  89. package/rules/10-agent-routing.md +12 -1
  90. package/rules/20-code-review-loop.md +52 -25
  91. package/rules/30-prompt-templates.md +4 -0
  92. package/rules/35-memory.md +3 -3
  93. package/rules/40-critical-rules.md +3 -0
  94. package/rules/55-coms-protocol.md +84 -18
  95. package/rules/60-task-tracking.md +2 -0
  96. package/settings-keys.json +563 -0
  97. package/templates/coms-feature-manager-prompt.md +4 -6
  98. package/extensions/coms/coms-net-server.ts +0 -1642
  99. package/extensions/coms/coms-net-wrapper.ts +0 -521
  100. package/extensions/coms/coms-net.ts +0 -1589
package/README.md CHANGED
@@ -12,9 +12,10 @@ Single extension that provides:
12
12
 
13
13
  | Feature | Description |
14
14
  |---------|-------------|
15
- | **Subagent tool** | Delegate tasks to specialist agents (single, parallel, chain, async modes) |
16
- | **Async background agents** | Spawn agents in background with `async: true` — results surface automatically when complete. Fullscreen overlay dashboard with live output, keyboard nav, and kill support (`/async-status`, `/async-kill`). On **acpx** parents, optional async is coerced to sync; dream/cron need `async_llm_provider` + `async_llm_model`. `cli-*` providers support async natively (see `dev-docs/cli-provider.md`) |
17
- | **CLI / ACPX providers** | Optional `cli_agents` / `acpx_agents` register `cli-*` / `acpx-*` via native `createProvider` (pi ≥ 0.81): `/login cli-<agent>` or `/login acpx-<agent>`, model refresh, filter when unavailable |
15
+ | **Subagent tool** | Delegate tasks to specialist agents (single, parallel, chain, async modes); optional `model` param for model override |
16
+ | **`list_models`** | List available models and providers for subagent model override |
17
+ | **Async background agents** | Spawn agents in background with `async: true` — results surface automatically when complete. Fullscreen overlay dashboard with live output, keyboard nav, and kill support (`/async-status`, `/async-kill`). On **acpx** parents, optional async is coerced to sync; dream/cron need `internal_operations_provider` + `internal_operations_model`. `cli-*` providers support async natively (see `dev-docs/cli-provider.md`) |
18
+ | **CLI / ACPX providers** | Optional `cli_agents` / `acpx_agents` register `cli-*` / `acpx-*` via native `createProvider` (pi ≥ 0.84): `/login cli-<agent>` or `/login acpx-<agent>`, model refresh, filter when unavailable. Missing context window / maxTokens / cost filled from models.dev (`~/.pi/pi-config/models.dev.json`, 1-day refresh). Cold-start default restore (#753): gates `startup`\|`new`, empty `enabledModels`, trusted project merge — see `dev-docs/cli-provider.md` |
18
19
  | **`/btw` command** | Quick side questions without polluting conversation history — ephemeral overlay |
19
20
  | **`/async-status` command** | Show status of background agents — select one for live output streaming |
20
21
  | **`/async-kill` command** | Kill async agents (overlay picker or by name/id) |
@@ -32,10 +33,10 @@ Single extension that provides:
32
33
  | **Dreaming** | Background memory consolidation — extracts memories from sessions, deduplicates, maintains topic-based memory |
33
34
  | **Memory enforcement** | Code-enforced memory entries — triggers on bash/tool/file events, actions: block, run_after, warn. LLM cannot ignore enforced rules. Dreaming-safe via *(enforced)* marker |
34
35
  | **Upgrade changelog** | Shows release notes on session start after pi-config version upgrade |
35
- | **Task tracking** | Structured task lists for multi-step workflows — live widget, progress tracking, reminder nudges ([@tintinweb/pi-tasks](https://github.com/tintinweb/pi-tasks)) |
36
+ | **Task tracking** | Structured task lists for multi-step workflows — live widget, progress tracking, reminder nudges (owned, based on [@tintinweb/pi-tasks](https://github.com/tintinweb/pi-tasks) MIT) |
36
37
  | **Neovim integration** | Send changed files and review findings to nvim's quickfix list — only active when running inside nvim |
37
- | **Inter-agent communication** | P2P (`/coms`) and networked (`/coms-net`) agent communication — on-demand activation via slash commands |
38
- | **Slash commands** | `/pr-review`, `/issue-review`, `/release`, `/review-local`, `/review-status`, `/query-db`, `/btw`, `/async-status`, `/async-kill`, `/status`, `/dream`, `/remember`, `/coms`, `/coms-net` — with autocomplete argument hints |
38
+ | **Inter-agent communication** | P2P (`/coms`) agent communication — on-demand activation via slash command |
39
+ | **Slash commands** | `/pr-review`, `/issue-review`, `/release`, `/review-local`, `/review-status`, `/query-db`, `/btw`, `/async-status`, `/async-kill`, `/status`, `/dream`, `/remember`, `/coms`, `/pi-config-settings` — with autocomplete argument hints |
39
40
  | **GitHub autocomplete** | Type `#` in the editor to get issue/PR suggestions from the current repo — lazy-loaded, 5min cache |
40
41
  | **Command arg completions** | Tab-complete arguments for slash commands — providers and models for `/external-ai`, branches for `/review-local`, PR numbers for `/pr-review`, and more |
41
42
  | **Discord bot** | Control pi sessions from your phone via Discord DMs — send prompts, answer ask_user dialogs, switch sessions |
@@ -76,13 +77,13 @@ Single extension that provides:
76
77
  | `/dream-auto` | Toggle automatic memory dreaming (every 3h + session end) |
77
78
  | `/cron add\|list\|list-all\|remove` | Schedule recurring tasks within the pi session (e.g., `/cron add every 2h check for new issues`, `/cron add at 12:00 /review-handler`). `/cron list` and `/cron list-all` open overlay UI (view / remove; list-all = all sessions). Tasks run while pi is active, survive `/reload`, and stop on exit |
78
79
  | `/async-kill [name\|id\|all]` | Kill async agents (overlay picker or by name/id) |
80
+ | `/pi-config-settings [project\|global]` | Interactive TUI settings editor — browse all pi-config settings with scope indicators, smart pickers for providers/models, and immediate save |
79
81
  | `/status` | Unified session snapshot — async agents, cron tasks, git branch, context usage |
80
82
  | `/nvim-changed-files` | Send git changed files to nvim's quickfix list (only inside nvim) |
81
83
  | `/pidiff start\|stop\|restart\|status` | Manage the pidiff diff viewer server (per-project) |
82
84
  | `/coms start\|stop\|status` | P2P local agent communication (Unix socket) |
83
- | `/coms-net start\|connect\|disconnect\|stop\|status` | Networked agent communication (HTTP/SSE hub) |
84
85
 
85
- ### Inter-Agent Communication (coms & coms-net)
86
+ ### Inter-Agent Communication (coms)
86
87
 
87
88
  Two systems for Pi agents to communicate with each other, activated on-demand via slash commands:
88
89
 
@@ -94,18 +95,6 @@ Two systems for Pi agents to communicate with each other, activated on-demand vi
94
95
  /coms status
95
96
  ```
96
97
 
97
- **Networked (`/coms-net`)** — HTTP/SSE hub for communication across machines. Server auto-starts on localhost.
98
-
99
- ```text
100
- /coms-net start --name dev --purpose "Development agent"
101
- /coms-net connect
102
- /coms-net disconnect
103
- /coms-net stop
104
- /coms-net status
105
- ```
106
-
107
- For LAN/remote access, set `PI_COMS_NET_AUTH_TOKEN` and `PI_COMS_NET_HOST=0.0.0.0` in your environment.
108
-
109
98
  **Tools available once activated:**
110
99
 
111
100
  | Tool | Description |
@@ -212,6 +201,19 @@ Use python-expert to fix the type errors in src/models.py
212
201
  Run scout and planner in a chain to analyze the auth module
213
202
  ```
214
203
 
204
+ **Run agent with specific model:**
205
+
206
+ ```bash
207
+ # Discover available models
208
+ list_models(provider="litellm")
209
+
210
+ # Run agent with explicit model
211
+ subagent(agent="worker", task="...", model="litellm/claude-opus-4-6-1m")
212
+
213
+ # Parallel tasks with per-task models
214
+ subagent(tasks=[{agent: "worker", task: "...", model: "litellm/claude-opus-4-6-1m", cwd: "..."}])
215
+ ```
216
+
215
217
  ## Code Review Loop
216
218
 
217
219
  After any code change, the orchestrator runs 6 agents **in parallel** (5 reviewers + test-automator):
@@ -224,16 +226,17 @@ After any code change, the orchestrator runs 6 agents **in parallel** (5 reviewe
224
226
  6. **test-automator** — Runs project tests (pytest, node tests, pre-commit)
225
227
 
226
228
  When `review_loop_enforcement` is enabled, the loop stops once all reviewers approve with 0 findings and tests pass
227
- (`tests_passed: true` in `pi-config-review-state.json`), OR after `review_loop_max_cycles` total cycles (default `3`,
229
+ (`tests_passed: true` in `pi-config-review-state.jsonl`), OR after `review_loop_max_cycles` total cycles (default `3`,
228
230
  valid integers `1`-`10`; env: digit string `"1"`-`"10"` only (after trim)) — whichever comes first. Each cycle
229
231
  always completes fix/explain (5a) before the cap check; the cap only blocks re-dispatch
230
232
  (step 2 / all 6 agents, including test-automator), not responding to findings.
231
233
  At cap, report **Not fixed** (explained why not → outstanding) vs **Fixed**
232
234
  (verification blocked by the cap — cannot re-dispatch to confirm clean). Invalid values (including non-digit
233
235
  forms like `"10.0"` / `"1e1"`) fall through to the next resolution layer / default `3`. Disable the review loop via
234
- `review_loop_enforcement: false`, not via max_cycles. The max-cycles stop is via injected orchestrator rules
235
- (LLM compliance only); commit blocking remains code-enforced — blocked unless both `status: clean` and
236
- `tests_passed: true`; hitting the cycle cap does NOT bypass it.
236
+ `review_loop_enforcement: false`, not via max_cycles. Commit blocking is code-enforced via `isCommitAllowed`:
237
+ allows commit when `isReviewClean` (`status: clean` + `tests_passed: true`, or `status: none`), or when max cycles are exhausted
238
+ (`status` is `has_findings` or `clean`, no pending reviewers, `cycle >= review_loop_max_cycles` — no `tests_passed` requirement).
239
+ Review enforcement and dirty tracking are automatically skipped on `chore/bump-version-<version>` branches (e.g. `chore/bump-version-4.2.1-1234567890`, used by the release workflow).
237
240
 
238
241
  Staged mode (`--autorabbit`/`--autoqodo` in `/review-handler`) shares one total `review_loop_max_cycles` budget
239
242
  across both its Spec Compliance and Code Quality stages — not a separate cap per stage.
@@ -244,35 +247,18 @@ Use `/review-status` to inspect the current review loop state. Pass a worktree p
244
247
 
245
248
  ### Project Settings
246
249
 
247
- Create `.pi/pi-config-settings.json` in your project to override global defaults:
248
-
249
- ```json
250
- {
251
- "commit_trailer": "Assisted-by",
252
- "allow_push_to_protected_branches": false,
253
- "use_worktrees": true,
254
- "dream_interval_hours": 6,
255
- "review_loop_enforcement": false,
256
- "review_loop_max_cycles": 3,
257
- "pidash_enable": true,
258
- "pidiff_enable": true,
259
- "pidash_port": 19190,
260
- "image_model": "gemini-3-pro-image",
261
- "acpx_agents": ["cursor"],
262
- "cli_agents": ["claude", "cursor"],
263
- "async_llm_provider": "anthropic",
264
- "async_llm_model": "claude-sonnet-4-20250514",
265
- "agent_provider": "cli-cursor",
266
- "agent_model": "cursor:cursor-grok-4.5-high-fast",
267
- "agent_overrides": {
268
- "git-expert": { "provider": null, "model": null }
269
- }
270
- }
250
+ Copy the example file to your project and customize:
251
+
252
+ ```bash
253
+ cp pi-config-settings.example.jsonc .pi/pi-config-settings.json
271
254
  ```
272
255
 
256
+ Settings files support JSONC (JSON with `//` comments).
257
+ See [`pi-config-settings.example.jsonc`](pi-config-settings.example.jsonc) for all available settings with descriptions.
258
+
273
259
  Resolution order: project file → global `~/.pi/pi-config-settings.json` → env var → default.
274
260
 
275
- See `dev-docs/project-settings.md` for the full settings table and env vars.
261
+ See `dev-docs/project-settings.md` for the full settings table.
276
262
 
277
263
  #### Reviewer Environment Variables
278
264
 
@@ -331,6 +317,17 @@ EOF
331
317
 
332
318
  Rules auto-load alphabetically. Same-filename entries are overridden (project > user > package). Missing directories are silently skipped.
333
319
 
320
+ #### Conditional assembly
321
+
322
+ Rules support settings/feature conditionals at prompt assembly (`assembleRuleText` in
323
+ `rule-placeholders.ts`). Full syntax, truthiness, and assembly order:
324
+ **[dev-docs/project-settings.md](dev-docs/project-settings.md)** (Rules assembly).
325
+
326
+ Markers: `{{IF:key}}…{{/IF}}`, `{{IFNOT:key}}…{{/IFNOT}}`, comparisons
327
+ `{{IF:key==value}}` / `{{IF:key!=value}}`. Whole-file frontmatter: `requires_setting` /
328
+ `requires`. Conditionals run **per file** (no cross-file matching), then bodies are
329
+ joined, then placeholders like `{{REVIEW_LOOP_MAX_CYCLES}}` are substituted.
330
+
334
331
  ### Add project agents
335
332
 
336
333
  Create `.pi/agents/my-agent.md` in your project with frontmatter:
@@ -357,7 +354,7 @@ Set `image_model` in `pi-config-settings.json` or use `PI_IMAGE_MODEL` env var.
357
354
 
358
355
  | Setting / Variable | Description |
359
356
  |----------|-------------|
360
- | `image_model` / `PI_IMAGE_MODEL` | Gemini model name (e.g., `gemini-3-pro-image`). No default. |
357
+ | `image_model` / `PI_IMAGE_MODEL` | Google/Gemini image model for `generate_image` (Settings TUI filters to google; empty = disabled). |
361
358
  | `GEMINI_API_KEY` or `GOOGLE_API_KEY` | Gemini API key (env only) |
362
359
 
363
360
  **Usage:** Ask naturally — "generate an image of a sunset" — or use structured params: `subject`, `action`, `scene`, `composition`, `lighting`, `style`, `text`, `aspect_ratio`.
@@ -390,8 +387,15 @@ Run pi inside a disposable container for **filesystem isolation** — the agent
390
387
  `agent` (Cursor Agent CLI). Enable with `cli_agents` in settings (e.g.
391
388
  `["claude","cursor","gemini"]`). Binary missing at load → `cli-*` not registered.
392
389
  After register, `filterModels` hides models when unavailable: PATH cleared while
393
- agent state remains → restore PATH; after `session_shutdown` (AgentState cleared)
394
- → `/reload` or restart (PATH alone is not enough). See `dev-docs/cli-provider.md`.
390
+ agent state remains, restore PATH; after `session_shutdown` (AgentState cleared
391
+ and `initialized` reset) the next factory re-registers on `/new`|`/resume`|`/fork`
392
+ (PATH alone is not enough). See `dev-docs/cli-provider.md`.
393
+
394
+ **ACPX provider agents (optional `acpx_agents`):** ACPX wraps CLI agents via the
395
+ ACP runtime. Supported agents: `cursor`, `claude`, `gemini`. Enable with
396
+ `acpx_agents` in settings (e.g. `["cursor","claude","gemini"]`). Each ACPX agent
397
+ requires the underlying CLI binary on PATH (`agent` for cursor, `claude` for claude,
398
+ `gemini` for gemini) — missing binary → `acpx-*` not registered.
395
399
 
396
400
  **CLI specialist agents (Cursor / Claude / Gemini):** On container start, `entrypoint.sh`
397
401
  symlinks package `agents/*.md` into the mounted project:
@@ -443,7 +447,9 @@ docker run --rm -it \
443
447
 
444
448
  ### Environment file
445
449
 
446
- Create a `.env` file with container-specific variables:
450
+ Create a `.env` file with external service credentials and container-specific
451
+ variables. Pi-config settings (image_model, acpx_agents, vertex_claude_1m, etc.)
452
+ go in `.pi/pi-config-settings.json` — not here:
447
453
 
448
454
  ```env
449
455
  # Timezone (host timezone for correct timestamps)
@@ -456,9 +462,6 @@ PI_HOST_USER=myakove
456
462
  GOOGLE_CLOUD_PROJECT=your-project-id
457
463
  GOOGLE_CLOUD_LOCATION=us-east5
458
464
  GOOGLE_APPLICATION_CREDENTIALS=/home/myakove/.config/gcloud/application_default_credentials.json
459
- VERTEX_PROJECT_ID=your-project-id
460
- VERTEX_REGION=us-east5
461
- VERTEX_CLAUDE_1M=true
462
465
 
463
466
  # GitHub
464
467
  GITHUB_TOKEN=ghp_xxx
@@ -468,12 +471,6 @@ GH_CONFIG_DIR=/home/myakove/.config/gh
468
471
  # Gemini (optional — required for image generation)
469
472
  GEMINI_API_KEY=xxx
470
473
 
471
- # Image generation model (required for generate_image tool)
472
- PI_IMAGE_MODEL=gemini-3-pro-image
473
-
474
- # acpx agents (optional)
475
- # ACPX_AGENTS=cursor
476
-
477
474
  # mcpl (MCP Launchpad) config path inside the container (must match mount target)
478
475
  # Use your actual home path — it resolves inside the container via the PI_HOST_USER symlink
479
476
  MCPL_CONFIG_FILES=/home/myakove/.config/mcpl/mcp.json
@@ -512,7 +509,8 @@ Pidash is a web-based dashboard that runs alongside the TUI, accessible from any
512
509
  **How it works:**
513
510
 
514
511
  - A daemon (`pidash-server.ts`) runs on port `19190` and aggregates all pi sessions
515
- - Each pi session's extension (`pidash.ts`) connects to the daemon and forwards events
512
+ - Each interactive pi session's extension (`pidash.ts`) connects to the daemon and forwards events
513
+ - Oneshot (`pi -p` / `--print` / `--mode json`) skips pidash register, so no session connects
516
514
  - The React web UI shows live conversations, tool calls, and session status
517
515
 
518
516
  **Features:**
@@ -550,6 +548,10 @@ PI_PIDASH_PORT=9999 pi
550
548
  PI_PIDASH_ENABLE=false pi
551
549
  ```
552
550
 
551
+ Oneshot (`pi -p` / `--print` / `--mode json`) skips register of pidash, pidiff,
552
+ pitasks, and coms so those daemons/watchers do not start. CLI and ACPX providers
553
+ still load. `--mode rpc` is long-lived and is not skipped.
554
+
553
555
  **Management:**
554
556
 
555
557
  ```bash
@@ -574,7 +576,8 @@ Pidiff is a per-project diff viewer that opens in your browser, providing rich b
574
576
 
575
577
  **How it works:**
576
578
 
577
- - Each pi session spawns its own server (`pidiff-server.ts`) on a random free port
579
+ - Each interactive pi session spawns its own server (`pidiff-server.ts`) on a random free port
580
+ - Oneshot (`pi -p` / `--print` / `--mode json`) skips pidiff register, so no per-session server starts
578
581
  - Container and native sessions get separate servers automatically
579
582
  - Lockfiles in `.pi/tmp/` track port and PID for each server
580
583
  - The extension (`pidiff.ts`) connects to its session's server and registers its repo
@@ -615,7 +618,8 @@ PI_PIDIFF_ENABLE=false pi
615
618
  | `-v "<PATH_TO_MCPL_CONFIG>":"$HOME/.config/mcpl/mcp.json":ro` | MCP server config for `mcpl` |
616
619
  | `-v "$HOME/.agents":"$HOME/.agents":rw` | User-level skills (install/uninstall from container) |
617
620
  | `-v "$HOME/.config/gcloud/application_default_credentials.json":"$HOME/.config/gcloud/application_default_credentials.json":ro` | Google Cloud ADC (for Claude via Vertex AI) |
618
- | `-v "$HOME/.config/cursor/auth.json":"$HOME/.config/cursor/auth.json":ro` | Cursor CLI auth (for acpx cursor models) |
621
+ | `-v "$HOME/.config/cursor/auth.json":"$HOME/.config/cursor/auth.json":ro` | Cursor CLI auth (for acpx-cursor / cli-cursor models) |
622
+ | `-v "$HOME/.claude/credentials.json":"$HOME/.claude/credentials.json":ro` | Claude CLI auth (for acpx-claude / cli-claude models) |
619
623
  | `-v "$HOME/.config/glab-cli":"$HOME/.config/glab-cli":ro` | GitLab CLI config (auth tokens, host settings) |
620
624
  | `-v "$HOME/.coderabbit":"$HOME/.coderabbit":rw` | CodeRabbit CLI auth and review data |
621
625
  | `-v "$HOME/screenshots":"$HOME/screenshots"` | Share screenshots/images with the agent |
@@ -630,8 +634,10 @@ PI_PIDIFF_ENABLE=false pi
630
634
  | `git` | Version control |
631
635
  | `gh` | GitHub CLI (PRs, issues) |
632
636
  | `glab` | GitLab CLI (MRs, issues, pipelines) — install [gitlab-cli-skills](https://github.com/vince-winkintel/gitlab-cli-skills) for full agent support |
637
+ | `gcc` | C compiler — needed for building Python C extensions (e.g. ovirt-engine-sdk-python) |
633
638
  | `uv` / `uvx` | Python execution (enforced by orchestrator) |
634
639
  | `go` | Go development and code review |
640
+ | `libxml2-dev` | libxml2 headers — needed for building Python C extensions (e.g. ovirt-engine-sdk-python) |
635
641
  | `mcpl` | MCP server access (search, Jenkins, etc.) |
636
642
  | `myk-pi-tools` | PR review, release, and other CLI utilities |
637
643
  | `prek` | Pre-commit hook runner |
@@ -663,7 +669,8 @@ PI_PIDIFF_ENABLE=false pi
663
669
  | `myk-pi-tools reviews` | Review handling commands |
664
670
  | `myk-pi-tools memory` | Project memory commands — persistent per-repo learning |
665
671
  | `myk-pi-tools ai-cli` | AI CLI commands (cursor, claude, gemini) |
666
- | `myk-pi-tools coderabbit` | CodeRabbit commands |
672
+ | `myk-pi-tools coderabbit` | CodeRabbit commands (check, trigger, retry) |
673
+ | `myk-pi-tools settings get [key ...]` | Resolve settings (project → global → env → default). No args = all keys |
667
674
 
668
675
  ### What's protected
669
676
 
@@ -704,6 +711,7 @@ alias pi-docker='docker pull ghcr.io/myk-org/pi-config:latest && \
704
711
  -v "$HOME/.agents":"$HOME/.agents":rw \
705
712
  -v "$HOME/.config/gcloud/application_default_credentials.json":"$HOME/.config/gcloud/application_default_credentials.json":ro \
706
713
  -v "$HOME/.config/cursor/auth.json":"$HOME/.config/cursor/auth.json":ro \
714
+ -v "$HOME/.claude/credentials.json":"$HOME/.claude/credentials.json":ro \
707
715
  -v "$HOME/.config/glab-cli":"$HOME/.config/glab-cli":ro \
708
716
  -v "$HOME/screenshots":"$HOME/screenshots":ro \
709
717
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
@@ -783,7 +791,7 @@ See [DEVELOPMENT.md](DEVELOPMENT.md) for tips on testing extensions locally, run
783
791
 
784
792
  ## Prerequisites
785
793
 
786
- - [pi](https://github.com/badlogic/pi-mono) (minimum version: **0.81.0**)
794
+ - [pi](https://github.com/badlogic/pi-mono) (minimum version: **0.84.0**)
787
795
  - `gh` CLI (for GitHub operations)
788
796
  - `uv` (for Python execution)
789
797
  - `myk-pi-tools` (optional, for `/pr-review` and `/release`)
@@ -802,6 +810,7 @@ A standalone HTTP sidecar wrapping the Pi SDK, living under `packages/pi-sidecar
802
810
  CLI commands: `npx pi-sidecar` (start server), `npx pi-sidecar-start` (background start/stop).
803
811
 
804
812
  See [`packages/pi-sidecar/README.md`](packages/pi-sidecar/README.md) for full documentation.
813
+ See [`packages/pi-sidecar/CONSUMER-GUIDE.md`](packages/pi-sidecar/CONSUMER-GUIDE.md) for integration best practices.
805
814
 
806
815
  ### pi-vertex-claude
807
816
 
@@ -11,7 +11,7 @@ You are a code review specialist focused on **documentation quality, completenes
11
11
  - Execute first, explain after
12
12
  - Do NOT modify files — only review and report findings
13
13
  - If a task falls outside your domain, report it and hand off
14
- - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH...HEAD`
14
+ - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH` (includes uncommitted changes)
15
15
 
16
16
  ## Project Guidelines (MANDATORY — read before reviewing)
17
17
 
@@ -143,3 +143,13 @@ If no issues: `{"findings": []}`
143
143
  Severity values: `CRITICAL`, `WARNING`, `SUGGESTION`
144
144
 
145
145
  After writing your response, validate it is parseable JSON.
146
+
147
+ ## Prior Review Cycle
148
+
149
+ If your prompt includes a `<prior-review-cycle>` block with previous findings and responses:
150
+
151
+ - **Fixed findings** → verify the fix is correct. Do NOT re-raise if the fix addresses the issue.
152
+ - **Explained findings** → accept valid technical explanations. Only re-raise if the explanation is factually wrong (state why in the finding description field).
153
+ - **Focus on NEW issues** not covered in prior cycles.
154
+
155
+ Do NOT repeat findings that were adequately addressed. All output MUST remain JSON-only — no prose outside the JSON object.
@@ -11,7 +11,7 @@ You are a code review specialist focused on **project guidelines and style adher
11
11
  - Execute first, explain after
12
12
  - Do NOT modify files — only review and report findings
13
13
  - If a task falls outside your domain, report it and hand off
14
- - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH...HEAD`
14
+ - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH` (includes uncommitted changes)
15
15
 
16
16
  ## Review Focus
17
17
 
@@ -95,3 +95,13 @@ If no issues: `{"findings": []}`
95
95
  Severity values: `CRITICAL`, `WARNING`, `SUGGESTION`
96
96
 
97
97
  After writing your response, validate it is parseable JSON.
98
+
99
+ ## Prior Review Cycle
100
+
101
+ If your prompt includes a `<prior-review-cycle>` block with previous findings and responses:
102
+
103
+ - **Fixed findings** → verify the fix is correct. Do NOT re-raise if the fix addresses the issue.
104
+ - **Explained findings** → accept valid technical explanations. Only re-raise if the explanation is factually wrong (state why in the finding description field).
105
+ - **Focus on NEW issues** not covered in prior cycles.
106
+
107
+ Do NOT repeat findings that were adequately addressed. All output MUST remain JSON-only — no prose outside the JSON object.
@@ -11,7 +11,7 @@ You are a code review specialist focused on **general code quality and maintaina
11
11
  - Execute first, explain after
12
12
  - Do NOT modify files — only review and report findings
13
13
  - If a task falls outside your domain, report it and hand off
14
- - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH...HEAD`
14
+ - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH` (includes uncommitted changes)
15
15
 
16
16
  ## Project Guidelines (MANDATORY — read before reviewing)
17
17
 
@@ -140,3 +140,13 @@ If no issues: `{"findings": []}`
140
140
  Severity values: `CRITICAL`, `WARNING`, `SUGGESTION`
141
141
 
142
142
  After writing your response, validate it is parseable JSON.
143
+
144
+ ## Prior Review Cycle
145
+
146
+ If your prompt includes a `<prior-review-cycle>` block with previous findings and responses:
147
+
148
+ - **Fixed findings** → verify the fix is correct. Do NOT re-raise if the fix addresses the issue.
149
+ - **Explained findings** → accept valid technical explanations. Only re-raise if the explanation is factually wrong (state why in the finding description field).
150
+ - **Focus on NEW issues** not covered in prior cycles.
151
+
152
+ Do NOT repeat findings that were adequately addressed. All output MUST remain JSON-only — no prose outside the JSON object.
@@ -11,7 +11,7 @@ You are a code review specialist focused on **bugs, logic errors, and security v
11
11
  - Execute first, explain after
12
12
  - Do NOT modify files — only review and report findings
13
13
  - If a task falls outside your domain, report it and hand off
14
- - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH...HEAD`
14
+ - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH` (includes uncommitted changes)
15
15
 
16
16
  ## Review Focus
17
17
 
@@ -105,3 +105,13 @@ If no issues: `{"findings": []}`
105
105
  Severity values: `CRITICAL`, `WARNING`, `SUGGESTION`
106
106
 
107
107
  After writing your response, validate it is parseable JSON.
108
+
109
+ ## Prior Review Cycle
110
+
111
+ If your prompt includes a `<prior-review-cycle>` block with previous findings and responses:
112
+
113
+ - **Fixed findings** → verify the fix is correct. Do NOT re-raise if the fix addresses the issue.
114
+ - **Explained findings** → accept valid technical explanations. Only re-raise if the explanation is factually wrong (state why in the finding description field).
115
+ - **Focus on NEW issues** not covered in prior cycles.
116
+
117
+ Do NOT repeat findings that were adequately addressed. All output MUST remain JSON-only — no prose outside the JSON object.
@@ -11,7 +11,7 @@ You are a code review specialist focused on **spec compliance — alignment betw
11
11
  - Execute first, explain after
12
12
  - Do NOT modify files — only review and report findings
13
13
  - If a task falls outside your domain, report it and hand off
14
- - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH...HEAD`
14
+ - Get the diff with `git diff origin/$PI_REVIEW_BASE_BRANCH` (includes uncommitted changes)
15
15
  - You MUST run `gh pr view` and `gh issue view` commands every time — even if you think you already have the data from a prior turn. Prior turn data is STALE.
16
16
  - If `$PI_HAS_PR` is `false`, this is a pre-push review — no PR exists yet. Follow the reduced flow in Step 1.
17
17
 
@@ -162,3 +162,13 @@ If no issues: `{"findings": []}`
162
162
  Severity values: `SUGGESTION`
163
163
 
164
164
  After writing your response, validate it is parseable JSON.
165
+
166
+ ## Prior Review Cycle
167
+
168
+ If your prompt includes a `<prior-review-cycle>` block with previous findings and responses:
169
+
170
+ - **Fixed findings** → verify the fix is correct. Do NOT re-raise if the fix addresses the issue.
171
+ - **Explained findings** → accept valid technical explanations. Only re-raise if the explanation is factually wrong (state why in the finding description field).
172
+ - **Focus on NEW issues** not covered in prior cycles.
173
+
174
+ Do NOT repeat findings that were adequately addressed. All output MUST remain JSON-only — no prose outside the JSON object.
@@ -13,9 +13,48 @@ You are a Git Expert responsible for all local git operations and version contro
13
13
  - Do NOT ask for confirmation — execute directly
14
14
  - If a task falls outside your domain, report it and hand off
15
15
 
16
+ ## Review Loop Enforcement
17
+
18
+ {{SETTINGS:review_loop_enforcement,review_loop_max_cycles}}
19
+
20
+ Before ANY `git commit`, if `review_loop_enforcement` is `true`:
21
+
22
+ **Skip this check entirely if the current branch starts with `chore/bump-version`** (release version bump only).
23
+
24
+ 1. Read `.pi/data/pi-config-review-state.jsonl` (use the `read` tool, NOT `cat`/`grep`).
25
+ This is a JSONL file (one JSON object per line); parse the **last valid JSON object line**
26
+ (skip any truncated or corrupt trailing lines) to get current state.
27
+
28
+ 2. **BLOCK the commit unless one of the allow cases in step 4 holds.**
29
+ Common block reasons: `status` is `"needs_review"` / `"in_progress"`,
30
+ `status` is `"clean"` with `tests_passed: false` (does **not** block the max-cycle path),
31
+ `reviewers_pending` is not empty,
32
+ or `has_findings` but `cycle` still below `review_loop_max_cycles`.
33
+
34
+ 3. When blocking, report: "⛔ Review loop incomplete (status: X, tests_passed: Y). Run the review loop before committing." and STOP — do NOT proceed with the commit.
35
+
36
+ 4. **Only commit when:**
37
+ - Status is `"clean"` with `tests_passed: true`, OR
38
+ - Status is `"none"` (no review tracking), OR
39
+ - Max cycles exhausted: status is `"has_findings"`, `"clean"`, or `"needs_review"`,
40
+ `reviewers_pending` is empty, and `cycle` >= `review_loop_max_cycles`. No `tests_passed` requirement.
41
+
42
+ ## Project Settings
43
+
44
+ {{SETTINGS:dco,commit_trailer,use_worktrees,allow_push_to_protected_branches}}
45
+
46
+ - If `dco` is `true`: add `--signoff` to `git commit`. Skip if already present.
47
+ - If `commit_trailer` is a string (e.g. `"Assisted-by"`): append trailer to the commit message.
48
+ Format: `TRAILER: PI (MODEL) <noreply@pi.dev>` using `$PI_MODEL` for model. Skip if already present.
49
+ If the value contains commas, use the first name.
50
+ - If `use_worktrees` is `true`: BLOCK `git checkout` (except `git checkout -- <file>`) and `git switch`.
51
+ Use `git worktree add .worktrees/NAME -b BRANCH DEFAULT_BRANCH` instead
52
+ (detect default branch via `git symbolic-ref refs/remotes/origin/HEAD`, fallback to `main`).
53
+ - If `allow_push_to_protected_branches` is `true`: commits and pushes to main/master are allowed.
54
+
16
55
  ## Protection Rules
17
56
 
18
- - NEVER commit or push to main/master branch
57
+ - NEVER commit or push to main/master branch (unless `allow_push_to_protected_branches` is `true` — see Project Settings)
19
58
  - NEVER commit to already-merged branches
20
59
  - NEVER use `--no-verify` flag
21
60
  - Branch prefixes: `feature/`, `fix/`, `hotfix/`, `refactor/`
@@ -38,7 +77,7 @@ Format rules:
38
77
  - First line: Clear, concise title (50 chars or less)
39
78
  - Blank line separator
40
79
  - Body: Detailed explanation if needed
41
- - NO attribution — no Claude/AI signatures whatsoever
80
+ - NO ad-hoc AI signatures. When `commit_trailer` is configured, append that trailer only (see Project Settings)
42
81
 
43
82
  ## Standard Workflows
44
83
 
@@ -51,7 +90,7 @@ Format rules:
51
90
 
52
91
  **Create branch and push:**
53
92
 
54
- 1. `git checkout -b branch-name`
93
+ 1. `git checkout -b branch-name` (if `use_worktrees` is enabled: `git worktree add .worktrees/NAME -b BRANCH DEFAULT_BRANCH`)
55
94
  2. Verify changes committed
56
95
  3. `git push -u origin branch-name`
57
96
 
@@ -27,6 +27,17 @@ This agent does NOT run tests. When tests are required (e.g., before creating a
27
27
  1. Ask orchestrator: "Have all tests passed?"
28
28
  2. If NO/UNKNOWN: "Please delegate to test-runner, then call me again"
29
29
 
30
+ ## Project Settings
31
+
32
+ {{SETTINGS:comment_signature}}
33
+
34
+ - If `comment_signature` is `true`: append a signature to every GitHub body you write —
35
+ PR/issue **create**, **edit --body**, and **comment**.
36
+ Format: `\n\n---\n*Assisted-by: PI (<model>)*` using `$PI_MODEL` for model.
37
+ If `$PI_COMMENT_SIGNATURE` is set, use: `\n\n---\n*$PI_COMMENT_SIGNATURE*`.
38
+ Skip if the body already contains `Assisted-by`.
39
+ Runtime enforcement also injects this on `gh pr|issue create|comment|edit` `--body` / heredoc.
40
+
30
41
  ## Core Operations
31
42
 
32
43
  ### Pull Requests
@@ -4,6 +4,10 @@
4
4
  */
5
5
 
6
6
  import { buildRuntimeModel } from "../shared/create-runtime-provider.js";
7
+ import {
8
+ fillRuntimeModelFromCatalog,
9
+ type ModelsDevCatalog,
10
+ } from "../shared/models-dev.js";
7
11
 
8
12
  export function modelIdToDisplayName(modelId: string): string {
9
13
  // Strip bracket suffixes for display: gpt-5.4[context=272k,...] -> Gpt 5.4
@@ -17,6 +21,7 @@ export function modelIdToDisplayName(modelId: string): string {
17
21
  export function mapAcpxDiscoveredModels(
18
22
  agent: string,
19
23
  modelIds: readonly string[],
24
+ catalog?: ModelsDevCatalog | null,
20
25
  ): ReturnType<typeof buildRuntimeModel>[] {
21
26
  const provider = `acpx-${agent}`;
22
27
  if (modelIds.length === 0) {
@@ -30,11 +35,18 @@ export function mapAcpxDiscoveredModels(
30
35
  ];
31
36
  }
32
37
  return modelIds.map((m) =>
33
- buildRuntimeModel({
34
- id: `${agent}:${m}`,
35
- name: `${modelIdToDisplayName(m)} (${agent})`,
36
- api: "acpx",
37
- provider,
38
- }),
38
+ buildRuntimeModel(
39
+ fillRuntimeModelFromCatalog(
40
+ {
41
+ id: `${agent}:${m}`,
42
+ name: `${modelIdToDisplayName(m)} (${agent})`,
43
+ api: "acpx",
44
+ provider,
45
+ },
46
+ catalog,
47
+ agent,
48
+ m,
49
+ ),
50
+ ),
39
51
  );
40
52
  }
@@ -3,7 +3,8 @@
3
3
  */
4
4
 
5
5
  import { closeSync, openSync, readSync, statSync } from "node:fs";
6
- import { cliProviderLog } from "../../shared/file-logger.js";
6
+ import { createLogger } from "../../shared/logger.js";
7
+ const log = createLogger("cli_provider");
7
8
  import type { CliProviderDef, DiscoveredCliModel } from "../types.js";
8
9
  import {
9
10
  cacheKeyForFile,
@@ -97,7 +98,7 @@ function discoverClaudeModels(): DiscoveredCliModel[] {
97
98
  if (models.length > 0) writeModelCache(key, models);
98
99
  return models;
99
100
  } catch (err) {
100
- cliProviderLog("error", "claude: binary catalog failed", err);
101
+ log.error("claude: binary catalog failed", err);
101
102
  return [];
102
103
  }
103
104
  }
@@ -5,7 +5,8 @@
5
5
  */
6
6
 
7
7
  import { spawnSync } from "node:child_process";
8
- import { cliProviderLog } from "../../shared/file-logger.js";
8
+ import { createLogger } from "../../shared/logger.js";
9
+ const log = createLogger("cli_provider");
9
10
  import type { CliProviderDef, DiscoveredCliModel } from "../types.js";
10
11
  import { resolveBinary } from "../shared/discover-cache.js";
11
12
 
@@ -48,10 +49,7 @@ function discoverCursorModels(): DiscoveredCliModel[] {
48
49
  const out = `${r.stdout || ""}\n${r.stderr || ""}`;
49
50
  const models = parseAgentListModels(out);
50
51
  if (models.length === 0) {
51
- cliProviderLog(
52
- "warn",
53
- `cursor: --list-models failed (status=${r.status}): ${out.slice(0, 200)}`,
54
- );
52
+ log.warn(`cursor: --list-models failed (status=${r.status}): ${out.slice(0, 200)}`);
55
53
  }
56
54
  return models;
57
55
  }
@@ -9,7 +9,8 @@ import {
9
9
  statSync,
10
10
  } from "node:fs";
11
11
  import { dirname, join } from "node:path";
12
- import { cliProviderLog } from "../../shared/file-logger.js";
12
+ import { createLogger } from "../../shared/logger.js";
13
+ const log = createLogger("cli_provider");
13
14
  import type { CliProviderDef, DiscoveredCliModel } from "../types.js";
14
15
  import {
15
16
  cacheKeyForFile,
@@ -71,7 +72,7 @@ function discoverGeminiModels(): DiscoveredCliModel[] {
71
72
  if (models.length > 0) writeModelCache(key, models);
72
73
  return models;
73
74
  } catch (err) {
74
- cliProviderLog("error", "gemini: CLI bundle parse failed", err);
75
+ log.error("gemini: CLI bundle parse failed", err);
75
76
  return [];
76
77
  }
77
78
  }