aboutsummaryrefslogtreecommitdiff
path: root/justfile
blob: f2fcb92b5fa4948a2082d29cca6813ec54b2fe81 (plain)
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
# fluxrec tasks. Convention: one comment per recipe, 3–4 words max.
# Details live in README.md, not here.

# Build binary
build:
    go build -o fluxrec .

# Run tests
test:
    go test ./...

# Format code
fmt:
    go fmt ./...

# Vet code
vet:
    go vet ./...

# Remove binary
clean:
    rm -f fluxrec

# Smoke-score a title
score TITLE MODEL="model.json":
    echo "{{TITLE}}" | go run . score --model {{MODEL}}

# Print auth exports
auth:
    @echo 'export MFLUX_URL="https://your-miniflux-host"    # base URL, no trailing slash'
    @echo 'read -s MFLUX_TOKEN && export MFLUX_TOKEN        # Settings -> API Keys; input hidden'

# Assert Miniflux credentials
check-auth:
    @test -n "${MINIFLUX_URL:-${MFLUX_URL:-}}" -a -n "${MINIFLUX_TOKEN:-${MFLUX_TOKEN:-}}" || { echo "not authed; run: just auth"; exit 1; }
    @echo "auth ok (URL=${MINIFLUX_URL:-${MFLUX_URL:-}})"

# Capture dev fixtures
dump-fixtures DIR="testdata": check-auth
    go run . export --dump-raw {{DIR}}

# Hand-star aid
retrostar LIMIT="50":
    go run . retrostar --limit {{LIMIT}}

# Per-feed star audit
feeds DAYS="180" MIN_PER_DAY="0.05" MIN_SEEN="0": check-auth
    go run . feeds --days {{DAYS}} --min-per-day {{MIN_PER_DAY}} --min-seen {{MIN_SEEN}}

# export + compact + train
retrain: check-auth
    go run . export
    go run . compact-labels
    go run . train labels.jsonl
    @echo "report: report.json — check precision@15 >= 0.10 before shipping"

# scp model to server
deploy SERVER:
    scp model.json {{SERVER}}:~/fluxrec-data/

# Recreate serve container
restart SERVER:
    ssh {{SERVER}} 'cd ~/services && docker-compose up -d --force-recreate fluxrec'

# Rebuild + recreate image
rebuild SERVER:
    ssh {{SERVER}} 'cd ~/services && git pull && docker-compose build --no-cache fluxrec && docker-compose up -d --force-recreate fluxrec'

# deploy + restart
ship SERVER: (deploy SERVER) (restart SERVER)
    @echo "model shipped; serve restarted — watch /api/status next run"

# retrain + ship
refresh SERVER: retrain (ship SERVER)
    @echo "refreshed: retrained locally + model shipped to {{SERVER}}"

# Show serve status
status REC_URL:
    curl -sS {{REC_URL}}/api/status | python3 -m json.tool

# Poll out of schedule
poll-now REC_URL:
    curl -sS -X POST {{REC_URL}}/api/poll