@polygraph/opencode-plugin 0.4.31 → 0.4.32

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.
@@ -73,7 +73,8 @@ This returns:
73
73
  - `name`: Repository name
74
74
  - `repository`: Full repo name (e.g., `org/repo`)
75
75
  - `provider`: VCS provider (e.g., `GITHUB`)
76
- - `description`: AI-generated description of what the repository does (may be null)
76
+
77
+ Candidate entries do not include repository descriptions. For natural-language discovery, pass the user's intent in `semanticQuery` so the service can apply semantic matching internally.
77
78
 
78
79
  ### Step 2: Select Relevant Repos
79
80
 
@@ -83,8 +84,8 @@ If `selectedRepoIds` or exact repo refs were provided by the main agent, use tho
83
84
 
84
85
  Otherwise, analyze the candidates using the `userContext` to determine which repos are relevant:
85
86
 
86
- 1. Read each repo's `description`
87
- 2. Match repo descriptions against the `userContext` to identify relevant repos
87
+ 1. Review each repo's `repository`, `name`, `provider`, and any relationship/filter metadata returned by the tool
88
+ 2. Match those fields and any requested filters against the `userContext` to identify relevant repos
88
89
  3. Select the repos that are relevant to the task
89
90
  4. When uncertain, include all candidates
90
91
  5. When the user described the task in natural language and the result is large, re-query with `semanticQuery` set to that description
@@ -133,16 +134,16 @@ Return a structured summary in this format:
133
134
 
134
135
  ### Repositories in this session
135
136
 
136
- | Repo | Repository ID | Description | Relationship |
137
- | --- | --- | --- | --- |
138
- | REPO_FULL_NAME | REPOSITORY_ID | DESCRIPTION | DIRECTION (distance: N) |
137
+ | Repo | Repository ID | Relationship |
138
+ | --- | --- | --- |
139
+ | REPO_FULL_NAME | REPOSITORY_ID | DIRECTION (distance: N) |
139
140
 
140
141
  ### All Candidates Discovered
141
142
  (Only include this section if `list_repos` was called)
142
143
 
143
- | Repo | Repository ID | Description | Selected |
144
- | --- | --- | --- | --- |
145
- | REPO_FULL_NAME | REPOSITORY_ID | DESCRIPTION | Yes/No |
144
+ | Repo | Repository ID | Selected |
145
+ | --- | --- | --- |
146
+ | REPO_FULL_NAME | REPOSITORY_ID | Yes/No |
146
147
  ```
147
148
 
148
149
  ## Important Notes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polygraph/opencode-plugin",
3
- "version": "0.4.31",
3
+ "version": "0.4.32",
4
4
  "description": "AI agent skills and subagents for Polygraph multi-repo coordination",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -18,7 +18,7 @@ Polygraph functionality is available via both MCP tools and CLI commands. Use wh
18
18
 
19
19
  | MCP Tool | CLI Equivalent | Description |
20
20
  | --- | --- | --- |
21
- | `list_repos` | `polygraph repo list` | Discover candidate repositories. |
21
+ | `list_repos` | `polygraph repo list` | Discover candidate repositories. Candidate entries do not include repository descriptions; use `semanticQuery` for natural-language discovery. |
22
22
  | `start_session` | `polygraph session start --repo <ids>` | Initialize a Polygraph session with selected repositories |
23
23
  | `spawn_agent` | — | Start a new child task or send a follow-up to an active task in another repository. Input: `{ sessionId, repo, instruction, context? }`. Output: `{ taskId, message, status: 'delegated' }`. Follow-up routing is automatic: if the repo already has an active child task, the instruction is delivered to it as a follow-up message; otherwise a new child run starts. A repo has at most one active child at a time. A session resume or reconstruction is read-only context restoration; after resuming, do not use `spawn_agent` to continue changes unless the user explicitly asks for changes. |
24
24
  | `show_agent` | — | Poll flat per-child status for the session. Output: `{ children: PolygraphChildStatusItem[] }` where each item exposes `repositoryId`, `repoFullName`, `status`, `lastOutputLines`, `durationMs`, `instruction`, `agentType?`, `inputRequiredQuestion?`. `status` is an AcpRunStatus: `'created' \| 'in-progress' \| 'input-required' \| 'permission-required' \| 'completed' \| 'failed' \| 'cancelled'` (British double-L on `'cancelled'`). `inputRequiredQuestion` is populated only when `status === 'input-required'`. |
@@ -300,27 +300,9 @@ push_branch(
300
300
 
301
301
  ### Session Description Policy
302
302
 
303
- `description` is user-facing Polygraph session context.
303
+ `description` is user-facing Polygraph session context. It is required for `push_branch`, `create_pr`, and `associate_pr`, and is the primary input to `update_session` (`mark_pr_ready` does not take a description).
304
304
 
305
- `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.) Use the canonical structured format:
306
-
307
- ```text
308
- Goal: <what the session is trying to accomplish>
309
-
310
- Current Progress: <what has been completed so far, including PR/session state when relevant>
311
-
312
- What Worked: <important decisions, approaches, or constraints that future agents should preserve>
313
-
314
- Next Steps: <clear next implementation steps>
315
- ```
316
-
317
- - Do not use a one-line feature summary for final handoff or PR creation in a multi-repo session.
318
- - Keep it concise but durable for a future resumed agent.
319
- - Prefer high-level state over file-by-file changelogs.
320
- - Mention unresolved decisions or risks when they matter.
321
- - In `Next Steps`, include only next implementation steps. Do not list routine operational steps such as pushing branches, watching CI, or marking PRs ready.
322
-
323
- > **Tip (optional):** The Polygraph UI renders fenced ` ```mermaid ` blocks in the session description as diagrams. If a small diagram would genuinely clarify the session state — for example, cross-repo relationships or a sequence of changes — you may include one. Plain text remains the norm; diagrams are never required.
305
+ **Whenever you write or update a session description, read [`reference/session-description.md`](reference/session-description.md) first.** That reference file holds the full policy: the canonical Markdown-heading template (`## Goal` / `## Current progress` / `## What worked` / `## Next steps`), the dual-audience guidance (humans in the web UI now, agents reconstructing history later), and the formatting building blocks the app renders (callouts, tables, mermaid, links, `link_reference`).
324
306
 
