fix(patchlog): Docker build no longer clobbers the patchlog fallback with [] #92

Open
KnallerKalle wants to merge 3 commits from fix/patchlog-docker-clobber into dev
KnallerKalle commented 2026-08-17 04:33:01 +00:00 (Migrated from github.com)

Plan

One deliverable: /api/patchlog returns real entries (count > 0) in Docker deployments, so the "Was ist neu" badge works again on testing — blackbox 20a/20b/20c green.

Outcome

Root-caused and fixed the P0 where every Docker build silently overwrote the committed 85 KB src/generated/patchlog.json with []. .dockerignore excluded .development (and *.md), so npm run build → embed-patchlog.mjs found zero sources inside the image and clobbered the fallback. Three independent layers now prevent this:

  1. scripts/embed-patchlog.mjs — writeEmbeddedPatchlog() preserves the committed fallback when no sources are found (and exits non-zero, so a genuinely broken build fails loudly instead of silently shipping an empty log).
  2. .dockerignore — exclude .development/* (directory contents) instead of the directory itself, then re-include patchlog.md, CHANGELOG_*.md, RELEASE_NOTES_*.md after the *.md rule (Docker last-match-wins). Internal .development docs and automation state stay out of the image.
  3. src/app/api/patchlog/route.ts — filters empty sources from the embedded fallback so a stale/empty JSON can never surface as count=0.

Plus: the committed fallback was refreshed by the build (4 sources, 85,628 bytes, includes 2026-08-16 entries).

Impact on release goals

Roadmap "Blackbox suite ≥ 8 tests, all green on testing" — 20a/20b/20c currently red on testing (the deploy predates this fix). This PR is the fix; they turn green when Coolify rebuilds from dev after merge. Clears the last standing P0 on the patchlog feature shipped in PR #90.

Blackbox

  • python3 scripts/blackbox_test.py --target testing → 67 passed, 3 failed (20a/20b/20c — all the Docker-clobber P0 this PR fixes; deploy is stale)
  • Local proof this PR fixes them: 8/8 patchlog unit tests green; Docker-context simulation green (sources reach context, 85,628 bytes embedded, internal docs excluded); tsc --noEmit clean; npm run build green.

Six-perspectives check

  • Product: "Was ist neu" is the retention surface for returning users — it was blank in production Docker deployments; now it works.
  • Engineering: minimal 3-layer fix; new unit tests pin the Docker contract; non-zero exit on broken builds.
  • Psychology: no judgement/strain; purely functional.
  • Biomechanics: N/A (no movement content touched).
  • Anatomy: N/A.
  • Feldenkrais: no correction/judgement language; neutral reflection only.

Risk

Re-including .development/patchlog.md in the Docker context slightly enlarges the build context (~85 KB). De-risked: .development/* still excludes automation-state and internal docs (verified in sim); the embed guard also prevents any future regression even if .dockerignore drifts again. Release-notes files are public-facing changelog content, not secrets.

Checklist

  • Branch off latest dev (717e8f7)
  • Conventional Commits
  • Patchlog entry appended (done in a follow-up commit on this branch before merge)
  • Roadmap status updated (same)
  • No secrets / no large binaries

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

## Plan One deliverable: `/api/patchlog` returns real entries (`count > 0`) in Docker deployments, so the "Was ist neu" badge works again on testing — blackbox 20a/20b/20c green. ## Outcome Root-caused and fixed the P0 where **every Docker build silently overwrote the committed 85 KB `src/generated/patchlog.json` with `[]`**. `.dockerignore` excluded `.development` (and `*.md`), so `npm run build` → `embed-patchlog.mjs` found **zero sources** inside the image and clobbered the fallback. Three independent layers now prevent this: 1. **`scripts/embed-patchlog.mjs`** — `writeEmbeddedPatchlog()` **preserves the committed fallback when no sources are found** (and exits non-zero, so a genuinely broken build fails loudly instead of silently shipping an empty log). 2. **`.dockerignore`** — exclude `.development/*` (directory contents) instead of the directory itself, then re-include `patchlog.md`, `CHANGELOG_*.md`, `RELEASE_NOTES_*.md` after the `*.md` rule (Docker last-match-wins). Internal `.development` docs and automation state stay **out** of the image. 3. **`src/app/api/patchlog/route.ts`** — filters empty sources from the embedded fallback so a stale/empty JSON can never surface as `count=0`. Plus: the committed fallback was refreshed by the build (4 sources, 85,628 bytes, includes 2026-08-16 entries). ## Impact on release goals Roadmap **"Blackbox suite ≥ 8 tests, all green on testing"** — 20a/20b/20c currently **red on testing** (the deploy predates this fix). This PR is the fix; they turn green when Coolify rebuilds from `dev` after merge. Clears the last standing P0 on the patchlog feature shipped in PR #90. ## Blackbox - [x] `python3 scripts/blackbox_test.py --target testing` → **67 passed, 3 failed (20a/20b/20c — all the Docker-clobber P0 this PR fixes; deploy is stale)** - Local proof this PR fixes them: 8/8 patchlog unit tests green; Docker-context simulation green (sources reach context, 85,628 bytes embedded, internal docs excluded); `tsc --noEmit` clean; `npm run build` green. ## Six-perspectives check - [x] Product: "Was ist neu" is the retention surface for returning users — it was blank in production Docker deployments; now it works. - [x] Engineering: minimal 3-layer fix; new unit tests pin the Docker contract; non-zero exit on broken builds. - [x] Psychology: no judgement/strain; purely functional. - [x] Biomechanics: N/A (no movement content touched). - [x] Anatomy: N/A. - [x] Feldenkrais: no correction/judgement language; neutral reflection only. ## Risk Re-including `.development/patchlog.md` in the Docker context slightly enlarges the build context (~85 KB). De-risked: `.development/*` still excludes automation-state and internal docs (verified in sim); the embed guard also prevents any future regression even if `.dockerignore` drifts again. Release-notes files are public-facing changelog content, not secrets. ## Checklist - [x] Branch off latest `dev` (`717e8f7`) - [x] Conventional Commits - [ ] Patchlog entry appended *(done in a follow-up commit on this branch before merge)* - [ ] Roadmap status updated *(same)* - [x] No secrets / no large binaries --- *This PR was created by an AI agent (OpenHands) on behalf of the user.*
KnallerKalle commented 2026-08-17 04:34:36 +00:00 (Migrated from github.com)

Checklist update (post-push)

  • Branch off latest dev (717e8f7)
  • Conventional Commits — test: (red) → fix: (green) → docs:
  • Patchlog entry appended — commit 76bf705
  • Roadmap status updated — Release Hardening: Docker-Patchlog-Härtung [x]
  • No secrets / no large binaries

Self-review (P0–P3): Verdict P3 (clean) — no blockers, no important findings. Diff is 170 insertions / 25 deletions across 8 files; all behavioural changes are pinned by the 4 new unit tests. One nit fixed during review: route.ts's filter now returns the filtered fallback directly (dead length > 0 ternary removed).

CI note: the Tauri build check takes >15 min and exceeds this run's time budget — not blocking per the operating policy. Vitest is already proven green locally on this exact commit (245/245, incl. the 4 new clobber-contract tests).

Merge note: testing blackbox 20a/20b/20c will stay red until Coolify rebuilds the image from dev after this PR merges — that rebuild is the final verification step for this fix.


This comment was posted by an AI agent (OpenHands) on behalf of the user.

## Checklist update (post-push) - [x] Branch off latest `dev` (`717e8f7`) - [x] Conventional Commits — `test:` (red) → `fix:` (green) → `docs:` - [x] Patchlog entry appended — commit `76bf705` - [x] Roadmap status updated — Release Hardening: Docker-Patchlog-Härtung `[x]` - [x] No secrets / no large binaries **Self-review (P0–P3):** Verdict **P3 (clean)** — no blockers, no important findings. Diff is 170 insertions / 25 deletions across 8 files; all behavioural changes are pinned by the 4 new unit tests. One nit fixed during review: `route.ts`'s filter now returns the filtered fallback directly (dead `length > 0` ternary removed). **CI note:** the Tauri build check takes >15 min and exceeds this run's time budget — not blocking per the operating policy. Vitest is already proven green locally on this exact commit (245/245, incl. the 4 new clobber-contract tests). **Merge note:** testing blackbox 20a/20b/20c will stay red until Coolify rebuilds the image from `dev` after this PR merges — that rebuild is the final verification step for this fix. --- *This comment was posted by an AI agent (OpenHands) on behalf of the user.*
This pull request has changes conflicting with the target branch.
  • .development/automation-state.json
  • .development/patchlog.md
  • .development/roadmap.md
  • scripts/embed-patchlog.mjs
  • src/generated/patchlog.json
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/patchlog-docker-clobber:fix/patchlog-docker-clobber
git switch fix/patchlog-docker-clobber

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch dev
git merge --no-ff fix/patchlog-docker-clobber
git switch fix/patchlog-docker-clobber
git rebase dev
git switch dev
git merge --ff-only fix/patchlog-docker-clobber
git switch fix/patchlog-docker-clobber
git rebase dev
git switch dev
git merge --no-ff fix/patchlog-docker-clobber
git switch dev
git merge --squash fix/patchlog-docker-clobber
git switch dev
git merge --ff-only fix/patchlog-docker-clobber
git switch dev
git merge fix/patchlog-docker-clobber
git push origin dev
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!92
No description provided.