Skip to content

ADR-0057 data lifecycle P1–P4: retention contract, rotation, separation, governance (tracking) #2786

Description

@os-zhuang

Tracking issue for ADR-0057 (system data lifecycle & retention) phases P1–P4 — docs/adr/0057-system-data-lifecycle-and-retention.md §4 Rollout. The roadmap currently lives only in the ADR document with no claimable work item; this issue is the entry point.

Background

Origin incident: a dev dev.db reached 260 MB, ~76 % of row growth being platform-produced telemetry with no retention contract (audit + activity double-writes) plus auto_vacuum=NONE. P0 (stop-the-bleed) shipped with the ADR (#2079): SKIP_OBJECTS exclusion for operational objects, SQLite auto_vacuum=INCREMENTAL default, showcase digest 20s→60s. P0 removes the acute growth but nothing is bounded by construction yet — that's P1+.

Phases (each independently shippable)

  • P1 — contract: lifecycleClass + lifecycle spec shapes; LifecycleService Reaper; spec-liveness enforcement for the new properties; dogfood growth gate (fail CI when a booted example app's DB grows past budget)
  • P2 — rotation/TTL: Rotator (shard + DROP) for high-frequency telemetry tables; transient-class TTL expiry
  • P3 — separation: telemetry/audit on a dedicated datasource; Archiver cold-store path
  • P4 — governance: per-table storage quotas, growth alerts, tenant-level retention overrides

Why now

The v2 permission launch (ADR-0090, #2696→closed) added more system tables with unbounded append semantics (sys_automation_run run history, audience-binding suggestions, explain traces if ever persisted). Every new ledger-shaped table added without a lifecycleClass deepens the migration debt P1 is designed to cap. Benchmarks in the ADR-0090 follow-up parking lot (#2776 item 3, 100k-user × 10M-record) will also be unrunnable without bounded telemetry.

References

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions