Kenshiki Labs

L0 — Compilation

Compiler

Constrains what gets asked. CFPO (Content-Format-Policy-Output) prompt compilation with deterministic zone ordering, evidence-to-zone mapping, audited prompts.

The Compiler is the L0 compilation layer that turns a governed query into a structured CFPO prompt — Content, Format, Policy, Output zones with deterministic ordering and evidence-to-zone mapping. The compiler enforces per-zone invariants, attaches provenance to every retrieved chunk, and emits a compiler-trace that the Claim Ledger uses to verify each generated claim against the prompt zone that authorized it.

Without this: the model receives prompts that reward hallucination. Evidence gets buried by recency bias, authority signals are lost in unstructured context, and post-generation scoring catches failures too late to prevent them.

How Compiler turns bounded evidence into a prompt contract

Read this left to right from the Kura handoff. Bounded evidence and caller intent enter together, the Compiler sorts them into CFPO structure, isolates authority boundaries, and emits a versioned prompt contract for Kadai runtime. Compiler stops at that contract. It does not retrieve evidence, verify claims, or assign output states.

Compiler Prompt Assembly Lifecycle
Bounded evidence and caller intent enter together, then the Compiler rewrites them into a controlled prompt contract before generation begins.
Step 1 of 4Receive
Step 2 of 4Classify
Step 3 of 4Isolate
Step 4 of 4Assemble
Every Compiler Run Produces

CFPO ordering model

Places content by function and relevance, matching known attention behavior instead of appending retrieval chunks as an undifferentiated block.

  • Content: domain framing and system context (early context)
  • Format: reference structures and definitions (mid context)
  • Policy: grounding and authority constraints (late context)
  • Output: response contract and output schema (final context)

Who this is for

Platform runtime

runs automatically on every inference request — no manual prompt engineering required.

The inference pipeline

every governed request passes through Compiler before generation. Ledger consumes compiler telemetry for attribution.

Compiler — the prompt-assembly engine — constrains what gets asked before the model sees anything. Bounded evidence from Kura — the governed evidence store — is structured into CFPO zones — Content, Format, Policy, Output — so the resulting query stays disciplined and evidence-grounded. Ledger — the integrity-protected inference audit trail — evaluates outputs downstream.