pi-crew 0.11.43 → 0.11.45

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 CHANGED
@@ -1,6 +1,80 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
3
+ ## [0.11.45] — security hardening wave: worktree git-injection class closed + verified review fixes (2026-10-27)
4
+
5
+ ### Security hardening wave — worktree git-injection (MED-1) + verified review fixes
6
+
7
+ Cold-verified adversarial review of v0.11.44 surfaced one CONFIRMED code-exec class finding (git config/hook injection
8
+ in worker-controlled worktrees) plus two same-class bypass vectors found while fixing it. This wave closes the full
9
+ attack surface, not just the original report.
10
+
11
+ **Fixed — git config/hook injection via worker-controlled worktrees (MED-1, CONFIRMED).** Every git invocation that
12
+ runs with `cwd` inside a worktree is now routed through `src/worktree/git-hardening.ts`:
13
+ `-c core.fsmonitor=false -c core.hooksPath= -c core.attributesFile=` (empty `hooksPath` neutralizes
14
+ prepare-commit-msg/post-commit that `--no-verify` does not block), `--no-textconv --no-ext-diff` on `diff`,
15
+ `--no-verify` on `commit`, plus `GIT_CONFIG_NOSYSTEM=1` and a shared `buildGitSafeEnv()` (drops `process.env`
16
+ inheritance and `GIT_CONFIG_SYSTEM`). A gitdir-pointer guard (`verifyWorktreeGitdirPointer` + per-command
17
+ `assertWorktreePointerTrusted`) defeats `.git`-pointer hijack and the R-A3 TOCTOU (pointer flipped mid-chain aborts
18
+ the chain as corrupted). Covers `cleanup.ts`, `worktree-manager.ts` (incl. diff-capture fns R-A1), `post-execution.ts`
19
+ read-lane probe (R-A2 — previously raw git with full env secrets), `branch-freshness.ts`, `goal-achievement.ts`.
20
+ Regression tests use live poisoned-config fixtures (fsmonitor/hooks/textconv/filter.clean/diff.external) and assert
21
+ no marker execution. Residual (documented in-code): filter definitions in genuinely-trusted global config remain
22
+ executable — required for commit identity.
23
+
24
+ **Fixed — broker `stop()` unlink race (R-MINOR-2).** Socket leaf identity (`dev`/`ino`) is pinned right after
25
+ `listen()` in the new `src/runtime/broker/socket-stop.ts`; `stop()` unlinks only while it still owns the inode,
26
+ renames the leaf aside while closing, restores only if the path is still `ENOENT` (B-LOW2), and stale
27
+ `.stopping.<pid>.*` shields are swept once their pid is dead (B-LOW1).
28
+
29
+ **Fixed — kill-timer PID-recycle window (E1).** `killProcessPid` snapshots `/proc/<pid>/stat` starttime at entry and
30
+ re-validates before the 3s SIGKILL (group + absolute-pid fallback); proven mismatch skips the kill with a warn log.
31
+ win32//proc-less platforms keep legacy behavior (documented).
32
+
33
+ **Changed — inference-broker token map keyed by SHA-256 digest (R-LOW-4).** Raw secrets are no longer map keys nor
34
+ retained broker-side after registration, matching `crew-broker-tokens` constant-time discipline.
35
+
36
+ **Changed — pi CLI resolution no longer falls back to `process.cwd()` (E2).** A planted `package.json` matching the
37
+ pi package name could otherwise be spawned as a worker with broker-token env in degenerate installs.
38
+
39
+ **Docs — corrected the R7-9 trust-model comment** in `cross-extension-rpc.ts` (`rpc:run` is the only mutating channel
40
+ accepting unsigned RPCs — rate-limited + cwd-contained; live-control rejects all unsigned ops), and removed the dead
41
+ hello length-check shadowed by `isHelloParams` bounds (crew-broker.ts back under the wc-gate ceiling).
42
+
43
+ **CI — nightly now runs `npm audit --audit-level=high` (signal-only, `continue-on-error`) and `test:coverage`**
44
+ (first workflow to execute the existing coverage script; job timeout 30→45 min).
45
+
46
+ **Tests:** worktree suites 92/92, task-runner 213/213, socket/goal suites 146/146, `test:critical` 125/125,
47
+ `tsc --noEmit` + biome + wc-gate all clean.
48
+
49
+ ## [0.11.44] — fix wave 16: full-backlog burn-down — liveness wiring everywhere + rmSync sweep complete + T-6(b) harden (2026-10-26)
50
+
51
+ Wave 15 left three open ends: the health-monitor/widget/powerbar/session-summary surfaces still judged liveness from
52
+ `lastActivityAt` alone, the bare-`rmSync` sweep had three batches (2a/2b/3) outstanding, and `state-helpers-cas-contention`
53
+ kept flaking on win32. This wave burns down all of them (SPEC-driven follow-ups to `fixwave15`/`fixwave13`).
54
+
55
+ **Added — `heartbeatLiveForDisplay(run, tasks, now)` shared export.** Wrapped predicate in `src/runtime/process-status.ts`
56
+ (manifest + tasks → active-or-fresh-heartbeat verdict). Wired into the remaining render surfaces: health-monitor
57
+ (stale-no-progress guard, 0 extra I/O via hoisted task read), crew widget (active filter, snapshot tasks only — no disk
58
+ reads), powerbar (active segment), session-summary (lazy coalesced read, fail-closed). Every UI surface now agrees with
59
+ the watchdog on run liveness — the wave-13/15 "displayed stale while heartbeat fresh" class is closed across the fleet.
60
+
61
+ **Fixed — the full bare-`rmSync` teardown backlog. All 4 sweep batches complete:** batch 2a extension+ui+workflows
62
+ (120 files), batch 2b runtime (208 files, 821 sites), batch 3 integration (33 files, 89 sites) — migrated to
63
+ `cleanupStateRoot`/`removeDirWithRetry`/drain-then-remove. Residual audit: the 44 remaining regex-matched lines are
64
+ 26 single-file deletes (intentional), 8 recursive-`force` false-positives, 10 intentional by test semantics — zero
65
+ actionable.
66
+
67
+ **Fixed — T-6(b) win32 flake (`state-helpers-cas-contention`).** Poll for tick-marker ≥1 after child exit (bounded 2 s)
68
+ plus one flush→reload→settled retry — targets the Windows rename-visibility gap (CAS rename lands but reader sees stale
69
+ cache) without changing test semantics.
70
+
71
+ **Battery (PASS).** wiring ×3 (health-monitor 23, session-summary-cov 5, crew-widget 8, powerbar 12 + regressions),
72
+ T-6b ×5 green, `test:critical` 124/124, full unit 10,078 pass / 0 fail / 4 skip, integration 144/0/4, static gates 0,
73
+ dist MATCH (1,893,366 B), leak sweep clean. (Two external-wrapper OOM incidents during the run — no test failures;
74
+ detached rerun completed green.)
75
+
76
+ **Docs.** Battery report
77
+ `docs/real-test/reports/real-test-2026-10-26-wave16-full-backlog-battery.md`.
4
78
 
5
79
  ## [0.11.43] — fix wave 15: render trusts task heartbeats + teardown sweep batch 1 (2026-10-25)
6
80