Task — engineering-spec@1

"Served-bundle version drift — live site announced v0.1.0 after the 1.0.0 release; refreshed bundle + version-sync gate coverage for apps/console/web"

doneTASK-IMP-080
module improvement · class product · priority p0 · created 2026-07-13 · shipped 2026-07-13
depends on none · blocks none

§1

  1. apps/console/web/ (the tracked vite output the VPS serves via git pull) MUST be rebuilt so version.json carries the current VERSION - done: {"build":"20260712204020","version":"1.0.0"}; the new service-worker cache id makes connected clients pick up the deploy via the existing update banner (useUpdateCheck polls version.json).
  2. check-version-sync.sh MUST cover the served bundle as artifact 7: apps/console/web/version.json .version == VERSION, failing with the exact rebuild command. This makes bundle lag loud at every pre-commit, payload-gate, version bump, and release run that already calls the gate (TASK-IMP-068 wiring).
  3. The check reads the REPO copy, not the payload - the served bundle is a repo-side channel like the status page, and it rides the same gate chain rather than a new one.

Lean profile: one gate check + one regenerated bundle; defect, fix, and both gate directions machine-verified in-session.

§2 — Why this shape

The badge pipeline itself was already correct (VersionBadge -> /version.json -> stamp-sw.mjs -> root VERSION); what was missing is anything that forces the TRACKED output to be regenerated after a version change. The gate converts "someone must remember to rebuild" into "the next commit fails with the command to run" - same posture as every other artifact in the sync check. A CI leg that rebuilds and ships the bundle (docs-job style, via ship.sh) would remove even that manual step; recorded in §9 as the structural follow-up rather than done here, because it changes the serving model (git-pull-tracked dir) that deploy.sh's caddy bind documents.

§5 (run 2026-07-13)

§9

§10

FailureDetectionRecovery
version bump without web rebuildgate check 7 fails the next commit/CI run with the commandrun the printed rebuild, commit
version.json deleted/mangledcheck 7 explicit missing/unreadable branchrebuild
rebuild forgotten AND gate bypassedimpossible via the normal chain (pre-commit + payload-gate + version.yml + release all call the gate)any one path fires
badge shows stale after deploysw cache id changed -> update banner prompts reloadclient reload

End of TASK-IMP-080.

Audit

  • ISS-001: draft only rebuilt the bundle (restores truth today, silently drifts again on the next bump) - resolved: gate coverage added as artifact 7 in check-version-sync.sh, riding the existing TASK-IMP-068 chain instead of a new mechanism; both directions tested.
  • ISS-002: draft proposed a CI rebuild-and-commit leg in the same change - resolved: deferred to §9; it alters the documented git-pull serving model (deploy.sh caddy directory bind) and deserves its own decision, while the gate already removes the silent-failure mode. Score = 10/10.