Infrastructure: Implement master/dev/vX branching, save git path, and fix username casing
This commit is contained in:
@@ -2,8 +2,22 @@
|
||||
This file contains the mandatory historical log of code, architecture, and logic modifications.
|
||||
Each entry MUST be formatted chronologically.
|
||||
|
||||
## Log Format
|
||||
### [YYYY-MM-DD HH:MM] Feature/Modification Title
|
||||
### [2026-04-10 18:43] v1.2.0: Categories, Types and LDAP Framework
|
||||
**Purpose:** Implemented structured category groups and specific item types. Fixed PBKDF2 hashing compatibility for Mac/Python 3.14. Integrated LDAP authentication framework. Established master/dev/vX Git rules.
|
||||
**Modified Files:**
|
||||
- `backend/models.py`
|
||||
- `backend/schemas.py`
|
||||
- `backend/main.py`
|
||||
- `backend/routers/categories.py`
|
||||
- `backend/routers/users.py`
|
||||
- `frontend/app/page.tsx`
|
||||
- `frontend/components/AIOnboarding.tsx`
|
||||
- `VERSION.json`
|
||||
- `requirements.md`
|
||||
- `AI_RULES.md`
|
||||
- `dev_docs/PLAN_HISTORY.md`
|
||||
- `dev_docs/SESSION_HISTORY.md`
|
||||
|
||||
**Purpose:** Why this was modified.
|
||||
**Modified Files:**
|
||||
- `path/to/file`
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
This file tracks all completed tasks and phases moved from `PLAN.md`.
|
||||
|
||||
## Archive
|
||||
*(Moved completed components here to keep PLAN.md focused on active work)*
|
||||
- **v1.2.0**: Structured Category Groups & Item Types (2026-04-10)
|
||||
- **v1.1.0**: Auth System & LDAP Framework (2026-04-10)
|
||||
- **v1.0.0**: Initial PWA MVP (2026-04-10)
|
||||
|
||||
36
dev_docs/SCANNER_LOGIC_SPEC.md
Normal file
36
dev_docs/SCANNER_LOGIC_SPEC.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# TFM aInventory - Scanner Technical Specification (v1.2)
|
||||
|
||||
This document defines the "Frozen" parameters for the scanner component. Do NOT modify these values without explicit user approval.
|
||||
|
||||
## 1. Hardware Access
|
||||
- **API**: Direct `MediaStreamTrack` access for high-performance camera control.
|
||||
- **Zoom**: Dynamic detection of `capabilities.zoom.max`.
|
||||
- **Zoom Cycle**: 1x -> 2x -> Max/2 -> Max.
|
||||
|
||||
## 2. Image Pre-processing (The OCR "Secret Sauce")
|
||||
Before being sent to Tesseract.js, every frame undergoes these transformations:
|
||||
- **Rescaling**: Fixed canvas width of **1200px** (Optimal for Mobile RAM/Accuracy).
|
||||
- **Cropping**: **60% Center Crop** of the video stream (forces focus & removes peripheral noise).
|
||||
- **Filters**: `grayscale(100%) contrast(180%) brightness(105%)`.
|
||||
- **Format**: High-quality JPEG (`0.85` quality) via `toDataURL`.
|
||||
|
||||
## 3. OCR Matching Engine (page.tsx)
|
||||
- **Sanitization**: Text normalized to UPPERCASE, non-alphanumeric replaced with spaces.
|
||||
- **Noise Filtering**:
|
||||
- Tokens < 3 chars ignored.
|
||||
- Decimals (e.g., `0.11`, `0.18`) ignored via regex: `/^\d+\.\d+$/`.
|
||||
- Dates (e.g., `2024-07-25`) ignored via regex: `/^\d{2,4}-\d{2}-\d{2}$/`.
|
||||
- **Scoring System**:
|
||||
- **Exact Serial Number Match**: +500 points (Instant Match).
|
||||
- **Exact Part Number Match**: +200 points.
|
||||
- **Token match (e.g., "LC" in "LC/UPC")**: +50 points.
|
||||
- **Category Match**: +20 points.
|
||||
- **Threshold**: Minimum **40 points** required for automatic match without user intervention.
|
||||
|
||||
## 4. UI/UX Flow
|
||||
1. **Auto-Match**: Attempt to identify item immediately from raw text.
|
||||
2. **Interactive Selection (Fallback)**: If match confidence is low, freeze frame and show clickable bounding boxes for manual word selection.
|
||||
|
||||
---
|
||||
*Created: 2026-04-10*
|
||||
*Status: FROZEN*
|
||||
@@ -4,3 +4,10 @@ Archive of previous AI handover notes from `SESSION_STATE.md`.
|
||||
Entries are added here when a new AI session starts.
|
||||
|
||||
---
|
||||
|
||||
### 2026-04-10 (v1.2.0)
|
||||
- Implemented **Structured Categories** (Group-based) and **Item Types**.
|
||||
- Finalized **Local Authentication** with PBKDF2 (Mac/Python 3.14 compatible).
|
||||
- Added **LDAP Authentication Framework** (disabled by default in `ldap_config.json`).
|
||||
- Fixed audit log schema (UUID and Details).
|
||||
- Updated documentation and bumped version to 1.2.0.
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
# AI Session State - HANDOVER
|
||||
|
||||
**Status**: Phase 3 Completed. Ready for Phase 4 (Frontend/PWA).
|
||||
**Status**: Phase 4 Completed. Frontend connected and Offline Scanning implemented.
|
||||
**Current AI Agent**: Gemini (Antigravity)
|
||||
**Context**:
|
||||
- **Backend**: Fully functional SQLite + FastAPI foundation. Supporting single/bulk check-in/out and trash operations.
|
||||
- **Audit Logging**: Mandatory and immutable across all mutation endpoints.
|
||||
- **Coordination**: Multi-AI Handover protocol established. `SESSION_STATE.md` (this file) and `SESSION_HISTORY.md` (archive) are ready.
|
||||
- **Backend**: Updated with `bulk-sync` endpoint in `operations.py` and supporting schemas in `schemas.py`.
|
||||
- **Frontend**:
|
||||
- Integrated `Dexie` for IndexedDB offline storage (`lib/db.ts`).
|
||||
- Implemented `Axios` client with `bulk-sync` support (`lib/api.ts`).
|
||||
- Created offline-ready `Scanner` component using `html5-qrcode`.
|
||||
- Implemented automatic/manual synchronization logic (`lib/sync.ts`).
|
||||
- Main dashboard (`app/page.tsx`) now supports Check-In/Out modes with real-time local updates and background syncing.
|
||||
- PWA configured with `next-pwa` and manifest.
|
||||
|
||||
**Technical Notes for next session**:
|
||||
- Every mutation in `routers/operations.py` and `routers/items.py` triggers an `AuditLog` entry.
|
||||
- `bulk-check-out` parses a list and performs individual item logging.
|
||||
- PWA is the next big step. Needs to support offline barcode scanning using `html5-qrcode` and eventual `IndexedDB` sync.
|
||||
**Technical Notes**:
|
||||
- Routine operations are saved to `pendingOperations` table when offline.
|
||||
- Inventory catalog is cached locally in `items` table.
|
||||
- Syncing pushes pending operations to `/operations/bulk-sync` and refreshes the local catalog.
|
||||
- Mobile users can install the app via "Add to Home Screen" (manifest.json ready).
|
||||
|
||||
**Next Steps**:
|
||||
1. Initialize the Frontend project (using React/Next.js/Tailwind).
|
||||
2. Establish the PWA manifest and Service Worker for offline support.
|
||||
3. Build the Dashboard UI.
|
||||
1. Implement Phase 5: Gemini AI Vision Integration for New Item Onboarding.
|
||||
2. Build the "History / Audit" view in the frontend.
|
||||
3. Add "Trash/Discard" logic to the frontend UI.
|
||||
|
||||
Reference in New Issue
Block a user