docs(spec): projects/archive layout + outline type — v1.1 spec (#106)

CONTEXT.md: Project, Outline, Archive adopted; Content Type rewritten
as frontmatter attribute; Post ID global across projects.
ADR-0012 (amends 0004), ADR-0013 (specializes 0010).

Wayfinder map #97 — spec assembly ticket #106.
This commit is contained in:
AlexKucera committed 2026-10-13 16:15:19 +02:00
1 parent 074f9af080
commit 50eecc6dcb
6 files changed
+46 -9

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ Owned by the root AGENTS.md contract.
## Local Contracts
- ADRs live in `docs/adr/`, sequentially numbered `NNNNN-slug.md` (currently `0001`–`0011`: stack, license, forge/CI, content layout, learnings home, fix-card transport, state ownership, tools host, sandbox posture, prose editor substrate, apex HTML reading pipeline).
- ADRs live in `docs/adr/`, sequentially numbered `NNNNN-slug.md` (currently `0001`–`0013`: stack, license, forge/CI, content layout, learnings home, fix-card transport, state ownership, tools host, sandbox posture, prose editor substrate, apex HTML reading pipeline, projects/archive layout + type-as-frontmatter, outliner block surface).
- ADR format follows the domain-modeling skill's `ADR-FORMAT.md`: short title + 1–3 sentences; optional Considered Options / Consequences only when they earn their place.
- `docs/agents/` holds the engineering-skills config (issue tracker, triage labels, domain-docs consumer rules) written by `setup-matt-pocock-skills` — edit directly, no child doc needed.
- `docs/sample-pass.md` is the worked sample Pass demonstrating the craft-canon skills firing as Fix Cards (issues #7 and #11 verification artifacts); card shape follows CONTEXT.md, anchors follow ADR-0006.
@@ -1,3 +1,5 @@
# 0004 — Content is folder-shaped under one Museion Home
> Layout half superseded by [ADR-0012](0012-projects-archive-layout-and-type-frontmatter.md) — Projects level, Archive, and Content Type as frontmatter; the folder-shaped Piece itself stands.
Content lives as per-post folders (`posts/<post id>/post.md` + `research/` + `assets/`, created lazily on first write) under a single Museion Home (`~/Documents/Museion` by default — not the account root; one-time macOS TCC consent for Documents applies since the app is unsandboxed (ADR-0009), editable in Settings; repoint-only — Museion never moves content), not as loose files in an opened project folder. The post id is the slug of the first line, set at first save; explicit Rename moves the folder (the file is always `post.md`). The Scrivener-shaped unit buys colocated assets and a growth path to long-form types at the cost of a post no longer being one file; external markdown is edited as-is, and Import (copy, never move) makes it a Post.
@@ -1,6 +1,6 @@
# 0010 — Native TextKit2 prose editor (mode B)
> Reading half superseded by [ADR-0011](0011-apex-html-reading-pipeline.md) — apex HTML pipeline; the editing stance (TextKit2 mode B) stands.
> Reading half superseded by [ADR-0011](0011-apex-html-reading-pipeline.md) — apex HTML pipeline; the editing stance (TextKit2 mode B) stands. Outline editing splits off onto a dedicated block surface per [ADR-0013](0013-outliner-dedicated-block-surface.md).
The editor is a native NSTextView/TextKit2 surface presenting markdown source as calm writing (mode B: styled source, dimmed syntax, reading toggle), with presentation as a flat line-kind→attribute map — no third-party editor dependency. Decided from three throwaway spikes on the pinned calibration corpus (`spike/codeedit/`, `spike/textkit2/`, `spike/blocks/` on `spike/editor-presentation`): TextKit2 delivers full typographic calm at the lowest cost, editing (undo, IME, selection) is native and free, and the Fix-Card anchor proof — exact-range quote highlight + stale-anchor alert with the web-proto wording — passes live on this substrate (2.4 ms anchor search on PERF-3k, ≤1.1 ms full-doc attribute load).
@@ -0,0 +1,11 @@
# 0012 — Projects and Archive shape the Home; type is a frontmatter attribute
> Amends [ADR-0004](0004-folder-shaped-content-under-one-home.md): the folder-shaped Piece stands; the Home's root gains a Projects level and an Archive, and Content Type moves from folder-determiner to frontmatter.
Pieces live as per-piece folders under named Projects (`projects/<name>/<piece-id>/post.md` + `research/` + `assets/`, lazily materialized on first write) instead of one flat `posts/` root, with a default Project `posts` (an ordinary Project; New Piece lands in the selected Project, else the default — no project ask in the zero-friction flow). The slug namespace stays global across Projects: a Piece ID is the durable identity, so id-derived addressing (sessions, sidecars) never threads `(project, id)`. Finished Projects and individual Pieces fold into `archive/<name>/` (mirroring the Project shape) — Finder-visible, reversible; the Archive is a library destination, still openable and editable, just out of the active library. Content Type demotes to a frontmatter attribute (`type: post` | `type: outline`, absent reads as `post`); the Learnings partition keys off it. Existing dev posts move by hand — no migration machinery; the app never reads the old `posts/` root again.
## Consequences
- The piece file is `post.md` for every Content Type, so every PostStore path (write, rename, trash, import, scan) stays single-track.
- Import and New Piece stamp `type: post` alongside `pass_state`/`origin` — the same our-keys-win merge.
- In-app moves: piece → project (Move to Project), piece → archive and back, project → archive and back. Project rename and cross-Home moves stay Finder-side.
@@ -0,0 +1,11 @@
# 0013 — The outliner is a dedicated block surface, not the prose editor
> Specializes [ADR-0010](0010-native-textkit2-prose-editor.md): prose editing stays TextKit2 mode B; outlines edit on a separate substrate.
Outline editing is a real tree of blocks (parse nested-bullet markdown → tree → serialize on save), not the prose editor's shared text buffer: chrome bullets + per-level vertical rules render exactly at every depth, which a painted-over-buffer approach could not match. Costs were scoped down deliberately: block-granular selection is accepted (no text-granular cross-block selection in v1) and structural edits carry no undo (text undo only). Block structure is also the native substrate for the planned TOC "outline nodes as posts" vision. Interaction: Tab/⇧Tab indent/outdent, ⌥↑/⌥↓ move node with subtree, fold/unfold as view state keyed by node id, Enter splits at caret, Enter on empty node outdents, ↑/↓ hop visible blocks; one promoted NSTextView over the focused row (native undo/IME), static text elsewhere.
## Consequences
- Fold is view state, never a text edit — folding never dirties the document.
- Reading an outline reuses the apex pipeline unchanged (nested lists already render).
- Storage is plain nested-bullet markdown on disk (ADR-0012's `type: outline`); node identity, if the second outline map needs it, arrives then as a migration.