Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (60 loc) · 3.24 KB
/
Copy pathMakefile
File metadata and controls
82 lines (60 loc) · 3.24 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
# Repo Steward — simple verbs over the systemd user units install.sh creates.
# Run `make help` for the full list. PORT overrides the dashboard port:
# make serve PORT=9000
PORT ?= 8377
SC := systemctl --user
SVC := repo-steward.service
TIMER := repo-steward.timer
DASH := repo-steward-dash.service
UPTIME := repo-steward-uptime.timer
.DEFAULT_GOAL := help
.PHONY: help install serve start stop restart tick timer-on timer-off status logs open audit audit-backfill signals insights build merge-ready evaluate test uninstall
help: ## List targets
@grep -hE '^[a-z-]+:.*?## ' $(MAKEFILE_LIST) \
| awk 'BEGIN{FS=":.*?## "}{printf " \033[1m%-11s\033[0m %s\n",$$1,$$2}'
install: ## Install/refresh the systemd units + dashboard (runs install.sh)
./install.sh
serve: ## Run the dashboard in the foreground, no systemd (Ctrl-C to stop)
STEWARD_PORT=$(PORT) python3 server.py
start: ## Start the dashboard service in the background
@$(SC) start $(DASH) && echo "dashboard: http://localhost:$(PORT)/"
stop: ## Stop the dashboard service
$(SC) stop $(DASH)
restart: ## Restart the dashboard service
$(SC) restart $(DASH)
tick: ## Run one steward tick now (reads ledgers, regenerates dashboard.html)
@# --no-block: the unit is Type=oneshot, so a plain `start` blocks until the
@# whole tick finishes (minutes) and only then prints "tick started".
@$(SC) start --no-block $(SVC) && echo "tick started — follow it with: make logs"
timer-on: ## Enable scheduled ticks
$(SC) enable --now $(TIMER)
timer-off: ## Pause scheduled ticks (leaves the dashboard up)
$(SC) stop $(TIMER)
status: ## Show dashboard / tick / timer state
@printf 'dashboard: %s\n' "$$($(SC) is-active $(DASH))"
@printf 'tick: %s\n' "$$($(SC) is-active $(SVC))"
@printf 'timer: %s\n' "$$($(SC) is-active $(TIMER))"
logs: ## Tail the tick log
tail -n 40 -f logs/tick.log
open: ## Open the dashboard in a browser
@xdg-open http://localhost:$(PORT)/ >/dev/null 2>&1 || echo "open http://localhost:$(PORT)/"
audit: ## Show the last 25 decision-log events
@test -s audit.jsonl && tail -n 25 audit.jsonl \
| jq -r '"\(.ts) \(.actor)\t\(.event)\t\(if .repo then .repo + " " + (.ref // "") else "" end)\t\(.summary // .detail // "")"' \
|| echo "no audit.jsonl yet — run 'make audit-backfill' to migrate existing history"
audit-backfill: ## Fold pre-existing history (approvals/decisions/usage) into the decision log
python3 audit.py backfill
signals: ## Collect changed ledger/audit/metric evidence for insights
python3 signals.py collect
insights: ## Rank what is worth building next (GitHub read + one model session)
bash insights.sh
build: ## Run the builds queued from the Insights page (opens PRs, never merges)
bash build.sh
merge-ready: ## Squash-merge PRs signed off "Good to merge" (MERGE=1 to act, LIMIT=N to cap; dry run otherwise)
python3 merge_ready.py $(if $(MERGE),--merge,) $(if $(LIMIT),--limit $(LIMIT),)
evaluate: ## Critically evaluate prior steward judgments and derive lessons
bash evaluate.sh
test: ## Run the deterministic runner/ledger tests
python3 -m unittest -v test_tick_guard.py test_insights_builds.py test_work_status.py test_merge_queue.py
uninstall: ## Disable and stop every steward unit
-$(SC) disable --now $(TIMER) $(DASH) $(UPTIME) $(SVC)