Archive Audita reports as polish diagnostics

This commit is contained in:
2026-09-25 15:51:18 +00:00
parent 77d9d57937
commit 569f467393
9 changed files with 212 additions and 14 deletions

View File

@@ -274,6 +274,28 @@ inputs:
if !strings.Contains(stdout.String(), "stage=polish executed=1 skipped=0") {
t.Fatalf("stdout = %q, want polish execution", stdout.String())
}
recorded, err := (&manifest.LocalStore{}).Load(context.Background(), filepath.Join(workRoot, "manifest.json"))
if err != nil {
t.Fatalf("load polished manifest: %v", err)
}
polish := recorded.Stages["polish"]
if polish == nil || len(polish.Outputs) != 1 || polish.Outputs[0].Kind != "transcript_polished" {
t.Fatalf("polish outputs = %#v, want only canonical transcript", polish)
}
if len(polish.Logs) != 5 || len(polish.GeneratedConfigs) != 1 {
t.Fatalf("polish diagnostics = %#v, want logs, reports, and invocation", polish)
}
for _, name := range []string{"errors.yml", "recoveries.yml", "report.md"} {
found := false
for _, path := range polish.Logs {
if filepath.Base(path) == name {
found = true
}
}
if !found {
t.Fatalf("report %q absent from manifest diagnostics: %#v", name, polish.Logs)
}
}
foundReference := false
if err := filepath.WalkDir(workRoot, func(path string, entry os.DirEntry, walkErr error) error {
if walkErr != nil || entry.IsDir() {