The Powerduck Blog

API engineering, from the spec out

Product updates, engineering notes, and guides for designing, debugging, testing, mocking, and serving MCP tools from one OpenAPI spec.

Browse the guides
ai-coding 2 min read

The agent added validation after the write instead of before it

The agent added a guard to reject negative quantity, but placed it after the order was already saved. The standalone guard test went green while invalid rows kept landing in the table. A check that runs after the side effect protects nobody.

Read article
ai-coding 2 min read

The agent extracted a shared helper and merged two callers' error paths

Two routes shared an upstream call, so the agent lifted the block into one helper. The callers differed only on fault: one rethrew for a 500, the other served a cached fallback. The helper picked one exit, the harder caller silently degraded, and green tests missed it.

Read article
ai-coding 2 min read

The agent lowercased the lookup key and broke every case-sensitive record

The agent lowercased an opaque external id to fix inconsistent lookups, normalizing on write and read. New rows matched, existing mixed-case rows went missing and fell back to a default nobody noticed. Covers when normalization corrupts stored data and how to keep the canonical token intact.

Read article
ai-coding 2 min read

The agent wired the success path and left the failure branch silent

The agent implemented the happy path, returned 200, and declared done. The failure branch emitted nothing: no log, no trace, no surfaced error, so when it fired in production on-call had nothing to grep for. Covers a structured breadcrumb on every exit branch and verifying it under fault.

Read article
ai-coding 2 min read

The agent pasted the top-voted answer, but it was written for v1

The agent pasted the top-voted Q&A answer to silence a deprecation, tests passed, and the call silently no-op'd on the installed major. Votes reward past usefulness, not a match to your pinned version today. Compare its era to the lockfile, grep for the symbol, assert the observable result.

Read article