Publish products without execution ledgers

This commit is contained in:
2026-12-02 15:50:59 +00:00
parent ebdf8b522f
commit 4f50a57a38
21 changed files with 115 additions and 359 deletions

View File

@@ -1169,7 +1169,7 @@ func TestExecutePublishIgnoresRetiredSharedLockObject(t *testing.T) {
if storeInitCalls != 1 {
t.Fatalf("object store initialization calls = %d, want 1", storeInitCalls)
}
current, err := artifacts.LoadCurrentState(context.Background(), fake, sessionPrefix, artifacts.CurrentStateValidation{ValidateRunID: true})
current, err := artifacts.LoadCurrentInventory(context.Background(), fake, sessionPrefix, artifacts.CurrentStateValidation{ValidateRunID: true})
if err != nil {
t.Fatalf("LoadCurrentState() error = %v", err)
}

View File

@@ -325,18 +325,13 @@ func TestExecuteRestoreRestoresPreviousCacheWhenPresent(t *testing.T) {
}
sessionRoot := artifacts.SessionWorkDirForCampaign(workspaceRoot, cfg.Session.Campaign, cfg.Session.SessionID)
previousManifestBytes, err := os.ReadFile(filepath.Join(sessionRoot, "inputs", "previous", "manifest.json"))
if err != nil {
t.Fatalf("read restored previous manifest: %v", err)
}
var previousManifest manifest.Manifest
if err := json.Unmarshal(previousManifestBytes, &previousManifest); err != nil || previousManifest.SessionID != "2026-04-26" {
t.Fatalf("restored previous manifest = %q, want previous session id", string(previousManifestBytes))
if _, err := os.Stat(filepath.Join(sessionRoot, "inputs", "previous", "manifest.json")); !os.IsNotExist(err) {
t.Fatalf("unexpected previous execution manifest: %v", err)
}
mustReadEquals(t, filepath.Join(sessionRoot, "inputs", "previous", "artifacts", "session_recap.md"), "# previous recap\n")
report := mustReadRestoreReport(t, filepath.Join(sessionRoot, "logs", "restore", "restore.json"))
if report.Execution.Downloaded != 3 {
t.Fatalf("report execution.downloaded = %d, want 3", report.Execution.Downloaded)
if report.Execution.Downloaded != 2 {
t.Fatalf("report execution.downloaded = %d, want 2", report.Execution.Downloaded)
}
}

View File

@@ -397,7 +397,6 @@ func buildPreviousCacheRestoreActions(
if err != nil {
return nil, fmt.Errorf("classify previous-session cache object %q: %w", record.RemoteKey, err)
}
action.VerifiedContent = append([]byte(nil), record.VerifiedContent...)
actions = append(actions, action)
}
return actions, nil

View File

@@ -150,7 +150,7 @@ func TestRestorePlanIncludesPreviousCacheByDefault(t *testing.T) {
}
got := actionRelPaths(plan.Actions)
want := []string{"inputs/previous/artifacts/session_recap.md", "inputs/previous/manifest.json", "manifest.json"}
want := []string{"inputs/previous/artifacts/session_recap.md", "manifest.json"}
if !slices.Equal(got, want) {
t.Fatalf("action local paths = %#v, want %#v", got, want)
}
@@ -192,7 +192,7 @@ func TestRestorePlanMissingOptionalPreviousCacheSkipsArtifact(t *testing.T) {
}
got := actionRelPaths(plan.Actions)
want := []string{"inputs/previous/manifest.json", "manifest.json"}
want := []string{"manifest.json"}
if !slices.Equal(got, want) {
t.Fatalf("action local paths = %#v, want %#v", got, want)
}
@@ -559,7 +559,7 @@ func TestRestorePlanIncludesAvailableOptionalPrerequisiteHistory(t *testing.T) {
if err != nil {
t.Fatal(err)
}
want := []string{"inputs/previous/artifacts/session_recap.md", "inputs/previous/manifest.json", "manifest.json"}
want := []string{"inputs/previous/artifacts/session_recap.md", "manifest.json"}
if got := actionRelPaths(plan.Actions); !slices.Equal(got, want) {
t.Fatalf("actions = %v, want %v", got, want)
}

View File

@@ -202,13 +202,8 @@ previous_session_id: 2026-04-26
}
mustReadEquals(t, filepath.Join(sessionRoot, "transcripts", "final.trimmed.json"), `{"segments":[]}`+"\n")
previousManifestBytes, err := os.ReadFile(filepath.Join(sessionRoot, "inputs", "previous", "manifest.json"))
if err != nil {
t.Fatalf("read restored previous manifest: %v", err)
}
var previousManifest manifest.Manifest
if json.Unmarshal(previousManifestBytes, &previousManifest) != nil || previousManifest.SessionID != "2026-04-26" {
t.Fatalf("restored previous manifest = %q, want previous session id", string(previousManifestBytes))
if _, err := os.Stat(filepath.Join(sessionRoot, "inputs", "previous", "manifest.json")); !os.IsNotExist(err) {
t.Fatalf("unexpected previous execution manifest: %v", err)
}
mustReadEquals(t, filepath.Join(sessionRoot, "inputs", "previous", "artifacts", "session_recap.md"), "# previous recap\n")