JevContextPlanner recommends which application-managed tool exchanges to retain or offload and can restore complete pairs in order. Use it when you assemble your own context and want to reduce old material before the next model call.
Example: move obsolete search results out of a repair task
A repair task read earlier-version documentation and later obtained test results for the current patch. Including the full old search in every request consumes context, but dropping only the result leaves a dangling call. Group each call and result into anExchange. JEV judges only complete unpinned exchanges. Pin the current test evidence so it always stays.
1. Prepare complete exchanges
pinned=true requires retention without model discretion. Include both a call and result in each pair and use unique IDs.
2. Plan for the current task
selector as in Application component setup; ctx belongs to the current call. Exchanges explicitly judged unnecessary go to archive(). Uncertain exchanges remain in retained().
3. Inspect the smaller context and restore on demand
retained() contains only the current test, archive() contains the old search and restore() returns both in original order. Only change the next model input when your application adopts the plan. In SHADOW, observe only.
Run and verify
SetJEV_CP using the example build instructions, then run:
old-search in the in-memory archive, retains current-test and restores both in order without re-executing tools. JevApplicationScenarios source
Persistence and failure handling
archive() is an in-memory map. It neither writes files, frees all process memory nor changes AgentState automatically. The Plan retains references to the host call/result objects; leave them unchanged while in use. If judgment fails or is off, retain all exchanges.
For Harness-triggered compaction, durable archiving before adoption and cross-request recovery, see Context compaction and Archive recovery.