Northline reference lab
=======================

Python 3.11 or newer, standard library only. From this directory:

    python3 test_all.py

On Windows the command is:

    py test_all.py

The scripted model in northline/scripted.py is not a language model. It
exercises the loop, the allowlist, and the step budget. It does not prove
provider behavior, paraphrase search, or prompt-injection resistance of a
model. The refund gateway tests do prove that a persuaded caller still cannot
commit an over-ceiling refund.

Embed in northline/retrieve.py is a token feature hash, not a semantic
embedding model.

jobs.py uses SQLite and does not demonstrate Postgres SKIP LOCKED.

httpapi.serve binds 127.0.0.1 by default. Set NORTHLINE_TOKEN before serving
/v1/tasks. /health does not need the token.

    NORTHLINE_TOKEN=dev python3 -m northline.httpapi

This is teaching code for the Grok11 studio notes. It is not a hosted service.

Week 1 cases: northline/cases_week1.json (15 rows). eval_week1.run_all
scores them. The two-id case documents a stand-in limit: the scripted model
looks up the first four-digit id only.

Cache: northline/cache.py keys query + sorted groups + embed version
+ corpus version. Bump the corpus version when a chunk is upserted or
tombstoned. The embed version does not do that.

dispatch(..., admit=False) returns 429 before the model. Successful task
responses include trace_id in the JSON body and not the transcript. The
handler does not set a trace header.

enqueue returns lastrowid only when rowcount is 1. A conflict selects by
idempotency_key. Non-dict tool arguments, including null and [], are
arguments_must_be_object. judge.py holds recorded rubric answers and does
not call a model.

python3 test_all.py runs 31 tests.

Dockerfile runs test_all.py as uid 10001, not root. ci-example.yml is the
pull-request job. It does not call a model provider.
