Clarify remote manifest recovery

This commit is contained in:
2026-09-02 14:37:36 +00:00
parent ccbd7ee820
commit c8bae3a4a3
3 changed files with 16 additions and 3 deletions

View File

@@ -92,6 +92,19 @@ func TestLoadCurrentStateUsesMetadataFromOpenedObjectVersion(t *testing.T) {
}
}
func TestDecodeCommittedManifestGuidesRemoteRecovery(t *testing.T) {
_, err := decodeCommittedManifest(context.Background(), []byte(`{"session_id":"2026-05-03"}`))
if err == nil {
t.Fatal("decodeCommittedManifest() error = nil, want unsupported schema failure")
}
if !strings.Contains(err.Error(), "schema_version is required") || !strings.Contains(err.Error(), "republish this session") {
t.Fatalf("decodeCommittedManifest() error = %v, want schema and republish guidance", err)
}
if strings.Contains(err.Error(), "local state") {
t.Fatalf("decodeCommittedManifest() error = %v, must not describe remote state as local", err)
}
}
func TestLoadCurrentStateRejectsPointerCommitIdentityMismatch(t *testing.T) {
store := &storage.FakeBackend{}
prefix := testCurrentSessionPrefix()