Skip to content

Feature/298 table description - #325

Merged
HeechanKim-Genon merged 8 commits into
developfrom
feature/298-table-description
Jul 15, 2026
Merged

Feature/298 table description#325
HeechanKim-Genon merged 8 commits into
developfrom
feature/298-table-description

Conversation

@inoray

@inoray inoray commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

feat(#298): 표 description(요약/재구성) + 청킹 옵션(chunk_mode/split_only) + doc_summary 단계화

개요

TableItem 단위 표 description(요약 병기 + refine HTML 재구성)을 표준 enrichment 로 도입하고,
청크의 표 출력 포맷/크기 제어 옵션doc_summary 단계화를 함께 정리했다.
intelligent_processor 중심으로 convert/parser/BOK 적재용까지 확산했다.

표 description 은 표를 이미지로 VLM 에 보내 두 가지를 얻는다.

  • 요약(summary): 청크 표 뒤에 \n---\n[표 설명]\n<요약> 로 병기.
  • 재구성(refine): 표 본체를 LLM 재구성 HTML 로 교체(출력 포맷에 맞춰 html/markdown 변환).

table_description/refine/doc_summary모두 기본 off 라 켜지 않으면 회귀 없음.
단, 청킹 기본값(chunk_size/chunk_mode)은 아래 "하위 호환/동작 변경" 대로 출고 기본이 바뀐다.

주요 변경

1) 표 description (table_description) — 신규 enrichment

facade/enrichment/table_description.py(신규, 공용 모듈 — intelligent/convert/parser 가 import).

- table_description:
    enable: false          # 기본 off. true 또는 런타임 table_desc=1 로 활성화
    url: ...; api_key: ...; model: ...
    concurrency: 8
    before_items: 3
    after_items: 2
    max_context_chars: 1500
    prompt_template_file: prompt_table_description_default.md   # 요약 전용
    refine:
      enable: false        # true 또는 런타임 table_refine=1
      prompt_file: prompt_table_refine_combined.md             # 재구성 HTML + 요약 통합
  • 부착 방식: 요약은 DescriptionAnnotation, 재구성 HTML 은 MiscAnnotation(content={"refined_html": ...})
    로 TableItem 에 부착. 청킹 시 intelligent_processor._extract_table_text() 가 소비
    (refine 있으면 표 본체 교체, 요약 있으면 [표 설명] 병기).
  • 런타임 kwargs: table_desc(→enable), table_refine(→refine.enable) — 요청 단위 오버라이드.
  • 프롬프트: prompt_table_description_default.md(요약), prompt_table_refine_combined.md
    ([[[TABLE_HTML]]]/[[[TABLE_SUMMARY]]] 마커 규약으로 재구성 HTML + 요약 통합 응답).

2) refine 결과 유효성 검증 — 잘못된 재구성/요약이면 원본 표로 폴백

VLM 재구성이 깨지거나(잘림/degeneration) 요약에 마크업이 새어들어도 그대로 쓰이지 않도록 다단 검증 추가.

  • is_valid_refined_html(): 재구성 HTML 구조 검증 — 원문에서 <table>/</table> 태그쌍 개수 일치
    (bs4 자동보정으로 인한 잘린 표 통과 방지) + docling grid 복원 + 2행 이상 + 첫 행 non-empty.
    실패 시 annotation 부착 안 함 → 다운스트림이 원본 표로 폴백.
  • _parse_refine_output() 강건화: [[[TABLE_SUMMARY]]] 마커 누락 등 마커 구조가 불완전하면
    (응답 잘림/토큰 반복 폭주) 전체를 요약으로 덤프하지 않고 ("", "") 반환 → 폐기.
  • is_valid_table_summary(): 요약에 [[[TABLE_HTML]]] 마커나 원문 <table> 잔재가 섞이면 폐기
    (요약 경로로 깨진 표가 새어드는 사례 차단).

3) 표 출력 포맷 옵션 (output)

output:
  table_format: "html"    # "html"(기본) | "markdown"
  compact_tables: true     # markdown 표 컬럼 정렬 패딩 제거(대형 표 청크 축소). html 포맷엔 무관.
  • markdown 선택 시 docling MarkdownDocSerializer(compact_tables=…) 로 직렬화(네이티브 표와 동일 경로).

