pi-crew 0.5.2 → 0.5.6
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.
- package/CHANGELOG.md +183 -0
- package/README.md +17 -1
- package/docs/architecture.md +2 -0
- package/docs/bugs/cross-session-notification-leakage.md +82 -0
- package/docs/coding-agent-optimization.md +268 -0
- package/docs/deep-review-report.md +384 -0
- package/docs/distillation/cybersecurity-patterns.md +294 -0
- package/docs/migration-v0.4-v0.5.md +208 -0
- package/docs/optimization-plan.md +642 -0
- package/docs/pi-crew-v0.5.5-audit-fix-plan.md +133 -0
- package/docs/pi-mono-opportunities.md +969 -0
- package/docs/pi-mono-review.md +291 -0
- package/docs/skills/REFERENCE.md +144 -0
- package/package.json +12 -9
- package/skills/artifact-analysis-loop/SKILL.md +302 -0
- package/skills/async-worker-recovery/SKILL.md +19 -1
- package/skills/child-pi-spawning/SKILL.md +19 -6
- package/skills/context-artifact-hygiene/SKILL.md +19 -2
- package/skills/delegation-patterns/SKILL.md +68 -3
- package/skills/detection-pipeline-design/SKILL.md +285 -0
- package/skills/event-log-tracing/SKILL.md +20 -6
- package/skills/git-master/SKILL.md +20 -6
- package/skills/hunting-investigation-loop/SKILL.md +401 -0
- package/skills/incident-playbook-construction/SKILL.md +383 -0
- package/skills/live-agent-lifecycle/SKILL.md +20 -6
- package/skills/mailbox-interactive/SKILL.md +19 -6
- package/skills/model-routing-context/SKILL.md +19 -1
- package/skills/multi-perspective-review/SKILL.md +19 -4
- package/skills/observability-reliability/SKILL.md +19 -2
- package/skills/orchestration/SKILL.md +20 -2
- package/skills/ownership-session-security/SKILL.md +20 -2
- package/skills/pi-extension-lifecycle/SKILL.md +20 -2
- package/skills/post-mortem/SKILL.md +7 -2
- package/skills/read-only-explorer/SKILL.md +20 -6
- package/skills/requirements-to-task-packet/SKILL.md +23 -3
- package/skills/resource-discovery-config/SKILL.md +20 -2
- package/skills/runtime-state-reader/SKILL.md +20 -2
- package/skills/safe-bash/SKILL.md +21 -6
- package/skills/scrutinize/SKILL.md +20 -2
- package/skills/secure-agent-orchestration-review/SKILL.md +29 -2
- package/skills/security-review/SKILL.md +560 -0
- package/skills/state-mutation-locking/SKILL.md +22 -2
- package/skills/systematic-debugging/SKILL.md +8 -6
- package/skills/threat-hypothesis-framework/SKILL.md +175 -0
- package/skills/ui-render-performance/SKILL.md +20 -2
- package/skills/verification-before-done/SKILL.md +17 -2
- package/skills/widget-rendering/SKILL.md +21 -6
- package/skills/workspace-isolation/SKILL.md +20 -6
- package/skills/worktree-isolation/SKILL.md +20 -6
- package/src/agents/agent-config.ts +40 -1
- package/src/benchmark/benchmark-runner.ts +45 -0
- package/src/benchmark/feedback-loop.ts +5 -0
- package/src/config/config.ts +32 -5
- package/src/config/role-tools.ts +82 -0
- package/src/config/suggestions.ts +8 -0
- package/src/config/types.ts +4 -0
- package/src/extension/async-notifier.ts +10 -1
- package/src/extension/crew-cleanup.ts +114 -0
- package/src/extension/cross-extension-rpc.ts +1 -1
- package/src/extension/notification-router.ts +18 -0
- package/src/extension/register.ts +27 -19
- package/src/extension/registration/subagent-tools.ts +1 -1
- package/src/extension/team-tool/anchor.ts +201 -0
- package/src/extension/team-tool/api.ts +2 -1
- package/src/extension/team-tool/auto-summarize.ts +154 -0
- package/src/extension/team-tool/run.ts +42 -7
- package/src/extension/team-tool.ts +44 -2
- package/src/hooks/registry.ts +1 -3
- package/src/observability/event-bus.ts +69 -0
- package/src/observability/event-to-metric.ts +0 -2
- package/src/runtime/anchor-manager.ts +473 -0
- package/src/runtime/async-runner.ts +8 -4
- package/src/runtime/auto-summarize.ts +350 -0
- package/src/runtime/background-runner.ts +10 -3
- package/src/runtime/budget-tracker.ts +354 -0
- package/src/runtime/chain-runner.ts +507 -0
- package/src/runtime/child-pi.ts +123 -35
- package/src/runtime/crash-recovery.ts +5 -4
- package/src/runtime/crew-agent-runtime.ts +1 -0
- package/src/runtime/custom-tools/irc-tool.ts +13 -0
- package/src/runtime/custom-tools/submit-result-tool.ts +3 -2
- package/src/runtime/delivery-coordinator.ts +10 -3
- package/src/runtime/dynamic-script-runner.ts +482 -0
- package/src/runtime/foreground-control.ts +87 -17
- package/src/runtime/handoff-manager.ts +589 -0
- package/src/runtime/hidden-handoff.ts +424 -0
- package/src/runtime/live-agent-manager.ts +20 -4
- package/src/runtime/live-session-runtime.ts +39 -4
- package/src/runtime/manifest-cache.ts +2 -1
- package/src/runtime/model-resolver.ts +16 -4
- package/src/runtime/phase-tracker.ts +373 -0
- package/src/runtime/pi-args.ts +11 -1
- package/src/runtime/pi-json-output.ts +31 -0
- package/src/runtime/pipeline-runner.ts +514 -0
- package/src/runtime/progress-tracker.ts +124 -0
- package/src/runtime/retry-runner.ts +354 -0
- package/src/runtime/sandbox.ts +252 -0
- package/src/runtime/scheduler.ts +7 -2
- package/src/runtime/skill-effectiveness.ts +473 -0
- package/src/runtime/skill-instructions.ts +37 -3
- package/src/runtime/subagent-manager.ts +1 -1
- package/src/runtime/task-graph.ts +11 -1
- package/src/runtime/task-runner.ts +92 -18
- package/src/runtime/team-runner.ts +13 -12
- package/src/runtime/tool-progress.ts +10 -3
- package/src/runtime/verification-gates.ts +367 -0
- package/src/schema/team-tool-schema.ts +37 -0
- package/src/skills/discover-skills.ts +5 -0
- package/src/state/active-run-registry.ts +9 -2
- package/src/state/contracts.ts +9 -0
- package/src/state/crew-init.ts +3 -3
- package/src/state/decision-ledger.ts +98 -55
- package/src/state/event-log-rotation.ts +2 -2
- package/src/state/event-log.ts +144 -10
- package/src/state/hook-instinct-bridge.ts +5 -5
- package/src/state/mailbox.ts +10 -0
- package/src/state/run-cache.ts +18 -8
- package/src/state/state-store.ts +3 -1
- package/src/state/types.ts +4 -0
- package/src/tools/safe-bash-extension.ts +1 -0
- package/src/tools/safe-bash.ts +152 -20
- package/src/types/new-api-types.ts +34 -0
- package/src/ui/agent-management-overlay.ts +5 -1
- package/src/ui/crew-widget.ts +29 -15
- package/src/ui/overlays/mailbox-detail-overlay.ts +13 -2
- package/src/ui/powerbar-publisher.ts +101 -7
- package/src/ui/tool-render.ts +15 -15
- package/src/ui/transcript-cache.ts +13 -0
- package/src/utils/bm25-search.ts +16 -8
- package/src/utils/env-filter.ts +8 -5
- package/src/utils/redaction.ts +169 -15
- package/src/utils/session-utils.ts +52 -0
- package/src/utils/sse-parser.ts +10 -1
- package/src/worktree/cleanup.ts +6 -1
- package/src/worktree/worktree-manager.ts +32 -13
- package/workflows/chain.workflow.md +252 -0
- package/workflows/pipeline.workflow.md +27 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# pi-crew Migration Guide: v0.4 → v0.5
|
|
2
|
+
|
|
3
|
+
**Author:** pi-crew team
|
|
4
|
+
**Date:** 2026-06-01
|
|
5
|
+
**Version:** 0.5.5
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
This guide covers breaking changes and new features introduced in v0.5.x.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## v0.5.5 Highlights (June 2026)
|
|
16
|
+
|
|
17
|
+
v0.5.5 closes 13 rounds of code review. The user-facing changes are:
|
|
18
|
+
|
|
19
|
+
- **Linear-time secret redaction** at all event/mailbox/artifact boundaries.
|
|
20
|
+
- **v8.deserialize hardened** with `BINARY_MAGIC` headers — old binaries are auto-discarded.
|
|
21
|
+
- **Adaptive implementation workflow** now has a single `assess` step; the planner picks the smallest effective crew.
|
|
22
|
+
- **Async-notifier debounce** of 30 s — completion notifications can be delayed by up to 30 s.
|
|
23
|
+
- **Mailbox delivery state capped at 10000 messages** — older entries are pruned FIFO.
|
|
24
|
+
- **Anchors cap at 50 with 100 handoffs each** — older handoffs are pruned FIFO.
|
|
25
|
+
|
|
26
|
+
No new public API is required for any of these changes. If you pinned a `BINARY_MAGIC`-guarded binary from a previous session, delete `~/.pi/agent/pi-crew/.cache/active-run-index.bin` once.
|
|
27
|
+
|
|
28
|
+
## v0.5.4 → v0.5.5 Migration
|
|
29
|
+
|
|
30
|
+
No breaking changes. Drop-in replacement.
|
|
31
|
+
|
|
32
|
+
## Breaking Changes
|
|
33
|
+
|
|
34
|
+
### 1. Environment Variable Allowlist (Security)
|
|
35
|
+
|
|
36
|
+
**Before (v0.4):**
|
|
37
|
+
```typescript
|
|
38
|
+
// Child Pi workers received ALL matching secrets
|
|
39
|
+
"*_API_KEY",
|
|
40
|
+
"*_TOKEN",
|
|
41
|
+
"*_SECRET",
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**After (v0.5):**
|
|
45
|
+
```typescript
|
|
46
|
+
// Only explicit provider keys
|
|
47
|
+
"ANTHROPIC_API_KEY",
|
|
48
|
+
"OPENAI_API_KEY",
|
|
49
|
+
"GOOGLE_API_KEY",
|
|
50
|
+
// ...
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Action Required:** If your workflows rely on custom environment variables with `*_API_KEY` patterns, you must now explicitly list them:
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"piCrew": {
|
|
57
|
+
"runtime": {
|
|
58
|
+
"envAllowlist": ["MY_CUSTOM_API_KEY", "MY_OTHER_KEY"]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### 2. Mock Mode Requires Dual Environment Variables
|
|
67
|
+
|
|
68
|
+
**Before (v0.4):**
|
|
69
|
+
```bash
|
|
70
|
+
PI_TEAMS_MOCK_CHILD_PI=success # Works silently
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**After (v0.5):**
|
|
74
|
+
```bash
|
|
75
|
+
PI_TEAMS_MOCK_CHILD_PI=success
|
|
76
|
+
PI_CREW_ALLOW_MOCK=1 # Required for security
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Action Required:** Update CI/CD and test scripts that use mock mode.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### 3. Skill Frontmatter Format
|
|
84
|
+
|
|
85
|
+
**Before (v0.4):**
|
|
86
|
+
```yaml
|
|
87
|
+
---
|
|
88
|
+
name: my-skill
|
|
89
|
+
description: "My skill description"
|
|
90
|
+
---
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**After (v0.5):**
|
|
94
|
+
```yaml
|
|
95
|
+
---
|
|
96
|
+
name: my-skill
|
|
97
|
+
description: "My skill description"
|
|
98
|
+
triggers:
|
|
99
|
+
- "trigger phrase 1"
|
|
100
|
+
- "trigger phrase 2"
|
|
101
|
+
---
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Action Required:** Run `node scripts/check-all-skills.ts` to identify skills needing `triggers` field.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## New Features in v0.5
|
|
109
|
+
|
|
110
|
+
### 1. Enhanced Security
|
|
111
|
+
|
|
112
|
+
- **Secure env allowlist**: Only explicit API keys passed to child processes
|
|
113
|
+
- **Mock mode protection**: Requires `PI_CREW_ALLOW_MOCK=1` alongside `PI_TEAMS_MOCK_CHILD_PI`
|
|
114
|
+
- **Worktree hook hardening**: Safer execution on Windows
|
|
115
|
+
|
|
116
|
+
### 2. Improved Reliability
|
|
117
|
+
|
|
118
|
+
- **Terminal event durability**: Critical events (task.completed, task.failed) now bypass event buffering
|
|
119
|
+
- **Race condition fixes**: Foreground interrupt requests are now properly serialized
|
|
120
|
+
- **File descriptor cleanup**: Background runner properly closes log file descriptors
|
|
121
|
+
|
|
122
|
+
### 3. Better Observability
|
|
123
|
+
|
|
124
|
+
- **Reduced cache TTL**: Manifest cache now expires in 30s instead of 5min for faster state updates
|
|
125
|
+
- **Decision ledger integrity**: Ledger entries are preserved during promote/decay operations
|
|
126
|
+
|
|
127
|
+
### 4. Skill System
|
|
128
|
+
|
|
129
|
+
- **Standardized triggers**: All 35 built-in skills now have explicit trigger phrases
|
|
130
|
+
- **Enforcement gates**: Skills include checklist-based enforcement sections
|
|
131
|
+
- **Anti-patterns**: Most skills include anti-pattern documentation
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Configuration Changes
|
|
136
|
+
|
|
137
|
+
### New Config Keys
|
|
138
|
+
|
|
139
|
+
| Key | Type | Default | Description |
|
|
140
|
+
|-----|------|---------|-------------|
|
|
141
|
+
| `limits.heartbeatStaleMs` | number | 30000 | Stale heartbeat threshold |
|
|
142
|
+
| `runtime.effectivenessGuard` | string | "off" | Effectiveness guard level |
|
|
143
|
+
| `runtime.completionMutationGuard` | string | "off" | Mutation guard level |
|
|
144
|
+
|
|
145
|
+
### Deprecated Config Keys
|
|
146
|
+
|
|
147
|
+
None in v0.5.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Workflow Migration
|
|
152
|
+
|
|
153
|
+
### Updating Custom Agents
|
|
154
|
+
|
|
155
|
+
1. Ensure agent files have `triggers` in frontmatter:
|
|
156
|
+
```yaml
|
|
157
|
+
---
|
|
158
|
+
name: my-agent
|
|
159
|
+
triggers:
|
|
160
|
+
- "my trigger"
|
|
161
|
+
---
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
2. Verify agent is discovered:
|
|
165
|
+
```bash
|
|
166
|
+
team action=list agent=my-agent
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Updating Custom Teams
|
|
170
|
+
|
|
171
|
+
1. Validate team config:
|
|
172
|
+
```bash
|
|
173
|
+
team action=validate resource=team name=my-team
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
2. Check for breaking changes in role/task definitions.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Testing Checklist
|
|
181
|
+
|
|
182
|
+
After upgrading to v0.5:
|
|
183
|
+
|
|
184
|
+
- [ ] Run `team action=doctor` to verify configuration
|
|
185
|
+
- [ ] Run `node scripts/check-all-skills.ts` to verify skills
|
|
186
|
+
- [ ] Test mock mode with both env vars set
|
|
187
|
+
- [ ] Verify environment variables are properly filtered in child processes
|
|
188
|
+
- [ ] Test foreground interrupt (cancel) behavior
|
|
189
|
+
- [ ] Verify terminal events are properly logged
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Rollback
|
|
194
|
+
|
|
195
|
+
If issues occur after upgrade:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Revert to v0.4.x
|
|
199
|
+
pi install npm:pi-crew@0.4.x
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Support
|
|
205
|
+
|
|
206
|
+
- **Issues**: https://github.com/baphuongna/pi-crew/issues
|
|
207
|
+
- **Documentation**: [docs/](docs/)
|
|
208
|
+
- **Changelog**: [CHANGELOG.md](CHANGELOG.md)
|