Skip to content

contract: mirror the 0x0805..0x0809 OCR plan mints (paired with OGAR #172)#655

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/ogar-mirror-0x08-mints
Jul 7, 2026
Merged

contract: mirror the 0x0805..0x0809 OCR plan mints (paired with OGAR #172)#655
AdaWorldAPI merged 1 commit into
mainfrom
claude/ogar-mirror-0x08-mints

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What

The lance-graph half of the two-sided drift fuse, paired with the now-merged OGAR #172: ogar_codebook::CODEBOOK +5 rows mirroring the OCR PDF→text plan mints, + the lance-graph-ogar doc-count 79→84.

concept id consumer phase (tesseract-rs pdf-to-text-ocr-v1.md)
textline 0x0805 P1B word/box + P3E line formation
blob 0x0806 P3B/3D connected components
page_layout 0x0807 P3F/4A layout result
page_image 0x0808 P2 decode/threshold input
ocr_renderer 0x0809 P4B-D output kinds (fmt = classid custom-low)

Why now (fuse balance)

Since #172 merged, OGAR main carries ALL.len() == 84 while lance-graph main's mirror still has 79 — the lance-graph-ogar COUNT_FUSE compile-assert is unbalanced on main until this lands (exactly the drift the fuse exists to catch). This PR restores balance.

Verification

  • cargo test -p lance-graph-contract829/829 green
  • cargo test --manifest-path crates/lance-graph-ogar/Cargo.toml (standalone, git-deps OGAR main = post-Claude/risc thought engine tc zw7 #172) — compiles + runs, i.e. the COUNT_FUSE compile-time assert balances at 84 == 84

Cherry-pick of 95a5c384 from the session branch (claude/happy-hamilton-0azlw4) onto fresh main, so the fuse balance does not wait on the full session-branch merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Expanded the OCR concept set with new canonical entries for text lines, blobs, page layouts, page images, and OCR rendering.
  • Documentation
    • Updated internal count/coverage notes to reflect the larger OCR vocabulary and its expected alignment across related components.

… OGAR #172)

The lance-graph half of the two-sided drift fuse: ogar_codebook::CODEBOOK +5
rows (textline/blob/page_layout/page_image/ocr_renderer) mirroring OGAR PR #172,
+ the lance-graph-ogar doc-count 79->84. MERGE ORDER: OGAR #172 first (or same
timeframe) — lance-graph-ogar pulls ogar-* as git deps on OGAR main, so its
COUNT_FUSE compile-assert only balances once both sides carry 84. 829/829
contract tests green.

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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@cursor

cursor Bot commented Jul 7, 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_702314b8-a27f-47c1-90a7-3734c6456a55)

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9362df9b-2449-4971-9546-26e1bd45024b

📥 Commits

Reviewing files that changed from the base of the PR and between b05cc30 and d28a397.

📒 Files selected for processing (2)
  • crates/lance-graph-contract/src/ogar_codebook.rs
  • crates/lance-graph-ogar/Cargo.toml
 __________________________________
< The only good bug is a dead bug. >
 ----------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI AdaWorldAPI merged commit 2c342f3 into main Jul 7, 2026
5 of 6 checks passed
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/lance-graph-contract/src/ogar_codebook.rs (1)

694-717: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Extend drift-guard test to cover the new OCR entries.

The comment on this test states entries "MUST match OGAR ogar_vocab::CODEBOOK exactly," but none of the five new ids added in this PR (textline, blob, page_layout, page_image, ocr_renderer) are asserted here. Per the crates/**/*.rs guideline to add tests alongside implementations, extend this test to cover the new mints so a local regression (e.g., a swapped id) is caught without relying solely on the lance-graph-ogar runtime parity check.

✅ Suggested test additions
         // 0x08XX OCR (container kinds; unichar content stays out of the codebook).
         assert_eq!(canonical_concept_id("unicharset"), Some(0x0801));
         assert_eq!(canonical_concept_id("charset"), Some(0x0803));
+        assert_eq!(canonical_concept_id("textline"), Some(0x0805));
+        assert_eq!(canonical_concept_id("blob"), Some(0x0806));
+        assert_eq!(canonical_concept_id("page_layout"), Some(0x0807));
+        assert_eq!(canonical_concept_id("page_image"), Some(0x0808));
+        assert_eq!(canonical_concept_id("ocr_renderer"), Some(0x0809));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/lance-graph-contract/src/ogar_codebook.rs` around lines 694 - 717, The
drift-guard test in codebook_ids_match_ogar_vocab does not cover the newly added
OCR codebook entries, so add assertions for textline, blob, page_layout,
page_image, and ocr_renderer to keep the test aligned with
OGAR::ogar_vocab::CODEBOOK. Update this test alongside canonical_concept_id so a
swapped or changed OCR mint is caught locally, not only by runtime parity
checks. Keep the existing “must match exactly” intent and place the new
assertions with the other OCR-related ids.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/lance-graph-contract/src/ogar_codebook.rs`:
- Around line 694-717: The drift-guard test in codebook_ids_match_ogar_vocab
does not cover the newly added OCR codebook entries, so add assertions for
textline, blob, page_layout, page_image, and ocr_renderer to keep the test
aligned with OGAR::ogar_vocab::CODEBOOK. Update this test alongside
canonical_concept_id so a swapped or changed OCR mint is caught locally, not
only by runtime parity checks. Keep the existing “must match exactly” intent and
place the new assertions with the other OCR-related ids.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9362df9b-2449-4971-9546-26e1bd45024b

📥 Commits

Reviewing files that changed from the base of the PR and between b05cc30 and d28a397.

📒 Files selected for processing (2)
  • crates/lance-graph-contract/src/ogar_codebook.rs
  • crates/lance-graph-ogar/Cargo.toml

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