systems.potatuhs.com

Systems Library

Premade topological diagrams — tech, health, wealth, and agent systems — each with a who-owns-what overlay. Download and adapt, or point an agent straight at the spec. Strongly opinionated by design.

agentic-pipelines

audio text + ts redact validated by param graph Phone callsrecorded audio TranscriptionASR speech → text Transcriptstext · speakers · timestamps LLM extractinsights · entities · sentiment Structured recordsparams · scores · tags Aggregate → time-seriesgroup by param · window Dashboardstrend graphs over time OWNERSHIP Source AI / ML Data Surface AI Insight PipelinePhone transcripts → LLM-extracted insights → structured records → time-series trend graphs.
agentic-pipelines
AI Insight Pipeline
Phone transcripts → LLM-extracted insights → structured records → time-series trend graphs.
You / Dev Data layer Agent automation Guardrails / controls Observability subdomain salvage · push query apply persona emits 4 downstream guards Claude CodeIDE session Firestoreruss_feed Automationquery · apply persona Composed Postagent voice Thoughts Words Action Priorities Downstream impactwork · decisions Guardrailscoding-behavior controls OWNERSHIP You / Dev Data layer Agent automation Observability surface Guardrails / controls Downstream (external) Potatuhs — Session Salvage LoopClaude Code sessions → agent post → four observable outputs. Ownership overlaid.
agentic-pipelines
Potatuhs — Session Salvage Loop
Claude Code sessions → agent post → four observable outputs. Ownership overlaid.

agent systems

Author (Brett) Build / seed SSOT / Firestore Surfaces compile assemble 52 sync-deck voice + roster seed loadH() open seats → write next Persona specJSON + portrait, per slug build-deck.pyassemble · open seats deck.json52 cards (SSOT) Characters apppotatuhs-characters Seederssocial + heuristics Firestoresocial_accounts · character_heuristics GeneratorsRhizome · fanout · chiefs OWNERSHIP Author (Brett) Build / seed SSOT / Firestore Surfaces Agent — Character SystemHow a Potatuhs character is authored, assembled into the deck, and seeded to the agents.
agent systems
Agent — Character System
How a Potatuhs character is authored, assembled into the deck, and seeded to the agents.
Built — Russ's memory loop Persona SSOT Gap — the stateless cast Proposed — give the cast a memory digest publish next reads own last post carry-forward → served handoff loadH() (static) no read-back append experience relationships over time evolve persona russ_feed8-facet dossiers (/russ) generate.mjsdigest + draft Russ postself-referential Objective chainnext → served character_heuristicsstatic persona Chiefs + castrender fresh daily No per-agent memorystateless — the gap Relationship graphsuperconscious (declared) Per-character feedread + append own dossier Individualizationpersona drifts w/ experience OWNERSHIP Built today Gap — stateless Proposed Agent — Memory & IndividualizationHow an agent accumulates experience and drifts over time — built for Russ, a gap for the cast.
agent systems
Agent — Memory & Individualization
How an agent accumulates experience and drifts over time — built for Russ, a gap for the cast.

distributed systems

