[Refactor] Add an ordered context transformation plan to the existing IR - #3521
[Refactor] Add an ordered context transformation plan to the existing IR#3521ethanjyx wants to merge 7 commits into
Conversation
Give history policies a request-owned plan that validates proposed edits before mutation, retains protected content and tool exchanges, and records bounded receipts. Preserve pre-enrichment history and integrate configured block compression without enabling new policies. Signed-off-by: Ethan Jiang <ethanjyx@umich.edu>
✅ Deploy Preview for vllm-semantic-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Xunzhuo
left a comment
There was a problem hiding this comment.
Thanks for putting the shared seam in place. The request-owned plan validates the complete step order before mutation, gives policies detached views, preserves complete turns and tool exchanges, and routes the existing compressor through the final commit stage. I do not see a code blocker in this draft. Please rebase onto current main and mark it ready when you want the final approval pass.
|
@Xunzhuo updated |
Xunzhuo
left a comment
There was a problem hiding this comment.
Thanks for taking this out of draft. The rebased head is patch-equivalent to the reviewed transformation-plan implementation, the history and protected-turn invariants remain intact, and the latest exact-head checks are green. Approved.
|
Queued — the merge queue status continues in this comment ↓. |
|
@Mergifyio queue |
☑️ Command disallowed due to command restrictions in the Mergify configuration.Details
|
Merge Queue Status
This pull request spent 22 minutes 26 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Tick the box to put this pull request back in the merge queue (same as
|
Signed-off-by: Ethan Jiang <ethanjyx@umich.edu>
Closes #3472
Purpose
Give reset, exact deduplication, turn selection, and the existing block compressor one request-owned transformation plan. Policies receive detached views and propose edits; shared validation preserves protected messages, complete selected turns, tool-exchange membership, and retained message order before committing a step.
Extend the existing
RequestIRandMessageIRwith trusted provenance, eligibility, protection reasons, and stable turn/exchange identity. Capture original semantic history before RAG and Memory enrichment so later topic evidence can read an immutable snapshot. Route configured compression through the same plan and record bounded receipts without request text or arbitrary callback errors.No public configuration or new policy is enabled. RAG still precedes Memory; configured tool-result text compression remains supported while non-text blocks and tool structure stay intact. Reset triggers, deduplication equivalence, ranking, summarization, and token budgeting remain separate work.
Owner:
wg/agentic-context.Test Plan
Test Result
Passed on commit
7513f43d857d692e1e5b650ab60e9b7e23e36b04:make agent-validate.SKIP_MODEL_DEPENDENT_TESTS=true make agent-ci-gate AGENT_CHANGED_FILES_PATH=/tmp/context-plan-changed-files: native Candle/ML/NLP builds, router build, baseline pre-commit, Go structural lint, structure and architecture checks, and 55 Go package test results, including the completepkg/extproc,pkg/contextcompression, andpkg/protocolcodecsuites.go test -race ./pkg/contextcompression ./pkg/protocolcodecfromsrc/semantic-router.go test ./pkg/contextcompression -run '^$' -fuzz '^FuzzTransformationRemovalInvariants$' -fuzztime=10s -parallel=2(61,889 executions).go-builderimage, with native Candle/ML/NLP libraries: original history capture, history selection without compression, tool-result compression, request controls, non-text preservation, RAG opt-in, neutral-request preparation, fail-closed handling, and recovery-tool name protection.make vllm-sr-dev: both final router and dashboard images built successfully, including the frontend Vite build.make agent-serve-local ENV=cpu AGENT_STACK_NAME=context-plan AGENT_PORT_OFFSET=400, thenmake agent-smoke-localwith the same stack and offset: router, Envoy, and dashboard healthy.smoke-model, preserved the system instruction and conversation history, and returned the backend response.The Docker storage blockers are resolved after restoring host disk headroom and restarting Docker Desktop. Image-store reads, builds, network creation, and startup all completed without I/O errors. The temporary test stack and mock backend were stopped, and the test-only builder image was removed.
Validation scope: the core gate used the repository's supported
SKIP_MODEL_DEPENDENT_TESTS=trueoption, excluding the model-dependent memory/tools package suites. External Milvus, Qdrant, Redis, Valkey, and Llama Stack test integrations retained the core gate's default skip settings. Model/GPU-dependent and Kubernetes E2E suites were not run. No public policy is enabled, so existing E2E coverage is retained for this internal refactor.Semantic Router PR Checklist