-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
197 lines (174 loc) · 7.61 KB
/
Justfile
File metadata and controls
197 lines (174 loc) · 7.61 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# SPDX-License-Identifier: PMPL-1.0-or-later
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath)
#
# justfile — gitbot-fleet
# Run with: just <recipe>
set shell := ["bash", "-euo", "pipefail", "-c"]
# Default recipe: show help
default:
@just --list
# Build robot-repo-automaton (Rust executor)
build:
cd robot-repo-automaton && OPENSSL_NO_VENDOR=1 cargo build --release
# Run robot-repo-automaton tests
test:
cd robot-repo-automaton && OPENSSL_NO_VENDOR=1 cargo test
# Build shared-context library
build-shared:
cd shared-context && cargo build
# Run fleet coordinator
coordinate *ARGS:
bash fleet-coordinator.sh {{ARGS}}
# Run dispatch runner with a manifest
dispatch manifest:
bash scripts/dispatch-runner.sh "{{manifest}}"
# Process review findings (dry-run by default)
review *ARGS:
bash scripts/process-review-findings.sh --dry-run {{ARGS}}
# Scan a repo for compliance issues
scan repo:
robot-repo-automaton/target/release/robot-repo-automaton scan "{{repo}}"
# Fix a repo with PR creation
fix repo:
robot-repo-automaton/target/release/robot-repo-automaton fix "{{repo}}" --create-pr
# Run hypatia security scan
hypatia-scan:
@echo "Running hypatia neurosymbolic scan..."
@if command -v hypatia-v2 &>/dev/null; then \
hypatia-v2 . --severity=critical --severity=high; \
else \
echo "hypatia-v2 not found — run via CI workflow instead"; \
fi
# Run panic-attack static analysis
panic-scan:
@if [ -x "/var$REPOS_DIR/panic-attacker/target/release/panic-attack" ]; then \
/var$REPOS_DIR/panic-attacker/target/release/panic-attack assail . --verbose; \
else \
echo "panic-attack not built — run 'cd /var$REPOS_DIR/panic-attacker && cargo build --release'"; \
fi
# Run release maintenance hard-pass on a target repository
maintenance-hard-pass repo *ARGS:
bash scripts/maintenance-hard-pass.sh --repo "{{repo}}" {{ARGS}}
# Discover and register repo coverage for gitbot-fleet/hypatia
enroll-repos repos_root="/var$REPOS_DIR" apply="false":
@if [ "{{apply}}" = "true" ]; then \
bash scripts/enroll-hypatia-fleet.sh --repos-root "{{repos_root}}" --apply; \
else \
bash scripts/enroll-hypatia-fleet.sh --repos-root "{{repos_root}}"; \
fi
# Check license compliance
license-check:
@echo "Checking for banned AGPL-3.0 headers..."
@if grep -rl "AGPL-3.0" --include='*.sh' --include='*.rs' --include='*.scm' --include='*.yml' . 2>/dev/null; then \
echo "FAIL: Found AGPL-3.0 headers"; \
exit 1; \
else \
echo "PASS: No AGPL-3.0 headers found"; \
fi
# Validate SCM files are in .machine_readable/ only
check-scm:
@for f in STATE.scm META.scm ECOSYSTEM.scm; do \
if [ -f "$$f" ]; then \
echo "ERROR: $$f found in root"; exit 1; \
fi; \
done
@echo "PASS: No SCM files in root"
# Clean all build artifacts
clean:
cd robot-repo-automaton && cargo clean
cd shared-context && cargo clean
@echo "Cleaned."
# Run panic-attacker pre-commit scan
assail:
@command -v panic-attack >/dev/null 2>&1 && panic-attack assail . || echo "panic-attack not found — install from https://github.com/hyperpolymath/panic-attacker"
# ═══════════════════════════════════════════════════════════════════════════════
# ONBOARDING & DIAGNOSTICS
# ═══════════════════════════════════════════════════════════════════════════════
# Check all required toolchain dependencies and report health
doctor:
#!/usr/bin/env bash
echo "═══════════════════════════════════════════════════"
echo " Gitbot Fleet Doctor — Toolchain Health Check"
echo "═══════════════════════════════════════════════════"
echo ""
PASS=0; FAIL=0; WARN=0
check() {
local name="$1" cmd="$2" min="$3"
if command -v "$cmd" >/dev/null 2>&1; then
VER=$("$cmd" --version 2>&1 | head -1)
echo " [OK] $name — $VER"
PASS=$((PASS + 1))
else
echo " [FAIL] $name — not found (need $min+)"
FAIL=$((FAIL + 1))
fi
}
check "just" just "1.25"
check "git" git "2.40"
# Optional tools
if command -v panic-attack >/dev/null 2>&1; then
echo " [OK] panic-attack — available"
PASS=$((PASS + 1))
else
echo " [WARN] panic-attack — not found (pre-commit scanner)"
WARN=$((WARN + 1))
fi
echo ""
echo " Result: $PASS passed, $FAIL failed, $WARN warnings"
if [ "$FAIL" -gt 0 ]; then
echo " Run 'just heal' to attempt automatic repair."
exit 1
fi
echo " All required tools present."
# Attempt to automatically install missing tools
heal:
#!/usr/bin/env bash
echo "═══════════════════════════════════════════════════"
echo " Gitbot Fleet Heal — Automatic Tool Installation"
echo "═══════════════════════════════════════════════════"
echo ""
if ! command -v just >/dev/null 2>&1; then
echo "Installing just..."
cargo install just 2>/dev/null || echo "Install just from https://just.systems"
fi
echo ""
echo "Heal complete. Run 'just doctor' to verify."
# Guided tour of the project structure and key concepts
tour:
#!/usr/bin/env bash
echo "═══════════════════════════════════════════════════"
echo " Gitbot Fleet — Guided Tour"
echo "═══════════════════════════════════════════════════"
echo ""
echo '// SPDX-License-Identifier: PMPL-1.0-or-later'
echo ""
echo "Key directories:"
echo " docs/ Documentation"
echo " tests/ Test suite"
echo " .github/workflows/ CI/CD workflows"
echo " .machine_readable/ Machine-readable metadata"
echo ""
echo "Quick commands:"
echo " just doctor Check toolchain health"
echo " just heal Fix missing tools"
echo " just help-me Common workflows"
echo " just default List all recipes"
echo ""
echo "Read more: README.adoc, EXPLAINME.adoc"
# Show help for common workflows
help-me:
#!/usr/bin/env bash
echo "═══════════════════════════════════════════════════"
echo " Gitbot Fleet — Common Workflows"
echo "═══════════════════════════════════════════════════"
echo ""
echo "FIRST TIME SETUP:"
echo " just doctor Check toolchain"
echo " just heal Fix missing tools"
echo ""
echo "PRE-COMMIT:"
echo " just assail Run panic-attacker scan"
echo ""
echo "LEARN:"
echo " just tour Guided project tour"
echo " just default List all recipes"