From 73ab38d23713425e67f87cd05af8f964f8a86dbd Mon Sep 17 00:00:00 2001 From: Daniel Bedeleanu Date: Wed, 15 Apr 2026 15:33:14 +0300 Subject: [PATCH] Build [v1.9.24] --- PROJECT_ARCHITECTURE.md | 13 ++++++++++--- README.md | 5 +++++ USER_GUIDE.md | 5 +++-- frontend/VERSION.json | 6 +++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/PROJECT_ARCHITECTURE.md b/PROJECT_ARCHITECTURE.md index ae6d5bde..c677b2d3 100644 --- a/PROJECT_ARCHITECTURE.md +++ b/PROJECT_ARCHITECTURE.md @@ -12,7 +12,7 @@ A unified system to maintain an inventory of "items" and their quantities, inclu - **Database:** SQLite (SQLAlchemy) - Local file-based persistence - **Validation:** Pydantic v2 - **Auth:** Hybrid LDAP (python-ldap) + PBKDF2 local password hash caching -- **AI Engine:** Google GenAI SDK (Gemini 2.0 Flash) - Location: `backend/ai/` +- **AI Engine:** Google GenAI SDK (Gemini 2.0 Flash) & Anthropic SDK (Claude 3.5 Sonnet) - Location: `backend/ai/` ### 2.2 Frontend (Web & PWA) - **Architecture:** Next.js 15+ (App Router) @@ -32,7 +32,7 @@ A unified system to maintain an inventory of "items" and their quantities, inclu - **PWA Deployment:** `next-pwa` (Service Workers + Manifest.json) - **HTTPS Proxy:** `caddy` or `local-ssl-proxy` (Port 8909) - **Servers:** Frontend (Port 8907), Backend (Port 8906) -- **Configuration:** Centrally managed via root `inventory.env` (Network/CORS/API Keys) and `config/` directory (LDAP, Caddyfile). +- **Configuration:** Centrally managed via root `inventory.env` (Network/CORS/API Keys), `config/` directory (LDAP, Caddyfile), and a dynamic `ConfigManager` (`backend/config_manager.py`) for runtime environment and AI provider settings. ## 3. Data Models & Entities - **Item:** Name, Category Group (Structured), Item Type (Specific), Quantity, Barcode, Part Number, Box Label (Association). @@ -43,7 +43,8 @@ A unified system to maintain an inventory of "items" and their quantities, inclu ## 4. Scanning & Optimization Strategy (Crucial) ### 4.1 AI Usage Policy - **Routine Operations (Check-in/Out):** Executes entirely on the local device unconditionally using `html5-qrcode` ($0 cost). No AI is allowed here. -- **New Item Onboarding (AI Label OCR):** Uses cloud AI (`gemini-2.0-flash`). The user takes a photo, AI extracts data based on strict templates. +- **New Item Onboarding (AI Label OCR):** Uses cloud AI (`gemini-2.0-flash` or `claude-3-5-sonnet`). The user takes a photo, AI extracts data based on strict templates. +- **AI Provider Selection (v1.9.23):** Administrators can choose between Gemini and Claude via the Admin Dashboard. API keys are managed securely in the environment. - **AI Box Discovery Mode (v1.6.0):** Supports specialized `mode="box"` prompt that focuses exclusively on prominent container names/hand-written labels, ignoring technical spec noise. - **Validation Mask:** AI-extracted data is NEVER saved directly. It is presented in a validation UI for human confirmation. @@ -103,3 +104,9 @@ To ensure enterprise-grade protection, the following policies are enforced: To ensure deployment stability on macOS environments with potentially broken developer tool links (`xcode-select` errors): - **Direct Binary Mapping:** The system bypasses path resolution by using a hardcoded direct link to the Git binary in `.git_path` (`/Library/Developer/CommandLineTools/usr/bin/git`). - **Persistence Mandate:** This path is protected by mandatory AI rules and must never be removed or modified to ensure `save-version` and automated deployment scripts remain functional. +106: +107: ## 8. Multi-AI Engine & Dynamic Configuration (v1.9.23) +108: To enhance extraction flexibility and system resilience: +109: - **Unified AI Core:** The backend uses an abstraction layer to handle multiple AI providers (Gemini and Claude). +110: - **Dynamic Configuration:** System settings (AI Provider, API Keys, Backup Policies) are managed via `backend/config_manager.py`, allowing real-time updates without restarting the container. +111: - **Admin Standardization:** The Admin Dashboard features a standardized configuration UI with secure field masking for sensitive credentials. diff --git a/README.md b/README.md index 37e846f6..90a9982b 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,11 @@ To generate a clean production package and snapshot the current state: - Accessible markup with `role="status"` and `aria-hidden` attributes - **Pages Updated:** Inventory (Categories, Item Types, Total Boxes), Logs (Total Events, Check in/out), Admin (Local Archives) - **Tested on:** iPhone SE (375px), iPhone 12 (390px), iPhone 14 Pro Max (430px), tablets (768px), desktop (1024px) +- **Multi-AI Selection & Secure Config (v1.9.23):** + - Support for both **Google Gemini** and **Anthropic Claude** for AI label extraction. + - Dynamically configurable AI providers via the Admin Dashboard. + - Centralized `ConfigManager` for secure API key and environment management. +- **Admin UI Standardization:** Refactored Admin page with unified StatCards and secure input masking for system credentials. ## 🏗 Technical Overview * **Backend:** FastAPI (Python 3.12+) diff --git a/USER_GUIDE.md b/USER_GUIDE.md index 442c74ca..6e6790ed 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -138,6 +138,7 @@ Ensure you have internet connectivity and wait a moment. Synchronization happens - The image size must not exceed 10 MB. - The application supports JPEG, PNG, WebP, and GIF formats. - If the AI service is unavailable, try again later or contact your administrator. +- **AI Provider Toggle:** In the Admin Dashboard, you can choose between **Gemini** and **Claude** for label extraction. If one provider is slow or failing, your administrator can switch to the other seamlessly. --- @@ -149,5 +150,5 @@ For detailed technical documentation, see the [Project Architecture](../PROJECT_ --- -**Version:** v1.9.19 -**Last Updated:** 2026-04-14 +**Version:** v1.9.24 +**Last Updated:** 2026-04-15 diff --git a/frontend/VERSION.json b/frontend/VERSION.json index e6227a34..4bae4d46 100644 --- a/frontend/VERSION.json +++ b/frontend/VERSION.json @@ -1,6 +1,6 @@ { - "version": "1.9.23", - "last_build": "2026-04-15-1522", + "version": "1.9.24", + "last_build": "2026-04-15-1533", "codename": "MultiAI", - "commit": "unknown" + "commit": "f751cc20" } \ No newline at end of file