4) 청킹 옵션 (chunking)

chunking:
  chunk_size: 10000        # 0 = 크기 기반 분할 안 함. 0 초과 시 최소 1024 로 보정.
  chunk_mode: split_only   # split_only(기본) | resize_all. 우선순위: kwargs.chunk_mode > 아래.
  • chunk_mode: split_only=구조 기반 청크를 유지하고 chunk_size 초과 청크만 분할(작은 청크 병합 안 함) /
    resize_all=모든 청크를 chunk_size 에 맞게 병합·분할(기존 방식).
  • chunk_size 최소 1024 보정(_clamp_chunk_size): 0 초과이면서 1024 미만이면 1024 로 상향(과도한 문맥 절단 방지). 0/None 은 그대로.
  • GenosSmartChunker 6개 복제본에 동일 적용: intelligent/convert/chunking + BOK 적재용 내부/외부/규정.
    구현: 2.5단계(긴 청크 분할)·4단계(토큰 병합 트리거)·5단계(greedy 병합)를 resize_all 전용으로 게이트하고,
    split_only 전용 5.5단계(초과 그룹만 균등 분할) 추가.
  • 런타임 kwargs: chunk_size, chunk_mode. 예제 러너 parse_chunk_test.py--chunk-mode 추가.

5) doc_summary 단계화

facade/enrichment/doc_summary.py(신규). 문서 본문요약을 요청당 1회 계산해 _enrichment_context
image/table description 이 {{doc_summary}} 로 공유(중복 LLM 호출 제거), 결과는 출력 metadata 에도 노출.
실제 요약 계산은 기존 body_summary.summarize_body() 에 위임. 런타임 kwargs doc_summary.

- doc_summary:
    enable: false          # 기본 off. true 또는 런타임 doc_summary=1
    prompt_file: prompt_doc_summary.md
    max_chars: 6000

6) 확산 / 배선

  • convert/parser: 표 description·출력 포맷 옵션·런타임 토글 배선.
  • BOK 적재용 3종: 청킹 옵션(CHUNK_MODE) + chunk_size 보정 반영.

7) config / 프롬프트 / 문서 / 테스트

  • config(resource·resource_dev, intelligent/convert/chunking/parser): table_description·output·chunking 블록.
  • 프롬프트: prompt_table_description_default.md, prompt_table_refine_combined.md(각 resource·resource_dev).
  • gitbook 매뉴얼(intelligent/convert/parser/intro) 갱신.
  • 단위 테스트: tests/unit/test_table_refine_validation.py(신규), tests/unit/test_chunk_size_config.py(clamp/mode 확장).

하위 호환 / 동작 변경

  • table_description/refine/doc_summary 전부 기본 enable:false켜지 않으면 회귀 없음.
  • ⚠️ 청킹 기본값 변경: chunk_size 출고 기본이 0 → 10000, chunk_mode 기본 split_only 로 바뀐다.
    기존 "무분할(0)" 대비 문서가 10000 초과 시 분할된다. 기존 동작 재현chunk_size: 0 또는 (병합 방식은) chunk_mode: resize_all.
  • ⚠️ BOK 적재용 3종: CHUNK_MAX_TOKENS 0→10000, CHUNK_MODE split_only → BOK 청크 출력이 실제로 바뀐다.
  • output.table_format 기본 html 유지, compact_tables 는 markdown 포맷에만 영향 → 기본(html) 출력 불변.
  • 비용: table_description/refine/doc_summary 는 각각 추가 LLM 호출을 유발(활성화 시).

테스트 / 검증

  • python -m py_compile: 표 enrichment 모듈 + 6개 청커 facade 통과.
  • 단위 테스트(.venv 실제 실행): test_table_refine_validation.py 16 passed(구조/태그쌍/마커/summary 검증),
    test_chunk_size_config.py(min-clamp·chunk_mode 우선순위) 통과, enrichment 스위트 회귀 없음(126 passed).
  • 로컬은 vendored docling(docling_parse.ContentConfig) 충돌로 facade import 기반 테스트가 skip 되는 관례 →
    실서빙 E2E 는 shkim_labs/test.py / 게이트웨이 스크립트로 수행.
  • refine 실동작 확인: refine 켠 상태에서 깨진 재구성/요약이 청크에서 사라지고 원본 표로 폴백되는지
    (refined table invalid/refine 응답 마커 불완전 → 폐기 로그) 확인.

