Skip to content

Releases

GoldPan AI v3.3.0: Repo Context Firewall (goldpan scan), SARIF 2.1.0 & Triple-Track Benchmark

Choose a tag to compare

@ptai-eng ptai-eng released this 07 Nov 15:47

🛡️ What's New in GoldPan AI v3.3.0

1. Repo Context Firewall (goldpan scan)

  • Codebase Prompt Injection Defense: Recursively inspects codebases for Trojan Source Bidirectional overrides (U+202E), ASCII smuggling via Unicode Tags (U+E0000–U+E007F), stray zero-width characters (U+200B–U+200D), fake chat/system tokens (<|im_start|>, [INST]), and Markdown image exfiltration beacons.
  • 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.
  • Emoji ZWJ Whitelisting: Preserves legitimate multi-codepoint compound emojis (e.g. 👨‍👩‍👧‍👦, 🧑‍💻, 🏳️‍🌈) while flagging malicious zero-width characters hidden between ASCII tokens.
  • Line- & Column-Exact Finding Telemetry: Pinpoints every security signal down to 1-based line number, column offset, and context snippet.

2. Synergy with Context Packaging Tools (Repomix Integration)

GoldPan does not duplicate generic file packagers; instead, it provides the essential security verification firewall:

# Verify repo and export verified clean files to Repomix
goldpan scan . --list-clean > clean_files.txt
repomix --include "$(cat clean_files.txt)"

3. Industry-Standard SARIF 2.1.0 Export

Emits native OASIS SARIF (goldpan scan . --format sarif -o results.sarif) for automated upload to GitHub Code Scanning alerts and DevSecOps pipelines.

4. 9th Model Context Protocol (MCP) Tool

Adds goldpan_scan_repo to goldpan-mcp, allowing autonomous coding agents (Claude Code, Cursor, Copilot, Antigravity) to audit repositories on-the-fly before ingesting untrusted files.

5. Triple-Track Empirical Benchmark (GoldPan Bench)

  • Track A (Document Firewall): 100.0% TPR | 0.0% FPR (0.21 ms/doc).
  • Track B (Multilingual Retrieval): 93.8% Recall@3 | 0.8958 MRR@5.
  • Track C (Repo Context Firewall): 100.0% TPR | 0.0% FPR (1.77 ms/file).

6. Full Cross-Platform CI Verification

All 17 test suites and benchmarks verified 100% green on Ubuntu, Windows, and macOS.

GoldPan AI v3.2.0: Playwright Tier-2 Computed-Style DOM Firewall, Next.js E2E & Contributor CI

Choose a tag to compare

@ptai-eng ptai-eng released this 31 Oct 07:42

What's Changed in GoldPan AI v3.2.0

1. Playwright Tier-2 Computed-Style DOM Firewall

  • 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.

2. Next.js 16 & React 19 Frontend Dashboard Telemetry

  • 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

Choose a tag to compare

@ptai-eng ptai-eng released this 31 Oct 07:33

What's Changed in GoldPan AI v3.1.0

1. 100% Offline Vietnamese & Multilingual OCR

  • 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.
  • Image Preprocessing Pipeline: Automatic EXIF auto-rotation, adaptive Otsu binarization, unsharp masking, and contrast enhancement.
  • Agent Context Firewall Integration: All OCR extractions pass through encoding normalization (VNI/TCVN3 to Unicode NFC) and the context firewall.
  • New MCP Tool & CLI Command:
    • MCP Tool: \goldpan_ocr\ with _meta.provenance\ and optional <untrusted_document_content>\ spotlighting.
    • CLI: \goldpan ocr [--dpi 200] [--json] [--output result.md].
    • API: \POST /api/ocr\ for direct file uploads.

2. Tier 2 Hardware Promotion: Apple Silicon CoreML & Intel OpenVINO

  • CoreMLExecutionProvider: Promoted to Tier 2 (CI-Verified on Apple Silicon M1/M2/M3/M4 runners under macOS Darwin).
  • OpenVINOExecutionProvider: Promoted to Tier 2 (CI-Verified on Intel CPU, iGPU, and NPU).
  • Expanded CI Matrix: GitHub Actions CI expanded to test on \macos-14\ alongside Ubuntu and Windows DirectML.

3. Verification & Quality Gates

  • All 15 end-to-end unit, API, MCP, benchmark, and OCR verification suites passed with 0 regressions.

GoldPan AI v3.0.0 — Multilingual E5 ONNX RAG, Agent Context Firewall & Dual-Track Benchmarks

Choose a tag to compare

@ptai-eng ptai-eng released this 31 Oct 07:20

🚀 What's New in GoldPan AI v3.0.0

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).
  • 3-Tier Hardware-Aware ONNX Acceleration (onnx_embedder.py):
    • Tier 1 (Default): CPUExecutionProvider (INT8, batch_size=32).
    • Tier 2 (Windows DirectML): DmlExecutionProvider (FP32, bounded batch_size=12 for AMD Radeon RX 6600, RX 5000, Intel Arc, NVIDIA DX12) with warmup tensor check and automatic CPU fallback.
    • Tier 3 (Community Extras): goldpan[cuda], goldpan[openvino], goldpan[coreml].
  • Diagnostics & Migration: goldpan doctor telemetry and goldpan reindex to migrate v2 goldpan_kb_local collections into v3.

