Skip to content

Decommissioned probe installs retain journal, database and logs indefinitely #243

Description

@willwashburn

Problem

A decommissioned probe install keeps everything forever. Observed under ~/.agentworkforce/probe/:

  • bc637…: all 9 delivery jobs cancelled, no config.json, yet history.db is 3.8 GB + 202 MB WAL, delivery_journal holds 14.5k rows / 99 MB (retained_bytes 37% of cap), and collector.log is 307 MB.
  • The live install's collector.log is 55 MB after two days.

Nothing reclaims journal rows once no subscription exists, nothing rotates collector.log, and nothing removes an install's directory when it is decommissioned.

Fix

  • When no non-cancelled job / subscription remains, compaction drops the whole journal and shadow tables (nothing can consume them).
  • collector.log rotates (10 MB, keep 3).
  • Decommissioning an install (cloud uninstall, account switch, installs listing an entry with no config.json) removes its directory after the collector is stopped; installs --json never lists a directory without a valid config.

Related: #53 (evidence-table retention for the history database itself — separate concern).

Acceptance

  • Test: cancelling the last job leaves delivery_journal and delivery_shadow empty after the next compaction and retained_bytes at 0.
  • Test: log rotation keeps the file under the cap.
  • Test: an install directory without config.json is removed by the decommission path and absent from installs --json.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions