Skip to content

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.md documents conversations/messages, Work, memories, approvals and queued direct sends, bindings, host native sessions, attachments, workspace config, the generated AGENTS.md block, 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.v2 RPC gained data.export. The projection lives in src/v2/data-control.ts, format ensemble.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 (confirmation DELETE) 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.json stay, 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|delete is a doctor-style CLI over the same invoke RPC 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, and LOG_MAX_BYTES are exported and used by the logger defaults; purgeLogFiles() deletes only Ensemble-owned JSONL names. data.delete --logs uses it. The export reports the retention values and excludes the logs themselves.
  • Roster disclosure. The v7 roster writes names, titles, and roles into AGENTS.md at 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 whole ensemble:start block 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 ​

SeamTestCovers
Service RPC invokesrc/v2/data-control.test.tsExport 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 deletesamepurgeWorkspaceData removes only workspace channels and workspace-attributed memory rows, keeps the workspace/agents/home bindings, and commits entity removals
LogssamepurgeLogFiles removes only service-*/tui-* JSONL and rotated files
CLIsrc/v2/data-cli.test.tsArgument 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 indexscripts/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).

text
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-sessions is 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.md removal is manual and repository-owned; reconciliation rewrites an initialized workspace's block, so the opt-out requires removing .ensemble/init.json and not re-running init.

Released under the MIT License.