Repository navigation
Expand file tree
/
Copy pathcontractile.just
More file actions
139 lines (116 loc) · 5.19 KB
/
Copy pathcontractile.just
File metadata and controls
139 lines (116 loc) · 5.19 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
127
128
129
130
131
132
133
134
135
136
137
138
# Auto-generated by: contractile gen-just
# Source directory: contractiles
# Re-generate with: contractile gen-just --dir contractiles
#
# The `# Source:` Dustfile, Intentfile, Mustfile and Trustfile named below were
# legacy .a2ml contractiles, retired 2026-11-14 with no mapping spec to
# translate them (docs/history/A2ML-REMOVED.adoc). Their recipes stand as
# generated until the edicts (<Verb>file.deed, A7 8.1) exist; do not regenerate
# from the retired files. Adjustfile.a2ml remains, because adjust-check below
# reads its declared thresholds.
#
# SPDX-License-Identifier: MPL-2.0
# === DUST (Recovery & Rollback) ===
# Source: Dustfile.a2ml
# List available dust recovery actions
dust-status:
@echo ' dust-source-rollback: Revert all source changes to last commit [rollback]'
# Revert all source changes to last commit
dust-source-rollback:
@echo 'Executing rollback for source-rollback'
git checkout HEAD -- .
# === INTEND (Declared Future Intent) ===
# Source: Intentfile.a2ml
# Display declared future intents
intend-list:
@echo '=== Declared Intent ==='
@echo ''
@echo 'Features:'
@echo ''
@echo 'Quality:'
# === MUST (Physical State Checks) ===
# Source: Mustfile.a2ml
# Run all must checks
must-check: must-license-present must-readme-present must-spdx-headers must-no-banned-files
@echo 'All must checks passed'
# LICENSE file must exist
must-license-present:
test -f LICENSE
# README must exist
must-readme-present:
test -f README.adoc || test -f README.md
# Source files should have SPDX license headers
must-spdx-headers:
find . -name '*.rs' -o -name '*.res' -o -name '*.gleam' | head -20 | xargs -r grep -L 'SPDX-License-Identifier' | wc -l | grep -q '^0$'
# No Dockerfiles or Makefiles
must-no-banned-files:
test ! -f Dockerfile && test ! -f Makefile
# === TRUST (Integrity & Provenance Verification) ===
# Source: Trustfile.a2ml
# Run all trust verifications
trust-verify: trust-license-content trust-no-secrets-committed trust-container-images-pinned
@echo 'All trust verifications passed'
# LICENSE contains expected SPDX identifier
trust-license-content:
grep -q 'SPDX\|License\|MIT\|Apache\|PMPL\|MPL' LICENSE
# No .env or credential files in repo
trust-no-secrets-committed:
test ! -f .env && test ! -f credentials.json && test ! -f .env.local
# Containerfile base images use pinned digests
trust-container-images-pinned:
test ! -f Containerfile || grep -q '@sha256:' Containerfile
# === ADJUST (Calibration & Threshold Drift Detection) ===
# Source: .machine_readable/contractiles/adjust/Adjustfile.a2ml
# Verify detector calibration thresholds declared in Adjustfile match source
adjust-check:
#!/usr/bin/env bash
set -euo pipefail
af=.machine_readable/contractiles/adjust/Adjustfile.a2ml
if [ ! -f "$af" ]; then echo "! Adjustfile missing — skipping"; exit 0; fi
echo "→ adjust-check — verifying calibration thresholds match Adjustfile"
drift=0
declared_prod=$(grep 'production-unwrap-threshold' "$af" | grep -oE '[0-9]+$' || true)
if [ -n "$declared_prod" ]; then
code_val=$(grep -oE 'if stats\.unwrap_calls > [0-9]+' src/assail/analyzer.rs | head -1 | grep -oE '[0-9]+$' || true)
if [ "$code_val" = "$declared_prod" ]; then
echo " ✓ production-unwrap-threshold = $declared_prod"
else
echo " ⚠ ADJUST drift: production-unwrap-threshold Adjustfile=$declared_prod code=$code_val"
drift=$((drift+1))
fi
fi
declared_test=$(grep 'test-unwrap-threshold' "$af" | grep -oE '[0-9]+$' || true)
if [ -n "$declared_test" ]; then
code_val=$(grep -oE 'unwrap_threshold = [0-9]+' src/assail/analyzer.rs | head -1 | grep -oE '[0-9]+$' || true)
if [ "$code_val" = "$declared_test" ]; then
echo " ✓ test-unwrap-threshold = $declared_test"
else
echo " ⚠ ADJUST drift: test-unwrap-threshold Adjustfile=$declared_test code=$code_val"
drift=$((drift+1))
fi
fi
declared_panic=$(grep 'test-panic-threshold' "$af" | grep -oE '[0-9]+$' || true)
if [ -n "$declared_panic" ]; then
code_val=$(grep -oE 'panic_threshold = [0-9]+' src/assail/analyzer.rs | head -1 | grep -oE '[0-9]+$' || true)
if [ "$code_val" = "$declared_panic" ]; then
echo " ✓ test-panic-threshold = $declared_panic"
else
echo " ⚠ ADJUST drift: test-panic-threshold Adjustfile=$declared_panic code=$code_val"
drift=$((drift+1))
fi
fi
declared_rules=$(grep 'active-rules' "$af" | grep -oE '[0-9]+$' || true)
if [ -n "$declared_rules" ]; then
code_count=$(grep -c '// Rule [0-9]' src/kanren/core.rs || echo "0")
if [ "$code_count" = "$declared_rules" ]; then
echo " ✓ active suppression rules = $declared_rules"
else
echo " ⚠ ADJUST drift: active-rules Adjustfile=$declared_rules code=$code_count (advisory — update Adjustfile when rules change)"
drift=$((drift+1))
fi
fi
if [ $drift -gt 0 ]; then
echo " → $drift threshold(s) drifted (advisory — reconcile Adjustfile.a2ml with source)"
else
echo " → all calibration thresholds match"
fi