skills/AAA-OCR-optical-compression/SKILL.md
OCR as optical context compression. Converts documents/images to structured markdown using a VLM cascade (qwen3-omni-flash → Tesseract → RapidOCR). Use when processing scanned documents, tables, charts, or images containing text. Includes F2/F4/F9/F12 constitutional gates. Trigger phrases include "OCR", "extract text from image", "document to markdown", "parse table from image", "scan document".
npx skillsauth add ariffazil/openclaw-workspace AAA-OCR-optical-compressionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
EUREKA777::OCR_COMPRESSION · 2026-07-31 Insight: OCR is not text extraction — it's optical context compression. Source: DeepSeek-OCR paper (arXiv:2510.18234), architecture adapted for af-forge (no GPU). DITEMPA BUKAN DIBERI
DeepSeek-OCR reframes OCR as context compression: a vision encoder compresses an image into tokens, the language model decodes those tokens into structured text. The key is that structure (tables, headings, figures, layout) survives the compression.
Before this insight, OCR meant "extract characters from pixels." After: OCR means "compress visual context into token-efficient structured text."
| Dimension | Old (Tesseract) | New (VLM OCR) | |-----------|----------------|---------------| | Output | Raw text blob | Structured markdown | | Tables | Lost/garbled | Preserved as markdown tables | | Figures/Charts | Ignored | Described in context | | Layout | None | Headings, sections, reading order | | Confidence | None | Per-section confidence scores | | Injection risk | Low (binary extraction) | High (model can hallucinate) → needs F9 gate |
Document/Image Input
│
▼
555-ASI-VISION (classify)
│
├── Document/PDF → VLM OCR (qwen3-omni-flash)
├── Chart/Figure → VLM Describe (qwen3-omni-flash)
├── Simple text → Tesseract (local, fast)
└── Ambiguous → RapidOCR (fallback)
│
▼
555-ASI (F12 INJECTION scan)
│
▼
Structured Markdown → 333-AGI
| Tier | Model | Cost | Use |
|------|-------|------|-----|
| 1 (VLM) | mulerouter/qwen3-omni-flash | $0.0001/1K | Documents, tables, charts |
| 2 (Local) | Tesseract 5.5.0 | FREE | Simple text, fast batch |
| 3 (Local) | RapidOCR 3.9.1 | FREE | Chinese/mixed scripts |
Based on DeepSeek-OCR's prompt patterns, adapted for qwen3-omni-flash:
<|grounding|>Convert this document to markdown. Preserve all headings, tables, lists, and reading order. For any figures or charts, describe them briefly. Output ONLY the markdown — no preamble.
Free OCR this image. Extract all visible text. Do not describe images.
Parse this figure. Describe what it shows — axes, trends, data points. Be specific about numbers.
Extract all tables from this document as markdown tables. Include all rows and columns.
Every OCR output passes through these before reaching 333-AGI:
| Floor | Gate | Action | |-------|------|--------| | F2 TRUTH | Epistemic label | Every section tagged OBS (machine-read text) or DER (model-described figure) | | F4 CLARITY | Structure check | Output must be valid markdown. Raw blobs rejected. | | F9 ANTI-HANTU | Hallucination scan | "The document says X" — but is X actually in the pixels? Low-confidence DER must be flagged. | | F12 INJECTION | Adversarial scan | Text extracted from images scanned for prompt injection patterns. |
When Arif sends an image to Telegram:
forge_document_ingest upgrade:
Any agent can call 555-ASI-VISION with OCR prompt. The output is always gated through 555-ASI before reaching reasoning.
1. Send document image → get structured markdown back (not raw text)
2. Table in document → markdown table in output
3. Chart in document → described in output, not ignored
4. Adversarial text hidden in image → F12 injection scan catches it
5. Low-quality image → confidence < 0.70 → output flagged as DER, not OBS
Forged from DeepSeek-OCR (arXiv:2510.18234) · Adapted for af-forge CPU-only VPS Cascade: VLM (qwen3-omni-flash) → Tesseract → RapidOCR Gate: 555-ASI F2/F4/F9/F12
testing
OpenClaw edge agent bridge — operational triage, doctor, restart, and A2A bridge routing for the federation edge (Telegram surface). USE WHEN: "openclaw unhealthy", "gateway down", "edge bot not responding", "a2a bridge disconnected", "watchdog tripped", "openclaw doctor", "openclaw restart". NOT for token/security audit — use FORGE-telegram-audit.
tools
Generate images, videos, TTS, voice clone, and music via MiniMax MCP server. Use when user asks to "draw", "generate image", "create picture", "make a photo", "text to image", "image generation".
testing
Single load-bearing constitutional-judgment skill. Routes all F1–F13, verdict, hold, seal, scope, authority and floor-check calls through the live arif_judge surface. Replaces 7 overlapping predecessors (arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge).
development
MANDATORY LSP grounding gate BEFORE any code mutation on .ts, .py, .js, .tsx, .jsx files. Forces the agent to read real-time compiler diagnostics and structural project context before editing — eliminating blind guesses and anchoring every mutation in F2 (TRUTH). Routes through arifOS kernel (:8088) for centralized gate logic.