feat: DO-gated manual batch mode (auto default, office-only switches)
ci / smoke (push) Canceled after 0s

This commit is contained in:
andrew committed 2026-09-24 15:45:12 +07:00
1 parent 735e0c7594
commit 0efcfa45b8
20 files changed
+3128 -209

No files matched your search

+24 -1
View File
@@ -6,7 +6,30 @@ version tags are cut in this repo — POC stage, `main` is the release line).
## [Unreleased]
Nothing pending.
### Added
- **DO-gated manual batch mode** (`auto` default · `do_manual` · legacy `manual`):
smartphone photo capture → OCR draft → plate-grouped start gates → net
expected/counted on live panel → stop soft-warn + force → discard only when
**both** `net_sack` and `net_box` are 0.
- `config.yaml` `batch.default_mode` + `do:` block; `DoConfig` in
`src/config_loader.py`; runtime `$OUTPUT_DIR/do_settings.json`.
- `delivery_orders` table + additive `batches` columns (`plate`, `do_numbers`,
`expected_*`, `net_*`); photo tree `do_photos/YYYY-MM-DD/` (7-day retention).
- APIs: `POST /api/batch/stop-preview`, DO CRUD + `POST /api/do/upload`,
`GET|POST /api/do/settings` (office-only plate/do flags; **ocr_engine both
ports**), office-only mode/model_mode POST (403 on operator; 409 when batch active).
- `src/do_batch.py` (pure gates/nets/units), `src/do_ocr.py`
(`extract_do_fields` tesseract|paddle|none).
- Operator DO panel + OCR toggle; monitoring 3-way mode switch + model mode +
OCR/require-plate controls; history/export plate, DO, expected, net columns.
- `docs/do-erd.md` (Mermaid ERD); tests `tests/test_do_batch.py`.
### Changed
- Default batch mode seed **`auto`** (was hard-coded `manual` when
`batch_mode.json` missing); `predict.py` accepts `do_manual` as operator-driven
and persists sack `unloading` for net-at-stop.
- Finalize discard rule (dashboard stop **and** `predict.py` `finalize_batch`):
keep row if **either** net ≠ 0 (box-only batches no longer dropped).
## 2026-09-18 — Config tuning: Sack confidence and batch timeout