Commit Graph
57 Commits
Author SHA1 Message Date
AlexKucera 4d33676a08 feat(mentor): apply/skip fix cards (#25)
CI / ci (push) Canceled after 0s
Fix Cards become actionable. Mechanical cards offer Apply behind a
blocking ask-before sheet showing the exact edit (anchored quote ->
replacement, occurrence + context; empty fix cuts); the sheet is the
only path to a write, one card at a time, no apply-all. The edit
lands through the editing session (pending edits flush first, the
editor re-seeds via adoptText, the card closes applied); Skip and
Done close the card in place, recording nothing; demonstration
cards close Done/Skip only (ADR-0006). Cards arrive ranked
(store-stamped, scan-ordered, open-first palette) and capped at ten
per submit — the app keeps the ranked head and the wire reply
discloses the drop. Stale anchors re-validate at apply: no text
selected or changed, the card flags itself. Includes the
finish-audit round (11 fixes, 2 flip-verified pins); 316 tests
green.

Closes #25
2026-10-20 16:46:43 +02:00
AlexKucera 683ddf8426 feat(mentor): museion-tools MCP server (#23)
CI / ci (push) Canceled after 0s
Headless --serve-mcp role in the app binary: NDJSON JSON-RPC on stdio
exposing query_learnings and submit_fix_cards (ADR-0006 cards,
anchor-validated; stale lands flagged, never rejected), registered
into the museion profile at provisioning. Cards persist per piece
under <piece>/cards/ and surface in a floating Fix Cards palette
with pass-stamped provenance.

Live dogfood drove the shape: session/prompt waits pass length (the
15 s request default abandoned working turns), a liveness row and a
persisted Debug checkbox (off) split writing sessions from debug
chatter, the verdict references findings by title only while the
cards carry the detail (persona v1.3 — tools work in silence), and
the #24 pass rails (pass bar, TurnOutcome seam, snapshots) ride in.

Three-reviewer audit round: piece-path shape guard closes the
JSON-drop and substring-oracle holes, nested submit rawInput parsing
(the flat parser never matched the live rail), missing stopReason
never advances a pass, 1 MB stdin cap, card scan off MainActor.
296 tests green; every behavioral fix flip-verified.

Closes #23
2026-10-20 12:20:54 +02:00
AlexKucera 803682f3f0 feat(prose): list shortcuts — S5 (#115)
CI / ci (push) Canceled after 0s
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]
2026-10-19 12:43:55 +02:00
AlexKucera c0513aae85 feat(outline): convert to post — S4 (#114)
CI / ci (push) Canceled after 0s
In-place outline→post conversion on the piece: id, folder, Pass
State, origin kept, type frontmatter flips to post, body transforms
once. The ask picks the transform — Verbatim Bullets (default,
lossless) or Headings ladder (roots ##, stepping to the ###### floor,
deeper stays bullets), with a warning when the ladder would drop
paragraph lines between bullets.

The open session flushes first, then reopens routed to prose via
proseOverridePostID (lastDraftWasOutline's machinery reversed).
An outline that went lossy on disk behind an unwarned ask aborts
the convert; an unanswered #67 conflict aborts every flush-first
op (shared flushOrAbort seam); rescan no longer hands a same-id
reopened session its predecessor's stale disk text; a held #111
guard ask dies with the outline it pointed at.

Audit round (finish-audit, three reviewers) included: 13 new pins,
206 tests green, pin discrimination verified. Record:
docs/devlog/20261016-issue114-convert-to-post_log.md
2026-10-16 18:03:41 +02:00
AlexKucera 21e2f27450 feat(outline): drag-reorder + zoom — S6 (#112)
CI / ci (push) Canceled after 0s
Pointer drag of a block run into any sibling seam or onto a block to
nest as its child (wf113 variant A: fat-gap 30/40/30 bands, seam
line at the future bullet column); the block selection rides the
drag, the moved run becomes the selection, and Esc cancels mid-gesture.
Double-click any bullet zooms to its children with breadcrumbs back
out. New OutlineTree extract/insertRun splice subtrees id-preserving;
the live row's NSTextView moved to OutlineRowTextView.

Audit round: the gesture is self-contained from arm time (strong
window + callback captures — a mid-drag scroll that drops the origin
row cannot strand drag state), a second arming cancels a stuck
predecessor, rowFrames prefers the grip frame, hitTestDrop is y-up
only, and the rails read DropGeometry. Pinned in OutlineDragTests
(monitors fire on sendEvent with a real window number).

[Generated by AI]
2026-10-16 14:49:57 +02:00
AlexKucera d722820fc8 chore: swiftformat drift + xcode 27 settings leftovers
Format-only pass over spikes, the gate prototype, and three app
files (brace style, wrapping — no semantic change), plus the 4-line
pbxproj alignment finishing the Xcode 27 settings pass (test-target
deployment target parity with 8e70f69).

[Generated by AI]
2026-10-16 14:49:26 +02:00
AlexKucera 0b172f73ef feat(outline): mixed-content open guard — S7 (#111)
CI / ci (push) Canceled after 0s
Opening a type: outline piece whose body parses with dropped prose
(paragraph lines between bullets) now asks before the outliner mounts:
Open in Prose (default, nothing drops), Open as Outline (explicit
consent to save normalization), or Cancel. The detector shares the
parser's item definition, the ask presents over an empty editor so
nothing can normalize on save before the choice, and the prose answer
rides a routing override that dies with the next open.

Audit round pinned the lifecycle: reselect of the open piece is a
no-op (an armed debounce must never flush mid-ask), and a draft or
guest staged during the ask displaces it without being destroyed.

Closes #111

[Generated by AI]
2026-10-15 18:31:26 +02:00
AlexKucera c23ee0f62f feat(outline): outline type + outliner — S3 (#109)
CI / ci (push) Canceled after 0s
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
2026-10-15 13:09:31 +02:00
AlexKucera e55747e7fe feat(library): projects & archive UI — S2 (#108)
CI / ci (push) Canceled after 0s
Variant B per the #104 prototype verdict: the library column groups
pieces by project (serif lowercase heads, collapse toggle, Pass-State
groups inside, 2px edge-bar selection shared with the new Archive
pane via LibraryPostRow). Move to Project / Archive / Move Back /
whole-project Unarchive are folder moves — post.md bytes untouched,
never clobbering, ids globally unique. File ▸ New Post ⌘N and New
Project… ⌥⌘N (CommandGroup, never CommandMenu per #84).

Every folder move flushes pending edits first and aborts when the
write failed — nothing moves without its text. Project membership and
the archived-refusal derive from freshly resolved disk paths, never
the scan snapshot. Slug and project-name comparisons fold through one
canonical key (NFC + lowercase). Two reviewer fanouts this session;
their findings are all fixed or visibly parked.

144/144 tests green (run twice), swiftformat/swiftlint clean.

Closes #108
2026-10-13 22:18:24 +02:00
AlexKucera 3ca9d4e601 feat(library): projects & archive substrate — S1 (#107)
CI / ci (push) Canceled after 0s
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
2026-10-13 17:44:44 +02:00
AlexKucera 0f1c4ef4fe feat(posts): import & external markdown — S1.1 (#22)
CI / ci (push) Canceled after 0s
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).
2026-10-12 17:00:03 +02:00
AlexKucera c1261222ec docs: DOX pass — #88 CALM ruling, editor-wide typewriter, #89 colors, #90 hairlines 2026-10-09 20:26:29 +02:00
AlexKucera c2be84e25a feat(design): two-color world — cream chrome, shared page, rust caret (#89)
Calibrated live with Alexander: background #FAF9F3 (cream chrome, also
the focus ground), surface #FFFEFB (one page color for edit AND read —
kills the three-way jump white/gray/blueish), rust #C96442 caret,
reading highlights in cream washes at whisper strength, hardcoded
NSColor.white sites removed. Departure from the export contract is
deliberate and recorded in DesignTokens.
2026-10-09 20:24:59 +02:00
AlexKucera 9ad71ebf8a fix(ui): align all pane-head hairlines at 52px (#90)
Posts header, editor toolbar, and mentor header now share the export's
52px pane-head height — the three hairlines read as one continuous line.
2026-10-09 20:24:59 +02:00
AlexKucera 34aa88b020 fix(editor): typewriter centering works at document end, editor-wide (#88, #21)
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.
2026-10-09 20:24:51 +02:00
AlexKucera 42355fcc9d docs: focus shortcut ⌥⌘F in AGENTS.md 2026-10-09 11:45:03 +02:00
AlexKucera 1bb3b459b1 fix(app): focus shortcut ⌃F → ⌥⌘F (#87)
⌃F shadowed the editor's Emacs caret-forward binding (menu key
equivalents beat the responder chain).
2026-10-09 11:44:49 +02:00
AlexKucera d07d41859a fix(workspace): audit fixes — dedupe failure chip, width-guard mentor overlay, a11y, NSColor bridge (#87)
Reviewer fan-out (ponytail/security/general) synthesis:
- one failure surface in focus (chip carries it; toolbar stays recessed)
- draft '⌘S saves' cue in focus (drafts have no autosave)
- mentor reveal honors the #17 width verdict
- hidden overlay panels leave the accessibility tree
- NSColor(DesignTokens.background) bridge replaces the twin constant
- HoverZone width plumbing deleted, zoneWidth hoisted as the knob
- single >=1100 threshold read in WorkspaceView
2026-10-09 11:42:14 +02:00
AlexKucera 9c2926f027 fix(app): focus toggle shortcut ⇧⌘F → ⌃F (#87 follow-up)
⇧⌘F collides with a system-wide shortcut on Alexander's machine —
the charting probe only checked NSUserKeyEquivalents and in-app
collisions, not global hotkeys. ⌃F is free.
2026-10-09 11:23:16 +02:00
AlexKucera b0ab800d3d feat(workspace): focus mode — recession, hover reveal, soft caret centering (#87)
Map #21 build child. Toggle via View menu / ⌘⇧F; panes and toolbar
recede, overlay hover reveal (left: rail+library, right: mentor),
soft caret centering while typing, loud save failure, ⌘S armed in
focus. Full suite green; calibration gate #88 judges calm.
2026-10-09 11:11:36 +02:00
AlexKucera 997607b9d3 fix(app): fold reading toggle into the system View menu (#84)
CommandMenu("View") created a second View menu beside the system
one. CommandGroup(after: .toolbar) puts Toggle Reading Mode into
the system View menu; ⌘R and the .toggleReadingMode notification
are unchanged. Hosted test pins exactly one View-titled menu.

Closes #84
2026-10-08 21:30:59 +02:00
AlexKucera fc0dde4f7c fix(editor): honest save indicator — Changed while dirty (#83)
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]
2026-10-08 18:27:22 +02:00
AlexKucera c1f5d707f8 feat(editor): spellcheck posture toggle (#77)
CI / ci (push) Canceled after 0s
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.
2026-10-08 17:36:57 +02:00
AlexKucera 1f7557a2ed fix(editor): audit fixes — fence staleness, font caching, lint shrink (#77)
- 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
2026-10-08 14:11:47 +02:00
AlexKucera ffb80be225 feat(editor): overlay scrollbar, visible only while scrolling (#77) 2026-10-08 13:59:13 +02:00
AlexKucera 46441438a2 feat(editor): 66ch measure + heading spacing (#77 follow-up)
- 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)
2026-10-08 13:51:07 +02:00
AlexKucera 3934b10ec5 docs(dox): #77 editor parity rework in app + tests docs 2026-10-08 13:34:03 +02:00
AlexKucera 8fe5f48e0e feat(editor): reading-parity presentation for the editing surface (#77)
ProsePresenter rewritten to mirror the calm-ruled reading surface (#78):
- leading calibrated to CSS 1.8 via font metrics (not the raw number)
- heading ladder 30/22/19-w600, h4+ bold body, new h3/h4+/fence/blank kinds
- half-height blank separators (9pt)
- quotes secondary-ink + 20pt indent; fence interiors mono-14 on substrate
- inline traits: bold, italic (CommonMark intraword _ rule), code, links
  (label ink + underline, marks dim); list markers dim
- 11 new tests pin the ladder, blanks, quote, fence, traits
2026-10-08 13:33:21 +02:00
AlexKucera 1a5f04c9f4 fix(editor): hop the runloop before caret scrolls land
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]
2026-10-08 10:44:26 +02:00
AlexKucera c7a6a82283 fix(reading): repair image, table, and link styling per critique
Address critique #2 findings in reading.css: replace the hover-expand
image sliver with a resting framed thumbnail and visible captions (P0),
honor align attributes on table cells instead of forcing left (P1), and
surface href + edit cue on link hover so plain-click-into-edit has a
visual contract (P1).

Also records both critique rulings under .impeccable/critique/ and
notes the single-size 1024px App icon convention in Museion/AGENTS.md.
2026-10-08 10:19:26 +02:00
AlexKucera dc38c2717d feat(assets): add mac app icon images to AppIcon set
Wire Museion logo PNGs (512x512 and 1024x1024) into the
AppIcon.appiconset so macOS builds show the proper icon.
2026-10-07 17:42:31 +02:00
AlexKucera 4cb753d17f feat(reading): polish typography, externalize CSS
Critique-directed polish of the reading surface (#72 ruling: pipeline
calm, surface not-calm) plus the single-user typography rework:

- Flow: leading 1.5, paragraph gap tightened; heading ladder rescaled
  (h1 1.15x / h2 0.85x / h3 body-face semibold) with cling margins,
  hN+hN suppression, no title dead space
- Constructs: confident blockquote (near-ink text, 3px rail, nesting
  degrades), booktabs tables, tinted code panels, relative inline code
- Fonts hardcoded for Alexander's faces: Valkyrie OT B 17 body,
  Concourse OT Semibold headings, UbuntuMono 14 code; 66ch measure
- Stylesheet moved to Museion/Resources/reading.css, read fresh per
  page build — Debug builds load the repo copy (#filePath), so CSS
  edits hot-reload on the next reading toggle
- Settings Typography/Text Flow sections and all flow-key plumbing
  deleted (56 insertions, 417 deletions)

Refs #72, #78. Detector: 192 findings -> 0. Build + 93 tests green.

[Generated by AI]
2026-10-07 17:02:10 +02:00
AlexKucera f1c915fed1 chore(reading): lint-clean lift — local renames, tab escape, DOX pass (#76)
Spike-locals renamed at lift time (identifier_name), literal tab in a
string escape fixed (unprintable-ASCII build error), swiftlint
force_try disable for the static regex. AGENTS.md reading-mode section
rewritten for the apex HTML pipeline; native-only Work Guidance line
rescoped to the editing side per ADR-0011.
2026-10-06 18:30:21 +02:00
AlexKucera cc04ec236e feat(reading): swap reading surface to apex HTML pipeline (#76)
ReadingPresenter becomes markdown -> bundled apex -> HTML fragment with
data-source-line stamps (chunker sentinels + regex restamp, #74-proven);
ReadingSurface becomes one WKWebView reloaded in place (no remount), CSS
vars from ProseTypography slots + flow knobs. TextKit reading machinery
deleted (ADR-0011: no fallbacks; stale-flow defect dies unfixed).
Footnotes now render natively (apex upgrade over #69's fallback). Tests
re-targeted at HTML string asserts incl. real-bundled-binary pipeline runs.

Closes-nothing: wayfinder #76 on map #20; branch wayfinder/76-apex-html-reading.
2026-10-06 18:26:22 +02:00
AlexKucera b30c0e3dd6 fix(settings): say where the flow knobs apply — line height everywhere, spacings reading-only 2026-10-06 14:23:04 +02:00
AlexKucera 0d3d5af78a fix(editor): typography knob changes reach open surfaces (#71 follow-up 9)
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.
2026-10-06 14:17:53 +02:00
AlexKucera 677dc8c073 fix(editor): source-editor spacing — blank lines are the separator (#71 follow-up 8)
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.
2026-10-06 14:14:17 +02:00
AlexKucera 6d7d1411a2 feat(editor): configurable text flow — line height + spacing knobs (#71 follow-up 7)
Three UserDefaults-backed knobs in ProseTypography (line-height multiple,
space-after-¶ and space-after-heading in body lines, clamped), surfaced
in Settings → Text Flow. Also fixes two real bugs from the last commit:
paragraphSpacing was set to 1.25 POINTS (now lines × linePoints), and
reading-mode body paragraphs never received the rhythm at all (they rode
the editing surface's fixed 10pt) — both surfaces now share one rhythm.
2026-10-06 13:43:43 +02:00
AlexKucera 2d4e2563f7 feat(editor): reading polish — inline images, rhythm, table padding, margins (#71 follow-up 6)
- 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.
2026-10-06 12:49:04 +02:00
AlexKucera 7ed7a56642 fix(editor): translate decoration frames by textContainerOrigin (#71 follow-up 5)
Frames arrive in CONTAINER space; the view draws text at
textContainerOrigin + frame. The missing +origin.y (inset height 20)
drew every decoration 20pt too high — hairline ending above the quote,
grid compressed over the table's top rows. Translate once, per-frame.
2026-10-06 12:04:37 +02:00
AlexKucera d9cb615bc2 fix(editor): engine-agnostic decoration measurement (#71 follow-up 4)
The reading canvas runs TextKit1 (textLayoutManager nil — the scroll-view
config path engages the TK1 bridge), so the TK2 fragment walk found
nothing and draw() bailed: no hairline, no grid. framesForRange() now
measures through whichever engine is live — TK2 fragments, else TK1
boundingRect per character line (lineFragmentRect returns degenerate
rects mid-layout; boundingRect is truthful, pixel-verified).

Headless pixel probe (temporary, deleted): quote hairline + table grid
lines render at the right coordinates.
2026-10-06 11:56:58 +02:00
AlexKucera 2fbc8af24d fix(editor): measure decorations via TK2 fragment geometry (#71 follow-up 3)
The TK1-compat layoutManager reports wrong rects under TextKit2 — the
table grid drew compressed above its text, the quote hairline landed
mid-heading. fragmentFrames(for:) walks NSTextLayoutManager fragments
(the engine's own frames, document order): quote hairlines span the
block, HRs center on their line, table verticals span all rows and
horizontals underline every grid line.
2026-10-06 11:36:29 +02:00
AlexKucera 4138bf22dd fix(editor): draw quote/HR/table decorations on the canvas (#71 follow-up 2)
NSTextBlock/NSTextTable layout is broken on this TextKit build regardless
of engine: textBlocks zero-width the line rect (quotes wrapped one
character per line), NSTextTable rows stack vertically with no grid
(tables rendered as concatenated text with a stray outline). The TextKit1
bridge attempt failed live too. Stop fighting the API:

- Presenter emits plain content: quotes indent-only, HR a thin invisible
  line, tables mono-space-padded grid text with alignment honored.
- Each Block/Bound carries a Decoration payload (quote indent, rule,
  table column offsets); ReadingCanvasView.draw renders hairlines,
  rules, and table grids from measured layoutManager geometry.
- Tests assert decorations + column alignment instead of textBlocks.

Full suite green; lint clean.
2026-10-05 18:05:16 +02:00
AlexKucera c410c99bf8 fix(editor): reading-mode layout + stale-reload defects (#71 follow-up)
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.
2026-10-05 17:41:34 +02:00
AlexKucera c4555ed810 docs(dox): record reading-mode surfaces in app + tests AGENTS.md (#71) 2026-10-05 15:52:03 +02:00
AlexKucera 4c91733e78 feat(editor): land reading toggle — render, interact, typography slots (S1.2 #71)
Map #20 execution child, built per decisions #68/#69/#70:

- ReadingPresenter: block-aware renderer (ADR-0010 stance) — blank-line
  split, one block per chunk; lists (bullets + ordered + nesting +
  auto-renumber via per-level counters — one rendering path), headings
  by level (h1 = slot size, h2 = 0.77x, ### = body+1, #### floors at
  bold body), HR via the editing syntaxOnly predicate, fenced code,
  blockquotes (QuoteTextBlock hairline), tables (NSTextTable 1px
  border, delimiter-row alignment), images (hover payload), links
  styled + retained. Footnotes stay fallback. Source ranges ride every
  block (click→edit map).
- ReadingSurface: read-only selectable NSTextView canvas (#68: a
  presentation of the same TextKit2 document). Tap with no selection
  after mouseDown returns = edit intent at the clicked block (the
  tracking-loop fix); ⌘-click opens links; scroll tracking feeds the
  flip-back caret; image hover NSPopover loads off-main.
- ProseTypography (#70): three role slots — Body / Headings / Code —
  each {face, size}, UserDefaults six values, member-based font
  resolution (family+weight lookup misresolves Concourse Book→Thin),
  silent system fallback; both prose surfaces read them; editing
  presenter's headings + dimmed syntax rewired through the slots.
- PostEditorView: Read⇄Edit toolbar button (far left) + View menu
  "Toggle Reading Mode" + ⌘R; reading state transient per open; drafts
  included (draft mirror); flip-back caret hint applied once per token.
- SettingsPaneView: Typography section — three slot rows (family
  picker incl. current face not in the installed list + size field).
- kitchen-sink.md (+png): corpus piece exercising constructs absent
  from the eight posts, per #69.

Verified: 94 unit tests (renderer classification, renumbering, source
ranges, fallbacks) + UI smoke; PERF-3k renders 128 blocks in ~17 ms;
live-app probe — Read renders kitchen-sink markers-hidden, renumbered,
byte-stable file after full round-trip; click-to-edit flips at the
clicked paragraph; typography ladder pixel-verified (20/15 ink px).
2026-10-05 15:51:28 +02:00
AlexKucera f2953ee07e feat(editor): land editor core — open, edit, autosave (S1.2)
CI / ci (push) Canceled after 0s
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
2026-10-05 10:56:33 +02:00
AlexKucera 530f852f75 feat(workspace): land Post lifecycle (S1.1)
CI / ci (push) Canceled after 0s
Posts become writable end to end per the #18 map decisions:
New Post holds an in-memory draft (folder appears only on first
save), first save stamps the flat frontmatter block the #17
reader already parses (pass_state First Draft, origin writer,
immutable after stamping), and the Post ID is the Title slug with
case-insensitive collision suffixes. Explicit Rename retitles the
# Title line and moves the folder (post.md stays); Delete goes to
Trash. A recursive FSEvents stream keeps the list mirroring
posts/ — external Finder edits included.

Editor is a deliberate TextEditor stub; #19's TextKit2 editor
replaces it in place while the lifecycle machinery below the view
survives the swap.

Two review rounds (standards/spec + finish-audit fanout) fixed:
watcher start-order bug, writeNew clobber race, overwrite
resurrecting vanished posts with reset origin, rename destroying
non-heading first lines, draft hijacking the editor, debounce
starvation under churn.

Tests: 75/75 (17 new). Closes #18.
2026-10-03 13:34:00 +02:00
AlexKucera de76a50cc6 fix(acp): repair mentor bridge for adapter 0.21.5
Two bugs after the engine update, both found via a live NDJSON
repro against the real binary:

session/new now requires mcpServers in the ACP SDK schema
(NewSessionRequest). Museion sent only cwd, the engine answered
-32602, the handshake threw, and the pane showed "the mentor
engine stopped" — a validation rejection dressed as a crash. Send
the honest empty list; Museion ships no MCP servers (#44
invariant, now pinned on the wire by a strict fake in tests).

The advisory version-drift note compared raw strings: the gate
records the derived version from `acp --version`
(0.21.5+2177.g735e426) while initialize answers the base version
(agentInfo.version -> 0.21.5), fabricating drift on every launch.
Compare base versions (strip +build metadata); real drift still
fires.

Wire facts re-verified against adapter 0.21.5; docs updated.
2026-10-02 11:32:49 +02:00
AlexKucera 765d32d4d4 refactor(workspace): finish-audit fixes — off-main scan, parser edges, dead code out
Reviewers' findings on 804b588: scan moved off MainActor (Task.detached),
PostLibrary struct folded into Post.scan, hidden dirs and symlinked dirs
now actually skipped (test de-vacuated), unterminated frontmatter no longer
leaks as the Title, quoted YAML values unquoted, leading blank line before
--- tolerated, #-only body reads untitled, persisted Home validated
isFileURL. Dead code deleted: radiusLarge, editorMinWidth, homeKey,
PaneHeader trailing slot, Settings ScrollView, PostRow fill dance.
Tests 56/56, lint 0.

[Generated by AI]
2026-10-01 13:43:25 +02:00