diff --git a/PRD.md b/PRD.md index bda98b6..e85d84c 100644 --- a/PRD.md +++ b/PRD.md @@ -15,7 +15,7 @@ - v1 = the Mentor Loop + library-light; long-form structure, multi-mind, Paper-grade polish deferred to v2+ - **Engine (G1, resolved):** Museion is the shell; Hermes (Python, NousResearch, MIT) is the engine, driven over **ACP** — spawned as a child process `hermes acp -p museion` (stdio JSON-RPC). **User-installed Hermes** — no app-managed install, no bundled Python. First run gates on `hermes acp --check`. - **Profile isolation (G3, this session):** Museion always runs Hermes under the dedicated `museion` profile (`~/.hermes/profiles/museion/` — isolated config, memory, skills, credentials, chat history). Coding learnings and writing learnings never mix. Not configurable in v1. -- **Provisioning (G3a):** first run creates the `museion` profile if missing, then seeds the writing skills bundled in the app (Serif stack, container persona files, demonstrator doctrine, distilled craft canon, drill packs) into `~/.hermes/profiles/museion/skills/`. Seeding is **additive only** — a bundled skill absent from the profile is copied; an existing one is never overwritten, because the mentor's self-improving skills live there. +- **Provisioning (G3a):** first run creates the `museion` profile if missing, then seeds the writing skills bundled in the app (Serif stack, merged deslop, container personas, demonstrator doctrine, distilled craft canon, drill packs — spec: *The bundled skill set*) into `~/.hermes/profiles/museion/skills/`. Seeding is **additive only** — a bundled skill absent from the profile is copied; an existing one is never overwritten, because the mentor's self-improving skills live there. - **Profile backup (G4):** Museion snapshots `~/.hermes/profiles/museion/` to `~/Library/Application Support/Museion/Backups/` — timestamped, at most once per day on launch, keeping the last 7. Snapshot is a complete copy (credentials included) so restore is one Finder copy-back; backups stay user-local, never in the project or git. - **Content layout (G5, merged):** one Museion Home; a post is a folder `posts//` holding `post.md`, `research/`, `assets/` — created lazily on first write. Further writing types (`essays/`, `stories/`) get the same shape when they arrive; v1 ships `posts/` only. Post id = slug of the draft's first line, computed at first save; explicit Rename moves the folder (the file is always `post.md`); external markdown edits as-is, Import (copy, never move) makes it a Post. ADR-0004. - **Writing tools (G6, merged; ADR-0008 + ADR-0006):** the Museion binary doubles as the stdio MCP server `museion-tools`, registered into the profile at provisioning — any MCP-capable engine registers it as a client (engine-swap seam — Hermes today, Pi the identified fallback, ADR-0007). Tool surface: `query_learnings`, `submit_fix_cards` — the fix-card tool's argument schema is the fix-card schema; anchors are quote-based (exact substring + occurrence + context), so edits between issue and accept degrade to a loud no-match, never a wrong-span patch. Research stays engine-native; draft stats are computed natively in Swift at capture time — not an agent tool. Pass prompts are Museion-sent minimal stubs (pass name, piece path, tool reminders) — all methodology lives in the profile's skills. The Serif methodology (SKILL.md files, agentskills.io-standard) stays the mentor's operating system. Fallbacks if ACP ever falls short: Hermes gateway JSON-RPC (every feature), HTTP+SSE API server. @@ -49,7 +49,7 @@ v1 delivers this as the Mentor Loop. The workflow is not hypothetical — it alr **In scope:** the seven features below, sequenced M0–M6 (loop-first). -**Non-goals (deferred to v2+ or never):** long-form structure tools (binder/compile), multi-mind agents, vault depth (backlinks, graph), native Swift agent loop, app-managed Hermes install/venv, publish targets beyond Micro.blog, platforms beyond macOS, App Store distribution (GPL-3 landmine — struck), session↔Post link machinery, engine-swap transcript migration, AI-draft wizards/templates, mentor image judgment (the author judges illustration style; the mentor never assesses images). +**Non-goals (deferred to v2+ or never):** long-form structure tools (binder/compile), multi-mind agents, vault depth (backlinks, graph), native Swift agent loop, app-managed Hermes install/venv, publish targets beyond Micro.blog, platforms beyond macOS, App Store distribution (GPL-3 landmine — struck), session↔Post link machinery, engine-swap transcript migration, AI-draft wizards/templates, mentor image judgment (the author judges illustration style; the mentor never assesses images). Deferred-but-wanted items are collected in *v2 parking lot* below. **Milestones:** @@ -65,6 +65,18 @@ v1 delivers this as the Mentor Loop. The workflow is not hypothetical — it alr M0–M3 is the ~3-month differentiator core; M4–M6 are sheddable in that order if scope pressure returns. +### v2 parking lot (deferred, not lost) + +From the 2026-08-28 sessions (Sudowrite/Muse learnings; issues #9, #10). None of it blocks v1. + +- **Periodization** — the M4 trend view names the dominant persistent weakness across recent unaided first drafts and surfaces the matching drill from the prompt-pack as the recommended next exercise (game film → drills → periodization). +- **Per-post context sheet** — the essay Story Bible: thesis, audience, key claims, what this post is *not* (frontmatter + prompt pack). +- **Fierce↔coach dial, per project** — the fierce end qualitatively different (blunt diagnostic mode), not just tone. +- **Mentor lenses** — user-buildable critique flavors with context injection ("check only evidence gaps," "critique as a New Yorker editor would"). Ship lenses, not ghostwriters. +- **Reader-simulation session flavor** — three simulated readers: what landed, where they stopped. Fills the reader-psych shelf with a prompt pack. +- **Demonstrator-model audition (optional)** — Claude Fable 5 (human-judged #1 on the Hemingway bench; GLM-5.3's nearest register neighbor, stronger emotional depth) and Muse Glimmer 30B (Apache-2.0 open weights, one 24 GB GPU; credible community prose reputation, unlisted on EQ-Bench — audition-tier) vs the `zai/glm-5.3` pin: same draft, same skills, one session each; actors, not authors — the winner executes the doctrine best. Glimmer doubles as a local-engine candidate for the ADR-0007 swap seam (fully-on-device critique story). +- **Dedicated lint repair model** (GPT-5.6-line) if the lint ever grows a repair loop — curiosity only. + ## User stories ### Editor surface (M1) @@ -81,14 +93,14 @@ M0–M3 is the ~3-month differentiator core; M4–M6 are sheddable in that order - **S2.5 — Trust model.** As the writer, the mentor acts only within trust levels: auto-act / inform-after / ask-before / never-do. *AC:* trust level maps to UI (dimmed inline edits vs blocking asks); never-do actions never auto-apply. Defaults, not configurable in v1: research fetch = auto-act; candidate source-note = inform-after; apply any fix, promote, keep note, publish = ask-before; delete files, touch anything outside Home and profile, shell, git = never-do. - **S2.6 — The engine is backed up.** As the writer, the mentor's accumulated state (memory, skills, history) survives profile corruption or a bad update. *AC:* on launch, if the last snapshot is older than a day, Museion copies `~/.hermes/profiles/museion/` to a timestamped snapshot under `~/Library/Application Support/Museion/Backups/`, keeping the last 7 (G4); complete copy, credentials included; restore is manual copy-back in v1; snapshots never land in the project or git. - **S2.7 — Draft from session.** As the writer, a freeform session can birth a Post. *AC:* "New Post from Session" creates the piece folder, writes the draft, stamps `origin: ai` (immutable — never stats-eligible); brainstorming is a session started with a brainstorm prompt — no separate machinery; session↔Post association stays by name/convention. -- **S2.8 — Drill offers at the motivation moment.** As the writer, when a pass exposes a weakness, the mentor may offer a micro-drill targeting exactly that weakness. *AC:* drills are session flavor (prompt-pack) — no machinery beyond S2.3; ≤2 minutes, offered right after the pass finding that motivates it; never homework, queues, or streaks; a declined drill vanishes; drills never edit the draft. +- **S2.8 — Drill offers at the motivation moment.** As the writer, when a pass exposes a weakness, the mentor may offer a micro-drill targeting exactly that weakness. *AC:* drills are session flavor (bundled prompt-pack skill — see *The bundled skill set*), no machinery beyond S2.3; ≤2 minutes, offered right after the pass finding that motivates it; single-dimension rule — a drill targets exactly one weakness shelf, the pattern the pass just exposed, nothing else; never homework, queues, or streaks; a declined drill vanishes; drills never edit the draft. ### Structured edit passes → fix cards (M2) - **S3.1 — Run a pass.** As the writer, I run Pass 1 (paragraph level and up — the skill stack's compose pass) or Pass 2 (line level — its hunt pass) on the current draft as a first-class document state. *AC:* running a pass never destroys text; changes diff against the original — a pre-pass snapshot lands in the post's `passes/` (latest per pass type kept); Pass State advances when the pass completes, not when its cards resolve; passes run in any order — order is the skill stack's to nag about, never the app's to enforce. A pass completes when the engine's turn ends — stream complete, tool calls settled. -- **S3.2 — Read fix cards.** As the writer, each finding arrives as a card: problem → diagnostic question → fix. *AC:* cards anchor to text spans; applying a card writes the file; the card schema is the critique-memory schema. +- **S3.2 — Read fix cards.** As the writer, each finding arrives as a card: problem → diagnostic question → fix. *AC:* cards anchor to text spans; applying a card writes the file; the card schema is the critique-memory schema; cards arrive ranked and capped per pass — an attention budget, not an infinite scroll. - **S3.3 — Keep my hand on the wheel.** As the writer, I accept or skip each card; ask-before fixes block until answered. *AC:* no batch-apply-all in v1. -- **S3.4 — Native deslop lint.** As the writer, deterministic style findings arrive as fix cards without an engine round-trip. *AC:* banned-vocab tiers and em-dash density computed in Swift at pass invocation, after First-Draft stats capture (S5.1); findings use the fix-card schema (ADR-0006) and render like any card; same trust model (ask-before apply). Evidence: prompting tops out ~80% style compliance — the last 20% is deterministic-checker territory (three 2026 studies; session doc, model research digest). +- **S3.4 — Native deslop lint.** As the writer, deterministic style findings arrive as fix cards without an engine round-trip. *AC:* banned-vocab tiers and em-dash density computed in Swift at pass invocation, after First-Draft stats capture (S5.1); findings use the fix-card schema (ADR-0006) and render like any card; same trust model (ask-before apply); the vocab tiers and em-dash budget ship as data, trivially editable without a recompile. Evidence: prompting tops out ~80% style compliance — the last 20% is deterministic-checker territory (three 2026 studies; session doc, model research digest). ### Persistent critique memory — the load-bearing feature (M3) @@ -114,6 +126,24 @@ M0–M3 is the ~3-month differentiator core; M4–M6 are sheddable in that order - **S8.2 — Keep or reject.** As the writer, I curate: nothing auto-saves. *AC:* candidates live in their Session until kept — resume brings them back; they are engine-owned cargo, expendable with the engine (ADR-0007); kept notes are plain markdown in the post's `research/` folder; rejected ones vanish — noise never feeds the mentor. - **S8.3 — The library feeds the loop.** As the writer, kept notes are consulted as context on every pass. *AC:* the manuscript-is-the-codebase promise holds at v1 depth. +## The bundled skill set (the G3a payload) + +The mentor's mind ships as markdown skills inside the app, seeded additively into `~/.hermes/profiles/museion/skills/` at first run (G3a). Spec'd here so the set can be authored independently of the app milestones — seeding is additive, so skills can land progressively. Folded from the 2026-08-28 mentor-feel session + Sudowrite/Muse learnings (issues #1–#10; docs under `docs/brainstorming-output/`). + +- **Serif stack — as-is.** The proven daily workflow: three-pillar style DNA (Sanderson/Brown/King), 24 anti-patterns, banned-vocab tiers, Editor's Knife line fixes, two-pass rule, learning capture. +- **fiction-craft — as-is.** Developmental level (misbelief, introspection, protagonist agency, varied emotional beats) for when fiction arrives. +- **deslop — humanizer + unslop merged into one skill.** One rule set, strongest detection/fix patterns from each source; every pattern survives or is consciously dropped with a reason. Personas and the demonstrator gauntlet reference this one skill. +- **Pass persona.** Editor-in-Chief 40 · Knife 30 · Coach 10 · Leader 10 · Sparring 8 · Sensei 5 — structural intelligence first, line-level deletion second. +- **Session persona.** Coach 40 · Knife 30 · Sensei 10 · Sparring 10 · Chief 5 · Leader 0 — pattern-teaching across drafts; answers, not Socratic questions. Both personas: the Knife never leaves the room (anti-sycophancy floor is constant); warm-but-firm by blend arithmetic, not a mood adjective; learnings consulted silently — inform the critique, never nag. +- **Voice-anchor rule (both personas).** Critique calibrates against the writer's best published prose — a small curated sample, the writer's explicit pick, never auto-collected. Drift is called out as "this isn't how you write openings; yours are better" — a critique baseline, never a copy-target or generation-style input. +- **Demonstrator doctrine.** Master-study method: demonstrate in a named master's style ("your paragraph, as Brown would pace it"), annotated with what changed and why. Options by default — variants, never a lone rewrite (a single example reads as the answer; variants read as a lesson). Bounded span: ≤ ~100 words, always on the writer's own material — never the piece, never open-ended generation. Every composed example passes the deslop gauntlet before the writer sees it (who deslops the deslopper). The writer's picked variant feeds Learnings (which master voice won). In-bounds per CONTEXT.md: example paragraphs, drafts, corrections — never a one-button final piece. +- **Micro-drill prompt-pack.** Drill offers ride the motivation moment — triggered by the pass finding that motivates them, ≤2 minutes, single-shelf targets, never homework/queues/streaks, a declined drill vanishes, drills never edit the draft (S2.8). Pattern-targeted examples: five cold openings none of which may contain "I"; rewrite this paragraph as Brown would pace it. +- **Craft canon (distilled).** 2–3 writing books distilled into diagnostic skills (problem, why it fails, fix — never summaries; fiction-craft is the pattern), one skill per shelf or per book, whichever distills cleaner. Fill the emptiest shelves first — primary: argument & rhetoric, structure for posts/essays, reader psychology, better-words doctrine (word precision beyond kill-lists); secondary: humor & punch, titles & hooks, revision craft. The craft-territory grid doubles as the acquisition checklist — every empty shelf names a book-slot. Distill-first: a writing-book RAG is built only if distillation underdelivers. + +**Cross-cutting rule — prompt-end constraints:** style constraints (banned vocab, anti-patterns, em-dash budget) sit at/near the *end* of the assembled pass prompt — Claude/GLM are recency-biased followers; top-of-prompt constraints decay by the time the draft arrives. Verify the real `museion` profile's prompt assembly with a real pass; fix the ordering if they land early; document the verified layout. + +**Done-looks-like:** a sample Pass and a sample Session produce visibly different mentor behavior; neither persona flatters; a worked master-study demonstration passes the gauntlet end-to-end. + ## Differentiation - **vs Obsidian + Copilot (the status quo to beat):** agent-first and native, not notes-first with an AI plugin. Obsidian is Electron, plugin-grade AI, note-shaped. Museion is manuscript-shaped with AI as a resident — and with *memory of the writer*, which a plugin can't own. @@ -140,7 +170,7 @@ M0–M3 is the ~3-month differentiator core; M4–M6 are sheddable in that order 1. **Bridge fragility / version drift** — ACP is production-ready (Zed, VS Code, JetBrains ship against it) and `--check` gates first run, but Hermes updates can still move the protocol. *Mitigation:* M0 tests against the actually-installed hermes-agent version and records it; documented fallbacks (gateway JSON-RPC, HTTP+SSE API server) exist if ACP regresses. 2. **No Swift ACP client SDK** (verified — Python only). *Mitigation:* M0 hand-rolls a thin client — ACP is JSON-RPC over stdio and Museion needs a small surface (initialize, session new/prompt/update, permission request/response, cancel). `ponytail:` hand-rolled thin client; adopt a Swift SDK if one appears. -3. **Token cost** — passes send draft + library + memory context. *Mitigation:* pass-scoped context assembly; model/provider pinned per profile (Hermes supports per-profile pins); v1 is personal, so the budget is visible, not abstract. +3. **Token cost** — passes send draft + library + memory context. *Mitigation:* pass-scoped context assembly; model/provider pinned per profile (Hermes supports per-profile pins); v1 is personal, so the budget is visible, not abstract — cost shown before the pass and kept predictable, never a deterrent to running another one (meter iteration kindly: revision-punishing metering is Sudowrite's #1 churn driver, and iteration is the product). 4. **Solo-dev scope / enthusiasm half-life** (~6 weeks, per roast Buyer). *Mitigation:* milestone slicing with M0–M3 as the sheddable-tail-free core; M4–M6 shed in order. The re-roast's guard: the narrow loop already grew back once — watch for it again. 5. **UX smothering fierceness** — friction is the product; polish that hides the critique kills it. *Mitigation:* critique stays visible and sharp in the UI (S3.2/S4 cards are first-class, never toasts). 6. **Stats validity** — measuring edited output proves the edits, not the writer. *Mitigation:* unaided-first-drafts-only is a hard rule (S5.1), not a setting. @@ -164,7 +194,7 @@ M0–M3 is the ~3-month differentiator core; M4–M6 are sheddable in that order - **G10 — Origin wall & session drafting (pi session).** "New Post from Session" stamps immutable `origin: ai`; only writer-origin First Drafts feed stats; brainstorm = session flavor; sessions engine-owned with resume/compact. - **G11 — Publish & model (main session).** Micropub token in Keychain, entered once, no OAuth in v1; model/provider user-managed in the profile config. - **G12 — Illustration gate → collapsed (grill session 3).** User decision: the author judges illustration style himself; the mentor never assesses images. M6 deleted, milestones renumbered; illustrations are plain image refs into `assets/`, and the publish floor lives in S6.2 — no photo ships without alt text. The `ref/` style guides stay author-side generation references, outside app scope. -- **G13 — Mentor feel & the skills ceiling (brainstorm session, 2026-08-28).** Decisions, evidenced in `docs/brainstorming-output/brainstorming-session-2026-08-28-0923.md`: (1) feel = trust that the mentor guards Alex's voice against AI-default register; two container personas — Pass = Editor-in-Chief/Knife (Chief 40/Knife 30), Session = Coach/Knife (Coach 40/Knife 30), warm-but-firm by blend arithmetic; learnings consulted silently, never nagged. (2) The persona exceeds the library: the stack covers ~1/3 of the craft territory and every empty shelf is additive (rhetoric, structure-for-posts, reader-psych, humor, better-words doctrine). Fill by distilling books into skills first; RAG only if distillation underdelivers. (3) The demonstrator role is in-bounds — master-study doctrine (example paragraphs in a named master's style, passed through the mentor's own deslop gauntlet); CONTEXT.md's "never composes" corrected to the real boundary: no one-button publish of mentor prose. (4) Micro-drills in v1 (S2.8) — ride the motivation moment; design for the lazy writer. (5) Native deslop lint in v1 (S3.4) — full style compliance needs a deterministic checker + repair loop, not prompts; style constraints sit at prompt-end (recency bias). (6) Model stays `zai/glm-5.3` — research-validated (EQ Longform 81.8, slop 7.09, Claude-Fable-nearest register); audition actors, not authors; optional later audition: Claude Fable 5 for the demonstrator role. +- **G13 — Mentor feel & the skills ceiling (brainstorm session, 2026-08-28).** Decisions, evidenced in `docs/brainstorming-output/brainstorming-session-2026-08-28-0923.md`: (1) feel = trust that the mentor guards Alex's voice against AI-default register; two container personas — Pass = Editor-in-Chief/Knife (Chief 40/Knife 30), Session = Coach/Knife (Coach 40/Knife 30), warm-but-firm by blend arithmetic; learnings consulted silently, never nagged. (2) The persona exceeds the library: the stack covers ~1/3 of the craft territory and every empty shelf is additive (rhetoric, structure-for-posts, reader-psych, humor, better-words doctrine). Fill by distilling books into skills first; RAG only if distillation underdelivers. (3) The demonstrator role is in-bounds — master-study doctrine (example paragraphs in a named master's style, passed through the mentor's own deslop gauntlet); CONTEXT.md's "never composes" corrected to the real boundary: no one-button publish of mentor prose. (4) Micro-drills in v1 (S2.8) — ride the motivation moment; design for the lazy writer. (5) Native deslop lint in v1 (S3.4) — full style compliance needs a deterministic checker + repair loop, not prompts; style constraints sit at prompt-end (recency bias). (6) Model stays `zai/glm-5.3` — research-validated (EQ Longform 81.8, slop 7.09, Claude-Fable-nearest register); audition actors, not authors; optional later audition: Claude Fable 5 for the demonstrator role. Full spec: *The bundled skill set*; the carrying issues (#1–#10) are folded into this PRD. Sudowrite/Muse learnings add Muse Glimmer 30B as a local-engine candidate (v2 parking lot). ## Stress-test verdict № 1 (2026-08-26 — carried from MISSION.md)