Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

T06 Consolidate lefthook + Woodpecker onto just targets

Question

The standard’s core claim (ADR 12): every gate is defined exactly once in the justfile, and hooks + CI call that same target, so “red is red once.” Cerebro violates it today:

  • lefthook clippy = cargo clippy --workspace -- -D warnings (no --all-targets)
  • CI clippy = cargo clippy --workspace --all-targets -- -D warnings
  • Both inline their own commands; they’ve already drifted.

Rebuild the justfile so just ci = fmt-check lint test doctest deny docs, init installs the tool set, and lefthook + .woodpecker/ci.yml call those targets. Fold in the gates from T03 (deny), T04 (nextest/doctest), T05 (rumdl), T13 (vale, docs-check) so no gate lives in two places.

Exit predicate

just --list shows one canonical target per gate; lefthook and CI contain just <target> calls, not raw cargo lines; the clippy --all-targets discrepancy is gone. lethook run pre-commit --dry-run and a CI dry run agree.

Resolution

The justfile defines every gate exactly once. just ci is fmt-check lint test doctest deny docs, the composition T04 fed in, plus T03’s deny and T05’s md-lint. lefthook and the Woodpecker steps call those targets, so the clippy --all-targets drift between hook and CI is gone by construction: both run just lint.

Landed pieces:

  • just test is nextest. The ADR 11 shim recorded in T04 landed in crates/cerebro-tui/tests/cucumber.rs, so the BDD binary is discovered as one real unit. Verified: cerebro-tui::cucumber appears in cargo nextest list, and just test reports 415 tests run, 415 passed, 0 skipped. The zero skipped is the proof the --ignored pass answers empty; a naive shim silently greens this unit (T04 gotcha 1).
  • .config/nextest.toml writes the stance down: retries = 0, slow-timeout warns at 60 seconds and terminates (ADR 9). The slowest real test measured 12.6 seconds (T04).
  • The CI test step drops the now-redundant separate cucumber line and runs just test-coverage (llvm-cov nextest, floor 25), just doctest, and just test-release.
  • The docs pipeline collapses to one step calling just docs (docs-lint, md-lint, then a real mdbook build). T13’s docs-check has its named slot inside that target.
  • Deleted: the check-cortex hook ran mdbook build under root: "Content/", a directory this repo does not have. The gate never ran; just docs is the real build gate. Also deleted: lefthook’s manual lint and test command groups, third and fourth copies of the cargo lines.
  • Renamed: the old just check (fmt plus clippy) splits into fmt-check and lint per the standard, and check now means cargo check --workspace --all-targets. quality survives as a private alias to ci until T17 rewrites AGENTS.md.
  • Added: init (binstall the cargo tools, brew the rest, then lefthook install and vale sync), bench as the libtest floor, fmt, and docs.
  • --all-features stays out of the recipes: cerebro declares no crate features, so it is decoration today (T04 measured the same).
  • AGENTS.md had documented the old hook/CI clippy drift as deliberate (“pre-commit stays src-only”). T06 retires that choice, per the exit predicate; T17 updates the prose to match.

Evidence: just --list shows one canonical target per gate with one-line doc comments; fmt-check, lint, test (415/415, 0 skipped), doctest, deny, test-release, and docs all exit zero locally; the Woodpecker validator passes both rewritten files. The PR pipeline itself re-runs every step through the shared targets.