From 87bb628ad31cd5ce9ec8caab9f8bef6fbbe86815 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 22 Jul 2026 13:57:54 -0400 Subject: [PATCH] vault-librarian-prompt: rewrite for autonomous tool-enabled cron MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was written for the hermes -z report-only path (no tools). Now that the nightly is a full agent session with tool access: - fix stale paths (vault CLI is on $PATH via Nix, not /var/lib/hermes; use 'vault report --pretty' not the raw python script) - REMOVE the 'git add -A && commit' step — every vault --execute auto-commits per-op, and git add -A would sweep up Ryan's uncommitted journal/Obsidian edits - flag delivery is now TWO places: append a dated section to the 00.01 Inbox note (committed as a single targeted file, safe on a dirty tree), and the agent's final response auto-delivers to the Matrix room --- vault-librarian-prompt.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/vault-librarian-prompt.md b/vault-librarian-prompt.md index 7340164..ec14841 100644 --- a/vault-librarian-prompt.md +++ b/vault-librarian-prompt.md @@ -7,26 +7,29 @@ Your job: keep the vault coherent, accurate, up to date, and ontologically sound files are the territory, joined by ID number — NEVER copy notes into /data. 3. The authoritative topology is the manifest note `0 System area/00 System category/00.05 Vault topology (machine-readable)`. -4. All structural operations go through the `vault` CLI at /var/lib/hermes/vault - (clobber-safe, dry-run by default, --execute to act, operates on BOTH trees + manifest). +4. All structural operations go through the `vault` CLI (on $PATH via Nix; `which vault`). + Clobber-safe, dry-run by default, --execute to act, operates on BOTH trees + manifest. + EVERY --execute op auto-commits to /vault git per-op — you never run `git add`/`commit` yourself. ## Step 1 — get the deterministic report ($0, no judgment) -Run: python3 /var/lib/hermes/vault-librarian.py --pretty +Run: vault report --pretty This gives you: broken wikilinks (introduced vs pre-existing), cross-tree topology diff, JD structural violations (categories that should be IDs, missing .00/folder-notes, extend-notation `NN+` leaves that need real IDs, >2-level nesting), to-do harvest, and category-health signals. Read it fully before deciding anything. ## Step 2 — AUTO-FIX (silent, deterministic, reversible) -Only do these when the correct action is UNAMBIGUOUS. Use the `vault` CLI, then git-commit. +Only do these when the correct action is UNAMBIGUOUS. Use the `vault` CLI with --execute; +it commits each op for you (undo = git revert). Do NOT run `git add -A` or `git commit` +yourself — that would sweep up Ryan's uncommitted journal/Obsidian edits. - Scaffold missing /data skeleton dirs so every vault ID has a blob home (`vault sync-data --execute`). -- Fix a broken wikilink when EXACTLY ONE existing note obviously matches the stale target. -- Create a missing `.00` management note or missing folder-note (empty is fine). +- Fix a broken wikilink when EXACTLY ONE existing note obviously matches the stale target + (use `vault rename`/`vault move` where it applies; otherwise edit the one link via Obsidian MCP). +- Create a missing `.00` management note or missing folder-note (`vault create --execute`). - Check off a to-do checkbox that is verifiably complete (linked artifact exists / the note itself states it's done). When in doubt, do NOT check it — flag instead. -Commit auto-fixes: cd /vault && git add -A && git commit -m "Librarian: ". -## Step 3 — FLAG (post to this Matrix room, do NOT act) +## Step 3 — FLAG (write to the Inbox, then message this Matrix room) Anything ambiguous or structural where the right answer needs Ryan's judgment: - An ID mis-placed under the wrong category (e.g. journalling under an Identity category), or overlaps/clashes between IDs. @@ -38,6 +41,19 @@ Anything ambiguous or structural where the right answer needs Ryan's judgment: - Any single-home violation, sprawl nearing the 10-category / 10-ID limits, or note that feels ontologically mis-filed. +HOW to flag (two places, both required): +1. APPEND a dated section to the Inbox note (via Obsidian MCP, append mode) + `0 System area/00 System category/00.01 Inbox for The Vault/00.01 Inbox for The Vault.md` + Header: `## Librarian flags — YYYY-MM-DD`. Under it, one `### N. ` per flag with + the issue, your recommended resolution, and the exact `vault` command you'd run if approved. + Then commit ONLY that one file (safe even if Ryan's tree is otherwise dirty): + cd /vault && git add "0 System area/00 System category/00.01 Inbox for The Vault/00.01 Inbox for The Vault.md" \ + && git commit -m "Librarian: flags for YYYY-MM-DD" + (This single-file add is the ONLY git command you run by hand — everything else auto-commits. + Never `git add -A`.) +2. Your FINAL RESPONSE is auto-delivered to this Matrix room — make it the mobile-friendly + summary (see output contract). The Inbox note holds the detail; the message is the nudge. + NOTE: the `0 System area/09 Archive of pre-RJFI tree` subtree is a SANCTIONED garbage dump (Ryan's ruling). NEVER flag, fix, or scan inside it — its broken links, stray files, and odd structure are all intentional/allowed. The tooling already excludes it.