refactor composer to use sqlalchemy, avoid string concatenations and follow conventions

This commit is contained in:
2026-06-03 12:10:30 -03:00
parent cbc7df8c60
commit be09fcde2c
16 changed files with 546 additions and 273 deletions

View File

@@ -1,4 +1,5 @@
.PHONY: kind tilt-up tilt-down seed seed-fetch seed-push recon evals test \
run-log run-logs \
compose-up compose-down compose-clean compose-seed compose-recon compose-evals \
docs-graphs
@@ -51,6 +52,23 @@ recon:
evals:
kubectl $(KCTX) $(KNS) exec deploy/api -- uv run python -m api.evals.run_evals
# Pull a run's JSONL transcript from the api pod to the host. The api writes
# every published event into /app/.data/logs/<RUN>.jsonl inside the pod;
# this target copies it next to .data/logs/ on the host so it's easy to
# share / grep / paste a path to.
# Usage: make run-log RUN=<run_id>
run-log:
@[ -n "$(RUN)" ] || { echo "usage: make run-log RUN=<run_id>" >&2; exit 1; }
@mkdir -p .data/logs
@POD=$$(kubectl $(KCTX) $(KNS) get pod -l app=api -o jsonpath='{.items[0].metadata.name}'); \
kubectl $(KCTX) $(KNS) cp $$POD:/app/.data/logs/$(RUN).jsonl .data/logs/$(RUN).jsonl \
&& echo "→ .data/logs/$(RUN).jsonl"
# List the runs the api currently has log files for (most recent first).
run-logs:
@POD=$$(kubectl $(KCTX) $(KNS) get pod -l app=api -o jsonpath='{.items[0].metadata.name}'); \
kubectl $(KCTX) $(KNS) exec $$POD -- sh -c 'ls -1t /app/.data/logs 2>/dev/null || echo "(no logs yet)"'
# Unit tests run on the host venv (no postgres/llm calls needed).
# Ensures dev extras are installed first; uv is idempotent on no-ops.
test: