A self-organizing Obsidian vault that gives AI coding agents persistent memory.
TypeScript ai-agentsclaude-codecodex-cligemini-cliknowledge-managementobsidianobsidian-vaultpersistent-memorysecond-braintemplate
fix: require shardmind 0.2.1 so a failed adopt cannot delete a clone's .shardmind files (#316)
Brenno Ferrarif19c6fc32faf
diff --git a/.claude/commands/om-vault-upgrade.md b/.claude/commands/om-vault-upgrade.mdindex c846a59..36c3397 100644--- a/.claude/commands/om-vault-upgrade.md+++ b/.claude/commands/om-vault-upgrade.md@@ -23,7 +23,7 @@ Two jobs, picked by whether a source vault is given:ShardMind owns the engine lifecycle: `shardmind update` moves a managed vault to a new release, and `shardmind adopt` brings a vault that was cloned without it under management. This command owns the judgment ShardMind's bulk modes cannot make: whether a file that differs from the template is one **you improved** (keep it, and maybe upstream it) or one **you never updated** (take the new version). A blunt use-all-theirs downgrades every local enhancement. A blunt keep-all-mine is worse: it records stale files as yours, so the vault reports itself up to date while those files stay old and no later update touches them.-**Requires ShardMind 0.2.0 or later** (`shardmind --version`; upgrade with `npm i -g shardmind@latest`). Without ShardMind, use *Workflow* below with this vault's previous copy as the source.+**Requires ShardMind 0.2.1 or later** (`shardmind --version`; upgrade with `npm i -g shardmind@latest`). Without ShardMind, use *Workflow* below with this vault's previous copy as the source.### U1. Plandiff --git a/.claude/scripts/tests/shard-contract.test.ts b/.claude/scripts/tests/shard-contract.test.tsindex de70059..e950b48 100644--- a/.claude/scripts/tests/shard-contract.test.ts+++ b/.claude/scripts/tests/shard-contract.test.ts@@ -30,10 +30,12 @@ const shardYaml = readFileSync(resolve(repoRoot, ".shardmind/shard.yaml"), {encoding: "utf-8",});-/** Lowest shardmind engine this shard supports (the hook lifecycle needs 0.1.3; safe updates need 0.1.7). */+/** Lowest shardmind engine this shard supports (the hook lifecycle needs 0.1.3; safe updates 0.1.7; safe adopts 0.2.1). */// 0.1.7: older engines overwrite user-edited files on update (shardmind#150),// and this shard's updates rewrite settings.json hook lines.-const MIN_SHARDMIND: readonly [number, number, number] = [0, 1, 7];+// 0.2.1: a failed or cancelled adopt in a clone of this repo deletes the+// clone's .shardmind/ files (shardmind#326), and /om-vault-upgrade adopts clones.+const MIN_SHARDMIND: readonly [number, number, number] = [0, 2, 1];function gte(a: readonly [number, number, number],diff --git a/.claude/scripts/upgrade-plan.ts b/.claude/scripts/upgrade-plan.tsindex 6ad461b..02b084b 100644--- a/.claude/scripts/upgrade-plan.ts+++ b/.claude/scripts/upgrade-plan.ts@@ -21,7 +21,9 @@* really the user's. Without it, keep-all-mine would record the stale files* as user-modified, and no later update would ever touch them.*- * Requires ShardMind 0.2.0 or later (`--json`).+ * Requires ShardMind 0.2.1 or later: `--json` arrived in 0.2.0, and 0.2.0 has+ * an adopt that deletes a clone's own `.shardmind/` files when it fails or is+ * cancelled (shardmind#326).*/import { spawnSync } from "node:child_process";@@ -126,7 +128,7 @@ function main(): void {const v = shardmindCommand(["--version"]);const ver = spawnSync(v.cmd, v.args, { shell: v.shell, encoding: "utf8", timeout: 60_000 });if (ver.status !== 0) fail("ShardMind is not installed. Install it (npm i -g shardmind) or use the manual migration in /om-vault-upgrade.");- if (!versionAtLeast(ver.stdout, [0, 2, 0])) fail(`ShardMind ${ver.stdout.trim()} is too old; 0.2.0 or later is needed for --json. Run: npm i -g shardmind@latest`);+ if (!versionAtLeast(ver.stdout, [0, 2, 1])) fail(`ShardMind ${ver.stdout.trim()} is too old; 0.2.1 or later is needed (--json, and an adopt that keeps a clone's .shardmind/ files if it fails). Run: npm i -g shardmind@latest`);let mode: "managed" | "unmanaged";let from = "?";diff --git a/.shardmind/shard.yaml b/.shardmind/shard.yamlindex 71c8768..a751ae8 100644--- a/.shardmind/shard.yaml+++ b/.shardmind/shard.yaml@@ -18,7 +18,10 @@ requires:# check. 0.1.7 fixes `update` overwriting user-edited files while reporting# them kept (shardmind#150), and this shard's updates rewrite settings.json# hook lines, so older engines must refuse with SHARDMIND_VERSION_MISMATCH.- shardmind: ">=0.1.7"+ # 0.2.1 fixes a failed or cancelled `adopt` in a clone of this repo deleting+ # the clone's own `.shardmind/` files (shardmind#326); `/om-vault-upgrade`+ # runs adopt on exactly such clones.+ shardmind: ">=0.2.1"hooks:bootstrap:diff --git a/brain/Skills.md b/brain/Skills.mdindex 95a30f4..58755a5 100644--- a/brain/Skills.md+++ b/brain/Skills.md@@ -79,7 +79,7 @@ Custom slash commands, subagents, and reusable workflows. Defined in `.claude/co**Maintenance:**- `/om-vault-audit` should be run at the end of substantial sessions — catches stale indexes and mixed context-- `/om-vault-upgrade` with no source upgrades this vault through ShardMind 0.2.0+: `upgrade-plan.ts` sorts every differing file into behind (take), ahead (keep; upstream candidate), merged or conflict before anything is applied. With a source, it imports content from an existing vault (older obsidian-mind or any Obsidian vault). Detects version, classifies notes, transforms frontmatter, fixes wikilinks, rebuilds indexes. Use `--dry-run` to preview.+- `/om-vault-upgrade` with no source upgrades this vault through ShardMind 0.2.1+: `upgrade-plan.ts` sorts every differing file into behind (take), ahead (keep; upstream candidate), merged or conflict before anything is applied. With a source, it imports content from an existing vault (older obsidian-mind or any Obsidian vault). Detects version, classifies notes, transforms frontmatter, fixes wikilinks, rebuilds indexes. Use `--dry-run` to preview.- `/om-project-archive` handles the active/ → archive/ move with index updates## Subagents