repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

x ci locked and x release stub

e99ca1b9f2bd2ec803f41cbc73ddfbfa7e580c66

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

+32 / −8 text lines

Diff layout

.ci/check.kdl

Modified

+1 / −2 text lines

11job "check" {
22 image "docker.io/library/rust:latest"
33 run "rustup component add rustfmt clippy"
4 run "cargo run -p xtask -- bootstrap"
5 run "cargo run -p xtask -- check"
4 run "cargo run -p xtask -- ci"
65}

.system/RULES.md

Modified

+2 / −1 text lines

@@ -47,7 +47,8 @@ Build gates
4747- `smith-cli` unsafe only for OS terminal manipulation, with safe wrapper, `// SAFETY:`, and tests.
4848- Public docs required.
4949- fmt, clippy, tests, docs, audit, arch, and architecture-test gates in CI.
50- Every `cargo x` command accepts argument passthrough; `-p` scoping overrides workspace defaults. Lockfile-wide commands (`audit`, `bootstrap`) reject scope explicitly.
50- Every `cargo x` command accepts argument passthrough; `-p` scoping overrides workspace defaults. Lockfile-wide commands (`audit`, `bootstrap`, `ci`) reject scope explicitly.
51- Build steps run `--locked`; lockfile drift fails instead of silently updating.
5253## Architecture

xtask/src/main.rs

Modified

+29 / −5 text lines

1818};
2020const HELP: &str = concat!(
21 "usage: cargo x <check|lint|fmt|test|doc|arch|mutants [args...]|audit|bootstrap>\n",
21 "usage: cargo x <check|lint|fmt|test|doc|arch|mutants [args...]|audit|ci|release|bootstrap>\n",
2222 " cargo x dev [args...] build and launch the dev smith binary\n",
2323);
6262 Some("arch") => arch(&rest),
6363 Some("mutants") => cargo_mutants(&rest),
6464 Some("audit") => audit(&rest),
65 Some("ci") => ci(&rest),
66 Some("release") => release(&rest),
6567 Some("bootstrap") => bootstrap(&rest),
6668 _ => fail(HELP),
6769 }
123125 )
128/// The merge-gate pipeline: every gate, machine context, fixed order.
129/// Passthrough is rejected so workflows cannot drift from the definition.
130fn ci(extra: &[OsString]) -> ExitCode {
131 if !extra.is_empty() {
132 return fail("ci is a fixed pipeline and admits no scoping\n");
133 }
134 sequence(&[bootstrap, check, audit], extra)
135}
137/// Release gates are defined by the release-readiness plan; the command
138/// exists so workflows reference a stable name today.
139fn release(extra: &[OsString]) -> ExitCode {
140 let _ = extra;
141 fail("release gates are not defined yet; see SMH-PLAN-RELS0001\n")
142}
126144/// Mutation testing runs on demand, never in the blocking check chain.
127145///
128146/// Split of concerns, kept CI-sensible:
185203fn cargo_clippy(extra: &[OsString]) -> ExitCode {
186204 let args = scoped(
187 &["clippy", "--workspace", "--all-targets", "--all-features"],
205 &[
206 "clippy",
207 "--locked",
208 "--workspace",
209 "--all-targets",
210 "--all-features",
211 ],
188212 extra,
189213 );
190214 match Command::new("cargo")
201225fn cargo_nextest(extra: &[OsString]) -> ExitCode {
202 let args = scoped(&["--workspace", "--all-features"], extra);
226 let args = scoped(&["--locked", "--workspace", "--all-features"], extra);
203227 nextest_run_os(&args)
386410fn cargo_doc(extra: &[OsString]) -> ExitCode {
387 let args = scoped(&["doc", "--workspace", "--no-deps"], extra);
411 let args = scoped(&["doc", "--locked", "--workspace", "--no-deps"], extra);
388412 run_os("cargo", &args)
403427/// Builds the CLI, then launches it against an isolated dev home.
404428fn dev(args: &[OsString]) -> ExitCode {
405 let code = cargo(&["build", "-p", "smith-cli", "--bin", "smith"]);
429 let code = cargo(&["build", "--locked", "-p", "smith-cli", "--bin", "smith"]);
406430 if code != ExitCode::SUCCESS {
407431 return code;
408432 }