I Built a Manga Like a Codebase — Unit Tests, Objects, and All

How my Roman-era tragedy about inherited optimism got version control, a test suite, and a dependency graph — and why that made the story better, not colder.


There is an old, comforting myth about how stories get made: a solitary author communes with the muse, and pages appear. It's a nice image. It is also, in my experience, almost entirely useless once a project crosses a certain size.

I should say up front what I am, because it explains everything that follows. I am an obsessive soul with ADHD, and I've come to see that combination as a genuine superpower — one that happens to need a sidekick to clean up after it. The obsession generates more world, more structure, more interlocking philosophical machinery than any single working memory can hold at once. The ADHD means I'll follow a thread down a hole for six hours and surface with something brilliant and three contradictions I didn't notice I'd created. The superpower is real. So is the mess. I needed a system that could keep the mess from eating the superpower.

I've also earned the right to say this the hard way, and from both sides. In 1997 I programmed the website for Viz.com — yes, that Viz, the company that put most of the manga on your shelf into English. So the "manga like a codebase" framing isn't a metaphor I reached for; it's just the two things I've done professionally since the '90s, finally pointed at the same project. And in the years since I've worked on something like 20,000 pages of manga — as script, as art, sometimes both — for other people's books. Two decades of watching how long-form comics actually hold together (and how they fall apart) under production pressure. Now, finally, it's time to do it for myself. And when it's your own book, you don't get to blame anyone else's pipeline for the drift.

The book is a graphic novel set in a realistic, magic-free world at roughly Roman-era technology. Its engine is a collision of two of the most durable pieces of Western literature: Voltaire's Candide — the naive optimist whose tutor insists this is "the best of all possible worlds," marched through catastrophe until the philosophy is ash — braced against a Medea counterweight, an avenger with zero illusions built as the photographic negative of the optimist. That's a lot of moving parts to keep coherent across hundreds of pages, multiple story arcs, a dozen characters, and a visual language that has to rhyme with itself chapter after chapter.

So at some point I stopped treating the project like a manuscript and started treating it like a software system. For someone who shipped web code and comic pages in the same career, that wasn't a leap — it was coming home. Not as a gimmick, and not to make it feel "high tech" for a pitch deck. I did it because the same problems that break large codebases — inconsistent state, silent regressions, tangled dependencies, changes in one place quietly contradicting another — are exactly the problems that break large stories, and exactly the problems an ADHD brain manufactures at scale. Programmers spent fifty years building tools to manage those failure modes. I just borrowed the tools.

Here's what that actually looks like.

Ground truth is a single source, and it lives in version control

The first thing any serious codebase insists on is a single source of truth. Not five copies of a document with slightly different edits; one canonical version, and a disciplined process for changing it.

My story bible lives in a directory literally called canon/. The rule is blunt: if it's not in here, it's not canon. Core premise, the world and its two rival faiths, every character sheet, the structural spine of the sagas — all of it sits in one place, in plain-text Markdown, under git.

That last part matters more than it sounds. In my old workflow, the way I recorded a change to the story was to write an "Amendment" document that overrode the original bible — Amendment 001, 002, 003, each one a patch layered on top of a base text I didn't want to rewrite. If you've ever inherited a codebase held together by config overrides stacked on config overrides, you know the smell. To understand the current state of anything, I had to mentally replay every amendment in order and hope I didn't miss one. For a brain that loses the thread mid-sentence, that's not a workflow — it's a trap.

Git kills that entire category of problem. Now, when the story changes, I edit the canonical file in place and commit it with a message explaining what changed and why. There are no amendment files anymore. git log on any bible file is the amendment trail — a complete, timestamped, attributed history of every decision, with the reasoning attached, that I can walk backward through at will. When a character's motivation gets rebuilt from the ground up (mine did — the antagonist's entire psychology was re-mechanized in a single committed revision), the diff shows me precisely what the old reading was and what replaced it. My prior era's messy backups don't get deleted either; they're frozen in a reference_archive/ directory, read-only, clearly marked as superseded. That's the legacy branch. You keep it for forensics; you never ship from it.

Separate the source from the build

Every compiled project draws a hard line between source and build output. You edit the source; the build is derived from it. Mixing them is how you get artifacts you can't reproduce and changes you can't trace.

