Your data drops get checked overnight. You get two lines in the morning.
MorningDrop is a small local agent for anyone who wakes up to a folder of nightly exports: vendor CSVs, storefront dumps, CRM extracts. While you sleep it
- finds the files that are new since last night,
- checks every row against a DataContractGate contract, fully offline,
- asks a local Gemma model (via Ollama) for a two-line summary and suggested fixes,
- checks Gemma's answer with AISchemaGate before it reaches you, and
- writes
reports/YYYY-MM-DD.md,.jsonand a two-linelatest.txt.
No rows leave your machine. No API keys. No per-call bill.
Recorded on a CPU-only box with asciinema + agg; the ~15–30 s Gemma wait is trimmed. Raw cast: docs/demo.cast.
$ morningdrop run
The orders_2026-10-24.csv file failed for 63 rows due to currency and quantity issues.
Prioritize fixing the currency and quantity validation rules in the orders contract.
report: reports/2026-10-25.md (21.7s, summary by model)
Full sample: samples/expected-report.md (a real gemma3:4b run on a CPU-only box).
A small local model is great at turning 60 × enum_violation on currency into
a sentence a tired human can act on. It is also happy to invent a file
called payments.csv, say a red night is green, or repeat your prompt back.
So MorningDrop treats Gemma the way it treats a vendor: its output has a
contract.
| Check | Library | What it catches |
|---|---|---|
Shape: status enum, line1/line2 length, every fix has file, field, kind, suggestion |
AISchemaGate (summary_contract.yaml) |
prose instead of JSON, missing keys, a 400-character "line" |
| Status equals the worst file's status | MorningDrop grounding | "all green!" on a red night |
| line1/line2 name the worst file | MorningDrop grounding | leading with the wrong problem |
| Every number in the text already appears in the facts | MorningDrop grounding | "41 of 300 rows failed" when nothing like that happened |
| Fixes point at real files and real failing fields | MorningDrop grounding | invented files and columns |
When a check fails, the violations go back to Gemma as a repair prompt (up to
max_retries). If only some fixes are bad, those fixes are quarantined and
the rest are kept, the same way DataContractGate quarantines bad rows. If the
model never gets it right, or Ollama isn't running, a plain template writes
the report from the same facts. You always get a correct morning report.
And on a quiet night where everything passed, the model isn't called at all.
What we saw while building it (sample drops, CPU only):
| Model | Result |
|---|---|
gemma3:4b |
Accepted on the first attempt, about 20–35 s |
gemma3:1b |
Valid JSON, but led with the wrong file on all 3 attempts (earlier prompt versions: invented "12 of 80 rows failed" in a file with no contract). Fallback report |
gemma3:270m |
Echoed the instructions back as its summary and suggested fixing data in a file with no failures. Fallback report |
git clone https://github.com/nightmoose/morningdrop && cd morningdrop
python -m venv .venv && . .venv/bin/activate
pip install -e .
ollama pull gemma3:4b # or gemma3:1b on a small laptop
morningdrop run # uses morningdrop.yaml -> samples/drops
cat reports/latest.txtNo Ollama yet? MORNINGDROP_LLM_BACKEND=mock morningdrop run runs the whole
pipeline with a deterministic stand-in model.
Point it at your own folder by editing morningdrop.yaml:
watch: /data/nightly # where the exports land
contracts: contracts # one DataContractGate YAML per dataset
llm:
backend: ollama # ollama | openai | mock
base_url: http://localhost:11434
model: gemma3:4bAny OpenAI-compatible local server works too (llama.cpp llama-server,
vLLM, LM Studio): set backend: openai and base_url. Environment overrides:
MORNINGDROP_LLM_BACKEND, MORNINGDROP_LLM_URL, MORNINGDROP_LLM_MODEL.
Then schedule it: examples/crontab.txt, macOS
launchd, or a systemd
watch service.
orders_2026-10-24.csv → dataset orders → contracts/orders.yaml. The
date suffix is stripped. CSV, JSON (array or {"records": [...]}) and JSONL
are supported. CSV cells are coerced to the contract's declared types; a value
that won't coerce stays a string, so DataContractGate reports an honest
type_mismatch.
New dataset, no contract yet? MorningDrop drafts one from the file
(types, required fields, ranges, small enums, date patterns), compiles it with
DataContractGate to prove it's valid, and saves it to contracts/_proposed/.
It is never enforced until you move it into contracts/. You can also run
morningdrop infer path/to/file.csv.
Re-sent files are recognized by content hash, so the same file twice doesn't produce a second report.
Only counts, field names, violation messages and the contract rule that was
broken, never whole rows. Passing rows are not sent to the model at all.
Violation messages can quote a bad value (value "usa" does not match), which is the
point, and it all stays on your machine anyway.
If SENTRY_DSN is set and sentry-sdk is installed (pip install -e '.[sentry]'),
each run emits spans for the DataContractGate checks, Gemma calls and AISchemaGate
checks. Without it, this does nothing and nothing is sent anywhere.
pip install -e '.[dev]'
pytest -q # offline, uses scripted fake models
MORNINGDROP_LIVE=1 MORNINGDROP_LLM_MODEL=gemma3:4b pytest -s tests/test_live_gemma.py # real GemmaCI runs the offline suite on Python 3.9 and 3.12, plus a best-effort job
that installs Ollama and runs gemma3:1b end to end on a CPU runner.
- Gemma open-weight models, served by Ollama
- DataContractGate (MIT): the
contractgatePython package's offline validator - AISchemaGate (MIT): the
aischemagatepackage, same engine, pointed at LLM output
MIT
