-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (57 loc) · 1.84 KB
/
Makefile
File metadata and controls
70 lines (57 loc) · 1.84 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
.PHONY: build install run-qdrant stop-qdrant doctor tidy test test-integration vet smoke
BIN := lore
BIN_DIR := $(shell go env GOPATH)/bin
build:
go build -o $(BIN) ./cmd/lore
install:
go install ./cmd/lore
tidy:
go mod tidy
vet:
go vet ./...
test:
go test ./...
test-integration:
go test -tags integration ./tests/... -v -timeout 120s
run-qdrant:
docker compose -f deploy/docker-compose.yml up -d
stop-qdrant:
docker compose -f deploy/docker-compose.yml down
doctor: build
./$(BIN) doctor
# smoke: quick end-to-end test against running Qdrant + Ollama
# Prerequisites: make run-qdrant && ollama pull nomic-embed-text
# Usage:
# make smoke
# make smoke REPO=/absolute/path/to/repo
SMOKE_REPO ?= $(shell pwd)
SMOKE_ID ?= smoke-test-$(shell date +%s)
smoke: build
@echo "=== lore init ==="
./$(BIN) init
@echo ""
@echo "=== lore add ==="
./$(BIN) add \
--kind decision \
--title "Smoke test: use PostgreSQL" \
--content "Chose Postgres over MySQL because of JSONB support and better query planner." \
--repo "$(SMOKE_REPO)" \
--tags "smoke,database"
@echo ""
@echo "=== lore search ==="
./$(BIN) search --repo "$(SMOKE_REPO)" "which database did we choose"
@echo ""
@echo "=== lore list ==="
./$(BIN) list --repo "$(SMOKE_REPO)" --limit 3
@echo ""
@echo "=== lore forget (cleaning up) ==="
@# Get the ID of the most recent smoke memory and delete it
./$(BIN) list --repo "$(SMOKE_REPO)" --json 2>/dev/null | \
python3 -c "import sys,json; d=json.load(sys.stdin); [print(m['id']) for m in d if 'smoke' in m.get('title','')]" | \
head -1 | xargs -I{} ./$(BIN) forget {} 2>/dev/null || true
@echo ""
@echo "=== smoke test complete ==="
# ingest-session: ingest a Claude Code session transcript
# Usage: make ingest-session TRANSCRIPT=~/.claude/sessions/abc123.jsonl
ingest-session: build
./$(BIN) ingest-session "$(TRANSCRIPT)"