I split the project the same way. canon/ is the source. production/ is the build — the actual page-by-page chapter scripts, the visual style guides, the render pipeline. The story bible almost never changes; the production files change constantly. Keeping them apart means a scriptwriting session can move fast and messy — exactly how I work best — without any risk of corrupting ground truth, and ground truth can be edited with ceremony without forcing a rebuild of everything downstream.

This shows up most clearly in how I handle recurring visual motifs — the repeating objects and compositional echoes that give a long book its subconscious rhythm. There are two files. One, in canon/, is the glossary: the definition of each motif type, changed only when a genuinely new device is invented. The other, in production/, is a live tracker of where each motif actually lands in the real chapters and how far along it is. That's the difference between a class definition and its instances at runtime. You define the pattern once; you track every place it's instantiated separately, because those two things change at completely different rates.

The characters are objects, and the philosophy is an inheritance chain

Here's where the object-oriented framing stops being a metaphor and starts being the literal structure on the page.

Take the tutor, the optimist who insists all is for the best. It would be easy to write him as a fool with a catchphrase. Instead, the bible defines him as the terminal heir of a two-thousand-year deductive tradition: Plato's craftsman shaping unruly matter as well as necessity permits, inherited by Leibniz's argument that of all possible worlds the best was the one actualized, inherited in turn by Voltaire's satire of that exact sentence said over an earthquake. The optimist doesn't invent his worldview. He inherits it — the conclusion passed down without the argument that produced it, three generations of a class hierarchy resolving into one character who overrides none of it.

That's not decoration. It's an inheritance chain, and it's load-bearing. It tells me which behaviors the character has by default (unshakeable optimism), which he can't explain (because he inherited the conclusion, not the derivation), and exactly where he'll break (when reality throws an exception his inherited logic has no handler for). Every character is written this way: a worldview enacted through behavior, never explained in dialogue — the same way a well-designed object exposes behavior through its methods and hides its internals. You infer the belief from what the character does, not from a speech. In my bible this is a hard rule, and it reads exactly like an encapsulation principle: never expose the private reasoning; only ever show the public method.

The guardrails are invariants — assertions that must never be false

Any system with real complexity has invariants: conditions that must hold true no matter what any other part of the code does. You assert them, and a violation is a hard failure.

My story has five, and they're written down as flat non-negotiables. The most important: there is no villain. No dark lord, no font of evil anywhere in the world's moral architecture. Every actor — the king, the revolutionary who frees slaves and burns villages, the ministers protecting their faith — is doing something defensible by their own lights. The reader is never allowed to discharge their discomfort onto a bad guy, because there isn't one.

That's an invariant, and like every good invariant it's hostile to convenient local changes. The instant any single scene makes one character read as gratuitously evil, the whole system is in an illegal state — the book's central effect collapses. So the rule is asserted at the top level and checked against constantly. Alongside it sit four more: no reactionary reading, no noble-savage reading, no cynical mentor, and the absolute prohibition on ever stating the book's themes out loud instead of dramatizing them. These aren't style preferences. They're the assertions the entire architecture is built to keep true, and any change I propose gets tested against all five before it's allowed to merge — including the changes my own enthusiasm generates at 2 a.m.

The critic panel is a test suite

This is my favorite piece, because it's the closest one-to-one mapping of all, and because it's the clearest example of the sidekick doing what I can't reliably do alone.

Before material is accepted, it runs through a panel of five critics — but not five people vaguely giving notes. Each critic is a formal, ready-to-run reviewer with a single owned domain and explicit authority boundaries: one owns structure and causality, one owns accessibility and reader-bounce risk, one owns craft and authenticity, one owns the reader's knowledge-state and dramatic irony, and one on-request specialist owns symbolic subtext. Each is weighted heavily inside its lane and explicitly discounted outside it. That's separation of concerns, enforced. A structural complaint from the structure critic outranks a structural complaint from anyone else, by design.

And every critic emits findings in one rigid schema:

[CRITIC] · [BLOCKER | CONCERN | NITPICK] · [DOMAIN] · <the note> · FIX: <concrete suggestion>

