Ephemeral / append-only over stateful

Updated · View the entry on sijie.xyz ↗

A recurring taste across the codebase: don't keep mutable state you can derive or append.

  • corpus paths are derived from the tree (derived-path-corpus-as-filesystem), not stored
  • the résumé PDF is never written to disk — gotenberg renders it on demand at print time (schema.sql says so next to resume_drafts; the print payload sits in Redis for 60 seconds, owner/jobs/printsess/store.go). Since 1b1ebed2b (2026-09-07) the same Puck config renders the editor and the printed page, so there is one renderer as well as no file
  • a fetched job never enters the DB — it lives in Redis (1 day TTL, owner/jobs/jobs.go) and is snapshotted into a draft/application only at create time
  • quotas are append-only ledgers — the kernel's code_bookings table was retired with #135 (f376b0432, 2026-07-25); each capability now counts usage live in its own isolated store via capquota.Counter (internal/capabilities/capquota/capquota.go, aab8abe90, 2026-08-01). Still no decrement, no decay, no race — only the store moved
  • conversations never "end" — a summary is just an append-only chat_reports artifact, regenerable

Fits the deployment read-light / single-writer shape: derive or append, don't maintain mutable rows.

Related notes