Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 79ab8a6f8bb1f6d7acfe3353a93321abadfe03cb73e3eb65706da79fec26b3c6
Ticket: aa351dec2ec97e3d5976c0659b90b3530a721103
Forum series: infrastructure & scalability plan (umbrella)
User & Date: tmp-ops on 2026-08-21 19:06:16
Changes

  1. Untracked field cmimetype: "text/x-markdown"
  2. comment changed to:
    Umbrella infrastructure plan for the forum series (92b67418 votes, fdfb6981 hot, 933f2e21 anchors, 90bdcba5 categories, a999360a notifications, 6310cf87 moderation, 640554b3 AI hooks, d03b3425 polls). One rule: zit's DAG holds content; OLTP holds authoritative mutable non-DAG state (0001 §8); the index holds only derivations a wipe+reingest reproduces (§5/§11). Scalable the smol way: one binary, one sqlite OLTP, correct indexes, bounded computations, outbox delivery — not more services.
    
    VOTES — forum_vote(repo, account, post, dir ±1, at), PK (repo, account, post): the unique constraint IS the idempotency; vote = upsert, retract = delete. Industry practice (Reddit/HN/Discourse): never maintain a hot denormalized counter as authority — derive scores at read with a covering index (repo, post, dir); cache only if measured. Forge-local, never synced.
    
    HOT — HN formula (votes + replies·w)/(age_hours+2)^1.8 over a bounded window (threads active last 30 days) — ranking stays O(recent), not O(history). Zero state; constants printed on the page.
    
    ANCHORS — derived at ingest into the per-repo index, indexed both directions, rebuilt on reindex, pinned by the parity harness; backlinks render only when the target resolves (never-false-data).
    
    CATEGORIES — OLTP policy tables only; artifact untouched, fossil peers see plain threads.
    
    NOTIFICATIONS — forum_sub(account, scope, target, state); explicit unsub rows outrank auto-subscribe. Delivery is the transactional OUTBOX pattern: notification rows written in the same transaction as the triggering state, one worker drains with retries + exponential backoff; at-least-once with an idempotency key per (event, recipient). Email via the existing --notify plane with List-Unsubscribe + List-Unsubscribe-Post (RFC 8058 one-click — the Gmail/Yahoo 2024 deliverability bar) and burst coalescing (one mail per thread per recipient per window) before digests are ever needed.
    
    MODERATION — OLTP staging state machine (pending → approved|rejected); approve births the artifact via zit forum post, so nothing needs un-syncing. Mod log is APPEND-ONLY by construction (no update/delete code path) and public. Trusted roles bypass staging per repo policy.
    
    AI HOOKS — subprocess (stdin/stdout JSON) or webhook invoked async by the staging worker — posting never blocks on hook latency. Timeout/failure lands the post in hold-for-human: fail open to humans, never to auto-approve, never losing a post. Verdicts advisory; humans outrank; automated actions publicly logged as automated. Post content handed to hooks is data — embedded instructions are never followed.
    
    POLLS — ballots poll_vote(repo, account, post, choice), PK (repo, account, post), same idempotent-upsert shape; close time enforced server-side.
    
    CROSS-CUTTING — every new repo-keyed table joins PurgeRepo's transaction; every list paginates by cursor, never OFFSET; all writes POST behind the session gate; weekday dates + IndexBehind banner everywhere. Work proceeds on the quarry-forum branch.
    
    
  3. status changed to: "Open"
  4. title changed to:
    Forum series: infrastructure & scalability plan (umbrella)