That is an assertion format. BLOCKER means the work fails on its own terms — a failing test that must halt the merge. CONCERN is a real weakness; NITPICK is a style nit. There's even a standing check that runs on every pass, no exceptions: the two-foreshadow rule. Every major reveal must be supported by at least two independent, separately catchable plants earlier in the text — never one. A single seed is a flaky test: a careful reader catches it once, an inattentive reader catches it zero times, and it reads as coincidence either way. Two independent plants make the trapdoor hold under a casual read and reward a careful one. The critic runs that check against every reveal and flags any resting on fewer than two plants — the way a CI job re-runs the full regression suite on every commit, whether or not you think you touched that code path.

Crucially, the tests don't get to rewrite the spec. A critic can report that the tragic ending will cost me readers — that's engagement data — but no critic has the authority to demand the ending change. The failing test tells you the cost; I decide whether to pay it. And the notes never edit canon directly. A finding becomes a proposed FIX, which gets reviewed and approved, and then it's committed. Pull request, review, merge. The critics can't push to main. Neither, honestly, can my impulses.

The open questions are an issue tracker with a dependency graph

Not every decision is made. In a codebase you don't pretend the open work doesn't exist; you file it, and you track what blocks what. For me this is survival gear: an ADHD brain will happily build three floors on top of a foundation it never poured, and love every minute of it.

So I keep a numbered decision log — every unresolved fork in the story, each with a status of open, resolved, or blocked. Two of them gate enormous amounts of downstream work, and the file says so explicitly. It tracks dependencies: certain motifs simply cannot be designed until a specific numbered decision closes, and the production tracker records that a given panel is OPEN — blocked on #18 the way a build fails with an unmet prerequisite. I can look at any half-finished element and trace, mechanically, exactly which upstream decision is holding it hostage. That's a dependency graph, and it stops me from building elaborate scaffolding on top of a foundation I haven't laid yet — which, left unsupervised, is my single most reliable failure mode.

The motif tracker even has a status pipeline — OPEN → PENDING → SCRIPTED → FLAGGED → DRAFTED → RENDERED → APPROVED — that every visual element moves through. It's a build pipeline with stages, and a FLAGGED tag links straight back to the critic pass that raised the objection, so nothing gets marked done while a failing check is still attached to it.

Why bother — doesn't this kill the magic?

The obvious objection is that all this process must sand the soul out of the work. In practice it does the opposite, for the same reason tests and version control don't make good software soulless — they make it possible. Every hour I don't spend re-deriving whether a change to one character silently broke another is an hour I spend on the actual creative problem. The structure isn't a cage around the art. It's the scaffolding that lets the art get ambitious enough to need scaffolding in the first place.

That's the deal I've made with my own wiring. The obsession and the ADHD are the engine — I wouldn't trade either, and after 20,000 pages spent building other people's books I finally understand exactly what they're worth. But an engine that powerful throws off a lot of debris. The system is the sidekick: the one that walks behind me with a broom and a ledger, catching the contradictions I'm too far down the next hole to see.

The muse still shows up. She just checks her work into git now.


This is the first in a series on the making of the book. Follow along — the reveals are all two-foreshadowed, so if you're paying attention, you'll see them coming twice.


Note — 2026-08-13: data-layer-first object-oriented storytelling

If the essay above is the why, this is the architecture underneath it, and it has a name now: data-layer-first, object-oriented storytelling.

The story is not the pages. It is not the prose. It is the data layer — beats, canon facts, the model, the retained judgments — and every surface you read is a projection over it. The script is a view. The prose is a view. The GN page preview is a view. Nothing is stored twice; every surface is derived from the materials at need.

That inversion is what makes the nonlinear tools possible. A line can live in superposition — the page shows one version while the alternative waits in a note, nothing destroyed, until a judgment resolves it. A mirror can connect two beats chapters apart without either knowing. Authorial intent can be ranked, promoted, and made durable while generated content stays regenerable. Nothing is flattened until it has to be, because the linear order of the finished book is a flattening, not the truth. The truth is the layer underneath, holding every version, every judgment, every origin, with provenance intact.

The object-oriented framing from the essay stops being metaphor here and becomes the literal structure: characters inherit, motifs instantiate, invariants assert, and the editorial process itself is an object graph — the author supplies intent, the sidekick works the model, and every change is a commit with a reason attached. The muse still shows up. She just checks her work into git now.

All production notes