Skip to content
/

quint-code (Haft)

quint-code · m0n0x41d/quint-code · ★ 1.3k · last commit 2026-05-25

Governs AI agent execution through formal decision contracts, parity-enforced comparisons, evidence-decay scoring, and bounded WorkCommissions — ensuring agents operate within explicit invariants rather than ad-hoc prompts.

Best whenEngineering governance must be formalized as machine-readable contracts (not prompts), and agent autonomy must be explicitly bounded at the Choose → Execute …
Skip ifSilently fixing docs to match legacy behavior, Silently changing runtime to match spec without explicit migration
vs seeds
claude-flow(also multi-agent MCP), Haft is less orchestration-focused but far more rigorous in decision governance. Haft is the onl…
Primitive shape 17 total
Commands 9 Skills 1 MCP tools 7
00

Summary

quint-code (Haft) — Summary

quint-code is the historical repository name for Haft, a Go-based engineering governance system for AI-assisted software delivery. The repository (m0n0x41d/quint-code) contains the full Haft codebase — the binary is named haft and the GitHub organization has migrated branding to m0n0x41d/haft. Haft sits between human intent and agent execution: it frames problems, explores alternatives with diversity enforcement, records decisions as falsifiable contracts with invariants, and governs agent execution through bounded WorkCommissions. It ships a production MCP server (7 tools), a CLI harness (haft binary) with ~10 subcommands, an alpha TUI (haft agent), and an alpha desktop app (Tauri-based). The framework is explicitly built on FPF (First Principles Framework, also in this batch) — internal/fpf/ implements FPF quantities in Go. With 1,333 stars and 104 forks it is the highest-starred framework in this batch and one of the most architecturally sophisticated in the corpus. Compared to seeds, Haft is closest to taskmaster-ai (both use MCP as primary interface for structured project tracking) but adds formal engineering governance, decision contract management, and FPF-based evidence scoring that taskmaster-ai lacks.

01

Overview

quint-code (Haft) — Origin & Philosophy

Origin

Authored by m0n0x41d (Ivan Zakutnii). Repository originally named quint-code, renamed to haft during active development. The installed binary is haft; the install script URL still references the quint-code path for compatibility. v7 is the current production version (as of analysis date). Last commit May 2026. 1,333 stars, 104 forks, 4 contributors. License: NOASSERTION (custom license visible in LICENSE file).

Core Philosophy (verbatim from README)

"True harness engineering for AI-assisted software delivery."

"Your agents write code fast. Most repositories are not ready for serious harness engineering: the target system is underspecified, the enabling system is implicit, term maps are missing, and runtime evidence is detached from the spec. Haft makes the project harnessable before it scales execution."

"The handle between the tool and the hand — the part that turns raw capability into formal specification, governed decisions, bounded commissions, and evidence-backed engineering work."

"Specify → Think → Run → Govern."

Conceptual Framing

Haft explicitly distinguishes:

  • Target System: what the software does (target-system spec)
  • Enabling System: the agents, tools, and processes used to build it (enabling-system spec)
  • Term Map: shared vocabulary for the project
  • WorkCommission: bounded execution authority between a decision and a runtime run

FPF Dependency

Haft is built on FPF (First Principles Framework). The internal/fpf/ package implements FPF's formal constructs in Go:

  • R_eff (reliability score from evidence verdicts + decay)
  • Decision contracts with invariants and claims
  • Characteristic Space comparisons with parity enforcement
  • Evidence verdict taxonomy (supports/weakens/refutes/superseded)

Manifesto Quote on Agent Autonomy

"Agent may frame, explore, compare, and recommend when delegated. Agent must stop at Choose → Execute boundary and wait for human confirmation. Even in autonomous mode: one-way-door decisions require confirmation."

02

Architecture

quint-code (Haft) — Architecture

Distribution

Go binary (haft) distributed via install script. Also supports Claude Code (.mcp.json), Codex CLI (.codex/config.toml), and experimental Cursor/Gemini CLI/OpenCode.

Install

curl -fsSL https://raw.githubusercontent.com/m0n0x41d/haft/main/install.sh | bash

# Initialize per host agent:
haft init                    # Claude Code (default)
haft init --codex            # Codex CLI / Codex App
haft init --all              # Claude Code + Codex
haft init --local            # project-local commands
# Experimental:
haft init --cursor
haft init --gemini
haft init --opencode

Required Runtime

  • Go binary (pre-compiled for target platform)
  • SQLite (embedded via sqlc-generated queries)
  • Claude Code and/or Codex CLI for agent surfaces

Two Production Surfaces

Surface What it is Use
haft serve (MCP server) Embedded MCP plugin for agent interaction Reasoning, drafting, querying, creating commissions
haft harness (CLI) Operator/runtime surface prepare, run, status, result, apply, requeue, cancel

Alpha Surfaces (not production)

  • haft agent — TUI (blessed/ink-based)
  • Desktop app (Tauri, desktop-tauri/)

Directory Structure (source)

cmd/
├── haft/main.go     # main CLI entry point
└── indexer/         # codebase indexer
internal/
├── artifact/        # artifact CRUD
├── graph/           # knowledge graph
├── fpf/             # FPF formal constructs (R_eff, parity, etc.)
├── reff/            # R_eff computation engine
├── mcp/             # MCP server implementation
├── agentcore/       # agent core logic
├── workcommission/  # WorkCommission lifecycle
├── skills/          # agent skills
└── ...
spec/
├── AGENT_CONTRACT.md  # normative agent operating rules
├── WORKFLOW.md        # .haft/workflow.md schema
├── target-system/     # target system spec templates
└── enabling-system/   # enabling system spec templates
.haft/               # project-local artifact projections (derived, never edit)

State Storage

SQLite database (~/.haft/ or project-local). All .haft/*.md files are derived projections regenerated from SQLite on every artifact write — never edit directly.

v7 Supported Host-Agent Matrix

Tool MCP Config Commands/Prompts
Claude Code .mcp.json (project root) ~/.claude/commands/ or .claude/commands/ (local)
Codex CLI .codex/config.toml ~/.codex/prompts/ or local
03

Components

quint-code (Haft) — Components

MCP Tools (7 production tools)

Tool Purpose
haft_note Micro-decisions with validation + auto-expiry
haft_problem Frame problems, define comparison dimensions with roles
haft_solution Explore variants with diversity check, compare with parity
haft_decision Decision contract with invariants, claims, evidence, baseline lifecycle
haft_commission WorkCommission create/list/claim lifecycle for execution harnesses
haft_refresh Lifecycle management for all artifacts
haft_query Search, status dashboard, file-to-decision lookup, FPF spec search

CLI Commands (haft binary)

Command Purpose
`haft init [--codex --all
haft serve Start MCP server (production mode)
haft harness run [--prepare-only] Execute WorkCommissions via Open-Sleigh
haft harness status Inspect active/recent runs
haft harness result <wc-id> Inspect completed run and workspace diff
haft harness apply <wc-id> Apply workspace patch to current checkout
haft spec check [--json] Validate project spec files (L0/L1/L1.5 parsing)
haft run <dec-id> [--agent codex|claude] Execute a decision via agent
haft check Verify governance health
haft agent Launch TUI (alpha)

Slash Commands (installed into agent tools)

Command Purpose
/h-reason Full reasoning loop: frame → explore → compare → decide
/h-frame Frame a problem
/h-char Define comparison characteristics
/h-explore Generate diverse solution variants
/h-compare Fair parity comparison
/h-decide Engineering decision contract
/h-onboard Build target/enabling system spec and term map for new project
/h-commission Create WorkCommissions without starting execution
/h-verify Verify governance health (renamed from /q-refresh)

Spec Files (in spec/)

  • AGENT_CONTRACT.md — normative rules for agents editing the Haft codebase
  • WORKFLOW.md — schema for .haft/workflow.md (mode, require_decision, allow_autonomy)
  • target-system/ — target system spec templates
  • enabling-system/ — enabling system spec templates

Open-Sleigh

The open-sleigh submodule is the execution harness runtime that runs WorkCommissions as bounded agent jobs.

Derived Artifacts (.haft/)

  • workflow.md — project policy (human-edited)
  • specs/*.md — project spec carriers (human-edited via onboarding)
  • *.md projections — auto-regenerated from SQLite (never edit)
05

Prompts

quint-code (Haft) — Prompt Files

Excerpt 1: AGENT_CONTRACT.md — Authority Hierarchy (normative)

# Agent Operating Contract

> Normative rules for any agent (human or AI) editing the Haft codebase.
> This is the authority file. When code and spec diverge, follow these rules.

## Authority hierarchy
1. **This contract** — operating rules, always followed
2. **spec/** — intended semantics of Haft's target and enabling systems
3. **Implementation** — current runtime behavior

When spec and implementation diverge:
- Preserve runtime safety first
- Open or annotate the semantic mismatch
- Do NOT silently "fix" docs to match legacy behavior
- Do NOT silently change runtime to match spec without explicit migration

Technique: Constitutional authority chain — establishes a strict precedence: contract > spec > implementation. This is a formal governance pattern that prevents agents from making ad-hoc "fixes" that corrupt the spec's canonical meaning.

Excerpt 2: AGENT_CONTRACT.md — Decision Boundary

## Decision boundary
- Agent may frame, explore, compare, and recommend when delegated
- Agent must **stop at Choose → Execute boundary** and wait for human confirmation
- `selected_ref` from compare is advisory — not the decision
- Exception: autonomous mode explicitly enabled for the session
- Even in autonomous mode: one-way-door decisions require confirmation

Technique: Explicit autonomy boundary — the agent's permission to act is carved at the Choose → Execute boundary. This is FPF's admissibility principle implemented as a normative rule in the operating contract.

Excerpt 3: WORKFLOW.md — Project Policy Schema

## Defaults

```yaml
mode: standard        # tactical | standard | deep
require_decision: true
require_verify: true
allow_autonomy: false

Path Policies

- path: "internal/artifact/**"
  mode: standard
  require_decision: true
  require_verify: true
  allow_autonomy: false

**Technique**: **Policy-as-code with path scoping** — project-level and path-level agent behavior is declared in a YAML policy file that the MCP server reads at initialization. Agents inherit policy constraints rather than relying on prompt-level instructions.

## Excerpt 4: CLAUDE.md — Engineering Reasoning Pattern

From the project's CLAUDE.md for contributors:

```markdown
**Weakest Link Analysis:**
- What will break first in this design?
- What's the least reliable component?
- System reliability ≤ min(component reliabilities)

**Reversibility Check:**
- Can we undo this decision in 2 weeks?
- What's the cost of being wrong?
- Are we painting ourselves into a corner?

Technique: Structured reasoning checklist — FPF's Characteristic Space approach applied to engineering decisions: each decision must pass separation-of-concerns, weakest-link, explicitness, and reversibility checks before proceeding.

Prompting Techniques Summary

  1. Constitutional authority chain (AGENT_CONTRACT.md)
  2. Explicit autonomy boundary (Choose → Execute boundary)
  3. Policy-as-code (WORKFLOW.md YAML governs agent behavior)
  4. Structured reasoning checklist (separation of concerns, weakest link, reversibility)
  5. FPF evidence vocabulary (supports/weakens/refutes/superseded for evidence verdicts)
09

Uniqueness

quint-code (Haft) — Uniqueness & Positioning

differs_from_seeds

Closest seed is taskmaster-ai (both use MCP as primary agent interface, both maintain a SQLite/file-based project knowledge store, both can spawn agents for execution). But Haft differs fundamentally: where taskmaster-ai tracks tasks (flat task decomposition with dependency ordering), Haft tracks governed decisions (with invariants, parity-checked comparisons, evidence verdicts, R_eff decay, and WorkCommission lifecycle). Haft's governance layer means agents operate within formal contracts rather than merely a task queue. Against claude-flow (also MCP-anchored, also multi-agent), Haft is simpler in multi-agent orchestration but far more rigorous in decision governance. No other seed implements FPF's R_eff evidence scoring or parity enforcement.

Unique Positioning

Haft is the only framework in this corpus that:

  1. Implements FPF formally in Go (internal/fpf/)
  2. Uses R_eff (evidence decay scoring) as an artifact health metric
  3. Defines WorkCommission as a bounded execution authority between Decision and runtime
  4. Requires spec coverage (haft spec check) before broad execution is permitted
  5. Ships an explicit Choose → Execute autonomy boundary in a normative contract (AGENT_CONTRACT.md)
  6. Distinguishes Target System spec from Enabling System spec as separate governed documents
  7. Has three UI surfaces (CLI, TUI, Desktop) plus MCP

Note on Repository Identity

The repository m0n0x41d/quint-code contains the Haft codebase. All code refers to haft as the product name. Legacy terms (quint-code, quint_*, /q-*, .quint/) appear in comments and git history but the current product is Haft. The install script URL still references quint-code path for compatibility. Any analysis of this repo should treat it as Haft v7.

Observable Failure Modes

  1. Steep learning curve: FPF concepts (Characteristic Spaces, R_eff, WorkCommission) require investment to understand before using.
  2. Alpha surfaces: TUI and Desktop are explicitly not production-ready.
  3. Spec coverage blocking: needs_onboard guard blocks broad execution if onboarding was skipped — steep entry tax for existing projects.
  4. SQLite global state: ~/.haft/ is global; multi-project use requires careful isolation.
  5. Custom license: NOASSERTION license requires checking the actual LICENSE file before enterprise use.

Explicit Antipatterns (from AGENT_CONTRACT.md)

  • Silently "fixing" docs to match legacy behavior
  • Silently changing runtime to match spec without explicit migration
  • Editing .haft/*.md projection files directly
  • Executing broadly without haft spec check passing
  • Modifying existing database migrations (append-only)
04

Workflow

quint-code (Haft) — Workflow

Primary Workflow: Specify → Think → Run → Govern

Phase 1: Onboard / Specify

haft init [--codex | --all | ...]     # Install host-agent integration
# Then in agent:
/h-onboard                            # Build target-system spec, enabling-system spec, term map
haft spec check                       # Validate spec structure (L0/L1/L1.5)

Artifact: .haft/specs/*.md (target-system spec, enabling-system spec), .haft/workflow.md

Phase 2: Think (Reason)

/h-reason "redesign the caching layer"   # Full reasoning loop
# OR step-by-step:
/h-frame → /h-char → /h-explore → /h-compare → /h-decide

Artifact: Note, Problem, Solution, Decision records in SQLite → projected to .haft/*.md

Phase 3: Run (Execute)

haft run dec-20260414-001 [--agent codex|claude]
# Reads decision → builds prompt → spawns agent → baseline snapshot

Artifact: Code changes + baseline snapshot

Phase 4: Govern

haft check                       # Governance health
haft harness status              # Active runs
haft harness result <wc-id>      # Inspect completed run
haft harness apply <wc-id>       # Apply workspace patch

Approval Gates

Gate Type Description
Choose → Execute boundary typed-confirm Agent must stop before execution; human must authorize
One-way-door decisions typed-confirm Even in autonomous mode, irreversible decisions require confirmation
needs_onboard guard typed-confirm Broad harness execution blocked if spec coverage insufficient; --force-skip-specs required with reason
Spec validation (L0/L1/L1.5) typed-confirm haft spec check fails if required fields missing

.haft/workflow.md Policy

Project-scoped file controlling agent behavior:

mode: standard        # tactical | standard | deep
require_decision: true
require_verify: true
allow_autonomy: false

Path-scoped overrides possible. Autonomy envelope is explicit per path.

06

Memory Context

quint-code (Haft) — Memory & Context

Primary State Storage

SQLite database at ~/.haft/ (global) or project-local path.

Artifact Types in SQLite

  • Notes (micro-decisions with auto-expiry)
  • Problems (framing + comparison dimensions)
  • Solutions (variants with diversity check results)
  • Decisions (contracts with invariants, claims, evidence)
  • WorkCommissions (bounded execution authorities)
  • Evidence verdicts (supports/weakens/refutes/superseded)
  • Spec section coverage graph

Derived Markdown Projections

.haft/*.md files are regenerated from SQLite on every artifact write:

  • Never edit directly — they are read-only views
  • Used as human-readable summaries of the knowledge graph

Project Spec Files (.haft/specs/)

  • *.md spec carriers with fenced YAML spec-section blocks
  • Human-edited (via /h-onboard or manually)
  • Required structural fields validated by haft spec check

.haft/workflow.md — Project Policy

Human-edited. Governs agent mode (tactical/standard/deep), require_decision, require_verify, allow_autonomy per path.

Cross-Session Handoff

Yes — full cross-session persistence via SQLite. haft_query provides session-start context loading (status dashboard, file-to-decision lookup).

Context Compaction

Yes — MCP server prepends Intent + Defaults from workflow.md to agent system prompt at startup; this is the compaction/initialization mechanism.

Evidence Decay

R_eff decreases over time as evidence ages. haft_refresh manages lifecycle: artifacts past their freshness window get flagged as stale.

Memory Type

SQLite + file-based projections.

Search Mechanism

haft_query implements FPF spec search, file-to-decision lookup, and status dashboard queries against the SQLite knowledge graph.

07

Orchestration

quint-code (Haft) — Orchestration

Multi-Agent

Yes. haft harness run spawns agents (Codex or Claude) as WorkCommissions. The harness creates bounded execution authorities and starts Open-Sleigh to run them.

Orchestration Pattern

Hierarchical — CLI operator creates WorkCommissions, then spawns agent workers with bounded scope from the parent Decision record.

Execution Mode

Hybrid: haft serve (MCP plugin, event-driven) + haft harness run (one-shot execution per run command).

Isolation Mechanism

WorkCommission isolation — each commission has declared scope (affected files, invariants, claims). Open-Sleigh creates a workspace context per commission. No git-worktree isolation visible in docs, but workspace diff is tracked per commission.

Multi-Model

Yes (v7 supported): Claude Code or Codex CLI as execution agents. Selection via --agent codex|claude in haft run.

Model Role Mapping

Role Model
Reasoning / MCP interaction Claude Code (primary)
Execution agent Claude Code or Codex CLI (selectable)

Consensus Mechanism

None in the distributed systems sense. Parity enforcement (from FPF A.17–A.19) ensures comparisons are admissible before decision, but this is not a runtime consensus protocol.

Auto-Validators

  • haft spec check — L0/L1/L1.5 spec structure validation (deterministic parser, no LLM)
  • haft check — governance health check
  • require_verify in workflow policy — enforces verification before completion

TDD Enforcement

No explicit TDD enforcement. Invariants in Decision contracts serve as post-execution verification criteria.

Git Automation

No automatic commits. haft harness apply <wc-id> applies workspace patch to checkout (manual trigger).

Prompt Chaining

Yes — the MCP server exposes haft_query for file-to-decision lookup, so agents can retrieve their governing Decision contract at task start and use its invariants as prompt constraints.

Cross-Tool Portability

Medium. v7 production: Claude Code + Codex CLI. Experimental: Cursor, Gemini CLI, OpenCode, JetBrains Air.

08

Ui Cli Surface

quint-code (Haft) — UI & CLI Surface

CLI Binary

  • Name: haft (formerly quint-code/quint)
  • Type: Dedicated CLI (Go binary)
  • Install: curl -fsSL https://raw.githubusercontent.com/m0n0x41d/haft/main/install.sh | bash
  • Not a thin wrapper — contains full FPF-based knowledge graph

CLI Subcommands

haft init [flags]           # Set up host-agent integration
haft serve                  # Start MCP server
haft run <dec-id>           # Execute a decision via agent
haft check                  # Governance health check
haft spec check [--json]    # Spec structure validation
haft harness run            # Execute WorkCommissions
haft harness status         # Check run status
haft harness result <id>    # Inspect run result + diff
haft harness apply <id>     # Apply workspace patch
haft agent                  # TUI (alpha)

MCP Server (haft serve)

  • 7 production tools
  • Protocol: stdio
  • Config: .mcp.json (Claude Code) or .codex/config.toml (Codex)

TUI (haft agent) — ALPHA

  • Built with tui/ package
  • Status: not part of v7 production envelope
  • Not recommended for production use

Desktop App — ALPHA

  • desktop-tauri/ — Tauri-based desktop app
  • Status: alpha, not part of v7 production envelope

Observability

  • haft check — governance health dashboard
  • haft spec check — spec structure report
  • haft harness status — active/recent execution runs
  • haft_query MCP tool — status dashboard, search, file-to-decision lookup
  • .haft/*.md projections — human-readable knowledge graph state

IDE Integration

  • Claude Code: .mcp.json + ~/.claude/commands/
  • Codex CLI: .codex/config.toml + ~/.codex/prompts/
  • Experimental: Cursor (.cursor/mcp.json), Gemini CLI, OpenCode, JetBrains Air

Related frameworks

same archetype · same primary tool · same memory type

claude-mem (thedotmack) ★ 78k

Background worker service captures every tool call as an observation, AI-compresses sessions, and auto-injects relevant past…

pi (badlogic/earendil) ★ 55k

A minimal, hackable, multi-provider terminal coding agent that adapts to your workflows via npm-installable TypeScript Extensions…

Agent Skills (Addy Osmani) ★ 46k

Encodes senior-engineer software development lifecycle as 23 auto-routed skills and 7 slash commands for any AI coding agent.

wshobson/agents Plugin Marketplace ★ 36k

Single Markdown source for 83 domain-specialized plugins that auto-generates idiomatic artifacts for five AI coding harnesses.

TabbyML/Tabby ★ 34k

Self-hosted AI coding assistant server (alternative to GitHub Copilot) with admin dashboard, RAG-based completions, and multi-IDE…

Compound Engineering ★ 17k

Make each unit of engineering work compound into easier future work via brainstorm→plan→execute→review→learn cycles.