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
feat(ai): context packing and symbol-pruned prompt synthesizer #85
Large prompt contexts in multi-file reviews and RAG grounding consume substantial token budgets and induce LLM attention degradation on irrelevant class methods, internal helpers, and verbose comments.
Proposed Solution & Architectural Design
Implement ContextPacker in src/devops_cli/ai/context_packer.py to rank imported symbols by usage density.
Strip unreferenced private methods, non-contract docstrings, and compress verbose type annotations.
Integrate context packing into prompt synthesis for code reviews and LLM payloads, cutting token overhead by 40-60% while preserving strict type fidelity.
Acceptance Criteria
Context packer strips unreferenced private symbols and simplifies docstrings based on prompt budget.
Preserves public interface signatures and referenced type hints without syntax corruption.
Unit tests in tests/test_context_packer.py pass with >= 90% coverage.
Strict cyclomatic complexity <= 10 and nesting depth <= 5.
Implemented ContextPacker and PackedContext in src/devops_cli/ai/context_packer.py to rank imported symbols, strip unreferenced private methods/docstrings, and skeletonize function/class bodies with ellipsis (...).
Supported zero-crash fallback for unparseable or non-Python code with bounded token truncation via truncate_to_token_limit.
Activity
feat(ai): integrate ai context packing and symbol-pruned prompt synth…
dan-petty commentedon Sep 9, 2026
Completed in commit 476df9f:
ContextPackerandPackedContextinsrc/devops_cli/ai/context_packer.pyto rank imported symbols, strip unreferenced private methods/docstrings, and skeletonize function/class bodies with ellipsis (...).truncate_to_token_limit.devops ai pack-context <path> [--referenced <syms>] [--max-tokens <int>] [--json].ai_pack_contextinsrc/devops_cli/ai/mcp/server.pyand exported 116 schemas._collect_linked_snippetsinsrc/devops_cli/ai/review/pipeline.py.tests/test_context_packer.pyand 9/9 FastMCP contract tests intests/test_fastmcp_contracts.py.feat(release): v0.2.14 (#86)