diff --git a/cmd/skillshare/log.go b/cmd/skillshare/log.go index 13d1b3d18..201e30363 100644 --- a/cmd/skillshare/log.go +++ b/cmd/skillshare/log.go @@ -245,7 +245,7 @@ Examples: func runLogStats(configPath string, auditOnly bool, f oplog.Filter) error { filename := oplog.OpsFile - if auditOnly { + if auditOnly || f.Cmd == "audit" { filename = oplog.AuditFile } diff --git a/tests/integration/log_test.go b/tests/integration/log_test.go index d20f7ddef..c456237df 100644 --- a/tests/integration/log_test.go +++ b/tests/integration/log_test.go @@ -464,6 +464,26 @@ targets: result.AssertOutputContains(t, "OK:") } +func TestLog_StatsCmdAuditReadsAuditLog(t *testing.T) { + sb := testutil.NewSandbox(t) + defer sb.Cleanup() + + sb.CreateSkill("s1", map[string]string{"SKILL.md": "# S\n\nTest."}) + tp := sb.CreateTarget("claude") + sb.WriteConfig(`source: ` + sb.SourcePath + ` +targets: + claude: + path: ` + tp + ` +`) + + sb.RunCLI("audit") + + result := sb.RunCLI("log", "--stats", "--cmd", "audit") + result.AssertSuccess(t) + result.AssertOutputContains(t, "audit") + result.AssertOutputContains(t, "OK:") +} + func TestLog_CheckCreatesEntry(t *testing.T) { sb := testutil.NewSandbox(t) defer sb.Cleanup()