[Platform] Extract LLM Batch Processing Package#258972
Closed
patrykkopycinski wants to merge 9 commits intoelastic:mainfrom
Closed
[Platform] Extract LLM Batch Processing Package#258972patrykkopycinski wants to merge 9 commits intoelastic:mainfrom
patrykkopycinski wants to merge 9 commits intoelastic:mainfrom
Conversation
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
Contributor
Vale Linting ResultsSummary: 20 warnings, 13 suggestions found
|
| File | Line | Rule | Message |
|---|---|---|---|
| docs/AESOP_DELIVERY_SUMMARY.md | 10 | Elastic.EndPuntuaction | Don't end headings with punctuation. |
| docs/AESOP_DELIVERY_SUMMARY.md | 57 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/AESOP_DELIVERY_SUMMARY.md | 58 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/AESOP_DELIVERY_SUMMARY.md | 214 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_demo_guide.md | 206 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'. |
| docs/aesop_demo_guide.md | 276 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_hypothesis_measurement_plan.md | 17 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'. |
| docs/aesop_hypothesis_measurement_plan.md | 138 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'. |
| docs/aesop_hypothesis_measurement_plan.md | 167 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_hypothesis_measurement_plan.md | 430 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_hypothesis_measurement_plan.md | 512 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_implementation_summary.md | 104 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_implementation_summary.md | 168 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_implementation_summary.md | 231 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_o11y_traces_validation.md | 408 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_o11y_traces_validation.md | 408 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
| docs/aesop_o11y_traces_validation.md | 676 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'. |
| docs/aesop_o11y_traces_validation.md | 677 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'. |
| docs/aesop_o11y_traces_validation.md | 678 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'. |
| docs/aesop_o11y_traces_validation.md | 678 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'versus' instead of 'vs'. |
💡 Suggestions (13)
| File | Line | Rule | Message |
|---|---|---|---|
| docs/AESOP_DELIVERY_SUMMARY.md | 10 | Elastic.Exclamation | Use exclamation points sparingly. Consider removing the exclamation point. |
| docs/AESOP_DELIVERY_SUMMARY.md | 366 | Elastic.WordChoice | Consider using 'run, start' instead of 'Execute', unless the term is in the UI. |
| docs/AESOP_DELIVERY_SUMMARY.md | 382 | Elastic.WordChoice | Consider using 'deactivated, deselected, hidden, turned off, unavailable' instead of 'disabled', unless the term is in the UI. |
| docs/aesop_demo_guide.md | 72 | Elastic.Ellipses | In general, don't use an ellipsis. |
| docs/aesop_demo_guide.md | 73 | Elastic.Ellipses | In general, don't use an ellipsis. |
| docs/aesop_demo_guide.md | 74 | Elastic.Ellipses | In general, don't use an ellipsis. |
| docs/aesop_demo_guide.md | 75 | Elastic.Ellipses | In general, don't use an ellipsis. |
| docs/aesop_demo_guide.md | 76 | Elastic.Ellipses | In general, don't use an ellipsis. |
| docs/aesop_hypothesis_measurement_plan.md | 211 | Elastic.Wordiness | Consider using 'tell' instead of 'inform'. |
| docs/aesop_implementation_summary.md | 283 | Elastic.WordChoice | Consider using 'run, start' instead of 'execute', unless the term is in the UI. |
| docs/aesop_o11y_traces_validation.md | 277 | Elastic.WordChoice | Consider using 'review' instead of 'sanity check', unless the term is in the UI. |
| docs/aesop_o11y_traces_validation.md | 396 | Elastic.WordChoice | Consider using 'select, press, visits' instead of 'hit', unless the term is in the UI. |
| docs/aesop_o11y_traces_validation.md | 652 | Elastic.WordChoice | Consider using 'can, might' instead of 'may', unless the term is in the UI. |
The Vale linter checks documentation changes against the Elastic Docs style guide.
To use Vale locally or report issues, refer to Elastic style guide for Vale.
Create foundational structure for new platform package that will contain extracted batch processing logic from Attack Discovery. Platform package rationale: - Reusable by all teams (Observability, ML, Analytics) for LLM batch processing needs - Zero external dependencies (inline concurrency control) - Shared visibility for cross-solution usage Files created: - package.json: Basic package metadata - kibana.jsonc: Platform package configuration with shared visibility - tsconfig.json: TypeScript config with empty kbn_references (zero deps) - jest.config.js: Jest configuration for unit tests Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Defines core types for batch processing: - BatchConfig: configuration interface with generics - BatchResult: output with statistics - BatchStats: execution metrics - SplitStrategy and MergeStrategy: strategy enums Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Implements adaptive batch sizing for LLM workloads: - tokenBasedSplit: splits items to stay under token limit - itemBasedSplit: fixed item count splitting - Handles edge cases: empty input, oversized items Tests: 6/6 passing Part of RFC SEC-2026-002: Extract LLM Batch Processing Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Implements tournament-style pairwise merge: - Reduces N outputs to 1 in log(N) rounds - Handles odd-numbered batches (pass through) - Single output returns unchanged (no merge needed) Tests: 5/5 passing Part of RFC SEC-2026-002 Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Implements concurrent batch processing with backpressure: - Respects maxConcurrentBatches to avoid rate limits - Inline concurrency control (no external deps) - Progress callback support - Returns stats (batches, rounds, duration) Tests: 4/4 passing Part of RFC SEC-2026-002 Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Exports main entry point (batchProcess) plus low-level utilities. Includes usage examples and API reference. Package complete: - 15 tests passing (split: 6, merge: 5, orchestrator: 4) - Zero external dependencies - Ready for integration into Attack Discovery Part of RFC SEC-2026-002 Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Changes main entry to src/index.ts for direct TypeScript import. This is the standard pattern for Kibana server packages. Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
26150a2 to
a379826
Compare
Removes AESOP-related files accidentally included: - docs/AESOP_*.md - evals/AESOP components - aesop_demo scripts PR now contains ONLY llm-batch-processing package. Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts reusable
@kbn/llm-batch-processingpackage for parallel LLM task processing.Package Details
Location:
x-pack/platform/packages/shared/kbn-llm-batch-processingStatus: ✅ Production-ready
Tests: 30/30 passing
Dependencies: Zero (inline concurrency control)
Type:
shared-serverOwner:
@elastic/security-generative-aiFeatures:
Validation Results (12+ Experiments)
Performance with Claude Sonnet 4.5
Key findings:
Optimal Configuration
Use Cases
✅ RECOMMENDED FOR:
Document summarization (each doc independent)
Data extraction (MapReduce-style)
Classification tasks (independent items)
Scenarios where: Speed > cost, items are independent
❌ NOT RECOMMENDED FOR:
API
Main Entry Point
Utilities
Complete Validation Documentation
This branch includes full validation findings:
docs/superpowers/specs/2026-03-21-rfc-batch-processing-validation-design.mddocs/superpowers/plans/2026-03-21-rfc-batch-processing-validation.mddocs/rfc-validation-results/RAW_METRICS_COMPARISON.mdRFC_SEC-2026-002_FINAL_VALIDATION.mdCOMPLETE_VALIDATION_SUMMARY.mdBATCH_PROCESSING_VS_INCREMENTAL_AD.mdExperiment IDs (LangSmith):
Trade-offs
Accept these to use batch processing:
Alternative Solution
For Attack Discovery specifically: Use Incremental AD instead
docs/superpowers/specs/2026-03-21-incremental-attack-discovery-design.mdRecommendation
✅ Approve package for platform adoption with:
Reason: Code is excellent, just not the right solution for original use case.
Files Changed
Package files:
x-pack/platform/packages/shared/kbn-llm-batch-processing/- Complete package.github/CODEOWNERS- Package ownershipValidation files:
Total: 26 commits with complete validation story
This is a DRAFT PR to preserve work. Review validation findings before merging.
🔗 Related: RFC Validator skill created -
.agents/skills/rfc-validator/SKILL.mdProduction-Readiness Checklist — Agent Skills Ecosystem
Generated against [Epic] Creation of the Agent Skills Ecosystem for Elastic Security.
Narrative role: Shared infra any skill can use for parallel LLM work (summarization, extraction, classification). Clean 1093-line package, 30/30 tests passing — the lowest-risk foundation PR in this program.
Must-do before this can ship
Follow-ups (post-merge)