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
Ground final review coverage in canonical evidence
Final-review context packs now preserve connected review context without letting self-reported labels satisfy coverage gates. The release keeps the OpenCode raw tool schema compact while making its top-level reviewContextPack contract reject empty and unknown payloads before strict runtime parsing owns nested validation.
Constraint: Improve final-review context discovery without adding commands, tools, state paths, package exports, or dependency versions
Constraint: Keep zod aligned with @opencode-ai/plugin; no dependency-version changes in this patch
Rejected: Let includedContext.surface or reason satisfy concrete surfaces | self-attested labels can spoof final-review coverage
Rejected: Reuse the full runtime reviewContextPack schema in raw OpenCode args | it violates the tool schema size budget, while strict runtime parsing already owns nested validation
Confidence: high
Scope-risk: moderate
Directive: Treat reviewContextPack as a grounded evidence ledger; derive concrete coverage from canonical paths, relationships, and validation commands rather than reviewer-supplied labels
Tested: bun test tests/runtime/final-review-contracts.test.ts tests/config/tool-schemas.test.ts; bun run typecheck; bun run lint; bun run check
Not-tested: Live GitHub-hosted CI/release workflow runs for tag v2.0.8 before push
Copy file name to clipboardExpand all lines: CHANGELOG.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,25 @@
2
2
3
3
## [Unreleased]
4
4
5
+
## [2.0.8] - 2026-05-06
6
+
7
+
Ground final review coverage in canonical evidence
8
+
9
+
Flow 2.0.8 hardens final-review coverage by introducing a typed `reviewContextPack` for changed files, connected context, relationship edges, validation evidence, suggested validation, and coverage gaps. Runtime normalization now carries that pack through final-review and worker-completion paths, while prompt, audit, schema, and capture fixtures teach reviewers that changed files are the review seed rather than the review boundary.
10
+
11
+
The release also closes the main trust-boundary risk in that new evidence ledger. Review surfaces such as tests, release, operator, tooling, docs, shared surfaces, and integration points now need grounded canonical path or relationship evidence instead of self-reported labels. Validation evidence must match actual worker validation commands, and the OpenCode tool surface rejects empty or unknown top-level `reviewContextPack` payloads while keeping the raw schema compact enough for the existing size budget.
12
+
13
+
Constraint: Improve final-review context discovery without adding new commands, tools, state paths, package exports, or dependency versions
14
+
Constraint: Keep `zod` aligned with `@opencode-ai/plugin`; no dependency-version changes in this patch
15
+
Rejected: Let reviewer-supplied `includedContext.surface` or `reason` satisfy concrete review surfaces | self-attested labels can spoof coverage and weaken final-review gates
16
+
Rejected: Reuse the full runtime `reviewContextPack` schema directly in OpenCode raw tool args | it exceeds the tool schema size budget, so runtime strict parsing owns nested validation while the compact raw schema pins top-level shape
17
+
Confidence: high
18
+
Scope-risk: moderate
19
+
Reversibility: clean
20
+
Directive: Treat `reviewContextPack` as a grounded evidence ledger: labels may describe context, but coverage gates must derive concrete surfaces from canonical paths, relationships, and validation commands
21
+
Tested: `bun test tests/runtime/final-review-contracts.test.ts tests/config/tool-schemas.test.ts` (18 pass, 444 expect calls); `bun run typecheck`; `bun run lint`; `bun run check` (520 pass in full suite, completion/replay gates, build, release hygiene, pack invariants, lint, bench smoke, and bench gate passed); Oracle review found no blockers and P2 follow-ups were applied
22
+
Not-tested: Live GitHub-hosted CI/release workflow runs for tag `v2.0.8` before push
Ground final review coverage in canonical evidence
4
+
5
+
Flow 2.0.8 hardens final-review coverage by introducing a typed `reviewContextPack` for changed files, connected context, relationship edges, validation evidence, suggested validation, and coverage gaps. Runtime normalization now carries that pack through final-review and worker-completion paths, while prompt, audit, schema, and capture fixtures teach reviewers that changed files are the review seed rather than the review boundary.
6
+
7
+
The release also closes the main trust-boundary risk in that new evidence ledger. Review surfaces such as tests, release, operator, tooling, docs, shared surfaces, and integration points now need grounded canonical path or relationship evidence instead of self-reported labels. Validation evidence must match actual worker validation commands, and the OpenCode tool surface rejects empty or unknown top-level `reviewContextPack` payloads while keeping the raw schema compact enough for the existing size budget.
8
+
9
+
Constraint: Improve final-review context discovery without adding new commands, tools, state paths, package exports, or dependency versions
10
+
Constraint: Keep `zod` aligned with `@opencode-ai/plugin`; no dependency-version changes in this patch
11
+
Rejected: Let reviewer-supplied `includedContext.surface` or `reason` satisfy concrete review surfaces | self-attested labels can spoof coverage and weaken final-review gates
12
+
Rejected: Reuse the full runtime `reviewContextPack` schema directly in OpenCode raw tool args | it exceeds the tool schema size budget, so runtime strict parsing owns nested validation while the compact raw schema pins top-level shape
13
+
Confidence: high
14
+
Scope-risk: moderate
15
+
Reversibility: clean
16
+
Directive: Treat `reviewContextPack` as a grounded evidence ledger: labels may describe context, but coverage gates must derive concrete surfaces from canonical paths, relationships, and validation commands
17
+
Tested: `bun test tests/runtime/final-review-contracts.test.ts tests/config/tool-schemas.test.ts` (18 pass, 444 expect calls); `bun run typecheck`; `bun run lint`; `bun run check` (520 pass in full suite, completion/replay gates, build, release hygiene, pack invariants, lint, bench smoke, and bench gate passed); Oracle review found no blockers and P2 follow-ups were applied
18
+
Not-tested: Live GitHub-hosted CI/release workflow runs for tag `v2.0.8` before push
Copy file name to clipboardExpand all lines: src/audit/prompts/contracts.ts
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@ Final response rules:
42
42
Audit rules:
43
43
- treat requestedDepth as the user's requested review strength, but set achievedDepth from actual evidence gathered
44
44
- discoveredSurfaces is the canonical coverage ledger for standalone review coverage; derive human-readable coverage summaries from it instead of duplicating the same truth in extra structures
45
+
- treat directly changed files as a seed, not the coverage boundary: distinguish directly reviewed changed surfaces from connected context surfaces (callers/callees, state/lifecycle owners, architectural neighbors, tests, validation evidence), and describe coverage gaps/validation limits explicitly in coverageNotes/findings/nextSteps
45
46
- evidencePackets is optional read-only context/evidence metadata for packet boundaries, exact sources, exclusions, uncertainty, and validation evidence; it must support discoveredSurfaces/findings instead of replacing their concrete evidence references
46
47
- achievedDepth can be full_audit only when every major surface discovered during repo mapping is directly reviewed and every discovered surface is represented in discoveredSurfaces
47
48
- if any major surface remains unreviewed, spot-checked only, or intentionally skipped, downgrade achievedDepth below full_audit and explain the gap in coverageNotes
- for scope: final, use reviewPurpose completion_gate
143
144
- for scope: final, include reviewDepth matching deliveryPolicy.finalReviewPolicy
144
145
- for scope: final, include reviewedSurfaces, evidenceSummary, validationAssessment, and evidenceRefs describing what was checked
146
+
- for scope: final, changed files are required evidence but not the review boundary; include connected context and integration surfaces discovered from changed files, relationships, state/lifecycle ownership, tests, and validation evidence
147
+
- for scope: final, when reviewContextPack is present, keep it grounded: reviewContextPack.changedFiles should map to reviewed changed artifacts, reviewContextPack.includedContext should capture connected context (not duplicate changed files only), and reviewContextPack.reviewedSurfaces should match reviewedSurfaces
148
+
- for scope: final, distinguish directly changed files from connected context in summary/integrationChecks/regressionChecks/remainingGaps, and use remainingGaps to report uncovered product paths, missing or weak test oracles, and validation limits
145
149
- for scope: final, set evidenceRefs.changedArtifacts to actual changed artifact paths you reviewed and evidenceRefs.validationCommands to actual validation commands you relied on
146
150
- for scope: final, use evidencePackets only as optional read-only context/evidence metadata; do not let packet references replace concrete evidenceRefs
147
151
- for scope: final, cover the execution-derived required surfaces from the current run, including changed_files when artifactsChanged is non-empty, validation_evidence when validationRun is recorded, and any touched docs/prompt, tooling/config, operator, release, or test surfaces
"- Apply the repo's coding guidelines before completion: prefer deletion/reuse over new layers, keep diffs small, use existing scripts and utilities, inspect existing logging/telemetry/CLI-output patterns before changing `console.*`, classify each occurrence, remove only temporary debug noise, replace intentional operator/observability signals with the repo's existing logger, telemetry API, injected logger, or explicit stdout/stderr stream writes while preserving severity, message intent, and key context, if no facility exists add the smallest local injected adapter or report a blocker instead of inventing a dependency, and add or update tests for behavior changes.";
62
62
exportconstFLOW_RELEASE_HYGIENE_REVIEW_RULE=
63
63
"- Treat release hygiene as a review gate: do not approve work that leaves raw console calls, debugger statements, or undocumented debug-only instrumentation in release-bound source or build artifacts, do not approve changes that delete intentional operator/observability signals without evidence of an equivalent logger, telemetry, or stdout/stderr replacement preserving severity, message intent, and key context, and do not approve a new logging or telemetry dependency unless it was explicitly approved.";
64
+
exportconstFLOW_REVIEW_CONTEXT_DISCOVERY_RULE=
65
+
"- Treat changed files as the review seed, not the boundary: include connected context discovered through callers/callees, state or lifecycle owners, architectural neighbors, tests, and validation evidence; distinguish directly changed files from connected context and report coverage gaps/validation limits explicitly.";
"- Review changed behavior through applicable adversarial failure-mode classes before approving: lifecycle/reentrancy/idempotency, async races/event ordering, persistence failure and recovery, interaction geometry/hit-testing, accessibility semantics/live regions, and test-oracle authenticity. When a class is applicable, cite the concrete path checked in summary, integrationChecks, regressionChecks, blockingFindings, followUps, or suggestedValidation; when it is not applicable, do not force a finding.";
- Call \`flow_run_start\` first, passing the argument as a feature id only when it is non-empty.
127
127
- If no feature is runnable, summarize the runtime result and stop.
128
-
- Otherwise implement exactly one feature, run targeted validation, review the changed files, fix review findings, rerun validation, and obtain reviewer approval through \`flow_review_record_feature\` using the direct reviewer decision object.
128
+
- Otherwise implement exactly one feature, run targeted validation, review changed files plus discovered connected context (changed files are the seed, not the boundary), fix review findings, rerun validation, and obtain reviewer approval through \`flow_review_record_feature\` using the direct reviewer decision object.
2. If the runtime says there is nothing runnable, summarize the runtime result and stop.
195
-
3. Implement the active feature, run targeted validation, and review changed files.
196
+
3. Implement the active feature, run targeted validation, and review changed files plus discovered connected context; changed files are not the review boundary.
196
197
4. If review finds blocking issues, fix them, rerun targeted validation, and review again. Repeat until review passes or a real blocker remains.
197
198
5. In the lite lane, if the runtime session is small enough and your worker result already contains the required passing feature-level review payload for a non-final feature, you may skip the separate reviewer-persistence hop.
198
199
6. On the final completion path, run broad validation, ask flow-reviewer for the final review required by deliveryPolicy.finalReviewPolicy, and persist that approval with flow_review_record_final using the direct reviewer decision object.
0 commit comments