latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-14129143297.4 KB

0e52fe5f8d33

admin

List Shared Data Compaction Events

Return per-event compaction metadata for one consenting user.

Backed by the OSS compaction_events table (migrations 023 and 030). The metadata columns (counts, timings, outcome flags) carry no user content, so no redaction is applied. Migration 030 added eight envelope-encrypted before/after snapshots (memory, history, user, soul); these decrypt to plaintext on read and ride through the response so an admin can see exactly what a compaction event rewrote across the four memory files. status is one of 'pending' (sync watermark advanced, async LLM call still running or crashed) or 'completed'; legacy rows default to 'completed' via the migration's server-side default.

Snapshots that exceed settings.compaction_event_snapshot_max_bytes_per_file are stored as a JSON truncation record. We surface those as a flagged payload (truncated=True plus head, tail, size, sha256) instead of dumping the JSON verbatim so the UI can render "truncated, N KB" with the head and tail visible inline.

Ordered triggered_at desc so the most recent compaction shows first; that is the question admins almost always ask ("did this user just compact, and what did it cost?"). limit caps the response so a long-running user does not OOM the wire.

get/api/admin/shared-data/users/{user_id}/compaction-events

Path parameters

user_idstring required

Query parameters

limitinteger
start_datestring nullable

ISO-8601 timestamp; lower bound on triggered_at.

ISO-8601 timestamp; lower bound on triggered_at.

end_datestring nullable

ISO-8601 timestamp; upper bound on triggered_at.

ISO-8601 timestamp; upper bound on triggered_at.

Response

Successful Response

user_idstring required
consent_atstring nullable required
totalinteger required