325
307
  ### 3. Create Draft PRs
326
308
 
@@ -630,15 +612,11 @@ get_ci_logs(
630
612
 
631
613
  ### Update Session Description
632
614
 
633
- Use this when the user asks to summarize progress, update the session description, capture the current state.
615
+ Use this when the user asks to summarize progress, update the session description, or capture the current state.
634
616
 
635
- Before writing:
636
- - Read the current session details.
637
- - Consider the current conversation, child-agent results, PRs, pushed branches, validation, and unresolved decisions.
638
- - If appending a new item, read the current/latest description first and write the full replacement description with the existing items plus the new item.
639
- - If updating or replacing the existing last item, write the resulting state directly.
617
+ Read [`reference/session-description.md`](reference/session-description.md) for the full update procedure (what to read before writing, how to append vs. replace) and the canonical Markdown-heading format. Then call `update_session` with the resulting summary as `description`.
640
618
 
641
- Write the description using the canonical structured format in the Session Description Policy. Then call `update_session` with the resulting summary as `description`.
619
+ Be liberal about updating the session description when you make changes that affect the scope of the session, how logic flows between repos, or anything else important for posterity. Avoid updating it for small implementation details that are not relevant outside of this session. An up-to-date session description matters for maintainability.
642
620
 
643
621
  ### Print Polygraph Session Details
644
622
 
@@ -0,0 +1,111 @@
1
+ # Session Description Reference
2
+
3
+ ## Session Description Policy
4
+
5
+ `description` is user-facing Polygraph session context.
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:
8
+
9
+ ```markdown
10
+ ## Goal
11
+
12
+ <what the session is trying to accomplish>
13
+
14
+ ## Current progress
15
+
16
+ <what has been completed so far, including PR/session state when relevant>
17
+
18
+ ## What worked
19
+
20
+ <important decisions, approaches, or constraints that future agents should preserve>
21
+
22
+ ## Next steps
23
+
24
+ <clear next implementation steps>
25
+ ```
26
+
27
+ - Do not use a one-line feature summary for final handoff or PR creation in a multi-repo session.
28
+ - Keep it concise but durable for a future resumed agent.
29
+ - Prefer high-level state over file-by-file changelogs.
30
+ - Mention unresolved decisions or risks when they matter.
31
+ - In `Next steps`, include only next implementation steps. Do not list routine operational steps such as pushing branches, watching CI, or marking PRs ready.
32
+
33
+ ## Dual audience: humans now, agents later
34
+
35
+ The description has two readers, and you must write for both:
36
+
37
+ 1. **Humans, in the web UI** — this is the primary surface. The app renders the description as Markdown for people scanning session state.
38
+ 2. **Agents, later** — the description is also read back by agents reconstructing session history (for example, on resume). They may not have the original working tree, branch, or local environment available.
39
+
40
+ Because of the second audience, write **durably**:
41
+
42
+ - Avoid ephemeral or local references (paths, ports, in-progress scratch state) that won't mean anything to a later reader.
43
+ - Don't assume the original working tree is available — describe *what* changed and *why* at a level that survives without the diff in front of you.
44
+ - Capture decisions and constraints, not just a snapshot of the current terminal.
45
+
46
+ ## Formatting building blocks
47
+
48
+ Plain text (headings + prose + lists) remains the norm. The blocks below are available when they genuinely add clarity — reach for them only when they earn their place.
49
+
50
+ ### Headings, emphasis, lists
51
+
52
+ Use the `##` headings from the canonical template. Use **bold**/*italic* for emphasis, and bullet or numbered lists for enumerations. Keep nesting shallow.
53
+
54
+ ### Callouts (GitHub alert syntax)
55
+
56
+ The app maps each callout to a status color, so pick the right type:
57
+
58
+ - `> [!WARNING]` / `> [!CAUTION]` — risky migrations, destructive operations, or **required manual steps** a reader must not miss.
59
+ - `> [!NOTE]` / `> [!IMPORTANT]` — context, rationale, or a key constraint worth highlighting.
60
+ - `> [!TIP]` — an optional helpful pointer.
61
+
62
+ ```markdown
63
+ > [!WARNING]
64
+ > The auth migration must run before deploying the API repo, or existing sessions are invalidated.
65
+ ```
66
+
67
+ ### Tables (GFM)
68
+
69
+ Use a GitHub-Flavored Markdown table only for genuinely tabular data. The polygraph UI already shows per-PR state so avoid that.
70
+
71
+ ```markdown
72
+ | Repo | Change Type |
73
+ | ----------- | ------------------ |
74
+ | org/api | api functionality |
75
+ | org/web | text-only |
76
+ ```
77
+
78
+ ### Mermaid diagrams
79
+
80
+ The app renders fenced ` ```mermaid ` blocks as diagrams. Use one only when it genuinely clarifies session state. Good uses:
81
+
82
+ - Control or data flow between logic pieces across repos or system components.
83
+ - A sequence of changes, or migration order.
84
+ - A state machine.
85
+
86
+ > [!IMPORTANT]
87
+ > Do NOT redraw the cross-repo dependency / repository graph. The app already renders the repo-relationship graph for every session, so a repo-relationship diagram in the description is redundant.
88
+
89
+ Plain text remains the norm; diagrams are optional and never required.
90
+
91
+ ### Code blocks and task lists
92
+
93
+ Use fenced code blocks for commands, signatures, or short snippets. Use task lists (`- [ ]` / `- [x]`) when tracking discrete remaining work items.
94
+
95
+ ### Links
96
+
97
+ - Prefer durable external URLs (e.g. GitHub PRs/issues, Linear tickets).
98
+ - Do NOT put local or dev links in the description: `localhost`, `127.0.0.1`, and `file://` URLs do not resolve in the UI and are useless to later readers.
99
+ - Do NOT put repo-relative file paths (`./foo.ts`, `../bar`) as links — they don't resolve in the UI.
100
+ - To attach supplementary references (PRs, issues, other Polygraph sessions, Linear tickets), use the `link_reference` tool instead of inline links. `link_reference` is **supplementary** to the description, not a replacement for it.
101
+
102
+ ## Updating the session description
103
+
104
+ Before writing:
105
+
106
+ - Read the current session details.
107
+ - Consider the current conversation, child-agent results, PRs, pushed branches, validation, and unresolved decisions.
108
+ - If appending a new item, read the current/latest description first and write the full replacement description with the existing items plus the new item.
109
+ - If updating or replacing the existing last item, write the resulting state directly.
110
+
111
+ Write the description using the canonical structured format above. Then call `update_session` or one of the other tools like `create_pr` that take a description as input.