변경 파일

  • 신규: facade/enrichment/table_description.py, facade/enrichment/doc_summary.py,
    tests/unit/test_table_refine_validation.py,
    resource/·resource_dev/prompt_table_description_default.md, prompt_table_refine_combined.md
  • 청커 facade(청킹 옵션): facade/intelligent_processor.py, convert_processor.py, chunking_processor.py,
    facade/legacy/BOK_적재용_{내부,외부,규정}.py (+ BOK_첨부용.py 소규모)
  • enrichment: facade/enrichment/__init__.py, enrichment_config.py, image_description.py
  • 확산: facade/parser_processor.py
  • config: resource/·resource_dev/intelligent/convert/chunking/parser_processor_config.yaml
  • 문서: facade/gitbook_doc/{intelligent,convert,parser}_processor.md, intro.md
  • 도구/테스트: examples/parse_chunk/parse_chunk_test.py, tests/unit/test_chunk_size_config.py

Summary by CodeRabbit

  • New Features
    • Added configurable document chunking modes: structure-preserving split_only and resizing resize_all.
    • Added optional document summaries and table descriptions, including table reconstruction and refinement.
    • Added runtime controls for summary, table description, and table refinement enrichment.
    • Added compact Markdown table output to reduce unnecessary spacing.
  • Bug Fixes
    • Improved handling of oversized content while preserving smaller structural sections.
    • Enrichment failures are isolated so one failed step no longer interrupts processing.
  • Documentation
    • Updated configuration guides and prompt templates for the new options.

@inoray inoray linked an issue Jul 15, 2026 that may be closed by this pull request
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@inoray inoray self-assigned this Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@inoray, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a022f3e-f492-4c9a-9b72-f7f3913349b9

📥 Commits

Reviewing files that changed from the base of the PR and between ed63d09 and f2cda4e.

📒 Files selected for processing (13)
  • docling/backend/genos_hwp_backend.py
  • genon/preprocessor/facade/convert_processor.py
  • genon/preprocessor/facade/enrichment/table_description.py
  • genon/preprocessor/facade/gitbook_doc/convert_processor.md
  • genon/preprocessor/facade/gitbook_doc/intelligent_processor.md
  • genon/preprocessor/facade/gitbook_doc/parser_processor.md
  • genon/preprocessor/facade/intelligent_processor.py
  • genon/preprocessor/facade/parser_processor.py
  • genon/preprocessor/resource/convert_processor_config.yaml
  • genon/preprocessor/resource/intelligent_processor_config.yaml
  • genon/preprocessor/resource/parser_processor_config.yaml
  • genon/preprocessor/tests/unit/test_parser_processor_unit.py
  • genon/preprocessor/tests/unit/test_table_refine_validation.py
📝 Walkthrough

Walkthrough

The PR adds split_only and resize_all chunking modes, compact Markdown table serialization, standalone document-summary and table-description enrichers, refined table handling, runtime enrichment toggles, configuration updates, prompt templates, documentation, and related unit tests.

Changes

Chunking and enrichment pipeline

