perf(doctor): delegate 8 schema checks to onebrain doctor --json · rm dead workflows · v3.0.3#187
Merged
Conversation
… dead workflows · v3.0.3
doctor SKILL.md (290 → 205 lines · -29% / -85 lines):
- Step 2a now runs `onebrain doctor --json` (or `--fix --json` with --fix flag)
and parses the stable JSON envelope: {ok, summary{total/errors/warnings/passing},
checks[{check, status, message, details, hint, fix?}]}. The 8 built-in CLI
checks (vault.yml, vault.yml-keys, folders, plugin-files, settings-hooks,
orphan-checkpoints, qmd-embeddings, claude-settings) are now Rust-native single
subprocess instead of skill-side reimplementation.
- Step 2b retains skill-only checks the CLI doesn't cover: broken wikilinks,
orphan notes, stale memory/ files, MEMORY.md size, inbox backlog, log folder
size, 07-logs structure, scheduler health (errors/drift/one-shot), pause-thread
state (orphan/missing/idle pointer), memory health checks.
- Step 4 (--fix) delegates CLI fix recipes to `onebrain doctor --fix --json` and
retains skill fix passes (wikilink fuzzy-match, MEMORY.md migration) via
references/autofix-procedures.md.
- Two-source architecture explicit in the skill body so future contributors
know where each check lives.
GitHub workflows cleanup:
- rm .github/workflows/ci.yml (`bun install` + tsc + biome + bun test on deleted
src/) — would fail on every PR now.
- rm .github/workflows/release.yml (binary build via bun --compile from src/
+ npm publish) — release pipeline moved to onebrain-ai/onebrain-cli in v3.0.0.
- Plugin repo has no test/build surface anymore. CLI release workflows live at
onebrain-ai/onebrain-cli/.github/workflows/ now.
plugin.json bump 3.0.2 → 3.0.3 (skill update per repo convention).
CHANGELOG v3.0.3 entry: 4 bullets within 8-bullet cap.
Why CLI delegation: WebFetch / shell text parsing of doctor's human format is
fragile. --json is the stable v3.x contract (frozen, declared in CLI CHANGELOG).
Single subprocess call beats N file reads + manual schema validation.
Tested locally: `onebrain doctor --json` returns expected envelope shape
({ok:true, summary:{total:8...}, checks:[...]}) on this vault. 8 checks total,
0 errors, 1 warning (qmd-embeddings: 584 indexed · 4 unembedded — advisory).
Round 1 (broad) findings: - HIGH: re-add Plugin install path check (cache/ detection) — CLI plugin-files only validates skills/agents/INSTRUCTIONS counts, NOT installed_plugins.json registry. Verified via live `onebrain doctor --json` on this vault. - MED: re-add AUTO-SUMMARY.md existence check — same root cause; CLI doesn't inspect individual skill reference files. Both checks restored to Step 2b. Round 2 (dead code) findings: - IMP: CONTRIBUTING.md lines 12 + 359 — replaced "TypeScript / Bun source under src/" / "(src/)" pointers with Rust + onebrain-ai/onebrain-cli link. - IMP: .claude/settings.json — removed `Bash(bun *)` broad permission; scoped `Bash(bun install -g @onebrain-ai/cli*)` retained for CLI bootstrap. Round 3 (inconsistency) findings: - HIGH: README.md line 657 license footer — `[MIT](LICENSE)` left over from pre-v3.0.1 relicense → corrected to `[AGPL-3.0-only](LICENSE)`. - HIGH: doctor SKILL.md line 51 brew install command — two-step `brew tap + brew install onebrain` diverged from the tap-path one-liner used everywhere else (README, CONTRIBUTING, CHANGELOG v3.0.0 entry). Unified to `brew install onebrain-ai/onebrain/onebrain`. Round 4 (edge cases) findings: - CRITICAL: Step 2a exit-code logic was wrong — old wording would mis-detect `exit 1 + valid JSON` (the normal "issues found" path) as "CLI not installed" and fall back to skill-only. Rewrote detection logic in 3 ordered steps: PATH lookup first, then parse JSON regardless of exit code, only treat as absent if PATH lookup fails or output doesn't parse. - IMP: malformed-JSON fallback now inline in Step 2a (was Gotcha-only). - IMP: defensive handling of optional `details`/`hint`/`fix` fields documented inline. - IMP: Step 3 report omits empty sections entirely (`--vault` flag suppresses ⚙️ Config; `--config` suppresses 📁 Vault + 🧠 Memory; sections with 0 findings drop their header). CHANGELOG: - v3.0.3 bullet 4: noted `--vault`/`--config` flag semantics tightened (was previously claimed as "no behavior changes" — actually `--vault` now skips the CLI subprocess explicitly). User Windows /update v3.0.2 report: - Stale PLUGIN-CHANGELOG.md at vault root after rename — surfaces because `vault-sync` doesn't delete files renamed-away from upstream. Added a skill-side doctor check to flag this until the CLI fix lands (tracked for v3.0.x cycle). Branch protection verified safe: `gh api repos/.../branches/main/protection` shows `no required_status_checks` — workflows deletion is non-blocking for future PRs. SKILL.md size: 290 (origin/main) → 205 (initial trim) → 225 (after re-adds). Still -22% net vs origin/main with all coverage restored.
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
Two post-trim cleanups bundled:
/doctorskill leverages the Rust CLI —onebrain doctor --jsonreplaces 8 schema-validation checks the skill used to implement manually. Skill SKILL.md drops 290 → 205 lines (-29%)..github/workflows/deleted —ci.yml(bun + tsc + biome + bun test) andrelease.yml(bun-build CLI binary + npm publish) targeted the v2.x TypeScript source removed in v3.0.2 (PR chore: plugin-only trim · CHANGELOG split · README update (v3.0.2) #185). Both would fail on the next CI run.Files
.claude/plugins/onebrain/skills/doctor/SKILL.md--json, retains 11 skill-only checks (wikilinks, memory, scheduler, pause, etc.).claude/plugins/onebrain/.claude-plugin/plugin.jsonCHANGELOG.md.github/workflows/ci.yml.github/workflows/release.yml/doctor architecture (post-PR)
onebrain doctor --json)--fix --json)references/autofix-procedures.md)Why
WebFetch / shell text parsing of
onebrain doctor's human format is fragile.--jsonis the stable v3.x contract (frozen, see CLI CHANGELOG). One subprocess beats N reads + manual schema validation.GitHub workflows: plugin repo has no test/build surface anymore. CLI release pipeline lives at
onebrain-ai/onebrain-cli/.github/workflows/(full release.yml builds 7 platform binaries).Test plan
onebrain doctor --jsonon this vault returns expected envelope (8 checks · 0 errors · 1 warning).requires.cli >=3.0.0retained./doctoron this vault uses the new flow.Out of scope (deferred to tomorrow per user)
onebrain orphan-scan --list --jsonflag for /wrapup,onebrain update --check-plugin --jsonfor /update). Today: skill-only optimization.