feat(doctor): add hook-attachment-valid check (gt-h6eq.2)

Add doctor check to verify that attached molecules exist and are not closed.
Detects when a hook's attached_molecule field points to a non-existent or
closed issue, which can leave agents with stale work assignments.

- Check: hook-attachment-valid
- Error if: Hook's attached_molecule field points to non-existent or closed issue
- Fix: Automatically detaches invalid molecules when run with --fix

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-23 11:34:38 -08:00
parent a473a35fe9
commit 78a20f0aad
3 changed files with 312 additions and 0 deletions

View File

@@ -96,6 +96,9 @@ func runDoctor(cmd *cobra.Command, args []string) error {
// Lifecycle hygiene checks
d.Register(doctor.NewLifecycleHygieneCheck())
// Hook attachment checks
d.Register(doctor.NewHookAttachmentValidCheck())
// Run checks
var report *doctor.Report
if doctorFix {