feat(doctor): project-side symlink + @path integrity checks (PER-193)#155
Conversation
…egrity checks (PER-193) Add four new check categories to abc doctor, implemented in the setup domain: 1. Symlink hygiene under .agentic-beacon/artifacts/: - Dangling symlinks (target missing in warehouse) - Symlinks pointing outside the configured warehouse path - Regular files where symlinks should be 2. @path reference integrity in project-committed files: - Parse @path references from CLAUDE.md and opencode.json - Verify each target exists locally - Classify cause: missing-from-beacon.yaml / wired-directly / genuinely broken - Flag warehouse-only absolute paths that break for teammates 3. Stale beacon.yaml glob detection: - Entries with glob characters that expand to zero warehouse files 4. Sanity checks: - Warehouse path not a git working tree - Platform warning on Windows - Minimal CLI wiring in cli/diagnostics.py (single domain call) - 31 unit tests with fixture project layouts - Integration test seeds broken links and confirms each is caught - Backward-compatible: existing checks and output format preserved
OpenCode ReviewModel: Reviewing the attached diff against the project rules and local context artifacts, focusing on correctness and architecture issues only. Findings
Open Questions
Notes
Token UsageInput tokens: |
Supervisor triage — bot round 1Bot reviewed commit: Findings
Notes / residual risks
Dispatching round 2. 🤖 diligent-supervisor |
Finding 1 – Glob-managed references now matched via fnmatch in _is_wired_in_beacon, fixing false unmanaged-reference warnings for glob entries like contexts/*.md. Finding 2 – Stale-glob check now uses SyncEngine.expand_glob (files-only semantics), so directory-only glob matches are correctly flagged as stale.
OpenCode ReviewModel: I’ll check the repository review context files first, then evaluate only the attached diff for concrete merge-blocking or actionable issues. Findings
Open Questions
Notes
Token UsageInput tokens: |
Supervisor triage — bot round 2Bot reviewed commit: Findings
Notes
Dispatching round 3. 🤖 diligent-supervisor |
OpenCode ReviewModel: Findings
Open Questions
Notes
Token UsageInput tokens: |
Supervisor triage — bot round 3Bot reviewed commit: Findings
Dispatching round 4 for the one verified finding (absolute-path message). 🤖 diligent-supervisor |
`_classify_reference` labelled every absolute @path reference as a "Warehouse-only absolute path" without doing any warehouse-relation check. The headline over-claimed — an absolute path could point anywhere. Reword to "Non-portable absolute path" — accurate for any absolute reference in a project-committed harness config. Still severity=error: absolute paths break for teammates with different home directories. Applied directly by the diligent-supervisor: the opencode/kimi delegate hit two consecutive transport-level failures (empty `!! ERROR {}`) during round-4 dispatch. The fix is a fully-specified two-string change. Addresses opencode-review PR #155 round-3 finding (the one verified-real finding of four — the other three were false alarms, see PR triage). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
OpenCode ReviewModel: Reviewing the attached diff against the project architecture and doctor command behavior. Findings
Open Questions
Notes
Token UsageInput tokens: |
Supervisor triage — bot round 4 (final)Bot reviewed commit: Findings
ResolutionBoth findings need the same refactor — extract glob expansion into a shared The opencode/kimi delegate was transport-down (two consecutive PR is READY for human review/merge. All verified functional findings from rounds 1–3 are fixed; CI green; the feature is smoke-tested against the live project. The two round-4 findings are non-functional quality improvements tracked separately. 🤖 diligent-supervisor |
Summary
Extends
abc doctorwith project-side health checks (warehouse-side checks already shipped viaabc warehouse lint). Closes the project-side gap from PER-108 and absorbs PER-32's@pathvalidation scope.New domain module
beacon/domains/setup/diagnostics.pyimplementing 5 checks via aDoctorIssuedataclass:.agentic-beacon/artifacts/): dangling targets, targets outside warehouse, regular files where symlinks should be.@pathreference integrity inCLAUDE.mdand.opencode/opencode.json: parses references, classifies as managed-by-beacon / wired-directly / broken.beacon.yamlglobs: entries whose globs expand to zero warehouse files.CLI handler (
cli/diagnostics.py) stays thin — callsrun_project_health_checksand renders. Architecture test (CLI layer rule) preserved.Test plan
pytest libs/beacon/tests/unit/domains/setup/test_diagnostics.py libs/beacon/tests/integration/test_doctor_command.py libs/beacon/tests/unit/test_architecture.py→ 51 passed, 6 skipped (BEACON_OFFLINE env)ruff checkon touched files → cleanabc doctoragainst the agentic-beacon project itself produces actionable findings🤖 Generated by diligent-supervisor / delegate-to-oc (kimi-for-coding/k2p6)