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 testis nextest. The ADR 11 shim recorded in T04 landed incrates/cerebro-tui/tests/cucumber.rs, so the BDD binary is discovered as one real unit. Verified:cerebro-tui::cucumberappears incargo nextest list, andjust testreports 415 tests run, 415 passed, 0 skipped. The zero skipped is the proof the--ignoredpass answers empty; a naive shim silently greens this unit (T04 gotcha 1)..config/nextest.tomlwrites 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, andjust 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-cortexhook ranmdbook buildunderroot: "Content/", a directory this repo does not have. The gate never ran;just docsis the real build gate. Also deleted: lefthook’s manuallintandtestcommand groups, third and fourth copies of the cargo lines. - Renamed: the old
just check(fmt plus clippy) splits intofmt-checkandlintper the standard, andchecknow meanscargo check --workspace --all-targets.qualitysurvives as a private alias tociuntil T17 rewrites AGENTS.md. - Added:
init(binstall the cargo tools, brew the rest, thenlefthook installandvale sync),benchas the libtest floor,fmt, anddocs. --all-featuresstays 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.