Show carried output locations
This commit is contained in:
@@ -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
|
pointer-selected remote commit and its declared published outputs. Current
|
||||||
publish metadata reports `published`, `carried_locked`, `locked_unpublished`,
|
publish metadata reports `published`, `carried_locked`, `locked_unpublished`,
|
||||||
`optional_missing`, and `unselected`; carried output lines include the run
|
`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`
|
### `session init`
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,9 @@ func remotePublishedOutputAvailabilityForCurrent(
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
state += "remote=published"
|
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
|
state += " origin_run=" + identity.RunID
|
||||||
}
|
}
|
||||||
out[publishedOutputRemoteStateKey(source, dest)] = state
|
out[publishedOutputRemoteStateKey(source, dest)] = state
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
@@ -145,7 +146,7 @@ func TestCommittedStatusReportsCarriedOutputOriginAndChecksExactKey(t *testing.T
|
|||||||
"transcripts/full.json": []byte("carried\n"),
|
"transcripts/full.json": []byte("carried\n"),
|
||||||
})
|
})
|
||||||
const originRun = "20260512T010203Z-11223344"
|
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")})
|
fake.SeedObject(storage.FakeObject{Key: oldKey, Data: []byte("carried\n")})
|
||||||
current.Commit.Artifacts[1].Source = "narratio.transcript.final_trimmed"
|
current.Commit.Artifacts[1].Source = "narratio.transcript.final_trimmed"
|
||||||
current.Commit.Artifacts[1].DestinationKey = oldKey
|
current.Commit.Artifacts[1].DestinationKey = oldKey
|
||||||
@@ -158,13 +159,20 @@ func TestCommittedStatusReportsCarriedOutputOriginAndChecksExactKey(t *testing.T
|
|||||||
|
|
||||||
availability := remotePublishedOutputAvailabilityForCurrent(context.Background(), cfg, fake, nil, current)
|
availability := remotePublishedOutputAvailabilityForCurrent(context.Background(), cfg, fake, nil, current)
|
||||||
key := publishedOutputRemoteStateKey("narratio.transcript.final_trimmed", "transcripts/full.json")
|
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 {
|
if availability[key] != want {
|
||||||
t.Fatalf("availability = %#v, want %q", availability, want)
|
t.Fatalf("availability = %#v, want %q", availability, want)
|
||||||
}
|
}
|
||||||
if len(fake.ExistsKeys) == 0 || fake.ExistsKeys[len(fake.ExistsKeys)-1] != oldKey {
|
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)
|
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) {
|
func TestCommittedPublishOutputOutcomesRecognizesAllStates(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user