6 articles
The circuit breaker is a state machine
A circuit breaker modeled as an explicit state machine, with thresholds, timeouts, the half-open probe, and how to combine it with retries and jittered backoff. Implemented in TypeScript and Go.
Idempotency in payment APIs
Idempotency keys for POST /charges: retries, duplicates, stored responses, the in-flight lock, the TTL, and which status code to return in each case.
Testing the domain and use cases without mocks
In-memory fakes instead of mocks, tests that check state instead of calls, contracts shared between adapters, and the shape of the test pyramid in Clean Architecture.
Atomic commits and Conventional Commits
What makes a commit atomic, how to write messages with Conventional Commits, how to split changes with git add -p, and how to fix older commits with fixup and autosquash.
Ports and adapters in TypeScript
An order use case with two ports, OrderRepository and PaymentGateway, an in-memory adapter, a Postgres adapter, and the composition root that wires them.
The dependency rule, without dogma
What the Clean Architecture dependency rule says, why the arrows point toward the domain, what goes in each layer, and the mistakes I see most often in TypeScript services.