ADR-0004: Spec/Blueprint authoring pillar — tiered, graph-grounded, check-gated

StateAccepted
Architectural SignificanceHIGH
DomainDeveloper Tooling
Document version1.0

Reference

Governs the authoring pillar (roteiro spec, Stage 13) of ADR-0001 — the "spec-store v2" intent-confirmation front door ADR-0001 always envisioned but left as a stub. Extends the tiered, offline-first model machinery decided in ADR-0003 from embedding to generative models. See docs/history/BUILD_PLAN.md Stage 13.

Summary

Make roteiro spec the front door for authoring intent — house-style ADRs/blueprints and a graph-grounded build/deploy plan — structured by GitHub spec-kit's phase discipline (constitution → specify → clarify → plan → tasks) but rendered in Roteiro's house ADR/blueprint style, not spec-kit's own format.

Two invariants make it trustworthy rather than a hallucination engine:

  1. Graph-grounded. Every generated artifact references real nodes from the store — existing symbols, ADRs, dependencies, and prior intent — assembled deterministically by the tool. Generated plans cannot cite code that does not exist.
  2. Check-gated. Output is only "done" once roteiro check validates its [[links]] / @rto: against the graph. Authoring produces authored facts; the drift gate keeps them honest.

Generation is tiered, mirroring inference (ADR-0003), so it degrades gracefully with no model and no network:

Agent-vs-tool boundary: the tool owns everything deterministic and verifiable — graph-grounded context assembly, house-style skeletons, build-plan outlines from real facts, and the check gate. Prose is delegated — to a local model (Tiers 1–2) or the agent (Tier 3) — and always flows back through the tool's check gate before it counts. The tool never emits unlabelled or ungrounded intent.

Context

ADR-0001 chose Roteiro over the three-tool stack partly on the strength of spec-store's pre-coding interview — the flow that confirms user intent before specs are written — and our house ADR/blueprint discipline. Both were named as the parts "nobody ships." Yet roteiro spec remains a bail! stub: the graph, the authored layer, check, and the inference tiers all exist, but the front door that produces new intent does not.

Four forces to reconcile:

  1. Offline-by-default & lean binary (ADR-0001). Authoring must work with no model and no network; any generative model is opt-in and local, never an API call. The default roteiro binary must not grow.
  2. Correctness over fluency. A generated plan that references a symbol or ADR that does not exist is worse than none — it launders hallucination as intent. Grounding in the graph and gating on check is what separates this from a chatbot. (ADR-0001's "precise-where-known" principle.)
  3. Low-power local generation (project directive). Light-mode drafting must run on modest local hardware, exactly as the inference default does — not require a foundation model. This is a generative sibling of ADR-0003's embedding tiers.
  4. House style, not spec-kit's format. spec-kit's phase discipline is worth adopting, but its markdown conventions conflict with the house ADR/blueprint style — the same conflict that led ADR-0001 to reject adopting lat.md's format wholesale. We take spec-kit's phases; we render in the house style.

spec-kit phase → Roteiro artifact mapping:

spec-kit phaseRoteiro artifactGrounding
constitutionhouse principles/invariants (ADR-0001 §1)already exists; new work is checked against it
specifyhouse ADR / blueprint ("what & why")authored nodes; symbol/ADR [[links]]
clarifythe intent interview (spec-store's front door)graph-aware — surfaces related ADRs/symbols to prevent duplication
plangraph-grounded build/deploy planreferences real symbols/deps; check-gated like BUILD_PLAN.md
tasksa task outline derived from the planoptionally linked to intent-debt markers (Stage 15)

Decision makers

Option 4 — tiered, graph-grounded, house-style, check-gated authoring (recommended).

Options considered + consequences

Option 1: Agent-only — the agent writes ADRs freehand

Option 2: Tool-only — deterministic templates, no prose ever

Option 3: Adopt spec-kit as-is (its CLI and markdown format)

Consequences

Advice Received

Project direction incorporated above: light-mode generation must run offline on low-power local hardware (a generative sibling of the ADR-0003 inference default), not require a foundation model; and the tool must keep deterministic, verifiable work (grounding, scaffolding, check) separate from delegated prose.

Document version history

VersionDateNotes
0.12026-08-09For Review. Tiered (0: offline scaffold → 1: local GGUF instruct → 2: larger local → 3: agent), graph-grounded, house-style, check-gated authoring pillar; spec-kit phases mapped to house artifacts; generative tier extends ADR-0003's registry/consent/candle machinery; agent-vs-tool boundary defined.
1.02026-08-09Accepted. Tier 0 implementation began with roteiro spec context (graph-grounded context assembly, no model).