ARCHITECTURAL DESIGN

The NLP Systems Stack

An walkthrough of the layers bridging human intent and deterministic software execution.

The Seven Layers of Alignment

Prompt engineering alone is insufficient to build production systems. Under the Sans Serif operating model, a prompt is merely the topmost layer of an integrated system stack designed to ensure verification, safety, and correctness.

LAYERPURPOSE / BOUNDARY
07. Governance / HITLHuman approvals and check promotion gates
06. Execution LedgerImmutable local operation logs (ledger.jsonl)
05. Guided LoopsSelf-correction and validation feedback steps
04. Workflow EngineJob-pack contracts (Input ➔ Normalize ➔ Map)
03. Evaluation HarnessRubric scoring and local assertion testing
02. Context ArchitectureWorkspace context-packing (XML tree structure)
01. Prompt InterfaceStructured schemas, typings, and JSON contracts

Layer Details

01. Prompt & Context Layers

At the foundation, prompts are not essays. They are structured contracts containing explicit output schemas (e.g., JSON schemas) and workspace file listings. The workspace context is filtered, pruned, and injected dynamically to prevent context overflow or model confusion.

02. Harness & Evaluation Layers

Once an LLM execution is triggered, the output must be validated against automated unit assertions. We score responses using programmatic rubrics (e.g., verifying Markdown structure, matching AST nodes, checking file paths, testing compilation status) before the loop continues.

03. Guided Loop & Ledger Layers

If evaluations identify a failure, the loop does not fail silently. The system feeds the error back to the model with context to trigger self-correction. Every cycle, change, and approval is logged to an immutable local ledger file (`ledger.jsonl`) to ensure full auditability.

04. Governance / Human-in-the-Loop

High-risk modifications (such as system re-routing, stylesheet changes, or third-party package configurations) require manual verification. The system creates interactive checklists for human review, holding changes at a gate until explicit approval is registered.