Digital Assistant Infrastructure

AI Engineer building
his own Digital Assistant

We're not building a thousand different things. We're building one thing — a single digital assistant that knows you, works for you, gets better over time. Everything else is plumbing. The unlock this year wasn't smarter models. It was the scaffolding around them.

3Layers
8Harnesses
277Workflows
266Prompt-patterns

The bet

Three layers carry the load.

When wrong output costs you, harness it. When wrong output is the variance you want, structure it via a skill workflow. Free-form prompts are for one-offs only. Karpathy called the math: agentic reliability is a march from 90% to 99% to 99.9%, each nine costing proportionally more engineering. Stanford put a number on it: a 6× capability gap between identical models in different harness shapes. Schmid named the move — the harness IS the operating system, the model is the runtime.

Layer 1 · Pattern Engineering

Harness engineering is the load-bearing variable.

DAI ships at every determinism level on a single dial: free-form prompt → skill workflow → harness. Every DAI session runs in a 7-phase meta-harness — the Algorithm v3.7.0 — with mechanical gates (ISC count, contradiction, plan-review, decisions, verification) and a PRD-as-system-of-record. The 8 fixed-plan harnesses run inside its phases. Same discipline at three scales: session, workflow, cognition.

Algorithm v3.7.0 — the meta-harness

7-phase OBSERVE→THINK→PLAN→BUILD→EXECUTE→VERIFY→LEARN contract. ISC + contradiction + plan-review + decisions + verification gates. PRD-as-record. Every DAI session runs in this.

Meta-harnessKarpathy nines · Schmid OS
1Meta-harness
9Fixed-plan harnesses
277Skill workflows
4Canonical patterns

The Loop — every automation engagement runs it

AUDIT → DIAGRAM → BUILD → DELIVER. Outer phases compose the fleet of fixed-plan harnesses; each cycle adds atoms; the cost of automation N+1 falls toward zero. Three witnesses to date: Speed-to-Lead (cycle-1), PAI self-witness (cycle-2, AUDIT/BUILD decoupling discovered), lwao outside-input (cycle-3, fleet 7 → 9, composition discipline codified).

4-map meta-harness: AUDIT (work-audit, url-to-kn ingest, outside-source-audit candidate) → DIAGRAM (FOLD into fixed-plan-harness-template and kn-to-action blueprint) → BUILD (9 fleet harnesses cumulative: work-audit, url-to-kn, kn-to-action, session-wrapup, narrativ-refactor, beads-sync, hook-authoring, web-search, competitor-research) → DELIVER (session-wrapup, narrativ-refactor, project-library entry, kn entry). Three witnesses: Speed-to-Lead, PAI self 9py, lwao outside-input.
The 4-map meta-harness · slot statuses: REAL · FOLD ×2 · conditional · FOLD composition · revised after cycle-2 (AUDIT/BUILD decoupling)

Building blocks

work-audit

Scores repeated activities (V×T×S×E×X) to identify what to harness next. Cycle-2 self-witness ran 2026-04-27 on DAI's own engineering work.

Fixed-plan harness

TreeOfThoughts

Skill workflow — branches 3-5 viable architectural paths and scores them. This site's architecture was locked through a TreeOfThoughts firing.

Skill workflow

narrativ-refactor

