05 / Case study

Authority

eighty pages that agree with each other.

A content platform that turns a topic into book-length output — ebooks of 25,000 to 35,000 words, plus email courses, webinars and lead magnets from the same engine.

Writing a good page is not the difficulty. Writing a hundred that do not contradict each other, in one voice, without losing the work when chapter twelve fails, is a different problem.

It is an orchestration problem, not a prompting one.

Stack

#Django#Celery#Postgres#Next.js#LangChain#Stripe

Infrastructure

#Docker#Gunicorn#Whitenoise#Redis#Token accounting
Ours outright

authority-wizard

long-form generation platform

25–35k
words per ebook
10–15
chapters, each a task
14
django apps, one engine

Generation in progress — chapters completing independently

screenshot pending

01

Six problems that are not about writing

01

Coherence across chapters

Chapter 11 has to know what chapter 3 promised. No context window holds the whole book while writing the end of it, so the outline becomes the shared memory and every chapter is written against it rather than against the previous chapter.

02

Drift in voice

Generate fifteen chapters independently and you get fifteen slightly different authors. The persona and the constraints are re-asserted per chapter, and they come from one place so they cannot diverge.

03

One request cannot do this

A book is tens of minutes of generation. It cannot live in an HTTP request. Celery holds the job, each chapter is a task, and the browser polls a status rather than a connection being held open.

04

Partial failure is normal

At fifteen chapters, something fails. Losing the whole book because chapter 9 timed out is unacceptable, so chapters persist as they complete and a retry resumes rather than restarts.

05

Cost has to be attributable

A token tracker records spend per generation, and users hold credits. Without that, a long-form generator is an uncapped bill wearing a product.

06

Many outputs, one engine

Ebooks, short ebooks, email courses, mini-webinars, lead magnets and hook generators are separate Django apps over shared generation machinery — different products, one pipeline.

02

The outline is the architecture

The single decision that makes long-form generation work: the outline is produced first, persisted, and then treated as immutable while chapters are written.

Every chapter is generated against that outline — what this chapter covers, what came before, what comes after, what has already been promised to the reader. Not against the text of the previous chapter, which is how drift compounds.

It is the same shape as an eval set. A fixed reference the work is measured against, rather than each step being judged relative to the last one.

Pipeline

outlineone call — structure, promises, arc
persistoutline is now fixed
fan outone Celery task per chapterper chapter
persisteach chapter saved as it landsper chapter
assemblestitch, format, export
accounttokens recorded, credits debited
03

How these break

SymptomUsual cause
It contradicts itself between chaptersEach chapter was written against the previous one instead of against a fixed outline.
The voice changes halfway throughPersona re-stated inconsistently, or only in the first prompt.
It dies at chapter 12 and loses everythingState held in the request instead of persisted per chapter.
The bill is a surpriseNo per-generation token accounting, so cost is only visible on the provider invoice.
It repeats itselfNo record of what has already been covered, so later chapters re-explain earlier ones.

Finished ebook — chapter structure and formatting

screenshot pending

04

What happened

Built and shipped, with Stripe billing and credit accounting in place. It is on this site for range rather than for the wedge: it is the clearest evidence that the Python and background-job half of the work is real, not a line on a CV.

No usage figures are published here because none were measured in a way worth quoting.

Long jobs

the question is whether yours loses the work.