Jump to content

KdpPublish/SPEC

From MindAttic Docs

KdpPublish — Product specification

The complete product, written down before it is built (owner, 2026-11-30, MAT-T360). Every epic, feature and story the finished product will have is listed here, built or not. The ticket tree mirrors this file one to one: every ID below is a ticket. Nothing gets built unless it is here, and anything taken out of here is closed wont-do in the tree. docs/RELEASE.md says which part of this the current milestone delivers.

1. Product definition

Place in the ecosystem (docs/ECOSYSTEM.md): a product, the writing studio's storefront: it puts the books Prose presses on sale on Kindle, using AutoWebNav for the browser, Prose.Core for the KDP operator and the platform for keys, UI, documents, notifications and deploy.

KdpPublish is the owner's WPF desktop tool that publishes and republishes MindAttic books on Amazon KDP. A control panel (checklist, sign-off, live log) sits beside a real WebView2 pane on kdp.amazon.com; an LLM operator from Prose.Core drives the pane through AutoWebNav while the owner watches. The finished product puts every book Prose presses, GLMZ and every other universe, on sale on Kindle at the version on disk, with its ASIN recorded in Prose and linked from its universe wiki, and keeps the panel's status truthful by reading KDP's own bookshelf.

2. Scope boundary

2.1 In the product

  • The control panel and KDP pane, and the sequential publishing pass (panel button or command-line codes).
  • A Status column read off the KDP bookshelf, re-read every minute while idle and after every run.
  • Respect for KDP's limits (the weekly title-creation limit) and Psst alerts for every status change.
  • Read-only diagnostic launch modes (--diagnose, --scan-bookshelf, --crawl-categories, --probe-categories).
  • Publishing every pressed MindAttic book: GLMZ Series 1, later GLMZ seasons, other universes.
  • One deploy on R:\MindAttic\Apps\KdpPublish through the shared run menu; NUnit tests for the logic the panel and launch modes depend on.

2.2 Never in the product

  • The publishing logic itself (KDP store, manifest builder, operator tools): it lives in Prose.Core in the Prose repo and is re-vendored here (KP-LAW-3).
  • Book content: manuscripts, covers (including the CYB1–3 and REN placeholder covers) and exports come from Prose and MindAttic.Export.
  • Other KDP accounts, other stores, paperback/hardcover formats: the docs only ever describe the owner's Kindle ebooks.
  • A headless or scheduled publisher: publishing is a real external change and runs with the owner present (KP-LAW-1).
  • MindAttic.Log adoption (wont-do KP-T14, KP-T32..T34): the app already keeps a durable run log through KdpRunLogService.
  • Open-ended sweeps ("run the suite until green" KP-T11, "/simplify" KP-T12, exhaustive bughunts KP-T38) and the LF line-ending conversion (KP-T16): real bugs are filed one by one under the feature they touch.
  • Components.Wpf 5.0 dark title bar (KP-T3): superseded; the app is on Components.Wpf 19.0.0.

3. Users and roles

  • The owner runs publishing passes, signs off, watches the pane and receives alerts.
  • An agent observes a live run read-only through AutoWebNav (awn-observe ... kdp) and reads the recordings.
  • Prose supplies the books (manifest, versions, KDP plans) and stores the ASINs and publish URLs.
  • The GLMZ wiki and other universe wikis read those ASINs to link each book to Amazon.

4. Requirements

Status is built (closed ticket, with evidence) or MS-n: the milestone in §7 that delivers it. Every unbuilt story is approved and prioritised in build order; the planner splits a story into tasks when the queue reaches it.

E1. Publishing desk — KP-T57 — built

The panel, the KDP pane, the operator pass and the truthful status column.

F1.1 Panel and KDP pane — KP-T58 — built

  • S1.1.1 Panel beside KDP pane — KP-T59 — built As the owner, I see every tracked book in a checklist panel beside a live KDP pane, sign off a run and follow its log. Acceptance: Given the manifest loads, when the app starts, then every book shows with its version and status. Evidence: 801d14d, KdpPublish/MainWindow.xaml.cs.
  • S1.1.2 Sequential publishing pass — KP-T60 — built As the owner, I start a reconciliation pass from the panel or with KdpPublish.exe CODE1,CODE2, and the operator publishes or republishes each book in turn. Acceptance: Given codes on the command line, when the manifest loads, then the pass runs for just those codes. Evidence: App.xaml.cs auto-run mode.
  • S1.1.3 Observable, recorded sessions — KP-T61 — built As the owner or an agent, I can watch a live run through AutoWebNav observation, and every session is saved as a recording in Downloads. Acceptance: Given a run, when awn-observe status kdp runs, then it shows the run state and log tail. Evidence: bf759cb, 4dd579d.
  • S1.1.4 Read-only diagnostic modes — KP-T62 — built As a maintainer, I can snapshot a book's page, scan the bookshelf or crawl KDP categories without anything being clicked or typed. Acceptance: Given --diagnose CODE, then a JSON DOM snapshot lands in tools/kdp/ and nothing on KDP changes. Evidence: App.xaml.cs launch modes.

