From 2bd5169322ccdef87e0eccde61e372a291d6dad1 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Thu, 1 Oct 2026 15:52:17 +0200 Subject: [PATCH] =?UTF-8?q?docs(adr):=20record=20verdict=20=E2=80=94=20nat?= =?UTF-8?q?ive=20TextKit2=20prose=20editor=20(ADR-0010)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #55 on the map: TextKit2 mode B wins by the tie-breaker (calm > effort > proven-elsewhere); variable heading sizes + paragraph spacing required, reading toggle block-aware, anchor re-proof satisfied live. CodeEdit exits Museion; Classis pin untouched. Paper-grade polish is iterative practice, not a deferred phase. Spike artifacts stay on this branch for reference. [Generated by AI] --- AGENTS.md | 1 + docs/AGENTS.md | 2 +- docs/adr/0010-native-textkit2-prose-editor.md | 14 +++++ ...-issue55-verdict-substrate-adr-0010_log.md | 56 +++++++++++++++++++ docs/devlog/INDEX.md | 1 + 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 docs/adr/0010-native-textkit2-prose-editor.md create mode 100644 docs/devlog/20261001-issue55-verdict-substrate-adr-0010_log.md diff --git a/AGENTS.md b/AGENTS.md index c4b5c31..0f94f8a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -177,6 +177,7 @@ Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Fu | Date | Log | |------|-----| +| 2026-10-01 | [20261001-issue55-verdict-substrate-adr-0010_log.md](docs/devlog/20261001-issue55-verdict-substrate-adr-0010_log.md) | | 2026-09-16 | [20260916-issue14-acp-bridge-s2-2_log.md](docs/devlog/20260916-issue14-acp-bridge-s2-2_log.md) | | 2026-09-05 | [20260905-issue48-provisioning-failure-alert-retry-ux_log.md](docs/devlog/20260905-issue48-provisioning-failure-alert-retry-ux_log.md) | | 2026-09-03 | [20260903-issue42-engine-gate-s2-1_log.md](docs/devlog/20260903-issue42-engine-gate-s2-1_log.md) | diff --git a/docs/AGENTS.md b/docs/AGENTS.md index 6a9733c..8fc75bb 100644 --- a/docs/AGENTS.md +++ b/docs/AGENTS.md @@ -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`–`0009`: stack, license, forge/CI, content layout, learnings home, fix-card transport, state ownership, tools host, sandbox posture). +- ADRs live in `docs/adr/`, sequentially numbered `NNNNN-slug.md` (currently `0001`–`0010`: stack, license, forge/CI, content layout, learnings home, fix-card transport, state ownership, tools host, sandbox posture, prose editor substrate). - 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. diff --git a/docs/adr/0010-native-textkit2-prose-editor.md b/docs/adr/0010-native-textkit2-prose-editor.md new file mode 100644 index 0000000..9b7268d --- /dev/null +++ b/docs/adr/0010-native-textkit2-prose-editor.md @@ -0,0 +1,14 @@ +# 0010 — Native TextKit2 prose editor (mode B) + +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). + +## Considered Options + +- **CodeEditSourceEditor fork `0.15.8-helm`** (the presumptive leader, proven in Classis): anchor mechanics clean, but the substrate cannot reach typographic calm — one font size for everything, no paragraph spacing (`EditorTheme`/`attributesFor` builds every run from a single base font), mid-word wraps at typographic apostrophes, and emphasis ghost-doubles colored spans (CATextLayer re-draw, unfixable from the API side). Museion takes no CodeEdit dependency; Classis keeps its fork pin, untouched. +- **SwiftUI block editor (mode C, live preview)**: best-in-class typography, but structural interaction ceilings — no cross-block selection, per-block undo only, split/merge outside any undo stack, and lists shatter into per-bullet blocks. Each solvable, none for free; it pays in interaction-model decisions where TextKit2 pays in already-written presentation code. + +## Consequences + +- Typography stance: variable heading sizes and real paragraph spacing are required, and natively expressible — not a compromise to accept. +- Reading toggle renders block-aware: blank-line split, per-paragraph inline parse, headings fonted by level. A monolithic single-`Text` `.full` markdown dump flattens block structure — the anti-pattern. +- Paper-grade polish is not a deferred phase; it is iterative practice, applied whenever the writing surface feels short of calm. diff --git a/docs/devlog/20261001-issue55-verdict-substrate-adr-0010_log.md b/docs/devlog/20261001-issue55-verdict-substrate-adr-0010_log.md new file mode 100644 index 0000000..0034fa6 --- /dev/null +++ b/docs/devlog/20261001-issue55-verdict-substrate-adr-0010_log.md @@ -0,0 +1,56 @@ +# Wayfinder map #16 closed — editor substrate verdict + ADR-0010 + +> **Date:** 2026-10-01 +> **Type:** issue +> **Reference:** [#55 Verdict: substrate decision + ADR-0010](https://git.babylondreams.de/AlexKucera/Museion/issues/55) (map: [#16](https://git.babylondreams.de/AlexKucera/Museion/issues/16)) + +## Goal + +Resolve the final ticket of wayfinder map #16: the live verdict session weighing the three editor spikes (A CodeEdit fork, B TextKit2, C SwiftUI blocks) and drafting ADR-0010. + +## What Was Done + +- Claimed #55, verified all three blockers (#52, #53, #54) closed with resolutions; verified the spike `run.sh` entry points and anchor-highlight wiring in `spike/textkit2/` exist before the session. +- Two grilling rounds with Alexander (live side-by-side of all three spikes): substrate+mode (Q1), v2 path (Q2), then typography stance, fork-sharing, reading renderer, anchor story (Q3–Q6). +- Drafted `docs/adr/0010-native-textkit2-prose-editor.md` (Considered Options + Consequences per format). +- Posted the #55 resolution comment (issuecomment-22384), closed #55. +- Updated map #16: verdict appended to Decisions so far, Not-yet-specified emptied, re-scope of #19–#21 moved to Out of scope (downstream hand-off), map closed — frontier empty, way clear. +- DOX pass: `docs/AGENTS.md` ADR range bumped 0001–0009 → 0001–0010. + +## Decisions & Rationale + +| Decision | Rationale | +|----------|-----------| +| **Substrate: native NSTextView/TextKit2, mode B** (styled source, dimmed syntax, reading toggle; zero editor dependencies) | Tie-breaker `calm > effort > everything else`. A cannot express variable heading sizes or paragraph spacing (substrate limit) plus integration tax; C confirmed hands-on — bullet lists shatter into per-bullet blocks, no cross-block selection, per-block undo. B: editing native/free, presentation is an already-written attribute map. | +| Typography: variable heading sizes + paragraph spacing required | "A must for a proper writing tool" — and natively expressible in B, so no compromise to record. | +| Fork-sharing: dissolved | Museion takes no CodeEdit dependency; Classis keeps `0.15.8-helm` untouched. | +| Reading toggle: block-aware rendering | Blank-line split + per-paragraph inline parse + headings fonted by level; single-`Text` `.full` dump is the anti-pattern (flattens blocks). | +| Anchor story: re-proof satisfied | Spike B proves exact-range quote highlight + `scrollRangeToVisible` + stale-alert with web-proto wording, live; 2.4 ms on PERF-3k. | +| Paper-grade polish: iterative practice, not a phase | Alexander: tackled step by step whenever something needs more polish. Premise for un-deferring never materialized. | + +## Gotchas & Fixes + +| Problem | Root Cause | Fix | +|---------|------------|-----| +| Gitea issue-asset upload (`POST /issues/55/assets`) returns 500 HTML | Server-side breakage on this instance (spike tickets show `"assets":[]` too — precedent) | Dropped the attachment; ADR gist in the resolution comment, file in the working tree, referenced by path | +| `patch` hit the wrong path (`scratch/docs/AGENTS.md`) | Terminal cwd had moved to scratch; patch used a relative path | Re-ran patch with absolute path | +| `tea`-skill traps confirmed | - | Asset upload with `-F file=` also 500s; map body PATCH via `-F body=@file` works cleanly | + +## Files Changed + +| File | Change Summary | +|------|---------------| +| `docs/adr/0010-native-textkit2-prose-editor.md` | NEW — the substrate ADR (uncommitted, on `spike/editor-presentation` working tree) | +| `docs/AGENTS.md` | ADR range 0001–0009 → 0001–0010, added "prose editor substrate" | +| Gitea #55 | Resolution comment + closed | +| Gitea #16 | Decisions so far + Out of scope updated, map closed | + +## Open Items & Next Steps + +- [ ] Alexander: commit ADR-0010 to main / merge the spike branch — his call, outside the map +- [ ] Re-scope #19–#21 against ADR-0010 (downstream hand-off; #19 is now a TextKit2 integration) +- [ ] Spike B styling flaws (left-anchored measure, tight first line) → production work in #20/#21 + +--- + +*Log written by write-log skill* diff --git a/docs/devlog/INDEX.md b/docs/devlog/INDEX.md index 287d949..ea17adb 100644 --- a/docs/devlog/INDEX.md +++ b/docs/devlog/INDEX.md @@ -5,6 +5,7 @@ Complete history of session logs in this directory, newest first. One-line summa | Date | Type | File | Summary | |------|------|------|---------| +| 2026-10-01 | issue | [20261001-issue55-verdict-substrate-adr-0010_log.md](20261001-issue55-verdict-substrate-adr-0010_log.md) | #55 + map #16 closed: TextKit2 mode B wins, ADR-0010 drafted, typography/rendering stances locked | | 2026-09-16 | issue | [20260916-issue14-acp-bridge-s2-2_log.md](20260916-issue14-acp-bridge-s2-2_log.md) | #14 M0 ACP bridge: NDJSON JSON-RPC client, mentor pane, fix-card round-trip, crash restart — 37 tests green | | 2026-09-05 | issue | [20260905-issue48-provisioning-failure-alert-retry-ux_log.md](20260905-issue48-provisioning-failure-alert-retry-ux_log.md) | #48 shipped: failure card with retry/Not-Now, traversal guard, temp sweep — 30 tests green | | 2026-09-03 | issue | [20260903-issue42-engine-gate-s2-1_log.md](20260903-issue42-engine-gate-s2-1_log.md) | Engine gate S2.1 shipped: six-path probe, blocking sheet, state.json, About mirror — 12 tests green |