Commit Graph
100 Commits
Author SHA1 Message Date
Alex-Gilbert 74b9820a48 font debug analysis 2026-02-23 21:17:22 -06:00
Alex-GilbertandClaude Opus 4.6 672bdc3223 fix: batch LLM validation, stream results, improve scoring prompt
- Batch candidates in groups of 50 (was 200) to avoid output token
  truncation that caused all-zero scores
- Stream scored results via SSE as each batch completes instead of
  waiting for all batches to finish
- Include solve_id in done event so validate works when results fit
  in a single page
- Rewrite prompt to judge sentence coherence ("does it make sense")
  rather than word predictability ("is it expected")
- Frontend inserts results in score-sorted order as they arrive

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 21:17:00 -06:00
Alex-GilbertandClaude Opus 4.6 fa6709cca4 feat: add LLM validation UI with score badges and context panel
Wire up Validate button in solver.js with showValidatePanel,
runValidation, and renderScoredResult functions. Add CSS for
score badges (green/yellow/red) and validate panel styling.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 16:23:06 -06:00
Alex-GilbertandClaude Opus 4.6 f7dd5a342a feat: add POST /api/solve/{id}/validate endpoint
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 16:19:21 -06:00
Alex-GilbertandClaude Opus 4.6 29a41e650c feat: add LLM validation module with prompt and tool schema
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 16:18:40 -06:00
Alex-GilbertandClaude Opus 4.6 fe25a20db9 docs: add LLM validation implementation plan
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 16:17:32 -06:00
Alex-GilbertandClaude Opus 4.6 512761cd28 docs: add LLM validation of solve results design
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 16:15:33 -06:00
Alex-GilbertandClaude Opus 4.6 a0e2bf6ec1 feat: disable two-word adjective+noun search by default
The new Wiktionary dictionary already includes 31k multi-word nouns,
making the combinatorial adjective+noun phase redundant. Add two_word
parameter (default False) to solve_word_dictionary to opt in when needed.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 15:43:00 -06:00
Alex-GilbertandClaude Opus 4.6 131c945641 data: replace word lists with Wiktionary noun dictionary
Replace the old general frequency word list (55k entries including
non-nouns like "li", "ys", "be") with a curated noun dictionary from
djstrong/nouns-with-plurals (137k entries). Frequency-sorted using
wordfreq, filtered to ASCII-only entries with min 3 characters.

