feat(microblog): add app token settings page and honest 5xx wording
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.
This commit is contained in:
1 parent
9aa0314564
commit
6938826101
11 files changed
+272
-14
No files matched your search
@@ -0,0 +1,51 @@
|
||||
# Release 0.1.2 — the macOS 27.2 image-drop fix ships
|
||||
|
||||
> **Date:** 2026-12-03
|
||||
> **Type:** milestone
|
||||
> **Reference:** Gitea release id 29 (tag v0.1.2); follow-up to #141 (unticketed fix, same-day)
|
||||
|
||||
## Goal
|
||||
|
||||
Ship the macOS 27.2 image-drop fix (this morning's `fix(editor)` work, finish-audited) as **0.1.2** — the first cut under the release skill's new patch-for-a-bug-fix rule — through the full runbook: apex check, bump, changelog heading, notes, rail, sliced commits, annotated tag, notarized DMG, then on Alexander's go: push, forge release, Micro.blog draft, Buy Me a Coffee draft.
|
||||
|
||||
## What Was Done
|
||||
|
||||
- **apex check (step 1):** GitHub `releases/latest` is still **v1.1.59** — identical to the bundled binary (published 2026-12-01). The shipped layout re-proven without any upgrade: exactly one rpath (`@executable_path/../Resources/libyaml.bundle`), `flags=0x10000(runtime)` + Developer ID authority, `--version` 1.1.59, and the load-bearing `--no-mixed-lists` check emits `<ul>` then `<ol>`. No `THIRD-PARTY-NOTICES.md` bump, no `### Changed` line. (The skill's "appears in `--help`" phrasing reads 0 because the help spells the flag `--[no-]mixed-lists`; the functional check is the evidence.)
|
||||
- **Bump (step 2, first run of the new rule):** `MARKETING_VERSION` 0.1.1 → 0.1.2 in all 6 pbxproj occurrences; build-settings read-back prints 0.1.2. Bug-fix cut → patch, per the rule committed this morning (`1b0c23a`).
|
||||
- **Changelog heading (step 3):** the former `[Unreleased]` Fixed entry moved under `## [0.1.2] - 2026-12-03` with the pointer line to the notes; a fresh empty `[Unreleased]` sits above.
|
||||
- **Notes (step 4):** `docs/releases/0.1.2.md` in the 0.1.1 shape — the fix told for a reader who never saw the ticket, the two deliberate refusals, install copy, suite numbers. **README (step 5):** no change — it carries no version-specific copy; "macOS 27 or later" matches `MACOSX_DEPLOYMENT_TARGET = 27.0`.
|
||||
- **Rail (step 6):** run `20261203T154235Z` (pid 41682) — **729/729**; swiftformat `--lint` 0/153; swiftlint 0. Freshness pinned on the test host's `Info.plist` reading **0.1.2** (zero `SwiftCompile` lines is expected — no Swift source changed).
|
||||
- **Slices + tag (step 7):** `build(release)` (notes) · `chore(release)` (bump + changelog heading) · annotated tag `v0.1.2` on the DMG tree `c959b67`. The `chore(release)` body wrapped at 74–77 columns past a 72 check — amended (tree byte-unchanged, verified) and the still-local tag force-moved onto the amended commit per the runbook.
|
||||
- **DMG (step 8):** `dist/Museion-0.1.2.dmg` — 3,167,265 bytes, **sha256 `2d0942ea1b5c01675feccc817424786f551b4ff4e1cc7aa8f60d016c54001913`**; mounted image: app `0.1.2`, apex `1.1.59`; `stapler validate` clean; `spctl` → `accepted, source=Notarized Developer ID`.
|
||||
- **On go (step 10):** `git push origin main v0.1.2` (remote main `d183d735` — Alexander's own `chore: ignore .hermes directory` rode between the tag and the push; the tag stayed on `c959b67`); `tea releases create` → release **id 29**, `draft: false`, one asset at the local byte size, body ends with the `[Generated by AI]` marker; token-authenticated download sha256-identical to the local DMG.
|
||||
- **Micro.blog (step 11):** draft posted to the main blog via `mp-destination` + `mp-channel: default` → 202, `Location: https://alexanderkucera.com/2026/12/03/164803.html`; read-back `q=source` → `post-status: draft`, download/release/notarized lines intact. **preview** `https://micro.blog/account/posts/239/preview/6088880`, **edit** `https://micro.blog/account/posts/239/edit/6088880`.
|
||||
- **Buy Me a Coffee (step 12):** `bmc.js` `create`/`draft`/`public` → `RESULT.mode: "draft"`, **editUrl** `https://www.buymeacoffee.com/posts/5336222/edit`; task space finished.
|
||||
|
||||
## Gotchas & Fixes
|
||||
|
||||
| Problem | Root Cause | Fix |
|
||||
|---------|------------|-----|
|
||||
| The apex `--help` grep for `no-mixed-lists` printed 0 | The help spells the flag `--[no-]mixed-lists` | The functional check (`printf … \| apex --no-mixed-lists` → `<ul>` then `<ol>`) is the evidence; expect the literal grep to miss |
|
||||
| The `chore(release)` body wrapped at 74–77 columns | Drafted wider than the 72 rule | Amended the message (tree verified unchanged), force-moved the still-local tag — after a push this would have been a new version |
|
||||
| `status` reported done ~60 s after `start`, looking like a stale summary read | Warm incremental build + no Swift changes: the suite is that fast on this tree | Freshness pinned on the run-dir pid (41682) and the test host's `Info.plist` version (0.1.2), not on elapsed time |
|
||||
| A `.hermes -> .agents` symlink appeared at the repo root mid-session | Hermes runtime artifact | Left untracked; Alexander committed `chore: ignore .hermes directory` (`d183d735`) which rode the release push |
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Change Summary |
|
||||
|------|---------------|
|
||||
| `Museion.xcodeproj/project.pbxproj` | `MARKETING_VERSION` 0.1.1 → 0.1.2 (6 occurrences) |
|
||||
| `CHANGELOG.md` | `## [0.1.2] - 2026-12-03` heading + notes pointer; fresh `[Unreleased]` |
|
||||
| `docs/releases/0.1.2.md` | NEW — human-readable notes |
|
||||
| `.agents/skills/release/SKILL.md` | (Alexander, `1b0c23a`) patch-for-a-bug-fix bump rule |
|
||||
|
||||
## Open Items & Next Steps
|
||||
|
||||
- [ ] Release live: https://git.babylondreams.de/AlexKucera/museion/releases/tag/v0.1.2 — DMG sha256 `2d0942ea…`, asset byte-identical on download.
|
||||
- [ ] Both announcements sit as DRAFTS in Alexander's queues (Micro.blog preview link, BMC edit link) — he publishes; rotation of the Micro.blog announce token recommended if it ever pastes into a transcript.
|
||||
- [ ] `/Applications/Museion.app` (0.1.1) should be replaced by the 0.1.2 DMG locally.
|
||||
- [ ] Next session: nothing pending from this release.
|
||||
|
||||
---
|
||||
|
||||
*Log written by write-log skill*
|
||||
@@ -0,0 +1,81 @@
|
||||
# Micro.blog: honest 5xx wording + a Settings page for the app token
|
||||
|
||||
> **Date:** 2026-12-04
|
||||
> **Type:** generic
|
||||
> **Reference:** unticketed — owner report in session ("publishing returns error 503; there is no place in settings to save the auth token")
|
||||
|
||||
## Goal
|
||||
|
||||
Two things the owner hit while publishing to Micro.blog. First, the publish sheet showed `Micro.blog said 503: HTTP 503` — find out whether the 503 was Museion's or Micro.blog's, and make the message say so. Second, the Micro.blog app token had no home in Settings: it was entered once in the publish sheet, the field came back only after a 401/403, and a saved token could not be replaced or removed anywhere in the app.
|
||||
|
||||
## What Was Done
|
||||
|
||||
- **Diagnosis first, no code.** Probed `https://micro.blog/micropub` tokenless at 14:01 CET: 25/25 POSTs → `400 Invalid request` (text/html — their no-token answer), homepage 200, media endpoint 400, an app-like User-Agent 400. The request shape matched the current `microblog.dev/api/posting` docs (JSON create with `post-status: draft`; `update`/`replace` is JSON-only, which is what `Micropub.swift` sends). Their documented error vocabulary is 400 (bad request) and 401/403 (auth) — a 503 is their nginx front with the app behind it not answering, or a rate limit. Their news feed logs the same pattern repeatedly (Nov 25 "traffic spikes or attacks", Nov 30 "blog publishing stuck", 2025-04-26 "sorry for the 503s"). The bare `HTTP 503` in the sheet was `decodeFailure` falling through: the body was an HTML page, so the JSON decode found no `error_description`.
|
||||
- `Micropub.decodeFailure(status:body:)` — the ONE failure decode every step shares (create, publish, q=config, media upload) — answers `unavailable on their side — retry in a few minutes (status.micro.blog)` for a 5xx that carries no JSON description. A described 5xx keeps its description; a 4xx keeps the bare `HTTP n`; 401/403 → `authFailed` unchanged. The sheet needed no change — it already renders `Micro.blog said <status>: <detail>`.
|
||||
- `SettingsPage.microblog` (label **Micro.blog**, last in the sidebar after Provider Keys) + `MicroblogSettingsPage` in `SettingsPagesView.swift`: a status line (stored / not saved), a `SecureField` + **Save** (replaces the stored token), a **Remove** button while one is stored. It writes the same `MicropubTokenStore` slot the publish sheet reads, so the sheet picks the token up unchanged.
|
||||
- `saved` is read back from the Keychain after every write: `save` is void (the `SecItemAdd` result is ignored), so a locked keychain would otherwise flip the status to "stored" falsely. On Save the read-back is compared with the token just written — an older token surviving a failed replace must not read as success.
|
||||
- Pin in `MicropubTests`: `a 5xx names micro.blog's outage not a bare status` — 503 over an HTML body → the their-side wording; 422 over the same body → `HTTP 422`; 502 with `error_description` → the description.
|
||||
- DOX: `Museion/AGENTS.md` (the Micropub bullet carries the 5xx contract and the token's two entry points; the Settings bullet names the page), the sheet's and both Settings files' headers, `CHANGELOG.md` `[Unreleased]` (Added + Fixed).
|
||||
|
||||
**Verification:** `./scripts/full-test.sh` — **736 executed / 736 passed / 0 failed** (run dir `_build/full-test/20261204T131024Z-Museion`; was 735, exactly +1). The filtered `MicropubTests` run 14/14 with `SwiftCompile` lines for every edited source. The new pin flip-verified: guard off (`status < 0`) → 14 executed / 13 passed / 1 failed, the one red being that pin with `detail → "HTTP 503"`; tree restored byte-exact (sha256 `21e9f101…` before and after). `swiftformat .` 0/153 formatted, `swiftlint .` exit 0.
|
||||
|
||||
**Follow-up, same session (owner: "there should be an indication on if the token was saved / is currently saved").** The owner was on the 14:59 build, so they had the page — the status was there, but as a muted intro-line text swap, which reads as description, not status. And the publish sheet showed nothing at all when a stored token was in use (the field just wasn't there).
|
||||
|
||||
- `MicroblogSettingsPage`: the intro is static again ("Where the Micro.blog app token lives."), and the status moved under the field row as its own row in the Settings verdict idiom — `✓ Token saved in your Keychain` in accent mono 11, `No token saved — publishing will ask for one` muted. Live: Save and Remove already read the Keychain back into `saved`.
|
||||
- `MicropubPublishSheet`: when the field is hidden because a token is stored, the sheet says `Sends with the app token in your Keychain — Settings → Micro.blog manages it.`
|
||||
- Verification: rail again on the settled tree — **736 / 736 / 0** (run dir `20261204T140402Z-Museion`). The two files were compiled by the standalone build that preceded the rail (`SwiftCompile` 2 lines each in its log; the rail's own build found them up to date — 0 lines, legitimately), so the artifact was checked instead: the dylib (15:04:07) postdates every source and carries all four new strings. `swiftformat --lint` 0/2, `swiftlint` 0. No new pin — both are view-only over the already-pinned store.
|
||||
|
||||
## Decisions & Rationale
|
||||
|
||||
| Decision | Rationale |
|
||||
|----------|-----------|
|
||||
| The 5xx wording lives in `decodeFailure`, not the sheet's `.requestFailed` branch | One decode serves create, publish, q=config, and media upload; every one of them surfaces through the same refusal line. Patching the sheet would have left the three other callers saying `HTTP 503`. |
|
||||
| A JSON description on a 5xx still wins over the outage wording | Never hide a real server explanation behind the generic line. Their documented errors are 400-shaped JSON; a 5xx from the app itself might still carry one. |
|
||||
| No retry, no `Retry-After` parsing | The user asked for honest wording. A 503 from an overloaded service is best retried by a human a few minutes later; automatic retries on a publish path can double-post. Add when a real outage pattern justifies it. |
|
||||
| The page goes into `SettingsPagesView.swift`, not a new file | This repo disables `file_length`/`type_body_length` ("deliberately large cohesive units"); the surface pages and Provider Keys already live there. |
|
||||
| Sidebar position: last, after Provider Keys | Enum declaration order is sidebar order. Credentials cluster at the end: provider keys (`.env`), then the one Keychain credential. |
|
||||
| `saved` is read back from the Keychain, compared with the written token on Save | `MicropubTokenStore.save` ignores the `SecItemAdd` status. A void write plus an assumed `saved = true` would lie on a locked keychain; comparing against the new token also catches a failed replace that leaves the old one in place. |
|
||||
| Capture `trimmedToken` into a local before clearing the field | `trimmedToken` is computed over `tokenField`. Clearing first made the read-back compare against `""` — always false. Caught before the first build. |
|
||||
| No "Test token" button on the page | The publish sheet's Send as Draft is the test, and a draft creates nothing public. A read-only `q=config` probe is a fine follow-up if the owner wants it. |
|
||||
| No view-layer pin | Repo convention: pure seams pinned, SwiftUI dogfooded. The page's logic is three calls into the store the `token store round-trips` pin already covers. |
|
||||
| The owner's Keychain token was confirmed present but never read | Credential rule. A read-only `q=config` with it was offered and not run; the tokenless probe was enough to rule out a hard outage. |
|
||||
| Unticketed, generic log | The owner asked for both fixes directly in session; no Gitea issue exists. The CHANGELOG carries the entry. |
|
||||
|
||||
## Gotchas & Fixes
|
||||
|
||||
| Problem | Root Cause | Fix |
|
||||
|---------|------------|-----|
|
||||
| My first test patch called `outcomeDetail(outage)`, a helper that does not exist | Wrote the pin from a mental shape instead of the suite's | Read the landed region before building; replaced with the suite's `guard case let .requestFailed` shape |
|
||||
| The patch tool's diffs around closing-brace runs read ambiguously (the `}` lines seemed added/re-indented) | Repeated `}` lines let the diff algorithm pair them unpredictably; the display is not the file | Read the landed regions and counted braces (open == close in every touched file) instead of trusting the diff |
|
||||
| The rail log showed 0 `SwiftCompile` lines for four of the edited sources on first grep | The earlier filtered run had compiled them (2 lines each in its log); the rail recompiled only the sheet, whose header comment changed after that build | Verified the artifact instead: the dylib postdates every source and carries all five distinctive strings |
|
||||
| `cut -c` on Swift source with em-dashes → `Illegal byte sequence` | macOS `cut` is not UTF-8-aware under the default locale | `read_file` for the region |
|
||||
| A tokenless POST answers **400** `Invalid request` (text/html), not 401 | Micro.blog's no-token answer is not REST-shaped | Useful probe signature for "is the endpoint up": 400 means healthy, 503 means theirs |
|
||||
| `MicropubPublishSheet` header said the token is "entered here ONCE" | True until this session | Header now names both entry points; the sheet's own logic is untouched |
|
||||
| Owner follow-up: "there should be an indication" although the page had a status text | The status sat in the intro slot — a muted 12pt subtitle swapping text — which reads as description, not state; the sheet showed nothing when a stored token was in use | A dedicated status row under the field in the Settings verdict idiom (`✓ …` accent / muted); the sheet names the stored token it sends with |
|
||||
| The first status-row patch nested `private var status` inside `form`'s body | The fuzzy patch matcher re-indents a replaced region that starts on a closing-brace run to the anchor's scope (the code-editing skill's rule 7) | Repaired by a programmatic splice of the whole struct between two unique doc-comment markers; verified column-0 struct line, brace balance, then swiftformat/swiftlint/build |
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Change Summary |
|
||||
|------|---------------|
|
||||
| `Museion/Micropub.swift` | `decodeFailure`: 5xx → their-side wording (JSON description wins); doc comment |
|
||||
| `Museion/SettingsPaneView.swift` | `SettingsPage.microblog` + label + detail switch; header |
|
||||
| `Museion/SettingsPagesView.swift` | `MicroblogSettingsPage` (status row / Save / Remove, Keychain read-back); header |
|
||||
| `Museion/MicropubPublishSheet.swift` | header comment (names the Settings manager); names the stored token a send carries when the field is hidden |
|
||||
| `MuseionTests/MicropubTests.swift` | +1 pin (5xx wording; 4xx and described-5xx contrasts) |
|
||||
| `Museion/AGENTS.md` | Micropub bullet (5xx contract, token entry points); Settings bullet (the page) |
|
||||
| `CHANGELOG.md` | `[Unreleased]` → Added (the page), Fixed (the wording) |
|
||||
| `docs/devlog/INDEX.md`, `AGENTS.md` | this log's row + the rolling window |
|
||||
|
||||
## Open Items & Next Steps
|
||||
|
||||
- [ ] Retry the publish that 503'd — the endpoint was healthy at 14:01 CET; if it 503s again, run a read-only `q=config` with the saved token (owner's go needed) to tell an account-specific 503 from a blip.
|
||||
- [ ] Dogfood Settings → Micro.blog: the `✓ Token saved in your Keychain` row shows on open; Save replaces it (Remove appears); Remove flips it to `No token saved` and the publish sheet offers its field again; the sheet shows `Sends with the app token in your Keychain…` while one is stored.
|
||||
- [ ] Optional: a **Test token** button (read-only `q=config`) on the page.
|
||||
- [ ] Optional: `Retry-After`-aware outage wording; automatic retry on 503 for the draft send (mind double-posting).
|
||||
- [ ] Pre-existing, untouched: the sheet's `showsTokenField` reads the Keychain on every body evaluation; a `.onAppear`-seeded state would read once.
|
||||
- [ ] Commit (maintainer) — nothing was committed, pushed, or commented on the forge.
|
||||
|
||||
---
|
||||
|
||||
*Log written by write-log skill*
|
||||
@@ -5,8 +5,10 @@ Complete history of session logs in this directory, newest first. One-line summa
|
||||
<!-- write-log: full-index -->
|
||||
| Date | Type | File | Summary |
|
||||
|------|------|------|---------|
|
||||
| 2026-12-04 | generic | [20261204-microblog-5xx-wording-token-settings-page_log.md](20261204-microblog-5xx-wording-token-settings-page_log.md) | Micro.blog publish: a 5xx names their outage instead of `HTTP 503`, and the app token gains a Settings page (rail 736/736) |
|
||||
| 2026-12-03 | issue | [20261203-issue205-reveal-in-finder-copy-path_log.md](20261203-issue205-reveal-in-finder-copy-path_log.md) | Reveal in Finder / Copy Path on library and Archive rows: one shared menu fragment over the model-resolved post.md path, three pins, rail 735/735 |
|
||||
| 2026-12-03 | issue | [20261203-issue204-fix-cards-jump-to-the-anchor_log.md](20261203-issue204-fix-cards-jump-to-the-anchor_log.md) | Fix Cards gain Jump: the anchor span selected in the editor, the main window keyed, over the #71 caret rail |
|
||||
| 2026-12-03 | milestone | [20261203-release-012-image-drop-fix_log.md](20261203-release-012-image-drop-fix_log.md) | Release 0.1.2 ships the macOS 27.2 image-drop fix: bump, notes, rail 729/729, notarized DMG, forge release id 29, drafts |
|
||||
| 2026-12-03 | generic | [20261203-image-drop-27-2-drag-routing-pastes-path_log.md](20261203-image-drop-27-2-drag-routing-pastes-path_log.md) | macOS 27.2 routes drags to the deepest view: NSTextView pasted the file path; the editor now owns drops through one router (rail 729/729) |
|
||||
| 2026-12-03 | milestone | [20261203-release-011-apex-refresh-is-step-one_log.md](20261203-release-011-apex-refresh-is-step-one_log.md) | Release 0.1.1: apex 1.1.59 refreshed FIRST (full recipe now in the release skill), bump + tag 4a056f9, rail 720/720, DMG notarized; push on go |
|
||||
| 2026-12-01 | milestone | [20261201-release-010-readme-notes-packaging_log.md](20261201-release-010-readme-notes-packaging_log.md) | Release 0.1.0: version bump + tag, README feature/usage rewrite, distilled release notes, release.sh (Developer ID DMG, notarize); rail 717/717; Developer ID cert pending |
|
||||
|
||||
Reference in new issue
Block a user