You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code Profile vs Text Profile (--profile code | --profile text): Understands fenced code blocks (``` and ~~~) and inline backticks. Accurately distinguishes legitimate developer documentation from unescaped, active injection attacks.
Dynamic CSS Injection Detection: Extends indirect prompt injection defense beyond static HTML attributes. Uses headless Chromium via Playwright to evaluate \window.getComputedStyle\ on all elements.
Advanced Stealth Pattern Stripping: Detects and removes elements hidden via external CSS stylesheets (\display: none, \�isibility: hidden), zero opacity (\opacity: 0), sub-pixel font sizes (\ont-size <= 1px), CSS clip-paths (\inset(50%)), and off-screen translation offsets (\ ransform: translate(-9999px, 0)).
Telemetry Integration: Reports \playwright_computed_css_hidden\ signals directly into \FirewallReport\ with
isk_score = 0.85\ and supports strict mode rejection.
Firewall Alert & Clean Verification Badges: Live UI badge rendering security indicators from _meta.provenance.firewall. Renders alert badge with risk score and trigger signals when indirect injection is caught; renders clean verification badge when document is safe.
Offline OCR Control & Status: Added UI toggle for offline OCR extraction and live telemetry badge displaying active OCR backend and confidence score.
Syntax Modernization: Grounded in React 19 and Tailwind CSS v4 via Context7 documentation validation, ensuring zero deprecated API usage.
3. Open Source Contributor & DevOps Automation
GitHub Issue Forms: Added structured issue templates for bug reports (\�ug_report.yml), feature requests (\eature_request.yml), and prompt injection sample submissions (\security_report.yml).
Pull Request Protocol: Added \PULL_REQUEST_TEMPLATE.md\ enforcing hardware diagnostics, 100% test passing, and CI regression gate checks.
4. Verification & Benchmarking
All 16 verification, security, OCR, and Playwright test suites passing with 100% success rate.
GoldPan AI v3.1.0: Offline Vietnamese OCR & Tier 2 Apple Silicon CoreML / OpenVINO
High-Speed Scanned PDF & Image Recognition: Built-in \VietnameseOfflineOCR\ engine supporting ONNX RapidOCR, Tesseract \�ie, and robust zero-dependency layout fallback.
Pure-Python PDF Rasterizer: Native page rasterization using \pypdfium2\ and \pdfplumber\ — eliminating any external Poppler / Ghostscript binary installation.
GoldPan AI v3.0.0 marks a major architectural milestone, evolving from a multimodal converter into a hardened, privacy-first data refinery, Multilingual E5 ONNX + SQLite FTS5 Hybrid RAG engine, and Agent Context Firewall for autonomous LLM agents (MCP, REST API, CLI).
🏛️ 1. Pillar B — Multilingual & Vietnamese First-Class Core
intfloat/multilingual-e5-small ONNX Embeddings (384-dim): Automatic passage: prefix on document ingestion, query: prefix on search, and L2 normalization in isolated collection goldpan_kb_e5_v3.
Persistent SQLite FTS5 Lexical Index (chroma_data/goldpan_fts.db): Replaces RAM-heavy in-memory BM25 with persistent disk-backed FTS5 (WAL mode) indexing both accented text_nfc and ASCII-folded text_folded (đ/Đ -> d + compound bigrams) fused via Reciprocal Rank Fusion (RRF, k=60).
Legacy Vietnamese Encoding Decoder (vn_encoding.py): Automatically detects and converts VNI-Windows, TCVN3 (ABC), and decomposed Unicode NFD into composed Unicode NFC in a single non-overlapping regex pass.
Hierarchical Breadcrumb Chunker (chunker.py): Tracks both Markdown headings (# H1 > ## H2 > ### H3) and Vietnamese legal hierarchy (Phần > Chương > Mục > Điều > Khoản), prepending [Ngữ cảnh: ...] to every chunk and extracting metadata (so_hieu, ngay_ban_hanh, loai_van_ban).
Control Tokens & Beacons: Neutralizes fake delimiters (<|im_start|>, [INST], <<SYS>>) and blocks Markdown image exfiltration beacons ().
Semantic Overrides: Scores English and Vietnamese imperative hijacking phrases with 0% False Positive Rate (FPR) on academic papers and OWASP LLM01 guides.
MCP Provenance & Spotlighting: Attaches _meta.provenance.firewall telemetry and optional <untrusted_document_content> XML Spotlighting.
📊 3. Pillar C — Reproducible GoldPan Bench (BENCHMARK_REPORT.md)
Dual-track evaluation suite with 95% Wilson Score Confidence Intervals (goldpan bench --ci-gate):
GoldPan AI v2.1.0 upgrades the Dual-Mode Knowledge Base with 3-Signal Reciprocal Rank Fusion (RRF), Vietnamese-Aware Hybrid BM25 + Diacritic Folding, Idempotent Content-Hash Deduplication, and explicit 768-dim Matryoshka L2 Normalization for gemini-embedding-001.
✨ What's New in v2.1.0
3-Signal Reciprocal Rank Fusion (RRF, $k=60$)
Replaces raw cross-collection distance sorting with scale-invariant Reciprocal Rank Fusion across goldpan_kb_local (384d ONNX), goldpan_kb_gemini (768d Gemini MRL), and a local BM25 lexical ranker.
Exposes rrf_score in both API citations and the goldpan_kb_search MCP tool.
Normalizes all extracted Markdown and search queries to composed Unicode (NFC) to fix decomposed (NFD) Vietnamese diacritics from PDFs and Word files.
Combines dense ONNX embeddings with an offline BM25 ranker supporting accented unigrams, ASCII-folded unigrams (đ/Đ -> d), and 2-syllable compound bigrams (tinh_diem, ban_to_chuc), enabling accurate offline retrieval for both accented and unaccented Vietnamese queries.
Generates deterministic uuid5 document IDs from normalized content and source metadata so re-ingesting a document via the UI, CLI, or MCP updates vectors and KB/*.md files in place without creating duplicates.
GoldPan AI v2.0.0 introduces a 100% Offline Local ONNX Vector Engine, a Command-Line Interface (goldpan), and a Model Context Protocol (goldpan-mcp) Server for AI coding agents, alongside a complete algorithmic overhaul of the Markdown refinery pipeline.
✨ New Features
Dual-Mode ChromaDB Knowledge Base (local_onnx + gemini_api)
Runs 100% offline out of the box using local ONNX all-MiniLM-L6-v2 embeddings (384-dim) in goldpan_kb_local with zero API keys required.
Isolates cloud gemini-embedding-001 vectors (768-dim) in goldpan_kb_gemini with exponential backoff against HTTP 429 rate limits and automatic fallback to Local ONNX.
Model Context Protocol Server (goldpan-mcp)
Exposes 5 stdio JSON-RPC 2.0 tools (goldpan_extract, goldpan_kb_ingest, goldpan_kb_search, goldpan_kb_list, goldpan_kb_delete) and goldpan://kb/<doc_id> resources for Claude Desktop, Claude Code, Cursor, and Antigravity.
Enforces rea-tool-design contracts: response character budgets (detail: summary | complete), explicit coverage and residual_unknowns, and untrusted-content provenance tags (_meta.provenance.untrusted_content = true).
Command-Line Interface (goldpan)
Installable via pip install -e . (pyproject.toml), providing terminal commands for extract, ingest, search, kb-list, kb-delete, mcp, and version with Rich telemetry tables.
/api/kb/chat forwards multi-turn conversation history, attaches source citations, and falls back to extractive passage retrieval when running without an API key.
Hybrid Local + Cloud Image Inspection (HybridVisionCaptioner)
Extracts image dimensions, color modes, and EXIF metadata locally via Pillow when offline, or delegates OCR and table extraction to gemini-2.5-flash when a key is configured.
🔧 Refinery & Algorithmic Improvements
Fence-Preserving Semantic Chunker & Router (SemanticRouterFilter & ChromaManager): Keeps fenced code blocks (``` / ~~~), Markdown tables, headings, blockquotes, and bullet lists intact across paragraph splits and sliding-window chunks.
Precision Boilerplate Stripping (HeuristicFilter): Replaces greedy link regexes with bounded character classes so academic citations ([1] ... [Paper](url)) and long GDPR/cookie compliance paragraphs remain untouched while standalone nav links and short footer banners are stripped.
Code-Safe ATX Heading Formatter (AIFriendlyMarkdownFormatter): Normalizes #Heading to # Heading outside code blocks without mutating shebangs (#!/usr/bin/env) or C macros (#include) inside fenced code.
Multiline CSV Escaping (LiteParseExtractor): Parses quoted multiline CSV fields via io.StringIO and escapes pipe characters (\|) and line breaks (<br>) to prevent broken Markdown tables.
🛡️ Security & Repo Hygiene
Upload & URL Hardening: Sanitizes uploaded filenames against path traversal (../../), prefixes temporary files with UUIDs to prevent concurrent collisions, enforces the 5MB offline limit on actual disk bytes, and blocks cloud metadata SSRF endpoints (169.254.169.254).
Clean Git Tree & Dependencies: Untracked binary chroma_data/ artifacts, removed scratch scripts, and standardized requirements.txt to clean UTF-8.
10/10 Automated Verification Suites: Added end-to-end pytest coverage across Web, MarkItDown, LiteParse, Local ONNX KB, MCP JSON-RPC contracts, CLI, algorithmic mutation guards, and FastAPI TestClient endpoints (run_tests.py & backend/tests/test_api.py).
v1.3.0 - The Ultimate Multimodal RAG & Knowledge Base Pipeline