pi-cohort 7.0.0 → 7.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [7.0.2] - 2026-09-20
4
+
5
+ ### Changed
6
+
7
+ - `/investigate` runs the verification wave right after the wave-1 draft instead of asking "Run the verification tasks?": every wave is read-only, so the request already authorizes the whole run. The brief prints once, with `### Verified` filled in.
8
+
9
+ ## [7.0.1] - 2026-09-17
10
+
11
+ ### Fixed
12
+
13
+ - `/handoff` records the run's linked worktree instead of the session cwd: the producer names it, the scout validates it against `git worktree list --porcelain` and snapshots it via `git -C`; a rejected candidate is surfaced under `## Open questions`; the `worktree:` field no longer misreports `yes` from a primary subdirectory. ([#17](https://github.com/jjuraszek/pi-cohort/issues/17))
14
+
3
15
  ## [7.0.0] - 2026-09-17
4
16
 
5
17
  ### Removed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cohort",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "description": "Delegate Pi work to focused child agents: code review, scouting, implementation, parallel audits, saved chains, and background jobs.",
5
5
  "author": "Jacek Juraszek",
6
6
  "license": "MIT",
@@ -15,12 +15,23 @@ $@
15
15
  - You write `## Intent`, `## Decisions`, `## Open questions`, and `## Skills loaded` from your own transcript, before the call and after it returns. Do not fork a child for this: forking a near-full transcript is the cost this handoff avoids.
16
16
  - Write nothing into the repository; the brief goes to `--out` or `$DIR/handoff.md`.
17
17
 
