// Reading the shelf: Redline Fieldbook Atrium v3.2 · 2026-04
Documentation / Redline · Review / The eight-pass pipeline Reference · 24 min

The eight-pass pipeline, in detail.

Review runs a deterministic, sequential pipeline. Each pass has a defined scope, a defined timeout, and a defined output. Issues from earlier passes inform later ones; nothing fails silently when a pass times out.

TypeReference
Reading24 min
Revised2026-04 · v3.2
Applies toRedline Review · all tiers

/ 01Architecture

Review is a sequential pipeline of eight passes orchestrated by the analysis engine (port 8765). A document enters as canonical text; it leaves as a structured AnalysisResult carrying issues, dimension scores, a composite compliance score, and the artefacts each pass produced along the way.

The pipeline is deterministic on its inputs: the same text + same tier + same jurisdiction yields the same output, bit-for-bit. Determinism is what makes glass-box explanations defensible — every finding can be replayed.

8Sequential passes
60sTotal budget
847+Legal-pack rules
127Jurisdictions
33Clause types classified

Request shape

class AnalyseRequest:
    text: str             # Document text (min 10 chars)
    tier: str             # "A" structural · "B" + legal · "C" all
    enable_legal: bool
    enable_academic: bool
    enable_corporate: bool
    style_guide: str      # chicago | oxford | nyt | bluebook | legal | academic | corporate
    citation_style: str   # apa (default) | chicago | oxford | nyt | bluebook | legal
    jurisdiction: str     # eng | de | fr | us_ny | au | sg ... (127 options)
    sectors: list[str]   # Optional sector filter

Tier gating

TierAvailable passesNotes
AStructural · Style · SynthesisFree tier. Grammar, readability, style.
B+ Consistency · Legal packPaid. Jurisdiction rules and statutory checks.
CAll passes incl. Semantic · counterparty · autopilotEnterprise.

/ 02The eight passes

The order is fixed. Each pass receives the document, the running issue list, and any artefacts produced by earlier passes (token graph from Structural; the term-glossary from Consistency; the obligation table from Semantic).

#PassTimeoutScope
1Structural15sTokenisation, sentence/clause split, POS, dependency, tense/voice, readability
Style5sCitation format, numbering, capitalisation, term consistency
3Consistency10sIntra-document contradictions, tense shifts, definition scope
Legal pack20sJurisdiction rules, statutory contradictions, sector rules
2Semantic30sLemmatisation, deontic logic, Hohfeldian rights, discourse
4Synthesis5sExecutive summary, clustering, prioritisation, letter grade
Note

The numbering ("Pass 1", "Pass 2"…) reflects checkpoint identifiers in the codebase, not the temporal order of execution. The execution order is the one shown above. The numbering is preserved because it survives in audit logs, exported reports, and Issue IDs — renumbering would break replay.

/ 03Pass 1 · Structural

The pre-flight check. Structural runs the document through spaCy (per detected language), produces tokens, sentences, paragraphs, POS tags, and a dependency graph. Every later pass operates on these artefacts; if Structural cannot produce them, the pipeline aborts with a hard error.

What it produces

  • Token graph — sentence and clause segmentation, dependency edges
  • Tense classification — present · past · future · perfect · conditional
  • Voice detection — active · passive · middle, with passive-voice percentage
  • Branching complexity — per-clause score over dependency depth
  • Readability — Flesch-Kincaid grade and word/sentence/paragraph/clause counts

What it flags

Grammar issues, sentences over ~45 words, paragraph integrity, formatting consistency, readability scored below grade 9 / above grade 18, branching complexity above silo threshold.

/ 04Style

Style runs the configured guide (Chicago, Oxford, NYT, Bluebook, Legal, Academic, Corporate, or a YAML house-rules file) against the document. The check is precise and fast — 5 seconds is generous; most documents complete in well under 1.

What it checks

  • Citation format vs. the selected citation_style
  • Numbering convention — alphabetic, numeric, or roman; mixed-scheme violations
  • Capitalisation against the guide
  • Term consistency — same concept, same word, across the document
  • House rules from a project-supplied YAML (see Authoring a legal-pack rule for syntax — the rule schema is shared)

/ 05Pass 3 · Consistency

Consistency catches the things even careful authors miss: a defined term used before its definition, a tense shift between recitals and operative clauses, a cross-reference to a clause that no longer exists after revision.

Sub-detectors

  • intra_contradiction — same document, contradictory statements
  • tense_shift — drift between past and present in connected clauses
  • definition_coherence — circular, conflicting, or orphan definitions
  • crossref_integrity — every "Section 4.2" actually resolves; 11 instrument detectors
  • defined_term — declared but unused, used but undeclared, used out of scope

/ 07Pass 2 · Semantic

The expensive pass — 30 seconds because semantic analysis is where the LLM-shaped work happens: lemmatisation across paraphrase, deontic logic over modal verbs, Hohfeldian rights analysis (right · duty · privilege · no-right · power · liability · immunity · disability), and discourse-relation extraction.

Deontic taxonomy

ModalForceCounter-party effect
shallObligation (strong)Right to compel performance
mustObligation (strong)Right to compel performance
shouldObligation (weak)Expectation, not enforceable as covenant
mayPermissionPrivilege; no duty on counter-party
willPrediction / undertakingContext-dependent

The output of Semantic feeds the Ledger obligation extractor — see the Ledger extraction model for what happens next.

/ 08Pass 4 · Synthesis

The closer. Synthesis takes the union of issues from every preceding pass, clusters them, scores them across the four dimensions, and produces the executive summary that the PDF report leads with.

The compliance score

0–100 composite across four sub-scores:

  • Structure · clause organisation, numbering, cross-references
  • Style · writing quality, readability, consistency
  • Legal · jurisdiction compliance, statutory alignment
  • Tone · formality, precision, deontic clarity

Letter grade

A ≥ 80 · B ≥ 60 · C ≥ 40 · D ≥ 20 · F < 20. Status colour: green ≥ 80 · amber ≥ 50 · red below.

/ 09When a pass times out

Time budgets are real, not aspirational. If a pass exceeds its budget the engine cancels the in-flight work, records a pass_timeout event on the result, and continues to the next pass with whatever the timed-out pass produced so far. The result is marked partial: true and the affected dimension is annotated.

Warn

A partial result is still a valid result — issues already emitted are kept. Letter grades and scores from partial runs are flagged in the API response and watermarked in exports. Treat them as advisory.

/ 10Output shape

The pipeline returns a single AnalysisResult object that every export format (DOCX tracked, branded PDF, .fieldbook, CSV/JSON) is derived from. The shape, abbreviated:

interface AnalysisResult {
  id: string;
  document_hash: string;
  tier: "A" | "B" | "C";
  jurisdiction: string;
  score: { composite: number; structure: number; style: number; legal: number; tone: number };
  grade: "A" | "B" | "C" | "D" | "F";
  issues: Issue[];
  passes: { [name: string]: PassReport };
  partial: boolean;
  timed_out_passes: string[];
  summary: string;
  artefacts: Artefact[];   // obligation table, term glossary, clause hierarchy
}

See Export formats & their guarantees for what each derived artefact preserves.

Read the pipeline. Then run it.

Request access Back to documentation