Token-substitution cascade across mj-deving/* portfolio surfaces. Eats its own dog food — propagates v6→v7 narrative shifts via a harness, not by hand.

Fixed-plan harness

fixed-plan-harness-template

The doctrine for new harnesses — 4-section phase blocks (Input · Action · Validation gate · Output artifact). Sibling pattern to V5 anatomy + best-path-routing.

Canonical pattern

Production exemplars

Layer 2 · Context Engineering

Engineer the full lifecycle, not the prompt.

In 2023 everyone wanted to be a prompt engineer. Three years in, that whole discipline looks quaint. It was a hack against stateless models with nothing to work with — you compensated for missing context by stuffing the prompt. The actual leverage was never in the prompt. It was always in the context pipeline behind it. DAI doesn't have a context window — it engineers the full context lifecycle.

⚠ Provisional taxonomy — pending Tier-1 Anthropic-official validation

Four-carving context taxonomy

A primitive lives in multiple lenses simultaneously. Driver (hook · user · model · harness) × Scope (per-session · cross-session · cross-project · global) × Direction (write · read) × Abstraction (file · state · behavioral · cognitive · organizational).

Context taxonomy
39Hooks
9Event types
105kn entries
45bd memories

Building blocks

kn-to-action

kn bundle → telos-score / propose-beads / distill / blueprint. The substrate-to-action pipe; 4 modes routed quality-first.

Fixed-plan harness

session-wrapup

5-phase session close: deltas · bd ops · commits · health · handoff. Ships in one harnessed pass instead of improvised end-of-session.

Fixed-plan harness

/cs context-search

9-source aggregator across history.jsonl + git logs + project memories + work.json + MEMORY/WORK PRDs + session-names + PRD content + kn entries.

Slash command

PRDSync hook

Frontmatter ↔ work.json sync. Read-only invariant that makes PRD-as-system-of-record reliable. One of 39 hooks across 9 event types.

Hook · PostToolUse

Layer 3 · Prompt Engineering

Doctrine + library + routing.

A prompt is an API call. The thin request. Everything interesting happens before it. Layer 3 is therefore both halves: a shape doctrine for new prompts when none of the existing ones fit (V5 anatomy — 8 named slots, cacheable-above / dynamic-below), and a standard library of 266 production-grade prompt-patterns ready to fire with a routing layer to find the right one in seconds.

V5 anatomy — the canonical shape

8 named XML slots: task_context · tone · schema · examples · input_content · instructions · reminders · output_format. Cacheable-above / dynamic-below preserves prefix-match cache hits across runs.

Canonical patternAnthropic V5
8V5 slots
266Prompt-patterns
9Routing skills
4/6V5 callsites live

System map

Show me the file → it's there.

Geometry is the argument. Three rows = three layers. Three columns = primitives, compositions, cross-cuts. The Algorithm spans the top because every DAI session runs in it. Public cells link to source; private ones describe what's there until they're exposed.

Algorithm v3.7.0 · The meta-harness — every DAI session runs in this 7 phases · ISC + 5 mechanical gates · PRD as system of record
Algorithm v3.7.0 flow: Request → PRD stub → OBSERVE → ISC count gate → contradiction gate → THINK → PLAN → plan review gate → BUILD → Decisions gate → EXECUTE → VERIFY → Verification gate → LEARN → complete.
Process flow · gates fire on Advanced+ effort tiers

L1 · Pattern

8 harnesseswork-audit · session-wrapup · …
4 patternsfixed-plan · best-path · V5 · concept
2 meta-patternsopportunity-map · knowledge-arc

L2 · Context

39 hooks9 event types · AuditTrail · PRDSync · …
CLAUDE.md hierarchyglobal → project → directory
16 specialist agentsArchitect · Engineer · Plan · …
105 kn entriessubstrate that compounds across sessions
Weekly audit cyclescycle-3 wired Fri 2026-05-01

L3 · Prompt

V5 anatomy8 named XML slots · cache-friendly
helper extract79 LOC bash 3.2 portable
Injection-bait fixPWNED=0 · prove the hardening

Proof

Numbers, not adjectives.

The 4-phase Opportunity-Map ran end-to-end on DAI's own weekly engineering audit on 2026-04-27. Cron wired Friday 07:00 UTC for cycle-3. Self-reference is the strongest proof of the engineering claim: show me the audit doc → it's there. Show me the cron → it's wired. Show me last Friday → it ran.

773Closed beads
6,806Prompts (cycle-2)
42/42Mechanical checks
4,010+Tests across portfolio