Shared primitives catalog
Shared primitives catalog
Before writing any helper, scan these tables first.
Most “I need a small string transform / id helper / md coercion / tree walk” needs already have an owner here —
the cost of finding the existing one is a grep;
the cost of missing it shows up later as drift between two parallel implementations (the user is the one who hits the divergence).
This page is the index. The tables live in three parts, split by responsibility. Grep all four files together — they are one catalog:
grep -n 'the_symbol' docs/shared-primitives.md docs/primitives-*.md
The catalog is mirrored (in condensed, review-checklist form) at
.github/instructions/shared-primitives.instructions.md, a path-scoped Copilot instruction file (applyTo: crates/**). When you edit any part, sync that mirror — aPostToolUsehook flags drift, but the discipline starts before the hook fires.
For the reuse-first rule (why this matters, past drift incidents, what to do when a primitive doesn’t exist yet), see Contributing → Reuse-first.
The three parts
| Part | Covers | Read it when |
|---|---|---|
| Core state, sync, and durability | op log, CRDT tree, HLC, ids, sync engine + transports, locks, Storage trait, local backups | you’re about to mutate or read converged workspace state |
| Markdown pipeline | parse, render, external coercion + ingest, reconcile / matching / diff, sidecar, outline AST helpers, indices, inline tokenizers, assets | you’re about to read or write .md / .outl |
| Editing actions and client features | block mutations, pages + journals, backlinks, code execution, undo/redo, templates, reminders, @outl/shared | you’re wiring a client gesture to a workspace change |
Full section index
Core state, sync, and durability
- Workspace lifecycle, op log, and HLC (outl-core)
- Tree reads (outl-core + outl-actions::tree)
- Sync engine, locks, storage trait
- Local backups (outl-actions::backup)
Markdown pipeline
- Parse / render (outl-md::parse + render)
- External markdown coercion & ingest (outl-md::frontmatter + wikilink, outl-actions::paste + ingest)
- Reconcile & matching (outl-md::reconcile + matching + diff)
- Sidecar (outl-md::sidecar + atomic)
- In-flight outline AST helpers (outl-md::outline_ops)
- Indices and search (outl-md::index + block_index)
- View helpers for editors (outl-md::view + inline)
- Asset links (outl-md::asset + outl-actions::asset)
Editing actions and client features
- Block mutations (outl-actions::block + collapsed + todo + quote)
- Pages and journals (outl-actions::page + journal)
- Backlinks (outl-actions::backlinks)
- Code-block execution (outl-actions::exec)
- Undo / redo history (outl-actions::history)
- Templates
- Reminders (
remind::) - Frontend shared primitives (
@outl/shared)
When your need isn’t in this catalog
If you’ve grepped honestly and the primitive doesn’t exist, that’s a fair sign — add it in the upstream crate that owns the concept:
outl-mdfor parse / render / sidecar / inline / tokenizersoutl-actionsfor workspace mutations, ingest, page/journal helpersoutl-corefor op-log / tree / HLC / storage trait
Then add its row to the matching part in the same commit, and sync the mirror at .github/instructions/shared-primitives.instructions.md.
The PostToolUse hook will flag drift, but the discipline starts before the hook fires.
For the broader reuse-first rule and past drift incidents that justify this catalog, see Contributing → Reuse-first.