ADR 0023: Static goal-contract + run-plan emitter

Field Value
Status Accepted
Date 2026-06-01
Deciders Project maintainers
Supersedes
Superseded by
Related ADRs ADR-0021 (task-quality-score), ADR-0014 (ProjectContext)

Summary

@aidokit/core gains buildGoalContract(briefMarkdown), a pure, deterministic function that extracts a goal contract from a task brief: an objective, the set of allowed files, the runnable validation commands, and a fixed set of stop rules. It returns a markdown string and makes zero model calls.

The CLI gains aidokit goal draft <id|path> (writes agent-artifacts/goals/<id>-goal.md) and aidokit goal plan <id|path> (writes agent-artifacts/goals/<id>-plan.sh, a commented run-plan shell script). The plan script is documentation: it enumerates the steps (draft goal → run YOUR adapter manually → aidokit evalaidokit verify → human review) and never invokes a model itself.


Context

Two pain points (#1 goal drift, #2 unbounded scope) share a root cause: the agent starts work without a written, checkable contract for what "done" means and which files it may touch. Teams want a single artifact that pins the objective, bounds the blast radius, and lists the exact commands that decide pass/fail — produced before any model runs, so it can be reviewed up front.

aidokit already has the raw material:

What was missing was a deterministic step that consolidates these into one contract artifact and a documented, model-free run plan around it. Per the permanent non-goal (CLAUDE.md §11, ROADMAP §Non-goals), aidokit must not call a model — so the "run the adapter" step is a manual placeholder, not automation.


Decision

1. buildGoalContract(briefMarkdown): string in @aidokit/core

A pure function (and a structured extractGoalContract companion returning GoalContract) that statically extracts:

No regexless parsing, no model, no I/O. Missing sections render guidance placeholders rather than failing.

2. aidokit goal draft <id|path>

Resolves the brief like aidokit eval / aidokit task score (bare id → agent-artifacts/task-briefs/<id>.md; path-looking value relative to root; --brief <path> override), builds the contract, and writes agent-artifacts/goals/<id>-goal.md.

3. aidokit goal plan <id|path>

Writes agent-artifacts/goals/<id>-plan.sh — a commented bash script that documents the workflow steps and ends with an echo. Every actionable line is a comment the human un-comments and runs. The adapter step is explicitly manual: the script never calls a model.


Consequences

Positive

Negative

Neutral


Alternatives considered


Validation

This decision is validated when:


References