
I build Powerduck — local-first OpenAPI studio. Writing about spec drift, AI agents that lie about being done, and docs that drift for months.
Joined December 2025
- Tweets2.8K
- Following3
- Followers38
- Likes7
Pinned Tweet
Everyone shipped a faster way to write code. Nobody shipped a faster way to believe it.
Powerduck is a local-first desk for AI changes: findings beside the diff, scenarios against a real server, one OpenAPI file feeding docs, mocks and MCP tools.
What's your test for done?
2
660
Half the tool result came back, and the model reasoned from the visible tail like it was the whole.
A long error blob or a big list got clipped at the token limit. The missing head held the rows that mattered; the agent planned against a partial picture and didn't notice the clip marker in the returned text.
I size results before the call, paginate or summarize on the server side, and check a total or length field before treating the response as complete.
What first tips you off that an agent is working from a truncated response?
5
Six months ago that rollout got a kill switch. Today the switch is off, and the branch behind it still ships.
Flags accumulate quietly. Each one leaves a parallel code path alive; conditions pile into the render logic, and every new change has to satisfy both sides. A safety valve turns into permanent architecture.
When the flag lands, I attach an expiry or a removal ticket. If the metric stays flat for one release, the branch goes in the next cleanup. What's your usual rule for deciding a flag can come out?
I post about these small structural debts most weeks. Follow along if that's useful.
3
The toast handed the user the raw exception: connection refused, an internal host, and a fragment of stack line to go with it.
The caught error message had been copied straight into the user-facing string. Debug details that matter on the server side leaked into the product. The reader can't act on a host or a trace path, and the internals now sit in a support ticket.
At the boundary I keep a stable, user-safe message and map the exception to it; the full trace stays in logs or a trace ID. The agent should never forward the raw exception to the UI.
Where do you draw the line between an error a developer can act on and one that only belongs on the server?
1
A function got split and renamed during the refactor. The code looked clean, the suite went green, and the metric label still said the old name.
Dashboards, alerts, and the on-call runbook all keyed off that label. The renamed path fired the same event under a string nobody queried, so a regression showed up as a missing line rather than a broken one.
When I rename something that emits logs or metrics, I treat the label as part of the public surface: update the query, the alert, and the runbook in the same change, or the trace breaks one refactor later.
Where do you usually catch a renamed metric before on-call does? If this rings a bell, follow along - I write about these review failures most weeks.
2
The first request read through to the database. The second came back with yesterday's value, and nobody noticed until the customer reported the old number.
The cache lived in process memory with no invalidation on write. Local tests read a fresh database each run, so the stale path never showed up there; the bug only appeared after the process had been up long enough to hold an entry.
I now invalidate on the write path, or put a short TTL on anything I do not fully control, and add one test that writes, then reads through the cache, before calling it done.
What is your usual tell that an in-memory cache is serving stale entries?
3
The test counted how many times an internal method was called. Refactor the internals and the call drops from two to one; user behavior stays identical, but the suite goes red.
Coupling a test to the call graph gives a false sense of coverage. Rename a helper, inline a loop, extract a class, and the test fails while nothing the user touches changed.
I assert on what the system outputs or returns: the record persisted, the shape came back, the error surfaced. Internals stay free to move. A test that breaks on a safe refactor is watching the code's shape, not its behavior.
Where do you draw the line between a structural assertion and one that locks in an implementation detail?
2
The PR had seven commits between the sketch and the fix. None stood alone: an early commit added a half-built function, a later one wired it up, and the middle one did not compile.
That is fine on a branch. In merged history it is not: a bisect hits a WIP commit, the build breaks there, and you cannot tell whether the break is the commit you are hunting or the WIP noise around it.
I keep scratch commits local and clean the branch before push: one green commit per logical step, or one squashed change. Pushed history has to be walkable, not just locally true.
How do you keep a branch bisectable — squash, stacked PRs, or something else? If this rings a bell, follow along — I write about these review failures most weeks.
11
A debug log went onto a request path. Local runs fired a handful of requests, so the extra line looked free. Nobody flagged it.
That path runs thousands of times a second in production. The log volume became the incident before the feature did. A log that costs nothing on your laptop does not cost nothing at traffic.
I keep debug output behind an explicit level and sample the hot paths rather than logging every entry. Local sample size hides amplification better than any lint rule will.
What's your fastest check for a hot-path log that looks harmless locally?
8
Its own diff came back with a clean self-review attached. Names match, flow matches, every intended step reads as covered.
The check ran against what the agent meant to write, not against what the code actually had to do. The assumption baked into the first draft survives the review, because the same context that produced it is the one judging it.
A fresh-context pass helps here: someone who did not write the change reads the ticket and the diff side by side, and the gap between intent and requirement shows up fast.
How much of your AI-generated diff do you trust after a self-review pass?
8
The merge conflict had two implementations of the same function. The resolution kept both: the old branch's version above, the incoming one below, with no comment explaining which won.
Nothing failed loudly. The tests passed because neither copy was deleted, and whichever branch ran first took the call. The diff read like a merge rather than a choice, so review skimmed past the duplicate.
When I resolve a conflict I delete one side on purpose and say why in the commit. Keeping both just defers the decision to runtime.
Where do you usually catch a conflict resolved by keeping both paths? If this rings a bell, follow along — I post these review breakdowns most weeks.
8
The README for the endpoint got updated; the example request and the new field were spelled out there. The OpenAPI spec still described the old response shape. Anyone generating a client from the spec built against the stale contract.
Prose drifts first because it's easy to edit; the spec is the thing downstream clients and mocks are actually generated from. We keep this locally in Powerduck — the spec stays the source of truth, and docs and mocks derive from it rather than being hand-kept alongside.
Where does your team's contract stop being the source of truth?
8
Reviewer asked whether the null input was handled. The reply said yes, and the thread read clean. The branch still assumed non-null; the answer lived in the comment, not in the code.
Once the clarification lands in a reply, follow through and check the path actually matches what was agreed. Otherwise the PR narrative and the diff quietly disagree, and the next reader trusts the thread over the code.
What's your fastest way to catch code that contradicts its own review thread?
6
The build went red where one call site passed a mismatched shape. The diff swapped the narrow interface for `any` and loosened the union to `string | undefined`. The compiler stops complaining; the underlying mismatch never got resolved.
That trades a type error for a future runtime one. The narrow type was the net catching the bad call; widening it removes the net at the spot it mattered. If a call genuinely passes loose data, widen the contract on purpose and say why, rather than erasing the type at one call.
Where do you draw the line between a justified broad type and just silencing the red? If this resonates, follow along — I write about this kind of review breakdown weekly.
7
The diff kept a block of the old implementation commented out above the new one. No instruction said to preserve it; it just looked safer to keep the old lines on screen. A commented block is not a saved fallback. It is dead text the next reader reads twice: once to confirm it matters, once to trust the active line below it.
In review I ask those blocks out. Git history already holds the old version, so deleting it loses nothing. Commented code lets a later edit revive the old shape by accident, and the diff carries noise that makes the live change harder to follow.
Where do you draw the line between keeping a deprecated path alive in comments and trusting history to bring it back?
1
13
A comment in the file read like an open todo, so the agent implemented it. The issue had been closed two cycles earlier; the behavior changed, and the comment simply never got cleaned up. New code now does the old thing nobody wants anymore.
Before I act on a TODO or an inline note, I check whether it still matches current behavior: date, linked issue, surrounding code, what the tests assert. A stale comment is not a live requirement.
How do you keep old comments from drifting into instructions the next pass follows?
10
The catch block logged a generic message and raised a fresh bare error. Original exception, arguments, and traceback were gone by the time it reached the caller. Debugging started from a second-hand summary that named nothing that had failed.
I keep the chain explicit: wrap and raise from, preserve the originating exception. A boundary handler should be able to walk down to what actually broke, not a generic note someone typed later.
What's your quickest way to tell a swallowed exception apart from a real clean failure in generated code?
9
Half the wrong features I hand to an agent come back on the most literal reading. The ask had two plausible shapes, it picked one, and the clarifying question that would have split them never surfaced. Fast to a working thing, slow to the right thing.
Before an agent writes code on anything even slightly ambiguous, I get one written pass back: what it expects to change, and what it expects to stay the same. If two shapes both fit, the fork comes out first instead of a guess baked into the diff.
Where do you draw the line between one clarifying round and just letting it build?
7
Generated additions often read like a stranger's code: a different error shape, different naming, a helper that already exists three files over. Reviewers end up normalizing style instead of checking whether the behavior is right.
Before an agent writes in this repo, I hand it one or two real local examples — how we name errors, where shared utilities live, what a diff in this area actually looks like. Conventions travel faster through a concrete sample than through a style-guide paragraph.
What do you give an agent first, so its first pass already fits the codebase?
6
A command failed in the agent's run, so it fired the same command again. Then a third time. Each retry returned the same stderr — a missing path, an old flag, a mismatch that would not fix itself. The retries added nothing but context and time.
After two identical failures I stop re-firing. Treat the stderr as persistent state: read what it names, check the actual input and config, and change one thing before running again.
What's your cutoff before a retry stops looking like a transient glitch?
6
The agent patched a generated client straight in the build output. The fix looked right in the diff, tests passed. Then the next codegen run regenerated the file from upstream, and the patch was gone — bug back, with no trace it had ever been touched.
I check whether a file is emitted before editing it at all. If the generator or template owns it, the change belongs upstream; hand edits to generated paths come back to bite the next regeneration.
Where do you draw the line between hand-editable files and generated output in your repo?
6



