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.go — RecordCleanupCounts (would be the natural place)
cmd/virtwork/main.go — cleanupE 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.
Category
Code quality / code smell
Description
audit_log.cleanup_modeexists ininternal/audit/schema.goand is documented indocs/audit-schema.mdas "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 declarationinternal/audit/audit.go—RecordCleanupCounts(would be the natural place)cmd/virtwork/main.go—cleanupEknows which mode it ran indocs/audit-schema.md— descriptionProposed Fix
Pick one:
Option A — populate it. Write a categorical value such as
all,run-id, ordry-runbased on the cleanup flags. Lets operators filter cleanup history by mode without parsing thecommandstring.Option B — drop it. If
command(alreadycleanuporcleanup --dry-run) plus therun_idfilter encoded in the row are enough, remove the column fromschemaSQL.Area
Audit system
Architecture Layer
Layer 4 - Orchestration (cmd, cleanup)
Additional Context
Related:
audit_log.cluster_contextandworkload_details.started_at/completed_atare also reserved-but-unused. Consider bundling all three into a single PR.