-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathMakefile
More file actions
183 lines (154 loc) · 8.23 KB
/
Copy pathMakefile
File metadata and controls
183 lines (154 loc) · 8.23 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
.PHONY: test test-api test-e2e test-e2e-duckdb test-fast test-hooks test-workflow test-moat test-moat-real test-compat moat-check moat-check-drive dev lint lint-daemon-allowlist lint-ci-test-coverage ci-test-coverage-report ci-test-coverage-baseline
dev:
OPENCLAW_GATEWAY_TOKEN=dev-token python3 dashboard.py --port 8900
test: test-api test-e2e test-e2e-duckdb test-workflow test-compat
# Runtime-compat adapters (issue #956): PicoClaw (flat JSONL) + NanoClaw
# (per-session SQLite). Hermetic, ~1s — no live server, no gateway, no
# network. Mirror in .github/workflows/ci.yml (moat-tests job).
test-compat:
python3 -m pytest tests/test_picoclaw_adapter.py tests/test_nanoclaw_adapter.py tests/test_runtime_detection_snapshot.py tests/test_family_runtime_ingest.py tests/test_codex_adapter.py tests/test_cursor_adapter.py tests/test_claude_code_adapter.py tests/test_aider_adapter.py tests/test_goose_adapter.py tests/test_goose_platform_paths.py tests/test_opencode_adapter.py tests/test_qwen_code_adapter.py -v
# Claude Code hook lifecycle + personal-data redaction tier (WO-61).
# Mirrored in .github/workflows/ci.yml (moat-tests job).
test-hooks:
python3 -m pytest tests/test_hooks_claude_code.py tests/test_hook_ownership_quoted_launcher.py tests/test_hook_lifecycle.py tests/test_redaction_pii.py -q
# WO-59 self-diagnostics: MCP report tool, corroboration, honesty rollup,
# multi-runtime MCP installer. Mirrored in .github/workflows/ci.yml (moat-tests).
test-selfdiag:
python3 -m pytest tests/test_self_diagnostics.py -q
test-fast:
CLAWMETRY_URL=http://localhost:8900 CLAWMETRY_TOKEN=dev-token python3 -m pytest tests/test_api.py -v
test-api:
CLAWMETRY_URL=http://localhost:8900 CLAWMETRY_TOKEN=dev-token python3 -m pytest tests/test_api.py -v
test-e2e:
CLAWMETRY_URL=http://localhost:8900 CLAWMETRY_TOKEN=dev-token python3 -m pytest tests/test_e2e.py -v
# Self-contained: drives the daemon ingest helper + relay shapes against an
# isolated DuckDB file. No live server, no gateway, no network. ~5s.
test-e2e-duckdb:
python3 -m pytest tests/test_duckdb_relay_integration.py -v
test-workflow:
python3 -m pytest tests/test_e2e_nightly_workflow.py -v
# MOAT verifier suite (issue #1491 / PRD #1133 invariant #3). Hermetic —
# no live server, no gateway, no network. ~10s locally. Mirror the CI
# job in .github/workflows/ci.yml (moat-tests). If you add a file here,
# add it there too.
test-moat:
python3 -m pytest \
tests/test_moat_send_message_e2e.py \
tests/test_moat_event_shape_manifest_guard.py \
tests/test_oss_routes_source_canary.py \
tests/test_moat_regression_1129.py \
tests/test_e2e_real_openclaw_pipeline.py \
tests/test_duckdb_fastpath_v3_invariants.py \
tests/test_moat_cloud_roundtrip_e2e.py \
tests/test_channel_event_chokepoint.py \
tests/test_no_direct_get_store_in_routes.py \
tests/test_local_query_api.py \
tests/test_harness_bench.py \
tests/test_bench_route.py \
tests/test_cohort_compare.py \
tests/test_behaviour_signals.py \
tests/test_signals_ui_contract.py \
tests/test_signal_shifts.py \
tests/test_briefs.py \
tests/test_guard_control_capability.py \
tests/test_guard_live_probe.py \
tests/test_process_control.py \
tests/test_process_control_windows.py \
tests/test_needs_you_matches_the_hero.py \
tests/test_live_session_truth.py \
tests/test_live_sessions_all_runtimes.py \
tests/test_needs_you_ui_contract.py \
tests/test_overview_claims_are_evidenced.py \
-q
# MOAT real-data E2E (2026-05-19 mandate). Drives a REAL ``openclaw agent
# --local`` turn, ingests via the daemon, then asserts every endpoint
# called out in the user mandate (overview / channels / crons /
# system-health on top of the sibling test's sessions / transcript /
# usage / brain-history / flow). Requires the ``openclaw`` binary on
# PATH (skipped cleanly otherwise). ~45s end-to-end. Memory pin:
# feedback_synthetic_tests_missed_real_event_shape.md.
test-moat-real:
python3 -m pytest tests/test_moat_real_e2e.py -v
# MOAT keystone bar (docs/MOAT_BAR.md Section 5, AC#1). The 13-endpoint
# verifier that drives a real openclaw turn (or skips it via --no-drive)
# and asserts every UI-backing API surface returns non-zero, correctly
# shaped data. Hard-gate on every PR via the moat-keystone job in
# .github/workflows/ci.yml. ~2s in --no-drive mode against a warm
# DuckDB; 30-60s when driving a real openclaw turn.
#
# Requires: dashboard listening on 127.0.0.1:8900 AND sync daemon
# running (writes ~/.clawmetry/local_query.json). Locally:
# make dev # starts dashboard
# python3 -m clawmetry.sync # starts daemon
# make moat-check
moat-check:
@python3 scripts/accuracy_harness/keystone_e2e.py --no-drive
# Drive mode (real openclaw agent turn -> +2 events in DuckDB -> 13
# probes). Costs LLM tokens, so runs nightly on main via
# .github/workflows/moat-keystone-drive-nightly.yml — never per-PR.
moat-check-drive:
@python3 scripts/accuracy_harness/keystone_e2e.py
lint: lint-py lint-py39 lint-js lint-daemon-allowlist lint-runtime-count lint-ac-coverage lint-module-map lint-framework-coverage lint-ci-test-coverage
# Issue #1267: every `local_store_via_daemon("X")` / `_ls_call("X")` call
# in routes/ must reference a method that's in the daemon's allowlist
# (routes/local_query.py:_DAEMON_METHODS). Catches the gap that produced
# the 3-PR cascade #1258 → #1260 → #1266 (forgot to add new methods to
# the allowlist; daemon returned 400; fast-paths fell through to slow
# legacy paths; surfaced as 6 s timeouts).
lint-daemon-allowlist:
@python3 scripts/lint_daemon_allowlist.py
# PEP 604 (`str | None`) parses on Python 3.9 but the 3.9 runtime raises
# TypeError when a signature is evaluated at def time, so lint-py's ast.parse
# rides right past it. 0.12.753 shipped one at clawmetry/cli.py module scope
# and every `clawmetry` subcommand died at import on 3.9, `clawmetry
# uninstall` included.
lint-py39:
@python3 scripts/check_py39_annotations.py
# The advertised runtime count must match FREE_RUNTIMES | PAID_RUNTIMES.
# Fix drift with: python3 scripts/sync_runtime_count.py
lint-ac-coverage:
@python3 scripts/check_ac_coverage.py --check
ac-report:
@python3 scripts/check_ac_coverage.py --report
ac-baseline:
@python3 scripts/check_ac_coverage.py --update-baseline
lint-runtime-count:
@python3 scripts/sync_runtime_count.py --check
# docs/MODULE_MAP.md is generated from the source tree. CLAUDE.md's route
# table listed 17 of 70 route modules before this existed.
# Fix drift with: python3 scripts/gen_module_map.py
lint-module-map:
@python3 scripts/gen_module_map.py --check
# docs/FRAMEWORK_COVERAGE.md is rendered from clawmetry/framework_map.py.
# Fix drift with: python3 scripts/gen_framework_coverage.py
lint-framework-coverage:
@python3 scripts/gen_framework_coverage.py --check
# CI test-file coverage ratchet (issue #5813). 82% of test files were in no
# CI job. This guard stops the hole from growing: new tests must be wired
# into a workflow in the same PR. Ratchet down by running:
# python3 scripts/check_ci_test_coverage.py --update-baseline
lint-ci-test-coverage:
@python3 scripts/check_ci_test_coverage.py --check
ci-test-coverage-report:
@python3 scripts/check_ci_test_coverage.py --report
ci-test-coverage-baseline:
@python3 scripts/check_ci_test_coverage.py --update-baseline
lint-py:
python3 -c "import ast; ast.parse(open('dashboard.py').read()); print('Python syntax OK')"
ruff check dashboard.py clawmetry/
# v0.12.165 shipped clawmetry/static/js/app.js with a missing `}`
# (PR #753). Browsers threw "Unexpected end of input" on first parse,
# killing every function in the bundle and stranding the dashboard on
# its boot overlay. `node --check` is the cheapest possible gate —
# runs in <100ms per file and would have failed the offending PR
# locally and in CI.
lint-js:
@if command -v node >/dev/null 2>&1; then \
for f in clawmetry/static/js/*.js; do \
node --check "$$f" || { echo "JS PARSE FAILED: $$f"; exit 1; }; \
done; \
echo "JS syntax OK"; \
else \
echo "WARN: node not installed — skipping JS syntax check (CI installs node automatically)"; \
fi
.PHONY: lint lint-py lint-js lint-daemon-allowlist lint-ac-coverage ac-report ac-baseline lint-ci-test-coverage ci-test-coverage-report ci-test-coverage-baseline