Skip to content

[Refactor] Define an ordered context-transformation plan and protected-turn IR #3472

Description

@Xunzhuo

Goal

Extend the existing contextcompression.RequestIR and MessageIR with one ordered transformation plan and protected-segment contract so reset, deduplication, turn selection, and compression cannot independently mutate the same request history.

Proposed Workgroup

Agentic & Context

Background

Current request preparation already applies RAG, then Router Memory, then the context-compression stage before provider encoding. The active children of #2984 add topic evidence, optional history reset, deduplication, prior-turn selection, and summarization around that shared path. A second IR or another raw-message mutation pipeline would make ordering and protected-content behavior diverge.

Work item shape and dependency

This is the shared integration seam for behavior-changing context work. #3342 signal-contract work and #3345 research can proceed independently. #3343, #3344, and #3346 may develop bounded policy and fixtures in parallel, but their request-pipeline integration must use this seam after it lands.

Scope

Configuration and API impact

This is an internal refactor. It adds no public configuration or client protocol and preserves current RAG, Memory, and compression behavior until an existing child policy explicitly enables a new step.

Non-goals

  • Create a second context IR or compression framework.
  • Implement topic detection, reset policy, deduplication policy, turn ranking, summarization, RAG, Memory, or token budgeting.
  • Reorder current RAG and Memory behavior as an incidental refactor.
  • Permit lossy mutation without an explicit plan entry and receipt.

Completion signal

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

acceptedAccepted by the accountable Workgroup or Maintainer; not necessarily scheduled.enhancementNew feature or requestin-progressActively owned and under implementation.wg/agentic-contextOwned by the Agentic and Context Workgroup.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions