01
Typed IR + validate
Broken or incomplete context is rejected before a single token is generated.
validate(ir) → ok
// a typed context language
Write context as a typed tree. Lint it. Compress it. Validate it. Emit a grounded pack. Short and deterministic input, checked before inference instead of after the hallucination.
$ tc emit task.tc --budget 8k▌
status: hypothesis. No implementation, no benchmark yet. Syntax and numbers on this page are illustrative.
raw window · 38,412 tok
tools[42].schema = {…}
history[0..118] …
mcp.search_all() → 9 files
auth/refresh.go (full, 812 L)
"also, be concise" ← in evidence
ref → spec#retry ✗ cut
ts=16:47:03 prefix drift
…lost in the middle…
typed pack · 5,960 tok
pack fix_refresh : Pack {
instruction goal
evidence src : Code.sig
@ auth/refresh.go#L12-48
evidence spec : Doc.excerpt
@ docs/auth.md §3.2
ref spec → src
}
01 — The harness today
Dynamic discovery helps strong models. For small and local LLMs "go find it yourself" usually breaks. They need an assembled, checked pack.
MCP schemas, tools and history eat the budget before the task arrives.
The fact that matters sits between two thousand that don't.
A drifting prefix invalidates the cache on every call.
Small models blur the order with the material it refers to.
Without sources, confident text is indistinguishable from invention.
Nobody can say exactly what went into the model.
02 — Built for local LLMs
Five checks on the way in. The model gets less to read, and every line of it is typed.
01
Broken or incomplete context is rejected before a single token is generated.
validate(ir) → ok
02
The model never points at something that was trimmed away.
refs: 0 dangling
03
Signatures and types instead of raw code, so the pack fits in 4–8k.
812 L → Code.sig
04
A hard wall between what to do and what to read. No orders hiding in the material.
kind: instruction | evidence
05
A Context Runtime pack where every piece names its source. E-E-A-T for a small model.
@ file#L12-48 · sha256
03 — Honest boundaries
TypeContext does not replace retrieval or Context Runtime, and it does not fix model weights. It makes the input deterministic and short.
Not proven yet
This is a concept, not a result. It counts as proven only if, on the same tasks and the same small or local models, typed packs beat raw or retrieved context on accuracy and grounding, fit 4–8k without losing needed facts, and actually improve prompt-cache hits. If not, the idea gets narrowed or dropped.