JevContextArchive saves the message snapshot at the compaction boundary and restores it within the same user, Agent and session scope. Use it to reread evidence, inspect compaction decisions or retrieve earlier tool results.
Example: inspect old file evidence after compaction
The Agent moved obsolete file contents out of context. Later the user asks what the file said at the time. Running the tool again might read a different version; replaying a write could duplicate side effects. Read the archived snapshot without executing tools or replacing the Agent history that has accumulated since.1. Choose an archive store
archiveRoot is an authorized host directory; the second argument limits bytes per archive. The file implementation isolates scopes by hash, publishes atomically and validates content on restore. On POSIX filesystems it uses private file and directory permissions.
For shared storage use StoreJevContextArchive(baseStore, maxBytes). It reuses the BaseStore namespace and compare-and-set creation semantics. Use an in-memory store only for testing; multiple production replicas need durable shared storage.
2. Archive before adoption and keep the reference
Supplyarchive to JevContextCompactor. ENFORCE writes the archive before adopting compaction; if writing fails it does not adopt the candidate. SHADOW never writes an archive.
Read the reference from the Plan or context_compaction decision record and store it with the authenticated scope. It identifies an archive to restore; it does not let the model specify a filesystem path.
3. Restore messages in the original scope
archiveReference from a successful prior archive. Show old evidence or selectively include it in future inputs. Do not overwrite newer history with the snapshot.
Archives include message IDs, timestamps, tool arguments, results and metadata. Apply the same ACL, retention and storage protection as the session. Unknown scope, corrupt contents or missing references fail; never fall back to reading arbitrary paths.
Run and verify
SetJEV_CP using the example build instructions: