Skip to content

ogar-vocab: OCR action table v2 — recognize_document + 5 structured-doc capabilities#188

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/happy-hamilton-0azlw4
Jul 10, 2026
Merged

ogar-vocab: OCR action table v2 — recognize_document + 5 structured-doc capabilities#188
AdaWorldAPI merged 3 commits into
mainfrom
claude/happy-hamilton-0azlw4

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

OCR action surface v2 — 6 structured-document capabilities

Grows the authoritative ogar_vocab::ocr_actions table from 8 → 14 so consumers (woa-rs, medcare-rs, smb-office-rs, …) can invoke the tesseract-rs structured-document surface through ogar-vocab like every other Core capability.

New ActionDef rows (zero new mints — subjects are the already-minted page_image 0x0808 and page_layout 0x0807):

capability subject produces
recognize_page_words page_image line_words
recognize_document page_image doc_json, fields (the one-shot: image → doc.v1 JSON + typed invoice fields)
harvest_fields page_layout fields
segment_page page_image regions_rects
detect_halftone_regions page_image figure_rects, mask_w, mask_h, found
detect_page_furniture page_layout header_lines, footer_lines, page_number

Fuse: OCR_ACTION_NAMES 8→14 + const _ assert 8→14; OCR_SUBJECT_CLASSIDS += PAGE_LAYOUT (the only net-new subject); the capability_registry hot-plug test mirrors (OCR_IDS/OCR_COVERED) are converted to LIVE references so they can never re-drift.

Process: authored via the 5+3 council (5 verification savants → consolidate → 3 brutal reviewers, all CLEAN). Spec + phase-1 consolidation in docs/OCR-ACTIONS-V2-PROPOSAL.md; DISCOVERY-MAP D-OCR-ACTIONS-V2 appended. Deferred (recorded, not omitted): typed_field mint (0x080A), a language param slot, a classify_regions toggle.

⚠ Merge order: merge THIS first. The companion tesseract-rs PR grows tesseract-ogar::COVERED_CAPABILITIES 8→14; its const _ assert against OCR_ACTION_NAMES makes the interim a hard workspace compile failure (verified: the assert fails in both 8-vs-14 and 14-vs-8 directions), so both must land.

Tests: 125/125 ogar-vocab, clippy clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1

claude added 3 commits July 10, 2026 07:58
…ding)

Detailed spec for extending ogar_vocab::ocr_actions from 8 to 14
capabilities (word-level page recognition, doc.v1 structured document,
typed invoice-field harvest, page segmentation, halftone detection,
page furniture) with numbered verifiable claims, zero new mints,
fuse-extension mechanics, executor pairing order, IR-shape and
preflight answers, and explicit non-goals. 5+3 council protocol:
5 verification savants first, consolidate, then 3 brutal reviewers.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1
Folds the 5 verification savants' evidence-backed corrections into the
spec before the 3 brutal reviewers (operator protocol: consolidate first
so the 5+3 doesn't go mushy). Load-bearing: the live fuse is
resolve_hotplug/HOT_PLUG not verify_ocr_registration; interim break is a
hard workspace compile failure; classify_regions dropped (no precedent);
C4 re-answered against the real OGAR-AS-IR §3 tests; BBB resolution path
for the woa-rs sketch; docs land in ocr_actions.rs module doc + a
DISCOVERY-MAP entry, not ARAGO-ACTIONHANDLER-PARITY.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1
Grows ogar_vocab::ocr_actions 8->14: recognize_page_words,
recognize_document (the one-shot: page -> doc.v1 JSON + typed fields),
harvest_fields, segment_page, detect_halftone_regions,
detect_page_furniture. Zero new mints — subjects are the already-minted
page_image (0x0808) and page_layout (0x0807); OCR_SUBJECT_CLASSIDS gains
exactly {PAGE_LAYOUT}. The const-assert fuse is 8->14, and the
capability_registry hot-plug test mirrors (OCR_IDS/OCR_COVERED) are
converted to LIVE references to the authoritative consts so they can
never re-drift.

5 new tests (document reads cover the word stage, harvest_profile slot
presence, subject set == exact row subjects, +v2 rows in the derive);
125/125 ogar-vocab tests, clippy clean. Spec + phase-1 (5-savant)
consolidation in docs/OCR-ACTIONS-V2-PROPOSAL.md; DISCOVERY-MAP
D-OCR-ACTIONS-V2 entry appended.

Companion tesseract-rs PR (tesseract-ogar executor COVERED 8->14 +
recognize_document helper) lands in lockstep; merge THIS first (the
sibling path-dep makes the interim a hard workspace compile failure).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_eb4daddd-69b1-4392-91b3-a6a18bc816be)

@AdaWorldAPI AdaWorldAPI merged commit 743f1a3 into main Jul 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants