Metadata-Version: 2.5
Name: buildbard
Version: 1.22.0
Summary: Buildbard CLI — spec-driven TDD orchestrator (deviatdd rewrite)
Requires-Python: >=3.13
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.12
Description-Content-Type: text/markdown

![buildbard](buildbard.svg)

# buildbard

Spec-driven TDD orchestrator. Python CLI (`buildbard` / `bard`).

## Setup

```sh
mise run setup
```

## Use

```sh
mise run dev          # CLI help
mise run check        # lint + format-check
mise run test         # unit tests
mise run verify       # CLI + integration behavior checks
```

## Where the contract lives

- `specs/constitution.md` — invariants, execution interface, phase write boundaries.
- `docs/09-data-model.md` — durable state and JSONL schemas.
- `docs/11-error-taxonomy.md` — halt tokens and their recovery.

`specs/` is the specification record: epics, PRDs, issues, and the ledger. Older epics cite retired `docs/` files; the contracts they describe live in the files above.
```

## Automatic phase timeout

Automatic Tasks preparation and micro phases have a one-hour (3,600-second)
agent timeout, including phases launched through `bard run` and review repair.
Set `BARD_PHASE_TIMEOUT` to a positive integer number of seconds to override it:

```sh
BARD_PHASE_TIMEOUT=2400 bard micro run --task TSK-013-01 --unpark
```

Invalid values fail before an agent starts or its handover changes. An explicit
Python-call timeout takes precedence. Standalone non-micro commands retain their
existing timeouts; verification and human-review gates remain required.

An explicit `micro run --task … --unpark` retry excludes commits rejected by the
committed RED/GREEN proof gates. It retains the task's earlier eligible RED,
including across an operator repair, and reruns GREEN instead of fabricating
another failing test. Missing or mismatched failure history halts recovery.
The retry still needs fresh accepted-commit checks, JUDGE, and required human
review. Ordinary queued-task resume remains conservative.

## Missing proof on a parked DIRECT task

A required-review DIRECT task without a resolved `Test target` stays parked.
Do not clear its checkpoint or substitute an unrelated passing test. Commit an
additive amendment: one meaningful `Test target` and its file appended to `Files`.
Keep the remaining card unchanged, including its human oracle and acceptance.
With a clean tree, explicitly request the repair at the expected commit:

```sh
bard review repair-contract --task TSK-013-01 --expected-head "$(git rev-parse HEAD)"
bard review run --task TSK-013-01
```

Repair requires a nonempty passing target check and human approval of the additive
contract. It preserves the original checkpoint in the committed ledger and keeps
the whole-task review baseline. A separate fresh check, JUDGE and human task
sign-off remain required. Existing approvals, scope removal, changed criteria and
dirty/stale inputs are refused; ordinary resume never adopts a changed contract.
If checkpoint persistence is interrupted after the repair ledger commit, rerun
the explicit repair at the current HEAD without making further project edits.

## Explicit repair after a test-defect JUDGE

For an unapproved running required-review TDD task, a committed JUDGE header
must identify `task`, `verdict: revert_red`, `classification: test_defect`,
`red` (the original valid RED), and `head` (its immediate GREEN parent).
After authorization, leave repairs uncommitted, within the unchanged card's
declared files and `handover.md`, then run:

```sh
bard review repair-judge --task TSK-001-01 --expected-head "$(git rev-parse HEAD)"
bard review run --task TSK-001-01
```

This opt-in commits repairs with hooks and durable original checkpoint/RED/JUDGE
provenance, executes a nonempty native check at the repair commit, then parks for
fresh JUDGE and the normal whole-task human gate. It never completes or approves
the task. RED roles, failing-proof rules, rollback, ordinary resume, and human
`--repaired` semantics do not change. The full card/baseline must match; history
is bounded to 100 linear task commits, and only recognized task ledger transitions
may follow JUDGE. Unrelated dirty files, runner-state edits and ambiguous history
are refused. Failed checks preserve the repair commit; retry the command at that
HEAD with clean inputs. Further edits after a failed repair require inspection,
not automatic adoption. No reset or history deletion occurs.
