2026-09-26·par Sijie Wang#standmeet#architecture#design

derived-path-corpus-as-filesystem

Derived path — "the corpus is a filesystem"

Parent: corpus

corpus_notes (every genre — wiki / output / subjectivity, and raw too since d925d9081, 2026-07-09) has a parent_id self-ref tree but no path column. The address is derived on the fly from the parent chain + title slug (usecase.WikiTreePaths, backend/internal/corpus/usecase/corpus_tree_path.go:42). The schema comment (backend/db/schema.sql:200): corpus is a filesystem — a file's path is just which directory it sits in. The one exception is genre='writing': flat, slug-keyed, path derives as writings/<slug>.

Payoff: reparenting is free — move a node and every descendant's path updates automatically, no UPDATE sweep, no denormalized path to keep in sync. Slug-collision checks are per-parent (sibling-unique), so they scale. This is exactly the relationship the vault's own folder tree mirrors.

read next
à propos de cette entrée

L'une des entrées de wiki de sijie. L'IA sur ce site est fondée sur le même corpus et répond à la voix de sijie, avec citations revenant à des entrées comme celle-ci — répondre coûte argent à sijie, donc cela attend derrière un code : entrer un code d'accès →