Skip to content

Build1 publisher3 min readPublished Updated

Vinkius's Python Excellence Prover makes the agent audit its own output against five pivots

A dev.to post lists thirteen Python anti-patterns that coding agents keep emitting, then proposes an MCP tool that walks the agent through structured reflections. Ten of the thirteen are single-file static checks.

The Engineer · Build desk

Illustration accompanying Vinkius's Python Excellence Prover makes the agent audit its own output against five pivots

What happened

  • A dev.to post catalogues what coding agents keep emitting in Python: functions without type hints, os.path where pathlib fits, and the mutable default argument trap written as def func(x=[]).
  • The same post flags bare except: blocks that swallow critical system signals including KeyboardInterrupt, and synchronous I/O placed inside an asynchronous loop.
  • Its author's answer is the Python Excellence Prover, a tool that forces the agent to prove its logic against five pivots: typesafe boundaries, removal of workarounds, error handling, clean architecture and async compliance.
  • The Prover's rules are specific: Pydantic BaseModel at external ingestion, @dataclass for internal DTOs, context managers over manual .close(), and structlog or loguru instead of print().
  • According to the post, most existing MCP implementations concentrate on connectivity between an agent and an API and rarely address correctness or language-specific idioms.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • constraint A check that lives in the agent's tool list only runs when the agent calls it, so it cannot hold the line the post asks for, which is a gate before code reaches the repository.
  • contradiction The post rules out a better prompt as the fix, then describes an enforcement mechanism in which the same model answers structured questions about the code it just wrote.
  • cost Adopting the rules is not free in an existing codebase: Pydantic at every ingestion point, and replacing print() with structlog or loguru means touching the logging in code that already ships.
  • exposure Where a bare except stays in agent-written Python, the operator's interrupt no longer stops the process, and on-call has to kill the job from outside it.

The Prover is an MCP tool, and what comes back when the agent calls it is a set of structured reflections: the tool asks the agent to prove its logic against five decision pivots, and the model that wrote the code answers [10][11]. Per the post, it "doesn't just check if the code runs; it checks if it complies with modern PEP standards and high-performance requirements" [11].

That enforcement path sits somewhere different from the one the post's own framing implies. Its author wrote that the aim was "a validation layer that acts as a gatekeeper for code quality before it ever reaches a repository" [7]. A gatekeeper at the repository boundary returns pass or fail on a diff. A reflection step inside the agent's tool loop runs when the agent calls it [20].

Thirteen distinct patterns appear in the post's list. Ten of them are single-file code shapes: missing type hints, os.path where pathlib fits, a mutable default argument, a bare except, `except Exception: pass`, percent formatting, a manual loop where a comprehension fits, a manual `.close()`, `print()` where structured logs are expected, and blocking I/O inside an async path [1][2][3][6][14][15][16][19]. A static checker flags every one of those with no model in the loop.

The remaining three need whole-program context: god classes, global mutable state, and the missing separation between repositories and services [17][19]. Those are where a reviewing model has something a rule does not. So is the exception question underneath the swallow: flagging `except Exception: pass` is a pattern match, and deciding which exception the call can actually raise is a judgement [15][16].

The strongest engineering claim in the post is about where validation sits. Pydantic at ingestion means that "if an API returns unexpected JSON, the failure happens at the boundary with a clear error message, rather than causing a silent logic error deep in your business logic," the post says [13]. The type example is the honest one: `def process_order(data, user, amount)` leaves the next developer guessing whether `amount` is an int of cents or a float of dollars [18].

The post's central assertion is unmeasured. It states that "without strict typing via Pydantic or Mypy, the risk of runtime failures increases exponentially as complexity grows" [5], and it cites no figures behind that [21]. Treat it as the author's design conviction.

For the Prover's result to transfer to your repo, three things have to hold. The agent has to call the tool on every diff it produces. Your review has to reject diffs where it did not. And the failures you actually see in agent Python have to be the idiom-shaped ones on this list, because a reflection about PEP compliance does not catch a wrong invariant. The one item on the list that survives all three tests without a linter is the async pivot, and the post describes that failure precisely: synchronous I/O inside an asynchronous loop, "effectively neutralizing any concurrency benefits" [3].

What to watch

  • Whether Vinkius ships a repo-side gate for the Prover, so a diff produced without calling it fails.
  • Whether the Prover's rules are published as mypy and linter configuration that runs with no model in the loop.
  • A measured before-and-after on a real codebase: defect rate in agent-written Python with the Prover and without it.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories