feedBack/lib
Byron Gamatos 0a6e0309e5
fix(tailwind): stop the dev server rewriting a tracked file (#911) (#918)
The runtime stylesheet moves to CONFIG_DIR. static/tailwind.min.css is never written again.

━━━ TWO DIFFERENT THINGS WERE SHARING ONE PATH ━━━

    static/tailwind.min.css   a BUILD ARTEFACT. Committed, image-baked, generated by scanning
                              the in-tree plugins only. CI's tailwind-fresh check verifies it.
    the RUNTIME sheet         PER-INSTALL STATE. Additionally scans whatever the user installed
                              into FEEDBACK_PLUGINS_DIR, so it differs machine to machine.

Writing the second over the first meant that MERELY RUNNING THE DEV SERVER from a git checkout
silently modified a tracked file. `git add -A` then swept a 100KB reshuffle of minified CSS
into the commit and ci/tailwind-fresh went red with a diff that explains nothing — on a PR
whose real change touched no Tailwind classes at all. It also wrote app state into the app
directory, which is read-only in some deploys.

A new route serves the runtime sheet when there is one and falls back to the committed one
otherwise. It is registered BEFORE the /static mount, which would otherwise swallow the path.

━━━ A PERSISTED SHEET MUST NOT OUTLIVE ITS REASON (Codex [P2] x2) ━━━

1. THE USER REMOVES THEIR PLUGINS. Startup only rebuilds when user plugins exist, so nothing
   would ever overwrite the stale sheet — and it still carries classes for plugins that are
   gone. With no user plugins the COMMITTED sheet is complete by definition. Guarded.

2. THE APP IS UPGRADED, and my first guard for this was WRONG. I compared mtimes. Codex: that
   is not a freshness signal across install methods — archives and container images routinely
   PRESERVE SOURCE MTIMES, so a just-shipped stylesheet can carry an OLDER timestamp than a
   runtime sheet a user built days ago. The mtime check then calls the stale one FRESH and it
   masks the new core CSS indefinitely — permanently, if no Tailwind toolchain is present to
   trigger a rebuild.

   Freshness is decided by CONTENT now. Each runtime build stamps a sidecar with the sha256 of
   the committed sheet it was made from. Core ships new CSS -> that file changes -> the hash
   changes -> the runtime sheet is correctly judged stale. Timestamps only gesture at the
   question that hashing answers.

Falling back to the committed sheet is always safe: at worst it lacks a just-installed plugin's
classes for the seconds until the async rebuild lands.

VERIFIED END TO END. Ran the real dev server with 3 plugins installed: it rebuilt Tailwind over
them (123,291 bytes), wrote the sheet + sidecar to CONFIG_DIR, still served /static/
tailwind.min.css at 200 — and `git diff` on the tracked file came back CLEAN.

8 tests. Bite-tested: reverting to the shared path fails 3, dropping the staleness guards fails
2 more.

pytest 2425, pyflakes 0, Codex 0.

Closes #911

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 13:25:16 +02:00
..
routers refactor(server): extract the artist routes into routers/artist.py (R3) (#870) 2026-07-11 15:49:37 +02:00
acoustid_match.py feat(enrichment): AcoustID audio-fingerprint identification (opt-in) (#759) 2026-07-05 00:17:43 +02:00
appconfig.py refactor(server): extract /api/tunings into routers/tunings.py + lib/appconfig.py (R3) (#858) 2026-07-11 01:43:19 +02:00
appstate.py refactor(server): carve the library scanner into lib/scan.py (R3b) (#901) 2026-07-12 01:26:02 +02:00
audio_effects_db.py refactor(server): extract AudioEffectsMappingDB into lib/audio_effects_db.py (R3) (#831) 2026-07-10 14:30:05 +02:00
audio.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
builtin_content.py refactor(server): carve builtin-content seeding into lib/builtin_content.py (R3b) (#900) 2026-07-12 00:50:50 +02:00
demo_mode.py fix(demo): the janitor re-entry guard actually works now (#902) (#909) 2026-07-12 11:30:53 +02:00
diagnostics_bundle.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
diagnostics_hardware.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
diagnostics_redact.py fix(tests): isolate plugin routes modules + redact .feedpak filenames (#736) 2026-07-03 13:01:07 +02:00
dlc_paths.py refactor(server): move DLC path resolution to lib/dlc_paths.py (R3 substrate) (#843) 2026-07-10 20:41:42 +02:00
drums.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
enrichment.py refactor(server): extract the song routes into routers/song.py (R3) (#864) 2026-07-11 13:14:52 +02:00
env_compat.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
gp2midi.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
gp2notation.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
gp2rs_gpx.py feat(gp_autosync): piecewise time-warp helpers + refine_sync onset pass (#787) 2026-07-05 20:08:19 +02:00
gp2rs.py fix(gp2rs): write beat times at 6-decimal precision so imported tempo matches Guitar Pro (#819) 2026-07-10 13:12:10 +02:00
gp8_audio_sync.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
gp_autosync.py fix(gp_autosync): slope-constrained DTW steps — stop path collapse on riff-based songs (#791) 2026-07-05 23:12:31 +02:00
jsonc.py feat(core): read .jsonc data files (strip C-style comments) (feedpak-spec §8) 2026-06-20 14:10:04 -07:00
library_registry.py refactor(server): extract library + collections routes + the provider registry (R3) (#866) 2026-07-11 14:56:12 +02:00
logging_setup.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
loosefolder.py Improve wording in terminology cleanup 2026-06-16 19:43:45 +01:00
lyrics_transcribe.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
mb_match.py feat(enrichment): alias-aware scoring — auto-confirm non-Latin-primary artists (#772) 2026-07-05 01:11:38 +02:00
metadata_db.py refactor(server): extract MetadataDB into lib/metadata_db.py (R3) (#830) 2026-07-10 14:18:59 +02:00
midi_import.py feat(drums): capture velocities alongside times in unmapped-percussion reporting (#808) 2026-07-07 23:58:49 +02:00
notation_lift.py fix: correctly import and notate multi-staff (piano/keys) tracks from GP8 (#692) 2026-07-02 08:40:20 +02:00
notation.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
progression.py Improve wording in terminology cleanup 2026-06-16 19:43:45 +01:00
reqfields.py refactor(server): extract the playlists routes into routers/playlists.py (R3) (#841) 2026-07-10 19:58:09 +02:00
safepath.py fix(library): serve art/load for songs mounted through a library junction (#766) 2026-07-05 00:15:50 +02:00
scan_worker.py refactor(server): extract MetadataDB into lib/metadata_db.py (R3) (#830) 2026-07-10 14:18:59 +02:00
scan.py refactor(server): carve the library scanner into lib/scan.py (R3b) (#901) 2026-07-12 01:26:02 +02:00
sloppak.py Drop dead whisperx entry from allowed lyrics_source set 2026-07-06 17:30:26 -04:00
song_score.py Clean release snapshot 2026-06-16 18:47:13 +02:00
song.py fix(gp-import): correct bass string count, lead/rhythm roles, preview note count (#601) 2026-06-26 18:58:35 +02:00
songmeta.py library: opt-in gap-fill — write confirmed missing metadata into the pack (R4a) (#724) 2026-07-02 20:52:11 +02:00
tailwind_rebuild.py fix(tailwind): stop the dev server rewriting a tracked file (#911) (#918) 2026-07-12 13:25:16 +02:00
tones.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
tunings.py Serve exact MIDI notes from GET /api/tunings (tuningMidis) (#829) 2026-07-10 13:05:39 +02:00
vocal_pitch.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
wem_decode.py rename: slopsmith → feedBack, byron → got-feedBack (#537) 2026-06-23 11:03:01 +02:00
xp.py Clean release snapshot 2026-06-16 18:47:13 +02:00