18
+ ## Run worktree
19
+
20
+ Before the snapshot dispatch, determine the run worktree from your own transcript and interpolate it into the scout task as `Run worktree: <abs path>` or `Run worktree: none`:
21
+
22
+ - A flow-level worktree the run created (any `git worktree add <path>` you ran, or a `Worktree ready at <path>` report from `/skill:using-git-worktrees`) or was told to work in (a resume brief's `worktree: yes <path>`, or a user instruction).
23
+ - Never inferred from the session cwd; a created or assigned worktree still qualifies when it happens to equal the cwd. Never a per-task worktree from `tasks[].worktree: true` or `worktree: true` dispatches - those are ephemeral.
24
+ - Two flow-level worktrees in the transcript: the candidate is the one most recently used by later work (a dispatch `cwd`, a `git -C <path>`, or a `cd <path>`); if that does not distinguish them, the most recent creation or assignment. The other goes into `## Open questions` as `Also seen: <path> - not recorded as the run worktree`.
25
+ - No flow-level worktree created or named: `Run worktree: none`.
26
+
27
+ After the scout returns, copy any `open-question:` line from `repo.md` into `## Open questions` without the `open-question:` prefix; it never appears in `## Repo state`.
28
+
18
29
  ## Repo snapshot
19
30
 
20
31
  ```
21
32
  subagent({ async: false, context: "fresh", tasks: [
22
33
  { agent: "scout", cwd: "<cwd>", reads: false, output: "<DIR>/repo.md",
23
- task: "Read-only; write only to your output path. Report each field on its own line, `unavailable` when a command fails: toplevel (git rev-parse --show-toplevel); `worktree: yes <path>` when git rev-parse --git-dir and --git-common-dir differ, else `worktree: no`; branch (git branch --show-current, `detached` when empty); HEAD SHA; base (origin/HEAD short name, else origin/main or origin/master if present, else `base: unknown`); dirty (git status --porcelain, or `clean`); diff-stat (git diff --stat <base>...HEAD; `diff-stat: unavailable` when base is unknown); test command (package.json scripts or AGENTS.md). Not a git repo -> the single line `not a git repo`." }
34
+ task: "Read-only; write only to your output path. Run worktree: <abs path|none>. Steps: (1) linked set: git worktree list --porcelain | awk '/^worktree /{print substr($0,10)}' - the first line is the primary checkout, the rest are the linked worktrees; a relative candidate resolves against the primary toplevel, not cwd. (2) candidate `none` or line absent -> target is cwd, go to (4). Otherwise if the candidate is relative, prefix it with the primary toplevel (first linked-set line) first; C=$(git -C <candidate> rev-parse --show-toplevel); valid when that succeeds and C equals one of the linked lines exactly (a line after the first; equality with the first, primary line is invalid); anything else (failure, not listed, the primary itself, prunable) is invalid -> target is cwd and emit the open-question line in (5). (3) valid -> target is $C and `worktree: yes $C`. (4) target cwd -> T=$(git rev-parse --show-toplevel); `worktree: yes $T` when $T equals one of the linked lines exactly (a line after the first; the first, primary line gives `worktree: no`), else `worktree: no`. (5) report each field on its own line, `unavailable` when a command fails, every git command as `git -C <target>`: toplevel (git -C <target> rev-parse --show-toplevel); the worktree line from (3) or (4); branch (git -C <target> branch --show-current, `detached` when empty); HEAD SHA; base (origin/HEAD short name, else origin/main or origin/master if present, else `base: unknown`); dirty (git -C <target> status --porcelain, or `clean`); diff-stat (git -C <target> diff --stat <base>...HEAD; `diff-stat: unavailable` when base is unknown); test command (<target>/package.json scripts or <target>/AGENTS.md). Invalid candidate: after the fields add the single line `open-question: producer named <candidate as submitted> as the run worktree; it is not a linked worktree of this repo`. cwd not a git repo -> the single line `not a git repo`, plus the same open-question line if a candidate was submitted." }
24
35
  ]})
25
36
  ```
26
37
 
@@ -17,6 +17,7 @@ $@
17
17
  - Write nothing into the repository. The brief goes to `--out` if given (relative resolves against cwd), else `$DIR/brief.md`.
18
18
  - A question whose answer is in code, docs, or the tracker is not asked; it is looked up in wave 1 or wave 2.
19
19
  - A verification task that would run, build, or validate the proposed change is rejected at brief-writing time. Wave 2 exercises the system as it is today.
20
+ - No human gate between waves: the request is the approval for the whole investigation, and every wave is read-only.
20
21
 
21
22
  ## Wave 1
22
23
 
@@ -40,12 +41,12 @@ A task that errored or left its output empty -> its section reads `<agent> faile
40
41
 
41
42
  ## Brief
42
43
 
43
- Read the outputs and write, section names fixed:
44
+ Read the outputs and draft, section names fixed:
44
45
 
45
46
  ```markdown
46
47
  # Investigation: <slug>
47
48
  ## Request
48
- ## Findings (cited; `### Verified` appended after wave 2)
49
+ ## Findings (cited; `### Verified` holds wave 2 results)
49
50
  ## External context (only when context-builder ran; unreadable refs listed)
50
51
  ## Premise check (Confirmed / Contradicted / Unverified - one line each, cited)
51
52
  ## Open questions (numbered; each ends with `Recommendation: <answer> - <why>`)
@@ -53,8 +54,6 @@ Read the outputs and write, section names fixed:
53
54
  ## Next steps (suggestions only; no implementation task decomposition)
54
55
  ```
55
56
 
56
- Print the path and the brief.
57
+ ## Wave 2
57
58
 
58
- ## Wave 2 (ask once)
59
-
60
- Ask: "Run the verification tasks?" No -> stop. Yes -> one call `subagent({ async: false, context: "fresh", tasks })`, one task per verification task, `scout` by default or `reviewer` when judgement is needed, each task text containing the phrase "read-only", `reads: false`, absolute `output` under `$DIR`. Fold results into `## Findings` under `### Verified` and rewrite the brief at the same path.
59
+ Runs immediately after the draft; no ask. One call `subagent({ async: false, context: "fresh", tasks })`, one task per verification task, `scout` by default or `reviewer` when judgement is needed, each task text containing the phrase "read-only", `reads: false`, absolute `output` under `$DIR`. No verification tasks -> skip the wave and omit `### Verified`. Fold results into `## Findings` under `### Verified`, write the brief, and print the path and the brief once.