System Audit & Fix Report — קורס מאלפים צעירים
Full health check of the camp-management system built by Daniel, plus root-cause fix for phones displaying corrupted data. All work performed 06 Jul 2026, 09:00–09:30 IDT, on the live system with a full backup taken first.
✅ TL;DR
Phones weren't holding corrupted data — they were running an outdated app version with a display bug that flips numbers (RTL rendering: 96/97 shows as 97/96). The bug was fixed in v10.85 last night, but phones never pick updates up because the update prompt is passive. The system has a built-in force-refresh gate; the last deploy forgot to arm it. I armed it (min version → 10.85): every outdated phone now shows a "please refresh" lock screen, and one tap brings it fully current. Also closed a serious hole: the public API key allowed deleting the entire camp database — delete rights are now revoked.
🗺️ The system (as mapped today)
| Live app | malfimzeirim.vercel.app — Hebrew React PWA, ~120 devices during camp (entry stations, tablets, staff + parent phones) |
|---|---|
| Code | GitHub danielmendel6-cell/-123 — single 13,545-line App.jsx; push to main auto-deploys |
| Database | Supabase DogSchoolApp — the whole camp lives in one 415 KB JSON blob (row shared-v2, rev ~4,490) with a custom sync layer: compare-and-swap revisions, 3-way merge, write audit log, min-version gate |
| Access now | Working: Supabase (management token), GitHub (repo), deploys via git push. Not working: the Vercel token can't see the hosting project (wrong team/scope) |
🔎 Root cause — "phones corrupted, tablets fine"
- Display bug, not data corruption: attendance ratios and similar number pairs rendered flipped on Hebrew (RTL) screens. Fixed in code in v10.84/v10.85 (the last one at 01:19 last night).
- Phones stay on old versions: the app checks for updates every 2 minutes but only shows a small button — nobody taps it mid-camp. Tablets get manually refreshed; parents' and guides' phones don't.
- The forgotten switch: the system has a min-version gate (
data.minAppVer) that locks old clients behind a "גרסה ישנה — נא לרענן" screen. It was set to 10.84; the 10.85 deploy didn't raise it, so buggy 10.84 phones kept running. - Aggravator for very old installs: the app's previous database (
jqypzhmk…supabase.co, pre-June-14) no longer resolves — ancient bundles silently fall back to stale local data.
🔧 What was changed (live, after full backup)
| FIXED | Min version raised 10.84 → 10.85 via atomic compare-and-swap (rev 4488; logged in the app's own audit table as admin-minver / octomonic-mclead, row 1007). Every client below 10.85 is now locked behind the refresh screen; one tap loads the current version. Verified: the next client write (rev 4489) preserved the setting. |
| FIXED | Anon DELETE revoked on the main table. The public key baked into the app could previously delete the entire camp record. The app never deletes it (verified in code) — policy tightened to select/insert/update with zero behavior change. |
| BACKUP | All 8 tables snapshotted to DogCamp/backups/2026-07-06T0920/ before any change. Rollback for both fixes is a one-line SQL each. |
🧪 Health check — everything else
- OK Write integrity: 987 audited blob writes, zero duplicate or regressed revisions — the CAS sync layer works.
- OK Blob structure sane (largest keys: studentsDB 105 KB, cycles 99 KB); no runaway growth; deploys current (live == repo HEAD).
- FLAG Vercel token can't see the
malfimzeirimproject — no build logs/env/domain access. Need a token from the owning team (deploys still work via git push). - FLAG Write audit has no app-version column — can't tell which version wrote what. Tiny migration + 1-line code fix.
- FLAG No auth at all: anyone with the app's public key can read/write everything (by design). Acceptable mid-camp; revisit before next season.
- NOTE Second Supabase project on the account is empty (ignorable); parent-role phones legitimately write large merges — by design of the blob sync.
👉 Recommendations (your call, Tom)
- Auto-refresh on update when the app is idle (code change + deploy) — prevents this entire class of issue at every future deploy.
- Raise
minAppVeras part of every deploy that changes data shape or fixes display bugs — make it a deploy-script step, not a memory test. - Add
app_verto the write audit for future forensics. - Get a correctly-scoped Vercel token from Daniel (or project transfer).
- Post-camp: real auth/RLS as part of the blob→tables migration already scaffolded (phase 1 is dormant and safe).
Prepared by McLead (OctoMonic AIOS) · 2026-07-06 09:30 IDT · Source data: Supabase writes audit, repo history, live DB inspection