gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit358474bf358474bflog: P50 livemre358474bf/reports/R52-REPORT.md

3.0 KB

  1. # R52 report: app token "unknown" after a restart (branch r52, worktree ../gitoria-R52, commit b05f6d9; not merged, pushed or deployed)
  2. ## Mechanism: the gate's own token life, not gitoria and not mpackdb
  3. tests/status.mjs ran the server with GITORIA_APP_TOKEN_LIFE_MS=3000 (`const LIFE = 3000`), so tPub expired 3 seconds after it was issued. The gate reached the restart PUT 3.0 to 3.3 seconds after issuing tPub (stop about 1 s, cold start about 2 s), so it was a race against the clock. rowOfToken correctly answered "expired", which gives the 401. tests/status-keyed.mjs had the same race and was already fixed on 2026-11-02 (commit e874e44, LIFE 60000). The 2026-11-02 V37 finding came from that race. status.mjs was never changed the same way.
  4. ## Evidence (instrumented copy of the gate, 4 runs, deleted afterwards)
  5. After the SIGTERM stop and after the restart, sha256(tPub) was always in apptokens.mpack AND in apptokens.hash.txt. The row was stored and its unique index was on disk; nothing was lost or swept before the PUT.
  6. The PUT result followed the clock exactly: 200 at t+2983 ms; 401 at t+3098, 3169 and 3277 ms (LIFE 3000). That is 3 of 4 runs failing, the same rate Gitoria measured.
  7. ## Fix
  8. tests/status.mjs: LIFE = 60000, with a comment, the same shape as status-keyed. No .hl was changed, so no framework repro is needed and there is no DOCS gap. Expiry itself stays covered by tests/app-token.mjs (its own short life).
  9. ## Proof (LC_ALL=C, ports 8720-8739, `ss -ltn` checked free first)
  10. status.mjs 10 of 10 runs passed (61 checks, 0 failed each). status-keyed.mjs 10 of 10 runs passed (13 checks, 0 failed each).
  11. Gates, all 0 failed: check-theme 86 files and 0 problems; create-api 47; signin-return 3; browser 269; security 82; private 158; ident-access 30; apps 95; pull-numbers 48; pull-ssh 20; app-token 42; reviews 98; events 52; pr-page 61; status 61; limits 53; status-keyed 13; member-merge 82.
  12. The browser, signin, security, private and ida gates were moved into my range through GITORIA_GATE_*/…_PORT variables, as V52 did (script: ../gitoria-R52/.scratch/r52/gates.sh).
  13. ## Live impact
  14. None. Live sets no GITORIA_APP_TOKEN_LIFE_MS (not in docker-compose.yml, the Dockerfile or deploy.sh), so a token lives one hour. docker stop sends SIGTERM, the same signal as the gate's p.kill(), and the token row and its hash index survived that stop in every run. A deploy or restart therefore loses no tokens. A token older than one hour expires as the contract says, and the app trades its key for a new one.
  15. ## Risks
  16. Small. The gate no longer tests short expiry around a restart; app-token.mjs tests expiry without a restart.
  17. ## Steps and cleanup
  18. Steps (about 25 requests in all): reading the mission and docs about 5, probe 3, fix and runs 4, gates and commit about 10. I stopped everything I started: the probe, the loops and the gate script all ended on their own, nothing of mine listens on 8720-8739, and no Chrome has its cwd in gitoria-R52. No browser tabs were used, because this mission has no UI change. LOG.md and STATUS.md are untouched.

Branches

Latest commits

  • 358474bflog: P50 livemre
  • 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