Repository navigation
Gate adapter directives on pack quality - #320
Conversation
Closes #312 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR implements confidence-gated directive-adapter guidance for context packs. It adds logic to decide when to emit strong behavioral instructions (like "do not search broadly") based on pack confidence and first-read grounding, updates Claude and Copilot renderers to branch wording accordingly, and adds tests validating gating across low/high/missing semantic coverage. ChangesDirective-Adapter Confidence Gating
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/unit/context-pack-adapter-gating.test.ts (1)
252-283: ⚡ Quick winAdd a high-confidence Copilot assertion to complete branch coverage.
This suite validates low-confidence Copilot behavior, but it doesn’t assert the high-confidence Copilot directive path. Adding one test that expects the strong “read first” guidance would close a likely regression gap in the new gating logic.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/context-pack-adapter-gating.test.ts` around lines 252 - 283, The test suite covers low-confidence Copilot behavior but lacks a parallel high-confidence Copilot case; add a new it(...) that mirrors the high-confidence Claude test but sets format: 'copilot', uses highConfidenceCoverage() and buildImplementationPackGuidanceMock.mockReturnValue(highConfidenceImplementation()), calls runContextPackCommand(...) and asserts the output contains the strong "Read `src/infrastructure/context-pack-command.ts` first to anchor the change:" guidance (and does not contain the cautious verification message), so branch coverage for Copilot high-confidence gating in context-pack-adapter-gating.test.ts is complete.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/infrastructure/context-pack-command.ts`:
- Around line 728-733: The gating function useDirectiveAdapterGuidance currently
ignores schema.missing_semantic; update it to require no missing semantic
evidence before allowing directive-mode guidance by adding a check that
schema.missing_semantic.length === 0 alongside the existing checks (confidence
>= ADAPTER_DIRECTIVE_CONFIDENCE_THRESHOLD, schema.missing_context.length === 0,
hasGraphBackedWorkflowCenter(schema), hasGroundedFirstRead(schema)), so
directive guidance is suppressed when semantic coverage is incomplete.
---
Nitpick comments:
In `@tests/unit/context-pack-adapter-gating.test.ts`:
- Around line 252-283: The test suite covers low-confidence Copilot behavior but
lacks a parallel high-confidence Copilot case; add a new it(...) that mirrors
the high-confidence Claude test but sets format: 'copilot', uses
highConfidenceCoverage() and
buildImplementationPackGuidanceMock.mockReturnValue(highConfidenceImplementation()),
calls runContextPackCommand(...) and asserts the output contains the strong
"Read `src/infrastructure/context-pack-command.ts` first to anchor the change:"
guidance (and does not contain the cautious verification message), so branch
coverage for Copilot high-confidence gating in
context-pack-adapter-gating.test.ts is complete.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 10b08cfe-e59b-4c65-a325-47ddced7b9ce
📒 Files selected for processing (3)
src/infrastructure/context-pack-command.tstests/unit/context-pack-adapter-gating.test.tstests/unit/context-pack-command.test.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Closes #312
Summary by CodeRabbit
Refactor
Tests