Source: https://github.com/djstrong/nouns-with-plurals

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 15:39:01 -06:00
Alex-GilbertandClaude Opus 4.6 44e324e2f5 feat: add Load More button for paginated solve results
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 14:51:49 -06:00
Alex-GilbertandClaude Opus 4.6 b51dc18d9c feat: clean up solve buffer on cancel
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 14:50:40 -06:00
Alex-GilbertandClaude Opus 4.6 6341bcdfa3 feat: add GET /api/solve/{id}/results pagination endpoint
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 14:50:07 -06:00
Alex-GilbertandClaude Opus 4.6 f0b444d26c feat: cap SSE stream at PAGE_SIZE and buffer remaining results
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 14:49:30 -06:00
Alex-GilbertandClaude Opus 4.6 c8d177f23f feat: add PAGE_SIZE constant and solve results buffer
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 14:33:46 -06:00
Alex-GilbertandClaude Opus 4.6 8d7e60950c docs: add solve pagination implementation plan
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 14:30:19 -06:00
Alex-GilbertandClaude Opus 4.6 012c4bbd28 docs: add solve result pagination design
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 14:27:55 -06:00
Alex-GilbertandClaude Opus 4.6 e6b38ebc6a feat: add word frequency filtering with vocabulary size control
Sort word lists by Google Books frequency (most common first).
Add vocabulary dropdown (Common/Standard/Extended/Full) to word
mode UI that controls how many words are searched.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 14:10:08 -06:00
Alex-GilbertandClaude Opus 4.6 b768e216fc docs: add word frequency filter design
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 12:13:16 -06:00
Alex-GilbertandClaude Opus 4.6 f0efd88c27 feat: connect word mode UI controls to solver backend
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 11:41:45 -06:00
Alex-GilbertandClaude Opus 4.6 2ca73ec01f feat: wire word mode and ensure_plural to /api/solve endpoint
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 11:35:28 -06:00
Alex-GilbertandClaude Opus 4.6 a0586be336 feat: add Word mode option and plural checkbox to UI
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 11:31:22 -06:00
Alex-GilbertandClaude Opus 4.6 d04116579b feat: add two-word binary search solver (phase 2 of word mode)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 11:06:10 -06:00
Alex-GilbertandClaude Opus 4.6 6c6a90e796 feat: add single-word noun solver (phase 1 of word mode)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 10:05:52 -06:00
Alex-GilbertandClaude Opus 4.6 f13590f80d feat: add noun/adjective/plural word list loaders
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 10:02:11 -06:00
Alex-GilbertandClaude Opus 4.6 9d8a3c9a1f feat: add word list generation script (nouns, adjectives, plurals from WordNet)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 09:51:15 -06:00
Alex-GilbertandClaude Opus 4.6 689609884e docs: add word dictionary mode implementation plan
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 09:39:36 -06:00
Alex-GilbertandClaude Opus 4.6 d868ce2de3 docs: add word dictionary solve mode design
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-23 09:36:50 -06:00
Alex-GilbertandClaude Opus 4.6 6e77070538 fix: known_start/end casing for multi-word name width calculation
When known_start was set with capitalized casing, the unknown portion was
forced to all-lowercase, breaking width measurements for multi-word names
(e.g., "hn doe" instead of "hn Doe"). Added _case_unknown_portion helper
that respects word boundaries. Also fixed effective_left/right kerning
context to use correctly cased characters from the display string.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-22 14:44:33 -06:00
Alex-GilbertandClaude Opus 4.6 c915935ee4 fix: defensive CSS hidden rule, cache MediaQueryList, guard setSheetSnap
- Add [hidden] { display: none !important } to prevent CSS specificity overrides
- Cache matchMedia query instead of creating new MediaQueryList per call
- Guard setSheetSnap against being called on desktop

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 16:25:46 -06:00
Alex-GilbertandClaude Opus 4.6 9ad2bc150a fix: mobile polish — tap-to-deselect and toast positioning
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 16:19:00 -06:00
Alex-GilbertandClaude Opus 4.6 f07a0c9c2c feat: wire sheet snap and tab switching to popover flow
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 16:13:15 -06:00
Alex-GilbertandClaude Opus 4.6 bee8a2f514 feat: sheet tab switching and responsive DOM relocation
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 16:11:46 -06:00
Alex-GilbertandClaude Opus 4.6 1eaf411847 feat: sheet drag and snap behavior for mobile
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 15:55:00 -06:00
Alex-GilbertandClaude Opus 4.6 6075a4f047 feat: mobile CSS for bottom sheet overlay
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 15:48:02 -06:00
Alex-GilbertandClaude Opus 4.6 95d909cc98 feat: desktop CSS for bottom-sheet as sidebar
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 15:46:47 -06:00
Alex-GilbertandClaude Opus 4.6 6ec5be11d9 refactor: replace left-panel with bottom-sheet container
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 15:42:03 -06:00
Alex-GilbertandClaude Opus 4.6 3a590e17c8 docs: add mobile-responsive implementation plan
7-task plan for bottom-sheet responsive redesign covering HTML restructuring,
desktop/mobile CSS, sheet snap behavior, tab switching, and integration.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 15:11:32 -06:00
Alex-GilbertandClaude Opus 4.6 534b3fbe33 docs: mobile-responsive redesign using bottom sheet pattern
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 15:02:28 -06:00
Alex-GilbertandClaude Opus 4.6 2297bd0aa0 fix: mobile touch-action and delete button visibility
- Add touch-action: none to #right-panel for reliable custom
  touch handling
