Conversation
…k checks Three more classes of doctor noise cleared after PR #25: 1. skill_symlinks shadowed dump — the check classifies any symlink that doesn't resolve into the current repo as foreign, so users with a global install at ~/.pbrain-repo who also have a dev clone elsewhere saw all 26×3 = 78 skills flagged as "shadowed by other plugins" on every doctor run. Added an `ours-elsewhere` state that walks up from the resolved symlink target looking for package.json with name: "pbrain" — deterministic detection, works for any pbrain checkout location. Doctor now reports `installed — claude: 26, cursor: 26, windsurf: 26 (symlinks resolve to sibling checkout at <path>)` instead. 2. mece_overlap between maintain and citation-fixer on trigger "citation audit" — removed from maintain since citation-fixer is the specialized skill for that phrase. maintain still handles citation audits as part of broader health runs via its description. 3. dry_violation warnings on 7 brain-writing skills (ingest, enrich, setup, signal-detector, idea-ingest, media-ingest, meeting-ingestion) that inlined citation/Iron-Law rules without referencing the canonical skills/conventions/quality.md. Added a single `> **Quality rules:**` line next to each skill's existing filing-rule reference. The inline recap stays (it's useful local guidance); the convention file is marked as the source of truth. Health score on a fresh install goes from 80 → 95. The only remaining [WARN] on this brain is `embeddings` (real, user-actionable via `pbrain embed --stale`). Test coverage: two new cases for scanTargets — symlink into sibling pbrain checkout (ours-elsewhere) and symlink into non-pbrain tree (still foreign-symlink). Full unit suite: 979 pass, 0 fail.
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.
Summary
Round 2 of the doctor-cleanup work started in #25. Three more false-positive classes eliminated:
1.
skill_symlinksshadowed dump (78-line WARN → 1-line OK)The symlink scanner classifies any symlink that doesn't resolve into the current repo root as
foreign-symlink, so any user with a global install at~/.pbrain-repowho also has a dev clone sees a massive "shadowed by other plugins: claude:X, cursor:X, windsurf:X" dump for all 26×3 = 78 skill entries on every doctor run — even though the skills are correctly installed and firing.Added an
ours-elsewherestate toscanTargets. When the resolved symlink target has an ancestorpackage.jsonwithname: "pbrain", it's classified asours-elsewhere(a valid install pointing at a sibling checkout) rather thanforeign-symlink. Detection is deterministic viapackage.json, not a heuristic.Doctor message now reads:
installed — claude: 26, cursor: 26, windsurf: 26 (symlinks resolve to sibling checkout at /Users/danziger/.pbrain-repo).2.
mece_overlapbetweenmaintainandcitation-fixerBoth skills declared the trigger
"citation audit". Removed it frommaintain—citation-fixeris the specialized skill for that phrase and should win the route.maintainstill covers citation audits as part of broader health checks via its description.3.
dry_violationon 7 brain-writing skillsingest,enrich,setup,signal-detector,idea-ingest,media-ingest,meeting-ingestioninlined citation format + Iron-Law rules without referencingskills/conventions/quality.md. Added a single> **Quality rules:**line alongside each skill's existing filing-rule reference. Inline recap stays (useful local guidance); convention file is marked as the source of truth.Result
Health score on a fresh install: 80 → 95. Only remaining
[WARN]isembeddings(real, user-actionable:pbrain embed --stale).Before:
After:
Test plan
bun test test/install-skills.test.ts— 20 pass, 0 fail (2 new tests for ours-elsewhere / foreign tree)pbrain doctoron the real brain: 95/100 health, 7 OK + 1 WARN (embeddings)pbrain doctor --fast: resolver_health green, skill_conformance green, skill_symlinks green