Layer / File(s) Summary
Mode-aware chunking and table serialization
genon/preprocessor/facade/*, genon/preprocessor/facade/legacy/*, genon/preprocessor/examples/parse_chunk/*, genon/preprocessor/tests/unit/test_chunk_size_config.py
Chunking now validates modes, clamps positive sizes to 1024, supports split-only oversized-group splitting, and forwards mode settings through processors and the CLI.
Document and table enrichment components
genon/preprocessor/facade/enrichment/*, genon/preprocessor/tests/unit/test_table_refine_validation.py
Adds cached document summaries, table-description requests, refined HTML parsing, annotation extraction, validation, and concurrent table enrichment.
Runtime enrichment and output wiring
genon/preprocessor/facade/convert_processor.py, genon/preprocessor/facade/parser_processor.py, genon/preprocessor/facade/intelligent_processor.py
Wires runtime toggles, enrichment ordering, refined table rendering, compact Markdown output, and per-stage exception isolation into document processing.
Configuration, prompts, and documentation
genon/preprocessor/resource*, genon/preprocessor/facade/gitbook_doc/*
Documents and configures chunk modes, compact tables, document summaries, chart handling, table descriptions, and table refinement prompts.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: heechankim-genon

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the main change and identifies the new table description feature.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/298-table-description

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.

@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: 12

Caution

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

⚠️ Outside diff range comments (1)
genon/preprocessor/facade/intelligent_processor.py (1)

2504-2570: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Same _configure_runtime_image_mode early-return coupling as convert_processor.py.

Identical structure to convert_processor.py#L2625-L2664: table_desc/table_refine/doc_summary runtime reconfiguration lives after the if base is None: return guard that's only meant to gate image-description reconfiguration. See the consolidated comment for details/fix suggestion.

🤖 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 `@genon/preprocessor/facade/intelligent_processor.py` around lines 2504 - 2570,
Update _configure_runtime_image_mode so the base image-description guard only
skips image_description_options and image_description_enricher reconstruction;
do not return from the entire method when _base_image_description_options is
missing. Keep table_desc/table_refine handling under its own
_base_table_description_options check and doc_summary handling under its own
_base_doc_summary_options check, allowing both to be reconfigured independently.
🧹 Nitpick comments (4)
genon/preprocessor/facade/chunking_processor.py (1)

1323-1323: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Format multiple statements on separate lines.

For better readability and PEP-8 compliance, consider splitting these statements onto separate lines rather than using semicolons.

♻️ Proposed refactor
-                            gi.append(x[0]); gh.append(x[1]); gs.append(x[2])
+                            gi.append(x[0])
+                            gh.append(x[1])
+                            gs.append(x[2])
🤖 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 `@genon/preprocessor/facade/chunking_processor.py` at line 1323, In the loop
containing gi.append, gh.append, and gs.append, place each append statement on
its own line and remove the semicolon-separated formatting while preserving the
existing order and behavior.

Source: Linters/SAST tools

genon/preprocessor/tests/unit/test_chunk_size_config.py (1)

28-160: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

LGTM overall — the spy/config helpers and new clamp/chunk_mode assertions are correct and well-targeted.

One coverage gap: genon/preprocessor/facade/chunking_processor.py has the identical _clamp_chunk_size/chunk_mode implementation (per the provided graph context) but isn't covered by _DEFAULT_CONFIG/_MODULES here, so a regression there wouldn't be caught by this suite. Consider adding "chunking_processor": "chunking_processor_config.yaml" to _DEFAULT_CONFIG (and to _MODULES) to reuse these same parametrized tests.

🤖 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 `@genon/preprocessor/tests/unit/test_chunk_size_config.py` around lines 28 -
160, Extend the test module’s shared coverage lists by adding the
chunking_processor module and its chunking_processor_config.yaml mapping to
_MODULES and _DEFAULT_CONFIG. Ensure the existing parametrized tests and helpers
exercise genon/preprocessor/facade/chunking_processor.py without introducing
separate test logic.
genon/preprocessor/resource/convert_processor_config.yaml (1)

98-99: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Explicitly define compact_tables in the output section.

The documentation correctly states that output.compact_tables: true is the default setting to remove padding from Markdown tables. However, this option is missing from the YAML templates, which limits discoverability for operators trying to configure output formats.

  • genon/preprocessor/resource/convert_processor_config.yaml#L98-L99: Add compact_tables: true under output.
  • genon/preprocessor/resource/intelligent_processor_config.yaml#L100-L101: Add compact_tables: true under output.
💡 Proposed refactor to add the configuration key
 output:
   table_format: "html"   # "html"(default) | "markdown"
+  compact_tables: true   # markdown 표 컬럼 정렬 패딩 제거(대형 표 축소). html 포맷엔 무관
🤖 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 `@genon/preprocessor/resource/convert_processor_config.yaml` around lines 98 -
99, Add compact_tables: true under the output section in
genon/preprocessor/resource/convert_processor_config.yaml (lines 98-99) and
genon/preprocessor/resource/intelligent_processor_config.yaml (lines 100-101),
alongside table_format, so both templates explicitly expose the documented
default.
genon/preprocessor/facade/parser_processor.py (1)

1356-1375: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Log a warning if table_desc is enabled at runtime but generate_page_images is disabled.

If table_desc is dynamically enabled via runtime kwargs while generate_page_images is False in the pipeline configuration, the VLM will fail to crop the table images. Consider adding a warning log here to alert operators, similar to the documented limitation for image_description.

💡 Proposed refactor to add a warning log
             self.table_description_options = resolve_runtime_table_options(
                 tbase,
                 table_desc=table_desc,
                 table_refine=table_refine,
             )
+            if self.table_description_options.enabled and not getattr(self.pipe_line_options, "generate_page_images", False):
+                _log.warning("[runtime_feature] table_desc is enabled at runtime, but generate_page_images is False. Table images will not be cropped.")
             self.table_description_enricher = TableDescriptionEnricher(
                 self.table_description_options
             )
🤖 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 `@genon/preprocessor/facade/parser_processor.py` around lines 1356 - 1375, Add
a warning in the runtime table-options block after resolving table_desc when
table_desc is enabled but the pipeline’s generate_page_images configuration is
false. Use the existing _log warning pattern and match the documented
image_description limitation, without changing option resolution or enrichment
behavior.
🤖 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 `@genon/preprocessor/facade/convert_processor.py`:
- Around line 2625-2664: Remove the early return in
_configure_runtime_image_mode that is triggered when
_base_image_description_options is missing. Scope image-option resolution and
enrichment updates to the image base-options check, then allow the existing
_base_table_description_options and _base_doc_summary_options branches to run
independently when their own base options are available.
- Around line 983-988: Update _table_item_to_texts so the early return guarded
by TableDescriptionExtractor only applies when refined HTML is present, not when
only a summary exists. For summary-only tables, preserve row-based splitting and
append the summary text only to the final split chunk, maintaining the
configured chunk_size behavior and avoiding duplicate summary content.

In `@genon/preprocessor/facade/enrichment/table_description.py`:
- Around line 379-387: Update TableItem.extract_summary to return only the
description annotation produced by the configured table-description source,
rather than the first DescriptionAnnotation from any enricher. Filter
annotations using the existing table-description provenance or dedicated
annotation key, while preserving the current text normalization and empty-string
fallback.
- Around line 319-324: Update the table validation around
GenosVlmHTMLDocumentBackend.parse_table_data so the first row is accepted only
when at least one normalized cell contains non-whitespace text, not merely when
grid[0] has cells. Preserve the existing checks for missing data, empty grids,
and missing data rows, and add a test covering a header row whose cells are all
empty.
- Around line 261-265: Update the resolver’s replace call so table_refine=1 also
sets enabled=True, allowing refinement to activate table enrichment
independently of table_desc. Preserve refine_enabled behavior and the existing
disabled state when neither option is enabled.
- Line 190: Update the table-description configuration parsing around
_parse_optional_bool to read the documented “enable” key instead of “enabled”,
so supplied enable: true values are recognized and enablement is preserved.
- Around line 539-564: Update the prompt-building method containing the
tpl.render call so max_context_chars is applied to individual context values,
especially doc_summary and the other safe_* inputs, before rendering. Remove the
final self._truncate_context(prompt) call and return the fully rendered prompt
unchanged, preserving the refine template’s trailing instructions and markers.

In `@genon/preprocessor/facade/intelligent_processor.py`:
- Around line 961-966: Update the table-splitting condition in the relevant
intelligent processor flow so row splitting is skipped only when refined HTML is
present, not when only a summary annotation exists. Preserve the single-chunk
behavior for tables with refined HTML while allowing summary-only large tables
to continue through the normal chunk-size-aware row splitting path.

In `@genon/preprocessor/resource_dev/convert_processor_config.yaml`:
- Line 173: Remove the plaintext API credential from both enrichment blocks in
genon/preprocessor/resource_dev/convert_processor_config.yaml at lines 173-173
and 198-198, replacing each api_key value with the project’s environment/secret
configuration reference. Use the same secret reference for document summaries
and table descriptions, and rotate the exposed credential.

In `@genon/preprocessor/resource_dev/intelligent_processor_config.yaml`:
- Line 190: Remove the plaintext api_key values from
intelligent_processor_config.yaml at lines 190-190 and 215-215, and
parser_processor_config.yaml at lines 152-152 and 177-177. Replace each with the
project’s supported environment-variable reference or a secure empty
placeholder, without committing credentials.

In `@genon/preprocessor/resource/convert_processor_config.yaml`:
- Around line 164-165: Update the doc_summary URL placeholder from
IMAGE_DESCRIPTION_SERVING_ID to ENRICHMENT_SERVING_ID in
genon/preprocessor/resource/convert_processor_config.yaml lines 164-165 and
genon/preprocessor/resource/intelligent_processor_config.yaml lines 163-164.
- Around line 186-187: Use <IMAGE_DESCRIPTION_SERVING_ID> consistently for
table_description because it relies on VLM image processing. Keep the existing
YAML URLs in convert_processor_config.yaml (lines 186-187) and
intelligent_processor_config.yaml (lines 185-186); update the corresponding
placeholders in convert_processor.md (lines 286-287), intelligent_processor.md
(lines 286-287), and parser_processor.md (lines 279-280). In parser_processor.md
(line 697), move table_description.url from the <ENRICHMENT_SERVING_ID> group
into the <IMAGE_DESCRIPTION_SERVING_ID> group.

---

Outside diff comments:
In `@genon/preprocessor/facade/intelligent_processor.py`:
- Around line 2504-2570: Update _configure_runtime_image_mode so the base
image-description guard only skips image_description_options and
image_description_enricher reconstruction; do not return from the entire method
when _base_image_description_options is missing. Keep table_desc/table_refine
handling under its own _base_table_description_options check and doc_summary
handling under its own _base_doc_summary_options check, allowing both to be
reconfigured independently.

---

Nitpick comments:
In `@genon/preprocessor/facade/chunking_processor.py`:
- Line 1323: In the loop containing gi.append, gh.append, and gs.append, place
each append statement on its own line and remove the semicolon-separated
formatting while preserving the existing order and behavior.

In `@genon/preprocessor/facade/parser_processor.py`:
- Around line 1356-1375: Add a warning in the runtime table-options block after
resolving table_desc when table_desc is enabled but the pipeline’s
generate_page_images configuration is false. Use the existing _log warning
pattern and match the documented image_description limitation, without changing
option resolution or enrichment behavior.

In `@genon/preprocessor/resource/convert_processor_config.yaml`:
- Around line 98-99: Add compact_tables: true under the output section in
genon/preprocessor/resource/convert_processor_config.yaml (lines 98-99) and
genon/preprocessor/resource/intelligent_processor_config.yaml (lines 100-101),
alongside table_format, so both templates explicitly expose the documented
default.

In `@genon/preprocessor/tests/unit/test_chunk_size_config.py`:
- Around line 28-160: Extend the test module’s shared coverage lists by adding
the chunking_processor module and its chunking_processor_config.yaml mapping to
_MODULES and _DEFAULT_CONFIG. Ensure the existing parametrized tests and helpers
exercise genon/preprocessor/facade/chunking_processor.py without introducing
separate test logic.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97464393-836b-4ab1-a1ea-aee881944c0d

📥 Commits

Reviewing files that changed from the base of the PR and between c705854 and ed63d09.

📒 Files selected for processing (32)
  • genon/preprocessor/examples/parse_chunk/parse_chunk_test.py
  • genon/preprocessor/facade/chunking_processor.py
  • genon/preprocessor/facade/convert_processor.py
  • genon/preprocessor/facade/enrichment/__init__.py
  • genon/preprocessor/facade/enrichment/doc_summary.py
  • genon/preprocessor/facade/enrichment/enrichment_config.py
  • genon/preprocessor/facade/enrichment/image_description.py
  • genon/preprocessor/facade/enrichment/table_description.py
  • genon/preprocessor/facade/gitbook_doc/convert_processor.md
  • genon/preprocessor/facade/gitbook_doc/intelligent_processor.md
  • genon/preprocessor/facade/gitbook_doc/intro.md
  • genon/preprocessor/facade/gitbook_doc/parser_processor.md
  • genon/preprocessor/facade/intelligent_processor.py
  • genon/preprocessor/facade/legacy/BOK_적재용_규정.py
  • genon/preprocessor/facade/legacy/BOK_적재용_내부.py
  • genon/preprocessor/facade/legacy/BOK_적재용_외부.py
  • genon/preprocessor/facade/legacy/BOK_첨부용.py
  • genon/preprocessor/facade/parser_processor.py
  • genon/preprocessor/resource/chunking_processor_config.yaml
  • genon/preprocessor/resource/convert_processor_config.yaml
  • genon/preprocessor/resource/intelligent_processor_config.yaml
  • genon/preprocessor/resource/parser_processor_config.yaml
  • genon/preprocessor/resource/prompt_table_description_default.md
  • genon/preprocessor/resource/prompt_table_refine_combined.md
  • genon/preprocessor/resource_dev/chunking_processor_config.yaml
  • genon/preprocessor/resource_dev/convert_processor_config.yaml
  • genon/preprocessor/resource_dev/intelligent_processor_config.yaml
  • genon/preprocessor/resource_dev/parser_processor_config.yaml
  • genon/preprocessor/resource_dev/prompt_table_description_default.md
  • genon/preprocessor/resource_dev/prompt_table_refine_combined.md
  • genon/preprocessor/tests/unit/test_chunk_size_config.py
  • genon/preprocessor/tests/unit/test_table_refine_validation.py

Comment thread genon/preprocessor/facade/convert_processor.py Outdated
Comment thread genon/preprocessor/facade/convert_processor.py Outdated
)
return None

enabled = _parse_optional_bool(table_desc_cfg.get("enabled"), "enabled")

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

Read the documented enable configuration key.

All supplied table-description YAML blocks use enable, but this parser only reads enabled, so enable: true still resolves to disabled.

Proposed fix
-        enabled = _parse_optional_bool(table_desc_cfg.get("enabled"), "enabled")
+        enabled = _parse_optional_bool(table_desc_cfg.get("enable"), "enable")
+        if enabled is None:
+            enabled = _parse_optional_bool(table_desc_cfg.get("enabled"), "enabled")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
enabled = _parse_optional_bool(table_desc_cfg.get("enabled"), "enabled")
enabled = _parse_optional_bool(table_desc_cfg.get("enable"), "enable")
if enabled is None:
enabled = _parse_optional_bool(table_desc_cfg.get("enabled"), "enabled")
🤖 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 `@genon/preprocessor/facade/enrichment/table_description.py` at line 190,
Update the table-description configuration parsing around _parse_optional_bool
to read the documented “enable” key instead of “enabled”, so supplied enable:
true values are recognized and enablement is preserved.

Comment thread genon/preprocessor/facade/enrichment/table_description.py
Comment thread genon/preprocessor/facade/enrichment/table_description.py
Comment thread genon/preprocessor/facade/intelligent_processor.py Outdated
- doc_summary:
enable: false # 기본 off. true 또는 런타임 doc_summary=1 로 활성화. image/table 이 공유
url: "https://genos.genon.ai/api/gateway/rep/serving/776/v1/chat/completions"
api_key: "30241fdbb58d42e48a36495da34a6de7"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win

Remove and rotate the committed API credential.

The new enrichment blocks duplicate a plaintext API key in version control. Load it from environment/secret configuration and rotate the exposed credential.

  • genon/preprocessor/resource_dev/convert_processor_config.yaml#L173-L173: replace the document-summary key with a secret reference.
  • genon/preprocessor/resource_dev/convert_processor_config.yaml#L198-L198: replace the table-description key with the same secret reference.
🧰 Tools
🪛 Betterleaks (1.6.1)

[high] 173-173: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

📍 Affects 1 file
  • genon/preprocessor/resource_dev/convert_processor_config.yaml#L173-L173 (this comment)
  • genon/preprocessor/resource_dev/convert_processor_config.yaml#L198-L198
🤖 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 `@genon/preprocessor/resource_dev/convert_processor_config.yaml` at line 173,
Remove the plaintext API credential from both enrichment blocks in
genon/preprocessor/resource_dev/convert_processor_config.yaml at lines 173-173
and 198-198, replacing each api_key value with the project’s environment/secret
configuration reference. Use the same secret reference for document summaries
and table descriptions, and rotate the exposed credential.

Source: Linters/SAST tools

- doc_summary:
enable: false # 기본 off. true 또는 런타임 doc_summary=1 로 활성화. image/table 이 공유
url: "https://genos.genon.ai/api/gateway/rep/serving/776/v1/chat/completions"
api_key: "30241fdbb58d42e48a36495da34a6de7"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Avoid hardcoding API keys in configuration files.

These newly added configuration blocks contain a hardcoded API key (30241fdbb58d42e48a36495da34a6de7). Even in development environments, committing credentials to source control poses a security risk. Consider removing the plaintext keys and sourcing them securely using environment variables or a secrets manager.

  • genon/preprocessor/resource_dev/intelligent_processor_config.yaml#L190-L190: Remove the hardcoded API key and replace it with an environment variable reference or secure placeholder (e.g., "").
  • genon/preprocessor/resource_dev/intelligent_processor_config.yaml#L215-L215: Remove the hardcoded API key here as well.
  • genon/preprocessor/resource_dev/parser_processor_config.yaml#L152-L152: Remove the hardcoded API key here.
  • genon/preprocessor/resource_dev/parser_processor_config.yaml#L177-L177: Remove the hardcoded API key here.
🧰 Tools
🪛 Betterleaks (1.6.1)

[high] 190-190: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

📍 Affects 2 files
  • genon/preprocessor/resource_dev/intelligent_processor_config.yaml#L190-L190 (this comment)
  • genon/preprocessor/resource_dev/intelligent_processor_config.yaml#L215-L215
  • genon/preprocessor/resource_dev/parser_processor_config.yaml#L152-L152
  • genon/preprocessor/resource_dev/parser_processor_config.yaml#L177-L177
🤖 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 `@genon/preprocessor/resource_dev/intelligent_processor_config.yaml` at line
190, Remove the plaintext api_key values from intelligent_processor_config.yaml
at lines 190-190 and 215-215, and parser_processor_config.yaml at lines 152-152
and 177-177. Replace each with the project’s supported environment-variable
reference or a secure empty placeholder, without committing credentials.

Source: Linters/SAST tools

Comment on lines +164 to +165
enable: false # 기본 off. true 또는 런타임 doc_summary=1 로 활성화. image/table 이 공유
url: "http://llmops-gateway-api-service:8080/rep/serving/<IMAGE_DESCRIPTION_SERVING_ID>/v1/chat/completions"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Correct the serving ID placeholder for doc_summary.

The doc_summary enricher performs text-based LLM summarization, but the YAML configuration templates incorrectly use <IMAGE_DESCRIPTION_SERVING_ID> (a VLM endpoint). According to the documentation, this should use <ENRICHMENT_SERVING_ID>.

  • genon/preprocessor/resource/convert_processor_config.yaml#L164-L165: Replace <IMAGE_DESCRIPTION_SERVING_ID> with <ENRICHMENT_SERVING_ID>.
  • genon/preprocessor/resource/intelligent_processor_config.yaml#L163-L164: Replace <IMAGE_DESCRIPTION_SERVING_ID> with <ENRICHMENT_SERVING_ID>.
📍 Affects 2 files
  • genon/preprocessor/resource/convert_processor_config.yaml#L164-L165 (this comment)
  • genon/preprocessor/resource/intelligent_processor_config.yaml#L163-L164
🤖 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 `@genon/preprocessor/resource/convert_processor_config.yaml` around lines 164 -
165, Update the doc_summary URL placeholder from IMAGE_DESCRIPTION_SERVING_ID to
ENRICHMENT_SERVING_ID in
genon/preprocessor/resource/convert_processor_config.yaml lines 164-165 and
genon/preprocessor/resource/intelligent_processor_config.yaml lines 163-164.

Comment thread genon/preprocessor/resource/convert_processor_config.yaml
@inoray
inoray requested a review from HeechanKim-Genon July 15, 2026 01:39
@HeechanKim-Genon
HeechanKim-Genon merged commit a3cb2ae into develop Jul 15, 2026
3 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.

테이블 description 기능 구현

2 participants