Problem
A low-cost local-first platform must bound its operational metadata and intermediate storage.
Long-running Duckle servers can accumulate:
run history
run-scoped logs
async run records
preview/sample data
temporary/spill files left after abnormal termination
content-addressed stage cache
queued-work ledgers
reject/dead-letter data
compiled/built releases
local artifact copies
DuckLake table maintenance solves a different problem; it does not bound Duckle’s own control-plane and cache storage.
Proposed solution
Add explicit retention policies per category.
Example:
retention:
runs:
keepDays: 180
keepLastPerPipeline: 50
logs
## Scheduling
Allow retention as a normal low-priority maintenance task using resource pools.
## Policy
An authoritative server policy can enforce:
```text
minimum audit retention
maximum cache size
whether reject data may be deleted
Observability
Expose:
bytes by category
oldest retained item
last prune result
prune failures
Scope
This is not object-storage lifecycle management or DuckLake snapshot expiration.
It is bounded housekeeping for data Duckle itself owns.
Acceptance criteria
--dry-run accurately lists what would be deleted;
- active/referenced data is protected;
- cache/log/history growth can be bounded by age and/or size;
- interrupted temporary files can be reclaimed safely;
- pruning is auditable.:
keepDays: 30
cache:
maxBytes: 500GB
keepDays: 45
previews:
keepHours: 24
interruptedTemp:
keepHours: 24
releases:
keepLast: 10
Reject/dead-letter and audit data should have conservative separate defaults.
## Commands
```bash
duckle retention status --json
duckle retention prune --dry-run
duckle retention prune
The dry run should report item counts and reclaimable bytes per category.
Safety
Never remove:
active-run files
queued-run state
artifacts referenced by retained manifests/releases
the active release
a cache entry currently being read/written
audit records unless an explicit policy permits it
user-owned source/raw/output data
Distinguish Duckle-managed files from arbitrary paths referenced by a pipeline.
Crash recovery
On startup or maintenance, detect abandoned run-scoped temp directories and incomplete cache writes using ownership metadata/leases rather than deleting files solely by name.
Scheduling
Allow retention as a normal low-priority maintenance task using resource pools.
Policy
An authoritative server policy can enforce:
minimum audit retention
maximum cache size
whether reject data may be deleted
Observability
Expose:
bytes by category
oldest retained item
last prune result
prune failures
Scope
This is not object-storage lifecycle management or DuckLake snapshot expiration.
It is bounded housekeeping for data Duckle itself owns.
Acceptance criteria
--dry-run accurately lists what would be deleted;
- active/referenced data is protected;
- cache/log/history growth can be bounded by age and/or size;
- interrupted temporary files can be reclaimed safely;
- pruning is auditable.
Problem
A low-cost local-first platform must bound its operational metadata and intermediate storage.
Long-running Duckle servers can accumulate:
DuckLake table maintenance solves a different problem; it does not bound Duckle’s own control-plane and cache storage.
Proposed solution
Add explicit retention policies per category.
Example:
Observability
Expose:
Scope
This is not object-storage lifecycle management or DuckLake snapshot expiration.
It is bounded housekeeping for data Duckle itself owns.
Acceptance criteria
--dry-runaccurately lists what would be deleted;keepDays: 30
cache:
maxBytes: 500GB
keepDays: 45
previews:
keepHours: 24
interruptedTemp:
keepHours: 24
releases:
keepLast: 10
The dry run should report item counts and reclaimable bytes per category.
Safety
Never remove:
Distinguish Duckle-managed files from arbitrary paths referenced by a pipeline.
Crash recovery
On startup or maintenance, detect abandoned run-scoped temp directories and incomplete cache writes using ownership metadata/leases rather than deleting files solely by name.
Scheduling
Allow retention as a normal low-priority maintenance task using resource pools.
Policy
An authoritative server policy can enforce:
Observability
Expose:
Scope
This is not object-storage lifecycle management or DuckLake snapshot expiration.
It is bounded housekeeping for data Duckle itself owns.
Acceptance criteria
--dry-runaccurately lists what would be deleted;