feat(memory): add audit export surface

This commit is contained in:
2026-05-15 11:15:16 +02:00
parent c5110f61b0
commit 914b698af7
6 changed files with 333 additions and 95 deletions

View File

@@ -21,10 +21,10 @@ with `markitect-tool`.
- `InMemoryMemoryGraphRepository` provides deterministic local storage for
tests and future service wiring.
- `MemoryRuntimeService.import_markitect_graph()` persists an imported graph and
can attach an audit event when an `OperationContext` is supplied.
persists an audit event when an `OperationContext` is supplied.
- `MemoryRuntimeService.query_memory()` retrieves graph nodes through a scope
policy check plus per-node policy checks, returns source-grounded context
items, preserves safe denied diagnostics, and emits an audit event in the
items, preserves safe denied diagnostics, and persists an audit event in the
result envelope.
- `MemoryRuntimeService.apply_retention()` marks stale memories for review or
transitions old memories to `delete_requested` without physical deletion.
@@ -40,6 +40,12 @@ with `markitect-tool`.
- `MemoryRuntimeService.export_context_package_inputs()` emits
Markitect-compatible context package input envelopes without invoking the
Markitect compiler.
- `MemoryGraphRepository` persists memory audit events separately from
Markitect memory events, allowing operations to be queried by graph,
correlation id, and operation.
- `MemoryRuntimeService.export_runtime_envelope()` emits a portable runtime
envelope containing graph nodes, edges, memory events, and audit traces with
operation id, actor, policy decision, and filter metadata.
## Boundary
@@ -53,6 +59,7 @@ with `markitect-tool`.
- runtime ids and persistence
- append-only event storage
- durable audit event storage
- permission-aware retrieval and context assembly
- retention, refresh, compaction, review gates, and audit behavior
- agent-safe update plans and Markitect-compatible export envelopes