@polygraph/claude-plugin 0.5.1 → 0.5.3

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.
@@ -30,7 +30,29 @@ spawn_agent(
30
30
 
31
31
  Write the instruction as if to a competent engineer who cannot see your conversation: state the goal, the constraints, what "done" looks like, and what to report back. The child has its own repo and its own context; it inherits nothing from yours.
32
32
 
33
- Delegate to several repos in parallel by calling `spawn_agent` once per repo before waiting on any of them.
33
+ Delegate to several repos in parallel before waiting on any of them, and prefer one call over N. There are three shapes, the same three `polygraph agent spawn` takes:
34
+
35
+ - **One repo** — `repo` with an `instruction`.
36
+ - **Several repos, one task** — `repos` with one `instruction`, run verbatim in each.
37
+ - **Several repos, different tasks** — `specFile`, a JSON file you write, whose path you pass.
38
+
39
+ Batching pays because the shared text is transmitted once rather than once per repo, and every sibling starts from a byte-identical prompt prefix that can be served from cache. Each id still gets its own poller.
40
+
41
+ The spec file is the many-to-many form. Each entry names a repo and carries its own `instruction`, and optionally its own `context`, `role`, `agent`, and `model`. Whatever the entries share goes in `sharedInstruction` / `sharedContext`, which are prepended to each entry's own text with a blank line between — so the common brief stays one identical prefix and only the per-repo part varies. An entry may carry no `instruction` of its own and rely entirely on the shared one. Being a file, it also carries a brief too large to pass as an argument, and it is straightforward to generate programmatically.
42
+
43
+ ```jsonc
44
+ {
45
+ "sharedInstruction": "Brief every child gets, verbatim.",
46
+ "sharedContext": "Optional background every child gets.",
47
+ "agents": [
48
+ { "repo": "api", "instruction": "Add the expand parameter to the endpoint." },
49
+ { "repo": "people", "instruction": "Consume it in the client.", "context": "This repo still pins the old SDK." },
50
+ { "repo": "planets", "role": "reviewer", "agent": "codex", "instruction": "Review the change against the shared brief." }
51
+ ]
52
+ }
53
+ ```
54
+
55
+ One qualifier is load-bearing: share only what is genuinely shared. Flattening several different tasks into one `sharedInstruction` to look efficient produces worse work, and the round trips to repair it cost more than the batch saved. Work that differs belongs in each entry's own `instruction`, which is what the file is for.
34
56
 
35
57
  **Own-repo rule.** With the default role, `repo` must be a repository other than the one you are working in — never delegate into your own repo with the default role; work on it directly (ordinary local subagents are fine for that). Delegating into your own repo IS allowed with an explicit non-default `role`, because each (repo, role) pair is a separate agent slot and the child then runs alongside your own default-role work without colliding with it.
36
58
 
@@ -75,6 +97,8 @@ show_agent(sessionId: "<sessionId>", id: "<id>")
75
97
 
76
98
  One-off unwaited reads like this are cheap and expected inline. It is the *waiting* that belongs in a subagent, not the reading.
77
99
 
100
+ When several pollers have exited, a **batch read** collects their results in one unwaited call: pass the list of ids and correlate each result by its delegation id.
101
+
78
102
  ## When the result is not enough
79
103
 
80
104
  Only if `result.text` is missing, truncated, or the child failed in a way you cannot explain from it:
@@ -1,6 +1,6 @@
1
1
  # Publishing Changes Reference
2
2
 
3
- The branch-to-PR flow: push branches, create draft PRs, mark them ready, and associate PRs created outside Polygraph. `push_branch`, `create_pr`, and `associate_pr` all require a `description` following the Session Description Policy — read [`session-description.md`](session-description.md) before writing one.
3
+ The branch-to-PR flow: push branches, create draft PRs, mark them ready, associate PRs created outside Polygraph, and update associated PRs. `push_branch`, `create_pr`, and `associate_pr` all require a `description` following the Session Description Policy — read [`session-description.md`](session-description.md) before writing one. `update_pr` does not require a session timeline description.
4
4
 
5
5
  ## Push Branches
6
6
 
@@ -151,3 +151,50 @@ associate_pr(
151
151
  ```
152
152
 
153
153
  **Returns** the list of PRs now associated with the session.
154
+
155
+ ## Update an Associated PR
156
+
157
+ Use the MCP `update_pr` tool to update one PR already associated with the named Polygraph session. Do not use `gh` or call Ocean HTTP directly. `mark_pr_ready` remains a separate operation.
158
+
159
+ **Parameters:**
160
+
161
+ - `sessionId` (required): The Polygraph session ID.
162
+ - `prUrl` (required): The URL of a PR already associated with the session.
163
+ - `title` (optional): Replacement PR title.
164
+ - `body` (optional): Replacement user-authored PR body. Pass an empty string to clear it. The managed Polygraph session footer remains server-owned.
165
+ - `labels` (optional): A collection update with `mode` and `values`.
166
+ - `assignees` (optional): A collection update with `mode` and `values`.
167
+
168
+ Omitted fields remain unchanged. For `labels` and `assignees`:
169
+
170
+ - `{ mode: "set", values: [...] }` replaces the complete collection. An empty `values` list clears it. Use `set` only when you intend to replace every value because it can remove labels or assignees applied by humans.
171
+ - `add` and `remove` preserve unrelated values and require a non-empty `values` list.
172
+
173
+ Set the complete label collection and clear the user-authored body:
174
+
175
+ ```
176
+ update_pr(
177
+ sessionId: "<session-id>",
178
+ prUrl: "https://github.com/org/repo/pull/123",
179
+ body: "",
180
+ labels: {
181
+ mode: "set",
182
+ values: ["documentation", "release-note"]
183
+ }
184
+ )
185
+ ```
186
+
187
+ Add an assignee while leaving the title, body, labels, and other assignees unchanged:
188
+
189
+ ```
190
+ update_pr(
191
+ sessionId: "<session-id>",
192
+ prUrl: "https://github.com/org/repo/pull/123",
193
+ assignees: {
194
+ mode: "add",
195
+ values: ["octocat"]
196
+ }
197
+ )
198
+ ```
199
+
200
+ Metadata updates do not require a session timeline `description`.
@@ -4,7 +4,7 @@
4
4
 
5
5
  `description` is user-facing Polygraph session context.
6
6
 
7
- `description` is required for `push_branch`, `create_pr`, and `associate_pr`, and is the primary input to `update_session` (which takes `title` and/or `description`). (`mark_pr_ready` does not take a description.) The Polygraph web app renders the description as Markdown, so use real Markdown headings — not flat `Label:` lines. Use the canonical structured format:
7
+ `description` is required for `push_branch`, `create_pr`, and `associate_pr`, and is the primary input to `update_session` (which takes `title` and/or `description`). Metadata updates through `update_pr` do not require a session timeline description, and `mark_pr_ready` does not take one. The Polygraph web app renders the description as Markdown, so use real Markdown headings — not flat `Label:` lines. Use the canonical structured format:
8
8
 
9
9
  ```markdown
10
10
  ## Goal