Skip to content

[Tech Debt]: audit_log.cleanup_mode column is declared but never populated #66

Description

@mrhillsman

Category

Code quality / code smell

Description

audit_log.cleanup_mode exists in internal/audit/schema.go and is documented in docs/audit-schema.md as "Reserved — currently unused." The cleanup code path never writes a value into this column. It is dead schema.

Severity

Low — cosmetic or minor inconvenience

Affected Files

  • internal/audit/schema.go — column declaration
  • internal/audit/audit.goRecordCleanupCounts (would be the natural place)
  • cmd/virtwork/main.gocleanupE knows which mode it ran in
  • docs/audit-schema.md — description

Proposed Fix

Pick one:

Option A — populate it. Write a categorical value such as all, run-id, or dry-run based on the cleanup flags. Lets operators filter cleanup history by mode without parsing the command string.

Option B — drop it. If command (already cleanup or cleanup --dry-run) plus the run_id filter encoded in the row are enough, remove the column from schemaSQL.

Area

Audit system

Architecture Layer

Layer 4 - Orchestration (cmd, cleanup)

Additional Context

Related: audit_log.cluster_context and workload_details.started_at / completed_at are also reserved-but-unused. Consider bundling all three into a single PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    size/SDenotes a PR that changes 10-29 lines, ignoring generated files.tech-debtTechnical debt, code quality, or maintenance concerntriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions