chore: bump fig-extract to v2.12.0 - #30
Conversation
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>
📝 WalkthroughWalkthrough엔진 버전을 v2.12.0으로 갱신하고, 방향·래스터·경계 조건에 따른 전면 figure 후보의 hugePenalty 판정을 변경했습니다. 관련 출력 스키마와 좌표계가 유지됨을 통합 문서에 추가했습니다. ChangesFigure 크롭 엔진 업데이트
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.jsast-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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
docs/fig-extract-integration.mdsrc/core/fig-extract.js
| 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; |
There was a problem hiding this comment.
🎯 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.
There was a problem hiding this comment.
@onetwothr1 알겠습니다. v2.12.1에서 scan()의 실제 body-stop 수를 metrics로 전달하는 패치가 반영되면 확인하겠습니다. 현재 PR에서는 해당 수정이 아직 포함되지 않았으므로 코멘트는 열린 상태로 두겠습니다.
엔진
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 (md532d13b96…, diff 0)docs/fig-extract-integration.md: §주의사항에 v2.12.0 항목 추가fig-engine.ts·fig-extract.d.ts무변경 — 계약 무변경(출력 필드·좌표계·(num,page)·manifest 스키마 불변, 전면 figure bbox가 truth에 더 가까워질 뿐)남은 것
🤖 Generated with Claude Code
Summary by CodeRabbit
개선 사항
문서