Skip to content

feat: vault hygiene — recalibrate oversized, add stub detector, vault-gardener remediation skill - #8

Merged
cizer merged 3 commits into
mainfrom
feat/vault-hygiene-gardener
Jun 21, 2026
Merged

feat: vault hygiene — recalibrate oversized, add stub detector, vault-gardener remediation skill#8
cizer merged 3 commits into
mainfrom
feat/vault-hygiene-gardener

Conversation

@cizer

@cizer cizer commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Pivots from the speculative durability track (Phase 3+) to practical vault hygiene that delivers value now. Grounded in measurements against the real ~1000-note vault.

Move 1 — make the audit worklist trustworthy

Recalibrate oversized. It flagged 35% of the vault because the 1200-token threshold sat at the median note size (token percentiles: p50 750, p90 3700, p95 5150). Default raised to 4000 tokens, so it flags the genuinely-bloated top ~7% (350 → 78 on the real vault). Tunable per vault.

Add a conservative stub detector. Near-empty notes worth merging or archiving, kept high-confidence to avoid new noise: body under stub_threshold tokens (default 20) AND zero outbound resolved links AND not under the expected-orphan folders. On the real vault this is a tight 33 findings.

Move 2 — remediation, not just detection (vault-gardener skill)

The detectors surfaced ~600 findings with no way to act on them. vault-gardener is the remediation counterpart: reads the hebb audit worklist and, one finding at a time, proposes a propose-diff-confirm fix, applies only after confirmation, and never deletes (archive-with-tombstone, git-backed, reversible). Generic; defers conventions to the vault's CLAUDE.md.

Category playbook (highest-confidence first): ambiguous_link (disambiguate, 142 on the real vault), para_drift (archive done projects with a tombstone), stub (merge or archive). Dangling/unresolved links are left alone by default (intentional future-notes); oversized splitting is the heaviest case and on request only. Regulated/compliance notes are never archived or consolidated without explicit per-note confirmation.

Auto-embeds and auto-installs via the existing plugin/skills enumeration.

Real-vault audit, before → after

Type Before After
oversized 350 (35%) 78 (7%)
stub n/a 33 (new)
ambiguous_link 142 142 (now remediable via gardener)
para_drift 10 10

Deferred (deliberately)

Durability / Phase 3 (speculative, two-week experiment), dedup (needs the precision test first), broken-attachment and tag-hygiene linters (low volume / tags barely used on this vault).

Full suite green; verified end-to-end against the real vault (read-only, temp index).

🤖 Generated with Claude Code

cizer and others added 2 commits June 20, 2026 15:28
The audit worklist was untrustworthy because oversized flagged 35% of the real
vault: its 1200-token threshold sat near the median note size. Raise the default
size_threshold to 4000 tokens (token percentiles on the real vault: p50 750,
p90 3700, p95 5150), so it flags the genuinely-bloated top ~7% (350 -> 78 on
that vault) rather than the median. Tunable per vault.

Add a `stub` detector for near-empty notes worth merging or archiving, kept
high-confidence to avoid new noise: a note is a stub only when its body is below
stub_threshold tokens (default 20) AND it has zero outbound resolved links
(a thin note that links out is an intentional map/index stub) AND it is not
under the expected-orphan folders (Journal/Notes/Archives). On the real vault
this is a tight 33 findings.

Both are content detectors, unaffected by exclude_from_graph. Documented in
CONFIG.md and the [health] config stanza.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The audit detectors surface findings but nothing acted on them, leaving a
guilt-list. vault-gardener is the remediation counterpart: it reads the
`hebb audit` worklist and, one finding at a time, proposes a concrete
propose-diff-confirm fix, applies only after confirmation, and never deletes
(archive-with-tombstone, git-backed, reversible). It is generic and defers
folder/convention specifics to the vault's CLAUDE.md.

Category playbook, highest-confidence first: ambiguous_link (disambiguate to a
single target), para_drift (move done projects to the archive with a tombstone),
stub (merge into a related note or archive). Dangling/unresolved links are left
alone by default (usually intentional future-notes); oversized splitting is the
heaviest case and only on request. Regulated/compliance notes are never archived
or consolidated without explicit per-note confirmation.

Auto-embeds and auto-installs via the existing plugin/skills enumeration; plugin
README skill list refreshed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR shifts vault-health work toward practical “vault hygiene” by (1) recalibrating the oversized detector so it flags truly large notes, (2) adding a conservative stub detector for near-empty notes, and (3) introducing a vault-gardener skill to remediate audit findings via a confirm-before-apply workflow.

Changes:

  • Raised the default oversized threshold from 1200 → 4000 tokens and updated config/docs/tests accordingly.
  • Added a new stub health detector (near-empty + no outbound resolved links + not under expected-orphan folders), plus CLI/help/type ordering updates.
  • Added a new vault-gardener remediation skill and documented it in the plugin README.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
plugin/skills/vault-gardener/SKILL.md New skill documentation/playbook for remediating hebb audit findings.
plugin/README.md Documents additional shipped skills including vault-gardener.
core/vaultconfig.go Adds stub_threshold config + raises default size_threshold to 4000; updates config writer comments.
core/health.go Adds stub finding type + detectStub implementation and runs it in the health pipeline.
core/health_test.go Updates oversized tests for new default + adds focused stub-detector coverage and recalibration assertions.
core/graph_test.go Adjusts oversized test fixture to exceed the new 4000-token default.
CONFIG.md Updates config reference to new defaults and documents stub_threshold.
cli/health.go Adds stub detector to help text and output ordering.
cli/health_test.go Updates oversized fixture to exceed the new default threshold.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/health.go Outdated
Comment thread core/health.go
Comment thread plugin/skills/vault-gardener/SKILL.md Outdated
- The stub detector ran a COUNT(*) per candidate to check for outbound resolved
  links (an N+1 that would slow `hebb audit` on large vaults). Build the set of
  notes with a resolved outbound link in one query, then test membership in Go.
- Update the Phase 2a comment to list all content detectors (it omitted the new
  stub detector and ambiguous_link).
- vault-gardener skill: "revertable" -> "revertible".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cizer

cizer commented Jun 21, 2026

Copy link
Copy Markdown
Owner Author

Thanks, all three addressed in the latest commit:

  • Stub detector no longer does a COUNT per candidate: the set of notes with a resolved outbound link is built in one query, then checked in Go (no N+1 on large vaults).
  • Phase 2a comment now lists all content detectors (added ambiguous_link and stub).
  • revertable -> revertible in the vault-gardener skill.

Stub detector tests still pass; full suite green.

@cizer
cizer merged commit 06e49cd into main Jun 21, 2026
5 checks passed
@cizer
cizer deleted the feat/vault-hygiene-gardener branch June 21, 2026 13:00
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.

2 participants