ARCHITECTURE Open-Core v4.13.0 + Sovereign Glass Cockpit 2026-11-10 • 7 min read

From 30-Page Waterfall PRDs to a 4-Layer JIT Intent Compiler

Why authoring 30-page upfront Markdown specifications before Line 1 of code recreates 1995 Waterfall for stochastic agents, and how progressive lowering across four machine-verified layers keeps greenfield and brownfield repositories coherent.

🖥️ Single 28MB Static Go Binary (CGO_ENABLED=0) + 11-Language AST Engine
Upfront Charter Size <= 2 Pages
JIT Slice Spec Horizon 1 Wave Ahead
Spec Taint Precision SHA-256 Exact
Pre-Merge Verification 42 AST Checks
Mark Gantlett
Mark Gantlett
Founder & Principal Systems Architect
Sophia AI
⚡ AI AUGMENTED
Tier 1 Frontier Reasoning + On-Premise RTX 4080 Silicon
FIG D-09 // FOUR-LAYER PROGRESSIVE INTENT COMPILER - Lowering a 2-page North Star Charter through trunk-pinned boundaries and 1-page JIT slice specs into 42-check hermetic Git worktree transactions.

From 30-Page Waterfall PRDs to a 4-Layer JIT Intent Compiler#

How Open-Core `nomos` Replaces Monolithic Upfront Prompt Novels With Progressive Vertical Lowering Across intent/intent.md, nomos.yaml, TC-* Slice Specifications, and Hermetic INT/SUB Worktree Transactions.

Architectural Scope & Executive Companion
Substrate Version: Open-Core `nomos v4.13.0` (Apache 2.0, zero external telemetry)
Executive Companion Brief (gantlett.io): EB-03: Replacing 30-Page AI Specification Novels With a 4-Layer Progressive Intent Compiler
Commercial Engagement Mapping: 14-Day AI Governance & Seam Charter Pilot


1. The False Dichotomy in Agentic Software Engineering#

Watch engineering teams adopt Claude Code, Cursor, Antigravity, OpenCode, or Windsurf on a real build and almost all of them hit one of two failure modes within thirty days:

  1. Unbounded Vibe Prompting (Zero Spec): Developers type conversational prompts straight against a shared branch. By Week 2, agents have invented duplicate retry helpers, imported infrastructure packages straight into pure domain modules, and weakened failing assertions to turn CI green.
  2. 1995 Waterfall in Markdown (The 30-Page Upfront Spec): Burned by vibe coding, teams swing to the opposite extreme and spend two weeks authoring a 30-page Markdown PRD detailing features A through Z before a single line of code runs.

The 30-page Markdown spec feels responsible on Day 1 and collapses on Day 3. Software engineering learned thirty years ago that giant upfront specifications cannot survive contact with a live runtime or a real user testing the first screen. The moment a stakeholder tries Slice A on Day 3 and changes a tenancy or billing workflow, pages 6 through 30 of the Markdown novel silently go stale. Worse, feeding all 30 pages into every agent session burns working-memory context on features ten weeks away while diluting attention on today's invariants.

The fix is not throwing away specifications. The fix is compiling requirements vertically one verified slice at a time rather than expanding prose horizontally upfront.


2. Architecture of the 4-Layer Progressive Intent Compiler#

Real compilers never jump straight from high-level intent to raw machine instructions in one flat file; they lower intent progressively through typed intermediate representations. Nomos structures greenfield and brownfield engineering along four explicit layers between human intent and production Git:

flowchart TD
    L0["Layer 0: 2-Page North Star Charter<br/>(intent/intent.md - Global Domain & Security Laws)"]
    L1["Layer 1: Compiled Repository Physics<br/>(nomos.yaml + ADRs - Read-Only main & Layer Boundaries)"]
    L2["Layer 2: 1-Page JIT Vertical-Slice Spec<br/>(specs/*_spec.md - Fenced Types + TC-* Vectors + SHA-256 Digest)"]
    L3["Layer 3: Hermetic Worktree Transaction<br/>(INT-N -> SUB-N + 42 AST Checks + Git Notes + mneme.db)"]

    L0 -->|"Day 1 Distillation"| L1
    L1 -->|"One Slice Ahead"| L2
    L2 -->|"PLAN -> EDIT -> REVIEW -> SYNC"| L3
    L3 -->|"SHA-256 Taint & Verified Lessons"| L2
