AI harness pipeline — chain contract, progressive disclosure, DoD gates
AI harness pipeline — chain contract, progressive disclosure, DoD gates
The delivery pipeline is itself a product: two pipeline skills (feature-analysis, development) ride a chain contract — every SKILL.md declares what it consumes, what it produces, its gate, and the next step. Context is progressively disclosed per step; quantitative DoD measures live in one place; human interaction is bunched and asynchronous.
Problem it solves
- Multi-step AI delivery drifts: context bloat between steps, unmeasured quality, drip-fed questions that babysit the user. The harness makes the pipeline inspectable (each step's contract is data) and the human burden minimal by design.
Shape
- Pipeline skills:
pipeline/skills/feature-analysis(collect → refine → prioritise → allocate → issue file inissues/) andpipeline/skills/development(design → build → store → verify → deploy → secure). One directory per step, one SKILL.md playbook each. - Chain contract: every step declares
consumes / produces / gate / next— the hand-off is explicit, machine-checkable, and resumable. - Progressive disclosure:
machine/harness.dslis always-on (the harness's own KB); each step loads only its SKILL.md + declaredpre-read:files. Same T0→T3 discipline as the knowledge base (kb:kb-retrieval-token-budget). - Definition of Done (
issues/definition-of-done.md): the flow of skill steps + quantitative outcome measures; each skill lists the measures it owns — quality is measured per step, not vibes at the end. - Tone/goals (
TONE.md): minimise bot-sitting (user answers, never watches) and end-user fatigue (few interactions, business language only, no jargon); questions batch across sub-steps and issues into one async Q/A set (fillable PDF or Q&A session) that feeds back so flow resumes (issues/async-questioning.md). - Hook gates (
hooks/modules/):dod_gate.pyanddsl_drift.pyrun as PreToolUse hooks with per-agent adapters (hooks/adapters/claude.settings.json,devin.hooks.v1.json) — the DoD and DSL drift checks fire automatically, not by memory. - Issue files (
issues/): async-questioning, definition-of-done, linear-seam, looper — the pipeline's durable state lives in files, not chat.
Rules
- Every pipeline step declares consumes/produces/gate/next — no implicit hand-offs.
- Questions to the human are bunched and async; the AI does everything it can between touchpoints.
- User-facing language is business language — if a question can't be asked in business terms, the AI isn't ready to ask it.
- DoD measures are quantitative and owned per step; the loop (
looper.md) repeats until measures pass. - Gates run as hooks with per-agent adapters — enforcement is mechanical, not remembered.
- Pipeline state lives in issue files — resumable across sessions and agents.
Anti-patterns
- Steps that produce undocumented outputs (next step guesses).
- Drip-fed questions — one question per turn babysits the user.
- Jargon in user-facing questions.
- Quality checked only at the end (no per-step measures).
- Gates that depend on the agent remembering to run them (hooks exist for this).
- State kept in chat instead of issue files (lost on session end).
Sources
- factory/ai-harness/pipeline/README.md, pipeline/skills/{feature-analysis,development}
- factory/ai-harness/issues/{definition-of-done,async-questioning,linear-seam,looper}.md
- factory/ai-harness/TONE.md, machine/harness.dsl
- factory/ai-harness/hooks/modules/{dod_gate.py,dsl_drift.py}, hooks/adapters/
- knowledge-base/factory/build-process.md