Ticket #272: data retention, export, delete, and roster disclosure
Parent: #268. Scope: give users control of their Ensemble data, document the retention policy, provide a user-facing export and delete path, and disclose the v7 AGENTS.md roster title/role write. No new product feature beyond data control and privacy disclosure.
What shipped
- Data classes and retention policy.
docs/privacy/data-and-retention.mddocuments conversations/messages, Work, memories, approvals and queued direct sends, bindings, host native sessions, attachments, workspace config, the generatedAGENTS.mdblock, logs, and settings. It cites the enforced values: terminal Work (including finished native-subagent rows) is purged 24 hours after it finishes (FINISHED_RETENTION_MS), and local logs keep 7 days, 5 rotated files per prefix, and 10 MiB per file by default. Conversation and memory rows have no automatic expiry. - Export. The existing
ensemble.v2RPC gaineddata.export. The projection lives insrc/v2/data-control.ts, formatensemble.data-export/formatVersion: 1, documented with a field-by-field example. It carries the workspace roster, group and direct conversations, message text and attachment metadata, Work text, and workspace-attributed memories. It never carries binding session ids, workspace or home directory paths, model configuration, settings, credentials, operational logs, other workspaces, or agent-global memories. - Delete.
data.delete(confirmationDELETE) stops active init and Work for one workspace, removes its conversations/messages, Work, dispatch groups, init jobs, native-subagent rows, workspace memories, approvals, queued direct sends, workspace/direct bindings, and attachment bytes. The workspace row, roster, and.ensemble/config.jsonstay, so the workspace remains usable and the next turn starts a fresh native session. Host native sessions are removed only with--delete-native-sessions. - User-facing path.
npm run data -- export|deleteis a doctor-style CLI over the sameinvokeRPC and service descriptor. It adds no runtime seam and is excluded from the published tarball like the doctor, because it is an operator tool run from a source checkout; installed integrations call the same RPC actions. - Log control.
LOG_RETENTION_DAYS,LOG_MAX_FILES, andLOG_MAX_BYTESare exported and used by the logger defaults;purgeLogFiles()deletes only Ensemble-owned JSONL names.data.delete --logsuses it. The export reports the retention values and excludes the logs themselves. - Roster disclosure. The v7 roster writes names, titles, and roles into
AGENTS.mdat init and on config reconciliation. The privacy document explains what is written, when, the public-repository risk, and the guidance (keep title/role non-sensitive or empty before init). The supported opt-out is manual: remove the wholeensemble:startblock and.ensemble/init.json(which marks the directory initialized), and do not re-run workspace init. No config switch was added: it would change the v7 contract and the workspace-config schema, which is wider than this ticket and destabilizes the contract.
Tests
| Seam | Test | Covers |
|---|---|---|
Service RPC invoke | src/v2/data-control.test.ts | Export shape, counts, attachments, direct conversations, exclusions; refusal without DELETE; scoped deletion of messages/Work/groups/memories/approvals/queue/bindings; another workspace untouched; export after delete; message.send and snapshot health after delete |
| Store/service delete | same | purgeWorkspaceData removes only workspace channels and workspace-attributed memory rows, keeps the workspace/agents/home bindings, and commits entity removals |
| Logs | same | purgeLogFiles removes only service-*/tui-* JSONL and rotated files |
| CLI | src/v2/data-cli.test.ts | Argument validation and required confirmation; descriptor resolution; request URL/body; Basic auth from the descriptor only; 0600 file write; password never printed; service refusal surfaces the error code |
| Docs index | scripts/docs-check.mjs (via npm run docs:check) | The new privacy page and this record are linked from docs/README.md; contract/host/Node claims stay current |
Fixtures use synthetic text only. No conversation content, credentials, file bytes, or private paths are written to fixtures or logs; the export test asserts the serialized document does not contain the two workspace directories or a seeded binding session id.
Verification
Environment: Linux, Node 26.12.1 (nvm), worktree /home/tristan/dev/ensemble-272 on ticket/272-data, merged with integration/public-release at 58adaf6 (package identity #269 and support runbook #274 included).
npm run verify
tests 2050
pass 2050
fail 0
duration ~54.8s
npm run docs:check
docs:check: ok (contract v7; OpenCode 2.2.6, 2.2.7; Node >=22.23.4; live Node 26.12.1)The first full verify run (pre-merge, 2038 tests) reported one timing-sensitive assertion in ticket217: the bounded watchdog recovers a missed terminal event ("the watchdog waits for its bound", expected 0, got 1). The isolated test passed (1/1), and every later full run passed with no change to that test or its code; it is recorded here rather than hidden.
No live TUI or host suite is required by this ticket: export, delete, and the post-delete health check are observed at the service/store seam, and the CLI is tested against an injected fetch. npm run docs:check passes the new links.
Boundaries and known limits
- Ensemble deletes its own durable rows. The OpenCode host owns native session transcripts; they survive unless
--delete-native-sessionsis passed, and the host may still retain its own copies. - Removing the binding is what prevents re-ingestion after delete. Without it, the next start-time reconcile could recreate deleted messages from the host context.
- A per-workspace export/delete does not touch agent-global memories or
ensemble.reset-only rows (settings and UI state). AGENTS.mdremoval is manual and repository-owned; reconciliation rewrites an initialized workspace's block, so the opt-out requires removing.ensemble/init.jsonand not re-running init.