Stop treating AI-generated code as a code-review problem and treat it as an interpretability problem. You never read the implementation. You structure the system into domain-specific pieces with well-defined inputs and outputs, attach sensors at the seams, run them, examine outputs, and build trust by interrogating the system continuously — every new user journey, every edge case, every real thing a user actually does.

This is the behavior surface of the Software Factory. Its counterpart, the intent surface, is the Decision Ledger.

What you need to know, and what you don't

You don’t need to know how this piece works. You need to know that this piece, given these inputs, produces these outputs, and keeps doing so as everything around it changes.


Why black-boxing is the default already

The move sounds reckless until you count what you already ship unread.

  • Your dependency tree. Take any modern application and count the shipped code anyone on the team has actually read. It rounds to zero, and has for a decade — your dependencies, their dependencies, four layers below that. The black-box model isn’t a scary future, it’s most of what’s running in production right now.
  • Your org chart. A VP of Engineering is accountable for everything their org ships and may go years without reading a line. Responsibility never required reading. It required knowing the system was structured so that problems surfaced.

What’s new is only that black-boxing has reached first-party code — the part we wrote ourselves and therefore assumed we understood. The techniques for being accountable for unread code already exist. We just never pointed them at our own repo.


The seams are what make it work

This is the part people skip, and skipping it is why “just don’t read the code” fails.

A large monolith cannot be interrogated efficiently. A typical full SaaS product has far too many input permutations, and many user journeys have no clearly defined boundary for what “correct” even means. Black-boxing a monolith gives you an opaque system with no inspection points — genuinely worse than reading it.

Domain-specific pieces with well-defined inputs and outputs are what turn an unreadable system into an inspectable one. The interface becomes the review surface. So the architectural commitment comes first:

  • pieces that are extremely domain-specific,
  • with inputs and outputs you can state,
  • that can be built, instrumented, and be wrong in isolation.

That last property is the same one that makes slicing work for long agent runs (see Fog of War Scouting). One discipline, both surfaces: the boundary you attach a sensor to is the boundary that keeps a bad decision from spreading.

This is where the idea shakes hands with the rest of the vault. Layered Domain Architecture for AI Agents (OpenAI’s Types→Config→Repo→Service→Runtime→UI with mechanically enforced boundaries) is the most concrete instance of exactly these seams. Own Your Stack and Modern Engineering Values argue for the same shape from the ownership side. And Agents and Domain Expertise already makes the softer version of the claim: a domain expert can safely direct agents without reading code, provided the pipeline has checkable boundaries.


The four artifacts that must stay readable

Going black box is only defensible if the human-readable layer moves up rather than vanishing. Otherwise you’re just shipping encrypted intent. Whatever the code compiles down to, these four stay in plain language:

ArtifactWhat it holdsNearest vault page
InvariantsWhat must always be true of this piece, stated in a form you can checkEvaluation-First Prompting, Capability vs Regression Evals
TracesWhat actually happened on a real run, at the seams, in a form a human can followSession Observability and Replay
Attack surfaceWhat this piece is exposed to and what it’s allowed to touchAgent Security and Threat Model
DecisionsEvery choice made where the spec was silentDecision Ledger

Zhang deliberately refuses to call these “specs.” They’re living documents that accumulate architectural decisions during implementation, which traditional specs don’t. He settles on the neutral word artifacts to avoid the semantics fight — a distinction worth keeping when reading this next to Spec-Driven Development, where the spec is a gated upstream document rather than a running record.

Invariants vs tests

An invariant is stated as a property that must hold, not as an example that passed. It survives a rewrite of the implementation; a test pinned to implementation details does not. Zhang’s write-tests skill states the rule as “pin real behavior, not implementation details” — the same thing from the other side.


Sensors, not test suites

The word choice matters. A sensor is continuously interrogating, not a suite you run at merge time:

  • Run the functions, examine the outputs, and keep doing it as everything around the piece changes.
  • Trust is built over time, by accumulation — every new user journey and edge case adds a reading, not a one-off green checkmark.
  • The system is never “verified.” It is currently consistent with everything you’ve asked it so far.

That’s a different mental model from a CI gate. CI answers “did this change break a known case?” Sensors answer “does this piece still behave the way I believe it behaves?” Both are needed; only the second grows with the product.


Why AI reviewers don’t substitute

The standard fix for too-much-code-to-read is more AI to help read the code. Zhang’s objection is structural, not about reviewer quality: AI reviewers are pinned to the artifact, and the artifact is exactly the thing going opaque. As generation improves, code trends toward token-efficient, AI-native forms — Claude-speak, purpose-built languages, eventually machine code. Every improvement in generation makes an artifact-pinned reviewer less relevant.

Sensors and invariants don’t have that problem: they attach to the interface, which stays human-defined no matter what the implementation compiles to. Same for the ledger, which attaches to intent.

This is a real disagreement with Agentic Code Review, whose central prescription is running two heterogeneous AI reviewers. The two positions are compatible today (nobody is shipping machine code from a prompt in 2026) and diverge on a forecast. Hold both.


Failure modes

  • Black-boxing before the seams exist. Skipping the architecture work gives you an unreadable and uninspectable system. The seams are the precondition, not a nice-to-have.
  • Sensors that test the implementation. If your sensor breaks whenever the agent refactors internals, it isn’t a sensor, it’s a tripwire. It will get deleted.
  • Treating green sensors as sufficient. They’re silent on every decision in the Decision Ledger. That’s the whole reason the second surface exists.
  • Boundaries drawn by the agent, unreviewed. Where the seams go is itself a decision — arguably the highest-stakes one. It belongs at the top of the ledger.
  • Skill atrophy. Paradox of Supervision: the judgement to define good invariants and spot a wrong boundary comes from having read a lot of code. The proposal consumes a resource it doesn’t replenish.


Sources