-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
215 lines (174 loc) · 7.3 KB
/
Copy pathMakefile
File metadata and controls
215 lines (174 loc) · 7.3 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
UV ?= uv
PNPM ?= pnpm
PYTHON := .venv/bin/python
.PHONY: help setup postgres seed test test-backend test-frontend lint \
dev dev-local dev-fresh dev-foundry dev-fabric dev-work-iq stop frontend \
demo scan eval judge-proof cloud-proof semantic-pr-export work-iq-proof \
fabric-proof foundry-hosted-deploy foundry-hosted-smoke agent-smoke \
foundry-agent-dry-run foundry-agent-smoke foundry-hosted-dry-run \
foundry-hosted-package capture fabric-mcp-diagnose \
fabric-bootstrap-dry-run fabric-bootstrap replay-check \
capture-deliberation court-replay-check clean
FOUNDRY_AGENT_PROVIDER ?= local
FOUNDRY_AGENT_WORKFLOW_MODE ?= strict
FOUNDRY_AGENT_SERVICE ?= concord-iq-2
FOUNDRY_AGENT_IMAGE ?= concord-iq-agent:learning
FOUNDRY_MODEL_DEPLOYMENT ?= Llama-3.3-70B-Instruct
LAUNCH := $(PYTHON) -m concord.dev_launcher
# ---------------------------------------------------------------------------
# help — the first command in the README
# ---------------------------------------------------------------------------
help:
@echo "Concord IQ — make commands"
@echo ""
@echo "Start the application"
@echo " make setup One-time local setup (deps, Postgres, schema, seed)"
@echo " make dev Learning demo: Fabric live + replay + Foundry live"
@echo " make dev-local Safe local UI (cloud disabled)"
@echo " make dev-fresh Reset synthetic demo state and start the cold-open UI"
@echo " make dev-foundry Foundry-hosted UI (token acquired automatically)"
@echo " make dev-fabric Live Fabric IQ UI (token acquired automatically)"
@echo " make dev-work-iq Work IQ UI (MSAL delegated authentication)"
@echo " make stop Stop only the Concord IQ dev processes"
@echo " make demo Print the three deterministic scenario verdicts"
@echo ""
@echo "Verify the project"
@echo " make judge-proof Reproducible mandatory judge proof"
@echo " make test Backend + frontend tests"
@echo " make lint Ruff + frontend lint/typecheck"
@echo " make eval Deterministic safety scorecard"
@echo ""
@echo "Cloud proofs"
@echo " make foundry-hosted-deploy Build, deploy, and smoke the learning agent"
@echo " make cloud-proof All configured live cloud proofs"
@echo " make foundry-hosted-smoke Foundry Agent Service hosted smoke"
@echo " make fabric-proof Fabric IQ sanitized replay proof"
@echo " make work-iq-proof Work IQ retrieval proof (honest status)"
@echo " make semantic-pr-export SHA-256 content-hashed semantic-PR export"
@echo ""
@echo "Maintenance"
@echo " make seed Reseed deterministic DuckDB data"
@echo " make replay-check Verify the committed Fabric IQ replay artifact"
@echo " make clean Remove local DuckDB and frontend build output"
# ---------------------------------------------------------------------------
# Start the application
# ---------------------------------------------------------------------------
setup:
@command -v $(UV) >/dev/null 2>&1 || { echo "Missing required tool: uv (https://docs.astral.sh/uv/)"; exit 1; }
@command -v $(PNPM) >/dev/null 2>&1 || { echo "Missing required tool: pnpm"; exit 1; }
@command -v docker >/dev/null 2>&1 || { echo "Missing required tool: docker"; exit 1; }
$(UV) sync --extra dev
$(PNPM) --dir frontend install --frozen-lockfile
docker compose up -d --wait postgres
$(PYTHON) -m concord.storage.db
$(PYTHON) -m concord.seed.seed_duckdb
@echo "Setup complete. Start the app with: make dev"
postgres:
docker compose up -d --wait postgres
seed:
$(PYTHON) -m concord.seed.seed_duckdb
dev: postgres seed
$(LAUNCH) --mode demo
dev-local: postgres seed
$(LAUNCH) --mode local
dev-fresh:
@echo "dev-fresh resets ONLY local synthetic Concord IQ state (Postgres volume + DuckDB)."
@echo "It never touches Azure, Fabric, Foundry, SharePoint, or committed replay artifacts."
docker compose down -v
docker compose up -d --wait postgres
$(PYTHON) -m concord.storage.db
$(PYTHON) -m concord.seed.seed_duckdb
$(LAUNCH) --mode local --reset
dev-foundry: postgres seed
$(LAUNCH) --mode foundry
dev-fabric: postgres seed
$(LAUNCH) --mode fabric
dev-work-iq: postgres seed
$(LAUNCH) --mode work-iq
stop:
$(LAUNCH) --stop
frontend:
$(PNPM) --dir frontend dev
demo: postgres seed
$(PYTHON) -m concord.demo
scan: seed
$(PYTHON) -m concord.scan
# ---------------------------------------------------------------------------
# Verify the project
# ---------------------------------------------------------------------------
test: test-backend test-frontend
test-backend:
docker compose up -d --wait postgres
$(PYTHON) -m pytest
test-frontend:
$(PNPM) --dir frontend test
lint:
$(PYTHON) -m ruff check backend tests
$(PYTHON) -m ruff format --check backend tests
$(PNPM) --dir frontend lint
eval: postgres seed
$(PYTHON) -m concord.evals
judge-proof: postgres seed
$(PYTHON) -m concord.judge_proof
# ---------------------------------------------------------------------------
# Cloud proofs
# ---------------------------------------------------------------------------
foundry-hosted-deploy:
azd env set AZURE_AI_MODEL_DEPLOYMENT_NAME $(FOUNDRY_MODEL_DEPLOYMENT)
docker buildx build --platform linux/amd64 --load -t $(FOUNDRY_AGENT_IMAGE) .
azd deploy $(FOUNDRY_AGENT_SERVICE) --from-package $(FOUNDRY_AGENT_IMAGE)
$(MAKE) foundry-hosted-smoke
cloud-proof:
$(PYTHON) -m concord.cloud_proof
semantic-pr-export: postgres seed
$(PYTHON) -m concord.semantic_pr_export
work-iq-proof:
$(PYTHON) -m concord.work_iq_proof
fabric-proof: replay-check
foundry-hosted-smoke:
$(PYTHON) -m concord.ms_agent.foundry_hosted --smoke
# ---------------------------------------------------------------------------
# Lower-level cloud tooling (used by the proofs above)
# ---------------------------------------------------------------------------
agent-smoke: postgres seed
CONCORD_SCENARIO_PACK=business PYTHONWARNINGS="ignore::FutureWarning" \
$(PYTHON) -c "from concord.ms_agent.workflow import main; main()" \
--term "$${FOUNDRY_SMOKE_TERM:-Certification Ready}" \
--period "2026-03-04/2026-06-01" \
--provider local
foundry-agent-dry-run:
PROVIDER=local ALLOW_CLOUD=false MAX_CLOUD_CALLS=0 \
$(UV) run --extra dev --extra foundry-hosting \
python -m concord.ms_agent.foundry_hosted_entrypoint \
--dry-run \
--provider local \
--workflow-mode $(FOUNDRY_AGENT_WORKFLOW_MODE)
foundry-agent-smoke: postgres seed
PROVIDER=$(FOUNDRY_AGENT_PROVIDER) ALLOW_CLOUD=false MAX_CLOUD_CALLS=0 \
$(UV) run --extra dev --extra foundry-hosting \
python -m concord.ms_agent.foundry_hosted_entrypoint \
--smoke \
--provider $(FOUNDRY_AGENT_PROVIDER) \
--workflow-mode $(FOUNDRY_AGENT_WORKFLOW_MODE)
foundry-hosted-dry-run:
$(PYTHON) -m concord.ms_agent.foundry_hosted --dry-run
foundry-hosted-package:
$(PYTHON) -m concord.ms_agent.foundry_hosted --package
capture:
$(PYTHON) -m concord.capture
fabric-mcp-diagnose:
$(PYTHON) -m concord.fabric_mcp_diagnose
fabric-bootstrap-dry-run:
$(PYTHON) -m concord.fabric_bootstrap --dry-run
fabric-bootstrap:
$(PYTHON) -m concord.fabric_bootstrap
replay-check:
$(PYTHON) -m concord.replay_check
PROVIDER=replay ALLOW_CLOUD=false MAX_CLOUD_CALLS=0 $(MAKE) demo
capture-deliberation: postgres seed
$(PYTHON) -m concord.court.capture
court-replay-check:
$(PYTHON) -m concord.court.deliberation_check
clean:
rm -f data/concord_iq.duckdb
rm -rf frontend/dist