feat: context_pack v2 — plugin-aware analogues, cycles and evidence diversity #35
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
Reference
h-dv/code-index#35
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current state
context_pack v1 shipped in v0.7.0 with:
This issue now tracks v2 only. Do not create a competing task-context tool.
V2 outcome
Produce the smallest evidence-linked edit context while preserving active plugin generation, provenance and uncertainty.
Scope
Plugin-aware evidence
Every seed and returned item is bound to:
Pending-generation ids never leak. A generation promotion invalidates or cleanly rejects a pack cursor/handle rather than mixing old and new evidence.
If relevant source extensions are symbol-blind, requested packages are unavailable, or a bridge is inactive, the pack includes compact coverage gaps and recommended text/index checks.
Analogue selection
Consume #27’s explained similarity engine:
Analogues are a reserved optional budget class and cannot displace targets or essential witnesses.
Cycle/layer context
Consume #28’s analyzer:
Do not manufacture authoritative coupling claims from incomplete graph coverage.
Placement/ranking
Fold the surviving suggest-placement/coupling idea from closed #30 into internal ranking:
Return reasons, not raw “best file” authority.
Richer witness diversity
Avoid returning many redundant paths through the same dense hub. Reserve a bounded set across:
Deduplicate overlapping source spans. Source bytes remain optional and budgeted.
Correctness
Benchmark
Extend #51 with representative builtin and plugin tasks:
Compare correctness, relevant-context precision/recall, tokens, calls and time-to-correct-file against the equivalent multi-tool workflow. V2 must improve measured task value, not merely add classes.
Acceptance
Triage: P0 — next product milestone
Make this the task-oriented context compiler rather than introducing a competing
task_contexttool. Add an optional shorttask/focus_textinput, used only for deterministic lexical symbol/text seed discovery; do not claim arbitrary natural-language understanding.V1 should ship without waiting for #27 or #28 and include:
change_impactexplain_dependencyStable handles (#37) are the cross-reindex contract and should land first or in the same milestone. Benchmark against representative coding tasks: tool calls, source tokens read, time to correct file, relevant-context precision/recall, and test-selection quality.
Minimal context_pack v1 shipped in v0.7.0 (mission I031, built on #37 stable handles). Keeping this issue open for the v2 vision (analogue expansion #27, cycle awareness #28, richer ranked-witness variety).
What landed (v1)
context_pack({ symbol_ids?, handles?, paths?, diff_base?, task_terms?, token_budget=4000, project })→ a single deterministic, budget-classed context bundle assembled from explicit seeds:cross_project_seedissue rather than silently mixed in — this closes the same cross-project identity-confusion class #37 exists to prevent.seed_issuescarries missing / ambiguous / cross-project / no-match-for-task-term, each with its offending input.symbol_ids(generation-local),handles(durable, resolved via #37),paths(file → symbols, cappedPATH_SYMBOL_CAP=64),diff_base(changed symbols), andtask_terms— lexical focus terms each run throughsearch_symbols; matches become seeds, no-match → a seed issue (NL extraction stays client-side).tokens_usedis the true serialized size of the response (serde_json::to_string(&resp).len()/4), and abudget_exceededflag is set rather than silently truncating past the ceiling.MAX_SEEDS=128. Every returned item carries an inclusion reason, score, and (for symbols) astable_handle. Dependents are deduped across chunks.Benchmark
Against the current multi-tool workflow (self-index): context assembly is 1 pack call vs a 5-call manual sequence (search → get_symbol → find_callers → dependents → tests). The pack front-loads all evidence — targets + ~40 dependents + ~21 test-role files — into one larger payload: a clear round-trip win, with an honest byte trade-off surfaced via
budget_exceededand true-sizetokens_used.Review
Deep adversarial review (17 agents: 11 confirmed / 2 refuted), all confirmed fixed with regression tests. Headline: cross-project seed-id mixing (project-local numeric ids from different projects) — now single-project-disciplined with
cross_project_seedreporting.Deferred to v2 (this issue stays open)
feat: context_pack — task-specific, evidence-linked context under a token budgetto feat: context_pack v2 — plugin-aware analogues, cycles and evidence diversity