Bulkheads — one pool per dependency in route route route call call (hangs) call Requestsmixed traffic Routerby dependency Pool A8 threads · healthy Pool Bfull · blocked Pool C8 threads · healthy Dependency Ahealthy Dependency Bslow / down Dependency Chealthy OWNERSHIP Requests Isolated pool Dependency Saturated / down Bulkhead PatternOne resource pool per dependency — a hung dependency saturates its pool only, not the system.
distributed systems
Bulkhead Pattern
One resource pool per dependency — a hung dependency saturates its pool only, not the system.
Hash ring — each node owns an arc hash k1 → A k2 → B k3 → C k4 → D only D’s keys remap Keysk1 · k2 · k3 · k4 hash(key)→ ring position Node Aowns arc [0,90) Node Bowns arc [90,180) Node Cowns arc [180,270) Node Downs arc [270,360) Node E (added)steals a slice of D OWNERSHIP Keys / client Node A Node B Node C Node D Node E (added) Consistent HashingNodes and keys share a ring — adding a node remaps only its neighbor’s slice, not everything.
distributed systems
Consistent Hashing
Nodes and keys share a ring — adding a node remaps only its neighbor’s slice, not everything.
Leader Followers Coordination On failure write replicate + heartbeat replicate + heartbeat renew lease no heartbeat → timeout acquire lease (quorum) promote (fencing token) Clientwrites Leaderholds the lease Follower 1stand-by replica Follower 2stand-by replica Lease + quorumetcd · ZooKeeper Electionrequest votes OWNERSHIP Client Leader Followers Coordination store Leader ElectionA lease + quorum keeps exactly one leader; on failure a follower is promoted with a fencing token.
distributed systems
Leader Election
A lease + quorum keeps exactly one leader; on failure a follower is promoted with a fencing token.
Fan-out backends request fan-out fan-out fan-out fast blocks (tail) straggler → hedge first answer wins Requestone user request Scatter-gatherfan-out + wait-for-all Backend 1p50 · fast Backend 2p99 straggler Backend 3p50 · fast Hedged requestafter p95 → backup Responselatency = slowest of N OWNERSHIP Client Scatter-gather Backend Straggler (p99) Hedge / backup Tail Latency (Fan-out)Wait-for-all means the slowest backend sets your latency — hedge the straggler, don’t wait on it.
distributed systems
Tail Latency (Fan-out)
Wait-for-all means the slowest backend sets your latency — hedge the straggler, don’t wait on it.

notifications & messaging

Product / app Notification service — your backend Third-party providers Recipient endpoints Security / infra Observability emit allowed? event body push sms email keys · certs status suppress bounces App eventsdomain triggers Ingest APIauth · validate Preferencesopt-in · quiet hrs Templatesrender · i18n Dispatcherroute by channel Push adapter SMS adapter Email adapter APNs FCM Web Push SMS provider Email provider iOS Android Browser / Linux Phone Mailbox Secrets & cert vaultAPNs .p8 · FCM SA · VAPID · API keys Delivery receiptswebhooks · bounces Delivery logstatus · analytics OWNERSHIP Product / app Your backend Third-party provider Recipient endpoint Security / infra Observability Notification SystemOne event, many channels — and the ownership boundaries the naive "push/pull" diagram hides.
notifications & messaging
Notification System
One event, many channels — and the ownership boundaries the naive "push/pull" diagram hides.

auth & identity

Client Auth service — your backend Step-up Identity providers Identity data Signing keys Resource 1. login step-up federate (OIDC) SSO (SAML) 2. verified verify hash store refresh sign (priv key) 3. tokens 4. Bearer token verify (JWKS pubkey) Client appweb / mobile Auth API/login /token Token issuerJWT access + refresh MFA / step-upTOTP · WebAuthn Social IdPGoogle · Apple (OIDC) Enterprise IdPSAML · OIDC SSO Identity storeusers · argon2 hashes Session / refreshrotation · revoke JWKS / signing keysrotation · kid Resource APIverifies JWT OWNERSHIP Client Your backend Identity provider Security Identity data Auth & IdentityLogin, federation, MFA, and token verification — the boundaries "check the password" hides.
auth & identity
Auth & Identity
Login, federation, MFA, and token verification — the boundaries "check the password" hides.

async & jobs

Your services Workers Broker / platform Data & observability enqueue cron / delayed dequeue persist after N retries nack → retry (backoff) alert metrics Schedulercron · delayed API / produceremits work Queue / brokerFIFO · at-least-once Worker poolautoscale · consumers Dead-letter queuepoison messages Result storeidempotent writes Metrics & alertsdepth · age · fail rate OWNERSHIP Your services Platform / SRE Data & observability Async Job QueueBackground work done right — retries, dead-letters, idempotency, and who owns the broker.
async & jobs
Async Job Queue
Background work done right — retries, dead-letters, idempotency, and who owns the broker.

