Compare commits

...
3 Commits
Author SHA1 Message Date
bvandeusenandClaude Opus 5.5 466912e202 docs: plan-era "v1", "Task N" and "Phase N" wording restated as facts (#6277)
release / govulncheck (push) Successful in 25s
release / web (push) Successful in 1m21s
release / go (push) Successful in 1m47s
release / integration (push) Successful in 4m35s
release / android (push) Successful in 7m5s
release / Build signed APK (releases and dev) (push) Successful in 7m16s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 1m1s
release / Verify release artifacts (tag releases only) (push) Skipped
The marker list behind the earlier server and web passes did not catch
"for v1", "Task 5", "Phase 2" or "today: Flutter". Those comments now say
what the code does.

Corrected: coverart said "both v1 providers" ship on. There are four
providers (MBCAA, TheAudioDB, Deezer, Last.fm), and Last.fm, which needs a
key, ships off.

Non-comment tokens unchanged against HEAD: 10 Go files, 7 TS/Svelte files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 13:05:03 -04:00
bvandeusenandClaude Opus 5.5 c96231106f docs: setup files and the client, shared and CI docs describe what is (#6277)
.dockerignore, .gitignore, deploy/initdb, ci-requirements.md,
client/README.md, shared/README.md and two web/scripts test names: dates,
issue/rule/spike ids and the stories behind each exclusion removed.

Corrected:
- client/README.md: the dev lane bundles its own APK; :main no longer
  exists; main bundles the recorded sidecar instead of re-deriving the
  version name. Its smoke-test step wrote a bare "v0.2.0", which the
  server rejects as a sidecar that is not JSON; it now writes the JSON
  shape, which the README documents.
- ci-requirements.md: one workflow, not four; the android lane builds no
  debug APK; main reads the recorded sidecar.
- .gitignore: CI fills client/ on every image build, not tag releases only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 13:04:02 -04:00
bvandeusenandClaude Opus 5.5 557887bb07 docs: workflow, Dockerfile and brand-tool comments say what each does (#6277)
release.yml, the Dockerfile and tools/gen-brand-assets.py keep every
constraint their comments explain (the tag map, the gate, immutable tags,
the shared-daemon Postgres guard, the version/channel split) and drop the
history around them: rule and family-idea numbers, issue and run ids,
dates, an operator quote, the "this used to say the opposite" paragraphs
and one-runner timings.

Corrected: the Dockerfile said client/ is filled on tag pushes only; every
build fills it (dev and tag push bundle their own APK, main bundles the
latest release's).

Only full-line `#` comments changed: non-comment lines are identical to
HEAD in all three files, and the three run: scripts whose text changed
differ only in shell comment lines. The release guard tests match raw
workflow text; none of their required or forbidden strings appear in the
new comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 13:01:39 -04:00
27 changed files with 231 additions and 283 deletions
+2 -6
View File
@@ -9,12 +9,8 @@ web/build
# The Android client — built by its own job, never from this context. The APK # The Android client — built by its own job, never from this context. The APK
# reaches the image through client/, downloaded as a CI artifact, so nothing # reaches the image through client/, downloaded as a CI artifact, so nothing
# here reads android/ sources. # here reads android/ sources.
# # Excluded so the Gradle project neither bloats the context nor busts the
# This block named `flutter_client/` until 2026-09-10 and lost its PATTERN when # `COPY . .` layer on every Android-only change.
# that tree was deleted, leaving a comment describing an exclusion that was no
# longer happening. android/ never took its place, so 4.1 MB of Gradle project
# has been entering the context and busting the `COPY . .` layer on every
# Android-only change.
android/ android/
# Local `make build` output — an 18 MB binary the image never uses, since the # Local `make build` output — an 18 MB binary the image never uses, since the
+116 -153
View File
@@ -7,45 +7,39 @@ name: release
# push tag vYYYY.MM.DD.HHMM → :latest (fresh APK bundled) # push tag vYYYY.MM.DD.HHMM → :latest (fresh APK bundled)
# workflow_dispatch → manual trigger (same rules based on the ref) # workflow_dispatch → manual trigger (same rules based on the ref)
# #
# That is the whole tag map, and it is family rule 145 + 147 as written. # That is the whole tag map.
# #
# :<sha> on main is the ROLLBACK UNIT — every production commit addressable # :<sha> on main is the ROLLBACK UNIT — every production commit addressable
# without a release ceremony. It is minted only on main, where rollback is # without a release ceremony. It is minted only on main, where rollback is
# actually worth having: merges are gated (rule 2) so they number in the dozens # actually worth having: merges to main are deliberate, so they number in the
# per year, while on dev they would be one per push, forever, for a channel # dozens per year, while on dev they would be one per push, forever, for a
# whose entire contract is that it moves. # channel whose entire contract is that it moves.
# #
# There are NO :<version> image tags. This repo published :vYYYY.MM.DD.HHMM # There are NO :<version> image tags. Git and the build's own self-reported
# until 2026-09-10 and it was the inverse of the rule on both counts — minting # version answer "which build is this"; a third name for the same thing is
# a version tag nobody pinned while the rollback unit the rule names did not # upkeep for a model we do not run. Only the APK needs version numbers, for
# exist here at all. Git and the build's own self-reported version answer # its update process.
# "which build is this"; a third name for the same thing is upkeep for a model
# we do not run. Operator, 2026-09-10: "only things like the APK need that kind
# of versioning for their update process."
# #
# There is no :main either. :latest tracks main's tip with no gate between them # There is no :main either. :latest tracks main's tip with no gate between
# (rule 147), so a second name for the same image sends readers looking for a # them, so a second name for the same image sends readers looking for a
# distinction that does not exist. # distinction that does not exist.
# #
# The dev channel exists so testing a build does not require shipping one. # The dev channel exists so testing a build does not require shipping one:
# Before it, the only way to get an APK onto a phone was to cut a release, # without it the only way to get an APK onto a phone is to cut a release,
# which made `main` the staging area by default. `:dev` carries its own # which makes `main` the staging area. `:dev` carries its own freshly-built
# freshly-built APK, signed with the SAME key as release builds — a different # APK, signed with the SAME key as release builds — a different key cannot
# key cannot install over the stable app, so anyone crossing channels would # install over the stable app, so anyone crossing channels would have to
# have to uninstall and lose their data. # uninstall and lose their data.
# #
# :dev is published ALONE, with no per-commit tag. A rolling channel is # :dev is published ALONE, with no per-commit tag. A rolling channel is
# rolling by definition; a commit-addressable image for it would be a # rolling by definition; a commit-addressable image for it would be a
# rollback target nobody ever pulls, kept forever. Recovery on dev is to fix # rollback target nobody ever pulls, kept forever. Recovery on dev is to fix
# forward. # forward.
# #
# Note what this repo does NOT need: a cross-repo dispatch to refresh the # No cross-repo dispatch is needed to refresh a channel when its bundled APK
# channel when its bundled APK is rebuilt. That mechanism exists elsewhere in # is rebuilt: Minstrel is a monorepo, so one push builds the APK and the
# the family because the app and the server live in separate repos. Minstrel # image in the same run from the same commit, and the channel cannot go
# is a monorepo — one push builds the APK and the image in the same run from # stale against its own artifact.
# the same commit, so the channel cannot go stale against its own artifact.
# The requirement is satisfied structurally; copying the mechanism would add
# a moving part to fix a problem that does not exist here.
# #
# Release model: the tag IS the artifact's version name with a `v` in front. # Release model: the tag IS the artifact's version name with a `v` in front.
# `v2026.09.10.1432` and `2026.09.10.1432` are the same string, derived from # `v2026.09.10.1432` and `2026.09.10.1432` are the same string, derived from
@@ -55,15 +49,9 @@ name: release
# #
# TAGS ARE IMMUTABLE. Never move, retarget or delete a published tag. A # TAGS ARE IMMUTABLE. Never move, retarget or delete a published tag. A
# same-day second release is not a collision — HHMM makes every tag unique # same-day second release is not a collision — HHMM makes every tag unique
# by construction, so the answer is simply another tag. # by construction, so the answer is simply another tag. Anyone installing
# # from a moved tag would hold something the tag no longer points at, which
# This block used to say the opposite: that the per-day tag was # is a worse failure than an extra row in the tag list.
# "intentionally mutable" and that a same-day re-cut should
# `git push -f origin vYYYY.MM.DD`. That instruction is what the family
# rulebook now forbids outright, and it has incidents behind it — moving a
# same-day tag forward once took a published release down with it. Anyone
# installing from a tag is holding something the tag no longer points at,
# which is a worse failure than an extra row in the tag list.
# #
# :latest is updated by every main push AND every tag push, so it always # :latest is updated by every main push AND every tag push, so it always
# reflects the newest blessed image. # reflects the newest blessed image.
@@ -83,15 +71,14 @@ name: release
# recomputed ones — so no rebuild is needed, just a rebundle. Tag builds # recomputed ones — so no rebuild is needed, just a rebundle. Tag builds
# keep bundling their own freshly-built APK. # keep bundling their own freshly-built APK.
# #
# THE GATE (rule 177, M462 #4984). Every verifying lane lives in this file — # THE GATE. Every verifying lane lives in this file —
# Go (vet, lint, short tests), the Postgres integration suite, the web app # Go (vet, lint, short tests), the Postgres integration suite, the web app
# (npm audit, svelte-check, vitest), Android (ktlint, detekt, unit tests) and # (npm audit, svelte-check, vitest), Android (ktlint, detekt, unit tests) and
# govulncheck — and every job that publishes something names each of them in # govulncheck — and every job that publishes something names each of them in
# `needs:` and requires `success` from each, by name. Nothing publishes on red. # `needs:` and requires `success` from each, by name. Nothing publishes on red.
# #
# They used to be three separate workflows (test-go, test-web, android) on the # One workflow, because separate workflows cannot see each other's verdict:
# same push trigger as this one. Separate workflows cannot see each other's # :dev would mean "it built", never "it passed", and a red test run and a
# verdict, so :dev meant "it built", never "it passed": a red test run and a
# fresh :dev could carry the same timestamp. One graph is the only place the # fresh :dev could carry the same timestamp. One graph is the only place the
# edge can be written. # edge can be written.
# #
@@ -125,10 +112,9 @@ on:
type: boolean type: boolean
default: false default: false
# A rapid re-push to main should supersede the in-flight build — the # A rapid re-push to main supersedes the in-flight build: the later commit
# operator explicitly wants the later commit to win. Tags no longer enter # wins. Tags are immutable and unique, so no tag build can be superseded by
# into this: they are immutable and unique, so no tag build can ever be # another run on the same ref.
# superseded by another run on the same ref.
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
@@ -173,14 +159,14 @@ jobs:
# Full `go test -race` against an ephemeral Postgres. # Full `go test -race` against an ephemeral Postgres.
# #
# DB wiring follows the act_runner shared-daemon pattern: the runner's Docker # DB wiring follows the act_runner shared-daemon pattern: the runner's Docker
# daemon also runs the operator's dev compose stack, so service containers # daemon also runs a dev compose stack, so service containers get NO
# get NO published ports (collision) and no service-name DNS. We discover the # published ports (collision) and no service-name DNS. We discover the
# service container through the mounted docker socket and reach it by bridge # service container through the mounted docker socket and reach it by bridge
# IP. The exactly-one assertion is a hard guard — pointing tests at the dev # IP. The exactly-one assertion is a hard guard — pointing tests at the dev
# Postgres would truncate it (the disaster Fable #339 exists to prevent). # Postgres would truncate it.
# #
# The key stays `integration` with no `name:` (rule 80): act_runner derives # The key stays `integration` with no `name:`: act_runner derives the
# the service container's name from the job's display name. # service container's name from the job's display name.
# #
# `web/build/` has a committed placeholder index.html so go:embed succeeds # `web/build/` has a committed placeholder index.html so go:embed succeeds
# without the SPA being built first. # without the SPA being built first.
@@ -195,7 +181,7 @@ jobs:
POSTGRES_USER: minstrel POSTGRES_USER: minstrel
POSTGRES_PASSWORD: minstrel POSTGRES_PASSWORD: minstrel
POSTGRES_DB: minstrel_test POSTGRES_DB: minstrel_test
# No `ports:` — the runner shares the operator's dev compose # No `ports:` — the runner shares the dev compose
# Docker daemon; publishing a fixed host port collides. # Docker daemon; publishing a fixed host port collides.
steps: steps:
@@ -209,13 +195,13 @@ jobs:
# mounted docker socket. act_runner attaches the job # mounted docker socket. act_runner attaches the job
# container and its service container(s) to a shared per-job # container and its service container(s) to a shared per-job
# network, so scope discovery to a postgres that sits on a # network, so scope discovery to a postgres that sits on a
# network THIS job container is also on. The old # network THIS job container is also on. A name filter alone
# `--filter name=integration` matched EVERY concurrent # would match EVERY concurrent integration run's postgres (a dev
# integration run's postgres (a dev push + the main-merge run # push and a main-merge run overlapping give 2 candidates and a
# overlap → 2 candidates → false "expected exactly 1" abort). # false "expected exactly 1" abort). The dev compose
# The operator's dev compose `minstrel-postgres-*` is never on # `minstrel-postgres-*` is never on this job's network; skip it
# this job's network; skip it explicitly as belt-and-suspenders # explicitly as belt-and-suspenders (a wrong target would
# (a wrong target would truncate real data). # truncate real data).
SELF=$(cat /etc/hostname) SELF=$(cat /etc/hostname)
SELF_NETS=$(docker inspect -f '{{range $k,$v := .NetworkSettings.Networks}}{{$k}} {{end}}' "$SELF") SELF_NETS=$(docker inspect -f '{{range $k,$v := .NetworkSettings.Networks}}{{$k}} {{end}}' "$SELF")
test -n "$SELF_NETS" test -n "$SELF_NETS"
@@ -236,11 +222,11 @@ jobs:
export MINSTREL_TEST_DATABASE_URL="postgres://minstrel:minstrel@${PG_IP}:5432/minstrel_test?sslmode=disable" export MINSTREL_TEST_DATABASE_URL="postgres://minstrel:minstrel@${PG_IP}:5432/minstrel_test?sslmode=disable"
# Wait for Postgres to accept connections. Asked of the service # Wait for Postgres to accept connections. Asked of the service
# container itself: the run: shell is dash (rule 81), where the # container itself: the run: shell is dash, where a `/dev/tcp`
# old `/dev/tcp` probe never connects and the loop silently # probe never connects and the loop would silently burn its full
# burned its full two minutes on every run. # two minutes.
# #
# Over TCP (-h 127.0.0.1), not the unix socket (#5426). On first # Over TCP (-h 127.0.0.1), not the unix socket. On first
# boot the image's entrypoint runs initdb under a temporary server # boot the image's entrypoint runs initdb under a temporary server
# that listens on the socket only, then stops it and starts the # that listens on the socket only, then stops it and starts the
# real one. A socket probe can catch the temporary server, and the # real one. A socket probe can catch the temporary server, and the
@@ -267,7 +253,7 @@ jobs:
# synchronous_commit is user-context, so pg_reload_conf() picks # synchronous_commit is user-context, so pg_reload_conf() picks
# all three up with no restart. # all three up with no restart.
# Non-fatal: a failure degrades to "slower", never red CI. But # Non-fatal: a failure degrades to "slower", never red CI. But
# slower is ~15x on internal/api (#5426), so retry a few times and # slower is ~15x on internal/api, so retry a few times and
# print what took effect. # print what took effect.
relaxed="" relaxed=""
for i in 1 2 3 4 5; do for i in 1 2 3 4 5; do
@@ -291,10 +277,10 @@ jobs:
# every integration package TRUNCATEs the one shared test DB; # every integration package TRUNCATEs the one shared test DB;
# concurrent package binaries → TRUNCATE deadlocks. Serialize # concurrent package binaries → TRUNCATE deadlocks. Serialize
# package execution (the documented local invocation too). # package execution (the documented local invocation too).
# -timeout 20m: internal/api alone takes ~6.5 min under -race on # -timeout 20m: internal/api alone takes several minutes under
# an idle runner, and a dev and a main run sharing the runner # -race on an idle runner, and a dev and a main run sharing the
# pushed it past go test's default 10m (run 8368, 600.016s, the # runner can push it past go test's default 10m with nothing
# running test 2s old — nothing hung). # hung.
MINSTREL_DATABASE_URL="$MINSTREL_TEST_DATABASE_URL" go run ./cmd/minstrel migrate MINSTREL_DATABASE_URL="$MINSTREL_TEST_DATABASE_URL" go run ./cmd/minstrel migrate
go test -p 1 -race -timeout 20m ./... go test -p 1 -race -timeout 20m ./...
@@ -314,11 +300,8 @@ jobs:
- name: Install deps - name: Install deps
run: npm ci run: npm ci
# The whole tree, build and test tooling included. Until #5021 this # The whole tree, build and test tooling included: the tooling that
# audited only what ships to browsers (`--omit=dev`), because vite, # builds the shipped bundle is held to the same bar as the bundle.
# vitest, tailwind and kit carried advisories that needed major
# upgrades. Those upgrades landed and the full tree audits clean, so
# the tooling that builds the shipped bundle is held to the same bar.
- name: npm audit (all dependencies) - name: npm audit (all dependencies)
run: npm audit --audit-level=moderate run: npm audit --audit-level=moderate
@@ -329,8 +312,8 @@ jobs:
run: npm test run: npm test
android: android:
# Using flutter-ci runner label because it's the only proven-working # The flutter-ci runner label is the only proven-working label with
# label with docker that can pull our container.image. # docker that can pull our container.image.
runs-on: flutter-ci runs-on: flutter-ci
container: container:
image: git.fabledsword.com/bvandeusen/ci-android:36 image: git.fabledsword.com/bvandeusen/ci-android:36
@@ -376,11 +359,10 @@ jobs:
- name: Unit tests - name: Unit tests
run: ./gradlew testDebugUnitTest run: ./gradlew testDebugUnitTest
# No debug APK is built or uploaded here. Main used to upload a # No debug APK is built or uploaded here: a debug build is signed by a
# debug-signed app-debug.apk: a build signed by a key regenerated in # key regenerated in every container, which no install can update.
# every container, which no install can update (family idea #5103, # Phones get builds from android-release, signed with the one release
# practice 2). Phones get builds from android-release, signed with # key, on dev and on tags.
# the one release key, on dev and on tags.
# Known vulnerabilities in the Go code and the standard library it is built # Known vulnerabilities in the Go code and the standard library it is built
# with. Runs in the SAME image the Dockerfile's builder stage uses, so the # with. Runs in the SAME image the Dockerfile's builder stage uses, so the
@@ -388,7 +370,7 @@ jobs:
# the ci-go image carries its own Go and would be checking a different # the ci-go image carries its own Go and would be checking a different
# toolchain. Keep this image and the Dockerfile's builder in step. # toolchain. Keep this image and the Dockerfile's builder in step.
# #
# govulncheck is fetched at CI time, unpinned (rule 154): the vulnerability # govulncheck is fetched at CI time, unpinned: the vulnerability
# database and the tool that reads it should both be current. # database and the tool that reads it should both be current.
govulncheck: govulncheck:
runs-on: go-ci runs-on: go-ci
@@ -397,7 +379,7 @@ jobs:
steps: steps:
# Plain git, not actions/checkout: that action runs on node, which the # Plain git, not actions/checkout: that action runs on node, which the
# golang image does not carry. This step is dash (rule 81). # golang image does not carry. This step is dash.
- name: Checkout - name: Checkout
env: env:
TOKEN: ${{ github.token }} TOKEN: ${{ github.token }}
@@ -420,7 +402,7 @@ jobs:
android-release: android-release:
name: Build signed APK (releases and dev) name: Build signed APK (releases and dev)
# Also builds on `dev`, which is what makes a test channel possible at # Also builds on `dev`, which is what makes a test channel possible at
# all. Without it the only way to get a build onto a phone was to cut a # all: without it the only way to get a build onto a phone is to cut a
# release, which quietly turns `main` into the staging area. # release, which quietly turns `main` into the staging area.
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dev' if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dev'
runs-on: flutter-ci runs-on: flutter-ci
@@ -453,7 +435,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
# Full history. The version name now reads only the tip commit's # Full history. The version name reads only the tip commit's
# timestamp, so a shallow clone would technically serve — but this # timestamp, so a shallow clone would technically serve — but this
# job derives a value that ships to devices, and a shallow checkout # job derives a value that ships to devices, and a shallow checkout
# changes what git-derived values resolve to WITHOUT failing. The # changes what git-derived values resolve to WITHOUT failing. The
@@ -487,9 +469,9 @@ jobs:
# Checked BEFORE the expensive work, not after it. "Attach APK to gitea # Checked BEFORE the expensive work, not after it. "Attach APK to gitea
# Release" below resolves the release by tag and fails if it is absent — # Release" below resolves the release by tag and fails if it is absent —
# but that is the final step, so a tag pushed without a release built an # but that is the final step, so a tag pushed without a release would
# APK for several minutes first and only then discovered it had nowhere to # build an APK for several minutes first and only then find it has
# put it. Same check, seconds in instead of minutes. # nowhere to put it. Same check, seconds in instead of minutes.
# #
# Releases are normally created through the API (which creates the tag and # Releases are normally created through the API (which creates the tag and
# the release together, so this passes). A bare `git push origin vX` is the # the release together, so this passes). A bare `git push origin vX` is the
@@ -549,16 +531,15 @@ jobs:
# secret) reaches no installed phone. The certificate's digest is # secret) reaches no installed phone. The certificate's digest is
# pinned below; it is public, not a secret. Gradle signs with the # pinned below; it is public, not a secret. Gradle signs with the
# release key or leaves the APK unsigned, and an unsigned build fails # release key or leaves the APK unsigned, and an unsigned build fails
# here too, as there is no app-release.apk to verify (family idea # here too, as there is no app-release.apk to verify. apksigner, not
# #5103, practice 3). apksigner, not keytool: keytool prints nothing # keytool: keytool prints nothing for a v2-only APK.
# for a v2-only APK.
# #
# Rotating the key on purpose means every install must be removed and # Rotating the key on purpose means every install must be removed and
# reinstalled; change the digest here in the same commit. # reinstalled; change the digest here in the same commit.
- name: The APK carries the release key - name: The APK carries the release key
shell: bash shell: bash
env: env:
# CN=Minstrel, O=FabledSword. Read from run 8446 (#5116). # CN=Minstrel, O=FabledSword.
RELEASE_CERT_SHA256: 43d183307bc46b821789d90444a960b137f78f2166ff431efb2406d0fceaf612 RELEASE_CERT_SHA256: 43d183307bc46b821789d90444a960b137f78f2166ff431efb2406d0fceaf612
run: | run: |
set -euo pipefail set -euo pipefail
@@ -580,11 +561,10 @@ jobs:
fi fi
- name: Upload APK as workflow artifact - name: Upload APK as workflow artifact
# Stock action (snippet #2271) — never @v3, which uploads something Gitea # Stock action — never @v3, which uploads something Gitea will never
# will never serve back. This is the producing half of a pair: # serve back. This is the producing half of a pair: image-release
# image-release downloads `minstrel-apk` below. Any upload v4+ pairs with # downloads `minstrel-apk` below. Any upload v4+ pairs with any
# any download v4+ on this forge (every combination tested 2026-09-10, # download v4+ on this forge, so the two pins need not move together.
# Scribe spike #3843), so the two pins need not move together.
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
name: minstrel-apk name: minstrel-apk
@@ -687,7 +667,7 @@ jobs:
image-release: image-release:
name: Build + push container image name: Build + push container image
# Every lane must have SUCCEEDED, each named here (rule 177). Then the # Every lane must have SUCCEEDED, each named here. Then the
# APK: tag and dev pushes build one and it must have succeeded; main # APK: tag and dev pushes build one and it must have succeeded; main
# pushes skip android-release and bundle the latest release's APK # pushes skip android-release and bundle the latest release's APK
# instead, so for main alone a skipped android-release is expected. # instead, so for main alone a skipped android-release is expected.
@@ -713,15 +693,13 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
# Full history, and rule 149 names this specifically: any job that # Full history: any job that DERIVES the version name needs it,
# DERIVES the version name needs it, because a shallow clone changes # because a shallow clone changes what git-derived values resolve to
# what git-derived values resolve to WITHOUT failing — a too-low # WITHOUT failing — a too-low value, silently, with every lane green.
# value, silently, with every lane green.
# #
# This job was depth-1 while it took the version from GITHUB_REF. It # This job runs ci/version.sh itself: with no :<version> image tags,
# now runs ci/version.sh itself, because with :<version> image tags # the server's self-reported version is the only thing that says which
# gone the server's self-reported version is the only thing that says # build an image is.
# which build an image is.
fetch-depth: 0 fetch-depth: 0
- name: Detect buildable project - name: Detect buildable project
@@ -743,21 +721,16 @@ jobs:
set -euo pipefail set -euo pipefail
# THE VERSION, and it is derived the same way on every ref — the # THE VERSION, and it is derived the same way on every ref — the
# branch decides the CHANNEL, never the version (family rule 149). # branch decides the CHANNEL, never the version.
# #
# This used to be three different things: the literal string "main" # A per-ref string ("main", "dev", the tag name) would not order, and
# on main, "dev" on dev, and the tag name on a tag. None of them # "dev" would be the same string forever — two dev images eight weeks
# ordered, and the first two were the same string forever — two dev # apart indistinguishable in the UI. With no version image tags, this
# images eight weeks apart were indistinguishable in the UI. That # is how an admin tells which build a container is running.
# mattered little while :vYYYY.MM.DD.HHMM existed to identify a
# build; with version image tags gone, this IS how an operator tells
# which build a container is running.
# #
# `sed -n s///p` rather than `grep`: it exits 0 when nothing matches, # `sed -n s///p` rather than `grep`: it exits 0 when nothing matches,
# so the empty check below is actually reachable. A grep here would # so the empty check below is actually reachable. A grep here would
# kill the step at the assignment under the runner's pipefail — the # kill the step at the assignment under the runner's pipefail.
# exact bug that took down the first main build after the version
# rework.
VERSION="$(ci/version.sh HEAD | sed -n 's/^name=//p')" VERSION="$(ci/version.sh HEAD | sed -n 's/^name=//p')"
if [ -z "${VERSION}" ]; then if [ -z "${VERSION}" ]; then
echo "::error::could not derive a build version from ci/version.sh" echo "::error::could not derive a build version from ci/version.sh"
@@ -770,13 +743,13 @@ jobs:
# The tag build exists to produce the signed APK and attach it to # The tag build exists to produce the signed APK and attach it to
# the release; the image it rebuilds is the SAME SOURCE as the main # the release; the image it rebuilds is the SAME SOURCE as the main
# build minutes earlier, differing only in which APK is baked in. # build minutes earlier, differing only in which APK is baked in.
# Rule 145 is explicit about that case: when the same source is # When the same source is rebuilt with different contents,
# rebuilt with different contents, publish the moving channel tag # publish the moving channel tag and never a commit-addressable
# and never a commit-addressable one. # one.
# #
# :latest must move here rather than waiting for the next main # :latest must move here rather than waiting for the next main
# push, or the channel would carry the PREVIOUS release's APK # push, or the channel would carry the PREVIOUS release's APK
# indefinitely — a channel that cannot refresh itself (rule 146). # indefinitely — a channel that cannot refresh itself.
CHANNEL=stable CHANNEL=stable
echo "args=-t ${IMAGE}:latest" >> "$GITHUB_OUTPUT" echo "args=-t ${IMAGE}:latest" >> "$GITHUB_OUTPUT"
echo "::notice::Release build ${VERSION}: refreshing :latest around the new APK" echo "::notice::Release build ${VERSION}: refreshing :latest around the new APK"
@@ -790,10 +763,9 @@ jobs:
echo "args=-t ${IMAGE}:dev" >> "$GITHUB_OUTPUT" echo "args=-t ${IMAGE}:dev" >> "$GITHUB_OUTPUT"
echo "::notice::Dev-branch build ${VERSION}: :dev" echo "::notice::Dev-branch build ${VERSION}: :dev"
else else
# The production line: :latest tracks main's tip (rule 147) and # The production line: :latest tracks main's tip and :<sha> is
# :<sha> is the rollback unit (rule 145). Full 40-char SHA, matching # the rollback unit. Full 40-char SHA, so a rollback target is
# the family's other repos, so a rollback target is addressable # addressable straight from the commit anyone is reading.
# straight from the commit anyone is reading.
CHANNEL=stable CHANNEL=stable
echo "args=-t ${IMAGE}:latest -t ${IMAGE}:${GITHUB_SHA}" >> "$GITHUB_OUTPUT" echo "args=-t ${IMAGE}:latest -t ${IMAGE}:${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
echo "::notice::Main-branch build ${VERSION}: :latest + :${GITHUB_SHA}" echo "::notice::Main-branch build ${VERSION}: :latest + :${GITHUB_SHA}"
@@ -818,8 +790,8 @@ jobs:
(startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dev') (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dev')
# Consuming half of the pair: stock download-artifact, which works here for # Consuming half of the pair: stock download-artifact, which works here for
# the same reason as the upload (gitea/runner 3.x edits the GHES refusal # the same reason as the upload (gitea/runner 3.x edits the GHES refusal
# out of the bundle; snippet #2271). v8 runs on node24, which every # out of the bundle). v8 runs on node24, which every CI-runner image
# CI-runner image carries — the runner uses the image's own node. # carries — the runner uses the image's own node.
uses: actions/download-artifact@v8 uses: actions/download-artifact@v8
with: with:
name: minstrel-apk name: minstrel-apk
@@ -887,10 +859,10 @@ jobs:
curl -fsSL -H "Authorization: token ${CI_TOKEN}" -o client/minstrel.apk "${APK_URL}" curl -fsSL -H "Authorization: token ${CI_TOKEN}" -o client/minstrel.apk "${APK_URL}"
# Take the version the release RECORDED rather than recomputing it. # Take the version the release RECORDED rather than recomputing it.
# This used to re-derive the name from the tagged commit, which meant # Re-deriving it from the tagged commit would keep the formula in two
# the formula lived in two files that had to be kept in step, and it # files that must stay in step, and could only ever recover the name —
# could only ever recover the name — the ordering key is build-time # the ordering key is build-time minutes and exists nowhere after that
# minutes and does not exist anywhere after that build ends. # build ends.
SIDECAR_URL="$(printf '%s' "${REL_JSON}" | grep -oP '"browser_download_url":\s*"\K[^"]+' | grep -E '\.apk\.version$' | head -1)" || true SIDECAR_URL="$(printf '%s' "${REL_JSON}" | grep -oP '"browser_download_url":\s*"\K[^"]+' | grep -E '\.apk\.version$' | head -1)" || true
if [ -n "${SIDECAR_URL}" ]; then if [ -n "${SIDECAR_URL}" ]; then
curl -fsSL -H "Authorization: token ${CI_TOKEN}" -o client/minstrel.apk.version "${SIDECAR_URL}" curl -fsSL -H "Authorization: token ${CI_TOKEN}" -o client/minstrel.apk.version "${SIDECAR_URL}"
@@ -924,18 +896,15 @@ jobs:
# Verifies a tag release actually ended up complete, and names the specific # Verifies a tag release actually ended up complete, and names the specific
# thing that's missing if not. # thing that's missing if not.
# #
# Added 2026-08-07 after v2026.08.07 was re-cut. The android-release job never # A release can be incomplete while looking fine. If android-release never
# started — no log was written at all — so all eight of its steps reported # starts (a runner failing to launch), its steps all report `failure` with
# `failure` with none executed and image-release showed `skipped`. The run was # none executed and image-release shows `skipped`. The run is red, but the
# red, but the *release page rendered fine*, and `main`'s own push build had # release page renders and main's own push build has already moved
# already moved `:latest`, so the code was deployable and nothing looked # `:latest`, so a release missing its APK and its image is easy to skim
# obviously wrong. The release was simply missing its APK and its image, # past.
# which is easy to skim past.
# #
# This job cannot prevent that (the cause was a runner failing to launch, not # This job cannot prevent that; it turns an incomplete release into an
# anything in this file). What it does is turn an incomplete release into an # explicit, named error instead of a row of mystery step failures.
# explicit, named error instead of eight mystery step failures — so the
# consequence is legible without having to infer it.
# #
# `if: always()` is the whole point: it has to report precisely when the jobs # `if: always()` is the whole point: it has to report precisely when the jobs
# above did NOT succeed. # above did NOT succeed.
@@ -977,22 +946,16 @@ jobs:
echo "::notice::APK attached: ${APK}" echo "::notice::APK attached: ${APK}"
# The other half. Checking only the APK would report success on a release # The other half. Checking only the APK would report success on a release
# whose image push failed — which is precisely the second thing that was # whose image push failed. `always()` on this job means it runs even when
# missing when v2026.08.07 had to be re-cut. `always()` on this job means # image-release failed, so without this the guard would cheerfully verify
# it runs even when image-release failed, so without this the guard would # an incomplete release.
# cheerfully verify an incomplete release.
# #
# This asserted `:${TAG}` — the :vYYYY.MM.DD.HHMM image — until # The image checked is the :<sha> rollback target, which main's own build
# 2026-09-10. Version image tags are no longer published (rule 145), so # published for this same commit before the tag was cut (there are no
# that assertion would now fail every release for a tag nothing mints. # version image tags). It catches an image push that silently did not
# The rollback target it was really protecting is the :<sha> image, which # happen, and it proves the ORDERING — a tag cut on a commit whose main
# main's own build published for this same commit before the tag was cut. # build never completed has no rollback target, and that is worth failing
# # on rather than discovering during an incident.
# Checking it here earns its keep twice over: it still catches an image
# push that silently did not happen, and it additionally proves the
# ORDERING — a tag cut on a commit whose main build never completed has
# no rollback target, and that is worth failing on rather than
# discovering during an incident.
- name: Rollback image must exist for the tagged commit - name: Rollback image must exist for the tagged commit
shell: bash shell: bash
run: | run: |
+6 -9
View File
@@ -12,13 +12,11 @@
# Test binary, built with `go test -c` # Test binary, built with `go test -c`
*.test *.test
# `make build` output. bin/minstrel was tracked until 2026-09-10 — an 18 MB # `make build` output — an 18 MB binary that is never committed.
# binary committed by accident, last refreshed by a commit about web test
# mocks, and re-dirtied by every local build since.
bin/ bin/
# Bundled Android APK + version sidecar (#397). Populated by CI for # Bundled Android APK + version sidecar. Populated by CI on every image
# tag releases; never committed. README in client/ explains the flow. # build; never committed. README in client/ explains the flow.
client/minstrel.apk client/minstrel.apk
client/minstrel.apk.version client/minstrel.apk.version
@@ -44,10 +42,9 @@ go.work.sum
docs/superpowers/ docs/superpowers/
# Per-machine Claude Code settings + remember-skill memory artifacts + # Per-machine Claude Code settings + remember-skill memory artifacts +
# project-level Claude/AI instruction files. All operator-scoped; the # project-level Claude/AI instruction files. All per-machine;
# canonical project memory lives under ~/.claude/projects/ outside the # CLAUDE.md/AGENTS.md/GEMINI.md are tool-specific working notes, not
# repo. CLAUDE.md/AGENTS.md/GEMINI.md stay on the operator's machine # project artifacts.
# only — they're tool-specific working notes, not project artifacts.
.claude/ .claude/
.remember/ .remember/
CLAUDE.md CLAUDE.md
+12 -11
View File
@@ -19,11 +19,10 @@ ENV CGO_ENABLED=0
# (YYYY.MM.DD.HHMM) and the lane's channel; a local `docker build` falls back # (YYYY.MM.DD.HHMM) and the lane's channel; a local `docker build` falls back
# to "dev"/"local". Both are surfaced at /healthz. # to "dev"/"local". Both are surfaced at /healthz.
# #
# These are two values on purpose (family rule 149): the same commit built on # These are two values on purpose: the same commit built on dev and on main
# dev and on main reports the same NAME and differs only in CHANNEL. Folding # reports the same NAME and differs only in CHANNEL. Folding the channel
# the channel into the version string is what the rule forbids — the version # into the version string would make two dev images eight weeks apart
# used to BE the channel word here ("main"/"dev"), which meant two dev images # indistinguishable.
# eight weeks apart were indistinguishable.
ARG MINSTREL_VERSION=dev ARG MINSTREL_VERSION=dev
ARG MINSTREL_CHANNEL=local ARG MINSTREL_CHANNEL=local
RUN go build -trimpath \ RUN go build -trimpath \
@@ -36,8 +35,8 @@ FROM debian:bookworm-slim
# ffmpeg: duration probes and the exact-tier audio hash (a SHA-256 of the # ffmpeg: duration probes and the exact-tier audio hash (a SHA-256 of the
# encoded audio packets, so no decode). libchromaprint-tools: fpcalc, the # encoded audio packets, so no decode). libchromaprint-tools: fpcalc, the
# acoustic fingerprint that tells the same recording at two bitrates apart # acoustic fingerprint that tells the same recording at two bitrates apart
# from two different recordings (M400). Both are baked in at build time so a # from two different recordings. Both are baked in at build time so a
# deployed instance never fetches either (rule 164); fpcalc is shelled out # deployed instance never fetches either; fpcalc is shelled out
# rather than bound because CGO_ENABLED=0 above rules out cgo. # rather than bound because CGO_ENABLED=0 above rules out cgo.
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates ffmpeg libchromaprint-tools \ && apt-get install -y --no-install-recommends ca-certificates ffmpeg libchromaprint-tools \
@@ -57,10 +56,12 @@ COPY config.example.yaml /etc/smartmusic/config.yaml
RUN mkdir -p /app/data /app/client && chown -R minstrel:minstrel /app RUN mkdir -p /app/data /app/client && chown -R minstrel:minstrel /app
WORKDIR /app WORKDIR /app
# In-app update channel (#397). client/ in the build context holds # In-app update channel. client/ in the build context holds
# minstrel.apk + minstrel.apk.version (populated by release.yml on tag # minstrel.apk + minstrel.apk.version, which release.yml fills on every
# pushes; .gitkeep + README otherwise). Endpoints return 404 when the # build (dev and tag pushes bundle their own APK, main bundles the latest
# APK files aren't present, so non-tag images degrade gracefully. # release's); a local build has only .gitkeep + README. Endpoints return
# 404 when the APK files aren't present, so such an image degrades
# gracefully.
COPY --chown=minstrel:minstrel client/ /app/client/ COPY --chown=minstrel:minstrel client/ /app/client/
USER minstrel USER minstrel
+17 -32
View File
@@ -5,27 +5,20 @@
## Runtime images ## Runtime images
Minstrel's four workflows consume two CI images: Minstrel's one workflow, `.gitea/workflows/release.yml`, consumes two CI images:
``` ```
git.fabledsword.com/bvandeusen/ci-go:1.26 git.fabledsword.com/bvandeusen/ci-go:1.26
git.fabledsword.com/bvandeusen/ci-android:36 git.fabledsword.com/bvandeusen/ci-android:36
``` ```
- `ci-go:1.26` — the `go`, `integration` and `web` lanes, `release-assets`, and the container build (`image-release`). All CI lives in one workflow, `.gitea/workflows/release.yml`, so every publishing job can depend on every lane (rule 177). - `ci-go:1.26` — the `go`, `integration` and `web` lanes, `release-assets`, and the container build (`image-release`). All CI lives in that one workflow so every publishing job can depend on every lane.
- `golang:1.26-bookworm` (Docker Hub) — the `govulncheck` lane. Deliberately the same image as the Dockerfile's builder stage rather than `ci-go`, so the standard library it checks is the one in the shipped binary. Keep the two in step. - `golang:1.26-bookworm` (Docker Hub) — the `govulncheck` lane. Deliberately the same image as the Dockerfile's builder stage rather than `ci-go`, so the standard library it checks is the one in the shipped binary. Keep the two in step.
- `ci-android:36` — native Kotlin/Compose client: ktlint + detekt + unit tests + debug APK (the `android` lane), and the signed release APK (`android-release`). - `ci-android:36` — native Kotlin/Compose client: ktlint + detekt + unit tests (the `android` lane), and the signed release APK (`android-release`).
**`ci-flutter` is no longer consumed, and `ci-flutter` can now be retired.** **No job uses `ci-flutter`**; nothing in this repo needs a Flutter toolchain.
The M8 rewrite replaced the Flutter client with the native Android app and The `flutter-ci` runner *label* is still used: the Android jobs schedule on it
`flutter.yml` was removed; `ci-android` took its place. `flutter_client/` while pulling `ci-android:36`, per the label/image split below.
itself was deleted on 2026-08-16, which was the condition CI-Runner was
waiting on before dropping the image — nothing in this repo needs a Flutter
toolchain any more.
Note this does **not** mean the `flutter-ci` runner *label* goes: the Android
jobs still schedule on it while pulling `ci-android:36`, per the label/image
split below. The label is a scheduling handle, not a toolchain assertion.
## Image deps used ## Image deps used
@@ -43,8 +36,7 @@ split below. The label is a scheduling handle, not a toolchain assertion.
error. The workflows also set `JAVA_TOOL_OPTIONS=--enable-native-access=ALL-UNNAMED` error. The workflows also set `JAVA_TOOL_OPTIONS=--enable-native-access=ALL-UNNAMED`
to silence Gradle's launcher-JVM restricted-method warning. to silence Gradle's launcher-JVM restricted-method warning.
- **Android SDK + cmdline-tools + build-tools 36.0.0** — APK assembly + signing. - **Android SDK + cmdline-tools + build-tools 36.0.0** — APK assembly + signing.
No NDK: the native client has no C/C++ sources (this is why it isn't on No NDK: the app has no C/C++ sources.
`ci-flutter`).
- **ktlint + detekt** — `./gradlew ktlintCheck` and `./gradlew detekt` in - **ktlint + detekt** — `./gradlew ktlintCheck` and `./gradlew detekt` in
the `android` lane. Image pins track `android/gradle/libs.versions.toml` so local the `android` lane. Image pins track `android/gradle/libs.versions.toml` so local
and CI checks agree. and CI checks agree.
@@ -61,32 +53,25 @@ None.
- **Label/image split.** Workflows keep `runs-on: go-ci` / `runs-on: flutter-ci` as the scheduling label per the [`ci-runners.md`](https://…/FabledRulebook/ci-runners.md) "label = scheduling handle, image = `container.image`" pattern. The labels are intentional handles, not toolchain assertions — which is why the Android jobs still schedule on `flutter-ci` while pulling `ci-android:36`. Switch them to `android-ci` if that runner label is ever registered; nothing breaks either way. - **Label/image split.** Workflows keep `runs-on: go-ci` / `runs-on: flutter-ci` as the scheduling label per the [`ci-runners.md`](https://…/FabledRulebook/ci-runners.md) "label = scheduling handle, image = `container.image`" pattern. The labels are intentional handles, not toolchain assertions — which is why the Android jobs still schedule on `flutter-ci` while pulling `ci-android:36`. Switch them to `android-ci` if that runner label is ever registered; nothing breaks either way.
- **Integration-job docker-socket dependency.** The `integration` lane uses the runner's shared docker socket (`/var/run/docker.sock`) to bridge-IP-discover the per-job Postgres service container by name + network intersection — the dev compose's `minstrel-postgres-*` containers are explicitly skipped as belt-and-suspenders. Depends on `act_runner.valid_volumes` whitelisting the socket; if that ever stops auto-mounting, integration tests fail at the `docker inspect` step. - **Integration-job docker-socket dependency.** The `integration` lane uses the runner's shared docker socket (`/var/run/docker.sock`) to bridge-IP-discover the per-job Postgres service container by name + network intersection — the dev compose's `minstrel-postgres-*` containers are explicitly skipped as belt-and-suspenders. Depends on `act_runner.valid_volumes` whitelisting the socket; if that ever stops auto-mounting, integration tests fail at the `docker inspect` step.
- **Go toolchain pin.** `go.mod` is on `go 1.25.0` because `golang.org/x/crypto v0.51.0` declares 1.25 as its minimum. `ci-go:1.26` satisfies this with headroom. Future `x/crypto` bumps that move the Go floor should be paired with an image-tag bump in this file + the workflows. - **Go toolchain pin.** `go.mod` is on `go 1.25.0` because `golang.org/x/crypto v0.51.0` declares 1.25 as its minimum. `ci-go:1.26` satisfies this with headroom. Future `x/crypto` bumps that move the Go floor should be paired with an image-tag bump in this file + the workflows.
- **In-app update channel — `needs:`, not polling.** `release.yml`'s `image-release` job declares `needs: [android-release]`, so on tag pushes the signed APK is guaranteed present before the image build starts — no polling window, no race. (The old cross-workflow polling against `flutter.yml` is gone with that workflow.) On non-tag `main` pushes `android-release` is skipped and `image-release` instead pulls the most recent release's APK and reconstructs its exact `versionName`, so `:latest` never ships without an update channel. It degrades to an empty `client/` — never a wrong version — if no release, asset, or tag commit-count can be resolved. - **In-app update channel — `needs:`, not polling.** `release.yml`'s `image-release` job declares `needs: [android-release]`, so on dev and tag pushes the signed APK is guaranteed present before the image build starts — no polling window, no race. On `main` pushes `android-release` is skipped and `image-release` instead pulls the most recent release's APK and the version sidecar recorded beside it, so `:latest` never ships without an update channel. It degrades to an empty `client/` — never a wrong version — if no release or APK asset can be resolved.
- **Cache server reachability.** The `web` lane does NOT use `cache: 'npm'` on `actions/setup-node` — the Gitea Actions cache server isn't reachable from this runner's container network and `setup-node` was burning ~4m41s on ETIMEDOUT before failing open. With the migration to `ci-go:1.26`, `setup-node` is removed entirely (Node is in the image). The cache concern reappears if a future change re-introduces a network-dependent action. - **Cache server reachability.** The `web` lane does NOT use `cache: 'npm'` on `actions/setup-node` — the Gitea Actions cache server isn't reachable from this runner's container network, so `setup-node` would spend minutes on ETIMEDOUT before failing open. `setup-node` is not used at all (Node is in the image). The cache concern reappears if a change introduces a network-dependent action.
- **Artifacts — stock `actions/upload-artifact@v7` and `actions/download-artifact@v8`; never `@v3`.** - **Artifacts — stock `actions/upload-artifact@v7` and `actions/download-artifact@v8`; never `@v3`.**
```yaml ```yaml
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
uses: actions/download-artifact@v8 uses: actions/download-artifact@v8
``` ```
Stock works on this forge since the runner moved to gitea/runner 3.x, which Stock works on this forge because gitea/runner 3.x edits the actions'
edits the actions' client-side `isGhes()` refusal out of their bundles. Proven client-side `isGhes()` refusal out of their bundles; upload v4–v7 and
on 2026-09-10 for upload v4–v7 and download v4–v8 (Scribe spike #3843). Until download v4–v8 are proven.
then this repo pinned SHA mirrors of the Forgejo project's forks, because
upstream threw on the hostname before it opened a connection (Scribe 2255).
`@v3` is still broken: it reports success, and Gitea serves artifacts back only `@v3` is still broken: it reports success, and Gitea serves artifacts back only
through the v4 API (`content_encoding = application/zip`), so a v3 upload is through the v4 API (`content_encoding = application/zip`), so a v3 upload is
stored but invisible to every retrieval path. That is how 72 unreachable stored but invisible to every retrieval path.
artifacts accumulated on this repo (Scribe 2270).
**Pairing no longer needs managing.** This entry used to pin upload v5 against **The upload and download majors need not match.** Every download major
download v6 so both bundled `@actions/artifact` ^4.0.0, warning that a mismatch v4–v8 reads the artifacts of every upload major v4–v7, by name and by
across `release.yml`'s producer/consumer pair would list empty. Tested, and not pattern; the only protocol break is v3 → v4. Every CI-runner image carries
true on this instance: every download major v4–v8 read the artifacts of every Node 24, and the runner runs actions with the image's `node`.
upload major v4–v7, by name and by pattern (CI-runner run 6312). The only real
protocol break is v3 → v4. node24 is no longer a concern either — every
CI-runner image carries Node 24 and the runner runs actions with the image's
`node`.
Upload steps set `if-no-files-found: error` rather than the default `warn`, so Upload steps set `if-no-files-found: error` rather than the default `warn`, so
an upload that matches nothing fails its own job instead of failing the an upload that matches nothing fails its own job instead of failing the
+38 -25
View File
@@ -1,45 +1,58 @@
# Bundled client assets # Bundled client assets
Holds the Android APK (`minstrel.apk` + `minstrel.apk.version`) that the Holds the Android APK (`minstrel.apk`) and its version sidecar
server serves via `/api/client/version` and `/api/client/apk` for the (`minstrel.apk.version`) that the server serves via `/api/client/version`
in-app update flow (#397). and `/api/client/apk` for the in-app update flow.
## Production ## Production
CI populates this directory in `release.yml` (no Flutter — the client is CI fills this directory in `release.yml` before every image build:
native Android, built by the `android-release` job):
- **Tag release (`v*`):** the `android-release` job builds + signs the - **Dev push (`:dev`) and tag release (`v*`):** the `android-release` job
APK, uploads it as a workflow artifact, and attaches it to the Gitea builds and signs the APK and uploads it as a workflow artifact;
release as `minstrel-<TAG>.apk`. The `image-release` job `image-release` downloads it here as `minstrel.apk` and writes the
(`needs: android-release`) downloads that artifact into this directory sidecar from that build's version outputs. A tag release also attaches
as `minstrel.apk` and writes the computed versionName to both files to the Gitea release.
`minstrel.apk.version`. - **Main push (`:latest` + `:<sha>`):** no APK is built, but the image
- **Main push (non-tag `:latest` / `:main`):** no APK is built, but the still moves `:latest`, so `image-release` downloads the most recent
image still moves `:latest`, so `image-release` pulls the most-recent release's APK and the sidecar recorded beside it. `:latest` keeps its
release's signed APK from the Gitea API and reconstructs its exact update channel between releases.
versionName — keeping the in-app update channel alive on `:latest`
instead of stripping it until the next tag.
Either way, `docker buildx build` bakes both files into the image via Either way, `docker buildx build` bakes both files into the image via
`COPY client/ /app/client/`. `COPY client/ /app/client/`.
## The sidecar
`minstrel.apk.version` is JSON:
```json
{"name": "2026.10.23.1200", "code": 3549060, "channel": "dev"}
```
- `name` is the version name the app shows.
- `code` is the ordering key Android installs by. `null` means unknown,
and clients then compare names.
- `channel` says which lane built it.
A sidecar that is not valid JSON, or has no `name`, is an error rather
than a blank version.
## Development ## Development
Empty directory works fine — the endpoints return 404 and the Android An empty directory works fine: the endpoints return 404 and the Android
update banner stays hidden ("no update channel" graceful degradation). update banner stays hidden.
To smoke-test the update flow locally, drop a real APK + a version To smoke-test the update flow locally, drop a real APK and a sidecar into
file into this directory: this directory:
```sh ```sh
cp /path/to/app-release.apk client/minstrel.apk cp /path/to/app-release.apk client/minstrel.apk
echo "v0.2.0" > client/minstrel.apk.version echo '{"name":"2099.01.01.0000","code":null,"channel":"dev"}' > client/minstrel.apk.version
``` ```
## Why a directory and not embed.FS? ## Why a directory and not embed.FS?
The APK is 30-60 MB. Embedding bloats the Go binary and slows The APK is 30-60 MB. Embedding bloats the Go binary and slows `go build`
`go build` for everyone, even when the APK isn't being changed. for everyone, even when the APK isn't being changed. File-on-disk also
File-on-disk also lets operators override at runtime via volume lets an admin override it at runtime with a volume mount on
mount on `/app/client/` if they want to ship their own build. `/app/client/` to ship their own build.
+1 -2
View File
@@ -1,6 +1,5 @@
-- Runs once, only on a fresh Postgres data volume (Docker entrypoint -- Runs once, only on a fresh Postgres data volume (Docker entrypoint
-- initdb hook). Creates the dedicated integration-test database so -- initdb hook). Creates the dedicated integration-test database so
-- `go test` never truncates the operator's dev `minstrel` DB (Fable -- `go test` never truncates the dev `minstrel` DB. For an already-initialised volume this script does NOT run;
-- #339). For an already-initialised volume this script does NOT run;
-- `make test-integration` creates the DB idempotently instead. -- `make test-integration` creates the DB idempotently instead.
CREATE DATABASE minstrel_test OWNER minstrel; CREATE DATABASE minstrel_test OWNER minstrel;
+4 -5
View File
@@ -41,9 +41,8 @@ func TestLibrarySync_AfterArtistUpsert_ReturnsHydratedPayload(t *testing.T) {
truncateLibrary(t, pool) truncateLibrary(t, pool)
u := seedUser(t, pool, "alice", "x", false) u := seedUser(t, pool, "alice", "x", false)
// Seed an artist + write a change row in the same tx — that's the // Seed an artist + write a change row in the same tx — the invariant
// invariant the scanner wiring (Task 5) will enforce, and the // library writes keep, and the handler relies on.
// handler relies on.
ctx := context.Background() ctx := context.Background()
tx, err := pool.Begin(ctx) tx, err := pool.Begin(ctx)
if err != nil { if err != nil {
@@ -122,8 +121,8 @@ func TestLibrarySync_DeleteIsReflected(t *testing.T) {
u := seedUser(t, pool, "alice", "x", false) u := seedUser(t, pool, "alice", "x", false)
// Just write a delete change row directly (no underlying mutation). // Just write a delete change row directly (no underlying mutation).
// Scanner wiring (Task 5) is what couples real deletes to LogChange; // Library writes couple real deletes to LogChange; here we test the
// here we test the handler reflects what's in the log. // handler reflects what's in the log.
ctx := context.Background() ctx := context.Background()
tx, _ := pool.Begin(ctx) tx, _ := pool.Begin(ctx)
_ = sync.LogChange(ctx, tx, sync.EntityArtist, "deadbeef-dead-beef-dead-beefdeadbeef", sync.OpDelete) _ = sync.LogChange(ctx, tx, sync.EntityArtist, "deadbeef-dead-beef-dead-beefdeadbeef", sync.OpDelete)
+1 -1
View File
@@ -23,7 +23,7 @@ type updateProfileReq struct {
// nil = leave unchanged; non-nil empty string = clear; non-nil // nil = leave unchanged; non-nil empty string = clear; non-nil
// non-empty = update to that value. Note: distinguishing // non-empty = update to that value. Note: distinguishing
// omit-vs-clear at JSON-decode time requires custom unmarshaling // omit-vs-clear at JSON-decode time requires custom unmarshaling
// or a sentinel; for v1 we use the simpler "empty string clears" // or a sentinel; we use the simpler "empty string clears"
// semantics: any field present in the JSON body is applied. // semantics: any field present in the JSON body is applied.
DisplayName *string `json:"display_name"` DisplayName *string `json:"display_name"`
Email *string `json:"email"` Email *string `json:"email"`
+3 -3
View File
@@ -32,7 +32,7 @@ type Provider interface {
RequiresAPIKey() bool RequiresAPIKey() bool
// DefaultEnabled is whether a freshly-installed Minstrel ships // DefaultEnabled is whether a freshly-installed Minstrel ships
// with this provider on. Both v1 providers return true. // with this provider on. Providers that need an API key ship off.
DefaultEnabled() bool DefaultEnabled() bool
// Configure receives the admin's settings (api_key, enabled // Configure receives the admin's settings (api_key, enabled
@@ -102,8 +102,8 @@ type ArtistArtProvider interface {
// TestableProvider is an opt-in capability: providers that can answer // TestableProvider is an opt-in capability: providers that can answer
// "is my config working?" without performing a full enrichment cycle. // "is my config working?" without performing a full enrichment cycle.
// Used by the admin Test-Connection button. v1: both MBCAA and // Used by the admin Test-Connection button. MBCAA and TheAudioDB
// TheAudioDB implement this. // implement this.
type TestableProvider interface { type TestableProvider interface {
Provider Provider
TestConnection(ctx context.Context) error TestConnection(ctx context.Context) error
+2 -2
View File
@@ -23,8 +23,8 @@ const (
// theAudioDBMinPeriod enforces TheAudioDB's documented free/test // theAudioDBMinPeriod enforces TheAudioDB's documented free/test
// rate limit (2 req/sec). Patreon supporter keys allow higher // rate limit (2 req/sec). Patreon supporter keys allow higher
// rates; we don't differentiate in v1 — operators with supporter // rates; we don't differentiate — supporter keys get the same
// keys experience the conservative 2 req/sec ceiling. // conservative 2 req/sec ceiling.
theAudioDBMinPeriod = 500 * time.Millisecond theAudioDBMinPeriod = 500 * time.Millisecond
// theAudioDBMaxRetries is the number of retry attempts on 429 / // theAudioDBMaxRetries is the number of retry attempts on 429 /
+5 -4
View File
@@ -1,5 +1,6 @@
// Package eventbus is an in-process publish/subscribe bus for real-time // Package eventbus is an in-process publish/subscribe bus for real-time
// events the server emits to subscribed clients (today: Flutter via SSE). // events the server emits to subscribed clients (the web and Android apps,
// over SSE).
// //
// Writers (likes handler, requests reconciler, scanner, etc.) call Publish // Writers (likes handler, requests reconciler, scanner, etc.) call Publish
// to announce a state change. Each connected SSE client holds a // to announce a state change. Each connected SSE client holds a
@@ -13,9 +14,9 @@
// - No persistence. A client that connects after an event was emitted // - No persistence. A client that connects after an event was emitted
// will not see that event. SSE clients are expected to fetch a fresh // will not see that event. SSE clients are expected to fetch a fresh
// snapshot via the normal /api/* endpoints on (re)connect. // snapshot via the normal /api/* endpoints on (re)connect.
// - No cross-process broadcast. v1 runs as a single Go binary; a future // - No cross-process broadcast. Minstrel runs as a single Go binary; a
// multi-instance deployment will need a real broker (NATS / Redis // multi-instance deployment would need a real broker (NATS / Redis
// pub-sub / etc.) but that's out of scope here. // pub-sub / etc.).
package eventbus package eventbus
import ( import (
+2 -2
View File
@@ -74,8 +74,8 @@ func (s *SMTPSender) Send(ctx context.Context, to, subject, textBody, htmlBody s
// We respect the use_tls flag: if true, we require STARTTLS via // We respect the use_tls flag: if true, we require STARTTLS via
// smtp.SendMail's default behavior (which negotiates STARTTLS when // smtp.SendMail's default behavior (which negotiates STARTTLS when
// the server advertises it). For implicit-TLS (port 465 style), // the server advertises it). For implicit-TLS (port 465 style),
// we'd need a custom dial — skip that complexity for v1 and rely on // we'd need a custom dial; instead this relies on STARTTLS via port
// STARTTLS via port 587 (the default). // 587 (the default).
dialCtx, cancel := context.WithTimeout(ctx, 30*time.Second) dialCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel() defer cancel()
_ = dialCtx // smtp.SendMail doesn't accept ctx; the timeout is enforced via Dialer below _ = dialCtx // smtp.SendMail doesn't accept ctx; the timeout is enforced via Dialer below
+1 -1
View File
@@ -92,7 +92,7 @@ type CandidateSourceLimits struct {
UserCoplay int UserCoplay int
} }
// DefaultCandidateSourceLimits returns the v1 hardcoded constants per spec. // DefaultCandidateSourceLimits returns the hardcoded per-source limits.
func DefaultCandidateSourceLimits() CandidateSourceLimits { func DefaultCandidateSourceLimits() CandidateSourceLimits {
return CandidateSourceLimits{ return CandidateSourceLimits{
LBSimilar: 30, LBSimilar: 30,
+1 -2
View File
@@ -1,8 +1,7 @@
package recommendation package recommendation
// SimilarityWeights balances the per-axis contribution to the weighted Jaccard // SimilarityWeights balances the per-axis contribution to the weighted Jaccard
// score. v1 hardcodes the defaults — operators cannot tune via YAML. If // score. The defaults are hardcoded; there is no config key for them.
// telemetry justifies it, expose under recommendation.similarity.* later.
type SimilarityWeights struct { type SimilarityWeights struct {
TagsWeight float64 TagsWeight float64
ArtistsWeight float64 ArtistsWeight float64
+2 -2
View File
@@ -48,8 +48,8 @@ func parseUUID(s string) (pgtype.UUID, bool) {
return u, u.Valid return u, u.Valid
} }
// MusicFolder matches Subsonic's /rest/getMusicFolders. v1 always reports a // MusicFolder matches Subsonic's /rest/getMusicFolders. Minstrel always
// single folder because Minstrel has no multi-library concept yet. // reports a single folder: it has no multi-library concept.
type MusicFolder struct { type MusicFolder struct {
XMLName xml.Name `json:"-" xml:"musicFolder"` XMLName xml.Name `json:"-" xml:"musicFolder"`
ID int `json:"id" xml:"id,attr"` ID int `json:"id" xml:"id,attr"`
+1 -1
View File
@@ -50,7 +50,7 @@ func TestRegisterDuplicatePanics(t *testing.T) {
Register(&fakeProvider{id: "dup"}) Register(&fakeProvider{id: "dup"})
} }
// TestBuiltinProvidersRegister confirms the two v1 sources register with // TestBuiltinProvidersRegister confirms the two built-in sources register with
// the expected identities/defaults. Runs against a fresh registry so it is // the expected identities/defaults. Runs against a fresh registry so it is
// independent of test ordering: re-register constructed instances. // independent of test ordering: re-register constructed instances.
func TestBuiltinProvidersRegister(t *testing.T) { func TestBuiltinProvidersRegister(t *testing.T) {
+2 -6
View File
@@ -3,12 +3,8 @@
`fabledsword.tokens.json` is the canonical statement of the FabledSword `fabledsword.tokens.json` is the canonical statement of the FabledSword
palette — the dark, light and flat cohorts in one machine-readable place. palette — the dark, light and flat cohorts in one machine-readable place.
It lived under `flutter_client/shared/` until that client was deleted The Android theme (`FabledSwordTokens.kt`) names it as its source of
(2026-08-16). It was never Flutter-specific: the Android theme truth, and the web client's CSS custom properties carry the same values.
(`FabledSwordTokens.kt`) names it as its source of truth, and the web
client's CSS custom properties carry the same values. It moved here rather
than going with the client, because losing the one place all three cohorts
are written down together would have been collateral damage.
Nothing generates from it today — both clients hold their own transcription, Nothing generates from it today — both clients hold their own transcription,
so this is the reference they must agree with, not a build input. If the so this is the reference they must agree with, not a build input. If the
+4 -5
View File
@@ -180,11 +180,10 @@ def main():
" Literal colours, for any consumer that cannot inline the SVG and\n" " Literal colours, for any consumer that cannot inline the SVG and\n"
" therefore cannot supply a currentColor. -->\n")) " therefore cannot supply a currentColor. -->\n"))
# The tab icon is the full mark too (#5267). A hand-drawn reduced hat used # The tab icon is the full mark too. A hand-drawn reduced form would lose
# to stand in at tab size because the art loses detail at 16px, but a # less detail at 16px, but a redrawing reads as a different logo; the full
# redrawing reads as a different logo. The full mark keeps the logo's own # mark keeps the logo's own shape, and a tab on a high-resolution screen
# shape, and a tab on a high-resolution screen draws it from 32px, where it # draws it from 32px, where it holds. Do not swap a redrawn form in here.
# holds. Do not swap a redrawn form back in here.
(ROOT / "web/static/brand/favicon.svg").write_text(svg_doc( (ROOT / "web/static/brand/favicon.svg").write_text(svg_doc(
vb, tr, "currentColor", ACCENT, hat_d, notes_d, vb, tr, "currentColor", ACCENT, hat_d, notes_d,
head=" <!-- Generated by tools/gen-brand-assets.py — do not edit by hand.\n" head=" <!-- Generated by tools/gen-brand-assets.py — do not edit by hand.\n"
+2 -2
View File
@@ -5,7 +5,7 @@ import { findCss, findRawText, findTailwind, scan } from './check-tint-contrast.
const web = resolve(dirname(fileURLToPath(import.meta.url)), '..'); const web = resolve(dirname(fileURLToPath(import.meta.url)), '..');
describe('hue-on-own-tint check (#3150)', () => { describe('hue-on-own-tint check', () => {
test('no source paints a hue as text on a tint of itself', () => { test('no source paints a hue as text on a tint of itself', () => {
expect(scan(resolve(web, 'src'), web)).toEqual([]); expect(scan(resolve(web, 'src'), web)).toEqual([]);
}); });
@@ -42,7 +42,7 @@ describe('hue-on-own-tint check (#3150)', () => {
expect(findRawText(`.msg { color: var(--fs-error); }`)[0].fix).toBe('var(--fs-error-fg)'); expect(findRawText(`.msg { color: var(--fs-error); }`)[0].fix).toBe('var(--fs-error-fg)');
}); });
test('raw accent text is caught too, including hover: variants (#5318)', () => { test('raw accent text is caught too, including hover: variants', () => {
expect(findRawText(`<a class="text-sm text-accent hover:underline">`)[0].fix).toBe('text-accent-fg'); expect(findRawText(`<a class="text-sm text-accent hover:underline">`)[0].fix).toBe('text-accent-fg');
expect(findRawText(`<a class="hover:text-accent">`)).toHaveLength(1); expect(findRawText(`<a class="hover:text-accent">`)).toHaveLength(1);
expect(findRawText(`.pending { color: var(--fs-accent); }`)[0].fix).toBe('var(--fs-accent-fg)'); expect(findRawText(`.pending { color: var(--fs-accent); }`)[0].fix).toBe('var(--fs-accent-fg)');
+2 -2
View File
@@ -7,8 +7,8 @@ export const BROWSE_PAGE_SIZE = 50;
// Genres are the raw ID3 strings, split on [;,] server-side but otherwise // Genres are the raw ID3 strings, split on [;,] server-side but otherwise
// untouched — no case folding, no synonym mapping. So "Rock" and "rock" can // untouched — no case folding, no synonym mapping. So "Rock" and "rock" can
// both appear, as can "Rock/Pop" beside "Rock" and "Pop". Deliberate for v1: // both appear, as can "Rock/Pop" beside "Rock" and "Pop". Deliberate: the
// the raw spread has to be visible before anyone can judge whether it needs // raw spread has to be visible before anyone can judge whether it needs
// normalising. // normalising.
export type GenreCount = { genre: string; track_count: number }; export type GenreCount = { genre: string; track_count: number };
+1 -1
View File
@@ -101,7 +101,7 @@
// The server-side filter hides this candidate on next refetch. // The server-side filter hides this candidate on next refetch.
await client.invalidateQueries({ queryKey: qk.suggestions() }); await client.invalidateQueries({ queryKey: qk.suggestions() });
} catch { } catch {
// Swallow for v1; the SPA will refetch on next mount and the card // Swallowed: the SPA will refetch on next mount and the card
// stays requestable so the user can retry. // stays requestable so the user can retry.
} }
} }
+1 -1
View File
@@ -133,7 +133,7 @@ export function useEventsDispatcher(): void {
openTrackId = trackId; openTrackId = trackId;
} }
} catch { } catch {
// Best-effort; missed events are OK in v1. // Best-effort; a missed event is acceptable.
} }
} }
} }
+1 -1
View File
@@ -79,7 +79,7 @@ describe('player store — basic actions', () => {
// play anyway — tested via report later. Here, simulate the paused state: // play anyway — tested via report later. Here, simulate the paused state:
reportTimeUpdate(0); reportTimeUpdate(0);
// manually put us in paused state by calling togglePlay twice isn't clean; // manually put us in paused state by calling togglePlay twice isn't clean;
// set via the state-report API in Task 2. Instead, test the simpler case: // it is set via the state-report API. Instead, test the simpler case:
// playQueue then togglePlay = still 'loading' (intent is to play). // playQueue then togglePlay = still 'loading' (intent is to play).
togglePlay(); // from 'loading' — inverts intent; store moves to 'paused' intent togglePlay(); // from 'loading' — inverts intent; store moves to 'paused' intent
expect(player.state).toBe('paused'); expect(player.state).toBe('paused');
+1 -1
View File
@@ -77,7 +77,7 @@
} }
}); });
// Phase 2 prefetch: when the current track passes the halfway mark, // Prefetch: when the current track passes the halfway mark,
// start loading the next track's bytes into a hidden <audio> element. // start loading the next track's bytes into a hidden <audio> element.
// The browser HTTP cache + audio buffer warm-up means the swap on // The browser HTTP cache + audio buffer warm-up means the swap on
// track-end is gap-free on slow networks. Reset src when no next // track-end is gap-free on slow networks. Reset src when no next
+2 -2
View File
@@ -94,8 +94,8 @@
// Surface the new request on /requests right away (+ start its poll). // Surface the new request on /requests right away (+ start its poll).
queryClient.invalidateQueries({ queryKey: qk.myRequests() }); queryClient.invalidateQueries({ queryKey: qk.myRequests() });
} catch { } catch {
// Swallow for v1: error toasts land in a later UX pass. The card stays // Swallowed, with no toast: the card stays in 'requestable' so the
// in 'requestable' so the user can retry. // user can retry.
} }
} }
+1 -1
View File
@@ -28,7 +28,7 @@
await unflagTrack(trackID); await unflagTrack(trackID);
await client.invalidateQueries({ queryKey: qk.myQuarantine() }); await client.invalidateQueries({ queryKey: qk.myQuarantine() });
} catch { } catch {
// Silent in v1; the SPA will refetch on next mount. // Silent; the SPA will refetch on next mount.
} }
} }
</script> </script>