From 6c66e18c4bfb7f8eb22671410552613f217c9981 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Sat, 5 Sep 2026 14:16:20 +0000 Subject: [PATCH] Show carried output locations --- docs/cli.md | 4 +++- internal/app/operator_artifact_rendering.go | 4 +++- internal/app/restore_commit_test.go | 12 ++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index 0b3dd1a..9ffbb73 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -294,7 +294,9 @@ Prints local manifest state and, when storage is available, status for the pointer-selected remote commit and its declared published outputs. Current publish metadata reports `published`, `carried_locked`, `locked_unpublished`, `optional_missing`, and `unselected`; carried output lines include the run -derived from their exact declared key. +derived from their exact declared key, the key itself, and its declared +destination. A separately displayed `dest` is the destination requested by the +current configuration and may differ while an older declaration is locked. ### `session init` diff --git a/internal/app/operator_artifact_rendering.go b/internal/app/operator_artifact_rendering.go index 44b48af..cc03390 100644 --- a/internal/app/operator_artifact_rendering.go +++ b/internal/app/operator_artifact_rendering.go @@ -193,7 +193,9 @@ func remotePublishedOutputAvailabilityForCurrent( continue } state += "remote=published" - if identity.RunID != current.RunID { + if outcome == "carried_locked" || identity.RunID != current.RunID { + state += " declared_dest=" + identity.Destination + state += " declared_key=" + declaration.DestinationKey state += " origin_run=" + identity.RunID } out[publishedOutputRemoteStateKey(source, dest)] = state diff --git a/internal/app/restore_commit_test.go b/internal/app/restore_commit_test.go index d68f862..f542f2e 100644 --- a/internal/app/restore_commit_test.go +++ b/internal/app/restore_commit_test.go @@ -1,6 +1,7 @@ package app import ( + "bytes" "context" "crypto/sha256" "encoding/hex" @@ -145,7 +146,7 @@ func TestCommittedStatusReportsCarriedOutputOriginAndChecksExactKey(t *testing.T "transcripts/full.json": []byte("carried\n"), }) const originRun = "20260512T010203Z-11223344" - oldKey := artifacts.S3RunRelativeDestinationKey(artifacts.S3RunPrefix(current.SessionPrefix, originRun), "published/transcripts/full.json") + oldKey := artifacts.S3RunRelativeDestinationKey(artifacts.S3RunPrefix(current.SessionPrefix, originRun), "published/transcripts/original.json") fake.SeedObject(storage.FakeObject{Key: oldKey, Data: []byte("carried\n")}) current.Commit.Artifacts[1].Source = "narratio.transcript.final_trimmed" current.Commit.Artifacts[1].DestinationKey = oldKey @@ -158,13 +159,20 @@ func TestCommittedStatusReportsCarriedOutputOriginAndChecksExactKey(t *testing.T availability := remotePublishedOutputAvailabilityForCurrent(context.Background(), cfg, fake, nil, current) key := publishedOutputRemoteStateKey("narratio.transcript.final_trimmed", "transcripts/full.json") - want := "outcome=carried_locked remote=published origin_run=" + originRun + want := "outcome=carried_locked remote=published declared_dest=transcripts/original.json declared_key=" + oldKey + " origin_run=" + originRun if availability[key] != want { t.Fatalf("availability = %#v, want %q", availability, want) } if len(fake.ExistsKeys) == 0 || fake.ExistsKeys[len(fake.ExistsKeys)-1] != oldKey { t.Fatalf("exists keys = %#v, want final exact declaration key %q", fake.ExistsKeys, oldKey) } + var rendered bytes.Buffer + writePublishedOutputLine(&rendered, cfg.Pipeline.Publish.Outputs[0], nil, nil, availability) + for _, fragment := range []string{"dest=transcripts/full.json", "declared_dest=transcripts/original.json", "declared_key=" + oldKey, "origin_run=" + originRun} { + if !strings.Contains(rendered.String(), fragment) { + t.Fatalf("rendered output = %q, want %q", rendered.String(), fragment) + } + } } func TestCommittedPublishOutputOutcomesRecognizesAllStates(t *testing.T) {