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
- e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
- c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
- 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
- 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre
- 69141f65|||PR pulls page: cache the git part per repo by branch tipsmre
- 155861f6Merge branch 'w52-person-approval' into mainGitoria
- b5435de8|||PR person approvals: second Kunibert round (#52)mre
- 3a8b2fb8|||PR person approvals: Kunibert review fixes (#52)mre
- 2a89d8d0|||PR person approvals: Approve button for people; merge needs the required checks or a listed person's approval (#52)mre
- 83f0c953Report person approval verificationmre
- 3ae94b86Record browser failures and verify owned tab cleanupmre
- 54eec687Gate person approvals and merge alternativesmre
- 12b08829Add person approvals for pull request headsmre
- 55c84779Merge branch 'gp-gate-ports' into mainGitoria
- 57af42bbREADME: point to deploy.sh for the port listmre
- d63375d2README: gate commands with explicit portsmre
- feeaa701|||PR gates: explicit ports only, deploy.sh passes themmre
- 6cc1f943Merge branch 'records-1112' into mainGitoria
- 9448c438|||PR records: LOG, missions and reports since 11-09mre
- 6dc08a8eMerge branch 'p51-public-pr-reads' into mainGitoria