Skip to content

fix(cli): propagate availableContexts to plan layer (#802 Phase 3 A2-fix-1)#865

Merged
s977043 merged 4 commits into
mainfrom
fix/802-phase3-available-contexts-propagation
May 21, 2026
Merged

fix(cli): propagate availableContexts to plan layer (#802 Phase 3 A2-fix-1)#865
s977043 merged 4 commits into
mainfrom
fix/802-phase3-available-contexts-propagation

Conversation

@s977043

@s977043 s977043 commented May 21, 2026

Copy link
Copy Markdown
Owner

Summary

Close the silent-skip gap discovered when dogfooding A2-1 (#864): every skill that declared inputContext: ['diff'] was being filtered out by buildExecutionPlan because runReviewPlan never forwarded availableContexts. The plan layer now defaults to ['diff'] whenever a diff artifact is resolved and merges in RIVER_AVAILABLE_CONTEXTS plus an optional caller argument / CLI --context flag.

Why this slice

Codex flagged silent-skip as a higher-impact risk than the LLM call itself: failures look like success, demos go empty. The A2-1 dogfood reproduced this — 0 selected skills with a 290-line diff because inputContext: diff skills were unconditionally skipped.

After this fix, the same dogfood selects 5 midstream skills end-to-end:

{
  "status": "ok",
  "selected_count": 5,
  "selected_ids": [
    "rr-midstream-logging-observability-001",
    "rr-midstream-review-automation-boundary-001",
    "rr-midstream-gh-address-comments-001",
    "rr-midstream-hello-skill-001",
    "rr-midstream-review-comment-triage-001"
  ],
  "exec_trace": { "skillsExecuted": 5, "heuristicsUsed": true, "...": "..." }
}

Changes

File What
src/lib/review-plan.mjs New availableContexts option + resolveEffectiveContexts helper (mirrors src/lib/local-runner.mjs); forwards into buildExecutionPlan
src/cli.mjs Passes parsed.availableContexts through so --context diff,tests works on river review exec
tests/cli-review-plan.test.mjs 5 new unit tests (defaults, explicit override, env-var merge, empty fallback, debug-only field)
tests/integration/review-plan-cli.test.mjs New E2E test for --context diff,tests forwarding
runners/github-action/dist/ Rebuilt with Node 22.22.2

Out of scope (follow-up silent-skip risks)

Codex flagged the same pattern in:

These should be handled the same way once the use case demands them.

Test plan

  • node --test tests/cli-review-plan.test.mjs tests/integration/review-plan-cli.test.mjs (75/75 green: 41 unit + 34 integration)
  • markdownlint + prettier green
  • CLI dogfood against real repo diff (selected_count 0 → 5)
  • npm run build:action rebuilt with Node 22.22.2
  • CI green

Follows: #864 (A2-1 generateReview adapter).

🤖 Generated with Claude Code

…A2-fix-1)

runReviewPlan never passed availableContexts to buildExecutionPlan, so all
skills with inputContext: ['diff'] landed in skippedSkills silently.

- Add resolveEffectiveContexts() helper: defaults to ['diff'], merges
  RIVER_AVAILABLE_CONTEXTS env var (mirrors local-runner.mjs pattern)
- Thread availableContexts param through runReviewPlan signature with JSDoc
- Pass effectiveAvailableContexts into buildExecutionPlanImpl call
- Forward parsed.availableContexts from CLI --context flag to runReviewPlan

Closes #802 (A2-fix-1 slice)
@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 6:15am

@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

このプルリクエストは、CLIから指定されたコンテキストをレビュープランに反映し、環境変数とマージする機能を導入します。これにより、特定のコンテキストを必要とするスキルが正しく選択されるようになります。レビューでは、重複するコンテキスト解決ロジックの共通ユーティリティ化と、ユーザー指定時でも'diff'コンテキストをデフォルトで保持するような挙動の改善が提案されています。

Comment thread src/lib/review-plan.mjs Outdated
Comment on lines +233 to +237
function resolveEffectiveContexts(inputContexts) {
const envContexts = parseList(process.env.RIVER_AVAILABLE_CONTEXTS);
const base = inputContexts?.length ? inputContexts : ['diff'];
return [...new Set([...base, ...envContexts])];
}

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.

medium

resolveEffectiveContexts のロジックが src/lib/local-runner.mjs 内の resolveAvailableContexts と重複しているようです(コメントにも記載があります)。将来的なロジックの乖離を防ぎメンテナンス性を向上させるため、この共通ロジックを src/lib/utils.mjs などの共通ユーティリティに抽出し、両方のエントリポイントから再利用することを検討してください。

Comment thread src/lib/review-plan.mjs Outdated
*/
function resolveEffectiveContexts(inputContexts) {
const envContexts = parseList(process.env.RIVER_AVAILABLE_CONTEXTS);
const base = inputContexts?.length ? inputContexts : ['diff'];

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.

medium

この実装では、CLI引数(inputContexts)が提供されるとデフォルトの 'diff' が完全に上書きされます。runReviewPlan が実行される際は常に diff アーティファクトが解決されているため、ユーザーが --context tests のように他のコンテキストを追加指定した場合でも、'diff' コンテキストは自動的に維持される(または常に含まれる)方が、スキルのスキップを防ぐ観点では直感的かもしれません。現状の実装では、ユーザーは明示的に --context diff,tests と指定する必要があります。

Suggested change
const base = inputContexts?.length ? inputContexts : ['diff'];
const base = [...new Set(['diff', ...(inputContexts ?? [])])];

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

River Reviewer

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

選択されたスキル (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.

@github-actions

github-actions Bot commented May 21, 2026

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

Picks up the new resolveEffectiveContexts helper and the additional
availableContexts argument forwarded into buildExecutionPlan via the
runReviewPlan path.

No source/contract changes — bundle only. Built with Node 22.22.2 per
.nvmrc.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@s977043 s977043 changed the title fix(review-plan): propagate availableContexts to buildExecutionPlan (A2-fix-1) fix(cli): propagate availableContexts to plan layer (#802 Phase 3 A2-fix-1) May 21, 2026
- Move resolveAvailableContexts() to src/lib/utils.mjs as the single
  source of truth. local-runner.mjs now imports the shared helper.
- Add alwaysInclude option to the helper. review-plan.mjs uses
  alwaysInclude: ['diff'] inside the diff-resolved branch so a narrow
  CLI override like `--context tests` no longer drops 'diff' from the
  effective set (would have re-introduced the A1 silent-skip failure
  Gemini flagged in its second comment).
- New regression test: --context tests still ends up with both
  'diff' and 'tests' in the buildExecutionPlan args.

No behavior change for local-runner (it never passed alwaysInclude).
1076/1076 tests green. dist rebuilt with Node 22.22.2.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@s977043 s977043 merged commit 074db50 into main May 21, 2026
16 checks passed
@s977043 s977043 deleted the fix/802-phase3-available-contexts-propagation branch May 21, 2026 06:18
s977043 added a commit that referenced this pull request May 21, 2026
…Deferred

D3: docs/review/troubleshooting.md — documents the silent-skip problem
fixed in A2-fix-1 (v0.51.0): river review exec returned empty findings
when availableContexts was not forwarded to buildExecutionPlan. Covers
diagnosis with --debug, the fix, and RIVER_AVAILABLE_CONTEXTS usage.

D2: docs/deprecated.md — marks artifact.executionDeferred as deprecated
in v0.51.0 (planned removal v0.53.0) and points to plan.skippedSkills
as the replacement.

Closes documentation gap for PR #865 (A2-fix-1).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
s977043 added a commit that referenced this pull request May 21, 2026
…cation (D2+D3) (#866)

* docs: add skill-selection troubleshooting guide + deprecate executionDeferred

D3: docs/review/troubleshooting.md — documents the silent-skip problem
fixed in A2-fix-1 (v0.51.0): river review exec returned empty findings
when availableContexts was not forwarded to buildExecutionPlan. Covers
diagnosis with --debug, the fix, and RIVER_AVAILABLE_CONTEXTS usage.

D2: docs/deprecated.md — marks artifact.executionDeferred as deprecated
in v0.51.0 (planned removal v0.53.0) and points to plan.skippedSkills
as the replacement.

Closes documentation gap for PR #865 (A2-fix-1).

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

* docs: tighten executionDeferred deprecation + troubleshooting

- Fix the deprecation narrative for `debug.executionDeferred`: the
  replacement is the new `debug.execution` trace (introduced in v0.51.0
  / A2-1), not `plan.skippedSkills`. Migration snippet now shows both
  the execution trace check and the skippedSkills check side by side.
- Fix the heading anchor: the deprecation header is now
  `output-artifact-field-debugexecutiondeferred-v0510`.
- In troubleshooting.md, code-format every reference to skill metadata
  (`inputContext: ['diff']`, `--context`, schema field names) so the
  prose does not look like Markdown links.
- Fix the relative path to the CLI spec (`../../pages/...` from
  `docs/review/`).
- Note explicitly that the v0.51.0 `alwaysInclude: ['diff']` semantics
  protect the diff context from being stripped by `--context tests`.

No code changes.

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 21, 2026
… A2-fix-2) (#869)

Same silent-skip pattern as A2-fix-1: runReviewPlan never forwarded
`availableDependencies` to buildExecutionPlan, so any skill that declared
a dependency (e.g. `code_search`, `test_runner`) was always selectable
regardless of whether the dependency was actually wired in the runtime.

What changed
- Move resolveAvailableDependencies + dependencyStubs to src/lib/utils.mjs
  so the helper is now shared between local-runner and review-plan
  (mirrors the A2-fix-1 split of resolveAvailableContexts).
- runReviewPlan accepts a new availableDependencies option and forwards
  the resolved value (or null = disabled sentinel) to buildExecutionPlan.
- CLI passes parsed.availableDependencies through so `--dependency` and
  RIVER_AVAILABLE_DEPENDENCIES / RIVER_DEPENDENCY_STUBS=1 work on the
  exec path.
- 4 new unit tests cover null default, explicit arg, env var, and stubs.
- runners/github-action/dist rebuilt with Node 22.22.2.

Out of scope (Codex silent-skip list, follow-ups remaining):
- fileTypes / relatedADRs / reviewMode propagation
- --plan replay context-snapshot drift

Follows: #864 (A2-1) and #865 (A2-fix-1).

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

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]>
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