You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a concrete planning.reviewFindings prerequisite so broad review-and-fix requests cannot enter remediation mode before an audit produces findings. Keep real review_and_fix completion strict and document the v2.0.14 release contract.
Constraint: Add a narrow planning-context/tool-schema contract without adding commands, tools, runtime modes, state paths, package exports, or dependencies
Constraint: Keep zod aligned with @opencode-ai/plugin; dependency contract verified unchanged at zod 4.1.8
Rejected: Loosen reviewFindingClosures, reviewScopeLedger, or final-review gates | that would make shallow no-change completion easier instead of forcing discovery first
Rejected: Raise the bundle sanity budget | prompt wording was trimmed so the bundle remains under the existing 720896-byte ceiling
Confidence: high
Scope-risk: moderate
Directive: Use goalMode: review_and_fix only after concrete findings are recorded in planning.reviewFindings; no-findings review-and-fix starts as goalMode: review
Tested: bun test tests/config/prompt-contracts.test.ts tests/plan-graph-validation.test.ts tests/prompt-mode-behavior-eval.test.ts tests/prompt-mode-capture.test.ts tests/runtime/plan-and-tool-schema-contracts.test.ts tests/completion-gates.test.ts tests/runtime/evidence-packets.test.ts; bun test tests/config/tool-schemas.test.ts; bun run build plus bundle sanity; bun run typecheck; bun run lint; bun run check
Not-tested: Live GitHub-hosted CI/release workflow for tag v2.0.14 before push
Copy file name to clipboardExpand all lines: CHANGELOG.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,32 @@
2
2
3
3
## [Unreleased]
4
4
5
+
## [2.0.14] - 2026-05-07
6
+
7
+
Route no-findings review-and-fix work through review-first discovery
8
+
9
+
Flow 2.0.14 fixes the review-and-fix quality regression where broad codebase review requests with no concrete findings could be planned as a single `review_and_fix` feature and then degrade into repeated completion-payload retries. Planning now has an explicit `planning.reviewFindings` context ledger for concrete existing review findings, and `review_and_fix` plan application fails fast when that ledger is empty.
10
+
11
+
No-findings review-and-fix requests now stay in `goalMode: review` for audit/discovery first. Once a review produces concrete findings, a remediation replan can use `goalMode: review_and_fix` with those findings recorded in `planning.reviewFindings`, preserving the strict finding-to-fix-to-validation chain.
12
+
13
+
The release deliberately keeps the existing completion gates strict. Real `review_and_fix` remediation still requires closure evidence, review-scope accounting, final-review evidence, and reviewer approval; this patch changes when remediation mode may start, not what it must prove before completion.
14
+
15
+
Prompt contracts, planner/auto/planning-researcher guidance, and prompt-mode calibration fixtures now mirror the runtime rule: no findings means review-first discovery, known findings means strict remediation. Regression coverage locks both paths, including inline-only `planning.reviewFindings` acceptance and audit-only no-findings calibration.
16
+
17
+
Constraint: Add only a narrow planning-context contract for concrete review findings; do not add commands, tools, runtime modes, state paths, package exports, or dependencies
18
+
Constraint: Accept a narrow raw tool-schema budget increase for `planning.reviewFindings` while keeping the bundle sanity budget unchanged
19
+
Constraint: Preserve strict `review_and_fix` completion gates for actual remediation with known findings
20
+
Constraint: Keep `zod` aligned with `@opencode-ai/plugin`; no dependency-version changes in this patch
21
+
Rejected: Loosen `reviewFindingClosures`, `reviewScopeLedger`, or final-review requirements for no-change completions | that would make shallow review-and-fix completion easier instead of forcing discovery first
22
+
Rejected: Keep broad no-findings review-and-fix as a single remediation feature | it frames the agent around completion accounting before findings exist
23
+
Rejected: Infer known findings from natural-language goals alone | `planning.reviewFindings` gives the runtime and prompts a concrete, auditable prerequisite
24
+
Confidence: high
25
+
Scope-risk: moderate
26
+
Reversibility: clean
27
+
Directive: Use `goalMode: review_and_fix` only after concrete findings are recorded in `planning.reviewFindings`; broad review-and-fix/codebase-review requests without findings must start as `goalMode: review`
28
+
Tested: `bun test tests/config/prompt-contracts.test.ts tests/plan-graph-validation.test.ts tests/prompt-mode-behavior-eval.test.ts tests/prompt-mode-capture.test.ts tests/runtime/plan-and-tool-schema-contracts.test.ts tests/completion-gates.test.ts tests/runtime/evidence-packets.test.ts` (91 pass, 1262 expect calls); `bun test tests/config/tool-schemas.test.ts`; `bun run build` plus bundle sanity at 720706 bytes; `bun run typecheck`; `bun run lint`; Oracle review found no blockers and P2 follow-ups were applied; `bun run check`
29
+
Not-tested: Live GitHub-hosted CI/release workflow runs for tag `v2.0.14` before push
30
+
5
31
## [2.0.13] - 2026-05-07
6
32
7
33
Dedupe final-completion tool guidance in subagent prompts
Route no-findings review-and-fix work through review-first discovery
4
+
5
+
Flow 2.0.14 fixes the review-and-fix quality regression where broad codebase review requests with no concrete findings could be planned as a single `review_and_fix` feature and then degrade into repeated completion-payload retries. Planning now has an explicit `planning.reviewFindings` context ledger for concrete existing review findings, and `review_and_fix` plan application fails fast when that ledger is empty.
6
+
7
+
No-findings review-and-fix requests now stay in `goalMode: review` for audit/discovery first. Once a review produces concrete findings, a remediation replan can use `goalMode: review_and_fix` with those findings recorded in `planning.reviewFindings`, preserving the strict finding-to-fix-to-validation chain.
8
+
9
+
The release deliberately keeps the existing completion gates strict. Real `review_and_fix` remediation still requires closure evidence, review-scope accounting, final-review evidence, and reviewer approval; this patch changes when remediation mode may start, not what it must prove before completion.
10
+
11
+
Prompt contracts, planner/auto/planning-researcher guidance, and prompt-mode calibration fixtures now mirror the runtime rule: no findings means review-first discovery, known findings means strict remediation. Regression coverage locks both paths, including inline-only `planning.reviewFindings` acceptance and audit-only no-findings calibration.
12
+
13
+
Constraint: Add only a narrow planning-context contract for concrete review findings; do not add commands, tools, runtime modes, state paths, package exports, or dependencies
14
+
Constraint: Accept a narrow raw tool-schema budget increase for `planning.reviewFindings` while keeping the bundle sanity budget unchanged
15
+
Constraint: Preserve strict `review_and_fix` completion gates for actual remediation with known findings
16
+
Constraint: Keep `zod` aligned with `@opencode-ai/plugin`; no dependency-version changes in this patch
17
+
Rejected: Loosen `reviewFindingClosures`, `reviewScopeLedger`, or final-review requirements for no-change completions | that would make shallow review-and-fix completion easier instead of forcing discovery first
18
+
Rejected: Keep broad no-findings review-and-fix as a single remediation feature | it frames the agent around completion accounting before findings exist
19
+
Rejected: Infer known findings from natural-language goals alone | `planning.reviewFindings` gives the runtime and prompts a concrete, auditable prerequisite
20
+
Confidence: high
21
+
Scope-risk: moderate
22
+
Reversibility: clean
23
+
Directive: Use `goalMode: review_and_fix` only after concrete findings are recorded in `planning.reviewFindings`; broad review-and-fix/codebase-review requests without findings must start as `goalMode: review`
24
+
Tested: `bun test tests/config/prompt-contracts.test.ts tests/plan-graph-validation.test.ts tests/prompt-mode-behavior-eval.test.ts tests/prompt-mode-capture.test.ts tests/runtime/plan-and-tool-schema-contracts.test.ts tests/completion-gates.test.ts tests/runtime/evidence-packets.test.ts` (91 pass, 1262 expect calls); `bun test tests/config/tool-schemas.test.ts`; `bun run build` plus bundle sanity at 720706 bytes; `bun run typecheck`; `bun run lint`; Oracle review found no blockers and P2 follow-ups were applied; `bun run check`
25
+
Not-tested: Live GitHub-hosted CI/release workflow runs for tag `v2.0.14` before push
Copy file name to clipboardExpand all lines: src/prompts/contracts.ts
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ const FLOW_PLAN_CONTRACT_BASE = `Persist a plan with:
26
26
27
27
Plan rules:
28
28
- review/review_and_fix plans must declare review scope through reviewScope or fileTargets for every target/domain the runtime must account.
29
+
- Use goalMode: review_and_fix only when concrete findings already exist and are recorded in planning.reviewFindings; broad review-and-fix/codebase-review goals with no findings must start as goalMode: review for audit/discovery, then replan review_and_fix after findings are recorded.
29
30
30
31
Record planning context separately via flow_plan_context_record or flow_plan_apply({ plan, planning: ... }) when needed — not inside \`plan\`.
31
32
- planning.repoProfile?: string[]
@@ -36,6 +37,7 @@ Record planning context separately via flow_plan_context_record or flow_plan_app
- planning.reviewFindings?: { findingRef: string, summary: string, sourceRefs: string[] }[] — concrete existing findings from a user-provided finding, audit report, issue, failing test, or prior review ledger; sourceRefs must be non-empty concrete refs. Missing/empty means no remediation findings are known yet.
"- Stay at the coordinator layer: decide whether planning, execution, review, reset, or recovery happens next, and rely on the specialized Flow roles for their detailed contracts.";
21
21
exportconstFLOW_REVIEW_FINDINGS_LOOP_RULE=
22
22
"- Do not complete a feature while review findings remain. Fix them, record a finding-by-finding closure ledger with code/test/validation evidence and residual risk, rerun validation, and rereview until the feature is clean or a real blocker remains.";
"- Broad review-and-fix/codebase-review goals with no concrete existing findings in planning.reviewFindings must start as goalMode: review for audit/discovery; replan to goalMode: review_and_fix only after concrete findings are recorded in planning.reviewFindings.";
23
25
exportconstFLOW_FEATURE_REVIEW_APPROVAL_RULE=
24
26
"- Before persisting success, get flow-reviewer approval and record it through flow_review_record_feature.";
body: "If the goal asks for a full codebase review and fixes, recommend a review-first plan shape: first run a read-only codebase review/audit, then fix confirmed findings only after the audit ledger exists. Do not invent findings during research.",
81
+
body: "No findings: recommend goalMode: review for audit, requiresReplanAfterAudit: true. goalMode: review_and_fix only after concrete findings are recorded in planning.reviewFindings. Do not invent findings.",
{title: "Role",body: "You are the Flow planning researcher."},
90
91
{
91
92
title: "Objective",
92
-
body: "Produce a read-only evidence packet that helps Flow planning stay phase-correct, especially for broad review-and-fix goals where findings do not exist yet.",
- Stay read-only: do not write repository code, do not call Flow runtime tools, do not apply or approve plans, and do not claim execution success.
99
100
- You are not flow-planner. Produce research for flow-planner or flow-auto to consume through normal runtime-owned planning.
100
-
- For full codebase review and fix goals, recommend an audit/review-first plan shape before any fix feature. Findings belong in the audit/review ledger, not planning research.
101
-
- Do not invent findings, severity, or closure evidence. If findings are not already provided, say the fix phase must wait for a concrete review ledger.
101
+
${FLOW_REVIEW_FIRST_WITHOUT_FINDINGS_PLAN_RULE}
102
+
- For codebase review/fix with no findings, recommend an audit/review-first plan shape before any fix feature; copy concrete findings into planning.reviewFindings after audit.
103
+
- Do not invent findings. If none are provided, set recommendedPlanShape.goalMode to "review", requiresReplanAfterAudit: true; fixes wait for a concrete review ledger.
body: `1. Normalize the request into goal, constraints, evidence requirements, and done-when.
111
113
2. Inspect only enough local evidence to identify package manager, stack, validation scripts, local standards, and the major review surfaces.
112
-
3. For review-and-fix goals without existing findings, recommend a review-first or replan-after-audit shape instead of a fake all-in-one fix feature.
114
+
3. For review-and-fix goals without findings, recommend goalMode: "review" and requiresReplanAfterAudit: true; use goalMode: "review_and_fix" only after planning.reviewFindings has concrete findings.
113
115
4. Return exactly one JSON object with no markdown fences or commentary:
- Keep plans short, concrete, and ready to execute.
155
158
- Broad goals are valid.
156
-
- For broad review-and-fix goals where findings do not exist yet, use a review-first plan shape or a flow-planning-researcher handoff; do not create a fake all-in-one fix feature.
159
+
${FLOW_REVIEW_FIRST_WITHOUT_FINDINGS_PLAN_RULE}
160
+
- For broad review-and-fix goals without findings, use goalMode: review or a flow-planning-researcher handoff; do not create a fake all-in-one fix feature.
161
+
- Use goalMode: review_and_fix only after concrete findings exist in planning.reviewFindings.
157
162
- Do not start implementation after drafting a plan.`,
158
163
},
159
164
{
160
165
title: "Workflow",
161
166
body: `${renderWorkflowProtocol(planner)}
162
167
1. Call flow_plan_start.
163
168
2. Read enough repo context to justify the plan. When the goal is a broad review-and-fix request and Task handoff is available, ask flow-planning-researcher for a read-only planning research packet before finalizing decomposition.
164
-
3. Persist repoProfile, packageManager, stackProfile, standardsProfile, research, implementationApproach, evidencePackets, or decisionLog with flow_plan_context_record.
169
+
3. Persist repoProfile, packageManager, stackProfile, standardsProfile, research, implementationApproach, evidencePackets, decisionLog, or concrete reviewFindings with flow_plan_context_record.
1. Call flow_auto_prepare with the raw command argument string before planning or repo inspection.
246
251
2. If flow_auto_prepare returns missing_goal, render that result clearly and stop.
247
-
3. If planning is needed for a broad review-and-fix/codebase-review request, prefer a Task-tool handoff to flow-planning-researcher first so review discovery and fix execution stay phase-correct.
252
+
3. If planning is needed for broad review-and-fix/codebase-review, use flow-planning-researcher first; without concrete planning.reviewFindings, start with goalMode: review, then goalMode: review_and_fix only after findings are recorded.
248
253
4. If planning is needed, prefer a Task-tool handoff to flow-planner; the planning pass records stackProfile, standardsProfile, and useful evidencePackets with flow_plan_context_record, persists the plan with flow_plan_apply, and approves it with flow_plan_approve.
249
254
5. If repo evidence and research still leave a meaningful architecture, product, or quality decision still remains, record the options and recommendation with flow_plan_context_record so the runtime summary exposes a decision gate. If any Flow tool response includes session.decisionGate with status recommend_confirm or human_required, present that recommendation clearly and stop for user confirmation.
250
255
6. Start the next feature with flow_run_start and keep that feature active until it is clean or truly blocked.
"review_and_fix plans require concrete existing findings in planning.reviewFindings. For broad review/codebase-review goals without findings, apply a review-first plan with goalMode: review, run discovery/audit, then replan remediation after findings exist.";
0 commit comments