|
1 | 1 | # SPDX-License-Identifier: PMPL-1.0-or-later |
2 | | -# Mustfile - declarative state contract (template) |
3 | | -# See: https://github.com/hyperpolymath/mustfile |
| 2 | +# Mustfile — Mandatory invariants for Robodog ECM |
| 3 | +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
4 | 4 |
|
5 | 5 | version: 1 |
6 | 6 |
|
7 | 7 | metadata: |
8 | | - name: project-state-contract |
9 | | - spec: v0.0.1 |
10 | | - description: "Invariant checks for config, policy, gateway, logs, and schema." |
11 | | - |
12 | | -parameters: |
13 | | - gateway_port: "8080" |
14 | | - schema_version: "v0.0.1" |
| 8 | + name: robodog-ecm-state-contract |
| 9 | + spec: v0.1.0 |
| 10 | + description: "Invariant checks for the Robodog ECM defensive technologies platform." |
15 | 11 |
|
16 | 12 | checks: |
17 | | - - name: config-valid |
18 | | - description: "config/service.yaml must be valid." |
19 | | - run: "yq -e '.' config/service.yaml >/dev/null" |
| 13 | + - name: trustfile-passes |
| 14 | + description: "All Trustfile operational checks must pass (zero critical failures)." |
| 15 | + run: "bash contractiles/trust/run-checks.sh" |
| 16 | + |
| 17 | + - name: rust-compiles |
| 18 | + description: "Rust core must compile without errors." |
| 19 | + run: "cd src/rust && cargo check 2>/dev/null" |
| 20 | + |
| 21 | + - name: rust-tests-pass |
| 22 | + description: "All Rust unit tests must pass." |
| 23 | + run: "cd src/rust && cargo test --quiet 2>/dev/null" |
| 24 | + |
| 25 | + - name: rust-clippy-clean |
| 26 | + description: "Clippy must report no warnings." |
| 27 | + run: "cd src/rust && cargo clippy --quiet -- -D warnings 2>/dev/null" |
20 | 28 |
|
21 | | - - name: policy-compiles |
22 | | - description: "policy/policy.ncl must compile." |
23 | | - run: "nickel check policy/policy.ncl" |
| 29 | + - name: defensive-annotation |
| 30 | + description: "lib.rs must contain DEFENSIVE USE ONLY annotation." |
| 31 | + run: "grep -q 'DEFENSIVE USE ONLY' src/rust/src/lib.rs" |
24 | 32 |
|
25 | | - - name: gateway-exposes-port |
26 | | - description: "Service must expose the configured port." |
27 | | - run: "bash -uc 'ss -lnt | rg \":${GATEWAY_PORT:-8080}\"'" |
| 33 | + - name: export-control-present |
| 34 | + description: "EXPORT-CONTROL.md must exist." |
| 35 | + run: "test -f EXPORT-CONTROL.md" |
28 | 36 |
|
29 | | - - name: logs-are-json |
30 | | - description: "Logs must be JSON." |
31 | | - run: "bash -uc 'rg --files -g \"*.json\" logs | xargs -r jq -e .'" |
| 37 | + - name: no-banned-patterns |
| 38 | + description: "No believe_me, assert_total, or pragma Suppress in source." |
| 39 | + run: "! grep -rPn '\\bbelieve_me\\b|\\bassert_total\\b|\\bpragma Suppress\\b' src/ 2>/dev/null | head -1 | grep -q ." |
32 | 40 |
|
33 | | - - name: schema-version-matches |
34 | | - description: "Schema must match version spec." |
35 | | - run: "bash -uc 'rg -n \"${SCHEMA_VERSION:-v0.0.1}\" schema'" |
| 41 | + - name: spdx-on-source |
| 42 | + description: "All source files have SPDX license headers." |
| 43 | + run: "! find src/ api/ ffi/ -type f \\( -name '*.rs' -o -name '*.v' -o -name '*.idr' -o -name '*.ads' -o -name '*.adb' -o -name '*.zig' \\) | xargs grep -L 'SPDX-License-Identifier' 2>/dev/null | head -1 | grep -q ." |
0 commit comments