The NLP Systems Stack
An editorial walkthrough of the layers bridging unstructured 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.
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.