gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainfe209ffeMerge branch 'w56-owner-members' into mainGitoriamain/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

  • fe209ffeMerge branch 'w56-owner-members' into mainGitoria
  • fa0754c8|||PR repository owner transfer and members API (#55)mre
  • 8862e537Merge branch 'w55-rename-org' into mainGitoria
  • 014d2b7fOne immutable readers snapshot per move for the left-organization event (#53)mre
  • 1859d506Decide who hears a repo left its organization by its readers before the move (#53)mre
  • 499f25f2Review fixes for the Settings organization move (#53)mre
  • ed3b922b|||PR move a repository into an organization in Settings (#53)mre
  • 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
  • 9f7ce8d8Preserve rename compatibility and live page titlesmre
  • c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
  • ce08920dMerge branch 'w52c-header-phone' into mainGitoria
  • 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
  • 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