Skip to content

activity: prune deletes a *.json that is not a pull record first #2754

Closed

Description

@thiras

Follow-up to #2752 (review).

Today. prune (crates/cli/src/commands/activity.rs) runs when each decdn get starts. It ranks every *.json in ~/.decdn/activity/pulls/ by started_of, the number its name begins with. started_of returns 0 for a name with no numeric prefix, so such a file ranks oldest. Once the directory holds 200 files (KEPT_RECORDS), prune deletes that file first. It never checks that the file is a record, so it deletes whatever *.json is there, for example a file a user copied in.

Since #2752 the dashboard lists each *.json that does not read as a record (UnreadableRecords) and says that deleting one is safe. Prune deletes those files with no notice. adr/appendix-binaries.md says only "Each run deletes the oldest records when it starts, and keeps 200".

Ask. Choose one, and make the ADR say it:

  • prune only files whose name matches <start-ms>-<pid>.json, and leave the rest (the dashboard keeps naming them);
  • or keep the current behaviour, and state in the ADR and on the dashboard banner that prune deletes any *.json that is not a record.

Done when

  • Prune behaviour toward a non-record *.json is decided, and the ADR states it.
  • A test in activity/tests.rs covers it.

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Oct 29, 2026
  2. added
    kind:bug
    area:cli
    prio:low
    on Oct 29, 2026
  3. assigned and unassigned on Oct 29, 2026
  4. moved this from Backlog to In progress in deCDNon Oct 29, 2026
  5. added a commit that references this issue on Oct 29, 2026
    b647762
  6. moved this from In progress to Done in deCDNon Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clikind:bugprio:low

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions