Expand description
Existing-history disclosure preview and consent gate (task D1).
The host owns metadata discovery, disclosure policy, and authority. Both
/memory index-history and the memory_context(action=index_history) tool
enter through this engine; D2 will consume the typed ImportPlan.
This module deliberately contains no importer. A successful confirmation returns a plan and performs no session-content reads or Axel writes.
Structs§
- Canonical
History Metadata Io - Production metadata provider over the canonical session storage API. It intentionally does not implement content reads or Axel writes in D1.
- Confirmed
User Intent - Confirmation authority is represented by the same unforgeable A4 proof type used by memory leases. There is intentionally no string constructor.
- History
Import Cancellation - History
Import Event - Content-free event envelope for frontends and diagnostics. The payload type intentionally has no content, session id, project id, or filesystem path.
- History
Import Host State - Trusted, host-computed scope and destination. No field comes from model parameters or a provider response.
- History
Import Preview - Complete disclosure presented before consent is requested.
- History
Import Report - History
Session Metadata - Metadata that may be inspected before the user decides whether to import. It must not contain message, prompt, or tool-result bodies.
- Import
Plan - D2 input: an already disclosed preview bound to explicit user intent.
- Included
Date Range
Enums§
- History
Import Consent - History
Import Error - History
Import Outcome - Request
Authority - Identifies the caller, independently of any claimed consent payload.
Constants§
- CHECKPOINT_
FILE_ MAX_ BYTES - Maximum durable host state for one project import. One digest is 64 bytes; this supports thousands of committed source ranges without unbounded growth.
- IMPORT_
BATCH_ MAX_ RECORDS - Hard ceiling on records accumulated before dispatch. The C3 worker queue is independently fixed-capacity and nonblocking; imports can therefore bound both their producer batch and consumer queue.
Traits§
- History
Import Io - Narrow I/O boundary for history import. D1 calls only
scan_metadata; content reads and provider writes are reserved for D2 consuming a plan.
Functions§
- authorize_
history_ import - Apply the user’s decision without beginning import.
- import_
history_ resumable_ from_ dir - Incremental D3 import. A source range is checkpointed only after the C3 worker receives a provider acknowledgement (or idempotency reconciliation). Therefore a process killed between provider commit and checkpoint rename may replay at most one stable capture id, which the provider store deduplicates.
- index_
history - Single shared engine operation used by every frontend.
- preview_
history_ import - Compute the disclosure using only trusted host state and a metadata scan.
- propose_
history_ import - Request authority is fixed by the entry point, not accepted as an argument.