Skip to content

Commit ea83971

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent 6f42b25 commit ea83971

1 file changed

Lines changed: 65 additions & 9 deletions

File tree

Justfile

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,63 @@
66
default:
77
@just --list
88

9-
# Build the project
9+
# Build all sub-project artefacts
1010
build:
11-
@echo "Build not configured yet"
11+
@echo "=== Standards Monorepo Build ==="
12+
@echo "[1/3] a2ml/bindings/rust"
13+
@cd a2ml/bindings/rust && cargo build 2>&1 || echo " SKIP: cargo not available"
14+
@echo "[2/3] k9-svc/bindings/rust"
15+
@cd k9-svc/bindings/rust && cargo build 2>&1 || echo " SKIP: cargo not available"
16+
@echo "[3/3] groove-protocol/reference/ipv6t"
17+
@cd groove-protocol/reference/ipv6t && zig build 2>&1 || echo " SKIP: zig not available"
18+
@echo "=== Build complete ==="
1219

13-
# Run tests
20+
# Run all sub-project test suites
1421
test:
15-
@echo "Tests not configured yet"
22+
@echo "=== Standards Monorepo Test Runner ==="
23+
@echo ""
24+
@echo "[1/5] groove-protocol/reference/ipv6t (Zig — 10 tests)"
25+
@cd groove-protocol/reference/ipv6t && zig build test 2>&1 || echo " SKIP: zig not available"
26+
@echo ""
27+
@echo "[2/5] 0-ai-gatekeeper-protocol/mcp-repo-guardian (Deno — 36 tests)"
28+
@cd 0-ai-gatekeeper-protocol/mcp-repo-guardian && deno task test 2>&1 || echo " SKIP: deno not available or tests failed"
29+
@echo ""
30+
@echo "[3/5] axel-protocol (Deno — 14 tests)"
31+
@cd axel-protocol && deno task test 2>&1 || echo " SKIP: deno not available or tests failed"
32+
@echo ""
33+
@echo "[4/5] a2ml/bindings/rust (Rust — 47 tests)"
34+
@cd a2ml/bindings/rust && cargo test 2>&1 || echo " SKIP: cargo not available or tests failed"
35+
@echo ""
36+
@echo "[5/5] k9-svc/bindings/rust (Rust — 45 tests)"
37+
@cd k9-svc/bindings/rust && cargo test 2>&1 || echo " SKIP: cargo not available or tests failed"
38+
@echo ""
39+
@echo "=== Test run complete ==="
1640

17-
# Format code
41+
# Format sub-project code
1842
fmt:
19-
@echo "Formatting not configured yet"
43+
@echo "=== Standards Monorepo Format ==="
44+
@cd a2ml/bindings/rust && cargo fmt 2>&1 || echo " SKIP"
45+
@cd k9-svc/bindings/rust && cargo fmt 2>&1 || echo " SKIP"
46+
@cd 0-ai-gatekeeper-protocol/mcp-repo-guardian && deno fmt 2>&1 || echo " SKIP"
47+
@echo "=== Format complete ==="
2048

21-
# Lint code
49+
# Lint sub-projects
2250
lint:
23-
@echo "Linting not configured yet"
51+
@echo "=== Standards Monorepo Lint ==="
52+
@echo "[1/2] Rust clippy"
53+
@cd a2ml/bindings/rust && cargo clippy --all-targets 2>&1 || echo " SKIP"
54+
@cd k9-svc/bindings/rust && cargo clippy --all-targets 2>&1 || echo " SKIP"
55+
@echo "[2/2] Deno lint"
56+
@cd 0-ai-gatekeeper-protocol/mcp-repo-guardian && deno lint 2>&1 || echo " SKIP"
57+
@echo "=== Lint complete ==="
2458

2559
# Clean build artifacts
2660
clean:
27-
@echo "Clean not configured yet"
61+
@echo "=== Cleaning ==="
62+
@cd a2ml/bindings/rust && cargo clean 2>&1 || true
63+
@cd k9-svc/bindings/rust && cargo clean 2>&1 || true
64+
@cd groove-protocol/reference/ipv6t && rm -rf zig-out zig-cache .zig-cache 2>/dev/null || true
65+
@echo "=== Clean complete ==="
2866

2967
# Run panic-attacker pre-commit scan
3068
assail:
@@ -78,3 +116,21 @@ help-me:
78116
@echo " https://github.com/hyperpolymath/standards/issues/new"
79117
@echo ""
80118
@echo "Include the output of 'just doctor' in your report."
119+
120+
121+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
122+
crg-grade:
123+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
124+
[ -z "$$grade" ] && grade="X"; \
125+
echo "$$grade"
126+
127+
# Generate a shields.io badge markdown for the current CRG grade
128+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
129+
crg-badge:
130+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
131+
[ -z "$$grade" ] && grade="X"; \
132+
case "$$grade" in \
133+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
134+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
135+
*) color="lightgrey" ;; esac; \
136+
echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"

0 commit comments

Comments
 (0)