F1.2 Truthful status column — KP-T63 — built

  • S1.2.1 Status from the bookshelf, re-read every minute — KP-T29 — built As the owner, the Status column comes from KDP bookshelf rows (matched by ASIN, then titleId), re-read every minute while idle without moving the pane. Evidence: 4c689f4, 368d577.
  • S1.2.2 Statuses tell the truth — KP-T31 — built As the owner, Last Published is local time, the version column says < only when behind, and live-but-unconfirmed books read "Live (unchecked)", not Outdated.
  • S1.2.3 'Live Updates in review' reads Publishing — KP-T39 — built. Evidence: da97b67.
  • S1.2.4 Held-but-live books flagged — KP-T22 — built. Evidence: f24c25d.

F1.3 KDP limits and alerts — KP-T64 — built

  • S1.3.1 Weekly title-creation limit respected — KP-T30 — built As the owner, when KDP's weekly limit modal appears the book stops, the limit is stored until Sunday 00:00 UTC, new-title books wait, and the panel shows the reset time. Evidence: d507f5f.
  • S1.3.2 Psst publish alerts — KP-T65 — built As the owner, every KDP status change and run result reaches me as a panel bell and a Psst alert (KDPPUBLISH_NO_PSST=1 silences it). Evidence: 4c689f4.

E2. Build, deploy and docs — KP-T66 — built

F2.1 Deploy on R: — KP-T67 — built

  • S2.1.1 Shared run menu deploy — KP-T68 — built As the owner, run.bat redeploys Debug and Release to R:\MindAttic\Apps\KdpPublish and runs either copy. Evidence: 757d5ae, KP-T40.
  • S2.1.2 Vendored packages restore — KP-T27 — built. Evidence: 4a977f1.
  • S2.1.3 Prose.Core matches the Prose database — KP-T28 — built. Evidence: 455f6f5.

F2.2 Brochure and docs — KP-T69 — built

  • S2.2.1 Brochure and wiki docs — KP-T70 — built As a visitor, I read what KdpPublish is on its brochure page and its full docs on the MindAttic wiki. Evidence: 5ab32fe (KP-T53), d1846a0 (KP-T55).

E3. Series 1 on Kindle — KP-T26 — MS-39

Every one of the 23 GLMZ Series 1 books on sale on Kindle with its ASIN recorded and wiki linked.