- Show delete button on mobile (no hover state on touch devices)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 13:29:29 -06:00
Alex-GilbertandClaude Opus 4.6 0de882c575 feat: add single-finger touch pan for mobile
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 13:26:02 -06:00
Alex-GilbertandClaude Opus 4.6 553563f871 feat: add mobile tab switching logic
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 13:24:57 -06:00
Alex-GilbertandClaude Opus 4.6 16ae903047 feat: add responsive CSS for mobile layout
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 13:24:54 -06:00
Alex-GilbertandClaude Opus 4.6 9124348e1c feat: add mobile tab bar markup and DOM refs
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 13:23:40 -06:00
Alex-GilbertandClaude Opus 4.6 028cad35fb docs: mobile-friendly implementation plan
5-task plan: HTML tab bar, JS tab switching, responsive CSS,
single-finger touch pan, integration test.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 13:22:31 -06:00
Alex-GilbertandClaude Opus 4.6 78788bce17 docs: mobile-friendly frontend design
CSS-responsive approach with tab-based navigation at ≤768px,
full-screen solver modal, and single-finger touch pan.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 13:20:51 -06:00
Alex-GilbertandClaude Opus 4.6 33b88f078f feat: manual guess input + continuous text preview rendering
- Replace redaction marker span with editable input for manual guesses
- Typing in the guess field sets r.preview and shows Accept button
- drawRedactionPreview now renders left+guess+right as continuous text
  with natural font kerning (no fixed gap width during preview)
- Active preview: green left, yellow highlighted guess, green right
- Inactive preview: full merged text in yellow

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 15:45:28 -06:00
Alex-GilbertandClaude Opus 4.6 a4863350ef fix: remove blue box overlay from approved redactions
Only the merged blue text is drawn — no box overlay needed.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 15:35:09 -06:00
Alex-GilbertandClaude Opus 4.6 bff50a1315 fix: drawRedactionApproved draws box overlay + distinct green badge
The approved draw function was only drawing text with no overlay on the
redaction box area, making it look like the redaction disappeared.
Now draws a blue semi-transparent box over the redaction area (like
other states) plus the merged blue text along the line.

