-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (62 loc) · 2.65 KB
/
Copy pathMakefile
File metadata and controls
77 lines (62 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# aicortex: the one source of truth for what CI validates (spec 001 B-2).
#
# Every target is guarded so the composite is green on the specify-only tree:
# before spec 010 lands there is no Cargo.toml.
# `make ci` locally means a green CI run.
SHELL := /bin/bash
.DEFAULT_GOAL := ci
SPEC_SPINE ?= spec-spine
BASE ?= origin/main
.PHONY: spine spec-dag ci build test lint fmt deny coverage attest verify help
## spine: the governed gate chain (compile, index, lint, index check, couple, spec-dag)
spine:
$(SPEC_SPINE) compile
$(SPEC_SPINE) index
$(SPEC_SPINE) lint --fail-on-warn
$(SPEC_SPINE) index check
$(SPEC_SPINE) couple --base $(BASE) --head HEAD
scripts/spec-dag.sh
## spec-dag: depends_on is acyclic and only names lower-numbered specs
spec-dag:
scripts/spec-dag.sh
## ci: everything CI runs, in order
ci: spine
$(SPEC_SPINE) index coverage --fail-on-untraced
$(MAKE) build
$(MAKE) test
$(MAKE) lint
$(MAKE) fmt
$(MAKE) deny
## build: cargo build (guarded on Cargo.toml)
build:
@if [ -f Cargo.toml ]; then cargo build --workspace --locked; else echo "build: no Cargo.toml yet (lands with spec 010)"; fi
## test: cargo test (guarded on Cargo.toml)
test:
@if [ -f Cargo.toml ]; then cargo test --workspace --locked; else echo "test: no Cargo.toml yet (lands with spec 010)"; fi
## lint: clippy with warnings denied (guarded on Cargo.toml)
lint:
@if [ -f Cargo.toml ]; then cargo clippy --workspace --all-targets --locked -- -D warnings; else echo "lint: no Cargo.toml yet (lands with spec 010)"; fi
## fmt: rustfmt check (guarded on Cargo.toml)
fmt:
@if [ -f Cargo.toml ]; then cargo fmt --all --check; else echo "fmt: no Cargo.toml yet (lands with spec 010)"; fi
## deny: cargo-deny supply-chain check (guarded on deny.toml and the tool)
deny:
@if [ -f deny.toml ]; then \
if command -v cargo-deny >/dev/null 2>&1; then cargo deny check; \
else echo "deny: cargo-deny not installed (cargo install cargo-deny --locked); skipped locally, CI runs it"; fi; \
else echo "deny: no deny.toml yet (lands with spec 010)"; fi
## coverage: which source files no spec specifically claims
coverage:
$(SPEC_SPINE) index coverage
## attest: the corpus attestation (spec-spine's ledger seal), never committed
attest:
@mkdir -p .derived/attestation
$(SPEC_SPINE) attest --with-coupling > .derived/attestation/corpus.json
@echo "attestation written to .derived/attestation/corpus.json"
## verify: run one spec's verify:cli blocks, e.g. make verify SPEC=018-retrieval-and-recall-trace
verify:
@test -n "$(SPEC)" || { echo "usage: make verify SPEC=<spec-id>"; exit 2; }
scripts/verify-spec.sh $(SPEC)
## help: list targets
help:
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/^## //'