Compiler Layer Canonical Artifact Authoring Timing & Size Machine Enforcement in nomos
Layer 0: North Star Charter intent/intent.md Day 1 (1 to 2 pages max; rarely mutates) Captures non-negotiable business, mathematical, and security invariants plus the coarse domain noun map. Strips out premature UI guesses.
Layer 1: Repository Physics nomos.yaml + ADR-0001..N Day 1 (trunk-pinned on main) Enforces physically read-only main, 11-language architecture_boundaries, and canonical SSoT schema rules before Feature 1 starts.
Layer 2: JIT Slice Spec intent/architecture/specs/<domain>/<slice>_spec.md Written strictly 1 wave ahead (60 to 120 lines) Declares fenced data contracts (strict_types), TC-* compliance vectors (verify_obligations), and 64-char SHA-256 digests (fail_on_stale_obligations).
Layer 3: Atomic Transaction worktrees/<repo>-SUB-<N> + mneme.db Per task (PLAN -> EDIT -> REVIEW -> SYNC) Isolates edits in a disposable Git worktree, runs 42 deterministic DoD checks (nomos verify), seals a Git Notes 2PC receipt, and promotes verified remedies to SQLite mneme.db.

3. Compiling a Messy 30-Page Client Backlog Into Live Software#

Suppose a team kicks off a multi-tenant ledger service and arrives with a 30-page requirements document. Instead of pasting 30 pages into .cursorrules or CLAUDE.md, the 4-layer workflow compiles it in three tight moves:

Step A: Distill Layer 0 (intent/intent.md) & Lock Layer 1 (nomos.yaml) on Day 1#

Strip the 28 pages of speculative future screens back into a parked discovery backlog and extract only the true system invariants into intent/intent.md (for example: Tenant A can never read Tenant B rows, all currency amounts are integer minor units, every external webhook mutation is idempotent). Immediately compile module seams into trunk-pinned nomos.yaml:

project: "acme-ledger"
default_branch: "main"
governance:
  boundary:
    enforce: true
  architecture_boundaries:
    - name: "domain-purity"
      from: "internal/domain/**"
      forbid_imports:
        - "internal/infra/**"
        - "internal/http/**"
  contracts:
    spec_roots:
      - "intent/architecture/specs"
    strict_types: true
    verify_obligations: true
    fail_on_stale_obligations: true

Before an agent writes a single endpoint, the walls of the repository are physically enforced in under 5 milliseconds.

Step B: Lower Slice #1 Just-In-Time (Layer 2 -> INT-1)#

Features 2 through 20 remain single-line roadmap entries. You author only intent/architecture/specs/ledger/tenant_posting_spec.md (~80 lines) for the Day 1-2 walking skeleton, ending with executable TC-* obligations:

Vector ID Scenario Expected Invariant
TC-LED-01 Cross-tenant journal post attempt Rejects fail-closed (ERR_TENANT_MISMATCH) with zero rows written
TC-LED-02 Floating-point amount payload Fails schema parse; accepts strictly int64 minor units
TC-LED-03 Duplicate idempotency key replay Returns cached receipt hash without double-posting ledger entries

Commit the specification cleanly on the Intent plane (INT-1). Because INT-* tasks are plane-separated from SUB-* implementation tasks (Law 7), the coding agent implementing SUB-2 cannot quietly delete TC-LED-01 from the specification to make a broken implementation pass.

Step C: Execute SUB-2 & Handle Day-4 Requirement Pivots via SHA-256 Taint#

The coding agent executes SUB-2 inside an isolated worktrees/acme-ledger-SUB-2 sandbox, binds unit tests to @verifies TC-LED-01..03, passes all 42 nomos verify probes, and merges via nomos task sync - stamping the exact 64-char SHA-256 digest of tenant_posting_spec.md into refs/notes/nomos/releases.

When the client tests the live walking skeleton on Day 4 and says "Workspaces now require multi-currency settlement accounts," you do not hunt through a 30-page document:

  1. You update tenant_posting_spec.md in INT-3 (+15 lines and TC-LED-04).
  2. On the very next nomos handshake, SHA-256 taint detection compares the current spec digest against the last verified Git Notes receipt and flags only the exact downstream SUB-* modules referencing @intent tenant_posting_spec.md (#StaleSpecObligation).
  3. Meanwhile, verified domain pitfalls learned during Slice #1 are recalled automatically from local SQLite mneme.db on Slice #2 without bloating Turn-1 prompt headers.

4. Adopting the 4-Layer Workflow Today#

Path Who It Serves How to Start
Open-Core CLI (nomos) Individual engineers, open-source maintainers, and builder teams running Claude Code, Cursor, Antigravity, OpenCode, or Aider Install the single Apache 2.0 Go binary via `curl -fsSL https://sophialabs.ca/install
SophiaLabs Sovereign High-leverage micro-teams scaling parallel autonomous execution Pair Open-Core nomos with the 5-Pillar Glass Cockpit, nomos code Tier 2 workers, and sovereign local GPU inference (Explore Nomos Sovereign).
Gantlett Systems 14-Day Seam Charter CTOs and VPs of Engineering onboarding greenfield builds or stabilizing high-friction brownfield monorepos (5 to 150+ engineers) Principal-led 14-calendar-day fixed-scope engagement distilling Layer 0 invariants, compiling Layer 1 boundaries, and shipping Layer 2/3 verified slices with 100% client-retained IP (Inspect the 14-Day Pilot Brief).
Ask Sophia Docs & Specs Sophia AI · Grounded Nomos Architecture & Docs Concierge