forked from ChelseaKR/permit-bearings
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (63 loc) · 3.02 KB
/
Copy pathMakefile
File metadata and controls
75 lines (63 loc) · 3.02 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
.PHONY: install verify lint type test security bundle-check copy-check readability-check evidence-export-check serve-ai ai-eval
install:
uv sync --locked --python 3.12 --group dev --extra ai
lint:
.venv/bin/ruff check src tests
.venv/bin/ruff format --check src tests
type:
.venv/bin/mypy
test:
.venv/bin/pytest
security:
.venv/bin/bandit -q -r src
@set -eu; \
runtime_requirements=$$(mktemp "$${TMPDIR:-/tmp}/permit-pathways-runtime.XXXXXX"); \
trap 'rm -f "$$runtime_requirements"' EXIT; \
UV_CACHE_DIR=/tmp/permit-pathways-uv-cache uv export --frozen --no-dev --extra ai \
--no-emit-project --format requirements-txt \
--output-file "$$runtime_requirements" >/dev/null; \
.venv/bin/pip-audit --requirement "$$runtime_requirements" \
--no-deps --disable-pip
bundle-check:
.venv/bin/python scripts/build_demo_bundle.py --check
.venv/bin/python scripts/scan_ordinances.py --check
PYTHONPATH=src .venv/bin/python -m permit_pathways.harness
copy-check:
node scripts/check_applicant_copy.mjs
# Enforced plain-language regression check: fails when English explanation
# copy becomes harder to read than the reviewed baseline. A score can flag a
# regression; it never replaces human readability review.
readability-check:
.venv/bin/python scripts/readability_gate.py
evidence-export-check:
@set -eu; \
evidence_directory=$$(mktemp -d "$${TMPDIR:-/tmp}/permit-pathways-evidence-export.XXXXXX"); \
trap 'rm -rf "$$evidence_directory"' EXIT; \
repository_commit_sha=$$(git rev-parse HEAD); \
archive="$$evidence_directory/public-synthetic-evidence.zip"; \
restored="$$evidence_directory/restored"; \
PYTHONPATH=src .venv/bin/python -m permit_pathways.evidence_export_cli build \
--output "$$archive" \
--freeze-id public-synthetic-evidence-freeze-2026-08-09 \
--frozen-on 2026-08-09 \
--repository-commit-sha "$$repository_commit_sha" >/dev/null; \
PYTHONPATH=src .venv/bin/python -m permit_pathways.evidence_export_cli verify \
--archive "$$archive" >/dev/null; \
PYTHONPATH=src .venv/bin/python -m permit_pathways.evidence_export_cli restore \
--archive "$$archive" \
--destination "$$restored" >/dev/null; \
printf '%s\n' 'evidence export round trip: pass'
serve-ai:
PYTHONPATH=src .venv/bin/python -m permit_pathways.ai
# Live evaluation of the runtime AI layer; needs a configured provider.
# Results are dated and name the provider/model so a committed number is
# always traceable to one run (see evals/ai/README.md).
AI_EVAL_PREFIX ?= $(shell date -u +%Y-%m-%d)-$(or $(PERMIT_AI_PROVIDER),anthropic)-$(subst .,-,$(or $(PERMIT_AI_MODEL),claude-sonnet-5))
ai-eval:
PYTHONPATH=src .venv/bin/python -m permit_pathways.ai.eval intake \
--cases evals/ai/intake-cases.json \
--output evals/ai/results/$(AI_EVAL_PREFIX)-intake.json
PYTHONPATH=src .venv/bin/python -m permit_pathways.ai.eval grounding \
--cases evals/ai/grounding-cases.json \
--output evals/ai/results/$(AI_EVAL_PREFIX)-grounding.json
verify: install lint type test security bundle-check copy-check readability-check evidence-export-check