frontend: fix the three inconsistencies the onboarding guide found #99
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Jinemi/thermograph#99
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/frontend-doc-and-parity-gaps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #98, which documented these but deliberately didn't fix them.
1.
frontend/CLAUDE.mdandREADME.mddescribed a service that isn't deployedBoth described the Python FastAPI/Jinja implementation. The live service is Go (
frontend/server/). Both now describe it, state plainly that the Python files at that level are the superseded original, and list the duplicate contract copies they still carry (api_client.py'sAPI_VERSIONpin,format.py'sF_COUNTRIES).CLAUDE.mdalso claimedmake test-unitis "the tier CI runs." It isn't — CI's only frontend check isDockerfile's builder stage runninggofmt -l+go vet+go test ./..., so a failing Go test is what fails CI. Corrected.Deleting the Python is left as an open question rather than done in passing: the Python tiers still run, against fixtures the Go tests share.
2.
static/units.js'sF_REGIONSwas guarded by nothingThree source files claimed "a test asserts all three stay identical." The only assertion compared the Go set against the backend's Python; nothing read
units.js. The sets happened to agree, held in step by convention.TestFCountriesMatchesUnitsJSnow parses it and diffs both directions.The part worth reviewing: the pre-existing
TestFCountriesMatchesBackendskips in CI. The frontend image's build context isfrontend/, sobackend/is structurally unreachable from the builder stage — and the builder stage is the only place CI executes these tests. It has always been a checkout-only guard.static/is in the context, sofrontend/Dockerfilecopiesunits.jsinto the builder stage specifically so the new assertion runs during the image build. Verified by mutatingunits.jsand confirming the image build fails:Also verified failing in the other direction (removing a code) and passing once restored.
3. Both
docker-compose.test.ymlfiles pointed at retired image pathsBoth defaulted
BACKEND_IMAGE_PATHtoemi/thermograph-backend/app; the published path isemi/thermograph/backend. Corrected in both.The frontend harness additionally pinned
THERMOGRAPH_BACKEND_TEST_TAGto the split-erav0.0.2-split-ci. Rather than swap one hardcoded pin for another,scripts/backend-for-tests.shnow derives the tag from the checkout —sha-<12hex of git log -1 -- backend/>, the same domain-keyed rulebuild-push.ymlanddeploy.ymluse — so the harness follows the tree.docker-compose.test.ymlrequires the variable (:?) instead of defaulting it, so a stale pin can't creep back in silently, and the script fails with a useful message when the derived tag has no published image.Note the pathspec is
:/backend/(repo-root-relative): a barebackend/resolves against the script's cwd (frontend/) and would silently match nothing.4.
backend/CLAUDE.mdcarried the backend half of the same claimIts
F_COUNTRIESbullet said "there is a test asserting this" and pointed atfrontend/format.py— the superseded Python. Now names the Go and browser copies and says where each assertion actually runs. Itspct_ordinalbullet likewise now names the Go SSR copy alongsideshared.js.Verification
gofmt -lempty,go vet ./...clean, all 7 packagesokunits.jsfails that build (above)make backend-uppulls and serves on the derived tagsha-d4a00099f2fdshellcheckover every*.shin the tree: zero findingsOne thing I did not fix
make test-integrationfails 7 of 16 with503against a freshly-booted throwaway backend — the database is empty, so nothing is warm. I reproduced it identically on the old image and path (7 failed / 9 passed both ways), so it predates this change and isn't caused by it. Recorded indocs/onboarding/as a heads-up; not investigated further.https://claude.ai/code/session_01AfXqHrxCJLs2D7hpQkiUiJ