Commit Graph
22 Commits
Author SHA1 Message Date
Noel 603b1c8cee Merge pull request 'feat: PreZero priority snapshot and internal API' (#4) from feat/prezero-api into main
ci / check (push) Successful in 29s
Reviewed-on: #4
2026-11-14 18:25:04 +00:00
Noel Sabia ad63d1caf3 feat: prezero priority snapshot and internal API
ci / check (push) Successful in 30s
ci / check (pull_request) Successful in 29s
Build artifacts/prezero_priority.json from the anonymized glass fill-level export (11,701 rows, 449 containers, 1,338 location/material series). The contract tier rule yields high 88, medium 248, low 113 with 1,192 overfull readings.

Add /prezero/summary, /prezero/priority, and /prezero/containers/{id} to the internal FastAPI service, with startup validation, filtering/pagination, recent reading history, and 503 isolation when the artifact is missing. Raw CSV stays gitignored; the derived 1.1 MB artifact is the source of truth. This is a priority proof, not a route: the dataset has no coordinates.
2026-11-14 18:06:02 +01:00
Noel 507f33b7ea Merge pull request 'feat: ci docs' (#3) from feat/ci-docs into main
ci / check (push) Successful in 32s
Reviewed-on: #3
2026-11-14 08:31:59 +00:00
Noel 8a10b3c8ed Merge branch 'main' into feat/ci-docs
ci / check (push) Successful in 29s
ci / check (pull_request) Successful in 28s
2026-11-14 08:28:24 +00:00
Noel Sabia ac0d8984bb docs: correct reproduction and cache claims
ci / check (push) Successful in 28s
ci / check (pull_request) Successful in 30s
The small-model page said make small reproduced every number, but the
threshold table and several derived values only appear in the JSON payload.
Say what the commands actually print, fix the stale weather-cache docstring,
and lead the e2e evidence page with what it checks.
2026-11-14 09:12:29 +01:00
Noel Sabia 070ecd2a78 ci: fix Gitea runner setup and tighten docs
ci / check (push) Successful in 1m12s
Replace setup-python with setup-uv: the self-hosted Gitea runner lacks the
toolcache and lsb_release dependency, so the job failed before any project
step. uv installs its own Python 3.12; the checks are unchanged.

Align the README and docs with the committed artifacts: quick start serves
from baked artifacts, rebuild steps are separate, and the reference-model
comparison no longer overstates the result. Drop stale external-doc
references and comments that restated the code.
2026-11-14 09:10:47 +01:00
Noel Sabia 9c7f77f66b merge: small-model artifact, train e2e, final metrics 2026-11-14 07:39:11 +01:00
Noel 48f8d2ee1b Merge pull request 'feat: snapshot' (#2) from feat/snapshot into main
ci / check (push) Failing after 5s
Reviewed-on: #2
2026-11-14 05:37:48 +00:00
Noel Sabia c7ea524b5b docs: small-model artifact, paper metrics, train e2e evidence
- docs/small-model.md: target, features, split, metrics, full confusion
  matrix, per-sensor table, honest limits
- docs/metrics.md: provenance, protocol, headline, ablation, per-sensor,
  uncertainty, small model, supported/unsupported claims
- docs/figures: generated ablation, per-sensor, confusion-matrix SVGs
- docs/train-e2e.md: exact 38-check live run, small + forecast job results
- model_card.md and README updated with final metrics and links
2026-11-14 06:35:22 +01:00
Noel Sabia 2bcf66c550 feat: repeatable small-model, figures, and training e2e scripts
- make small trains from a CSV and prints metrics + confusion matrix
- make figures renders dependency-free SVGs from metrics.json
- scripts/e2e_train.py boots a real server and checks snapshot, robustness,
  auth, one-job-at-a-time, and both training jobs with hot-swap
- CI/ruff/compileall now include scripts/
2026-11-14 06:35:19 +01:00
Noel Sabia 000aaed7a5 feat: per-sensor holdout metrics and small-model confusion matrix
- train.py emits per-sensor MAE/WAPE/R2 vs the seasonal-naive baseline
- small.py emits the full confusion matrix and per-sensor classifier metrics
- metrics.json now carries the small-model summary for paper support
- regenerate baked artifacts; tests assert the tables are internally consistent
2026-11-14 06:35:14 +01:00
Noel Sabia 4ea7212b70 merge: /bootstrap snapshot, numeric UID, CI 2026-11-14 06:15:06 +01:00
Noel 69a8abf00f Merge branch 'main' into feat/snapshot
ci / check (push) Failing after 6s
ci / check (pull_request) Failing after 6s
2026-11-14 05:04:54 +00:00
Noel Sabia 2b9617fd71 ci: add ruff static gate to make check and Gitea workflow
ci / check (push) Failing after 40s
ci / check (pull_request) Failing after 6s
Adds ruff as a dev dependency with an explicit py312 E/F rule set, so the
gate stays stable across ruff releases. make check now runs uv sync --frozen,
ruff, compileall, and pytest; make lint runs ruff alone.

The Gitea job splits the same checks into named steps for readable failures
and has a 10-minute timeout. No secrets, image push, or cluster access.
2026-11-14 06:04:15 +01:00
Noel Sabia 8656d9bc8a feat: add /bootstrap snapshot, numeric UID 10001, CI gate
GET /bootstrap returns the 8 sensors, hourly series for all of them,
context, meta, and versions in the CONTRACT.md shape. Snapshot artifacts
are projected to contract fields once at boot; incomplete artifacts return
503. Adds tests for shape, sensor count, hourly alignment, and versions.

Dockerfile now creates UID/GID 10001, uses COPY --chown=10001:10001, and
runs as USER 10001:10001. Adds make check and a minimal Gitea Actions
workflow that runs the same local gate: uv sync --frozen, compileall, pytest.
2026-11-14 06:00:14 +01:00
Noel Sabia 7ec4fc8bb3 merge: ML pipeline, FastAPI, small model, artifacts 2026-11-14 05:52:02 +01:00
Noel 750726e514 Merge pull request 'feat: ml bootstrap' (#1) from feat/ml-bootstrap into main
Reviewed-on: #1
2026-11-14 04:17:58 +00:00
Noel Sabia dc83825de0 fix: use exact 168-row lag for the seasonal-naive baseline
The baseline now reproduces mission/data.md exactly: MAE 5.40, WAPE 44.7%,
R2 0.462. The model's lag_week remains the previous observed same weekday/hour,
which handles sensor gaps and is documented in the model card.
2026-11-14 05:04:41 +01:00
Noel Sabia 939a8db482 feat: complete ML pipeline, FastAPI service, small model, tests, image
- finish the global HistGB bundle, scenario forecasts and 28-day ablation
- export sensors/series/forecasts/metrics/context plus baked weather frames
- add FastAPI health/meta/predict/simulate and background /train jobs
- add the p75 busy classifier, retraining from CSV, and hot-swap persistence
- add pytest coverage, multi-stage non-root Dockerfile, README and model card

Holdout: weather 7d MAE 3.32 / WAPE 27.5% / R2 0.777 vs seasonal naive
MAE 4.23 / WAPE 35.0% / R2 0.656 (5,350 eval rows).
2026-11-14 05:01:16 +01:00
Noel Sabia 68402803b2 feat: add pipeline and training entrypoints 2026-11-14 04:24:15 +01:00
Noel Sabia 8a81af771e chore: sync ML environment 2026-11-14 04:23:43 +01:00
Noel Sabia 2eeb1f937a chore: bootstrap ML-py scaffold 2026-11-14 04:16:22 +01:00