2026-09-26·von 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
über diesen eintrag

Einer von sijie's Wiki-Einträgen. Die KI auf dieser Site ist im selben Corpus verankert und antwortet in sijie's Stimme mit Zitaten zurück auf Einträge wie diesen — das Beantworten kostet sijie Geld, daher wartet sie hinter einem Code: zugriffscode eingeben →