fix: Two pipeline bugs affecting rules loading and acceptance rate#369
Conversation
1. orchestrator.ts: Use input.repoPath for loadReviewRules/loadLearnedPatterns - Was using process.cwd() which fails in CI/MCP with different cwd - Now falls back to process.cwd() only if repoPath is undefined 2. quality-tracker.ts: Fix headAcceptanceRate denominator - Was dividing by issuesRaised (includes non-discussed issues) - Now divides by totalInDiscussion (only discussed issues) - Prevents penalizing thorough reviewers who raise issues below threshold Fixes: #302 Fixes: #303
📝 WalkthroughWalkthroughTwo bug fixes applied: corrected Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/core/src/pipeline/orchestrator.ts (1)
530-540:⚠️ Potential issue | 🟡 MinorThe orchestrator changes are correct, but callers need updating for full feature support.
The fix correctly respects
input.repoPathwhen provided and falls back toprocess.cwd(). However, not all callers pass it:
- CLI (packages/cli/src/index.ts): ✓ Detects and passes
repoPathvia git root detection- GitHub Action (packages/github/src/action.ts:88): ✗ Only passes
{ diffPath: inputs.diff }- MCP (packages/mcp/src/helpers.ts:26): ✗ Only passes
diffPathand options- TUI (packages/tui/src/screens/PipelineScreen.tsx:32): ✗ Only passes
diffPathThe orchestrator change works for CLI users, but GitHub Action and MCP—the environments mentioned in issue
#302—will continue to useprocess.cwd()unless updated to detect and passrepoPath.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/src/pipeline/orchestrator.ts` around lines 530 - 540, Callers of the orchestrator must pass the repoPath detected from the git root (as the CLI already does) so the orchestrator's use of input.repoPath ?? process.cwd() works correctly; update the GitHub Action, MCP helpers, and TUI entry points that currently call the pipeline/orchestrator with only { diffPath } to detect the repository root (use the same git root detection logic used in the CLI) and include repoPath in the input object passed to the orchestrator (the same input shape that loadReviewRules and loadLearnedPatterns expect), ensuring every invocation provides repoPath when available.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/core/src/pipeline/orchestrator.ts`:
- Around line 530-540: Callers of the orchestrator must pass the repoPath
detected from the git root (as the CLI already does) so the orchestrator's use
of input.repoPath ?? process.cwd() works correctly; update the GitHub Action,
MCP helpers, and TUI entry points that currently call the pipeline/orchestrator
with only { diffPath } to detect the repository root (use the same git root
detection logic used in the CLI) and include repoPath in the input object passed
to the orchestrator (the same input shape that loadReviewRules and
loadLearnedPatterns expect), ensuring every invocation provides repoPath when
available.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 857a6ed4-ff94-41ce-9f99-06031c7e1f01
📒 Files selected for processing (2)
packages/core/src/l0/quality-tracker.tspackages/core/src/pipeline/orchestrator.ts
justn-hyeok
left a comment
There was a problem hiding this comment.
LGTM! headAcceptanceRate denominator fix correct. repoPath fallback preserves compat. Follow-up: update Action/MCP callers.
Fix two high-priority pipeline bugs:
1. orchestrator.ts: Rules not found in CI/MCP (Issue #302)
2. quality-tracker.ts: headAcceptanceRate penalizes thorough reviewers (Issue #303)
Fixes: #302
Fixes: #303
Summary by CodeRabbit
Bug Fixes