Skip to content

chore: bump fig-extract to v2.12.0 - #30

Merged
onetwothr1 merged 1 commit into
devfrom
chore/bump-fig-extract-2.12.0
Jul 23, 2026
Merged

chore: bump fig-extract to v2.12.0#30
onetwothr1 merged 1 commit into
devfrom
chore/bump-fig-extract-2.12.0

Conversation

@onetwothr1

@onetwothr1 onetwothr1 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

엔진 fig-extract.js를 v2.11.0 → v2.12.0으로 벤더링. [계약 무변경]. Draft — [사람] Margin 스모크 대기.

엔진 변경 (hugePenalty 전면 figure 오발 완화)

Nature Extended Data류 전면(full-page) figure(up 영역이 페이지의 65~78%)가 과대 패널티(hugePenalty -8)에 눌려 healthy(≥8) 문턱 아래로 떨어지며 작은 side 크롭에 지던 clip을 해소:

  • up && bodyStops=0 && (farClosed ‖ !raster)일 때 hugePenalty 면제
  • !farClosed && raster(칼럼폭 over-grab)는 벌점 유지 → 회귀 방지

엔진 게이트: gate sCritical 0.9013 → 0.9133, critical 66 → 58 (해소 8·신규 0·회귀 0), 앵커 무악화.

벤더링 검증

  • src/core/fig-extract.js: byte-identical (md5 32d13b96…, diff 0)
  • docs/fig-extract-integration.md: §주의사항에 v2.12.0 항목 추가
  • fig-engine.ts·fig-extract.d.ts 무변경 — 계약 무변경(출력 필드·좌표계·(num,page)·manifest 스키마 불변, 전면 figure bbox가 truth에 더 가까워질 뿐)
  • ✅ typecheck 통과 · ✅ build 통과

남은 것

  • [사람] Margin 스모크 테스트 → 정상 확인 후 Ready for review 전환·머지

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 개선 사항

    • 전면 figure의 크롭 영역 정확도가 향상되었습니다.
    • 특정 전면 figure가 잘못 감지되는 문제가 완화되었습니다.
    • 엔진 버전이 2.12.0으로 업데이트되었습니다.
  • 문서

    • 변경된 크롭 동작과 호환성 정보를 통합 문서에 반영했습니다.
    • 기존 출력 필드, 좌표계, 페이지 정보 및 매니페스트 형식은 변경되지 않았습니다.

hugePenalty 전면 figure 오발 완화 [계약 무변경].
- src/core/fig-extract.js: v2.11.0 → v2.12.0 byte-identical (md5 32d13b96…)
- docs/fig-extract-integration.md: §주의사항에 v2.12.0 전면 figure 크롭 개선 항목 추가

계약 무변경이라 fig-engine.ts·fig-extract.d.ts 수정 불요. 출력 필드·좌표계·
(num,page)·manifest 스키마 불변. typecheck·build 통과.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

엔진 버전을 v2.12.0으로 갱신하고, 방향·래스터·경계 조건에 따른 전면 figure 후보의 hugePenalty 판정을 변경했습니다. 관련 출력 스키마와 좌표계가 유지됨을 통합 문서에 추가했습니다.

Changes

Figure 크롭 엔진 업데이트

Layer / File(s) Summary
방향 기반 figure 스코어링
src/core/fig-extract.js, docs/fig-extract-integration.md
measureCandidatedirection을 반환하도록 확장되고, 특정 up 방향 전면 figure 후보의 hugePenalty가 면제됩니다. 엔진 버전과 관련 통합 문서가 v2.12.0 기준으로 갱신되었습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • enu3379/PDFViewer#2: figure 추출 엔진을 도입한 변경으로, 동일 엔진의 후속 업데이트와 직접 연결됩니다.
  • enu3379/PDFViewer#25: figure 후보 스코어링 및 선택 로직을 변경했습니다.
  • enu3379/PDFViewer#26: 방향 기반 figure 후보 탐지와 스코어링 로직을 변경했습니다.

Suggested reviewers: enu3379

Poem

토끼가 당근처럼 figure를 골라
위쪽 후보의 점수를 살펴요.
큰 벌점은 살짝 내려놓고,
새 버전 표지를 달았답니다.
문서도 함께 깡충깡충!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 fig-extract를 v2.12.0으로 올리는 핵심 변경을 간결하게 잘 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/bump-fig-extract-2.12.0

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
src/core/fig-extract.js

ast-grep timed out on this file


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.

@onetwothr1
onetwothr1 marked this pull request as ready for review July 23, 2026 14:58
@onetwothr1
onetwothr1 requested a review from enu3379 as a code owner July 23, 2026 14:58

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/core/fig-extract.js`:
- Around line 691-692: Update scan() to return stopNstop when the scan ends
because of a body stop, then propagate that value into the metrics used by the
hugeExempt calculation. Ensure up candidates with upStopReason === "body" no
longer appear as bodyStops === 0, while preserving the existing hugePenalty
logic for other candidates.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ee95c32c-489a-4060-a22e-d7828195045f

📥 Commits

Reviewing files that changed from the base of the PR and between 947dda6 and 43eb31b.

📒 Files selected for processing (2)
  • docs/fig-extract-integration.md
  • src/core/fig-extract.js

Comment thread src/core/fig-extract.js
Comment on lines +691 to +692
const hugeExempt = m.direction === "up" && m.bodyStops === 0 && (m.farClosed || !m.raster);
const hugePenalty = (!hugeExempt && (m.areaRatio > 0.65 || m.heightRatio > 0.82)) ? 8 : 0;

@coderabbitai coderabbitai Bot Jul 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

up 후보의 실제 body stop 수를 hugeExempt에 전달해야 합니다.

Line 691-692는 m.bodyStops === 0일 때 hugePenalty를 면제하지만, scan()은 Line 952에서 unprotectedBodyStops: 0을 항상 반환합니다. 따라서 upStopReason === "body"인 과대 후보도 bodyStops가 0으로 남아 farClosed 또는 벡터 조건에 의해 벌점을 면제받을 수 있습니다. scan()이 body stop 시 stopNstop을 반환하도록 수정한 뒤 이 값을 metrics에 전달해야 합니다.

수정 예시
-      return { incl, rx0, rx1, stopReason, stopNstop, farBlankPx, unprotectedBodyStops: 0 };
+      return { incl, rx0, rx1, stopReason, stopNstop, farBlankPx,
+        unprotectedBodyStops: stopReason === "body" ? stopNstop : 0 };
🤖 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 `@src/core/fig-extract.js` around lines 691 - 692, Update scan() to return
stopNstop when the scan ends because of a body stop, then propagate that value
into the metrics used by the hugeExempt calculation. Ensure up candidates with
upStopReason === "body" no longer appear as bodyStops === 0, while preserving
the existing hugePenalty logic for other candidates.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

v2.12.1에서 패치

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@onetwothr1 알겠습니다. v2.12.1에서 scan()의 실제 body-stop 수를 metrics로 전달하는 패치가 반영되면 확인하겠습니다. 현재 PR에서는 해당 수정이 아직 포함되지 않았으므로 코멘트는 열린 상태로 두겠습니다.

@onetwothr1
onetwothr1 merged commit 111f389 into dev Jul 23, 2026
3 checks passed
@onetwothr1
onetwothr1 deleted the chore/bump-fig-extract-2.12.0 branch July 23, 2026 15:17
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.

1 participant