CRUX / BLOG

Notes from the harness

Engineering deep-dives, release notes, and the occasional opinion — from the team building the blocks around the model call.

RSS ↗
ecosystem ·comparison ·harness ·
// ecosystem
EssayJul 16, 2026

Where a harness layer fits: AI SDK, LangChain, Mastra, and Crux

The TypeScript AI stack is usually framed as a framework choice. A harness layer is a different axis: it composes over the SDK you already picked. An honest map of what each tool owns, and when you'd add (or skip) Crux.

HS8 min
safety ·guardrails ·security ·
fn safety()
EngineeringJul 13, 2026

Guardrails that compose: practical LLM safety boundaries in TypeScript

Prompt injection can't be solved with a wrapper function and a regex. Model safety as typed boundaries (input, output, tool calls, memory writes) with declared actions, streaming semantics, and evidence for every decision.

HS9 min
routing ·cost ·quality ·
fn routing()
EngineeringJul 8, 2026

Cut your AI bill with a routing policy you can prove

Vendors promise 40–85% savings from model routing. The claims are plausible, and unverifiable without two things most routing setups lack: a declared policy and a receipt per request.

HS9 min
retrieval ·rag ·freshness ·
fn retrieval()
EngineeringJul 3, 2026

The RAG freshness problem is a harness problem

Vector similarity has no concept of time: a stale chunk at 0.92 outranks the current one at 0.87, every time. Why freshness can't be fixed inside the index, and what it looks like as a first-class, testable property of the turn.

HS8 min
routing ·quality ·migration ·
fn routing()
EngineeringJun 30, 2026

Shipping a model migration without breaking production

Every model deprecation email starts the same fire drill. A migration playbook built on baselines, side-by-side variants, provider adaptations, and canary splits, so 'upgrade the model' becomes a reviewable change.

HS9 min
context ·token-budget ·debugging ·
fn context()
EngineeringJun 24, 2026

Silent truncation: the context your model never saw

When a prompt outgrows its budget, something gets cut, and most stacks cut silently. What actually gets dropped, why 'lost instructions' bugs are so hard to diagnose, and how to make dropping a declared policy.

HS8 min
evals ·testing ·ci ·
fn evals()
EngineeringJun 18, 2026

Test the harness, not just the output

Output evals tell you that something regressed. They can't tell you what. Assert what your harness did (context decisions, routing, freshness) and CI starts failing with causes instead of symptoms.

HS9 min
context ·philosophy ·testing ·
// context
EssayJun 15, 2026

Context engineering is missing correctness

The discipline taught us to curate what the model sees. It never gave us a way to verify the curation. That second half is where production reliability actually lives.

HS7 min
memory ·ai-sdk ·tutorial ·
fn memory()
EngineeringJun 9, 2026

Adding memory to the Vercel AI SDK

The AI SDK deliberately leaves memory open. How to add typed, budgeted, observable memory to an AI SDK app: recent messages, working state, and long-term facts, without switching frameworks.

HS9 min
observability ·debugging ·devtools ·
fn observability()
EngineeringJun 4, 2026

What did the model actually see? Anatomy of a bad AI answer

A debugging walkthrough of one bad model turn: from wrong answer, to the context that never made it into the prompt, to a regression test that keeps it fixed.

HS8 min