go/internal/config/config.go: changed CacheDir default from tmp to tmp/go. CACHE_DIR env override still works; os.MkdirAll creates the subdir on first write.
Both backends were defaulting to tmp/ and writing the same cache keys (attendance_regular, attendance_juniors, payments_transactions, exceptions_dict) with different shapes (Python: post-processed tuples; Go: raw rows). Whichever wrote last poisoned the cache, breaking the other backend.
Symptom: Python /adults failed with ValueError: too many values to unpack (expected 2, got 68) once the Go server populated tmp/attendance_regular_cache.json with 68 raw CSV rows.
This blocked M5.4's make parity flow (both backends running in parallel).
Test plan
cd go && go build ./... — clean
Stop Go server; hit POST /flush-cache on Python; verify /adults returns 200 (rewrites tmp/*.json with Python's shape)
Pull this fix, restart make web-go — verify Go writes to tmp/go/*_cache.json and leaves tmp/*_cache.json alone
With both running, make parity (after merging M5.4) should succeed end-to-end
After merge
The next PR (M5.4 — feat/go-m5-4-parity-binary, #19) will rebase on this fix.
## Summary
- `go/internal/config/config.go`: changed `CacheDir` default from `tmp` to `tmp/go`. `CACHE_DIR` env override still works; `os.MkdirAll` creates the subdir on first write.
- Both backends were defaulting to `tmp/` and writing the same cache keys (`attendance_regular`, `attendance_juniors`, `payments_transactions`, `exceptions_dict`) with different shapes (Python: post-processed tuples; Go: raw rows). Whichever wrote last poisoned the cache, breaking the other backend.
- Symptom: Python `/adults` failed with `ValueError: too many values to unpack (expected 2, got 68)` once the Go server populated `tmp/attendance_regular_cache.json` with 68 raw CSV rows.
- This blocked M5.4's `make parity` flow (both backends running in parallel).
## Test plan
- [x] `cd go && go build ./...` — clean
- [ ] Stop Go server; hit `POST /flush-cache` on Python; verify `/adults` returns 200 (rewrites `tmp/*.json` with Python's shape)
- [ ] Pull this fix, restart `make web-go` — verify Go writes to `tmp/go/*_cache.json` and leaves `tmp/*_cache.json` alone
- [ ] With both running, `make parity` (after merging M5.4) should succeed end-to-end
## After merge
The next PR (M5.4 — `feat/go-m5-4-parity-binary`, #19) will rebase on this fix.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Previously both backends defaulted to `CacheDir=tmp` and used the
same cache keys (`attendance_regular`, `attendance_juniors`,
`payments_transactions`, `exceptions_dict`) but stored different
shapes: Python caches post-processed view-model tuples
(e.g. `(members, sorted_months)`), Go caches raw sheet rows.
Whichever backend wrote last poisoned the cache for the other,
producing `ValueError: too many values to unpack (expected 2,
got 68)` on Python's /adults after the Go side populated the
file with 68 raw CSV rows.
This breaks the M5.4 `make parity` workflow that requires both
backends running side-by-side.
Fix: change Go's default to `tmp/go` so the two cache trees
never overlap. `CACHE_DIR` env var override still works.
`os.MkdirAll` already handles creating the new subdirectory on
first write.
Recovery for users with poisoned `tmp/`: hit /flush-cache on
the Python side once after pulling, then restart the Go server.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr
merged commit e5a272b682 into main2026-05-07 23:07:18 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
go/internal/config/config.go: changedCacheDirdefault fromtmptotmp/go.CACHE_DIRenv override still works;os.MkdirAllcreates the subdir on first write.tmp/and writing the same cache keys (attendance_regular,attendance_juniors,payments_transactions,exceptions_dict) with different shapes (Python: post-processed tuples; Go: raw rows). Whichever wrote last poisoned the cache, breaking the other backend./adultsfailed withValueError: too many values to unpack (expected 2, got 68)once the Go server populatedtmp/attendance_regular_cache.jsonwith 68 raw CSV rows.make parityflow (both backends running in parallel).Test plan
cd go && go build ./...— cleanPOST /flush-cacheon Python; verify/adultsreturns 200 (rewritestmp/*.jsonwith Python's shape)make web-go— verify Go writes totmp/go/*_cache.jsonand leavestmp/*_cache.jsonalonemake parity(after merging M5.4) should succeed end-to-endAfter merge
The next PR (M5.4 —
feat/go-m5-4-parity-binary, #19) will rebase on this fix.🤖 Generated with Claude Code
tmp/goto avoid Python collision