You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(ai): high-performance AST context packer with binary search truncation #118
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/refactorType refactor: a new structure, same behavior
DevSecOps review highlighted an O(N^2) algorithm in _prune_tree_to_budget (devops_cli.ai.context_packer) which iteratively executes ast.unparse(tree) and count_tokens inside a while-loop for every statement popped, incurring excessive CPU and latency overhead when pruning large modules.
Proposed Changes
Replace linear re-unparsing with binary-search truncation index discovery.
Memoize per-statement token weight estimates.
Preserve AST semantic integrity while reducing context packing overhead from seconds to <10ms.
Acceptance Criteria
Benchmark execution runtime under 10ms for 1,000-line AST trees.
Cyclomatic complexity <= 10.
Zero syntax truncation errors in tests/test_context_packer.py.
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/refactorType refactor: a new structure, same behavior
Activity
fix(ai): resolve review feedback on full-body binary search, empty AS…
fix(ai): accurately evaluate truncation boolean and expand test cover…
perf(ai): high-performance AST context packer with binary search trun…
feat(release): v0.2.19 (#217)