Last verified: 2026-08-27 Β· Repo root: isotope-code Β· Served entry: public/assets/index-D1Y5F8Lk.js
Status: the 2026-08-09 audit backlog is closed. H1βH4, M1βM6 and L1βL3 are all fixed and verified against the current tree. What remains open is L4βL7 below, all accepted-risk or low-priority.
This file previously described those items as open, with line numbers from the
2026-08-09 tree. Following it verbatim would now re-introduce bugs β most
sharply H3, whose prescribed fix (if (!isAdminAuthed(req)) on
/api/update-now) is exactly the regression that made the in-app Update button a
permanent 403 on every install running ENABLE_ADMIN_MODE=false. The historical
detail is kept below each heading for provenance; the Status line is
authoritative.
Anchor health is now self-reporting: every patch logs on apply and warns on miss,
and misses are additionally collected into _criticalPatchFailures, which renders
a banner in served HTML. So the check is just "start the server and read the log".
# Zero output = every anchor matched.
bash bin/isotope restart && sleep 6
grep -iE 'anchor not found|String not found' ~/.isotope/logs/server.log
# What did apply (52 lines at time of writing).
grep -E '^\[[A-Za-z]+(Patch|CrashFix|KeyboardFix)' ~/.isotope/logs/server.log | sort -u
# Every patched bundle must return 200 and parse.
for f in useAIStore-DRa7CkEN App-CQ9mV4wu Auth-D0Y8CB1f Focus-B4gLsWoP \
Onboarding-C0svxOgT SingleGroup-DU1IhoNK useLeaderboard-BpvH5FXA \
SettingsLayout-DkuooNHv useSyncStore-Di0wBMnH AppAccessGate-DzNuNpuU \
sessionSync-mloIEnTd useInvites-D9RLFwf8 Community-CEnEgsrd \
communityApi-Ccw5N_9O CommunityHub-gANxZssO CommunityVisuals-mHr4KGyg \
Dashboard-Dzf-IC_a Study-BXfkiHvM useNotificationStore-BTREori0 \
usePWA-BOujtGOv marketing-core-DzcTqL0l useAuthStore-Aw1au7RF \
index-D1Y5F8Lk; do
T=$(mktemp)
code=$(curl -s -o "$T" -w '%{http_code}' "http://127.0.0.1:3000/assets/$f.js")
[ "$code" = 200 ] && node --check "$T" || echo "FAIL $f ($code)"
done
node --check server.mjs && node --check public/sw.jsTwo invariants worth asserting after any bundle rebuild:
# 1. The two RUNTIME_PATCHED_ASSET_PATHS sets must be identical.
python3 - <<'PY'
import re
def s(p):
m = re.search(r'RUNTIME_PATCHED_ASSET_PATHS\s*=\s*new Set\(\[(.*?)\]\)',
open(p, encoding='utf8').read(), re.S)
return set(re.findall(r"'([^']+)'", m.group(1)))
a, b = s('server.mjs'), s('public/sw.js')
print('IN SYNC' if a == b else f'OUT OF SYNC\n server only: {sorted(a-b)}\n sw only: {sorted(b-a)}')
PY
# 2. Every *_ABS asset the server patches must be in that set, or it ships immutable.Status: β
FIXED. All anchors match. grep -iE 'anchor not found|String not found'
on a fresh server log returns nothing, and 52 patches report applied.
Re-anchoring happened in stages. The last two were fixed 2026-08-27 and are worth recording because they shared a root cause: the anchor was written against pretty-printed source while the shipped bundle is minified.
| Anchor | Was | Is |
|---|---|---|
STUDY_SYLLABUS_FROM |
Y.filter((m) => I.syllabusIds.includes(...)) |
Y.filter(m=>I.syllabusIds.includes(...)) |
| Onboarding completion | a({\n currentStep: 7\n}), await r({...}) |
a({currentStep:C}),await r({...}) |
APP_DEMO_FROM and CB_FROM no longer exist under those names β the demo gate and
circuit breaker both moved into useAuthStore-Aw1au7RF.js and are now
DEMO_GATE_FROM / CB_FROM inside getPatchedAuthStoreBundle().
COMMUNITY_FEATURE_RENDER_FROM became obsolete (the current Community bundle has
no store/events feature switch); the removal is handled by
COMMUNITY_HUB_CARDS_FROM against CommunityHub-gANxZssO.js instead.
Lesson, applied: anchors were failing silently. Each patch now logs on apply,
warns on miss, and pushes to _criticalPatchFailures so a miss surfaces in the UI
rather than only in a log nobody reads. StudyPatch additionally counts hits
instead of re-testing raw.includes(FROM) after the replace β that bug made it
warn even on success.
Status: β
FIXED. handleSupabaseProxy gates escalation on
const useServiceKey = ADMIN_MODE_READY && isAdminAuthed(req);. Non-admin callers
are forwarded with their own Authorization header plus the anon key.
Status: β FIXED β but NOT with the fix originally prescribed here.
The original prescription was if (!isAdminAuthed(req)) return 401. That closes
the hole but breaks the feature: ADMIN_MODE_READY requires
ENABLE_ADMIN_MODE=true and a service-role key, which a normal self-hosted
install has neither of. The button became a permanent 403 with a redirect to a
login page that was itself disabled.
Current design authorizes on admin cookie OR loopback:
isLoopbackRequest(req)returns true only whenreq.socket.remoteAddressis127.0.0.1/::1, and nox-forwarded-for/x-forwarded-hostheader is present β any proxy in front means the real client is elsewhere, so we refuse.- LAN and remote callers still get 403, with
admin_availablein the body so the UI only offers admin unlock when unlock can actually work.
isotope update is a local git pull; the operator at the machine is precisely
who should be allowed to run it.
Additionally, because git pull auto-stashes a dirty tree, a bare POST now
returns 409 confirmation_required with dirty_count when
git status --porcelain is non-empty. ?confirm=1 proceeds. GET /api/update-status reports {authorized, admin_available, dirty, dirty_count, dirty_files, branch} so the pill can warn before acting. This was added after
a test run silently stashed 15 modified files.
Status: β
ACCEPTED (owner-approved), documented at server.mjs:2413-2416.
This install intentionally grants itself plan_type='ranker'. Not a defect here.
Status: β
FIXED. All eight chains have .catch().
Status: β
FIXED. Now index-LkPKl--4.css and vendor-react-BWKHxYQy.js.
Status: β
FIXED. Now focusBackground-Dc8Rc9XQ.js.
Status: β FIXED. Both call sites wrapped in try/catch.
Status: β
FIXED. Points at hero-dashboard.png / community.png, both present.
Status: β ACCEPTED (owner-approved), comment-only.
Status: β FIXED (2026-08-10).
Status: β FIXED (2026-08-10). See also L7 β the two sets drifted again later and are now checked by an invariant.
Status: β
FIXED (2026-08-10). Deleted; manifest.webmanifest is canonical.
server.mjs:180-181 β DEFAULT_SUPABASE_URL and DEFAULT_SUPABASE_ANON_KEY.
Anon-scope only and deliberate: they let a downloaded copy reach shared cloud sync
with no setup. Low risk.
Note the secondary finding in the original entry is fixed:
ADMIN_COOKIE_SECRET no longer falls back to the service key. It is now
ADMIN_SECRET || crypto.randomBytes(32).toString('hex') (server.mjs:241), so an
unconfigured install gets a random per-boot secret instead of reusing a credential.
server.mjs:6839-6843 returns {gemini: bool, groq: bool} unauthenticated. No key
material. Restrict to authenticated callers if it ever matters.
server.mjs:6600. Appends caller-supplied JSON to
~/.isotope/logs/browser-errors.log. 1 MB cap per request, but no rate limit and
no ceiling on total file size. Local-only surface; worth a cap if the server is
ever LAN-exposed.
The set lives in both server.mjs and public/sw.js and must stay identical; they
have drifted twice. Both are correct and in sync as of 2026-08-27 (25 entries), and
the stale /assets/PWAManager-CUuXr3sv.js entry is gone from server.mjs.
The failure mode is quiet and expensive: a serve-time-patched asset missing from
the set matches isHashedStaticAsset() and ships
Cache-Control: public, max-age=31536000, immutable, so browsers pin the
unpatched body for a year. This is what produced the recurring community black
screens. Mitigated β sw.js cache names now include a BUILD_TOKEN digest of
VERSION + server.mjs mtime, so editing a patch rotates the cache β but a single
generated source of truth would remove the class entirely.
- No TODO/FIXME/HACK markers.
- No SQL string-concatenation injection.
community_discover_groupswas parameterised withquote_literal()and escaped LIKE operands. - All 27
*_BUNDLE_ABS/*_ABStarget files exist. - Both
RUNTIME_PATCHED_ASSET_PATHSsets identical, and every*_ABSasset the server patches is present in them. node --checkclean acrossserver.mjs,public/sw.js,server/backup-manager.mjs, bothpublic/sync/*, the 7 runtime glue scripts, and all 17scripts/*.mjs.bash -nclean across all 9 shell scripts.test:auth-bridge,prove-runtime-glue,validate-docs(34 checks, 0 errors), and the CI backup-normalizer smoke all pass.- Dollar-quote delimiters balanced in every
*.sqlandsql/*.sql(now gated inschema-lint.ymlβ a stray$$;inisotope-complete.sqlhad been silently truncating every function after line 1305). pwa-local.js,update-checker.js,boot-recovery.js: storage guarded, no XSS vectors in banners.src/components(shadcn/ui scaffold): no missing keys, no hooks in conditionals; the onlydangerouslySetInnerHTMLissrc/components/ui/chart.tsx:79(component config only).
src/ is a Vite/React shadcn scaffold. The app actually served is the pre-built
bundle set in public/assets/, patched at serve time by server.mjs. Editing
src/ has no effect on what users get.