Skip to content

docs: add code-level context compaction evolution record (v1→v2→correctness) - #6

Draft
by2060 with Copilot wants to merge 2 commits into
mainfrom
copilot/context-compaction-evolution
Draft

by2060 with Copilot wants to merge 2 commits into
mainfrom
copilot/context-compaction-evolution

Conversation

Copilot AI commented Sep 14, 2026 •

Copy link
Copy Markdown

This change adds a detailed design document for the upstream context compaction evolution, covering the full path from initial compaction orchestration to v2 iterative summarization and later correctness hardening. It consolidates system-level milestones and code-level deltas into one scan-friendly reference under docs/design/.

  • What this adds

  • Code-level change mapping

    • Enumerates modules, classes, and method signatures involved in each phase (e.g., compaction orchestrator/process paths, iterative summary APIs, pruning/token-estimation paths)
    • Captures algorithmic changes (iterative summary state + rebuild interval, overflow policy, pre/post prune, delta-only compaction, post-call tool-result accounting)
  • Protocol + policy coverage

    • Documents frontend/backend protocol updates (notably session.compaction_progress SSE stages and FE action handling)
    • Summarizes compaction policy/config shifts (tiering, thresholds, tool-retention strategy, cooldown/anti-thrashing mechanics)
  • Impact and compatibility analysis

    • Includes per-phase touched files and churn stats (files/additions/deletions)
    • Notes backward/forward compatibility implications for each systemic upgrade
## 4. 阶段 C:PR #321(v2 机制升级)
#### 4.2.1 迭代式摘要(E1/E2)
- summary.py: build_iterative_prompt(...)
- summary.py: summarize_chunked_iterative(...)
- models.py: DEFAULT_COMPACTION_PROMPT_WITH_PREVIOUS
- models.py: ITERATIVE_SUMMARY_REBUILD_INTERVAL = 5

Co-authored-by: by2060 <145313386+by2060@users.noreply.github.com>
Copilot AI changed the title [WIP] Document context compaction evolution and upgrades docs: add code-level context compaction evolution record (v1→v2→correctness) Sep 14, 2026
Copilot AI requested a review from by2060 September 14, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants