feat(git-sync): native-Obsidian format — phase 1 = page-file (frontmatter gitmost_id)

Pivot the thin-meta design to "the vault IS a native Obsidian vault": clean
markdown + a minimal YAML frontmatter `gitmost_id:` (the durable pageId, travels
with the file so identity survives any move); folders mirror the page tree with
the parent's body as a folder-note `<Folder>/<Folder>.md` (LostPaul Folder Notes
convention); links as `[[wikilinks]]` (basename-resolved → reparent never breaks a
link, only retitle does); collisions disambiguated Obsidian-style; `.obsidian/`
and non-page files left untouched (no .gitignore). Verified the conventions
against the Obsidian/Folder-Notes docs.

Replaces the abandoned `.gitmost/index.json` sidecar (path-keyed → fragile to
git-undetected renames; the in-file id is self-sufficient): removes vault-index.ts.
Adds lib/page-file.ts — parsePageFile/serializePageFile (frontmatter id + clean
body) with a LEGACY `docmost:meta` fallback for migration. 6 unit tests; engine
suite green. Not yet wired into pull/push — no behavior change. Design doc
rewritten to the native-Obsidian format.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
claude code agent 227
2026-06-24 04:25:04 +03:00
parent d163f43e12
commit d8007480ac
7 changed files with 226 additions and 389 deletions
+1 -14
View File
@@ -120,17 +120,4 @@ export type {
CycleFs,
} from "./engine/cycle";
export {
VAULT_INDEX_PATH,
emptyVaultIndex,
parseVaultIndex,
serializeVaultIndex,
pageIdAt,
slugIdAt,
pathForPageId,
trackedPageIds,
setEntry,
removeAt,
moveEntry,
} from "./engine/vault-index";
export type { VaultIndex, VaultIndexEntry } from "./engine/vault-index";
export { parsePageFile, serializePageFile } from "./lib/page-file";