twining_housekeeping
Run periodic maintenance on Twining stores to archive old entries, remove duplicates, surface stale decisions, prune orphaned entities, and rotate old metrics. Preview by default; execute changes with the execute flag.
Instructions
Run periodic maintenance on Twining stores. Preview by default (dry run). Archives old entries, removes duplicates, surfaces stale decisions and dangling warnings, prunes orphaned graph entities, and rotates old metrics. Pass staleness_review: true to also flag entries whose scope/files/branch are gone. Pass execute: true to apply changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| execute | No | Set to true to apply changes. Default is false (preview only). | |
| promote_provisionals | No | Set to true to auto-promote stale provisional decisions to active. Default is false (report only). | |
| staleness_review | No | Set to true to scan blackboard entries and decisions for staleness — flags items whose scope path, affected files, or originating branch no longer exist. Returns candidates only; use twining_archive_stale to act on them. | |
| merge_sweep | No | Set to true to detect branches deleted since the last housekeeping run (typically post-merge cleanup) and flag entries provenance-stamped with those branches. First call records the initial branch snapshot and returns no candidates. The branch snapshot is advanced only when execute=true; preview passes leave the baseline untouched so deletions stay visible across multiple previews. Returns candidates only; use twining_archive_stale to act on them. When run alongside staleness_review, branch-gone duplicates are removed from staleness_review (merge_sweep is the more specific signal). | |
| stale_days | No | Flag provisional decisions older than this many days (default: 7) | |
| metrics_retention_days | No | Remove metrics older than this many days (default: 30) |