planpong 0.3.0 → 0.5.0

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.
Files changed (59) hide show
  1. package/dist/src/config/defaults.js +1 -0
  2. package/dist/src/config/defaults.js.map +1 -1
  3. package/dist/src/config/loader.d.ts +1 -0
  4. package/dist/src/config/loader.js +3 -0
  5. package/dist/src/config/loader.js.map +1 -1
  6. package/dist/src/core/apply-edits.d.ts +40 -0
  7. package/dist/src/core/apply-edits.js +220 -0
  8. package/dist/src/core/apply-edits.js.map +1 -0
  9. package/dist/src/core/convergence.d.ts +57 -4
  10. package/dist/src/core/convergence.js +134 -6
  11. package/dist/src/core/convergence.js.map +1 -1
  12. package/dist/src/core/loop.js +3 -3
  13. package/dist/src/core/loop.js.map +1 -1
  14. package/dist/src/core/operations.d.ts +14 -1
  15. package/dist/src/core/operations.js +592 -56
  16. package/dist/src/core/operations.js.map +1 -1
  17. package/dist/src/core/plan-diff.d.ts +23 -0
  18. package/dist/src/core/plan-diff.js +135 -0
  19. package/dist/src/core/plan-diff.js.map +1 -0
  20. package/dist/src/core/session.d.ts +11 -0
  21. package/dist/src/core/session.js +51 -1
  22. package/dist/src/core/session.js.map +1 -1
  23. package/dist/src/mcp/tools/get-feedback.d.ts +16 -0
  24. package/dist/src/mcp/tools/get-feedback.js +118 -114
  25. package/dist/src/mcp/tools/get-feedback.js.map +1 -1
  26. package/dist/src/mcp/tools/revise.d.ts +16 -0
  27. package/dist/src/mcp/tools/revise.js +76 -61
  28. package/dist/src/mcp/tools/revise.js.map +1 -1
  29. package/dist/src/mcp/tools/status.js +15 -1
  30. package/dist/src/mcp/tools/status.js.map +1 -1
  31. package/dist/src/prompts/planner.d.ts +34 -1
  32. package/dist/src/prompts/planner.js +272 -17
  33. package/dist/src/prompts/planner.js.map +1 -1
  34. package/dist/src/prompts/reviewer.d.ts +14 -1
  35. package/dist/src/prompts/reviewer.js +84 -1
  36. package/dist/src/prompts/reviewer.js.map +1 -1
  37. package/dist/src/providers/claude.d.ts +3 -0
  38. package/dist/src/providers/claude.js +151 -13
  39. package/dist/src/providers/claude.js.map +1 -1
  40. package/dist/src/providers/codex.d.ts +3 -0
  41. package/dist/src/providers/codex.js +150 -14
  42. package/dist/src/providers/codex.js.map +1 -1
  43. package/dist/src/providers/types.d.ts +69 -3
  44. package/dist/src/schemas/config.d.ts +3 -0
  45. package/dist/src/schemas/config.js +6 -0
  46. package/dist/src/schemas/config.js.map +1 -1
  47. package/dist/src/schemas/json-schema.d.ts +21 -0
  48. package/dist/src/schemas/json-schema.js +172 -0
  49. package/dist/src/schemas/json-schema.js.map +1 -0
  50. package/dist/src/schemas/metrics.d.ts +171 -0
  51. package/dist/src/schemas/metrics.js +49 -0
  52. package/dist/src/schemas/metrics.js.map +1 -0
  53. package/dist/src/schemas/revision.d.ts +166 -2
  54. package/dist/src/schemas/revision.js +35 -2
  55. package/dist/src/schemas/revision.js.map +1 -1
  56. package/dist/src/schemas/session.d.ts +6 -0
  57. package/dist/src/schemas/session.js +10 -0
  58. package/dist/src/schemas/session.js.map +1 -1
  59. package/package.json +4 -2
@@ -17,7 +17,10 @@ Output ONLY the markdown plan. No preamble, no commentary.
17
17
 