data & storage

Offset / limit — simple but fragile Cursor / keyset — stable & fast offset way query cost cursor way query result Clientpage through a list GET ?offset=40&limit=20page 3 DB: scan 60, discard 40no index help Slow at depth · shifts on insertskips / repeats GET ?after=<cursor>&limit=20opaque key DB: WHERE id > cursorindex seek Fast · stable under writesno random jump OWNERSHIP Client Offset / limit Cursor / keyset Database API Pagination: Offset vs CursorOffset is simple but slow and unstable; cursor (keyset) is an index seek that’s stable under writes.
data & storage
API Pagination: Offset vs Cursor
Offset is simple but slow and unstable; cursor (keyset) is an index seek that’s stable under writes.
Source DB CDC pipeline Consumers write commit → log tail publish consume consume consume Applicationwrites only to the DB Source DBcommit Replication logWAL / binlog CDC connectortail log · Debezium Change streamordered topic Search indexreindex Cacheinvalidate Warehouseanalytics OWNERSHIP Application Source DB CDC pipeline Consumers Change Data Capture (CDC)Tail the DB’s replication log and stream every committed change — no dual writes, no drift.
data & storage
Change Data Capture (CDC)
Tail the DB’s replication log and stream every committed change — no dual writes, no drift.
Client Your backend Processing Storage / CDN Metadata Security Recipient 1. request 2. presigned URL 3. PUT direct (resumable) 4. record object created (event) validate + AV update status GET (signed URL) origin Clientbrowser / mobile Upload APIpresign · validate Object storageS3 / GCS Metadata DBkey · owner · status AV scan / validatetype · size · malware Processingthumbs · transcode CDNsigned URLs Viewerdownload / stream OWNERSHIP Client Your backend Storage / CDN Security Data File Upload & StorageDirect-to-storage uploads, validation, async processing, and signed delivery — with owners.
data & storage
File Upload & Storage
Direct-to-storage uploads, validation, async processing, and signed delivery — with owners.
Durable log Data files 1. append + fsync 2. apply flush @ checkpoint flush truncate replay from checkpoint Write requestinsert / update WALappend-only · fsync Memtable / cacheapply in-memory Data filesdurable pages Checkpointflush + truncate Recoveryreplay on crash OWNERSHIP Client Storage engine Durable log Data files Recovery Write-Ahead Log (WAL)Append the change durably before applying it — so a crash replays instead of corrupting.
data & storage
Write-Ahead Log (WAL)
Append the change durably before applying it — so a crash replays instead of corrupting.

integrations & webhooks

Signer (external) Vendor Your services Queue · storage · infra 1. create envelope 2. request generate set code or SMS SMS passcode email code 3. signs 4. webhook → internal service (≠ requester) enqueue: completed consume → dependent process consume → fetch signed files push signed files sweep manifest long-term storage Signerrecipient Twilio / SMSpasscode DocuSignenvelope · access · webhook Requesting servicecomposes · downloads Access-code servicegenerate code Webhook receiver≠ the requester Process serviceneeds signed docs Sweeper servicereads index file Message queueat-least-once fan-out File sharelanding zone Long-term storagearchive · WORM Index filemanifest OWNERSHIP Signer (external) Vendor (DocuSign · Twilio) Your services Queue · storage · infra DocuSign — Vendor Webhook FlowA vendor webhook calls back into a DIFFERENT internal service, which fans out through a queue.
integrations & webhooks
DocuSign — Vendor Webhook Flow
A vendor webhook calls back into a DIFFERENT internal service, which fans out through a queue.
People (external) Twilio Your integration Backend / data 1. request (SMS) 2. inbound webhook 3. create (pending · due-by) 4. confirm SMS confirm · due-by (reply YES) on write changed 5. notify owner SMS: request updated Neighbortexts to order Client / farmergets notified Twilio numberprogrammable SMS / voice Inbound handlerwebhook · parse Notifieron update → owner Requests DBitem · qty · due-by · status Change triggeron write (outbox) OWNERSHIP People (external) Twilio (vendor) Your integration Backend / data Twilio — Programmable NumberInbound produce requests (confirm · due-by) and owner notification on every backend change.
integrations & webhooks
Twilio — Programmable Number
Inbound produce requests (confirm · due-by) and owner notification on every backend change.

project lifecycle

game development

Discovery — find the fun Systems — dock the layers Polish (last) pillars playtest fun ✓ iterate (not fun) dock onto dock into finally Planconcept · pillars · scope Prototypefind the fun Fun?playtest gate Re-enterable loopstart → play → end → restart Persistence + configsave · settings · unlocks Mode switchingmenu ↔ game ↔ pause Asset polishart · audio · juice OWNERSHIP Discovery Fun gate Systems Polish Game LifecyclePlan → prototype (find the fun) → re-enterable loop → dock persistence + modes → polish assets.
game development
Game Lifecycle
Plan → prototype (find the fun) → re-enterable loop → dock persistence + modes → polish assets.
Local client Remote peer Simulation poll buffer +N send now apply @ F (delayed) peer inputs dejitter apply @ F draw Controllerraw input Input samplerpoll per frame Input delay bufferhold N frames Send to peerUDP · unreliable Remote peersends inputs Receivereorder Jitter buffersmooth arrivals Simulation tickadvance frame F Renderframe F OWNERSHIP Local client Network Remote peer Simulation Input Buffers (Netcode)Delay the local input, jitter-buffer the remote — advance a frame only when both are ready.
game development
Input Buffers (Netcode)
Delay the local input, jitter-buffer the remote — advance a frame only when both are ready.
Peer A (local) Peer B (remote) Input exchange Guard send input send input all inputs all inputs advance advance state hash state hash A: inputframe F Input exchangeall-to-all · frame F B: inputframe F A: input barrierwait for all inputs B: input barrierwait for all inputs A: deterministic simadvance F B: deterministic simadvance F Checksum comparedesync detection OWNERSHIP Peer A (local) Peer B (remote) Input exchange Determinism guard Deterministic LockstepEveryone runs the same sim, exchanges only inputs, and advances in lockstep once all inputs arrive.
game development
Deterministic Lockstep
Everyone runs the same sim, exchanges only inputs, and advances in lockstep once all inputs arrive.
Local sim Network State ring Rollback local input predicted remote draw now save state @ F prediction actual remote mispredict @ F restore @ F re-sim F → now Remote inputarrives late Predicted == actual?per frame Local inputframe F Predict remoterepeat last input Advance simto "now", 0 delay Renderframe F State ring buffersave each frame Rollback + resimrestore F → replay to now OWNERSHIP Local sim Network State ring Rollback Rollback NetcodePredict, simulate to now with zero delay, and re-simulate from the past when a prediction was wrong.
game development
Rollback Netcode
Predict, simulate to now with zero delay, and re-simulate from the past when a prediction was wrong.

video production

storytelling

health & training

Feedback loop Seasonal focus — one quality at a time Always-on foundation — underpins every block build peak deload annual cycle · rebuild the base weekly adjust next block Daily log (idk)one entry / day Season reviewmetrics → adjust Spring — Runningaerobic base · zone 2 Summer — Calisthenicsskill · relative strength Fall — Liftingmax strength · hypertrophy Winter — Stretch & Mobilitydeload · range Sleep7–9h · consistency Nutritionprotein · whole foods Recoverywalks · mobility · rest OWNERSHIP Seasonal focus Always-on foundation Feedback loop Health — Seasonal TrainingA yearly plan that periodizes one focus per season, on an always-on foundation.
health & training
Health — Seasonal Training
A yearly plan that periodizes one focus per season, on an always-on foundation.