🛡️ 2. Pillar A — Agent Context Firewall (THREAT_MODEL.md)

  • Three Operating Modes:
    • sanitize (default): Deterministically strips structural/steganographic injection vectors before tokenization without corrupting visible text.
    • audit: Non-destructive inspection returning risk_score and signals for security audits (goldpan audit).
    • strict: Rejects requests immediately with PromptInjectionBlockedError upon detecting injection signals.
  • Multi-Vector Threat Defense:
    • HTML/CSS DOM: Strips display:none, visibility:hidden, opacity:0, font-size:0, white-on-white, off-screen positions, <template>, and suspicious HTML comments before Trafilatura parsing.
    • Document Binaries: Inspects PDF characters via pdfplumber for <1pt, white text, or off-page bounding boxes; inspects DOCX <w:vanish/> hidden runs.
    • Unicode Steganography: Strips Unicode Tags (U+E0000–U+E007F), Bidi overrides, and Zero-Width characters.
    • Control Tokens & Beacons: Neutralizes fake delimiters (<|im_start|>, [INST], <<SYS>>) and blocks Markdown image exfiltration beacons (![...](https://...?secret=...)).
    • 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):

Track B: Multilingual & Vietnamese Hybrid Retrieval (Held-out 16 queries)

  • Recall@3:
    • BM25-only: 62.5% ([38.6%, 81.5%])
    • v2.1 MiniLM+BM25 RRF: 81.2% ([57.0%, 93.4%])
    • v3.0 E5+FTS5+Breadcrumb+VNI/TCVN3: 93.8% ([71.7%, 98.9%])
  • Query Categories in v3.0:
    • vi_accented: 100.0% Recall@1 & Recall@3 (MRR = 1.0000)
    • vi_unaccented: 100.0% Recall@1 & Recall@3 (MRR = 1.0000)
    • vi_paraphrase: 100.0% Recall@1 & Recall@3 (MRR = 1.0000)
    • cross_lingual_en_vi: 75.0% Recall@3

Track A: Agent Context Firewall (13 attacks + 4 hard negatives)

  • Attack Detection Rate (TPR): 100.0% ([77.2%, 100.0%] 95% Wilson CI)
  • Payload Sanitization Rate: 100.0% ([77.2%, 100.0%] 95% Wilson CI)
  • Hard-Negative False Positive Rate (FPR): 0.0% ([0.0%, 49.0%] 95% Wilson CI)
  • Benign Content Preservation Rate: 100.0%
  • Firewall Overhead Latency: 0.21 ms/doc

📦 Installation

# Core package
pip install -e .

# With Windows DirectML GPU acceleration (AMD RX 6600, RX 5000, Intel Arc, NVIDIA DX12)
pip install -e ".[directml]"

GoldPan AI v2.1.0: Reciprocal Rank Fusion, Vietnamese Hybrid BM25 & Idempotent KB

Choose a tag to compare

@ptai-eng ptai-eng released this 25 Oct 04:02

Highlights

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.
  • Vietnamese & Multilingual Offline Retrieval (_tokenize_multilingual + Unicode NFC)
    • 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.
  • Idempotent Content-Hash Deduplication (compute_document_id)
    • 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.
  • Explicit 768d Matryoshka Gemini Embeddings (outputDimensionality=768)
    • Explicitly requests 768-dimensional slices from gemini-embedding-001 and applies unit L2 normalization (_l2_normalize) prior to ChromaDB upsert.
  • Expanded Verification Suite (12/12 Passed)
    • Added automated unit and integration tests for 768d MRL payloads, L2 norm verification, HTTP 429 retry, cross-collection RRF fusion, idempotent ingestion, and Vietnamese NFC/NFD + unaccented retrieval (run_tests.py & backend/tests/test_api.py), plus clean tsc --noEmit verification on the Next.js frontend.

GoldPan AI v2.0.0: Dual-Mode Local ONNX RAG, CLI & MCP Server

Choose a tag to compare

@ptai-eng ptai-eng released this 24 Oct 16:31

Highlights

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.
  • Multi-Turn Grounded Chat & Offline Extractive Fallback
    • /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

Choose a tag to compare

@ptai-eng ptai-eng released this 25 Jun 07:38

Full Changelog: v1.2.3...v1.3.0

GoldPan v1.2.3: Blazing Fast Parallel Processing, Audio Multi-Modal & Smart API Limits

Choose a tag to compare

@ptai-eng ptai-eng released this 25 Jun 07:06

Full Changelog: v1.2.1...v1.2.3

v1.2.1: Hotfix - Crash Prevention & AI Optimization

Choose a tag to compare

@ptai-eng ptai-eng released this 25 Jun 05:59

Full Changelog: v1.2...v1.2.1

v1.2: The UI/UX & Performance Overhaul

Choose a tag to compare

@ptai-eng ptai-eng released this 25 Jun 04:35

Full Changelog: v1.1.3...v1.2