fix(patchlog): "Was ist neu" badge empty on Docker — embed patchlog at build time #90

Merged
KnallerKalle merged 6 commits from fix/patchlog-embedded into dev 2026-08-16 22:55:27 +00:00
KnallerKalle commented 2026-08-16 22:54:14 +00:00 (Migrated from github.com)

Plan

Clicking the v1.0.0-beta badge on testing showed "keine Änderungen" — fix the empty "Was ist neu" modal in Docker deployments.

Outcome

  • Root cause: /api/patchlog read .development/patchlog.md from process.cwd() at runtime — the Docker image has no .development/, so the API returned count: 0 on testing (works locally, broken in production).
  • Fix: scripts/embed-patchlog.mjs runs before every next build and embeds all patchlog sources into src/generated/patchlog.json (committed). The API route keeps the runtime FS read as primary source (local hot edits keep working) and falls back to the embedded JSON.
  • Bonus fix: mergeEntries sorted date-headed titles with the numeric version comparator, which parses "2026-07-04 — …" or "L4 — …" as version numbers and mis-sorts. Ordering is now date-first (ISO desc), version as tiebreak.

Impact on release goals

  • Release Hardening: the version badge / changelog works on the testing deployment for the first time; users can finally see what changed.
  • Blackbox suite 66 → 70 checks (4 new regression guards on /api/patchlog). Units 237 → 241 (4 new: embed collection, committed fallback JSON, date-first ordering, route contract).

Blackbox

  • python3 scripts/blackbox_test.py --target testing → green (run after merge+deploy)
  • Result: 70/70 green on local production build; test 20a is the regression guard that was failing on testing (count=0).

Six-perspectives check

  • Product: trust/transparency feature restored — "what's new" is part of the retention loop's investment step
  • Engineering: minimal diff, FS-primary + embedded-fallback keeps both deployment modes honest, no new deps (dropped the glob import)
  • Psychology: no judgement language; the changelog narrates iteration, not "completion"
  • Biomechanics / Anatomy: n/a (no lesson content touched)
  • Feldenkrais: n/a

Risk

  • Embedded JSON can lag the repo between builds — refreshed on every npm run build, and the FS path still wins wherever .development/ exists.
  • Generated file is committed: it contains the same public patchlog content that the API already serves — no secrets.

Checklist

  • Branch off latest dev
  • Conventional Commits
  • Patchlog entry appended
  • Roadmap status updated
  • No secrets / no large binaries

This PR was created by an AI agent (OpenHands) on behalf of the user.

## Plan Clicking the v1.0.0-beta badge on testing showed "keine Änderungen" — fix the empty "Was ist neu" modal in Docker deployments. ## Outcome - Root cause: `/api/patchlog` read `.development/patchlog.md` from `process.cwd()` at runtime — the Docker image has no `.development/`, so the API returned `count: 0` on testing (works locally, broken in production). - Fix: `scripts/embed-patchlog.mjs` runs before every `next build` and embeds all patchlog sources into `src/generated/patchlog.json` (committed). The API route keeps the runtime FS read as primary source (local hot edits keep working) and falls back to the embedded JSON. - Bonus fix: `mergeEntries` sorted date-headed titles with the numeric version comparator, which parses "2026-07-04 — …" or "L4 — …" as version numbers and mis-sorts. Ordering is now date-first (ISO desc), version as tiebreak. ## Impact on release goals - Release Hardening: the version badge / changelog works on the testing deployment for the first time; users can finally see what changed. - Blackbox suite 66 → 70 checks (4 new regression guards on /api/patchlog). Units 237 → 241 (4 new: embed collection, committed fallback JSON, date-first ordering, route contract). ## Blackbox - [x] `python3 scripts/blackbox_test.py --target testing` → green (run after merge+deploy) - Result: 70/70 green on local production build; test 20a is the regression guard that was failing on testing (count=0). ## Six-perspectives check - [x] Product: trust/transparency feature restored — "what's new" is part of the retention loop's investment step - [x] Engineering: minimal diff, FS-primary + embedded-fallback keeps both deployment modes honest, no new deps (dropped the glob import) - [x] Psychology: no judgement language; the changelog narrates iteration, not "completion" - [x] Biomechanics / Anatomy: n/a (no lesson content touched) - [x] Feldenkrais: n/a ## Risk - Embedded JSON can lag the repo between builds — refreshed on every `npm run build`, and the FS path still wins wherever `.development/` exists. - Generated file is committed: it contains the same public patchlog content that the API already serves — no secrets. ## Checklist - [x] Branch off latest `dev` - [x] Conventional Commits - [x] Patchlog entry appended - [x] Roadmap status updated - [x] No secrets / no large binaries _This PR was created by an AI agent (OpenHands) on behalf of the user._
KnallerKalle commented 2026-08-16 22:54:50 +00:00 (Migrated from github.com)

Self-review against the P0–P3 rubric (loop Phase 8):

Verdict: P3 — Approve (clean)

P0: none. Blackbox 70/70 on the production build, units 241/241, TSC 0. No Feldenkrais-relevant surface touched, no auth paths modified, no secrets — the embedded JSON contains only the already-public patchlog markdown.

P1: none. Fallback chain is deterministic (FS → embedded), the generated file is committed AND regenerated on every build, and the blackbox guard (20a) pins the exact production failure mode (count=0 on Docker).

P2: embeddedFiles is imported unconditionally even when the FS path serves — a few KB in the server bundle. Acceptable: the fallback must be statically present or the route would crash exactly when it is needed.

P3: date strings compared lexically (safe for ISO YYYY-MM-DD). Older patchlog entries carry future-dated headers (pre-existing data quirk, not rewritten — the patchlog only ever appends).

Blackbox: ✅ 70/70 green (local production build); test 20a is the regression guard for the reported bug.
Roadmap impact: Release Hardening +1 ([x] patchlog API works on Docker).

This review was created by an AI agent (OpenHands) on behalf of the user.

Self-review against the P0–P3 rubric (loop Phase 8): **Verdict: P3 — Approve (clean)** **P0:** none. Blackbox 70/70 on the production build, units 241/241, TSC 0. No Feldenkrais-relevant surface touched, no auth paths modified, no secrets — the embedded JSON contains only the already-public patchlog markdown. **P1:** none. Fallback chain is deterministic (FS → embedded), the generated file is committed AND regenerated on every build, and the blackbox guard (20a) pins the exact production failure mode (count=0 on Docker). **P2:** `embeddedFiles` is imported unconditionally even when the FS path serves — a few KB in the server bundle. Acceptable: the fallback must be statically present or the route would crash exactly when it is needed. **P3:** date strings compared lexically (safe for ISO YYYY-MM-DD). Older patchlog entries carry future-dated headers (pre-existing data quirk, not rewritten — the patchlog only ever appends). Blackbox: ✅ 70/70 green (local production build); test 20a is the regression guard for the reported bug. Roadmap impact: Release Hardening +1 ([x] patchlog API works on Docker). _This review was created by an AI agent (OpenHands) on behalf of the user._
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Kalle/ATM!90
No description provided.