Commit Graph
30 Commits
Author SHA1 Message Date
Rafhan Mazaya Fathurrahman 9ff4a4a922 docs: add scan-product reference and update backend/root plans for enhancements 2026-07-08 14:50:32 +07:00
Rafhan Mazaya FathurrahmanandClaude Sonnet 5 e60ab63154 Adopt agents-settings kit, ship Product/SKU scan models, harden auth, verify OCR accuracy
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>
2026-07-08 11:56:32 +07:00
Rafhan Mazaya FathurrahmanandClaude Sonnet 5 3df9f6ec5d Add OCR Accuracy section to README with field-level breakdown
Documents the 89.4% overall accuracy (up from 82.2% baseline, 95% target),
grounded in the actual logged run in accuracy_history.jsonl rather than a
vague claim, plus which fields the sanitize/triple-check layer rescues over
raw regex. Notes that current gaps are partly a photo-capture SOP floor
(DO paper photographed on top of other documents confuses auto-deskew),
not just a parsing/OCR ceiling.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eRAsLqN9Sg1b9YPz22Lxz
2026-07-05 00:35:16 +07:00
Rafhan Mazaya FathurrahmanandClaude Sonnet 5 1599eb57d1 Rewrite README with accurate architecture, setup, and install caveats
Replaces stale setup instructions (single hardcoded API URL, old migration
story) with the dual-mode ngrok/LAN config, the demo/production compose
override, and a "what to consider" section grounded in real issues hit this
session: the duplicate backend/docker-compose.yml project-name collision,
store_master shipping unseeded, and the debug-signed APK.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eRAsLqN9Sg1b9YPz22Lxz
2026-07-05 00:16:42 +07:00
Rafhan Mazaya FathurrahmanandClaude Sonnet 5 4808a798fb Add mobile reliability fixes, Bahasa Indonesia UI, and continue OCR accuracy tuning
Reliability/PoC hardening: dedupe uploads by file_hash, surface editor sync
failures instead of a false success SnackBar with a retry-without-re-OCR path,
bound the OCR pipeline fetches with timeouts, share a single ApiClient/Dio
instance app-wide, tune capture JPEG quality, and add an opt-in
docker-compose.demo.yml for a production-mode run ahead of client demos.

Translate all Flutter-side user-facing text (screens, validators, SnackBars,
the printed delivery receipt, and shared API error messages) to Bahasa
Indonesia.

Also includes in-progress OCR parser/accuracy-tuning work from the same
session: table column/unit normalization fixes, store/customer master data,
accuracy history log, and test-image renaming/cleanup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eRAsLqN9Sg1b9YPz22Lxz
2026-07-04 19:41:24 +07:00
Rafhan Mazaya Fathurrahman 095dd4cb8b feat: implement db layout caching for parsed ocr & reprocess batch test with corrected parser alignment 2026-07-03 16:43:24 +07:00
Rafhan Mazaya Fathurrahman 2900eb670b fix: resolve table column shift, normalize units and standardize dates 2026-07-03 16:04:57 +07:00
Rafhan Mazaya Fathurrahman 095d4b799a feat: normalize customer name and quantity checkmarks in accuracy check and regenerate excel 2026-07-02 17:03:28 +07:00
Rafhan Mazaya Fathurrahman 43e6eea253 feat: make manual-images list dynamic and resolve checkmark encoding issues 2026-07-02 16:57:47 +07:00
Rafhan Mazaya Fathurrahman a211593f2c feat: completely remove IMG_20260701_134635 and IMG_20260701_134636 from dataset and update report 2026-07-02 16:54:53 +07:00
Rafhan Mazaya Fathurrahman 2a644cfa6d feat: finalize comparison report and push all changes 2026-07-02 16:53:01 +07:00
Rafhan Mazaya Fathurrahman 89730912f3 feat: clean up duplicate files from dataset, update compiled jsons and recalculate accuracy report 2026-07-02 16:49:38 +07:00
Rafhan Mazaya Fathurrahman acd8fb4295 feat: standardise customer name as PT. PRIMAFOOD INTERNATIONAL and update report 2026-07-02 16:48:09 +07:00
Rafhan Mazaya Fathurrahman 6666ecd599 feat: auto-fill empty item names in manual labels from sku master database table 2026-07-02 16:46:13 +07:00
Rafhan Mazaya Fathurrahman 170cd586d9 feat: replace DKI AREA with PX HEAD OFFICE ANCOL in manual labels, update report and remove deleted test images 2026-07-02 16:45:14 +07:00
Rafhan Mazaya Fathurrahman 995347a0ea feat: compile manual labels and AI results into unified JSON files in sources folder 2026-07-02 16:41:25 +07:00
Rafhan Mazaya Fathurrahman e3acc36a89 feat: add compare_accuracy script and public comparison_report Excel 2026-07-02 16:39:13 +07:00
Rafhan Mazaya Fathurrahman 5ddd4cf37d feat: default manual label form to previous automated parser results 2026-07-02 15:57:46 +07:00
Rafhan Mazaya Fathurrahman ab21d1ca5d feat: remove image preview panel and make manual labeling form full-width 2026-07-02 15:51:27 +07:00
Rafhan Mazaya Fathurrahman 5a097c457f feat: use static test-images directory for manual label page and update gitignore 2026-07-02 15:49:04 +07:00
Rafhan Mazaya Fathurrahman e2cb2990f0 feat: serve images in manual-label UI from static /do-pfm folder 2026-07-02 15:45:43 +07:00
Rafhan Mazaya Fathurrahman a269c2494d feat: copy Excel report to public folder for direct browser download 2026-07-02 15:43:51 +07:00
Rafhan Mazaya Fathurrahman 453bc14863 fix: change image source endpoint to /api/files in manual label UI 2026-07-02 15:42:21 +07:00
Rafhan Mazaya Fathurrahman 9c7f3368e5 feat: implement manual labeling web UI and APIs in Next.js 2026-07-02 15:39:21 +07:00
Rafhan Mazaya Fathurrahman 056a650885 feat: add Excel report generator and generate styled xlsx report 2026-07-02 15:34:19 +07:00
Rafhan Mazaya Fathurrahman 5c7c64e2f4 chore: reduce layout threshold to 0.2, tune vLLM memory, and add test scripts and reports 2026-07-02 15:30:19 +07:00
Rafhan Mazaya Fathurrahman bdb3a49742 feat: update backend OCR parser, web app, mobile app camera/preview UI, tests, and documentation with sample images 2026-07-02 13:33:57 +07:00
Rafhan Mazaya Fathurrahman aa3233e411 feat: Add OCR Processing Layers Viewer UI and log proxy middleware 2026-07-01 08:45:45 +07:00
Rafhan Mazaya Fathurrahman 54b46fc35f docs: rewrite README with backend consolidation and how-to-run guide 2026-06-30 21:11:17 +07:00
Rafhan Mazaya Fathurrahman ff3753a745 feat: consolidate backend and docker-compose setup 2026-06-30 21:09:08 +07:00