Skip to content

refactor(status): decouple status from doctor internals#52

Merged
synsoftworksdev merged 1 commit intomainfrom
fix/status-doctor-decoupling
Apr 15, 2026
Merged

refactor(status): decouple status from doctor internals#52
synsoftworksdev merged 1 commit intomainfrom
fix/status-doctor-decoupling

Conversation

@synsoftworksdev
Copy link
Copy Markdown
Member

Summary

Harden the gitrole status path by decoupling it from doctor internals while
preserving current public behavior.

Changed

  • add src/application/alignment.ts as a small shared alignment evaluator
  • move role matching into a neutral shared primitive
  • add summarizeAlignment(...) to compute:
    • overall
    • commit
    • remote
    • auth
      directly from observed state, matched role, and repo policy
  • rework src/application/use-cases/status.ts so it no longer calls doctor() or groups doctor.checks by label
  • keep doctor as the detailed diagnosis surface while reusing the shared role-matching primitive
  • add focused regression coverage showing status warnings are derived from observed state directly, not diagnosis label/check text

Verification

  • npm run build
  • npm test
  • npm run test:e2e
  • npm run test:release

Harden the status path so `gitrole status` and `status --short` no longer
depend on diagnosis check-label internals.

Also:
- add a small shared alignment evaluator in `src/application/alignment.ts`
- move role matching into a neutral shared primitive
- compute `overall`, `commit`, `remote`, and `auth` directly from observed state, matched role, and repo policy
- rework `status` to build from observed state and the new alignment summary instead of calling `doctor()`
- keep `doctor` as the detailed explanation surface while reusing the shared role-matching seam
- add regression coverage proving status summary behavior is derived from stable evaluation logic rather than diagnosis labels

Verified with:
- npm run build
- npm test
- npm run test:e2e
- npm run test:release
@synsoftworksdev synsoftworksdev self-assigned this Apr 15, 2026
@synsoftworksdev synsoftworksdev merged commit 3145241 into main Apr 15, 2026
4 checks passed
@synsoftworksdev synsoftworksdev deleted the fix/status-doctor-decoupling branch April 15, 2026 20:26
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