Wires #161's goal engine and #160's contract into the app: armed
from a corner dot or View ▸ Start Cold Turkey…, enforced by the
macOS app-kiosk (7-option presentation combo + fullscreen, restored
on completion), readout with hairline + near-goal terracotta, and
a completion note fading back into focus. While held: focus exit,
reading, new buffers, ⌘W/⌃⌘F/⌘N refused (key-code-matched monitor
— character matching is layout/Caps-blind; no .closeItem placement
exists), ⌘Q asks once per #163's ruling. Typing continuity holds by
construction — lock ⇒ focus freezes the branch under the editor and
chrome mounts as overlays only. Arm values type directly (1…1000
words / 1…60 min, defaults 250/5). Nothing persists.
Wayfinder map #158 Build S2; suite 620, flip-verified pins.
Dragging an image onto a saved post's prose editor copies it (never
moves) into the piece's assets/ under a parser-clean slugged name
(collision -2 via the shared uniqueFile helper) and inserts
 at the drop point with alt selected for
type-over — one edit step, one undo.
Routing rides the window-level SwiftUI drop destination, field-verified
to starve every deeper drag destination (nested SwiftUI targets never
fire; AppKit NSDraggingDestination overrides never fire). Pure-markdown
sets keep the open-as-guest behavior; mixed md+image sets refuse loudly
instead of silently dropping the images behind the opened markdown.
The drop point comes from NSEvent.mouseLocation mapped through the one
geometry source that answers under SwiftUI hosting —
firstRect(forCharacterRange:), bottom-up screen coords. Non-contiguous
layout returns zero/stale rects for off-screen characters, so the solve
(a pure static function, pinned by windowless tests) samples the
document, keeps only viewport-band rects, brackets the drop between two
in-band samples, binary-searches the bracket, and slides to the next
whitespace gap — a landing never splices inside a word or an existing
ref. The typewriter inset re-syncs after the edit so scrolling never
freezes. The source gate refuses folders and symlinks alike: copyItem
would land the LINK itself, and the #34 publish rail would then refuse
the whole send. Type gate = the rail's exact set (PNG/JPEG/GIF/WebP/
SVG) — nothing enters assets/ that can't ship. Drafts, outlines, and
guest surfaces refuse loudly.
Finish-audit (three fresh-context reviewers) drove the mixed-set
routing, the symlink refusal, and the pure-function extraction; every
pin flip-verified in one batched cycle. Eleven ingest tests; suite 557.
Closes#141
Two-step publish to Micro.blog over Micropub: Send as Draft (JSON
h=entry create — name = the Title, markdown content verbatim,
post-status draft), review via the preview link, then Publish (the
action=update post-status flip). The piece remembers its draft URL
as a frontmatter micropub_url stamp — in-place, body and foreign
keys byte-identical — so a draft survives a reopen; Send Again
re-drafts after edits. The app token lives in the Keychain (login
keychain; entered once in the sheet, re-offered only on auth
failure — ADR-0014's no-Keychain rule covers only provider keys
hermes reads from .env). Frontmatter category: is permitted but
never sent in v1 — pinned on the wire.
The draft URL is trust-boundary data landing in frontmatter, so
every URL passes a format gate (https + host, no line/control
characters) at BOTH ends: the response decode (Location header →
body url; the preview link is display-only, never the publish
target) and Post.scan's read-back — imported frontmatter rides
verbatim, and a newline--- rider would otherwise close the block
and reparse as attacker markdown in the writer's piece.
Twenty tests pin the wire contract, decode matrix, own-slot keychain
round-trip, stamp/scan, and the model flow (flush-first, refusal
guards, the category AC); all four audit guards are flip-verified.
Full suite 529 passed / 0 failed. Live end-to-end on a real post
(needs the owner's app token) remains open on the ticket.
Markdown lists in the prose editor become structural: Tab/⇧Tab
indent/outdent the item under the caret (wrapped lines ride along,
caret follows), ⌥↑/⌥↓ move the item with its subtree among siblings.
Every structural edit is one range replacement — a single undo step
over the plain mode-B store (ADR-0010 stands).
List parents fold visually: a gutter chevron collapses children to
near-zero height with a rust ▸ and a "⋯ N" summary after the parent's
line. Folding is view state — the buffer never changes (ADR-0013's
posture carried to prose).
Field findings baked in: SwiftUI-hosted TextKit2 never calls
NSTextView.draw(_:) and every NSTextLayoutManager fragment query
returns empty, so the chrome renders offscreen into a layer-contents
image and geometry comes from firstRect(forCharacterRange:) (screen →
window → view). Includes the finish-audit round: sibling block-for-
block ⌥-move swap (was stealing the sibling's subtree), blank-line
indent dirt, fold-key dedupe, hidden-parent chevron filtering,
plain-click-only hit zone, no-parents raster skip.
Closes#115
[Generated by AI]
Dedicated block surface (ADR-0013, #105 variant B): OutlineTree
parses/serializes plain nested-bullet markdown leniently and
normalizes on save; the outliner promotes one NSTextView over the
focused row with LogSeq-style keys (Tab/⇧Tab, ⌥↑/⌥↓ subtree move,
↑/↓ hop, ⇧↑/⇧↓ block selection, ⌘↑/⌥↓ fold, Enter split), folds
session-scoped by runtime node UUID. New Outline ⇧⌘N stages a
type: outline draft through the existing autosave/conflict
machinery; reading renders the serialized markdown unchanged.
Outline rows use the body face at its natural line box — the prose
CSS-1.8 lineHeightMultiple grew the focused row and detached the
bullet (test-pinned). Finish-audit fixes included: paste-multiline
sanitizing at setText, dead Enter disjunct, dead Row.path.
Closes#109
Pieces re-root from posts/<id>/ to projects/<name>/<id>/ with an
archive/ twin root (ADR-0012): scan walks both levels, New Piece and
Import land in the selected project else the default posts, the slug
namespace is global across projects and archive (an archived slug is
never reused), and every piece carries type: post frontmatter —
stamped by New/Import, read leniently (absent or unknown reads as
post), the file stays post.md for every content type. Write paths
resolve the folder from the id alone (folder(of:)); sessions and
sidecars never thread (project, id).
Finish-audit hardening: duplicate ids on disk (Finder copy) dedupe in
scan to the same first-match folder(of:) writes to; folder(of:) skips
hidden/symlinked projects like scan does.
Dev posts moved by hand to projects/posts/ — no migration machinery,
the app never reads the old posts/ root (#103). Full suite green
(128 unit + UI), swiftlint clean on changed files.
Closes#107
External .md/.markdown opens and edits as-is in a single guest slot
(File > Open... Cmd+O, drag-onto-window): SessionTarget extends
EditorSession to write in place verbatim, no cursor sidecar, the #67
conflict alert reused for foreign files. Import... (Shift+Cmd+O)
copies multi-select files in as Posts behind ONE Origin ask
(writer default, immutable); external frontmatter keys ride verbatim
with pass_state/origin set; slug/collision machinery shared with
writeNew.
Audit fixes folded in: BOM stripped + CRLF normalized at the trust
boundary (a CRLF pair is one Swift grapheme — \n splits saw one
line); unreadable files refuse to open (loadFailed — a failed read
never becomes a write); dropped web links and severed symlinks
guarded; ~24 lines of reviewer-flagged dead weight removed.
7 new tests; full unit + UI suite green; swiftlint clean.
Map #22 stays open pending the live calibration pass (#88 posture).
The bottom clamp parked the scroll and no-oped every keystroke when
typing at the document end — the natural writing position. Padding the
text container by half the viewport (typewriter breathing room) lets the
clamp center the last lines. Calibration ruling: typewriter centering
and breathing room are editor-wide, not focus-gated.
The dot claimed "Saved" for open posts even with unflushed keystrokes;
only draft mode told the truth. SaveState now mirrors cleanliness:
Changed while text differs from the last flush, Saved when clean. The
Saving… state is deleted — the synchronous write never lasts a render
pass. Save failed stays sticky until a write actually succeeds, and
Keep Local no longer adopts local text as flushed when the post
vanished mid-alert (that path silently killed ⌘S with "Saved" showing).
Closes#83
[Generated by AI]
Neo triage input: continuous spell checking off by default, on when
asked — markdown on disk already carries the spelling; squiggles are
a presentation choice, per-launch with no persistence.
Edit ▸ Check Spelling While Typing binds AppGateState.spellChecking
and applies it to the live NSTextView in makeNSView/updateNSView.
Commands views take gate as a plain property — @Environment lookups
trap at launch there (crash-verified).
Verified in-app: toggle -> live view flag true -> squiggles render.
(The initial "does nothing" report was a machine-level kill switch:
NSAllowContinuousSpellChecking=0 in the global defaults domain, since
deleted; no app code change was needed for that part.)
Closes#77 follow-up.
- HIGH: fence delimiter edits now restyle the whole document (delimiter
count fingerprint in the coordinator; count moved = full re-attribute,
caret preserved) — typing/deleting a ``` flipped every line until
the match before
- derived fonts + measureWidth cached as nonisolated(unsafe) static let
(were NSFontManager.convert per line per pass)
- h2/h3/h4 line height calibrated from their own face's metrics
- 7+ hashes fall to body (CommonMark cap); tab-indented heading marker
dims the hash, not the tab
- intraword _ spans unclaim on reject so the fallback char-dim takes them
- shrink: fenceState reuses contentLines+classify (isDelim deleted),
marker regexes as literals (helper + 2 lint disables deleted),
charBefore/After via NSString, dead colors + forwarders deleted
- vacuous retrofit test replaced with a real one + fenceDelimCount test
- editor text centers at reading.css --measure 66ch (zero-advance × 66
+ 2×24pt padding), scroll view still fills the column
- headings get paragraphSpacingBefore 75 / after 30 (CSS 90/30 minus
the visible blank separator's ~15pt)
Click-to-edit and open-with-cursor-restore both scrolled a freshly
mounted NSTextView synchronously. TextKit lays out asynchronously, so
scrollRangeToVisible clamped to the laid-out height - on long posts
that is near the top, which read as "click always lands at top".
Born with the #71 toggle, masked in devlogs by short verification
posts where top equals the clicked paragraph; reproduced offscreen
against a 3000-para doc (scroll y=69076 for a y=70000 target), one
runloop hop lands dead-on.
Both scroll sites (hint branch + cursor restore) now defer scroll and
first-responder to the next runloop tick. 93 tests green.
[Generated by AI]
updateNSView never fires on UserDefaults writes from the Settings pane,
so the flowKey check there was dead code. Both surfaces now observe
UserDefaults.didChangeNotification directly: the editor re-attributes
(selection preserved), the reading canvas rebuilds its document. Also
closes the parked stale-reading-view defect from the handoff notes.
Two defects from the flow-knob commit: (1) edit mode got reading-mode's
paragraph spacing stacked on top of the visible blank source lines —
gaps tripled. Source editors render the blank line AS the separator;
paragraph spacing is now 0, only lineHeightMultiple rides the knobs.
(2) Knob changes never reached an open editor — updateNSView now
re-attributes the whole storage (selection preserved) when
ProseTypography.flowKey moves.
- Images render inline via NSTextAttachment (scaled to 480pt, alt as
caption); the hover popover and its ImagePopoverView are gone.
- Vertical rhythm per the author's measurements: lineHeightMultiple 1.25,
1 line after paragraphs, 2 after headings (all block styles).
- Table cells breathe: mono pad 2→3 per side; decoration offsets measure
with the same pad so the grid still lands on the text.
- Margins: lineFragmentPadding 12→24 (reading + editing), inset height 24.
- Image URL resolution hoisted into blocks(for:) — the attachment loads
the resolved path, document() no longer re-resolves.
Five root causes behind Alexander's calibration findings:
- Wrap to column: both canvases had a fixed 640pt text container —
clipped instead of wrapping when the editor column is narrower
(library + mentor open). widthTracksTextView = true now; measure
polish can return with calibration.
- Tables: TextKit2 stacks NSTextTable rows vertically (each row its
own content-width fragment — no grid). The reading canvas forces
the TextKit1 bridge (replaceLayoutManager); probe-verified grid +
column borders. Read-only canvas — nothing editing-grade lost.
- Heading-tail: a chunk like "# Title" followed by body lines (single
newline, legal markdown) dropped everything after line one. The
heading now renders, then the remaining lines as a soft-joined
paragraph.
- Stale reload (data-loss vector): ProseTextView seeded from
session.loadText (open-time snapshot) — after a reading⇄editing
swap the recreated editor showed the pre-paste text, and a keystroke
there flushed stale content over the user's real edits. Seeds from
session.text (live) now.
- Quote one-char-per-line: did not reproduce after the layout fixes;
root cause was the broken layout state above.
EditorSessionTests debounce flake (50ms margin under parallel load)
passed on both re-runs — timing margin, not a regression.
Full suite green (94 unit + UI smoke); lint clean.
Posts open into the TextKit2 surface (ADR-0010 mode B) lifted from
the proven spike: styled source, scaled headings, dimmed syntax,
native undo/IME. One EditorSession per open post drives a ~1 s
debounced autosave (flush on selection change, window close, app
quit; ⌘S immediate), the Saved/Saving/Failed dot, and the per-post
.museion-state.json cursor sidecar that dies with the folder.
External edits raise an explicit Reload/Keep-Local alert — the
debounce never answers it for the writer, and drafts keep the
lazy-folder first-⌘S rule (#62).
Reviewer fanout fixes folded in: session teardown at every lifecycle
exit (rename flushes before the folder move; trash cancels the
debounce), draft ⌘S continues in place, conflict holds the debounce,
rescan's disk read off-main, ~35 lines of dead code out.
Closes#19