Skip to content

[P3] Audit log rotation (currently unbounded) #20

@Railly

Description

@Railly

Context

`~/.sunat/audit/YYYY-MM.jsonl` grows unbounded. After a year of daily emissions, the file gets large and `cpe doctor stale_pendings` scan slows down.

Scope

  • Per-month JSONL files (already kind of by date) but explicit rotation
  • `sunat audit compact` — move >12 months old to compressed archive
  • `sunat audit prune --before YYYY-MM` — delete archived months
  • Default policy: compact at 6 months, archive at 24 months, never auto-delete

Success criteria

  • `stale_pendings` doctor check stays fast even after years of emissions
  • Operator can recover archived months on demand

Why P3

Won't matter for ~2 years of normal use. File system is forgiving.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:infraCI, build, tooling, observabilityenhancementNew feature or requestpriority:p3Nice-to-have, low priorityready-for-agentAFK agent should pick this up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions