Category
Code quality / code smell
Description
internal/audit/schema.go declares two timestamp columns on workload_details:
CREATE TABLE IF NOT EXISTS workload_details (
...
started_at TEXT,
completed_at TEXT
);
docs/audit-schema.md marks both as "Reserved — currently unset." The Auditor interface and its SQLiteAuditor implementation never write to these columns. They are dead schema.
Severity
Low — cosmetic or minor inconvenience
Affected Files
internal/audit/schema.go — column declarations
internal/audit/audit.go — RecordWorkload, UpdateWorkloadStatus, CompleteExecution
cmd/virtwork/main.go — orchestration calls that record per-workload progress
docs/audit-schema.md — descriptions to update either way
Proposed Fix
Pick one:
Option A — populate them. Stamp started_at when RecordWorkload is called (right before VM creation begins for that workload), and completed_at from UpdateWorkloadStatus when transitioning to created / failed. Useful if anyone ever queries per-workload duration.
Option B — drop them. If nobody plans to query workload-level start/end timestamps separately from audit_log.started_at / VM-level timestamps, remove the columns from schemaSQL. The audit schema doc already calls them out; one less surface to maintain.
Either option is a small, contained PR; the choice is editorial.
Area
Audit system
Architecture Layer
Layer 4 - Orchestration (cmd, cleanup)
Additional Context
See also the related issues for audit_log.cluster_context and audit_log.cleanup_mode, which have the same "declared but never written" pattern.
Category
Code quality / code smell
Description
internal/audit/schema.godeclares two timestamp columns onworkload_details:docs/audit-schema.mdmarks both as "Reserved — currently unset." TheAuditorinterface and itsSQLiteAuditorimplementation never write to these columns. They are dead schema.Severity
Low — cosmetic or minor inconvenience
Affected Files
internal/audit/schema.go— column declarationsinternal/audit/audit.go—RecordWorkload,UpdateWorkloadStatus,CompleteExecutioncmd/virtwork/main.go— orchestration calls that record per-workload progressdocs/audit-schema.md— descriptions to update either wayProposed Fix
Pick one:
Option A — populate them. Stamp
started_atwhenRecordWorkloadis called (right before VM creation begins for that workload), andcompleted_atfromUpdateWorkloadStatuswhen transitioning tocreated/failed. Useful if anyone ever queries per-workload duration.Option B — drop them. If nobody plans to query workload-level start/end timestamps separately from
audit_log.started_at/ VM-level timestamps, remove the columns fromschemaSQL. The audit schema doc already calls them out; one less surface to maintain.Either option is a small, contained PR; the choice is editorial.
Area
Audit system
Architecture Layer
Layer 4 - Orchestration (cmd, cleanup)
Additional Context
See also the related issues for
audit_log.cluster_contextandaudit_log.cleanup_mode, which have the same "declared but never written" pattern.