gitoria
All repositories: gitoria
2.7 KB
# R52 — app token unknown after a restart (blocks the day52 deploy)Task line: obvious bug in the live app (CONDUCTOR.md: "Obvious bugs in the live app: fix without asking").## Symptom (Gitoria, 2026-11-08 12:20, measured)`node tests/status.mjs` step "after a restart the token still works, the PUT replaces the stored row" (tests/status.mjs ~line 220-225: stop(); startServer(ENV); await up(); PUT status with the app token tPub issued before the restart) fails in about half the runs: the PUT gets 401 `unauthorized` "missing, unknown or expired token". Same rate on day50 bin (2 of 4) and day52 bin (3 of 4), so not a day52 regression. V37 (2026-11-02) saw the same in status-keyed ("token unknown after the second restart"). Live risk: after every deploy/restart, apps' (Kunibert's) tokens may be lost or not found.Code: lib/app-tokens.hl (MPackDB apptokens.db, primaryKey @id, indexes ['!hash','app','repo']; issueToken put, rowOfToken find('hash', sha256(token)); sweepExpired), lib/app-auth.hl.Read first, fully: /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md; /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md; the hl:mpackdb README in plugins/mpackdb (durability, close/flush, shutdown, index rebuild).## Work (git worktree `../gitoria-R52`, branch r52 from main; bin/ is not in git: copy main's bin/ folder (day52) into the worktree; never edit LOG.md/STATUS.md)1. Find the mechanism: is the row missing in apptokens.db after the restart (not flushed before SIGTERM/stop?), present but not found by the '!hash' index (index not persisted/rebuilt?), or something else (expires clock, a sweep deleting it, a second process)? Prove with a minimal instrumented run (inspect the db file before/after, log in a scratch copy only). Check how tests stop the server (signal, wait) vs how docker stops it live.2. If it is gitoria's code: fix it the framework's way (copy a working shape from the docs; gap → DOCS line). If it is a framework (mpackdb/runtime) bug: minimal repro in .scratch/ (a tiny .hl app: put, stop the same way, start, find by unique index) and STOP; no workaround.3. Proof: tests/status.mjs and tests/status-keyed.mjs 10 runs each, all 0 failed; then the full gates (LC_ALL=C, ports 8720-8739 only, `ss -ltn` first; port 8700 is taken: use the GITORIA_GATE_* variables as V52 did): `node theme/check-theme.mjs .`, `node tests/browser.mjs`, and every gate in deploy.sh's GATES list, all 0 failed.4. Commit on branch r52 (subject names the cause, no ticket number). Do NOT merge, push or deploy.## Reportreports/R52-REPORT.md (≤25 lines): mechanism with evidence, fix or repro path, run counts, gate numbers, live impact (were tokens lost at past deploys?), risks. Then stop. Budget ~60 requests.
Branches
- f1-broken-json
- f2-api-bugs
- gp-gate-ports
- heap-revert
- hl25-records
- ident-chooser-selector
- mainmain branch
- p51-public-pr-reads
- records-1112
- s25-no-session-on-login-error
- v59
- w52-person-approval
- w52b-approval-followup
- w52c-header-phone
- w53-pulls-speed-pr
- w54-repo-rename-pr
- w55-rename-org
- w56-owner-members
- w62-pr-close
- w63-force-push
- w64-org-slash
Latest commits
- 26117255|||PR apps API: review comments on files with spaces in their namemre
- b8796cecMerge branch 'f1-broken-json' into mainGitoria
- 2f2959c5|||PR apps API: broken JSON body gives 400 invalid_json, not 500mre
- f7c6ca07Merge branch 'ident-chooser-selector' into mainGitoria
- 691abb8e|||PR tests: find ident identity choice without the removed .choose classmre
- 16a3530fMerge branch 'heap-revert' into mainGitoria
- 220a80e0|||PR Remove temporary /__heap route and heap helper; logmre
- 13f0c342Merge branch 'hl25-records' into mainGitoria
- a002ecb7|||PR records: HL25 report, heap helper, logmre
- 2492a55cTemporary keyed /__heap route for the live memory snapshotmre
- fefaedd2log: tracker PR-only, HL25 startedmre
- 21aa57calog: parkmre
- e9f950a8reports: G25c soakmre
- a7783686log: deploy 9f41ffcmre
- 9f41ffc1log: W30b mergedmre
- bef635c1Merge branch 'w30b'mre
- 15b996a5Org list: keyed rows by @id, newest first, concat instead of hand loopmre
- c4f6d9e3reports: G25c growth huntmre
- b88e39f1log: privacy cleanup donemre
- bfd7826ddocs: neutral example organisation namemre