The publish sheet flipped a draft live and remembered nothing, so
nothing on disk said a piece was out and the library could not show
it. A successful Publish now stamps `micropub_published` in the
piece's frontmatter; the row and the sheet read `published <date>`
or `draft on Micro.blog`, and a published piece's menu opens the
live post.
Sending a piece again no longer creates a second post: a piece that
remembers its post updates it in place (name and content only, so
categories set on Micro.blog survive). An image whose bytes are
unchanged rides its earlier upload through a per-piece memo. When
Micro.blog answers 404 the piece forgets both keys and the sheet
offers a fresh draft; a clear that cannot land says so instead of
claiming the link is gone.
Museion's micropub keys are dropped at the import boundary. An
imported `micropub_url` passes the format gate and would aim the
in-place update at one of the writer's own posts under their token,
so the keys are treated like `origin`: ours to set, never a foreign
file's to carry in. Publish is model-owned and trust-gates its URL
before anything is stamped.
Tests read recorded requests through an optional accessor: an
out-of-range subscript after a failed count expectation trapped the
hosted runner and reported every queued test as crashed.
+16 tests net (17 new pins in MicropubStatusTests, one retired whose
premise the in-place design voids); every new pin was watched fail
on its own guard. Rail 752/752; SwiftFormat and SwiftLint clean.
Reviews: standards + spec during the build, then a three-reviewer
finish audit. Docs: AGENTS.md bullets and learnings, GLOSSARY
terms, CHANGELOG [Unreleased], README, and the devlog.
Closes#206
The app token could only be entered in the publish sheet, and that
field came back only after a 401/403, so a saved token had no standing
way to be replaced or removed. The new Settings → Micro.blog page
writes the same `MicropubTokenStore` slot the sheet reads, with a
status row read back from the Keychain after every write so a locked
keychain fails visibly instead of claiming "stored". The sheet now
names the stored token a send carries when its field is hidden.
Micro.blog's errors arrive as HTML pages, never Micropub JSON, so
`decodeFailure` fell through to a bare `HTTP 503` that said nothing
about whose side it was on. Any 5xx without a JSON description now
reads "unavailable on their side — retry in a few minutes"; a
described 5xx keeps its description and a 4xx keeps the bare status.
One decode covers create, publish, q=config, and media uploads.
Docs: AGENTS.md bullets, CHANGELOG [Unreleased] Added/Fixed, and the
devlog for this task plus the 0.1.2 release log.
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.