Skip to content

refactor: knowledge compilation templates - #20383

Merged
JinHai-CN merged 3 commits into
infiniflow:mainfrom
JinHai-CN:fix712
Sep 29, 2026
Merged

JinHai-CN merged 3 commits into
infiniflow:mainfrom
JinHai-CN:fix712

Conversation

@JinHai-CN

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ceb676a1-406d-4e00-b946-022bc27898d2

📥 Commits

Reviewing files that changed from the base of the PR and between f88c1d1 and d01f395.

📒 Files selected for processing (19)
  • Dockerfile
  • internal/ingestion/component/knowledge_compiler/tree/raptor.go
  • internal/ingestion/component/knowledge_compiler/tree/raptor_test.go
  • internal/ingestion/knowledge_compile/templates/knowledge_graph.yaml
  • internal/ingestion/knowledge_compile/templates/mind_map.yaml
  • internal/ingestion/knowledge_compile/templates/page_index.yaml
  • internal/ingestion/knowledge_compile/templates/session_essence.yaml
  • internal/ingestion/knowledge_compile/templates/session_graph.yaml
  • internal/ingestion/knowledge_compile/templates/timeline.yaml
  • internal/ingestion/knowledge_compile/templates/tree.yaml
  • internal/ingestion/knowledge_compile/templates/wiki.yaml
  • internal/ingestion/knowledge_compile/templates/wiki/brand.yaml
  • internal/ingestion/knowledge_compile/templates/wiki/engineering.yaml
  • internal/ingestion/knowledge_compile/templates/wiki/general.yaml
  • internal/ingestion/knowledge_compile/templates/wiki/market.yaml
  • internal/ingestion/knowledge_compile/templates/wiki/product.yaml
  • internal/ingestion/knowledge_compile/templates/wiki/user_interview.yaml
  • internal/service/compilation_template_service.go
  • internal/service/compilation_template_service_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The template service and production image now use the templates under internal/ingestion/knowledge_compile. Tests use the updated paths. Comments above the default Raptor prompt and its test were removed.

Changes

Knowledge template directory update

Layer / File(s) Summary
Update template sources and validation
internal/service/compilation_template_service.go, Dockerfile, internal/service/compilation_template_service_test.go, internal/ingestion/component/knowledge_compiler/tree/raptor.go, internal/ingestion/component/knowledge_compiler/tree/raptor_test.go
Wiki presets and built-in templates now load from internal/ingestion/knowledge_compile/templates. The production image copies templates from that directory. Tests use the updated paths. Comments above the default prompt and its test were removed.

Priority: ⬇️ Low

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

Change: Refactor

Suggested reviewers: yuzhichang

Merge Risk: ⚪ Minimal · up to d01f3

The template assets are available at the paths used by the service, and the remaining changes preserve existing template contents. No actionable merge-blocking risk was found.

Security Architecture Review

Security architecture risk: 🔵 Low · up to d01f3

The production image and service point to the same new template location, with no apparent change to user access or credential authority. Alternate deployment arrangements remain unverified and could serve incomplete template lists if the assets are missing.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A missing packaged directory could affect template lists served by that deployment, rather than just one request. The inspected handlers authenticate before accessing the loaders.

Trust Boundaries and Controls

  • observed — Template directories are fixed in service code, and the inspected public handlers obtain a user before invoking template-list operations. Runtime write access to the packaged directory was not established.

Resilience and Maintainability Implications

  • inferred — Existing empty-list and per-file skip behavior could obscure an asset-packaging mistake during an alternate rollout; the aligned production image path is counterevidence to such a mistake in the reviewed image.

Hardening Proposals

  • proposed — If alternate deployment packages are supported, verify the expected template assets and working directory at startup or through deployment health checks so an incomplete package is detectable.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request has no description. It does not include the required Summary section or explain the purpose and background of the template path changes. Add a Summary section that explains the refactor, identifies the new template locations, and provides relevant background for reviewers.
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the refactor of knowledge compilation templates.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI

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

A rabbit checks the paths at dawn
The templates hop to their new home
The prompt keeps all its words the same
Old comments rest beside the lane
The build packs pages for the road

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

@JinHai-CN
JinHai-CN marked this pull request as ready for review September 29, 2026 09:36
@JinHai-CN JinHai-CN added the ci Continue Integration label Sep 29, 2026
@JinHai-CN
JinHai-CN merged commit fb2699f into infiniflow:main Sep 29, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant