planpong 0.5.3 → 0.5.4
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/dist/src/config/defaults.js +1 -0
- package/dist/src/config/defaults.js.map +1 -1
- package/dist/src/config/loader.d.ts +1 -0
- package/dist/src/config/loader.js +3 -0
- package/dist/src/config/loader.js.map +1 -1
- package/dist/src/core/convergence.js +26 -1
- package/dist/src/core/convergence.js.map +1 -1
- package/dist/src/core/operations.d.ts +48 -0
- package/dist/src/core/operations.js +81 -19
- package/dist/src/core/operations.js.map +1 -1
- package/dist/src/core/session.d.ts +1 -1
- package/dist/src/core/session.js +11 -2
- package/dist/src/core/session.js.map +1 -1
- package/dist/src/mcp/server.js +6 -2
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools/record-revision.d.ts +20 -0
- package/dist/src/mcp/tools/record-revision.js +158 -0
- package/dist/src/mcp/tools/record-revision.js.map +1 -0
- package/dist/src/mcp/tools/revise.js +14 -0
- package/dist/src/mcp/tools/revise.js.map +1 -1
- package/dist/src/mcp/tools/start-review.js +7 -0
- package/dist/src/mcp/tools/start-review.js.map +1 -1
- package/dist/src/prompts/reviewer.d.ts +15 -7
- package/dist/src/prompts/reviewer.js +55 -19
- package/dist/src/prompts/reviewer.js.map +1 -1
- package/dist/src/schemas/config.d.ts +3 -0
- package/dist/src/schemas/config.js +8 -0
- package/dist/src/schemas/config.js.map +1 -1
- package/dist/src/schemas/feedback.d.ts +14 -35
- package/dist/src/schemas/feedback.js +14 -12
- package/dist/src/schemas/feedback.js.map +1 -1
- package/dist/src/schemas/metrics.d.ts +3 -0
- package/dist/src/schemas/metrics.js +6 -0
- package/dist/src/schemas/metrics.js.map +1 -1
- package/dist/src/schemas/session.d.ts +3 -0
- package/dist/src/schemas/session.js +12 -0
- package/dist/src/schemas/session.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { type IssueResponse } from "../../schemas/revision.js";
|
|
3
|
+
export declare function recordRevisionHandler(input: {
|
|
4
|
+
session_id: string;
|
|
5
|
+
expected_round: number;
|
|
6
|
+
responses: IssueResponse[];
|
|
7
|
+
cwd?: string;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
content: {
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
isError: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
export declare function registerRecordRevision(server: McpServer): void;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { readSessionState, readRoundFeedback, writeRoundMetrics, } from "../../core/session.js";
|
|
5
|
+
import { finalizeRevision, writeStatusLineToPlan, } from "../../core/operations.js";
|
|
6
|
+
import { loadConfig } from "../../config/loader.js";
|
|
7
|
+
import { getReviewPhase } from "../../prompts/reviewer.js";
|
|
8
|
+
import { IssueResponseSchema, } from "../../schemas/revision.js";
|
|
9
|
+
/**
|
|
10
|
+
* Inline-mode counterpart to `planpong_revise`. The agent that invoked
|
|
11
|
+
* /pong-review acts as the planner: it edited the plan with its own
|
|
12
|
+
* Edit/Write tools, then calls this tool to log the per-issue responses
|
|
13
|
+
* and advance the session bookkeeping.
|
|
14
|
+
*
|
|
15
|
+
* No planner provider is invoked. The shared `finalizeRevision` helper
|
|
16
|
+
* persists the response file, updates the plan hash, and writes session
|
|
17
|
+
* state — same path the external mode takes after `runRevisionRound`.
|
|
18
|
+
*/
|
|
19
|
+
const inputSchema = {
|
|
20
|
+
session_id: z.string().describe("Session ID from planpong_start_review"),
|
|
21
|
+
expected_round: z
|
|
22
|
+
.number()
|
|
23
|
+
.int()
|
|
24
|
+
.nonnegative()
|
|
25
|
+
.describe("The round this revision responds to. Must equal session.currentRound. Catches double-submission and stale tool calls."),
|
|
26
|
+
responses: z
|
|
27
|
+
.array(IssueResponseSchema)
|
|
28
|
+
.describe("One response per issue from the round's feedback. Every issue.id MUST appear here."),
|
|
29
|
+
cwd: z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("Working directory (defaults to process.cwd())"),
|
|
33
|
+
};
|
|
34
|
+
export async function recordRevisionHandler(input) {
|
|
35
|
+
const cwd = input.cwd ?? process.cwd();
|
|
36
|
+
const session = readSessionState(cwd, input.session_id);
|
|
37
|
+
if (!session) {
|
|
38
|
+
return errorResponse(`Session not found: ${input.session_id}`);
|
|
39
|
+
}
|
|
40
|
+
if (session.status !== "in_review") {
|
|
41
|
+
return errorResponse(`Session status is '${session.status}', expected 'in_review'`);
|
|
42
|
+
}
|
|
43
|
+
if (session.plannerMode !== "inline") {
|
|
44
|
+
return errorResponse(`session is in ${session.plannerMode} planner mode — use planpong_revise instead`, { planner_mode: session.plannerMode });
|
|
45
|
+
}
|
|
46
|
+
if (input.expected_round !== session.currentRound) {
|
|
47
|
+
return errorResponse(`round ${input.expected_round} already finalized (current round is ${session.currentRound})`, {
|
|
48
|
+
expected_round: input.expected_round,
|
|
49
|
+
current_round: session.currentRound,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const feedback = readRoundFeedback(cwd, session.id, session.currentRound);
|
|
53
|
+
if (!feedback) {
|
|
54
|
+
return errorResponse(`No feedback found for session ${session.id} round ${session.currentRound}. Call planpong_get_feedback first.`);
|
|
55
|
+
}
|
|
56
|
+
// Validate every issue has a response. Mirrors the planner prompt's
|
|
57
|
+
// "every issue MUST have an entry in responses" constraint so inline
|
|
58
|
+
// mode produces the same shape downstream tools expect.
|
|
59
|
+
const responseIds = new Set(input.responses.map((r) => r.issue_id));
|
|
60
|
+
const missing = feedback.issues
|
|
61
|
+
.map((i) => i.id)
|
|
62
|
+
.filter((id) => !responseIds.has(id));
|
|
63
|
+
if (missing.length > 0) {
|
|
64
|
+
return errorResponse(`responses missing for issue(s): ${missing.join(", ")}. Provide one response per feedback issue.`, { missing_issue_ids: missing });
|
|
65
|
+
}
|
|
66
|
+
const round = session.currentRound;
|
|
67
|
+
const phase = getReviewPhase(round);
|
|
68
|
+
const planPath = resolve(cwd, session.planPath);
|
|
69
|
+
// Hash before finalize so we can detect "agent forgot to edit".
|
|
70
|
+
const planHashBefore = session.planHash;
|
|
71
|
+
// Construct PlannerRevision-shape payload. Direction phase keeps the
|
|
72
|
+
// full-plan shape; risk/detail keep the edits shape (with empty edits[]
|
|
73
|
+
// — the agent applied changes via its own Edit tool rather than
|
|
74
|
+
// declaring them here, so the array is informational-only).
|
|
75
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
76
|
+
const revision = phase === "direction"
|
|
77
|
+
? { responses: input.responses, updated_plan: planContent }
|
|
78
|
+
: { responses: input.responses, edits: [] };
|
|
79
|
+
const tally = finalizeRevision({
|
|
80
|
+
session,
|
|
81
|
+
cwd,
|
|
82
|
+
round,
|
|
83
|
+
revision,
|
|
84
|
+
planPath,
|
|
85
|
+
});
|
|
86
|
+
// Plan-hash warn: any accepted issue should correspond to a plan edit.
|
|
87
|
+
// Surface the no-op case but don't gate — sometimes all issues are
|
|
88
|
+
// legitimately rejected and the plan correctly stays unchanged.
|
|
89
|
+
const planUnchanged = session.planHash === planHashBefore;
|
|
90
|
+
const anyAccepted = input.responses.some((r) => r.action === "accepted");
|
|
91
|
+
if (planUnchanged && anyAccepted) {
|
|
92
|
+
process.stderr.write(`[planpong] warn: round ${round} has accepted issues but plan hash is unchanged — did the agent forget to edit?\n`);
|
|
93
|
+
}
|
|
94
|
+
// Write fully valid RoundMetrics so bench/run.ts:226 doesn't drop this
|
|
95
|
+
// round from analysis. Inline revisions have no provider duration —
|
|
96
|
+
// started_at and completed_at are the same instant.
|
|
97
|
+
const ts = new Date().toISOString();
|
|
98
|
+
const metrics = {
|
|
99
|
+
schema_version: 1,
|
|
100
|
+
session_id: session.id,
|
|
101
|
+
round,
|
|
102
|
+
phase,
|
|
103
|
+
role: "revision",
|
|
104
|
+
started_at: ts,
|
|
105
|
+
completed_at: ts,
|
|
106
|
+
total_duration_ms: 0,
|
|
107
|
+
attempts: [],
|
|
108
|
+
planner_mode: "inline",
|
|
109
|
+
};
|
|
110
|
+
writeRoundMetrics(cwd, session.id, round, "revision", metrics);
|
|
111
|
+
// Update plan status line. Use loadConfig for provider labels (the
|
|
112
|
+
// status-line writer needs them). In inline mode the planner provider
|
|
113
|
+
// is informational, not invoked.
|
|
114
|
+
const config = loadConfig({ cwd });
|
|
115
|
+
const sessionConfig = {
|
|
116
|
+
...config,
|
|
117
|
+
planner: session.planner,
|
|
118
|
+
reviewer: session.reviewer,
|
|
119
|
+
};
|
|
120
|
+
const statusLine = writeStatusLineToPlan(session, cwd, sessionConfig, "Revision recorded");
|
|
121
|
+
// Match planpong_revise's unverified_rejected counter so the slash
|
|
122
|
+
// command can consume either tool's output uniformly.
|
|
123
|
+
const unverifiedRejected = input.responses.filter((r) => r.action === "rejected" &&
|
|
124
|
+
/unverified\s+evidence/i.test(r.rationale ?? "")).length;
|
|
125
|
+
const payload = {
|
|
126
|
+
round,
|
|
127
|
+
responses: input.responses,
|
|
128
|
+
accepted: tally.accepted,
|
|
129
|
+
rejected: tally.rejected,
|
|
130
|
+
deferred: tally.deferred,
|
|
131
|
+
unverified_rejected: unverifiedRejected,
|
|
132
|
+
plan_updated: !planUnchanged,
|
|
133
|
+
status_line: statusLine,
|
|
134
|
+
planner_mode: "inline",
|
|
135
|
+
idempotent_replay: !tally.fresh,
|
|
136
|
+
};
|
|
137
|
+
return {
|
|
138
|
+
content: [
|
|
139
|
+
{ type: "text", text: statusLine },
|
|
140
|
+
{ type: "text", text: JSON.stringify(payload) },
|
|
141
|
+
],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function errorResponse(error, extra = {}) {
|
|
145
|
+
return {
|
|
146
|
+
content: [
|
|
147
|
+
{
|
|
148
|
+
type: "text",
|
|
149
|
+
text: JSON.stringify({ error, ...extra }),
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
isError: true,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
export function registerRecordRevision(server) {
|
|
156
|
+
server.tool("planpong_record_revision", "Inline-mode revision: log the agent's per-issue responses and advance session bookkeeping. The agent must have already edited the plan with its own Edit/Write tools. Use only when planpong_start_review was called with planner_mode: 'inline'. Otherwise call planpong_revise.", inputSchema, recordRevisionHandler);
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=record-revision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-revision.js","sourceRoot":"","sources":["../../../../src/mcp/tools/record-revision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GAEtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACL,mBAAmB,GAGpB,MAAM,2BAA2B,CAAC;AAGnC;;;;;;;;;GASG;AACH,MAAM,WAAW,GAAG;IAClB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IACxE,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,GAAG,EAAE;SACL,WAAW,EAAE;SACb,QAAQ,CACP,uHAAuH,CACxH;IACH,SAAS,EAAE,CAAC;S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B,EAC1B,mRAAmR,EACnR,WAAW,EACX,qBAAqB,CACtB,CAAC;AACJ,CAAC"}
|
|
@@ -39,6 +39,20 @@ export async function reviseHandler(input) {
|
|
|
39
39
|
isError: true,
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
+
if (session.plannerMode === "inline") {
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: "text",
|
|
47
|
+
text: JSON.stringify({
|
|
48
|
+
error: "session is in inline planner mode — use planpong_record_revision instead",
|
|
49
|
+
planner_mode: "inline",
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
isError: true,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
42
56
|
const config = loadConfig({ cwd });
|
|
43
57
|
const plannerProvider = getProvider(session.planner.provider);
|
|
44
58
|
if (!plannerProvider) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revise.js","sourceRoot":"","sources":["../../../../src/mcp/tools/revise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,GAAG;IAClB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IACxE,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,+CAA+C,CAAC;CAC7D,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAGnC;IACK,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG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I,MAAM,CAAC,KAAK,CAAC,aAAa,KAAK,OAAO,EAAE,CAAC;YAC3C,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC;YACvD,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC;YACnD,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC;YACjD,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC;YACvD,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC;QACrD,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,UAAU;aACjB;YACD;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;aAC9B;SACF;KACF,CAAC;AACR,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAiB;IAC9C,MAAM,CAAC,IAAI,CACT,iBAAiB,EACjB,+JAA+J,EAC/J,WAAW,EACX,aAAa,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -38,6 +38,10 @@ const inputSchema = {
|
|
|
38
38
|
.boolean()
|
|
39
39
|
.optional()
|
|
40
40
|
.describe("If true, pause after each round for user confirmation. Default: false (autonomous)"),
|
|
41
|
+
planner_mode: z
|
|
42
|
+
.enum(["inline", "external"])
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("Planner mode for this session. 'external' (default) routes revisions through planpong_revise + a planner provider. 'inline' routes through planpong_record_revision so the agent that invoked /pong-review acts as the planner. Sticky for the session lifetime."),
|
|
41
45
|
};
|
|
42
46
|
export function registerStartReview(server) {
|
|
43
47
|
server.tool("planpong_start_review", "Create a review session for an existing plan file. Validates the file, loads config, checks provider availability, and creates a session. Does NOT invoke any models.", inputSchema, async (input) => {
|
|
@@ -54,6 +58,7 @@ export function registerStartReview(server) {
|
|
|
54
58
|
reviewerEffort: input.reviewer?.effort,
|
|
55
59
|
maxRounds: input.max_rounds,
|
|
56
60
|
autonomous: true,
|
|
61
|
+
plannerMode: input.planner_mode,
|
|
57
62
|
},
|
|
58
63
|
});
|
|
59
64
|
// Check provider availability and auto-fallback
|
|
@@ -124,10 +129,12 @@ export function registerStartReview(server) {
|
|
|
124
129
|
plan_path: planPath,
|
|
125
130
|
plan_summary: planSummary,
|
|
126
131
|
interactive: input.interactive ?? false,
|
|
132
|
+
planner_mode: session.plannerMode,
|
|
127
133
|
config: {
|
|
128
134
|
planner: config.planner,
|
|
129
135
|
reviewer: config.reviewer,
|
|
130
136
|
max_rounds: config.max_rounds,
|
|
137
|
+
planner_mode: config.planner_mode,
|
|
131
138
|
},
|
|
132
139
|
}),
|
|
133
140
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-review.js","sourceRoot":"","sources":["../../../../src/mcp/tools/start-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAEL,qBAAqB,EACrB,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CAAC,8DAA8D,CAAC;IAC3E,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,+CAA+C,CAAC;IAC5D,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ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iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC1E,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,UAAU,EAAE,OAAO,CAAC,EAAE;wBACtB,SAAS,EAAE,QAAQ;wBACnB,YAAY,EAAE,WAAW;wBACzB,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK;wBACvC,YAAY,EAAE,OAAO,CAAC,WAAW;wBACjC,MAAM,EAAE;4BACN,OAAO,EAAE,MAAM,CAAC,OAAO;4BACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;4BACzB,UAAU,EAAE,MAAM,CAAC,UAAU;4BAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;yBAClC;qBACF,CAAC;iBACH;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -5,15 +5,23 @@ export declare function getReviewPhase(round: number): ReviewPhase;
|
|
|
5
5
|
* Incremental review prompt for resumed reviewer sessions.
|
|
6
6
|
*
|
|
7
7
|
* The reviewer has already seen the full plan (round 1) and produced its
|
|
8
|
-
* own prior critique.
|
|
9
|
-
*
|
|
10
|
-
* plus the new phase instructions.
|
|
8
|
+
* own prior critique. Round 2+ prompts include both the diff (for change
|
|
9
|
+
* context) AND the full current plan text (for unambiguous quoting).
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* **Why ship the full plan even when the model has it in session memory:**
|
|
12
|
+
* the cite-evidence block requires verbatim `quoted_text` matching against
|
|
13
|
+
* the *current* plan. Without an authoritative current-plan section, the
|
|
14
|
+
* reviewer must reconstruct from R1's full plan + every subsequent diff in
|
|
15
|
+
* its memory. That's fragile (context loss, truncation, attention to old
|
|
16
|
+
* lines). Sending the full plan eliminates the reconstruction job. Plans
|
|
17
|
+
* are typically < 10KB — the cost is marginal next to a wasted round from
|
|
18
|
+
* bad quotes.
|
|
19
|
+
*
|
|
20
|
+
* `planDiffOrContent` carries the diff (or, when the caller skips diffing,
|
|
21
|
+
* the full plan as a fallback). `currentPlanContent` is always the
|
|
22
|
+
* authoritative current plan.
|
|
15
23
|
*/
|
|
16
|
-
export declare function buildIncrementalReviewPrompt(planDiffOrContent: string, priorDecisions: string | null, phase?: ReviewPhase, structuredOutput?: boolean): string;
|
|
24
|
+
export declare function buildIncrementalReviewPrompt(planDiffOrContent: string, currentPlanContent: string, priorDecisions: string | null, phase?: ReviewPhase, structuredOutput?: boolean): string;
|
|
17
25
|
export declare function buildReviewPrompt(planContent: string, priorDecisions: string | null, phase?: ReviewPhase, structuredOutput?: boolean): string;
|
|
18
26
|
export declare function formatPriorDecisions(rounds: Array<{
|
|
19
27
|
round: number;
|
|
@@ -6,7 +6,7 @@ export function getReviewPhase(round) {
|
|
|
6
6
|
return "detail";
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Shared "cite evidence" instruction
|
|
9
|
+
* Shared "cite evidence" instruction blocks. Every issue must include a
|
|
10
10
|
* verbatim ≤200-char `quoted_text` snippet that planpong verifies by
|
|
11
11
|
* grepping the plan markdown. Quotes that don't match are tagged
|
|
12
12
|
* `verified: false` and deprioritized by the planner — they're treated
|
|
@@ -15,8 +15,19 @@ export function getReviewPhase(round) {
|
|
|
15
15
|
* Length and distinctiveness limits are enforced server-side; the prompt
|
|
16
16
|
* communicates them so the model produces compliant quotes on the first
|
|
17
17
|
* try.
|
|
18
|
+
*
|
|
19
|
+
* Two variants:
|
|
20
|
+
* - `_FRESH` is appended by `buildReviewPrompt`. The full plan is in the
|
|
21
|
+
* prompt above the cite block, so "appear in the plan markdown above"
|
|
22
|
+
* is literally true.
|
|
23
|
+
* - `_INCREMENTAL` is appended by `buildIncrementalReviewPrompt`. That
|
|
24
|
+
* prompt now sends both a diff (for change context) AND the full
|
|
25
|
+
* current plan text (for quoting). Quoting from a diff line would leak
|
|
26
|
+
* `+ ` / `- ` prefixes; quoting from session memory of an earlier round
|
|
27
|
+
* risks pulling deleted lines. The incremental cite block points the
|
|
28
|
+
* reviewer at the authoritative current-plan section.
|
|
18
29
|
*/
|
|
19
|
-
const
|
|
30
|
+
const CITE_EVIDENCE_BLOCK_FRESH = `
|
|
20
31
|
## Cite Evidence For Every Issue
|
|
21
32
|
|
|
22
33
|
Every issue you raise MUST include a \`quoted_text\` field — a verbatim snippet copied from the plan that the issue refers to. This is how planpong verifies the issue actually corresponds to something in the plan rather than a misread.
|
|
@@ -24,6 +35,15 @@ Every issue you raise MUST include a \`quoted_text\` field — a verbatim snippe
|
|
|
24
35
|
- Quote, do not paraphrase. The string must appear character-for-character (whitespace tolerant) somewhere in the plan markdown above.
|
|
25
36
|
- Keep \`quoted_text\` between 10 and 200 characters. Pick the shortest distinctive snippet that anchors the issue.
|
|
26
37
|
- If you cannot find a verbatim quote that supports the issue, the issue is probably a misread of the plan — drop it.`;
|
|
38
|
+
const CITE_EVIDENCE_BLOCK_INCREMENTAL = `
|
|
39
|
+
## Cite Evidence For Every Issue
|
|
40
|
+
|
|
41
|
+
Every issue you raise MUST include a \`quoted_text\` field — a verbatim snippet copied from the plan that the issue refers to. This is how planpong verifies the issue actually corresponds to something in the plan rather than a misread.
|
|
42
|
+
|
|
43
|
+
- Quote, do not paraphrase. The string must appear character-for-character (whitespace tolerant) in the **current plan text provided below** (the "Current Plan" section, not the diff).
|
|
44
|
+
- Do NOT quote diff prefix characters (\`+ \` / \`- \`). The diff is for change context only; quote from the Current Plan section.
|
|
45
|
+
- Keep \`quoted_text\` between 10 and 200 characters. Pick the shortest distinctive snippet that anchors the issue.
|
|
46
|
+
- If you cannot find a verbatim quote that supports the issue, the issue is probably a misread of the plan — drop it.`;
|
|
27
47
|
function buildDirectionReviewInstructions() {
|
|
28
48
|
return `You are reviewing an implementation plan at a HIGH LEVEL. Focus on direction, not details.
|
|
29
49
|
|
|
@@ -50,8 +70,7 @@ Assign severity based on directional impact:
|
|
|
50
70
|
Verdict rules:
|
|
51
71
|
- Use "needs_revision" when there are issues to address (this is the normal case).
|
|
52
72
|
- Use "blocked" ONLY when the plan is fundamentally non-viable due to hard external constraints — e.g., depends on a deprecated/unavailable API, violates an organizational policy, or requires resources that don't exist. Do NOT use "blocked" for fixable design issues.
|
|
53
|
-
- You CANNOT approve in this round. Direction review always produces "needs_revision" or "blocked"
|
|
54
|
-
${CITE_EVIDENCE_BLOCK}`;
|
|
73
|
+
- You CANNOT approve in this round. Direction review always produces "needs_revision" or "blocked".`;
|
|
55
74
|
}
|
|
56
75
|
function buildRiskReviewInstructions(priorDecisions) {
|
|
57
76
|
const priorBlock = priorDecisions
|
|
@@ -84,7 +103,6 @@ Verdict rules:
|
|
|
84
103
|
- Use "needs_revision" when there are issues to address (this is the normal case).
|
|
85
104
|
- Use "blocked" ONLY when unmitigable risks make the plan non-viable — e.g., a hard dependency is unavailable, a critical external system is unreliable with no workaround. Do NOT use "blocked" for risks that can be mitigated with plan changes.
|
|
86
105
|
- You CANNOT approve in this round. Risk review always produces "needs_revision" or "blocked".
|
|
87
|
-
${CITE_EVIDENCE_BLOCK}
|
|
88
106
|
${priorBlock}`;
|
|
89
107
|
}
|
|
90
108
|
function buildDetailReviewInstructions(priorDecisions) {
|
|
@@ -106,7 +124,6 @@ The plan's overall direction has already been validated. Focus on implementation
|
|
|
106
124
|
- Deferred items from prior rounds are acknowledged and do not block approval.
|
|
107
125
|
- If the plan is solid with only minor informational notes, use "approved_with_notes" (all issues must be P3).
|
|
108
126
|
- If you approve with "approved_with_notes", do NOT include any P1 or P2 issues.
|
|
109
|
-
${CITE_EVIDENCE_BLOCK}
|
|
110
127
|
${priorBlock}`;
|
|
111
128
|
}
|
|
112
129
|
function buildDirectionJsonSchema() {
|
|
@@ -210,15 +227,23 @@ If the plan is approved with no issues, use:
|
|
|
210
227
|
* Incremental review prompt for resumed reviewer sessions.
|
|
211
228
|
*
|
|
212
229
|
* The reviewer has already seen the full plan (round 1) and produced its
|
|
213
|
-
* own prior critique.
|
|
214
|
-
*
|
|
215
|
-
*
|
|
230
|
+
* own prior critique. Round 2+ prompts include both the diff (for change
|
|
231
|
+
* context) AND the full current plan text (for unambiguous quoting).
|
|
232
|
+
*
|
|
233
|
+
* **Why ship the full plan even when the model has it in session memory:**
|
|
234
|
+
* the cite-evidence block requires verbatim `quoted_text` matching against
|
|
235
|
+
* the *current* plan. Without an authoritative current-plan section, the
|
|
236
|
+
* reviewer must reconstruct from R1's full plan + every subsequent diff in
|
|
237
|
+
* its memory. That's fragile (context loss, truncation, attention to old
|
|
238
|
+
* lines). Sending the full plan eliminates the reconstruction job. Plans
|
|
239
|
+
* are typically < 10KB — the cost is marginal next to a wasted round from
|
|
240
|
+
* bad quotes.
|
|
216
241
|
*
|
|
217
|
-
*
|
|
218
|
-
* plan
|
|
219
|
-
*
|
|
242
|
+
* `planDiffOrContent` carries the diff (or, when the caller skips diffing,
|
|
243
|
+
* the full plan as a fallback). `currentPlanContent` is always the
|
|
244
|
+
* authoritative current plan.
|
|
220
245
|
*/
|
|
221
|
-
export function buildIncrementalReviewPrompt(planDiffOrContent, priorDecisions, phase = "detail", structuredOutput = false) {
|
|
246
|
+
export function buildIncrementalReviewPrompt(planDiffOrContent, currentPlanContent, priorDecisions, phase = "detail", structuredOutput = false) {
|
|
222
247
|
const instructions = phase === "direction"
|
|
223
248
|
? buildDirectionReviewInstructions()
|
|
224
249
|
: phase === "risk"
|
|
@@ -230,12 +255,19 @@ export function buildIncrementalReviewPrompt(planDiffOrContent, priorDecisions,
|
|
|
230
255
|
? buildRiskJsonSchema()
|
|
231
256
|
: buildDetailJsonSchema();
|
|
232
257
|
const isDiff = planDiffOrContent.startsWith("```diff");
|
|
258
|
+
// When the caller has a real diff: ship diff (for context) + current plan
|
|
259
|
+
// (for quoting). When `planDiffOrContent` is already the full plan
|
|
260
|
+
// (caller skipped diffing — e.g., R1 fallback path), don't duplicate.
|
|
233
261
|
const planSection = isDiff
|
|
234
262
|
? `## Plan Changes Since Last Round
|
|
235
263
|
|
|
236
|
-
The plan has been revised in response to your prior feedback. Below is what changed
|
|
264
|
+
The plan has been revised in response to your prior feedback. Below is what changed.
|
|
265
|
+
|
|
266
|
+
${planDiffOrContent}
|
|
237
267
|
|
|
238
|
-
|
|
268
|
+
## Current Plan (full text — quote from this)
|
|
269
|
+
|
|
270
|
+
${currentPlanContent}`
|
|
239
271
|
: `## Plan to Review
|
|
240
272
|
|
|
241
273
|
${planDiffOrContent}`;
|
|
@@ -245,24 +277,26 @@ ${planSection}
|
|
|
245
277
|
|
|
246
278
|
## Your Task
|
|
247
279
|
|
|
248
|
-
You are continuing the same review conversation. Your prior round's feedback
|
|
280
|
+
You are continuing the same review conversation. Your prior round's feedback is in your context — use it. The Current Plan section above is the authoritative source for quoting.
|
|
249
281
|
|
|
250
282
|
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.
|
|
251
283
|
|
|
252
284
|
Schema:
|
|
253
285
|
|
|
254
|
-
${jsonSchema}
|
|
286
|
+
${jsonSchema}
|
|
287
|
+
${CITE_EVIDENCE_BLOCK_INCREMENTAL}`;
|
|
255
288
|
}
|
|
256
289
|
return `${instructions}
|
|
257
290
|
${planSection}
|
|
258
291
|
|
|
259
292
|
## Your Task
|
|
260
293
|
|
|
261
|
-
You are continuing the same review conversation. Your prior round's feedback
|
|
294
|
+
You are continuing the same review conversation. Your prior round's feedback is in your context — use it. The Current Plan section above is the authoritative source for quoting.
|
|
262
295
|
|
|
263
296
|
Respond with a JSON object wrapped in <planpong-feedback> tags conforming to:
|
|
264
297
|
|
|
265
298
|
${jsonSchema}
|
|
299
|
+
${CITE_EVIDENCE_BLOCK_INCREMENTAL}
|
|
266
300
|
|
|
267
301
|
IMPORTANT: Wrap your JSON response in <planpong-feedback>...</planpong-feedback> tags.
|
|
268
302
|
|
|
@@ -297,7 +331,8 @@ Output ONLY a single JSON object conforming to the schema below. The first chara
|
|
|
297
331
|
|
|
298
332
|
Schema:
|
|
299
333
|
|
|
300
|
-
${jsonSchema}
|
|
334
|
+
${jsonSchema}
|
|
335
|
+
${CITE_EVIDENCE_BLOCK_FRESH}`;
|
|
301
336
|
}
|
|
302
337
|
return `${instructions}
|
|
303
338
|
## Plan to Review
|
|
@@ -309,6 +344,7 @@ ${planContent}
|
|
|
309
344
|
Respond with a JSON object wrapped in <planpong-feedback> tags. The JSON must match this schema:
|
|
310
345
|
|
|
311
346
|
${jsonSchema}
|
|
347
|
+
${CITE_EVIDENCE_BLOCK_FRESH}
|
|
312
348
|
|
|
313
349
|
IMPORTANT: Wrap your JSON response in <planpong-feedback>...</planpong-feedback> tags.
|
|
314
350
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviewer.js","sourceRoot":"","sources":["../../../src/prompts/reviewer.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,WAAW,CAAC;IACnC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IAC/B,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"reviewer.js","sourceRoot":"","sources":["../../../src/prompts/reviewer.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,WAAW,CAAC;IACnC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IAC/B,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,yBAAyB,GAAG;;;;;;;sHAOoF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.ZodDefault<z.ZodNumber>;
|
|
44
44
|
human_in_loop: z.ZodDefault<z.ZodBoolean>;
|
|
45
45
|
revision_mode: z.ZodDefault<z.ZodEnum<["edits", "full"]>>;
|
|
46
|
+
planner_mode: z.ZodDefault<z.ZodEnum<["inline", "external"]>>;
|
|
46
47
|
}, "strip", z.ZodTypeAny, {
|
|
47
48
|
planner: {
|
|
48
49
|
provider: string;
|
|
@@ -58,6 +59,7 @@ export declare const PlanpongConfigSchema: z.ZodObject<{
|
|
|
58
59
|
max_rounds: number;
|
|
59
60
|
human_in_loop: boolean;
|
|
60
61
|
revision_mode: "edits" | "full";
|
|
62
|
+
planner_mode: "external" | "inline";
|
|
61
63
|
}, {
|
|
62
64
|
planner: {
|
|
63
65
|
provider: string;
|
|
@@ -73,6 +75,7 @@ export declare const PlanpongConfigSchema: z.ZodObject<{
|
|
|
73
75
|
max_rounds?: number | undefined;
|
|
74
76
|
human_in_loop?: boolean | undefined;
|
|
75
77
|
revision_mode?: "edits" | "full" | undefined;
|
|
78
|
+
planner_mode?: "external" | "inline" | undefined;
|
|
76
79
|
}>;
|
|
77
80
|
export type ProviderConfig = z.infer<typeof ProviderConfigSchema>;
|
|
78
81
|
export type PlanpongConfig = z.infer<typeof PlanpongConfigSchema>;
|
|
@@ -16,5 +16,13 @@ export const PlanpongConfigSchema = z.object({
|
|
|
16
16
|
// kill switch — risk + detail phases use the direction-phase schema and
|
|
17
17
|
// skip the edit applier entirely.
|
|
18
18
|
revision_mode: z.enum(["edits", "full"]).default("full"),
|
|
19
|
+
// `external` (default) preserves today's behavior: `planpong_revise`
|
|
20
|
+
// sends plan + feedback to a planner provider that produces a structured
|
|
21
|
+
// revision. `inline` flips the loop: `planpong_revise` errors out, the
|
|
22
|
+
// agent that invoked /pong-review uses `planpong_record_revision` to log
|
|
23
|
+
// its own responses + advance the round after editing the plan with its
|
|
24
|
+
// own Edit/Write tools. Inline mode trades the planner's adversarial
|
|
25
|
+
// signal for the agent's full session context.
|
|
26
|
+
planner_mode: z.enum(["inline", "external"]).default("external"),
|
|
19
27
|
});
|
|
20
28
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/schemas/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,oBAAoB;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACvD,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACxC,iEAAiE;IACjE,qEAAqE;IACrE,sEAAsE;IACtE,wEAAwE;IACxE,kCAAkC;IAClC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/schemas/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,oBAAoB;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACvD,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACxC,iEAAiE;IACjE,qEAAqE;IACrE,sEAAsE;IACtE,wEAAwE;IACxE,kCAAkC;IAClC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACxD,qEAAqE;IACrE,yEAAyE;IACzE,uEAAuE;IACvE,yEAAyE;IACzE,wEAAwE;IACxE,qEAAqE;IACrE,+CAA+C;IAC/C,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;CACjE,CAAC,CAAC"}
|
|
@@ -27,7 +27,20 @@ export declare const FeedbackIssueSchema: z.ZodObject<{
|
|
|
27
27
|
quoted_text?: string | undefined;
|
|
28
28
|
verified?: boolean | undefined;
|
|
29
29
|
}>;
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Base feedback schema for the detail phase. Includes the `blocked` verdict
|
|
32
|
+
* so fallback parsing can accept it from direction/risk phases when
|
|
33
|
+
* phase-specific parsing fails.
|
|
34
|
+
*
|
|
35
|
+
* **Production callers must NOT use `.parse()` / `.safeParse()` directly.**
|
|
36
|
+
* Always route through `parseFeedback` or `parseStructuredFeedbackForPhase`
|
|
37
|
+
* in `src/core/convergence.ts`. Those functions apply post-parse semantic
|
|
38
|
+
* coercions (e.g., `approved_with_notes` with non-P3 issues is downgraded
|
|
39
|
+
* to `needs_revision` rather than throwing). Calling the schema directly
|
|
40
|
+
* silently bypasses these coercions and reintroduces the terminal-Zod-error
|
|
41
|
+
* failure mode that the parser-side coercion is specifically there to avoid.
|
|
42
|
+
*/
|
|
43
|
+
export declare const ReviewFeedbackSchema: z.ZodObject<{
|
|
31
44
|
verdict: z.ZodEnum<["needs_revision", "approved", "approved_with_notes", "blocked"]>;
|
|
32
45
|
summary: z.ZodString;
|
|
33
46
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -96,40 +109,6 @@ export declare const ReviewFeedbackSchema: z.ZodEffects<z.ZodObject<{
|
|
|
96
109
|
missing_phase_fields?: string[] | undefined;
|
|
97
110
|
quote_compliance_warning?: boolean | undefined;
|
|
98
111
|
unverified_count?: number | undefined;
|
|
99
|
-
}>, {
|
|
100
|
-
issues: {
|
|
101
|
-
id: string;
|
|
102
|
-
severity: "P1" | "P2" | "P3";
|
|
103
|
-
section: string;
|
|
104
|
-
title: string;
|
|
105
|
-
description: string;
|
|
106
|
-
suggestion: string;
|
|
107
|
-
quoted_text?: string | undefined;
|
|
108
|
-
verified?: boolean | undefined;
|
|
109
|
-
}[];
|
|
110
|
-
verdict: "needs_revision" | "approved" | "approved_with_notes" | "blocked";
|
|
111
|
-
summary: string;
|
|
112
|
-
fallback_used?: boolean | undefined;
|
|
113
|
-
missing_phase_fields?: string[] | undefined;
|
|
114
|
-
quote_compliance_warning?: boolean | undefined;
|
|
115
|
-
unverified_count?: number | undefined;
|
|
116
|
-
}, {
|
|
117
|
-
issues: {
|
|
118
|
-
id: string;
|
|
119
|
-
severity: "P1" | "P2" | "P3";
|
|
120
|
-
section: string;
|
|
121
|
-
title: string;
|
|
122
|
-
description: string;
|
|
123
|
-
suggestion: string;
|
|
124
|
-
quoted_text?: string | undefined;
|
|
125
|
-
verified?: boolean | undefined;
|
|
126
|
-
}[];
|
|
127
|
-
verdict: "needs_revision" | "approved" | "approved_with_notes" | "blocked";
|
|
128
|
-
summary: string;
|
|
129
|
-
fallback_used?: boolean | undefined;
|
|
130
|
-
missing_phase_fields?: string[] | undefined;
|
|
131
|
-
quote_compliance_warning?: boolean | undefined;
|
|
132
|
-
unverified_count?: number | undefined;
|
|
133
112
|
}>;
|
|
134
113
|
export declare const AlternativeSchema: z.ZodObject<{
|
|
135
114
|
approach: z.ZodString;
|