DL
Duong Labs

Writing

Notes from building and selling small tools

One problem per post, the fix stated in the first paragraph, then how it works and when it isn't worth doing. No newsletter, no popups.

5 SEP 2026 · TESTING

Regression-testing an agent whose output is never the same twice

String diffs don't work on free-text output. Freeze the traces, assert on behaviour instead of text, and run the suite after every prompt or model change.

5 SEP 2026 · BILLING

Two ways usage-based AI billing quietly loses money

Charge after the stream using the provider's real token counts, and let a unique key on the ledger reject Stripe's duplicate webhooks.