S Stonewall Innovations Book

May 2026 edition · show-ready

The architecture is the innovation

Stonewall is what happens when you build a real litigation practice on top of a versioned corpus. A flat-file database, agents that route on purpose, CI that refuses drift, four deploy surfaces that all read the same truth file, and a cockpit that still works when the API is down.

2,542Manifest rows
88%Analyzed active
277Live patterns
0Strict errors

Part I

Flat-file corpus engine

catalog/manifest.md is the database. Agents grep it; lawyers diff it; CI refuses drift.

Manifest as load-bearing wall

Sequential artifact IDs, typed rows, character/pattern/case joins, analysis flags — searchable without spinning up Postgres.

catalog/manifest.md · A001–A2697+

Stonewall CLI

Stdlib-only stonewall.py: stats, find, case, character, pattern, timeline, show, validate, doctor — every session queries the corpus on purpose.

scripts/stonewall_cli/

Crossref freshness gates

corpus_crossref.py rebuilds indexes; verify_all.py runs KPI + crossref + graph validators before merge.

catalog/crossref_index.json

Design law: pointers are not facts. Manifest rows route you to verbatim source — never replace opening the file.

Part II

Agent-native control plane

Routing bundles replace "read the whole repo." Machine snapshots tell the next agent where to look first — ordered paths per task instead of breadth-first context burn.

Workflow bundles

MASTER_INDEX.mdWORKFLOW_BUNDLES.md: ordered paths per task (bootstrap, verify, cockpit, OCR gold, …).

context/

Generated snapshots

refresh_agent_context.py emits repo shape + corpus navigation line maps for partial reads of 200k-token codices.

context/generated/

Lock-state sweeps

Type one settlement sentence in chat. The script propagates the change to every codex, the KPIs, the bot brain, the cockpit snapshot, and the chronological prohibitions — in one sweep, no manual fan-out.

scripts/lock_case_state.py

Part III

Verification spine

verify_all.py is the merge contract. Fast and corpus-only modes for the cheap PRs. The whole suite for anything that touches the codex. CI argues with you before opposing counsel does.

Merge-critical freshness

KPIs, case parties, asset stamps, SHA-256 dedupe index, pattern coverage, codex↔corpus wiring — stale generated artifacts fail closed.

scripts/verify_all.py

Drift catchers

Four classes of subtle wrong: rendering substring conflation, codex claims that contradict reality, cross-surface mirror drift, identity prohibitions. Each one has its own audit gate. Pattern 278 is the canonical example.

scripts/audit_horn_corns.py

PR language gate

Two tiers. Anything a malpractice carrier might read — PR title, branch name, release notes — stays in neutral counsel voice. Commit bodies can carry the internal vocabulary, since they live inside the working file.

scripts/audit_pr_language.py

Part IV

Multi-surface deploy truth

surfaces.toml is the single truth file for what's deployed where. The public build is sealed: minify, content-hash stamp, catalog-only portal export, an export-scope guard that fails the build if anything sensitive sneaks into docs/.

stonewall.esq

Vercel stonewallvercel_build.shdocs/

app.stonewall.esq

Next.js cockpit · Clerk · bundled offline JSON

api.stonewall.esq

Railway FastAPI · corpus API shape canary

StonewallBot

Isolated Telegram service — never on API hostname

Part V

Gold-standard evidence layer

Sidecars are permanent screen records. 300+ dpi raster OCR floor. Nested reply chains preserved as blockquotes. Bubble colors named, emojis transcribed, every visual bracketed. The principle: the operator should never have to open the original to know what's in it.

The May 1 Domo package — 31,000+ clickstream rows from the case-management system — is the audit anchor for every chronology claim. When the codex and the clickstream disagree, the clickstream wins.

Part VI

Operator cockpit

The signed-in workspace. 45-second artifact reads, snapshot fallback when the live API preview comes back empty, a Domo reading room. Built to keep working even when Railway is having a bad afternoon.

operator-snapshot.json

Stats, ledger, per-artifact source_contexts previews — built by build_cockpit_operator_snapshot.py.

Reading room

Domo audit + burn-book control packets at /reading — hotkey g y.

Fallback chain

Live API → bundled snapshot → public artifacts.json — one warn per route per process.

Part VII

Documentation automation

A daily watch opens one rolling editor PR when the docs and the API stop agreeing. A janitor closes the duplicates that background agents tend to spawn. Graphite is the canonical review surface; corpus-only PRs skip the cockpit gates.

Part VIII

May 2026 campaign

Ninety-six merges in eight days, May 11–18. Then the May 19–20 front: artifact reader, agent snapshots, public hero, vision intake, Graphite migration, governance trims. The longest sustained push since the corpus was born.

May 11–18

The control-plane week

Public perf, cockpit streaming, codex sharding, graph wiring, audit gates, deterministic indexes — chronicled in the May engineering epic.

May 19–20

Reader + snapshots + docs truth

#881 artifact reader · #885 agent context · #884 docs API drift pass · #855/#835 public surface polish.

Part IX

One-page summary

This is not a startup deck. It is a working litigation memory machine with production gates around it.

  • 2,500+ artifacts in a versioned manifest. Zero strict validation errors.
  • Agents route deliberately — bundles, snapshots, lock-state sweeps.
  • CI enforces truth — verify_all, drift catchers, SHA-256 dedupe, public-export guards.
  • Four deploy surfaces, each one with live HTTP probes and rendered surface docs.
  • Evidence held to a gold standard — full-page raster OCR, reply chains nested, Domo clickstream as the anchor.
  • Cockpit keeps working offline — bundled JSON, 45-second reads, Clerk-gated operator access.
  • Automation refuses doc rot — API drift watch, PR janitor, Graphite review.
  • Azure Well-Architected discipline — five pillars, every one of them wired to a CI gate, not a slide.

Part X

Microsoft × Vercel — the production bar

Azure Well-Architected discipline on a Vercel + Next.js stack. Every row in the pillar table points at a real file in this repo or a CI gate that runs on every push.

Reliability

SWR caching tiers, content-hashed ?v= stamps, cockpit offline bundles, surfaces.toml live probes.

vercel.json · asset_version_stamp.py

Security

gitleaks, public export guard, Clerk allowlist, HSTS preload, frame deny, SHA-pinned Actions.

vercel_build.sh · web/middleware.ts

Performance

Speed Insights deferred past LCP; ISR revalidate=60; check_web_perf_invariants.py blocks TTFB regressions.

vercel-observability.js · web/lib/api.ts

Operations

Two Vercel projects, drift watch, deploy runbooks, frozen lockfile cockpit builds, path-scoped verify.

docs/platform-elite-practices.md

Cost

Public build no-op install, corpus-only CI for doc PRs, concurrency groups, three brain zips max.

detect_pr_change_scope.py

Deep dive: pillar tables, post-deploy curl checklists, and executive mapping — Platform Elite Practices (full contract).