Repository navigation
fix(ingestion): derive component param whitelist from component schemas - #20060
Conversation
chunk_token_cap and root_chunk_as_heading were silently dropped when saving the dataset/document parser_config for the builtin title and manual templates: the param whitelist only accepted keys the DSL template already carried, and those templates bake only method, hierarchy, levels and include_heading_content. Union the template keys with the keys declared by the component's param schema, so a param the component can read survives for builtin templates and for canvas snapshots saved before the param existed. ManualChunker (whose config the dataset tabs now render) is covered by the same table.
|
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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe pipeline now preserves schema-declared component parameters during cleaning. Tests cover stale DSL snapshots, built-in templates, supported operator-form parameters, exemptions, and unknown-key removal. ChangesComponent parameter preservation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change preserves supported ingestion parameters without retaining unknown keys, and no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. I’m a rabbit, and the keys now stay, Comment |
…keys Pin the builtin templates' component-name inventory so a renamed or newly added component cannot silently skip the operator-form guard, add a negative case proving unknown keys are still dropped, and record that ManualChunker accepts but ignores method / chunk_token_cap / include_heading_content. Also spell out the accepted-key sources in the CleanComponentParams doc comment.
Bruce-Yii
left a comment
There was a problem hiding this comment.
Well-scoped fix for the component param whitelist drift. Derives accepted keys from component schemas and unions with template-baked keys. Comprehensive test coverage (5 test cases). Approved.
Summary
The dataset/document pipeline operator forms could not persist
chunk_token_capandroot_chunk_as_headingfor the built-in title/manual chunker templates. Saving goes throughBuildParserConfig→CleanComponentParams, whose param whitelist only accepted keys the DSL template already baked;ingestion_pipeline_{book,laws,paper,manual}.jsonbake onlymethod,hierarchy,levelsandinclude_heading_content, so both keys were dropped with a warning while the API still returned success. At parse time the component then fell back to its schema defaults (cap 512, switch off) — the UI edit silently had no effect.This change derives each component's accepted param keys from its param schema (
schema.TitleChunkerParam,schema.TokenChunkerParam,schema.TokenizerParam) and unions them with the template-baked keys, so a param the component can read is no longer lost to template drift. It also covers canvas DSL snapshots saved before a param existed, andManualChunker(whose config the dataset tabs now render) whoseroot_chunk_as_headingwas being dropped the same way.Related Issue
No upstream issue — reported directly by a user running the Go backend (title chunker "Chunk token cap" / "Set first chunk as global context" changes had no effect).
Changes
internal/ingestion/pipeline/pipeline_params.go: addcomponentParamSchemaKeys(component name → keys derived from the component's param schema) and union it into theCleanComponentParamswhitelist; spell out the accepted-key sources in the function doc comment and record thatManualChunkeraccepts but ignoresmethod/chunk_token_cap/include_heading_content. Templates, golden fixtures, Python behavior, and the existing Extractor/Compiler whitelists are untouched.internal/ingestion/pipeline/pipeline_params_test.go: five tests —BuildParserConfigpreserveschunk_token_cap/root_chunk_as_headingfor every builtin template carrying aTitleChunker/ManualChunkernode;Non-goals
GeneralChunker,QAChunkerandParserkeep their existing whitelists (param struct not in the schema package / no operator form / file families defined by the DSL);ExtractorandCompilerkeep their cpnID-prefixed dynamic whitelists.Test Plan
bash build.sh --test ./internal/ingestion/pipeline/... ./internal/ingestion/task/... ./internal/service/dataset/... ./internal/service/document/...— all pass. Theingestion/tasktemplate golden test passes unchanged because no template was modified.book/laws/paper/manualreportchunk_token_capandroot_chunk_as_headingdropped), so they lock the regression.