← Signal Feed
•7 min read

Agentic Rebuild: Why You Regenerate the Corpus, Not the Instance

When a generator's defect is systemic, patching it instance by instance never finishes and never matches. The story engine behind Bookbrary stops hand-editing one flawed chapter and instead reruns the whole series through the current pipeline, so every artifact inherits every fix at once and the corpus returns to being self-consistent. Rebuild over patch is a decision with a trigger condition and a price in both directions.

agentic-airebuildstory-enginebookbraryregenerationconsistencycorpus

Agentic Rebuild: Why You Regenerate the Corpus, Not the Instance

The instinct when a generated artifact comes out wrong is to fix the artifact. Find the flawed paragraph, the missing field, the broken link, and patch it. For a one-off that instinct is right. It collapses the moment the generator produces a corpus, a long-lived body of related output where the defect is not in one item but in the pipeline that printed all of them. At that point the patch is a trap, and the correct move is a rebuild: rerun the whole body through the current engine so every item inherits every fix at once, and the corpus becomes consistent again as a whole instead of as a pile of hand-touched pieces.

Systemic Defects Are the Trigger

The distinction that decides everything is whether the flaw is local or systemic. A single misspelled name is local. A chapter that drifted out of the series timeline is systemic, because the engine that will write the next chapter carries a model of where the story already is, and a hand-patch to chapter three does nothing to correct that model. The visible symptom sits in one place; the cause sits in the generator's rule.

Systemic defects share a signature. They recur everywhere at once: every volume is missing the same field, every chapter carries the same legacy formatting artifact, every index is missing the same embedding. They are not independent mistakes; they are one mistake stamped across the whole run. Patching them is a game of whack-a-mole that can only be won by never finishing, because the corrected item no longer matches what the engine would now produce, and the engine keeps marching forward.

The Story Engine: Rebuild, Not Rewrite

This is exactly the discipline behind the Story Engine that generates books for Bookbrary. The engine writes a series as a whole: a premise, a cast, a continuity model, and the chapters that follow from them. When the pipeline changes, a field gets added, a formatting rule hardens, a generation step improves, the change applies to every book the engine has ever written, not just the next one.

The temptation is to go book by book and hand-fix the ones that show a gap. The engine refuses that move, and the reason is structural. The prose is not the source of truth; the premise and the pipeline are. Edit the prose directly and you fork the book away from its own premise. Rerun the series through the current engine and every chapter regenerates from the same source with the same rules, so chapter three and chapter seven agree with each other and with the model behind them.

The rebuild is literally a serial rerun of a whole series through the current pipeline, each chapter passing the build-and-critic gauntlet and landing a consistent quality on the other side. The fixed gap is almost the least of it. The real output is a corpus that is coherent as a body, not a set of individually clean parts.

Consistency Is Load-Bearing for the Reader

Why does that coherence matter enough to spend a full rerun? Because Bookbrary is the reader that displays the corpus, and a reader is the strictest consistency checker a system will ever face. A person holds chapter three and chapter seven in their head at once. They notice when a character's name is spelled two ways, when a historical detail contradicts itself, when a field is populated in one book and blank in the next. The reader experiences the whole series, so the series is the unit of correctness, not the book.

That is the real argument for rebuild over patch. A patch fixes the artifact in isolation. A rebuild fixes the artifact in relationship. When the defect is systemic and the relationship is what is being judged, only regeneration restores the thing the reader actually consumes.

The Price Runs Both Directions

Rebuild is not a reflex; it is a decision with a cost in both directions, and getting the direction wrong is expensive either way.

Patch a systemic defect and you build a Frankenstein. Each edit is individually right and jointly wrong, because the hand-touched chapter no longer matches its neighbors or the engine that wrote them. You have traded one visible flaw for a thousand invisible seams, and the seams are harder to find than the flaw ever was.

Rebuild a local defect and you burn a full run to move one comma. Regeneration is not free: it costs the compute, the time, and the risk that a long rerun fails partway and has to resume. Pointing a rebuild at a typo is throwing the engine at a problem a pencil could solve.

The trigger condition is the whole game. Local and isolated means patch. Systemic and relationship-bearing means rebuild. The discipline is judging which one you are looking at before reaching for either tool.

A Rebuild Needs Its Own Resilience

There is a final complication. A rebuild of a large series is itself a long, fragile run. It spans hours and hundreds of artifacts, and it can fail partway through, which is exactly what the story engine has to handle when a build exits unclean and retries. A rebuild that cannot survive its own failure is just a more expensive failure.

So a rebuild carries the same self-healing the engine always has: detect the failed segment, retry only what failed, and resume without redoing the work that already cleared. Checkpointing and per-segment retry turn a multi-hour regeneration from a single brittle pass into a run that can be interrupted and restarted without corrupting the corpus it is trying to heal. The rebuild itself has to be built with the discipline it is applying to the books.

The Discipline in One Line

Builders reach for the patch because it is local and cheap and feels surgical. The hard-won lesson is that a generator's biggest defects are not local, and neither is the thing a reader judges. When the flaw lives in the pipeline and the reader holds the whole body at once, regenerate the corpus, not the instance. Patch the typo. Rebuild the series. Know which one is in front of you.

Key Takeaways for Agentic Rebuild

  • T-RB1: Classify the defect before choosing the tool. Local and isolated means patch; systemic and recurring means rebuild. A flaw stamped across every artifact is one pipeline bug wearing many faces, and no number of patches reaches the cause.
  • T-RB2: The premise and pipeline are the source of truth, not the prose. Hand-editing generated output forks the artifact away from its own generator. Rerun through the current engine and every item stays coherent with the model behind it.
  • T-RB3: The corpus is the unit of correctness when a reader consumes the whole body. A reader compares chapter three to chapter seven, so the relationship between artifacts is what is judged. Rebuild restores the relationship; a patch only restores the part.
  • T-RB4: A rebuild must survive its own failure. Checkpoint and resume per segment so a long regeneration can fail partway and retry only what failed, instead of corrupting the corpus it is meant to heal.