stories from the edge of modern engineering

Human-in-the-loop-AI.

Back to the post I wrote here, the next evolution of this workflow is module-level spec generation — one spec file per node in the dependency tree, generated in isolation. Rather than asking the model to reason across the entire platform at once, you bound the context to a single module: its files, its interfaces, its known behaviours, its immediate dependencies. Sonnet’s inference stays focused, and Opus has a clear, scoped brief to validate against.

The order of generation matters. You work bottom-up — leaf modules first, then progressively upward toward the high-complexity hubs at the centre of the dependency graph. By the time you’re generating specs for the most entangled modules, the downstream specs already exist and can be fed as additional context, making each successive spec more accurate than it would have been in isolation

The high-complexity nodes — the ones with hundreds of files and cross-cutting business logic — are still too large to spec in a single pass even with bounded scope. Those get decomposed further, by responsibility, before generation begins. The human review gate maps naturally onto this structure too: each module spec becomes a discrete, reviewable unit that can be owned by the engineer closest to that part of the system.

Leave a Reply

Discover more from Beyond the Stack

Subscribe now to keep reading and get access to the full archive.

Continue reading