Repository navigation
refactor(doctor): share Claude directory problem formatting - #132974
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 9:28 PM ET / August 30, 2026, 01:28 UTC. ClawSweeper reviewWhat this changesThe PR replaces two private Claude CLI doctor directory-diagnostic formatters with one formatter whose callers supply the appropriate label. Merge readinessKeep open: current main still has the duplicated private formatters, while this focused refactor preserves their health-state output and caller-specific labels. No blocking review finding was identified; normal maintainer handling and completion of exact-head checks remain appropriate. Priority: P3 Review scores
Verification
How this fits togetherClaude CLI doctor checks workspace and Claude project directories, then turns unhealthy states into user-facing diagnostic lines and targeted fix hints. This refactor sits between those health probes and the doctor command’s rendered output. flowchart LR
A[Claude directory paths] --> B[Directory health probes]
B --> C[Diagnostic formatter]
C --> D[Workspace and project labels]
D --> E[Doctor output]
E --> F[Fix hints]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -20. Total -20 across 1 file. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the module-local consolidation once exact-head checks are green, retaining the two caller-owned labels and the existing distinct fix-hint policy. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-neutral refactor, not a reported runtime defect. Source comparison establishes the relevant output equivalence without a separate failure reproduction. Is this the best way to solve the issue? Yes. A single private formatter removes the duplicated policy while preserving labels at the only two callers; retaining separate wrappers would leave the drift risk intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ccecf46e1f9a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper disposition for exact head
Proceeding with the normal merge verification. |
|
Merged via squash.
|
What Problem This Solves
Claude CLI doctor diagnostics had two copies of the same directory-problem formatting policy. Keeping workspace and project-directory wording in separate implementations made future drift possible.
Why This Change Was Made
The doctor command now uses one private directory-problem formatter while each call site continues to own its exact label. Healthy/missing suppression, path shortening, diagnostic ordering, and fix-hint behavior are unchanged.
The canonical owner remains
src/commands/doctor-claude-cli.ts; no shared utility, public API, config, persistence, or compatibility surface is introduced.User Impact
No user-visible behavior change. Claude CLI doctor output remains byte-for-byte equivalent for the affected directory health states.
Evidence
src/commands/doctor-claude-cli.test.ts: 8/8 passed.oxfmt --check: passed.pnpm tsgo:core: passed.git diff --check: passed.check-changedpassed its applicable ratchets, then its dead-export scan could not load tracked UI config files omitted by the sparse worktree. This draft will remain unready until the hydrated native review lane resolves that environment-only gap.Root cause: duplicated presentation policy inside the Claude CLI doctor owner.
Canonical fix: one private formatter parameterized by directory path, health, and caller-owned label.
Removed paths: the separate workspace and Claude project-directory formatter implementations.
Sibling coverage: both workspace and project-directory call sites use the canonical formatter; their distinct fix-hint policies remain untouched.