make-automatic-archival-opt-in

Make automatic task archival opt-in

Metadata

Statusdone
Agent identityfbb2d89fe44d6b761bcb4b67748ab3d417f29df70a65f8d9403308f5bb2bab78
Created2026-08-02T06:13:33.450002245+00:00
Started2026-08-02T06:13:46.557024650+00:00
Completed2026-08-03T09:42:52.325284579+00:00
Tokens18669394 in / 25585 out

Description

Make task-graph automatic archival opt-in rather than a time-triggered default. The current shipped default (default_archive_retention_days) can cause a daemon restart or upgrade to hide a large historical backlog based only on wall-clock age. That is unsafe for repositories where completed/abandoned tasks retain dependency, receipt, session, audit, incident, or recovery evidence. Archive is organization, not backup or cleanup.

Change the new-install/default retention to 0 (disabled; visible history preserved). Preserve an operator's explicit non-zero project/profile setting. Ensure setup, config templates, starter profiles, status, service reload, upgrades, and documentation consistently represent automatic archival as disabled unless deliberately enabled. A daemon upgrade must never activate archival merely because a new default appeared, and disabling retention while a hold exists must clear or neutralize the pending batch without archiving anything. Manual archival and an explicit dry-run/confirmation workflow must remain available.

Do not delete existing archives, rewrite graph history, or conflate task archival with bounded stream/cache cleanup. Document the risk model and recommend manual review for evidence-bearing development graphs.

Validation

  • Unit tests prove a fresh/default config resolves task archive retention to 0, while an explicit non-zero value remains effective across load/reload.
  • Regression test starts with an eligible historical backlog, enters an archive hold, changes retention to 0, reloads/restarts the candidate daemon, and asserts zero tasks archived and all visible task states preserved.
  • Candidate-binary clean-room smoke uses isolated HOME and explicit --dir, verifies a new graph does not auto-archive after restart/upgrade simulation, then opts into a short retention and confirms only the exact reviewed batch is archived.
  • wg service status and wg archive auto --dry-run clearly report disabled behavior at retention 0.
  • Update operator/config documentation and run pinned cargo fmt --check, focused tests, and the owned smoke scenario.

Depends on

Required by

Log