diff options
| -rw-r--r-- | justfile | 38 |
1 files changed, 22 insertions, 16 deletions
@@ -1,77 +1,83 @@ -# fluxrec task automation +# 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 -# Quick smoke: train-free, needs a model.json +# Smoke-score a title score TITLE MODEL="model.json": echo "{{TITLE}}" | go run . score --model {{MODEL}} -# Print the two export lines to paste in your shell (just can't set them for you) +# 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' -# Guard for recipes that hit the live API (token never echoed) +# 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 from the live API; run once, then offline dev +# Capture dev fixtures dump-fixtures DIR="testdata": check-auth go run . export --dump-raw {{DIR}} -# Retroactive-starring aid: model-ranked read+unstarred candidates to star by hand +# Hand-star aid retrostar LIMIT="50": go run . retrostar --limit {{LIMIT}} -# Pruning audit: per-feed volume + star stats +# 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 the negative pool to the per-feed ceiling, then train (never deploys) +# 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" -# Ship a freshly trained model.json to SERVER's state dir (SERVER = ssh alias) +# scp model to server deploy SERVER: scp model.json {{SERVER}}:~/fluxrec-data/ -# Recreate the serve container (plain `restart` reuses the old command; this applies compose changes too) +# Recreate serve container restart SERVER: ssh {{SERVER}} 'cd ~/services && docker-compose up -d --force-recreate fluxrec' -# Rebuild the serve image from latest git on the server, then recreate +# Rebuild + recreate image rebuild SERVER: - ssh {{SERVER}} 'cd ~/services/fluxrec && git pull && cd .. && docker-compose build --no-cache fluxrec && docker-compose up -d --force-recreate fluxrec' + ssh {{SERVER}} 'cd ~/services && git pull && docker-compose build --no-cache fluxrec && docker-compose up -d --force-recreate fluxrec' -# deploy + restart in one verb +# deploy + restart ship SERVER: (deploy SERVER) (restart SERVER) @echo "model shipped; serve restarted — watch /api/status next run" -# retrain + ship in one verb (no report gate; use retrain/ship separately if unsure) +# retrain + ship refresh SERVER: retrain (ship SERVER) @echo "refreshed: retrained locally + model shipped to {{SERVER}}" -# Serve status: last run, model age, poll counts (REC_URL = the fluxrec serve base URL) +# Show serve status status REC_URL: curl -sS {{REC_URL}}/api/status | python3 -m json.tool -# Trigger an out-of-schedule poll (serialized + cooldown-gated server-side; REC_URL = fluxrec serve base URL) +# Poll out of schedule poll-now REC_URL: curl -sS -X POST {{REC_URL}}/api/poll |