Also made the approved CSS badge green (--accent) to distinguish it
from the blue analyzed badge.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 15:08:20 -06:00
Alex-GilbertandClaude Opus 4.6 0ffae2aeae feat: blue CSS badge for approved status
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:49:12 -06:00
Alex-GilbertandClaude Opus 4.6 651b7eee33 feat: popover handles approved redactions with solution pre-populated
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:49:02 -06:00
Alex-GilbertandClaude Opus 4.6 0873120775 feat: update main.js references from solved to approved status
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:48:51 -06:00
Alex-GilbertandClaude Opus 4.6 7bc5aa3239 feat: replace drawRedactionSolution with drawRedactionApproved (blue merged text)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:48:32 -06:00
Alex-GilbertandClaude Opus 4.6 531693653a feat: acceptSolution produces 'approved' status with merged text
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:48:05 -06:00
Alex-GilbertandClaude Opus 4.6 9f5ceb38ae fix: remove inline-edit feature and backspace delete keybinding
- Delete inline-edit.js and all references
- Remove backspace/delete key handler for redaction deletion
- Clean up popover.js syncInlineEdit references

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:46:50 -06:00
Alex-GilbertandClaude Opus 4.6 f1e25f9712 feat: add LLM boundary detection for spot redaction path
analyze_spot_redaction is now async and calls identify_boundary_text()
to use Claude Haiku for clean left/right text extraction instead of
center-point character filtering. Falls back to center-point if LLM
is unavailable.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:46:45 -06:00
Alex-GilbertandClaude Opus 4.6 163a450720 docs: add redaction approval implementation plan
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:45:39 -06:00
Alex-GilbertandClaude Opus 4.6 f04bacd961 docs: add redaction approval design
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 14:44:32 -06:00
Alex-GilbertandClaude Opus 4.6 e9ec2ff7f3 feat: add inline-edit.js and sync popover with inline inputs
Missed files from the inline text editing task — adds the inline-edit
module and wires up bidirectional sync between popover text bar and
inline canvas inputs.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:55:25 -06:00
Alex-GilbertandClaude Opus 4.6 3d07faadc8 style: add OCR status indicator and edge case handling
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:52:14 -06:00
Alex-GilbertandClaude Opus 4.6 43e7f80bbe feat: drag handles for resizing redaction bounding boxes
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:49:52 -06:00
Alex-GilbertandClaude Opus 4.6 9b9618d9fa feat: spot redactions now created as analyzed with full data
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:44:35 -06:00
Alex-GilbertandClaude Opus 4.6 7331fc5936 feat: add OCR-on-upload and Detect Redactions button
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:43:09 -06:00
Alex-GilbertandClaude Opus 4.6 2783ed2615 feat: spot endpoint returns full analysis data
Enrich POST /api/doc/{doc_id}/page/{page}/spot to call
analyze_spot_redaction when OCR data is cached, returning full
analysis JSON (segments, gap, font, line, offsets) alongside the
bounding box. This makes spot redactions first-class, matching the
analysis format returned by get_page_data for auto-detected redactions.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:42:18 -06:00
Alex-GilbertandClaude Opus 4.6 8857793759 feat: add analyze_spot_redaction for single-box analysis
Add a synchronous function that runs the analysis mini-pipeline on a
single known bounding box using cached OCR data. This enables spot
redaction endpoints to get full analysis (font, left/right context text,
pixel alignment offsets) without needing LLM detection.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:39:57 -06:00
Alex-GilbertandClaude Opus 4.6 03333e212c feat: wire analyze endpoint to use cached OCR data
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:38:31 -06:00
Alex-GilbertandClaude Opus 4.6 f24a710b9e feat: allow analyze_page to accept pre-computed OCR lines
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:36:58 -06:00
Alex-GilbertandClaude Opus 4.6 ced68f2321 feat: add /api/doc/{id}/ocr SSE endpoint for cached OCR
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:36:46 -06:00
Alex-GilbertandClaude Opus 4.6 87a59802bf feat: add ocr_lines field to page_data structure
Add an ocr_lines slot (initially None) to each page's data dictionary
in the upload endpoint. This prepares for OCR caching so results can
be reused between the auto-detect and spot-redaction pipelines.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:34:58 -06:00
Alex-GilbertandClaude Opus 4.6 3345dde096 docs: add redaction workflow redesign implementation plan
13 tasks covering: OCR caching, spot analysis, detect button,
inline canvas editing, drag handles, and full integration.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:30:56 -06:00
Alex-GilbertandClaude Opus 4.6 050907ae89 docs: add redaction workflow redesign design
Captures the plan to decouple auto-detection from upload, make manual
(double-click) redactions first-class with full analysis, and move to
inline-on-canvas editing.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 12:22:17 -06:00
Alex-GilbertandClaude Opus 4.6 2a5db8f990 fix(frontend): update associates.js to use renamed dom exports
The rename from solveFilterPrefix/Suffix to solveKnownStart/End missed
associates.js, breaking the entire JS module tree and disabling upload.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 13:23:55 -06:00
Alex-GilbertandClaude Opus 4.6 4a92cb8463 fix: update app tests for mode/charset restructuring
Replaced test_solve_endpoint_dictionary and test_dictionary_crud with
test_solve_endpoint_name_mode testing the new name mode.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 13:16:57 -06:00
Alex-GilbertandClaude Opus 4.6 65865da28a feat: restructure solve endpoint with mode-based dispatch
Modes: name (default), full_name, email, enumerate
Renamed filter_prefix/suffix to known_start/known_end
Removed DictionaryStore and dictionary API endpoints

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 13:14:00 -06:00
Alex-GilbertandClaude Opus 4.6 bde5fce636 feat: update frontend JS for new modes, known start/end, and filter visibility
Renamed solveFilterPrefix/Suffix to solveKnownStart/End. Word filter
label hidden by default, shown only when enumerate mode is selected.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 13:12:54 -06:00
Alex-GilbertandClaude Opus 4.6 a9117e3876 feat: update HTML with new modes, charsets, and known start/end fields
Modes: Name (default), Full Name, Email, Enumerate
Charsets: lowercase, UPPERCASE, Capitalized
Renamed filter prefix/suffix to known start/end
Word filter hidden by default (shown only for enumerate mode)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 13:12:17 -06:00
Alex-GilbertandClaude Opus 4.6 d0bd7967e4 feat: update solve_full_name_dictionary with casing and known_start/known_end
Replaces uppercase_only bool with casing string parameter. Adds
known_start/known_end support for filtering and gap-width measurement.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 13:11:53 -06:00
Alex-GilbertandClaude Opus 4.6 d32f27cb8d feat: add solve_name_dictionary for single-word associate name matching
Supports casing (lowercase/uppercase/capitalized), known_start/known_end
filtering with gap-width measurement of the unknown portion only.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 13:11:13 -06:00
Alex-GilbertandClaude Opus 4.6 57650af1fe docs: add mode/charset restructuring design and implementation plan
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 13:07:54 -06:00
Alex-GilbertandClaude Opus 4.6 c04dc589f4 feat: wire dictionary full-name solver into solve endpoint
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 12:01:53 -06:00
Alex-GilbertandClaude Opus 4.6 7b0802d005 feat: add solve_full_name_dictionary with Cartesian product matching
Generate first x last name combinations from associate lists, apply
Title Case or UPPER casing, measure rendered widths, and return matches
within tolerance. Also checks associate name variants (initials,
nicknames) with deduplication.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 12:00:45 -06:00
Alex-GilbertandClaude Opus 4.6 72df8d3579 feat: extract associate first/last name lists from registry
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 11:55:33 -06:00
Alex-GilbertandClaude Opus 4.6 921d702c07 feat: add lazy loaders for associate name lists
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 11:55:09 -06:00
Alex-GilbertandClaude Opus 4.6 291eadaba8 docs: add dictionary full-name solver implementation plan
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 11:52:39 -06:00
Alex-GilbertandClaude Opus 4.6 04aa089c7f docs: add dictionary-based full name solver design
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 11:50:50 -06:00
Alex-GilbertandClaude Opus 4.6 b50a32a038 fix(solver): add max_results cap to prevent OOM in full-name solver
The full-name solver collected all results into a Vec with no limit,
causing OOM crashes for realistic targets where millions of valid
first×last combinations exist. Thread max_results through
solve_subtree, dfs_first, and the Cartesian product loop so the
search stops early once enough results are found.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 11:20:16 -06:00
Alex-GilbertandClaude Opus 4.6 11339d0ecc test(solver): add 3-char equivalence expansion integration test
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 10:52:54 -06:00
Alex-GilbertandClaude Opus 4.6 25a8d47d53 feat(solver): wire equiv classes into DFS pipeline
Thread EquivClasses and deduped_allowed through solve_subtree, dfs,
generate_prefixes, handle_solve, and dfs_first (full_name). The DFS
hot loop now iterates deduped representatives instead of all allowed
chars, and expand_match restores full class-member variants at match
time. This reduces branching factor for charsets with metrically
identical glyphs while preserving complete result sets.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 10:50:31 -06:00
Alex-GilbertandClaude Opus 4.6 700a76eeee feat(solver): add dedup_state_allowed, build_byte_to_idx, expand_match
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 10:43:57 -06:00
Alex-GilbertandClaude Opus 4.6 be9dd07a66 feat(solver): add EquivClasses struct and compute_equiv_classes
Foundation for glyph equivalence class optimization. Groups charset
characters with identical metric signatures (width table columns/rows,
left/right edges, optional extra columns) into equivalence classes
using exact f64::to_bits() comparison. Includes 3 unit tests covering
duplicate detection, all-unique case, and extra column splitting.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 10:39:23 -06:00
Alex-Gilbert a5505c1fbb attempting to make redaction guessing better 2026-02-18 10:35:42 -06:00
Alex-GilbertandClaude Opus 4.6 cddbf74492 docs: add glyph equivalence classes implementation plan
7 bite-sized tasks with TDD steps: EquivClasses struct, dedup/expand
functions, DFS wiring, prefix generation, full_name integration, and
end-to-end testing.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 10:34:58 -06:00
Alex-GilbertandClaude Opus 4.6 23f535a614 docs: add glyph equivalence classes design
Group metrically identical characters into equivalence classes to reduce
the DFS branching factor from N to K per node, with Cartesian product
expansion on matches to recover all solutions.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-18 10:28:41 -06:00
Alex-GilbertandClaude Opus 4.6 b577f2b52e feat: update frontend to use SSE analysis and pre-computed redaction data
Replace the click-to-analyze and spot-detection flows with an automatic
SSE-driven analysis pipeline. After upload, an EventSource connects to
/api/doc/{id}/analyze and reloads page data as each page completes,
consuming pre-computed analysis from the page data endpoint.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-17 15:38:13 -06:00
Alex-GilbertandClaude Opus 4.6 1a65cb9a87 refactor: replace per-redaction endpoints with SSE upload analysis pipeline
Replace the old /api/redaction/analyze and /api/redaction/spot endpoints
with a new /api/doc/{id}/analyze SSE endpoint that pre-computes all
analysis during upload. The page data endpoint now returns pre-computed
analysis results instead of requiring per-redaction API calls.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-17 15:35:09 -06:00
Alex-GilbertandClaude Opus 4.6 0f9c7ff858 feat: add page analysis pipeline orchestrating OCR, LLM, OpenCV, and font detection
Wire together the per-page pipeline: OCR -> LLM redaction detection ->
guided OpenCV search -> font detection with masking -> pixel alignment.
Includes font caching per line and progress callbacks.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-17 15:31:17 -06:00
Alex-GilbertandClaude Opus 4.6 8b5511e7fd feat: add detect_font_masked for redaction-aware font detection
Adds a new detect_font_masked() function that masks redaction boxes to
white (255) before running pixel-based font detection on the full line
crop. This replaces the fragile approach of cropping just the left/right
portion of a line, which lost signal from narrow crops and coordinate
mismatches. The Dice-based scoring naturally ignores masked (white)
regions since they contain no ink pixels.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-17 15:26:14 -06:00
Alex-GilbertandClaude Opus 4.6 c39d74e46d feat: add guided OpenCV search for LLM-directed redaction regions
Add find_redaction_in_region() that searches for a black rectangle
within a specific page region identified by the LLM. Uses a lower
minimum area threshold (100px vs 500px) since the LLM provides
spatial guidance, preventing merged redactions and false positives.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-17 15:22:28 -06:00
Alex-GilbertandClaude Opus 4.6 51ef030322 feat: add LLM-based redaction detection module
Introduce llm_detect.py that sends OCR lines to Claude Haiku to identify
redaction locations via broken text patterns (garbled chars, brackets,
pipes). The LLM returns boundary words which are mapped back to pixel
positions using OCR character data. Includes comprehensive tests covering
single/multiple redactions, line start/end edge cases, and error handling.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-17 13:59:49 -06:00
Alex-GilbertandClaude Opus 4.6 72eae5a468 docs: add pipeline refactor implementation plan
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-17 13:53:10 -06:00
Alex-GilbertandClaude Opus 4.6 23376ebe00 docs: add pipeline refactor design (LLM-guided redaction detection)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-17 13:48:29 -06:00