Repository navigation
Expand file tree
/
Copy pathmise.toml
More file actions
126 lines (111 loc) · 4.77 KB
/
Copy pathmise.toml
File metadata and controls
126 lines (111 loc) · 4.77 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Toolchain and task gate for cauce. One gate: `mise run validate`.
# Install everything: `mise install` (also installs the Rust toolchain).
[tools]
rust = { version = "1.98.0", components = ["rustfmt", "clippy"] }
node = "24.19.0"
pnpm = "12.16.1"
"cargo:cargo-deny" = "0.20.2"
"cargo:cargo-nextest" = "0.9.146"
"ubi:hatoo/oha" = "1.16.0"
[tasks.fmt]
description = "Check formatting with rustfmt"
run = "cargo fmt --all -- --check"
[tasks."fmt:fix"]
description = "Apply rustfmt"
run = "cargo fmt --all"
# CARGO_INCREMENTAL=0 on the gate tasks: gate builds are one-shot (especially
# in short-lived agent worktrees) and incremental artifacts for workspace
# crates just accumulate on disk. Day-to-day `cargo run`/`cargo test`
# iteration keeps incremental on — it is not affected.
[tasks.lint]
description = "Clippy on all targets, warnings as errors"
env = { CARGO_INCREMENTAL = "0" }
run = "cargo clippy --all-targets -- -D warnings"
[tasks.test]
description = "Run tests (cargo-nextest when installed, else cargo test)"
env = { CARGO_INCREMENTAL = "0" }
run = """
#!/usr/bin/env bash
set -euo pipefail
threads="$(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4)"
if command -v cargo-nextest >/dev/null 2>&1; then
cargo nextest run --workspace --test-threads "$threads" --no-tests=pass
# nextest cannot run doctests; they are part of the gate (CacheKey contract).
cargo test --workspace --doc
else
cargo test --workspace -- --test-threads "$threads"
fi
"""
[tasks.deny]
description = "cargo-deny: licenses, advisories, bans, sources"
run = "cargo deny check"
# W1-12: the non-default feature set stays compilable. The default build is
# already covered by lint/test; this checks the minimal agent build
# (`cauce mcp` + `cauce serve --headless`, no ui/ai/otlp). --all-targets also
# compiles the e2e test target under the reduced features.
[tasks."check:features"]
description = "Check cauce-cli --no-default-features --features mcp"
env = { CARGO_INCREMENTAL = "0" }
run = "cargo check -p cauce-cli -p cauce-server --all-targets --no-default-features --features mcp"
# The web bundle is committed (rust-embed reads assets/ at build time), so
# the task rebuilds it and diffs the output — a stale or missing app.js
# fails the gate instead of silently shipping the old script. The generated
# artifacts (ts-rs wire types in web/src/types, i18n bundles in
# web/src/i18n) are committed the same way: regenerated here, then
# freshness-checked by the trailing `git diff`.
#
# FX-02 adds the Svelte SPA: `pnpm run build:spa` emits `assets/spa/` and
# runs first because rust-embed fails to compile the ui feature when the
# folder is absent; `pnpm run check:spa` (svelte-check) is the SPA's
# typecheck pass; `assets/spa` joins the freshness diff.
[tasks.web]
description = "pnpm install + tsc typecheck + svelte-check + vite bundle + vitest + committed generated-artifact freshness"
dir = "crates/cauce-server"
run = """
#!/usr/bin/env bash
set -euo pipefail
pnpm install --frozen-lockfile
pnpm run build:spa
cargo test -p cauce-server --test wire_types --quiet
cargo run -p cauce-server --bin gen_i18n --quiet
pnpm run typecheck
pnpm run check:spa
pnpm run test
git diff --exit-code -- assets/spa pnpm-lock.yaml web/src/types web/src/i18n
"""
[tasks.validate]
description = "Full local gate: fmt + lint + test + deny + web + feature-matrix check"
depends = ["fmt", "lint", "test", "deny", "check:features", "web"]
[tasks."validate:nightly"]
description = "Nightly budget, live canary, and full gate"
run = "CAUCE_NIGHTLY=1 CAUCE_LIVE=1 mise run validate"
# W3-08: LOC/complexity report. Non-gating — prints totals, largest
# files/functions and the >1000/>1500/>150 warning thresholds; always
# exits 0. Runs in CI for tracking; not part of `validate`.
[tasks.loc]
description = "Non-gating LOC/complexity report"
run = "bash scripts/loc-report.sh"
[tasks.dev]
description = "Run the cauce binary (cauce serve)"
run = "cargo run -p cauce-cli -- serve"
# PUB-04: public-instance load harness. Builds the release binary, then runs
# spike-shed / collapse / constrained / edge-basis scenarios against the
# replay engine and prints KEY=VALUE metrics for docs/deploy/sizing.md.
# Non-gating — manual capacity check, not part of `validate`.
[tasks.loadtest]
description = "Public-instance load harness (oha + replay engine)"
env = { CARGO_INCREMENTAL = "0" }
run = """
cargo build --release -p cauce-cli
contrib/loadtest.sh
"""
[tasks."hooks:install"]
description = "Point git at .githooks/ (pre-push runs mise run validate)"
run = "git config core.hooksPath .githooks && echo 'core.hooksPath=.githooks'"
[tasks.docs]
description = "Serve the docmd docs site locally (end-user docs/ + .agents/docs copied to docs/developers)"
run = """
set -e
rsync -a --delete --exclude='screens/' .agents/docs/ docs/developers/
npx -y @docmd/core dev
"""