18
18
  ${requirements}`;
19
19
  }
20
- export function buildRevisionPrompt(currentPlan, feedback, keyDecisions, priorContext, phase = "detail") {
20
+ export function buildRevisionPrompt(currentPlan, feedback, keyDecisions, priorContext, phase = "detail", structuredOutput = false, revisionMode = "full") {
21
+ // Direction phase always uses full-plan output (sweeping rewrites are
22
+ // expected). Risk + detail phases honor `revisionMode`.
23
+ const useEdits = revisionMode === "edits" && phase !== "direction";
21
24
  const contextBlock = priorContext
22
25
  ? `\n## Prior Research & Constraints\n\n${priorContext}\n`
23
26
  : "";
@@ -104,7 +107,65 @@ For each response, cite specific evidence: reference the plan section, the resea
104
107
  - Do not reorganize or rephrase parts of the plan unrelated to risk feedback.`
105
108
  : `- Only modify sections of the plan that are directly addressed by accepted feedback. Do not reorganize, rephrase, or "improve" parts of the plan that aren't related to any issue.
106
109
  - Preserve the plan's existing structure, headings, and formatting. Your job is surgical revision, not rewriting.`;
107
- return `${roleInstructions}
110
+ const fullSchemaBlock = `\`\`\`
111
+ {
112
+ "responses": [
113
+ {
114
+ "issue_id": "F1",
115
+ "action": "accepted" | "rejected" | "deferred",
116
+ "severity_dispute": { // optional
117
+ "original": "P1",
118
+ "revised": "P2",
119
+ "justification": "..."
120
+ },
121
+ "rationale": "Detailed explanation of why this action was taken"
122
+ }
123
+ ],
124
+ "updated_plan": "The full updated plan in markdown (incorporate accepted changes)"
125
+ }
126
+ \`\`\``;
127
+ // Edits-mode schema for risk + detail phases: planner emits a structured
128
+ // edit list instead of the full plan. Each edit is section-scoped — the
129
+ // applier locates the section heading, then finds `before` within that
130
+ // section's content. `before` MUST be unique within the section.
131
+ const editsSchemaBlock = `\`\`\`
132
+ {
133
+ "responses": [
134
+ {
135
+ "issue_id": "F1",
136
+ "action": "accepted" | "rejected" | "deferred",
137
+ "severity_dispute": { // optional
138
+ "original": "P1",
139
+ "revised": "P2",
140
+ "justification": "..."
141
+ },
142
+ "rationale": "Detailed explanation of why this action was taken"
143
+ }
144
+ ],
145
+ "edits": [
146
+ {
147
+ "section": "Steps",
148
+ "before": "verbatim text from the plan to replace (must appear EXACTLY ONCE within the named section)",
149
+ "after": "replacement text (may be empty for deletion)"
150
+ }
151
+ ]
152
+ }
153
+ \`\`\``;
154
+ const schemaBlock = useEdits ? editsSchemaBlock : fullSchemaBlock;
155
+ // Edits-mode constraints. The applier is strict: section-scoped lookup,
156
+ // unique-match-within-section enforcement, no plan-wide fallback. The
157
+ // prompt has to make those constraints visible so the planner produces
158
+ // edits that actually apply.
159
+ const editsConstraints = `- Output edits, NOT the full plan. The plan is updated server-side by replaying your edits.
160
+ - Each edit's \`section\` is the nearest markdown heading label (e.g., "Steps", "Limitations & Future Work"). The applier searches ONLY within that section's content.
161
+ - Each edit's \`before\` must appear EXACTLY ONCE within the named section, character-for-character (whitespace tolerant). If the same text appears multiple times in the section, expand \`before\` with surrounding context until it is unique within the section.
162
+ - Use the SHORTEST \`before\` that is unambiguous. Do not quote large unchanged blocks.
163
+ - \`after\` is the replacement. Empty string deletes; non-empty replaces.
164
+ - For an addition, set \`before\` to a short stable anchor (e.g., the line before the insertion point) and \`after\` to that anchor plus the new content.
165
+ - Edits run sequentially: later edits see earlier edits' results. If you have multiple edits in the same section, order them so each one's \`before\` is unique against the running plan state.
166
+ - Keep the total number of edits small — only what is needed to address accepted issues. One issue typically maps to one edit.`;
167
+ const fullModeConstraint = `- The \`updated_plan\` must be the complete plan markdown, not a diff.`;
168
+ const commonBody = `${roleInstructions}
108
169
  ${contextBlock}${decisionsBlock}
109
170
  ## Current Plan
110
171
 
@@ -116,35 +177,229 @@ ${currentPlan}
116
177
 
117
178
  ${issuesList}
118
179
 
119
- ## Your Task
180
+ ## Your Task`;
181
+ const outputConstraint = useEdits ? editsConstraints : fullModeConstraint;
182
+ if (structuredOutput) {
183
+ // Structured-output mode. Some providers constrain output at the token
184
+ // level; others only validate post-hoc. Emphatic JSON-only instructions
185
+ // help advisory providers comply; constrained providers ignore them.
186
+ return `${commonBody}
187
+
188
+ Output ONLY a single JSON object conforming to the schema below. The first character of your response must be \`{\` and the last must be \`}\`. No prose. No markdown. No code fences. No preamble or explanation. No trailing text.
189
+
190
+ Schema:
191
+
192
+ ${schemaBlock}
193
+
194
+ Constraints embedded in your JSON response:
195
+ - Every issue MUST have an entry in \`responses\`. Do not skip any.
196
+ ${outputConstraint}
197
+ ${surgicalConstraint}
198
+ - Do NOT modify the \`**planpong:**\` status line — it is managed automatically.`;
199
+ }
200
+ return `${commonBody}
120
201
 
121
202
  Respond with a JSON object wrapped in <planpong-revision> tags. The JSON must match this schema:
122
203
 
123
- \`\`\`
204
+ ${schemaBlock}
205
+
206
+ IMPORTANT:
207
+ - Every issue MUST have a response. Do not skip any.
208
+ ${outputConstraint}
209
+ ${surgicalConstraint}
210
+ - Do NOT modify the \`**planpong:**\` status line — it is managed automatically.
211
+ - Wrap your JSON response in <planpong-revision>...</planpong-revision> tags.
212
+
213
+ <planpong-revision>
214
+ YOUR_JSON_HERE
215
+ </planpong-revision>`;
216
+ }
217
+ /**
218
+ * Build a minimal revision prompt for resumed planner sessions.
219
+ *
220
+ * The planner is already in a persistent CLI conversation that has the
221
+ * plan, the prior reviewer feedback, and the planner's own prior rationales
222
+ * in context. We do NOT re-send "Current Plan", "Prior Decisions", or
223
+ * "Key Decisions" — the model has all of that. Only the new feedback +
224
+ * minimal phase reminder + output schema instructions.
225
+ *
226
+ * The output schema and surgical constraints stay because they're per-call
227
+ * directives, not stable context. (We don't trust that the model won't
228
+ * drift in format across many turns of a long session.)
229
+ */
230
+ export function buildIncrementalRevisionPrompt(feedback, phase, structuredOutput, revisionMode = "full") {
231
+ const useEdits = revisionMode === "edits" && phase !== "direction";
232
+ const issuesList = feedback.issues
233
+ .map((issue) => `### ${issue.id} (${issue.severity}): ${issue.title}\n**Section:** ${issue.section}\n**Description:** ${issue.description}\n**Suggestion:** ${issue.suggestion}`)
234
+ .join("\n\n");
235
+ const phaseLabel = phase === "direction"
236
+ ? "DIRECTION"
237
+ : phase === "risk"
238
+ ? "RISK / PRE-MORTEM"
239
+ : "DETAIL";
240
+ const surgicalConstraint = phase === "direction"
241
+ ? `- You may make structural changes (reorder sections, change approach, adjust scope) if accepted feedback warrants it.
242
+ - Preserve sections that aren't affected by the feedback.`
243
+ : phase === "risk"
244
+ ? `- Add mitigations, verification steps, or fallback procedures for accepted risks.
245
+ - You may add new sections (e.g., "Risks & Mitigations") if needed.
246
+ - Do not reorganize or rephrase parts of the plan unrelated to risk feedback.`
247
+ : `- Only modify sections of the plan that are directly addressed by accepted feedback.
248
+ - Preserve the plan's existing structure, headings, and formatting. Surgical revision, not rewriting.`;
249
+ const fullSchemaBlock = `\`\`\`
124
250
  {
125
251
  "responses": [
126
- {
127
- "issue_id": "F1",
128
- "action": "accepted" | "rejected" | "deferred",
129
- "severity_dispute": { // optional
130
- "original": "P1",
131
- "revised": "P2",
132
- "justification": "..."
133
- },
134
- "rationale": "Detailed explanation of why this action was taken"
135
- }
252
+ { "issue_id": "F1", "action": "accepted" | "rejected" | "deferred",
253
+ "severity_dispute": { "original": "P1", "revised": "P2", "justification": "..." }, // optional
254
+ "rationale": "Why this action" }
136
255
  ],
137
- "updated_plan": "The full updated plan in markdown (incorporate accepted changes)"
256
+ "updated_plan": "The full updated plan in markdown"
138
257
  }
139
- \`\`\`
258
+ \`\`\``;
259
+ const editsSchemaBlock = `\`\`\`
260
+ {
261
+ "responses": [
262
+ { "issue_id": "F1", "action": "accepted" | "rejected" | "deferred",
263
+ "severity_dispute": { "original": "P1", "revised": "P2", "justification": "..." }, // optional
264
+ "rationale": "Why this action" }
265
+ ],
266
+ "edits": [
267
+ { "section": "Steps", "before": "verbatim text from the plan (must appear EXACTLY ONCE within the named section)", "after": "replacement" }
268
+ ]
269
+ }
270
+ \`\`\``;
271
+ const schemaBlock = useEdits ? editsSchemaBlock : fullSchemaBlock;
272
+ const editsConstraints = `- Output edits, NOT the full plan. The plan is updated server-side by replaying your edits.
273
+ - Each edit's \`section\` is the nearest markdown heading. \`before\` must appear EXACTLY ONCE within that section.
274
+ - Use the SHORTEST \`before\` that is unambiguous within the section.
275
+ - For an addition: \`before\` = a stable anchor; \`after\` = anchor + new content.
276
+ - Edits run sequentially: later edits see earlier edits' results.`;
277
+ const fullModeConstraint = `- The \`updated_plan\` must be the complete plan markdown, not a diff.`;
278
+ const outputConstraint = useEdits ? editsConstraints : fullModeConstraint;
279
+ const body = `## ${phaseLabel} ROUND — Round ${"current round in your session memory"}: New Reviewer Feedback
280
+
281
+ You are continuing the same revision conversation. The plan, your prior rationales, and the prior rounds of reviewer feedback are already in your context — do not re-emit them.
282
+
283
+ The reviewer has produced new feedback for this round. Process it below.
284
+
285
+ **Summary:** ${feedback.summary}
286
+
287
+ ${issuesList}
288
+
289
+ ## Your Task`;
290
+ if (structuredOutput) {
291
+ return `${body}
292
+
293
+ Output ONLY a single JSON object conforming to the schema below. The first character of your response must be \`{\` and the last must be \`}\`. No prose. No markdown. No code fences. No preamble or explanation. No trailing text.
294
+
295
+ Schema:
296
+
297
+ ${schemaBlock}
298
+
299
+ Constraints:
300
+ - Every issue MUST have an entry in \`responses\`. Do not skip any.
301
+ ${outputConstraint}
302
+ ${surgicalConstraint}
303
+ - Do NOT modify the \`**planpong:**\` status line — it is managed automatically.`;
304
+ }
305
+ return `${body}
306
+
307
+ Respond with a JSON object wrapped in <planpong-revision> tags conforming to:
308
+
309
+ ${schemaBlock}
140
310
 
141
311
  IMPORTANT:
142
312
  - Every issue MUST have a response. Do not skip any.
143
- - The \`updated_plan\` must be the complete plan markdown, not a diff.
313
+ ${outputConstraint}
144
314
  ${surgicalConstraint}
145
315
  - Do NOT modify the \`**planpong:**\` status line — it is managed automatically.
146
316
  - Wrap your JSON response in <planpong-revision>...</planpong-revision> tags.
147
317
 
318
+ <planpong-revision>
319
+ YOUR_JSON_HERE
320
+ </planpong-revision>`;
321
+ }
322
+ /**
323
+ * Build a targeted retry prompt for failed edits in edits-mode revisions.
324
+ * Given the partially-edited plan and the list of edits that failed first
325
+ * pass, asks the planner to re-express each failed edit with corrected
326
+ * `section` and `before` values.
327
+ *
328
+ * The retry prompt is small — it does not re-include the full feedback or
329
+ * key decisions, only the failed edits and the current state of the plan.
330
+ */
331
+ export function buildEditsRetryPrompt(currentPlan, failures, structuredOutput) {
332
+ const failureBlock = failures
333
+ .map((f, i) => {
334
+ const reasonHelp = f.reason === "no-match"
335
+ ? "Your `before` did not match any text in that section. Re-quote a verbatim string from the plan."
336
+ : f.reason === "multi-match"
337
+ ? "Your `before` matched multiple times in that section. Add surrounding context until it is unique within the section."
338
+ : f.reason === "section-not-found"
339
+ ? "The section heading does not exist in the plan. Pick a heading that does exist."
340
+ : f.reason === "status-line"
341
+ ? "Your edit modified the **planpong:** status line, which is reserved. Move the change elsewhere."
342
+ : "Edit failed. Re-express it.";
343
+ const diagnosticLine = f.diagnostic ? `\nDiagnostic: ${f.diagnostic}` : "";
344
+ return `### Failed edit ${i + 1}
345
+ **Section:** ${f.edit.section}
346
+ **Reason:** ${f.reason}${diagnosticLine}
347
+ **Help:** ${reasonHelp}
348
+ **Original \`before\`:**
349
+ \`\`\`
350
+ ${f.edit.before}
351
+ \`\`\`
352
+ **Original \`after\`:**
353
+ \`\`\`
354
+ ${f.edit.after}
355
+ \`\`\``;
356
+ })
357
+ .join("\n\n");
358
+ const schemaBlock = `\`\`\`
359
+ {
360
+ "edits": [
361
+ { "section": "Steps", "before": "verbatim", "after": "replacement" }
362
+ ]
363
+ }
364
+ \`\`\``;
365
+ const body = `You are correcting failed edits. The previous edit list partially applied; the edits below failed at the apply step.
366
+
367
+ For EACH failed edit, produce a corrected edit with the same intent but a working \`section\` and \`before\`. You may also revise \`after\` if the previous version assumed text that is no longer present.
368
+
369
+ ## Current Plan (with previously-successful edits already applied)
370
+
371
+ ${currentPlan}
372
+
373
+ ## Failed Edits
374
+
375
+ ${failureBlock}
376
+
377
+ ## Your Task`;
378
+ if (structuredOutput) {
379
+ return `${body}
380
+
381
+ Output ONLY a single JSON object with an \`edits\` array. The first character of your response must be \`{\` and the last must be \`}\`. Do NOT include \`responses\` — those are already finalized.
382
+
383
+ Schema:
384
+
385
+ ${schemaBlock}
386
+
387
+ - Output one corrected edit per failure (same count, same order).
388
+ - Each \`before\` must appear EXACTLY ONCE within the named section in the current plan above.
389
+ - Do NOT modify the \`**planpong:**\` status line.`;
390
+ }
391
+ return `${body}
392
+
393
+ Respond with a JSON object wrapped in <planpong-revision> tags. The JSON must match this schema:
394
+
395
+ ${schemaBlock}
396
+
397
+ IMPORTANT:
398
+ - Output one corrected edit per failure (same count, same order). Do NOT include \`responses\`.
399
+ - Each \`before\` must appear EXACTLY ONCE within the named section in the current plan above.
400
+ - Do NOT modify the \`**planpong:**\` status line.
401
+ - Wrap your JSON response in <planpong-revision>...</planpong-revision> tags.
402
+
148
403
  <planpong-revision>
149
404
  YOUR_JSON_HERE
150
405
  </planpong-revision>`;
@@ -1 +1 @@
1
- {"version":3,"file":"planner.js","sourceRoot":"","sources":["../../../src/prompts/planner.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,sBAAsB,CACpC,YAAoB,EACpB,QAAgB;IAEhB,OAAO;;;;;;;;;;;;;;;;EAgBP,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,WAAmB,EACnB,QAAwB,EACxB,YAA2B,EAC3B,YAA2B,EAC3B,QAAqB,QAAQ;IAE7B,MAAM,YAAY,GAAG,YAAY;QAC/B,CAAC,CAAC,wCAAwC,YAAY,IAAI;QAC1D,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,cAAc,GAAG,YAAY;QACjC,CAAC,CAAC,mCAAmC,YAAY,IAAI;QACrD,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM;SAC/B,GAAG,CACF,CAAC,KAAK,EAAE,EAAE,CACR,OAAO,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,QAAQ,MAAM,KAAK,CAAC,KAAK,kBAAkB,KAAK,CAAC,OAAO,sBAAsB,KAAK,CAAC,WAAW,qBAAqB,KAAK,CAAC,UAAU,EAAE,CACnK;SACA,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;oLAkBoJ,CAAC;IAEnL,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;4KAmBiJ,CAAC;IAE3K,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;mTAuBsR,CAAC;IAElT,MAAM,gBAAgB,GACpB,KAAK,KAAK,WAAW;QACnB,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,KAAK,KAAK,MAAM;YAChB,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,kBAAkB,CAAC;IAE3B,MAA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AAG,CAAC;eACtB,CAAC,CAAC,IAAI,CAAC,OAAO;cACf,CAAC,CAAC,MAAM,GAAG,cAAc;YAC3B,UAAU;;;EAGpB,CAAC,CAAC,IAAI,CAAC,MAAM;;;;EAIb,CAAC,CAAC,IAAI,CAAC,KAAK;OACP,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,MAAM,WAAW,GAAG;;;;;;OAMf,CAAC;IAEN,MAAM,IAAI,GAAG;;;;;;EAMb,WAAW;;;;EAIX,YAAY;;aAED,CAAC;IAEZ,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,GAAG,IAAI;;;;;;EAMhB,WAAW;;;;mDAIsC,CAAC;IAClD,CAAC;IAED,OAAO,GAAG,IAAI;;;;EAId,WAAW;;;;;;;;;;qBAUQ,CAAC;AACtB,CAAC"}
@@ -1,7 +1,20 @@
1
1
  import type { IssueResponse } from "../schemas/revision.js";
2
2
  export type ReviewPhase = "direction" | "risk" | "detail";
3
3
  export declare function getReviewPhase(round: number): ReviewPhase;
4
- export declare function buildReviewPrompt(planContent: string, priorDecisions: string | null, phase?: ReviewPhase): string;
4
+ /**
5
+ * Incremental review prompt for resumed reviewer sessions.
6
+ *
7
+ * The reviewer has already seen the full plan (round 1) and produced its
8
+ * own prior critique. Instead of re-sending the full plan markdown, we
9
+ * send only what's changed since the model last saw it (a markdown diff)
10
+ * plus the new phase instructions.
11
+ *
12
+ * Falls back to full-plan content if `planDiffOrContent` is the entire
13
+ * plan rather than a diff (caller's choice — see operations.ts logic that
14
+ * skips diffing on certain cases).
15
+ */
16
+ export declare function buildIncrementalReviewPrompt(planDiffOrContent: string, priorDecisions: string | null, phase?: ReviewPhase, structuredOutput?: boolean): string;
17
+ export declare function buildReviewPrompt(planContent: string, priorDecisions: string | null, phase?: ReviewPhase, structuredOutput?: boolean): string;
5
18
  export declare function formatPriorDecisions(rounds: Array<{
6
19
  round: number;
7
20
  responses: IssueResponse[];
@@ -74,6 +74,7 @@ function buildDetailReviewInstructions(priorDecisions) {
74
74
 
75
75
  The plan's overall direction has already been validated. Focus on implementation completeness and correctness.
76
76
 
77
+ - When the plan references files, function names, exports, imports, configs, or APIs, VERIFY them against the codebase using your tools (Read, Grep, Glob, Bash). A plan that references \`src/foo/bar.ts\` should have a corresponding file; a plan that calls \`someLib.thing()\` should match the library's actual API. Flag verifiable mismatches as P1 (would break implementation) — these are the issues only an independent reviewer catches.
77
78
  - Only flag issues you have concrete evidence for. Cite the plan section.
78
79
  - Assign severity honestly:
79
80
  - P1 = blocks implementation or causes failure
@@ -180,7 +181,19 @@ If the plan is approved with no issues, use:
180
181
  { "verdict": "approved", "summary": "...", "issues": [] }
181
182
  \`\`\``;
182
183
  }
183
- export function buildReviewPrompt(planContent, priorDecisions, phase = "detail") {
184
+ /**
185
+ * Incremental review prompt for resumed reviewer sessions.
186
+ *
187
+ * The reviewer has already seen the full plan (round 1) and produced its
188
+ * own prior critique. Instead of re-sending the full plan markdown, we
189
+ * send only what's changed since the model last saw it (a markdown diff)
190
+ * plus the new phase instructions.
191
+ *
192
+ * Falls back to full-plan content if `planDiffOrContent` is the entire
193
+ * plan rather than a diff (caller's choice — see operations.ts logic that
194
+ * skips diffing on certain cases).
195
+ */
196
+ export function buildIncrementalReviewPrompt(planDiffOrContent, priorDecisions, phase = "detail", structuredOutput = false) {
184
197
  const instructions = phase === "direction"
185
198
  ? buildDirectionReviewInstructions()
186
199
  : phase === "risk"
@@ -191,6 +204,76 @@ export function buildReviewPrompt(planContent, priorDecisions, phase = "detail")
191
204
  : phase === "risk"
192
205
  ? buildRiskJsonSchema()
193
206
  : buildDetailJsonSchema();
207
+ const isDiff = planDiffOrContent.startsWith("```diff");
208
+ const planSection = isDiff
209
+ ? `## Plan Changes Since Last Round
210
+
211
+ The plan has been revised in response to your prior feedback. Below is what changed (the rest of the plan is unchanged from your context).
212
+
213
+ ${planDiffOrContent}`
214
+ : `## Plan to Review
215
+
216
+ ${planDiffOrContent}`;
217
+ if (structuredOutput) {
218
+ return `${instructions}
219
+ ${planSection}
220
+
221
+ ## Your Task
222
+
223
+ You are continuing the same review conversation. Your prior round's feedback and the plan you reviewed are in your context — use them.
224
+
225
+ Output ONLY a single JSON object conforming to the schema below. The first character of your response must be \`{\` and the last must be \`}\`. No prose. No markdown. No code fences. No preamble or explanation. No trailing text.
226
+
227
+ Schema:
228
+
229
+ ${jsonSchema}`;
230
+ }
231
+ return `${instructions}
232
+ ${planSection}
233
+
234
+ ## Your Task
235
+
236
+ You are continuing the same review conversation. Your prior round's feedback and the plan you reviewed are in your context — use them.
237
+
238
+ Respond with a JSON object wrapped in <planpong-feedback> tags conforming to:
239
+
240
+ ${jsonSchema}
241
+
242
+ IMPORTANT: Wrap your JSON response in <planpong-feedback>...</planpong-feedback> tags.
243
+
244
+ <planpong-feedback>
245
+ YOUR_JSON_HERE
246
+ </planpong-feedback>`;
247
+ }
248
+ export function buildReviewPrompt(planContent, priorDecisions, phase = "detail", structuredOutput = false) {
249
+ const instructions = phase === "direction"
250
+ ? buildDirectionReviewInstructions()
251
+ : phase === "risk"
252
+ ? buildRiskReviewInstructions(priorDecisions)
253
+ : buildDetailReviewInstructions(priorDecisions);
254
+ const jsonSchema = phase === "direction"
255
+ ? buildDirectionJsonSchema()
256
+ : phase === "risk"
257
+ ? buildRiskJsonSchema()
258
+ : buildDetailJsonSchema();
259
+ if (structuredOutput) {
260
+ // Structured-output mode. Some providers (OpenAI/Codex) constrain output
261
+ // at the token level; others (Claude) only validate post-hoc. Emphatic
262
+ // JSON-only instructions help the advisory case comply; the constrained
263
+ // case ignores them harmlessly.
264
+ return `${instructions}
265
+ ## Plan to Review
266
+
267
+ ${planContent}
268
+
269
+ ## Your Task
270
+
271
+ Output ONLY a single JSON object conforming to the schema below. The first character of your response must be \`{\` and the last must be \`}\`. No prose. No markdown. No code fences. No preamble or explanation. No trailing text.
272
+
273
+ Schema:
274
+
275
+ ${jsonSchema}`;
276
+ }
194
277
  return `${instructions}
195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G,CAC5F,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,8 +1,11 @@
1
1
  import type { Provider, InvokeOptions, ProviderResponse } from "./types.js";
2
2
  export declare class ClaudeProvider implements Provider {
3
3
  name: string;
4
+ private capabilityCache;
4
5
  invoke(prompt: string, options: InvokeOptions): Promise<ProviderResponse>;
5
6
  isAvailable(): Promise<boolean>;
7
+ checkStructuredOutputSupport(): Promise<boolean>;
8
+ markNonCapable(): void;
6
9
  getModels(): string[];
7
10
  getEffortLevels(): string[];
8
11
  }