diff options
Diffstat (limited to 'justfile')
| -rw-r--r-- | justfile | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/justfile b/justfile new file mode 100644 index 0000000..6921ac4 --- /dev/null +++ b/justfile @@ -0,0 +1,68 @@ +# fluxrec task automation (planned commands per PLAN.md, only implemented ones run) + +build: + go build -o fluxrec . + +test: + go test ./... + +fmt: + go fmt ./... + +vet: + go vet ./... + +clean: + rm -f fluxrec + +# Quick smoke: train-free, needs a model.json (from `fluxrec train`, future) +score TITLE MODEL="model.json": + echo "{{TITLE}}" | go run . score --model {{MODEL}} + +# ── auth (same pattern as the mflux justfile) ── + +# Print the two export lines to paste in your shell (just can't set them for you) +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) +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 +dump-fixtures DIR="testdata": check-auth + go run . export --dump-raw {{DIR}} + +# Retroactive-starring aid: model-ranked read+unstarred candidates to star by hand +retrostar LIMIT="50": + go run . retrostar --limit {{LIMIT}} + +# ── retrain loop ── +# Export new labels, train, print the report path. Eyeball report.json +# (precision@15 >= 0.10) before `just ship SERVER` — retrain never deploys. + +retrain: check-auth + go run . export + go run . train labels.jsonl + @echo "report: report.json — check precision@15 >= 0.10 before shipping" + +# ── deploy lane (local PC → server) ── +# SERVER is an ssh config alias; the agent does auth. No hostnames in this +# file. Run `ship` only after eyeballing report.json — retrain never deploys. + +# Ship a freshly trained model.json to the server +deploy SERVER: + scp model.json {{SERVER}}:/srv/fluxrec/ + +# Restart mechanism pinned at D5 once the container runtime is known; +# adjust the ssh line below then. + +# Bounce the serve container so it picks up the new model +restart SERVER: + ssh {{SERVER}} 'docker restart fluxrec' + +# deploy + restart in one verb +ship SERVER: (deploy SERVER) (restart SERVER) + @echo "model shipped; serve restarted — watch /api/status next run"
\ No newline at end of file |
