[#186] fix: wire --config through dispatch path for update and install#192
Merged
[#186] fix: wire --config through dispatch path for update and install#192
Conversation
- dispatcher.test.ts: test.fails for update + install config forwarding - update/handler.test.ts: custom config, backward compat, missing config - install/handler.test.ts: custom config, backward compat, missing config Refs: #186
- DispatchContext: add config?: string - resolveOptions: spread config to handler options - cli.ts: pass normalizedOptions.config to dispatch context - dispatcher tests: test.fails → test (bug fixed) Refs: #186
- update/parser.ts: add config?: string to ParseUpdateOptions - install/parser.ts: add config?: string to ParseInstallOptions Refs: #186
rucka
commented
Apr 11, 2026
Collaborator
Author
rucka
left a comment
There was a problem hiding this comment.
Code Review: [#192] fix: wire --config through dispatch path for update and install
Review Information
PR Number: #192
Author: rucka
Reviewer: AI (pair-process-review)
Review Date: 2026-04-11
Story: #186 — Bug: pair update ignores --config
Review Type: Bug Fix
Review Summary
Overall Assessment
- Approved — Ready to merge
Key Changes Summary
Wires the -c/--config CLI option through the dispatch path (DispatchContext → resolveOptions → handler options) so it reaches handleUpdateCommand and handleInstallCommand. The handlers already supported options.config but the dispatcher silently dropped it.
Business Value Validation
Users can now override registry behavior per-project via pair update -c ./pair.config.json. Config resolution matches pair install and pair package exactly.
Code Review Checklist
Functionality Review
- Requirements Met — All 5 AC implemented and tested
- Business Logic — Config forwarding follows same conditional-spread pattern as existing fields
- Integration — Handlers already had
loadConfigWithOverrideswiring; dispatch path was the only gap - Error Handling — Missing config file error propagates from
loadConfigWithOverrides(no new error handling needed) - Performance — No impact; one additional field spread
Code Quality Assessment
- Readability — Changes are minimal and self-documenting
- Maintainability — Follows exact same pattern as
httpClient,cliVersion,baseTargetinresolveOptions - Naming —
configPathin cli.ts,configin DispatchContext — clear and consistent - Complexity — Trivial; 4 one-line additions in production code
Technical Standards Compliance
- Style Guide — Matches existing conditional-spread pattern
- Architecture — No architectural changes
- Dependencies — No new dependencies
Testing Review
Test Coverage Assessment
- Dispatcher tests — Config forwarding for both update and install commands
- Handler tests (update) — Custom config override, base config fallback, missing config error
- Handler tests (install) — Custom config override, base config fallback, missing config error
- Integration — End-to-end dispatcher → handler with custom registry target verification
- Backward compat — No-config path unchanged; all 742 existing tests pass
Test Quality
- Tests are well-structured with clear
#186annotations - Each test verifies observable behavior (file at custom target path) not implementation details
- Error case uses
.rejects.toThrow(/Failed to load custom config/)— appropriate regex match
Security Review
- Config path is user-provided CLI input;
loadConfigWithOverridesalready validates - No new attack surface
Risk Assessment
| Risk | Impact | Probability | Mitigation |
|---|---|---|---|
| Breaking existing tests | Medium | None | 742 tests pass unchanged |
| Config merge order surprise | Low | Low | Same loadConfigWithOverrides semantics as install/package |
Positive Feedback
- Test-first approach: Failing tests created before fix (T-2 → T-1 → T-3 → T-4) — follows bug-fix workflow correctly
- Minimal change: 4 production lines changed, comprehensive test coverage
- Parity: Update and install config paths are now symmetrical
- PR description: Excellent — clear story context, AC mapping, and reviewer guide
Issues
Critical: 0 | Major: 0 | Minor: 0
REVIEW COMPLETE:
├── PR: #192: [#186] fix: wire --config through dispatch path
├── Story: #186: Bug: pair update ignores --config
├── Decision: APPROVED
├── Issues: critical: 0 | major: 0 | minor: 0
├── Quality: PASS — all gates
├── DoD: 5/5 AC met
├── Adoption: Level 4 — no concerns
├── Debt: 0 items flagged
└── Report: Posted as PR comment
Note: PR is currently marked as draft. Mark as ready for review before merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Information
PR Title: [#186] fix: wire --config through dispatch path for update and install
Story/Epic: #186
Type: Bug Fix
Priority: P0
Labels: bug
Summary
What Changed
Wired the
-c/--configCLI option through the dispatch path so it reacheshandleUpdateCommandandhandleInstallCommand. The handlers already supportedoptions.configbut the dispatcher silently dropped it.Why This Change
pair update -c ./pair.config.jsonignored the custom config — registries always resolved from the packaged base config. The same bug affectedpair install. Users could not override registry behavior (e.g.skills.flatten=false) per-project.Story Context
User Story: As a CLI user running
pair updatein a consumer repo, I wantpair updateto honor-c/--config <path>and auto-load projectpair.config.jsonso that I can override registry behavior per-project.Acceptance Criteria:
Changes Made
Implementation Details
DispatchContextinterface: addedconfig?: stringresolveOptions: spreadconfigto handler optionscli.tsregisterCommandFromMetadata: extractnormalizedOptions['config']and pass to dispatch contextParseUpdateOptions: addedconfig?: stringfor interface completenessParseInstallOptions: addedconfig?: stringfor interface completenessFiles Changed
apps/pair-cli/src/commands/dispatcher.ts— DispatchContext + resolveOptionsapps/pair-cli/src/cli.ts— config passthrough in registerCommandFromMetadataapps/pair-cli/src/commands/update/parser.ts— ParseUpdateOptionsapps/pair-cli/src/commands/install/parser.ts— ParseInstallOptionsapps/pair-cli/src/commands/dispatcher.test.ts— config forwarding tests (update + install)apps/pair-cli/src/commands/update/handler.test.ts— config override testsapps/pair-cli/src/commands/install/handler.test.ts— config override testsTesting
Test Coverage
Test Results
Testing Strategy
loadConfigWithOverrideserror propagation verifiedQuality Assurance
Code Quality Checklist
Deployment Information
Deployment Notes
Risk Assessment
Technical Risks
loadConfigWithOverridessemantics as install/packageReviewer Guide
Review Focus Areas
dispatcher.ts— verifyconfigis spread correctly inresolveOptionscli.ts— verifynormalizedOptions['config']extraction and forwardingTesting the Changes
Closes #186