Backend (app-pfm-ocr-v2/backend): - Product/SKU scan feature complete: trained DINOv2 index (118 reference photos, 16 SKU classes) and YOLO classifier (83.3% top-1 val accuracy), fixed scripts/install-pipeline.sh (was missing ultralytics/torch), fully browser-verified end-to-end on /scan-pfm. Mobile m-scan-pfm page cancelled (Flutter app handles mobile; web UI is desktop-only for pipeline testing). - Fixed a real data-loss bug: Save Ground Truth (scan-pfm and the DO-flow's manual-label) was silently writing into the pfm-web-app container's ephemeral filesystem instead of the host, because /sources wasn't bind-mounted in docker-compose.yml. Added the mount, recovered an orphaned entry. - accounts.password is now bcrypt-hashed (bcryptjs, idempotent migration in db/init.ts) instead of plaintext; login route compares hashes. - /api/v1/documents/* (list, PUT, upload) now enforces real 401 auth, matching what the Flutter client already sends. The "classic" routes deliberately stay open — they're dev-only web UI with no login flow and won't exist in production. - OCR accuracy investigated end-to-end: real baseline is 95.10% overall (target met; accuracy_report.md was stale at 75.04%, now flagged). Fixed one genuine parser.ts bug (SO/DO field duplication in the global fallback regex); remaining gaps are OCR/layout-model limitations, not parser bugs. - Adopted a standalone copy of the fhanyuh/agents-settings e/n workflow scoped to backend/ (AGENTS.md Part A/B split, SKILLS.md, plans/, docs/), independent of the root copy which now covers Flutter only. - next-implementation.md deleted; content folded into backend/plans/next-enhancements.md for traceability. Root: - Adopted fhanyuh/agents-settings kit (AGENTS.md, SKILLS.md, plans/, docs/feature-list.md), scoped to the Flutter app only. - Pending documents queue now persists to Hive (lib/core/storage) instead of memory-only, surviving an app kill mid-upload. Removed backend_backup/ (stale Express/Prisma prototype, superseded by pfm-web-app) and the completed plans/next-enhancement-plan.md checklist. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
62 lines
3.5 KiB
Markdown
62 lines
3.5 KiB
Markdown
# Feature List (Flutter)
|
|
|
|
Structured log of shipped features, updated by the `n`/`next` workflow
|
|
(see [AGENTS.md](../AGENTS.md)) whenever a task is marked `[DONE]`. Organize entries
|
|
under a heading per module/section, matching `plans/next-enhancements.md`. Scoped to
|
|
**Flutter only** as of 2026-07-08 (see `AGENTS.md`'s "Scope: excludes `backend/`") —
|
|
the Backend sections below are a frozen historical record; the active backend
|
|
feature log now lives at
|
|
[backend/docs/feature-list.md](../backend/docs/feature-list.md), driven by
|
|
`backend/AGENTS.md` Part B.
|
|
|
|
## Format
|
|
|
|
```
|
|
## <Section / Module Name>
|
|
|
|
- **<task number>** <feature description> — shipped <date>
|
|
```
|
|
|
|
---
|
|
|
|
## Existing Features (pre-kit)
|
|
|
|
Backfilled 2026-07-08 during adoption of this kit — these predate the `e`/`n`
|
|
workflow and have no task numbers; see `git log` for real dates/history.
|
|
|
|
### Flutter — Auth & Splash
|
|
- Login screen with client-side validation; JWT session persisted via Hive; splash auto-navigates based on session state.
|
|
|
|
### Flutter — Camera Capture & Geotagging
|
|
- Laplacian-variance blur detection with a pass/fail badge before upload.
|
|
- IMU stillness lock (linear/angular thresholds) gating the shutter.
|
|
- GPS geotagging on both camera capture and gallery picks.
|
|
|
|
### Flutter — Pending Documents Queue
|
|
- In-memory upload queue with per-item status (uploading/processing/success/error), retry (preserving original GPS), delete, and search filter.
|
|
|
|
### Flutter — Document Editor & PDF Receipt
|
|
- Header field validation (date, PO/SO number formats), item CRUD validated against the master SKU registry, signature + confirmation submission, local PDF receipt printing.
|
|
|
|
### Backend — Next.js API Gateway
|
|
- Upload/parse/documents CRUD routes, GPU status endpoint, vLLM proxy, manual-label review tool.
|
|
|
|
### Backend — OCR Pipeline & Accuracy
|
|
- PaddleOCR + vLLM classification pipeline with DB layout caching, table column-shift correction, date normalization, and an accuracy regression harness (`backend/pfm-web-app/scripts/accuracy-check.mts`) currently at ~89.4% overall (target 95% — see `backend/CLAUDE.md`).
|
|
|
|
### Backend — Postgres Data Layer
|
|
- Schema/init in `backend/pfm-web-app/src/db/init.ts`, served via the canonical root `docker-compose.yml` stack.
|
|
|
|
### DevOps — Docker & Dev Tunnel
|
|
- Root `docker-compose.yml` (dev, hot-reload) and `docker-compose.demo.yml` (production-mode override); `start-dev-tunnel.ps1` syncs the host LAN IP into the Flutter app config and starts an ngrok tunnel.
|
|
|
|
*(New features shipped via `n`/`next` go below, organized the same way, with task numbers.)*
|
|
|
|
## Flutter — Pending Documents Queue
|
|
|
|
- **3.1** Persisted the pending documents queue to a new Hive box (`lib/core/storage/local_storage.dart`) instead of holding it in memory only — an OS-level app kill mid-upload no longer silently loses the document. On next launch, `PendingDocumentsNotifier` reloads the queue and resumes anything left non-terminal: re-uploads a fresh capture from scratch (safe due to server-side file-hash dedup) or resumes polling for one whose upload already completed. Storage failures degrade gracefully to the old in-memory-only behavior rather than crashing the app — shipped 2026-07-08.
|
|
|
|
## Backend — Postgres Data Layer
|
|
|
|
- **7.1** Wrapped the `ocr_items` delete-then-reinsert in `/api/parse` and `/api/v1/documents/[id]` PUT inside a DB transaction (`withTransaction` helper, `backend/pfm-web-app/src/db/index.ts`) — a mid-loop insert failure now rolls back to the previous item set instead of leaving a document with a correct header but partial/missing items — shipped 2026-07-08.
|