Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
117 lines (92 loc) · 4.37 KB
/
Copy pathMakefile
File metadata and controls
117 lines (92 loc) · 4.37 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
# One verb per capability. Every target fails loudly.
SHELL := /bin/bash
export ACS_DSN ?= postgresql://acs:acs@127.0.0.1:5432/acs
# Use the project venv when it exists; plain python3 otherwise (CI installs globally).
PY := $(shell test -x .venv/bin/python && echo .venv/bin/python || echo python3)
# Demo query, selected by MEASURING, not by hunch: golden line 92, where
# vector-only misses the gold chunk entirely, stage 1 recovers it at rank 5,
# and rerank promotes it to rank 1. Fusion and graph hold position here; they
# earn their rows in the aggregate table, not in this single trace.
Q ?= What is the current state of connection pooling for Sierra-Grommet?
SUBJECT ?= contributor-03
ENTITY ?= CHG-4568
.PHONY: setup demo db-up db-down migrate corpus ingest query bench check lock-baseline \
supersede asof purge graph gateway research vet warmup test hero history \
gateway-client
# setup: one-time; venv + all dependencies (including the pinned local models' libraries)
# CPU-only torch: nothing here touches a GPU. The install is 1.4 GB against
# 5.1 GB with the CUDA wheels. Every direct dependency is exact-pinned;
# transitive dependencies resolve at install time.
setup:
python3 -m venv .venv
.venv/bin/pip install --extra-index-url https://download.pytorch.org/whl/cpu -e ".[dev,local-models]"
# demo: the whole thing from a clean clone; fresh db, corpus, ingest, traced query, benchmark. No keys.
# (Resets the database first so the demo is repeatable, not additive.)
demo: db-down db-up warmup migrate corpus ingest query bench
# warmup is the only demo stage allowed to reach the network. Everything
# downstream runs offline, so a weight warmup did not fetch fails loudly
# here instead of being downloaded silently. `make test` stays online:
# running the suite before warmup on a fresh clone is a supported path.
ingest query bench check: export HF_HUB_OFFLINE=1
db-up:
docker compose up -d --wait
db-down:
docker compose down -v
migrate:
$(PY) -m acs.cli migrate
corpus:
$(PY) corpus/generate.py --docs 480 --seed 7
ingest:
$(PY) -m acs.cli ingest --corpus corpus/out/corpus.jsonl
# query: trace one query through every pipeline stage (the centrepiece)
query:
$(PY) -m acs.cli query "$(Q)" --trace
bench:
$(PY) eval/run_benchmark.py
# check: the CI gate; fail if the benchmark drops below baseline.lock.json
check:
$(PY) eval/run_benchmark.py --check
# lock-baseline: a deliberate act, done in a commit that says so
lock-baseline:
$(PY) eval/run_benchmark.py --lock
# history: list memory identities, or one lineage's full version chain.
# supersede and asof both need a lineage id; this is where a reader gets one.
history:
$(PY) -m acs.cli history $(if $(LINEAGE),--lineage $(LINEAGE),)
supersede:
$(PY) -m acs.cli supersede --lineage "$(LINEAGE)" --content "$(CONTENT)"
asof:
$(PY) -m acs.cli asof --lineage "$(LINEAGE)" --ts "$(TS)"
# purge: deletion that includes the vectors, audited by hash only
purge:
$(PY) -m acs.cli purge --subject "$(SUBJECT)"
# graph: read the entity graph; the supersession chain and the neighbours
graph:
$(PY) -m acs.cli graph "$(ENTITY)" --chain
# gateway: serve the substrate over MCP (TOKEN selects the caller scope)
gateway:
ACS_GATEWAY_TOKEN=$(or $(TOKEN),demo-token-planning) $(PY) -m acs.gateway.server
# gateway-client: the two-callers demo; spawns its own scoped servers over stdio
gateway-client:
$(PY) -m acs.gateway.client "$(Q)"
# research: one research cycle; gaps → search → cited findings, quarantined
research:
$(PY) -m acs.cli research --seed "$(or $(SEED),reciprocal rank fusion background)"
# vet: list quarantined findings, or promote one by id (a deliberate act)
vet:
$(PY) -m acs.cli vet $(if $(ID),$(ID),--list)
# warmup: construct the active profile's adapters up front (local: downloads ~180 MB, once; deterministic: instant)
warmup:
$(PY) -m acs.cli warmup
test:
$(PY) -m pytest
# hero: re-record the README GIF. demo.tape holds every parameter.
# vhs exits 0 even when it writes an empty file, and a failed run can leave
# the previous render in place, so remove the target first and assert the bytes.
hero: query check
rm -f docs/hero.gif
# env -u MAKELEVEL: the tape types make query and make check inside the
# shell this recipe spawns; a level above zero makes them print
# Entering/Leaving directory lines, and the directory is a local path.
env -u MAKELEVEL VHS_NO_SANDBOX=true vhs demo.tape
test -s docs/hero.gif