gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit477d7bdc477d7bdcMerge branch 'p50'mre477d7bdc/missions/R52-apptoken-restart.md

2.7 KB

  1. # R52 — app token unknown after a restart (blocks the day52 deploy)
  2. Task line: obvious bug in the live app (CONDUCTOR.md: "Obvious bugs in the live app: fix without asking").
  3. ## Symptom (Gitoria, 2026-11-08 12:20, measured)
  4. `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.
  5. 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.
  6. 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).
  7. ## 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)
  8. 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.
  9. 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.
  10. 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.
  11. 4. Commit on branch r52 (subject names the cause, no ticket number). Do NOT merge, push or deploy.
  12. ## Report
  13. reports/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

Latest commits

  • 477d7bdcMerge branch 'p50'mre
  • 00efc06fP50 reportmre
  • e3f85afblog: commit mention slipmre
  • 4d1a4cf4log: #25 numbersmre
  • 1af0a60ddocs: H25 run() correctionmre
  • eefa2dbcRepo setting: refuse direct pushes to the main branch (pre-receive over HTTPS and ssh)mre
  • 8c8ba2f1log: PR flow announcedmre
  • fa00cd35log: Kunibert pings provenmre
  • 3a68cfaclog: components decisionmre
  • 87de8e31log: Kunibert connected to 9 app reposmre
  • c22aff69log: PR-only rollout startedmre
  • 25309981log: STOP and paused workers 2026-11-08mre
  • 5286803alog: worker briefs and reports of 2026-11-08mre
  • 85c86605log: 2026-11-08 Arachne on list shapemre
  • cb634512log: 2026-11-08 keyed lists livemre
  • 07c98d4aLists: keyed rows with @id, remove(id) and one whole-list assignment instead of hand-rebuilt loopsmre
  • 0db0d81elog: 2026-11-08 day52 live, W30 startedmre
  • b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmre
  • 1e8f4f0avendor: Hybriel set-day52 (fault-path leak fix #335, keyed rows #331)mre
  • f5f0fb7blog: 2026-11-08 day50/#29 live, H25 correction, V52 startedmre