Add document-image OCR workflow and clue-driven search query generation - #5
Merged
Conversation
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/6cd3f2cb-45d7-4938-9b7f-bcaaafbfe12f Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/6cd3f2cb-45d7-4938-9b7f-bcaaafbfe12f Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
…Advanced Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/6cd3f2cb-45d7-4938-9b7f-bcaaafbfe12f Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/63cdc1b1-d6ec-45bc-9cb6-304f7c230e30 Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/63cdc1b1-d6ec-45bc-9cb6-304f7c230e30 Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/63cdc1b1-d6ec-45bc-9cb6-304f7c230e30 Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/63cdc1b1-d6ec-45bc-9cb6-304f7c230e30 Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/419821fd-96da-4593-99b0-98b32ee0cc59 Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/419821fd-96da-4593-99b0-98b32ee0cc59 Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/9f2fb05c-7bc4-41b5-9e84-d5dfb49bffb6 Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/9f2fb05c-7bc4-41b5-9e84-d5dfb49bffb6 Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/e1b7b5f9-72f5-432a-a7be-edccc449d31d Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/bluelens/sessions/e1b7b5f9-72f5-432a-a7be-edccc449d31d Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
potemkin666
May 5, 2026 18:36
View session
potemkin666
marked this pull request as ready for review
May 5, 2026 18:37
There was a problem hiding this comment.
Pull request overview
This PR expands BlueLens’s OCR capabilities by adding a document-image review workflow and a clue-driven search query generator, while also broadening the multi-engine relay and updating the UI/export surfaces to keep these new outputs visible and exportable.
Changes:
- Add
document_imageandquery_generatorworkflows with structured OCR/layout output and generated follow-up searches. - Expand reverse-search engine coverage (incl. Pinterest/SauceNAO/IQDB/Baidu/ASCII2D) across UI, config, OSINT lib, and doctor checks.
- Enhance investigation UX and exports (deduped intake labeling/suppression, no-result autopsy, contradiction surfacing, batch CSV + enriched JSON export).
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/ui-regressions.test.js | Updates UI regression assertions for new workflows, panels, engine set, and copy changes. |
| test/osint.test.js | Adds test coverage for new reverse-search engine URL builders. |
| test/helpers.test.js | Adds tests for new document/layout/logo/query helper functions. |
| styles.css | Adds styling for quick/advanced action groups, result suppression, autopsy/contradiction cards, and AI suspicion panel. |
| server.js | Expands doctor engine availability checks to the broader engine list. |
| README.md | Rewrites README with new workflow framing, expanded engine list, and updated run/test guidance. |
| osint-lib.js | Adds reverse-search URL and upload-page mappings for additional engines. |
| index.html | Adds quick actions + advanced drawer, new OCR panels (document/query), new engine buttons, and other UI restructuring. |
| bluelens-helpers.js | Introduces shared document/layout inference and query-spec composition helpers for browser + tests. |
| bluelens-config.js | Updates default engine order/labels/icons to include the new engines. |
| assets/bluelens-ocean-banner.svg | Adds a new README banner asset. |
| app.js | Implements document-mode output, query generator output, intake suppression/autopsy/contradictions, AI suspicion checklist, engine wiring, and batch CSV export. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+198
to
+203
| <img | ||
| class="table-art" | ||
| src="https://github.com/user-attachments/assets/59733571-36f8-4cec-b18c-52e88b2fb9ea" | ||
| alt="BlueLens visual reference" | ||
| title="External GitHub attachment retained as a visual reference" | ||
| loading="lazy" |
Comment on lines
+2474
to
+2481
| <div class="mission-card"> | ||
| <div class="mission-card-head"> | ||
| <div>${escapeHtml(item?.label || "Item")}</div> | ||
| <div class="mission-card-meta">${escapeHtml(item?.meta || "")}</div> | ||
| </div> | ||
| <div class="mission-card-lines">${lines.map((line) => `<div>${escapeHtml(line)}</div>`).join("")}</div> | ||
| ${links.length ? `<div class="mission-card-links">${links.map((link) => `<a class="chip chip-link" href="${escapeAttr(link.url)}" target="_blank" rel="noreferrer">${escapeHtml(link.label || link.url)}</a>`).join("")}</div>` : ""} | ||
| </div> |
Comment on lines
+2514
to
+2533
| function parseFilenameStem(name) { | ||
| if (appHelpers.parseFilenameStem) return appHelpers.parseFilenameStem(name); | ||
| const raw = String(name || "").trim().replace(/\.[^.]+$/, ""); | ||
| return raw.replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim(); | ||
| } | ||
|
|
||
| function getCurrentReconContext() { | ||
| return normalizeReconEntities(state.ocrText || ""); | ||
| } | ||
|
|
||
| function summarizeDocumentLayout(text) { | ||
| if (appHelpers.summarizeDocumentLayout) return appHelpers.summarizeDocumentLayout(text); | ||
| const lines = String(text || "") | ||
| .split(/\r?\n/) | ||
| .map((line) => line.trim()) | ||
| .filter(Boolean); | ||
| const paragraphBreaks = String(text || "").split(/\n\s*\n/).filter((block) => block.trim()).length; | ||
| const headingCandidates = lines.filter((line) => line.length >= 4 && line.length <= 72 && (line === line.toUpperCase() || /^[A-Z][A-Za-z0-9 '&/-]{3,}$/.test(line))).slice(0, 4); | ||
| const kvRows = lines.filter((line) => /[:|]/.test(line) || /\b(total|date|name|address|price|receipt|invoice|menu|certificate|issued|expires)\b/i.test(line)).slice(0, 6); | ||
| const tableRows = lines.filter((line) => /\d/.test(line) && /[$€£¥]|(?:\s{2,}|\t)|\bqty\b|\btotal\b|\bsubtotal\b/i.test(line)).slice(0, 6); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BlueLens handled OCR as raw text extraction, but it did not treat document-style images as first-class evidence surfaces or turn extracted clues into ready-to-run searches. This change adds a document-image workflow for structured OCR review and a query generator that composes higher-signal searches from text, brands, locations, usernames, filenames, dimensions, and language hints.
Document-image workflow
document_imagemission and direct Text-tab action for document-heavy images: letters, forms, IDs, posters, flyers, menus, receipts, certificates, and similar material.Search query generator
query_generatormission and direct Text-tab action.UI surface
Document ImageSearch Query GeneratorExport/report integration
Shared logic
bluelens-helpers.jsso the browser and test suite use the same logic for: