postgres-ttl-cleanup
Lane: ops
Version: 0.1.0
Owner: system
Schedule: 0 3 * * *
Purpose
Daily cleanup of expired rows from Postgres tables lacking native TTL. Deletes old audit logs (90d), idempotency keys, workspace invites (30d), subscriber events (60d). Logs deletions to ClickHouse audit trail.
Memory Contract
Access Mode
service_only - All writes go through MemoryClient. No direct ClickHouse access.
Writes
None - read-only skill
Provenance
Every write includes:
| Field | Source |
|---|---|
run_id | Generated UUID |
trace_id | From Langfuse or run_id |
source_ref | postgres-ttl-cleanup:run |
actor | postgres-ttl-cleanup |
Environment Variables
See task definition in app/cosmocrat_tasks.yaml
Testing
bash
# Run locally
python -m app.services.mcp.jobs.{domain}.{module}
# Integration tests
pytest tests/skills/test_postgres_ttl_cleanup.py -v
Changelog
- •0.1.0 (2025-12-22): Initial manifest generated via migrate_skills.py