Mustafa Nevfel

Notes

Engineering notes from production systems I have built since 2012 and from a daily practice of building with AI agents.

Snippets: the reusable patterns from these notes →

  1. 8 min read

    An invoice is a snapshot, not a calculation

    Why recomputing invoice totals from current rules breaks, and how to freeze integer minor-unit amounts, rule versions and document numbers in PostgreSQL.

  2. 8 min read

    Design the reconnect first: sequence numbers, replay and snapshots

    Real-time bugs live in the seconds after a connection comes back. A resume protocol built on sequence numbers, idempotent replay and snapshots.

  3. 8 min read

    Run AI agents like queue workers: briefs, budgets and stop reasons

    How I run AI coding agents like queue workers: written briefs, narrow tools, hard budgets, idempotent writes, typed stop reasons and review gates.