F3.1 Every Series 1 book listed — KP-T44 — MS-39 (requires Prose PRS-T792, the owner's export decision)

  • Submit The Cabal (CYB3) — KP-T35 — MS-39. Given the saved draft, when it is submitted, then the bookshelf shows it In review or Live and Prose records it published.
  • List Read the Room (RTR) — KP-T49 — MS-39 (owner present; respects the weekly title limit).
  • List Babineaux's Guide (REN) — KP-T50 — MS-39 (owner present).
  • Record Series 1 ASINs — KP-T51 — MS-39. Then all 23 books have Nodes.Asin and PublishUrl in Prose.

E4. Trustworthy publishing tool — KP-T43 — MS-39

F4.1 New listings run unattended — KP-T46 — MS-39

  • Vendor Prose.Core checkbox fix — KP-T52 — MS-39 (waits on PRS-T1059 in Prose). Then a new listing passes the Content step without hand finishing.

F4.2 Bookshelf status trustworthy — KP-T47 — MS-39

  • Status mapping tests — KP-T4 — MS-39 (new KdpPublish.Tests NUnit project).
  • Scan parsing tests — KP-T5 — MS-39.

F4.3 Installs from the shared run menu — KP-T48 — MS-39

  • Remove C:\Apps\KdpPublish — KP-T41 — MS-39 (the folder still exists on 2026-11-30).

F4.4 Carries only licensed assets — KP-T56 — MS-39

  • Remove the Amazon Ember fonts — KP-T54 — MS-39. Given KdpPublish/wwwroot/fonts/AmazonEmber* are tracked, when they are removed, then the panel renders with a free fallback font and the build is clean.

E5. Every pressed book on Kindle — KP-T71 — MS-144 (requires KP-T26)

F5.1 Later GLMZ seasons — KP-T72 — MS-144 (requires Prose PRS-T1373)

  • S5.1.1 List later GLMZ books — KP-T73 — MS-144 As the owner, each GLMZ book Prose presses after Series 1 (Prose MS-107) is listed and submitted on KDP, respecting the weekly title limit, with its ASIN and PublishUrl recorded in Prose.
  • S5.1.2 Wiki links for later seasons — KP-T74 — MS-144 (requires KP-T73) As a reader, every later-season Book: page links to its Kindle listing once it is live.

F5.2 Other universes — KP-T75 — MS-144 (requires Prose PRS-T1384)

  • S5.2.1 Per-universe listings — KP-T76 — MS-144 (requires KP-T73) As the owner, the panel tracks books from every pressed universe (ePub\MindAttic\<universe>\<CODE>, Prose MS-108) and the operator lists each with its universe's categories and keywords.
  • S5.2.2 Universe ASINs recorded — KP-T77 — MS-144 (requires KP-T76) As the owner, every live book in every universe has its ASIN and PublishUrl in Prose for its wiki to link.

F5.3 KdpPublish 2.0 polish and release — KP-T79 — MS-144 (requires F5.1, F5.2; was bucket epic KP-T78, dissolved)

  • S5.3.1 Launch-mode parsing tests — KP-T80 — MS-144 (replaces wont-do KP-T6) As a maintainer, argument handling is a tested parser, so a bad argument never starts live automation in the wrong mode.
  • S5.3.2 Run-log formatting tests — KP-T81 — MS-144 (replaces wont-do KP-T7) As a maintainer, FormatEvent/Truncate are a tested static helper, since that text is the durable run log.
  • S5.3.3 2.0 docs and owner sign-off — KP-T82 — MS-144 (requires KP-T80, KP-T81) As the owner, the docs match the 2.0 app and I sign off one full catalog pass with every pressed book Live and linked.

Added by MAT-T477 (owner stories and cross-repo links)

  • F KP-T83 Announces published books (epic KP-T71, MS-144)
    • S KP-T84 Each new listing is announced: requires Relay's outbox (M.RLY-T99); related M.RLY-T101. Given a book goes live on Kindle, when KdpPublish records it, then a book-published message with its ASIN is on the Relay bus and survives a restart.

5. Non-functional requirements

  • Windows desktop only (WPF, WebView2); the KDP login session lives under %LocalAppData%\MindAttic\KdpPublish\ and survives redeploys.
  • KDP's bookshelf is ground truth; local bookkeeping never overrides it (KP-LAW-2).
  • No credentials in the repo; nothing redistributed that the repo has no licence for.
  • Builds clean with dotnet build KdpPublish\KdpPublish.csproj -c Release; tests are NUnit.

6. Interfaces and dependencies

  • By concern (docs/ECOSYSTEM.md §2.1): credentials — MindAttic.Vault; UI controls — MindAttic.Components.Wpf; documents — MindAttic.Export; notifications — MindAttic.Psst; browser automation — AutoWebNav; shipping — the shared run menu. Product dependency: Prose.Core for the KDP operator (the operator's code lives in Prose, F11.3 PRS-T1409).
  • Prose / Prose.Core (vendored in lib/local-packages): manifest, KDP store, operator tools; ASINs written back.
  • AutoWebNav (vendored): browser automation, live observation, session recording.
  • MindAttic.Components.Wpf 19.0.0, MindAttic.Vault, MindAttic.Export (diagnostic dumps).
  • MindAttic.Psst (psst on PATH): alerts.
  • GLMZ wiki (Prose.Wiki.GLMZ) and later universe wikis: read the ASINs to link books.

7. Release sequence

  1. MS-39 KdpPublish GLMZ Series 1 on Kindle (active, docs/RELEASE.md): epics KP-T26, KP-T43.
  2. MS-144 KdpPublish 2.0: every pressed book on Kindle (planned, the finished product): epic KP-T71, ending with its polish-and-release feature KP-T79. It follows Prose's own sequence (MS-107, MS-108) as books are pressed.

8. Change log

Date Change to scope Ticket
2026-11-30 Specification written from overview, BIBLE, RELEASE, the code and the ticket history; KP-T54 (licensed fonts) added to MS-39; 2.0 milestone MS-144 added as the finished product MAT-T386
2026-11-30 MAT-T462 single-source pass: 7 renamed (features to capabilities), 1 bucket dissolved (epic KP-T78; KP-T79 now closes KP-T71), 9 requires added (5 cross-repo on Prose), 0 platform re-points (already on AutoWebNav, Vault, Components, Export, Psst) MAT-T468
2026-11-30 MAT-T477 owner story for Relay adoption MAT-T477
Part of KdpPublish.
From KdpPublish/docs/SPEC.md via MindAttic.Docs; synced automatically, so edit the repo, not this page.