Contracts & Schemas

The 10-step chain-of-thought architecture that converts raw primary sources into structured legal reasoning.

The Chain Phases

LegalChain decomposes the legal research process into four distinct logical phases. Each phase represents a shift in cognitive mode, from mechanical retrieval to substantive synthesis.

Phase I

Rule Phase

Identify, retrieve, and validate legal authority.

S1 S2 S3
Phase II

Application

Extract facts and apply precedent through distinction.

S4 S5
Phase III

Synthesis

Synthesize analysis and verify citation integrity.

S6 S7 S8
Phase IV

Advanced

Transitive reasoning and evidentiary grounding.

S9 S10

Step Definitions

Every step in the chain is a discrete, testable unit. The "Contract" defines the required input, the expected operation, and the ground truth against which the output is validated.

Step Name Functional Task Ground Truth
S1 Citation ID Extract case metadata from opinion text. SCDB
S2 Unknown Authority Find cases citing the anchor case. Shepard's Cite Network
S3 Validation Report overruling status (Dual-Channel). SCDB + Shepard's
S4 Fact Extraction Extract disposition and winning party. SCDB Codes
S5 Treatment Predict treatment relationship (Target vs. Citing). Shepard's `agree` field
S6 Synthesis (CB) Synthesis from extracted artifacts (Reasoning). MEE Rubric
S7 Synthesis (OB) Synthesis with full ResearchPack (RAG). Integration Delta
S8 Integrity Gate FAB gate: Verify no fabricated citations. Deterministic Registry
S9 Transitive Authority Trace precedent A → B → C triangle. Jurisdictional Weight
S10 Evidentiary Outcome prediction from oral arguments. Oyez Transcripts

Dependency & Validation

Steps in LegalChain are not isolated. Each step declares its Step Contracts—the specific results from prior steps it requires to function.

[ CODE LOGIC ]
step.requires() -> Set[step_id]

A step like S6 (Synthesis) requires {S1, S4, S5} outputs to generate its prompt. If any prerequisite failed, S6 is automatically marked as SKIPPED_DEPENDENCY.

[ SUCCESS CRITERIA ]
status == "OK" and correct == True

Only steps that return a valid (OK) and accurate (True) result allow the chain to proceed. This ensures that the model is never forced to reason from incorrect data.