Backend follow-ups: release idle users, prune idempotency, access log #112

Closed
kayg wants to merge 0 commits from issue/17-backend-followups-2 into dev
Owner

Part of #17 (not closing it: OpenAPI and the dev shell are left for a later PR).

  • Idle users are released. The engine drops a user's runtime (writer thread and memory) after 10 minutes of quiet. It never drops one while an action runs, a live view is open, or anything else holds the store. Sweeps piggyback on incoming calls, so no timer thread. Reopening is the existing fast open.
  • Idempotency records are pruned after 7 days: at store open and hourly, on the writer thread. New additive migration adds an index on at_ms.
  • Access log: one access line per request: method, route pattern, status, ms. No query, headers, cookies, bodies, or raw paths. /healthz logs at debug.
  • CI pin: .forgejo/workflows/ci.yml has no uses: at all (caches are runner volumes), so there is nothing to pin. Moot.

Tests: idle user returns with nothing lost (journal, replay of old key, continued seqs, writer thread really exits); live view / running action keeps a user open; a hammer test (4 users x 4 writers x 40 actions while a sweeper drops everyone at zero idle time) loses no write; prune at open and after commit; access log has no secrets.

Memory numbers are on the issue.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

(Replaces #109, with current dev merged in. Reviewed on #109.)

Part of #17 (not closing it: OpenAPI and the dev shell are left for a later PR). - **Idle users are released.** The engine drops a user's runtime (writer thread and memory) after 10 minutes of quiet. It never drops one while an action runs, a live view is open, or anything else holds the store. Sweeps piggyback on incoming calls, so no timer thread. Reopening is the existing fast open. - **Idempotency records are pruned** after 7 days: at store open and hourly, on the writer thread. New additive migration adds an index on `at_ms`. - **Access log**: one `access` line per request: method, route pattern, status, ms. No query, headers, cookies, bodies, or raw paths. `/healthz` logs at debug. - **CI pin**: `.forgejo/workflows/ci.yml` has no `uses:` at all (caches are runner volumes), so there is nothing to pin. Moot. Tests: idle user returns with nothing lost (journal, replay of old key, continued seqs, writer thread really exits); live view / running action keeps a user open; a hammer test (4 users x 4 writers x 40 actions while a sweeper drops everyone at zero idle time) loses no write; prune at open and after commit; access log has no secrets. Memory numbers are on the issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T (Replaces #109, with current dev merged in. Reviewed on #109.)
Backend follow-ups: release idle users, prune idempotency, access log
Some checks failed
CI / rust (pull_request) Successful in 1m35s
CI / web (pull_request) Failing after 1m29s
e72a1a2d1e
- Engine drops a user's runtime (writer thread, memory) after a quiet
  spell. Never while an action runs, a live view is open, or anything
  else holds the store. Nothing is lost: commits are on disk first.
- Idempotency records older than 7 days are swept at open and hourly.
- One compact access log line per request: method, route pattern,
  status, ms. No query, headers, cookies or bodies.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Merge remote-tracking branch 'origin/dev' into issue/17-backend-followups
Some checks failed
CI / rust (pull_request) Failing after 1m51s
CI / web (pull_request) Failing after 10m17s
26451b360f
Author
Owner

Closing: this branch is already fully contained in dev (it landed through a merge train). Branch cleanup, 2026-10-15.

Closing: this branch is already fully contained in `dev` (it landed through a merge train). Branch cleanup, 2026-10-15.
kayg closed this pull request 2026-10-15 08:35:05 +00:00
Some checks failed
CI / rust (pull_request) Failing after 1m51s
CI / web (pull_request) Failing after 10m17s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!112
No description provided.