Skip to content

fix(cli): forward analysis context to generateReview (#802 Phase 3 A2-fix-3)#871

Merged
s977043 merged 1 commit into
mainfrom
fix/802-phase3-exec-analysis-context-propagation
May 21, 2026
Merged

fix(cli): forward analysis context to generateReview (#802 Phase 3 A2-fix-3)#871
s977043 merged 1 commit into
mainfrom
fix/802-phase3-exec-analysis-context-propagation

Conversation

@s977043

@s977043 s977043 commented May 21, 2026

Copy link
Copy Markdown
Owner

Summary

Forward the analysis context that buildExecutionPlan already derives (fileTypes, relatedADRs, reviewMode) from runReviewPlan into generateReview. Continues the Codex silent-skip cleanup after #865 (availableContexts) and #869 (availableDependencies).

Silent failures this closes

Field What was silently lost
fileTypes Verifier file-phase coherence check fell back to lenient mode → phase mismatch detection disabled on exec
relatedADRs ADR cross-references were dropped from the prompt → skill outputs lost "ADR-001 says X" anchors that river run produced
reviewMode Diff-size-driven context budget preset was always the generateReview default rather than the calibrated `tiny

Changes

File What
src/lib/review-plan.mjs Pull plan.fileTypes / relatedADRs / reviewMode off the buildExecutionPlan return and pass to generateReview
tests/cli-review-plan.test.mjs 2 new unit tests (forward path + undefined-fallback)
runners/github-action/dist/ Rebuilt with Node 22.22.2

Behavior

  • Backward-compat: when buildExecutionPlan returns a minimal plan shape (older tests), ?? undefined ensures these fields stay undefined and generateReview falls back to its existing defaults.
  • Real exec path: the three derived fields now reach generateReview on every invocation.

Remaining silent-skip items

  • --plan replay context-snapshot drift (deferred to A2-3).

Test plan

  • node --test tests/cli-review-plan.test.mjs (48/48 green, 2 new)
  • npm test (full suite green)
  • markdownlint + prettier green
  • npm run build:action with Node 22.22.2

Follows: #864 (A2-1), #865 (A2-fix-1), #869 (A2-fix-2).

🤖 Generated with Claude Code

…802 Phase 3 A2-fix-3)

Continue the Codex silent-skip cleanup after #865 (availableContexts)
and #869 (availableDependencies). The plan layer's
`buildExecutionPlan` already derives fileTypes, relatedADRs, and
reviewMode (review-runner.mjs:212-217), but runReviewPlan never read
them off the plan return and never forwarded them to generateReview.

Impact (silent, no error)
- fileTypes: generateReview's verifier file-phase coherence check fell
  back to "lenient when fileTypes not provided". On exec, phase
  mismatch checks were effectively disabled.
- relatedADRs: ADR cross-references were never injected into the prompt
  on the exec path. Skill outputs lost the "ADR-001 says X" anchors
  that `river run` produced.
- reviewMode: the diff-size-driven context budget preset was always the
  generateReview default rather than the calibrated 'tiny|medium|large'
  the plan layer determined.

Fix
- Pull `plan.fileTypes`, `plan.relatedADRs`, `plan.reviewMode` off the
  buildExecutionPlan return and pass them to generateReview alongside
  the existing diff/plan/phase/config. Optional chaining (`?? undefined`)
  keeps backward-compat: tests that mock buildExecutionPlan with a
  minimal shape continue to work.

Tests
- 2 new unit tests in tests/cli-review-plan.test.mjs cover the forward
  path and the undefined-fallback path.
- runners/github-action/dist rebuilt with Node 22.22.2.

Follows: #864 (A2-1), #865 (A2-fix-1), #869 (A2-fix-2).

Remaining silent-skip risks
- --plan replay context-snapshot drift (deferred to A2-3).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@vercel

vercel Bot commented May 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-review-kit Ready Ready Preview, Comment May 21, 2026 10:40pm

@github-actions

Copy link
Copy Markdown
Contributor

River Reviewer

  • フェーズ: midstream
  • LLM: skipped (dry-run enabled)
  • Planner: off
  • Impact tags: javascript, observability, reliability, tests
  • 変更ファイル数: 4
  • トークン見積もり: 16754

選択されたスキル (1)

  • rr-midstream-logging-observability-001
スキップされたスキル (82)
  • adversarial-review: routing skill: not an executable review skill
  • river-reviewer-architecture: routing skill: not an executable review skill
  • river-reviewer-code: routing skill: not an executable review skill
  • river-reviewer-performance: routing skill: not an executable review skill
  • river-reviewer-security: routing skill: not an executable review skill
  • river-reviewer-testing: routing skill: not an executable review skill
  • river-reviewer: routing skill: not an executable review skill
  • rr-downstream-review-policy-standard-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-downstream-coverage-gap-001: phase mismatch: downstream !== midstream; missing inputContext: tests
  • rr-downstream-flaky-test-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-downstream-test-existence-001: phase mismatch: downstream !== midstream; missing inputContext: tests
  • rr-downstream-test-naming-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-downstream-test-plan-review-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-downstream-test-review-sample-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-a11y-accessible-name-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-nextjs-app-router-boundary-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-review-policy-standard-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-agent-skill-bridge-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-api-compatibility-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-config-json-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-gh-address-comments-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-hello-skill-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-i18n-unused-key-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-loading-state-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-logic-torturing-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-normalization-consistency-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-nullability-contract-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-review-automation-boundary-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-review-comment-triage-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-security-basic-001: applyTo did not match any changed file
  • rr-midstream-suppression-feedback-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-type-driven-design-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-typescript-nullcheck-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-typescript-strict-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-war-game-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-midstream-code-quality-sample-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-review-policy-standard-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-test-code-nextjs-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-test-code-php-laravel-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-test-code-react-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-test-code-remix-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-test-code-unit-python-pytest-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-test-code-unit-ts-jest-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-test-code-vue-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-adr-decision-quality-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-api-design-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-api-versioning-compat-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-architecture-boundaries-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-architecture-diagrams-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-architecture-risk-register-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-architecture-traceability-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-architecture-validation-plan-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-availability-architecture-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-bounded-context-language-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-cache-strategy-consistency-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-capacity-cost-design-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-change-communication-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-context-budget-tuning-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-create-plan-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-data-flow-state-ownership-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-data-model-db-design-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-dr-multiregion-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-eval-driven-skill-design-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-event-driven-semantics-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-external-dependencies-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-failure-modes-observability-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-integration-contracts-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-migration-rollout-rollback-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-multitenancy-isolation-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-openapi-contract-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-operability-slo-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-plangate-exec-conformance-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-plangate-gc-deterministic-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-plangate-plan-integrity-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-plangate-rule-promotion-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-plangate-verification-audit-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-pr-template-qa-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-pre-mortem-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-requirements-acceptance-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-security-privacy-design-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-trust-boundaries-authz-001: dry-run: LLM必須スキル(ヒューリスティック未対応)
  • rr-upstream-architecture-sample-001: dry-run: LLM必須スキル(ヒューリスティック未対応)

優先度サマリー

  • P1 (must fix before merge): 0 件
  • P2 (should fix or waive): 0 件
  • P3 (recommended improvement): 0 件
  • P4 (informational): 0 件

スコア (参考値)

結果(スコア): 100/100
判定: auto-approve

内訳:

  • 可読性: 100/100
  • 拡張性: 100/100
  • パフォーマンス: 100/100
  • セキュリティ: 100/100
  • 保守性: 100/100

スコアは severity と axis から決定論的に算出された 参考値 (derived: true)。HITL レビューと併用してください。

指摘

No findings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the runReviewPlan function to propagate analysis context fields—specifically fileTypes, relatedADRs, and reviewMode—from the execution plan to the generateReviewImpl call. This ensures that prompt enrichment and coherence checks have access to the necessary metadata derived during the planning phase. Additionally, new unit tests have been added to verify that these fields are correctly forwarded and remain undefined when omitted for backward compatibility. I have no feedback to provide as there were no review comments to assess.

@github-actions

Copy link
Copy Markdown
Contributor

PlanGate Review

  • decision: pass
  • plan status: skipped-by-label
  • exec status: skipped-by-label

PlanGate review decision: pass

severity count policy
critical 0 fail
major 0 fail-if-required / warn
minor 0 comment-only
info 0 skipped

ポリシー: critical=fail / major=fail-if-required (warn) / minor=comment-only / info=skipped — spec: pages/reference/cli-review-plan-spec.md

@s977043 s977043 merged commit 74b6c6f into main May 21, 2026
16 checks passed
@s977043 s977043 deleted the fix/802-phase3-exec-analysis-context-propagation branch May 21, 2026 22:45
s977043 added a commit that referenced this pull request May 22, 2026
…872)

* docs(troubleshooting): close out silent-skip cleanup through v0.51.1

Codex-recommended docs follow-up after the v0.51.1 release. The
existing troubleshooting page only documented the v0.51.0
availableContexts fix; v0.51.1 closed two more silent-skip failure
modes (#869 availableDependencies, #871 fileTypes/relatedADRs/reviewMode)
that were not yet reflected.

What this adds
- "Skill appears in skippedSkills with reason missing dependency": new
  section describing the v0.51.1 fix and the --dependency /
  RIVER_AVAILABLE_DEPENDENCIES / RIVER_DEPENDENCY_STUBS=1 knobs.
- "Finding output looks generic / missing ADR references": new section
  explaining the three derived-context fields the exec path was
  silently dropping, and confirming the fix is automatic in v0.51.1+.
- "Where the plan layer forwards each context": small reference table
  that maps each forwarded field to the PR / release that wired it.
- "Residual gap: --plan replay does not yet run skills": explicit
  pointer to the remaining #802 A2-3 work so adopters know the boundary
  of v0.51.x.

No code changes.

Follows: #864 (A2-1), #865 (A2-fix-1), #869 (A2-fix-2), #871 (A2-fix-3).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs: link the #802 issue reference (Gemini PR #872 nit)

Make the introductory mention of #802 a real GitHub link, matching the
style of the residual-gap section. No content change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
s977043 added a commit that referenced this pull request May 22, 2026
…A2-fix-4) (#877)

The final remaining silent-skip identified by the multi-perspective
session review (Codex + Gemini): runReviewPlan was hard-coding
riskMap: undefined when calling buildExecutionPlan, so the
riskAssessment that buildExecutionPlan would have produced never
appeared on the artifact, and never reached generateReview's prompt
on the exec path.

What changed
- runReviewPlan loads the optional risk map via loadRiskMap (default
  path .river/risk-map.yaml). Missing file => null (no behaviour
  change). Malformed file => ReviewPlanError so it fails loudly
  instead of dropping the risk signal silently.
- The loaded riskMap is forwarded to buildExecutionPlan, which already
  knew how to compute riskAssessment when given a non-null riskMap.
- plan.riskAssessment is forwarded to generateReview alongside
  fileTypes / relatedADRs / reviewMode (the analysis-context bundle
  finalised in A2-fix-3).
- loadRiskMapImpl is injectable so tests can drive the path without a
  fixture file on disk.

Tests
- 5 new unit tests cover happy path forwarding, null sentinel, load
  failure, generateReview hand-off, and the undefined-fallback when
  the plan omits riskAssessment.
- runners/github-action/dist rebuilt with Node 22.22.2.

Silent-skip cleanup status (post-A2-fix-4)
- availableContexts (#865)
- availableDependencies (#869)
- fileTypes / relatedADRs / reviewMode (#871)
- riskAssessment (this PR)
- --plan replay context-snapshot drift is the only remaining item,
  deferred to A2-3.

Multi-perspective review reference
- Codex 86/100: "riskAssessment が runReviewPlan で riskMap: undefined
  固定で実質ドロップ" 指摘
- Gemini 95/100: "riskAssessment の伝播漏れのみが唯一の明確な減点
  対象"
- 両者が独立に同じ点を 6 番目の silent-skip として指摘した。

Follows: #864 (A2-1), #865 (A2-fix-1), #869 (A2-fix-2), #871 (A2-fix-3).

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant