channels digests: list the heads a new box would refuse, marker or not
Fix round 1 (Astra P1-6, Fable P2-3, P2-4). This branch makes a fresh or replaced box refuse two kinds of channel head: an account-less pointer (H3-M8) and a digestless head with no promotion record (H3-M1). Neither was listed anywhere: `channels digests` showed an account-less pointer only as its account's error, and record-less heads not at all. DigestReport now reads each head as the write verbs do (verifyPredecessor), so an account-less pointer is a line with Unbound set, filled in from the pointer, and checks a digestless head's promotion record (NoRecord; a record that cannot be read is RecordErr, which leaves the account unknown). The console's report and the direct-store report add "repairs" with both kinds by account, app and channel, with the marker on or off, and the CLI prints them under REPAIR, or says none is needed. A console without the field is named as such, never read as clean. No switch is added. README, release notes: the repair for each line. No account: a repeat promote of the head's version (re-signs bound, digests or not; the marker-off repair), through the bucket with CARLOS_RELEASE_KEY where the console refuses (stable, passkey or approval channels); channels resign for marker-on accounts, the same way for stable and passkey channels. No promotion record: carlos releases authorize, after checking the digests it shows against the shipped build. Rollout gate: the `carlos channels digests` REPAIR listing is empty on dev and flagship before this release rolls. The new CLI and README text has not been through copy review. Tests: TestDigestReportListsHeadsAFreshBoxWouldRefuse, TestSystemDigestsDoorListsRepairsWithTheMarkerOff, TestChannelsDigestsListsRepairsWithTheMarkerOff.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 files changed,
+281
−6
README.md+5 −0apimode.go+15 −0channels_digests.go+48 −1channels_digests_test.go+33 −0internal/console/apidigests.go+19 −2internal/console/apidigests_test.go+60 −0internal/release/digests.go+45 −3internal/release/digests_test.go+56 −0
diff --git a/README.md b/README.md| index 6c448fc4d..a597cb268 100644 |
| --- a/README.md |
| +++ b/README.md |
| @@ -306,6 +306,11 @@ the release you are about to roll. |
| **Pointer digests (#253): writers before readers.** Once a box has verified a channel pointer that carries manifest digests, it refuses pointers for that channel without them. So digests are turned on in order. First upgrade every writer: every console, and every CLI or deploy script that promotes, rolls back or fast-tracks. Then run `carlos channels digests on`. Then watch `carlos channels digests`: a channel marked as written by an old writer means one is still in use. Rolling a writer back below this release stops it writing pointers boxes accept; `carlos channels digests off` suspends digests while it is fixed, but does not clear the boxes that have already seen them. When `carlos channels digests` lists nothing, set `CARLOS_REQUIRE_POINTER_DIGEST=on` in every box's host.env, so a new box refuses old pointers too. |
| +**Account binding and record-less heads: repair before rolling (hunt H3-M8, H3-M1).** From this release a new or replaced box refuses two kinds of channel head. One is a pointer signed before the account binding, which names no account. The other is a head that signs no manifest digest and has no promotion record to bind its bytes. Boxes that already run a build keep running it. Before the release rolls, run `carlos channels digests` against dev and against flagship. It lists both kinds under REPAIR, by account, app and channel, whether or not digests are on. Roll only when it lists nothing on both. Repair each line, then run the listing again: |
| + |
| +- **no account.** Promote the version the channel already names, again: `carlos promote --app <app> --account <sqid> <version> <channel>`. A repeat promote re-signs the pointer with its account, with or without digests, and is the repair for an account whose digests are off. If the console refuses it (stable, or a channel that needs a passkey or an approval), run the same command against the bucket with the root key, as in step 10 above: `AWS_PROFILE` for the deployment, `CARLOS_DEPLOYMENT_BUCKET` set to its bucket, and `CARLOS_RELEASE_KEY` from SSM `/carlos/release-key` set for that one command. For an account whose digests are on, `carlos channels resign --app <app> --account <sqid> <channel>` also binds it. The console's resign door refuses stable and passkey channels too, so use the same bucket-and-root-key form for those. |
| +- **no promotion record.** `carlos releases authorize --app <app> --account <sqid> <version>`. It shows the manifest and artifact digests and signs a record for them when you type yes. It signs whatever the bucket holds now, so check the digests against the build you shipped first. |
| + |
| **Instance update settings: the roll order.** Roll every box to the release that applies update settings before anyone turns on manual updates, a major hold or a pin: the console refuses those until every box reports it can protect the builds they name from pruning, and says how many boxes it is waiting on. Before rolling any box back below that release, turn retention off for the deployment (`carlos releases retention --off` for each app that has one), because an older housekeeper prunes builds a pin or a held instance still needs. After such a rollback the console shows *settings not enforced* for instances on the older boxes: they follow their channel until the box is rolled forward again. |
| **v0.25.0: instances move to the nested layout on their own.** This is |
diff --git a/apimode.go b/apimode.go| index e2e2a35b2..3265b4091 100644 |
| --- a/apimode.go |
| +++ b/apimode.go |
| @@ -1709,9 +1709,24 @@ type apiDigestChannel struct { |
| Version string `json:"version"` |
| Straggler bool `json:"straggler"` |
| } |
| + |
| +// apiDigestRepair is a channel whose head a fresh or replaced box would |
| +// refuse: Unbound (signed before the account binding) or NoRecord (no digest |
| +// and no promotion record to bind it). |
| +type apiDigestRepair struct { |
| + Account string `json:"account"` |
| + App string `json:"app"` |
| + Channel string `json:"channel"` |
| + Version string `json:"version"` |
| + Unbound bool `json:"unbound"` |
| + NoRecord bool `json:"no_record"` |
| +} |
| type apiPointerDigests struct { |
| Accounts []apiDigestAccount `json:"accounts"` |
| Channels []apiDigestChannel `json:"channels"` |
| + // Repairs is nil when the console predates the listing, never empty |
| + // for that reason: an empty list is a clean answer. |
| + Repairs *[]apiDigestRepair `json:"repairs"` |
| } |
| // pointerDigests reads the pointer-digest report (verb ""), or turns the |
diff --git a/channels_digests.go b/channels_digests.go| index 683cf0759..b7b97150d 100644 |
| --- a/channels_digests.go |
| +++ b/channels_digests.go |
| @@ -41,6 +41,46 @@ const ( |
| textUnknownAccount = "no account %s on this console, so nothing was changed for it" |
| ) |
| +// The repair listing (hunt H3-M8 and H3-M1, fix round 1). Not yet through |
| +// copy review. |
| +const ( |
| + textRepairHeader = "ACCOUNT\tAPP\tCHANNEL\tVERSION\tREPAIR" |
| + textRepairUnbound = "no account: promote this version again" |
| + textRepairNoRecord = "no promotion record: carlos releases authorize" |
| + textRepairNone = "no channel needs a repair: a new or replaced box accepts every head" |
| + textRepairUnknown = "this console does not list repairs: upgrade it, or ask the bucket directly" |
| +) |
| + |
| +// repairCell is the repair a channel needs. A head can need both: the |
| +// account first, since an unbound pointer is refused before its bytes are. |
| +func repairCell(r apiDigestRepair) string { |
| + if r.Unbound { |
| + return textRepairUnbound |
| + } |
| + return textRepairNoRecord |
| +} |
| + |
| +// printRepairs lists the channels whose heads a fresh or replaced box would |
| +// refuse, whatever the marker says. The account binding's rollout gate is |
| +// this list being empty on every deployment. |
| +func printRepairs(rep apiPointerDigests, failed bool) { |
| + switch { |
| + case rep.Repairs == nil: |
| + fmt.Fprintln(stdout, textRepairUnknown) |
| + case len(*rep.Repairs) == 0: |
| + if !failed { |
| + fmt.Fprintln(stdout, textRepairNone) |
| + } |
| + default: |
| + w := newTable(stdout) |
| + fmt.Fprintln(w, textRepairHeader) |
| + for _, r := range *rep.Repairs { |
| + fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", r.Account, r.App, r.Channel, r.Version, repairCell(r)) |
| + } |
| + w.Flush() |
| + } |
| +} |
| + |
| // resignInput is where resign reads its confirmation; tests swap it. |
| var resignInput io.Reader = os.Stdin |
| @@ -211,6 +251,7 @@ func runChannelsDigests(args []string) { |
| fmt.Fprintf(stdout, textStatusOff+"\n", a.Account) |
| } |
| } |
| + printRepairs(rep, failed) |
| if len(rep.Channels) == 0 { |
| if failed { |
| return |
| @@ -247,7 +288,7 @@ func checkNamedAccounts(rep apiPointerDigests, ids []string) error { |
| // report. |
| func localPointerDigests(ctx context.Context, s release.Store, verb string, ids []string) (apiPointerDigests, error) { |
| pub := publicKey() |
| - var rep apiPointerDigests |
| + rep := apiPointerDigests{Repairs: &[]apiDigestRepair{}} |
| for _, acct := range ids { |
| var err error |
| switch verb { |
| @@ -298,6 +339,12 @@ func localPointerDigests(ctx context.Context, s release.Store, verb string, ids |
| case !st.HeadDigest: |
| rep.Channels = append(rep.Channels, apiDigestChannel{Account: acct, App: app, Channel: st.Channel, Version: st.Version, Straggler: st.Straggler}) |
| } |
| + if st.Err == "" && st.RecordErr != "" && row.Error == "" { |
| + row.Error = st.RecordErr // unknown whether it needs a repair |
| + } |
| + if st.Err == "" && st.NeedsRepair() { |
| + *rep.Repairs = append(*rep.Repairs, apiDigestRepair{Account: acct, App: app, Channel: st.Channel, Version: st.Version, Unbound: st.Unbound, NoRecord: st.NoRecord}) |
| + } |
| } |
| } |
| rep.Accounts = append(rep.Accounts, row) |
diff --git a/channels_digests_test.go b/channels_digests_test.go| index 2750d6d17..337f90df5 100644 |
| --- a/channels_digests_test.go |
| +++ b/channels_digests_test.go |
| @@ -406,3 +406,36 @@ func TestChannelsDigestsDirectStoreUnreadableChannel(t *testing.T) { |
| t.Fatalf("an incomplete report printed the none-left line:\n%s", out) |
| } |
| } |
| + |
| +// The account binding's rollout listing, direct-store, with the marker OFF |
| +// (fix round 1): a digestless head whose promotion record is gone is listed |
| +// for `carlos releases authorize`, and once it has a record again the |
| +// listing says nothing needs a repair. |
| +func TestChannelsDigestsListsRepairsWithTheMarkerOff(t *testing.T) { |
| + s, pub := directDigestStore(t) // bab: km/stable at v1, no digest |
| + ctx := context.Background() |
| + if err := release.RemoveDigestMarker(ctx, s, "bab"); err != nil { |
| + t.Fatal(err) |
| + } |
| + rec, _, err := s.Get(ctx, release.PromotionRecordKey("bab", "km", "v1")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := s.Delete(ctx, release.PromotionRecordKey("bab", "km", "v1")); err != nil { |
| + t.Fatal(err) |
| + } |
| + out := runDigests(t, "--account-id", "bab") |
| + if !strings.Contains(out, fmt.Sprintf(textStatusOff, "bab")) || !strings.Contains(out, "REPAIR") || !strings.Contains(out, textRepairNoRecord) { |
| + t.Fatalf("record-less head not listed for repair with the marker off:\n%s", out) |
| + } |
| + if strings.Contains(out, textRepairNone) { |
| + t.Fatalf("said nothing needs a repair:\n%s", out) |
| + } |
| + if _, err := s.Put(ctx, release.PromotionRecordKey("bab", "km", "v1"), rec, ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + if out := runDigests(t, "--account-id", "bab"); !strings.Contains(out, textRepairNone) || strings.Contains(out, textRepairNoRecord) { |
| + t.Fatalf("with the record back:\n%s", out) |
| + } |
| + _ = pub |
| +} |
diff --git a/internal/console/apidigests.go b/internal/console/apidigests.go| index 05fa60c93..61d820c02 100644 |
| --- a/internal/console/apidigests.go |
| +++ b/internal/console/apidigests.go |
| @@ -219,7 +219,18 @@ func (s *Server) handleAPISystemPointerDigests(w http.ResponseWriter, r *http.Re |
| Version string `json:"version"` |
| Straggler bool `json:"straggler"` |
| } |
| - acctRows, chRows := []acctRow{}, []chRow{} |
| + // repRow is a channel whose head a fresh or replaced box would refuse |
| + // (release.ChannelDigestState.NeedsRepair), listed whatever the |
| + // account's marker says: the account binding's rollout waits on none. |
| + type repRow struct { |
| + Account string `json:"account"` |
| + App string `json:"app"` |
| + Channel string `json:"channel"` |
| + Version string `json:"version"` |
| + Unbound bool `json:"unbound,omitempty"` |
| + NoRecord bool `json:"no_record,omitempty"` |
| + } |
| + acctRows, chRows, repRows := []acctRow{}, []chRow{}, []repRow{} |
| for _, a := range accts { |
| row := acctRow{Account: a.Sqid} |
| m, err := release.ReadDigestMarker(ctx, s.cfg.Releases, s.cfg.ReleasePub, a.Sqid) |
| @@ -254,9 +265,15 @@ func (s *Server) handleAPISystemPointerDigests(w http.ResponseWriter, r *http.Re |
| case !st.HeadDigest: |
| chRows = append(chRows, chRow{Account: a.Sqid, App: app, Channel: st.Channel, Version: st.Version, Straggler: st.Straggler}) |
| } |
| + if st.Err == "" && st.RecordErr != "" && row.Error == "" { |
| + row.Error = st.RecordErr // unknown whether it needs a repair |
| + } |
| + if st.Err == "" && st.NeedsRepair() { |
| + repRows = append(repRows, repRow{Account: a.Sqid, App: app, Channel: st.Channel, Version: st.Version, Unbound: st.Unbound, NoRecord: st.NoRecord}) |
| + } |
| } |
| } |
| acctRows = append(acctRows, row) |
| } |
| - writeJSON(w, http.StatusOK, map[string]any{"accounts": acctRows, "channels": chRows}) |
| + writeJSON(w, http.StatusOK, map[string]any{"accounts": acctRows, "channels": chRows, "repairs": repRows}) |
| } |
diff --git a/internal/console/apidigests_test.go b/internal/console/apidigests_test.go| index e10872935..777ae95be 100644 |
| --- a/internal/console/apidigests_test.go |
| +++ b/internal/console/apidigests_test.go |
| @@ -2,6 +2,8 @@ package console |
| import ( |
| "context" |
| + "crypto/ed25519" |
| + "encoding/base64" |
| "encoding/json" |
| "fmt" |
| "net/http" |
| @@ -425,3 +427,61 @@ func (fx *digestsFixture) markerThenPromote(t *testing.T, v string) { |
| t.Fatalf("canary/x promoted to %s with the marker on carries no digest", v) |
| } |
| } |
| + |
| +// The account binding's rollout listing through the console (fix round 1): |
| +// with the marker OFF, the report's "repairs" names a digestless head whose |
| +// promotion record is gone (no_record) and an account-less head (unbound), |
| +// by account, app and channel; the account row carries no error for either. |
| +func TestSystemDigestsDoorListsRepairsWithTheMarkerOff(t *testing.T) { |
| + fx := newDigestsFixture(t) |
| + ctx := context.Background() |
| + if err := release.RemoveDigestMarker(ctx, fx.store, release.OpsAccount); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := fx.store.Delete(ctx, release.PromotionRecordKey(release.OpsAccount, "km", "v2")); err != nil { |
| + t.Fatal(err) |
| + } |
| + legacy := release.ChannelPointer{Schema: 1, App: "km", Channel: "canary/x", Version: "v1", PromotedAt: time.Date(2026, 6, 1, 0, 0, 0, 0, time.UTC)} |
| + payload, _ := json.MarshalIndent(legacy, "", " ") |
| + b64 := base64.StdEncoding.EncodeToString(payload) |
| + wire, _ := json.Marshal(map[string]string{"payload": b64, "sig": base64.StdEncoding.EncodeToString(ed25519.Sign(fx.priv, []byte(b64)))}) |
| + key := release.ChannelKey(release.OpsAccount, "km", "canary/x") |
| + _, etag, _ := fx.store.Get(ctx, key) |
| + if _, err := fx.store.Put(ctx, key, wire, etag); err != nil { |
| + t.Fatal(err) |
| + } |
| + st, out := getRaw(t, fx.ts.URL+"/api/cli/system/pointer-digests", fx.operator) |
| + if st != http.StatusOK { |
| + t.Fatalf("report: %d %s", st, out) |
| + } |
| + var rep struct { |
| + Accounts []struct{ Account, Error string } `json:"accounts"` |
| + Repairs []struct { |
| + Account, App, Channel, Version string |
| + Unbound bool `json:"unbound"` |
| + NoRecord bool `json:"no_record"` |
| + } `json:"repairs"` |
| + } |
| + if err := json.Unmarshal([]byte(out), &rep); err != nil { |
| + t.Fatalf("report body %s: %v", out, err) |
| + } |
| + got := map[string]string{} |
| + for _, r := range rep.Repairs { |
| + switch { |
| + case r.Unbound: |
| + got[r.Channel] = "unbound " + r.Version |
| + case r.NoRecord: |
| + got[r.Channel] = "no record " + r.Version |
| + } |
| + } |
| + // stable and beta both head v2, whose record is gone. |
| + want := map[string]string{"canary/x": "unbound v1", "stable": "no record v2", "beta": "no record v2"} |
| + if fmt.Sprint(got) != fmt.Sprint(want) { |
| + t.Fatalf("repairs = %v, want %v\n%s", got, want, out) |
| + } |
| + for _, a := range rep.Accounts { |
| + if a.Account == release.OpsAccount && a.Error != "" { |
| + t.Fatalf("bab's row reads unknown: %q", a.Error) |
| + } |
| + } |
| +} |
diff --git a/internal/release/digests.go b/internal/release/digests.go| index b9568a49f..4d5b6c2a5 100644 |
| --- a/internal/release/digests.go |
| +++ b/internal/release/digests.go |
| @@ -142,8 +142,25 @@ type ChannelDigestState struct { |
| HistoryMissing int `json:"history_missing"` |
| Straggler bool `json:"straggler"` |
| Err string `json:"error,omitempty"` |
| + // Unbound is a pointer signed before the account binding: it names no |
| + // account, and every box that acts on a pointer refuses it |
| + // (ErrPointerUnbound, hunt H3-M8). The line is still filled in from the |
| + // pointer, so the channel can be repaired by name. |
| + Unbound bool `json:"unbound,omitempty"` |
| + // NoRecord is a head that signs no digest and has no promotion record |
| + // with one: a fresh or replaced box refuses to stage it, since nothing |
| + // binds its bytes (stagePointerHead, hunt H3-M1). RecordErr is a record |
| + // that could not be read, so whether it binds is unknown. |
| + NoRecord bool `json:"no_record,omitempty"` |
| + RecordErr string `json:"record_error,omitempty"` |
| } |
| +// NeedsRepair reports whether a fresh or replaced box would refuse this |
| +// channel's head: an account-less pointer, or a digestless head with no |
| +// promotion record to bind it. The rollout of the account binding waits on |
| +// no channel needing one. |
| +func (st ChannelDigestState) NeedsRepair() bool { return st.Unbound || st.NoRecord } |
| + |
| // DigestStateOf is a verified pointer's line. A straggler is a pointer |
| // without digests signed after the marker went on: an old writer is still in |
| // use. |
| @@ -161,7 +178,11 @@ func DigestStateOf(p *ChannelPointer, marker *DigestMarker) ChannelDigestState { |
| // DigestReport is every channel of one app, plus the account's marker. A |
| // pointer that cannot be read or does not verify is never skipped: it comes |
| -// back as a line with Err set, its state unknown. |
| +// back as a line with Err set, its state unknown. It reports, with or |
| +// without the marker, the heads a fresh or replaced box would refuse |
| +// (NeedsRepair): an account-less pointer, and a digestless head with no |
| +// promotion record. The rollout of the account binding (hunt H3-M8) waits |
| +// on none being left. |
| func DigestReport(ctx context.Context, s Store, pub ed25519.PublicKey, acct, app string) ([]ChannelDigestState, *DigestMarker, error) { |
| marker, err := ReadDigestMarker(ctx, s, pub, acct) |
| if err != nil { |
| @@ -178,12 +199,33 @@ func DigestReport(ctx context.Context, s Store, pub ed25519.PublicKey, acct, app |
| if !ok || name == "" { |
| continue |
| } |
| - p, err := Channel(ctx, s, pub, acct, app, name) |
| + // Read as the write verbs read a head (verifyPredecessor): an |
| + // account-less pointer is a line to repair, not an unreadable one. |
| + raw, _, err := GetQualified(ctx, s, ChannelKey(acct, app, name)) |
| + var p *ChannelPointer |
| + if err == nil { |
| + p, err = verifyPredecessor(pub, raw, acct, app, name) |
| + } |
| if err != nil { |
| out = append(out, ChannelDigestState{Channel: name, Err: fmt.Sprintf("%s: %v", ChannelKey(acct, app, name), err)}) |
| continue |
| } |
| - out = append(out, DigestStateOf(p, marker)) |
| + st := DigestStateOf(p, marker) |
| + st.Unbound = p.Account == "" |
| + if !st.HeadDigest { |
| + // The record recordBinding would bind the head to: none, or |
| + // one without a digest, is a repair; one that cannot be read |
| + // is unknown (never read as "no record"). |
| + rec, recErr := ReadPromotionRecord(ctx, s, pub, acct, app, p.Version) |
| + switch { |
| + case recErr == nil && rec.ManifestDigest != "": |
| + case recErr == nil || errors.Is(recErr, ErrNoPromotionRecord): |
| + st.NoRecord = true |
| + default: |
| + st.RecordErr = fmt.Sprintf("%s: promotion record for %s: %v", ChannelKey(acct, app, name), p.Version, recErr) |
| + } |
| + } |
| + out = append(out, st) |
| } |
| return out, marker, nil |
| } |
diff --git a/internal/release/digests_test.go b/internal/release/digests_test.go| index 5b4ff2a80..bc4ec56cc 100644 |
| --- a/internal/release/digests_test.go |
| +++ b/internal/release/digests_test.go |
| @@ -3,9 +3,13 @@ package release |
| import ( |
| "bytes" |
| "context" |
| + "crypto/ed25519" |
| + "encoding/base64" |
| + "encoding/json" |
| "errors" |
| "strings" |
| "testing" |
| + "time" |
| ) |
| func TestManifestDigestIsTheStoredBytes(t *testing.T) { |
| @@ -103,3 +107,55 @@ func TestDigestReportMarksAChannelItCannotRead(t *testing.T) { |
| t.Fatalf("canary/x = %+v; want it read as carrying digests", c) |
| } |
| } |
| + |
| +// The account binding's rollout listing (fix round 1, Astra P1-6, Fable |
| +// P2-3/P2-4): with the digest marker OFF, DigestReport names every head a |
| +// fresh or replaced box would refuse. An account-less pointer is a line to |
| +// repair, filled in from the pointer, not an unreadable one; a digestless |
| +// head whose promotion record is gone is a line too; a recorded head is not. |
| +func TestDigestReportListsHeadsAFreshBoxWouldRefuse(t *testing.T) { |
| + ctx := context.Background() |
| + s := NewDirStore(t.TempDir()) |
| + priv, pub := testKeys(t) |
| + for _, v := range []string{"v1", "v2", "v3"} { |
| + shipRelease(t, s, "bab", "km", v, adoptPlatform, []byte(v)) |
| + } |
| + for ch, v := range map[string]string{"canary": "v1", "beta": "v2", "stable": "v3"} { |
| + if err := Promote(ctx, s, priv, "bab", "km", ch, v); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + // beta's head loses its record: promoted before records existed. |
| + if err := s.Delete(ctx, PromotionRecordKey("bab", "km", "v2")); err != nil { |
| + t.Fatal(err) |
| + } |
| + // canary is re-signed the pre-binding way: no account. |
| + legacy := ChannelPointer{Schema: 1, App: "km", Channel: "canary", Version: "v1", PromotedAt: time.Date(2026, 6, 1, 0, 0, 0, 0, time.UTC)} |
| + payload, _ := json.MarshalIndent(legacy, "", " ") |
| + b64 := base64.StdEncoding.EncodeToString(payload) |
| + wire, _ := json.MarshalIndent(signedWrapper{Payload: b64, Sig: base64.StdEncoding.EncodeToString(ed25519.Sign(priv, []byte(b64)))}, "", " ") |
| + _, etag, _ := s.Get(ctx, ChannelKey("bab", "km", "canary")) |
| + if _, err := s.Put(ctx, ChannelKey("bab", "km", "canary"), wire, etag); err != nil { |
| + t.Fatal(err) |
| + } |
| + if m, _ := ReadDigestMarker(ctx, s, pub, "bab"); m != nil { |
| + t.Fatal("setup: the marker is on") |
| + } |
| + rows, _, err := DigestReport(ctx, s, pub, "bab", "km") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + got := map[string]ChannelDigestState{} |
| + for _, r := range rows { |
| + got[r.Channel] = r |
| + } |
| + if c := got["canary"]; c.Err != "" || !c.Unbound || c.Version != "v1" || !c.NeedsRepair() { |
| + t.Errorf("account-less canary = %+v, want an unbound line naming v1", c) |
| + } |
| + if b := got["beta"]; b.Err != "" || !b.NoRecord || b.Unbound || !b.NeedsRepair() { |
| + t.Errorf("record-less beta = %+v, want a no-record line", b) |
| + } |
| + if st := got["stable"]; st.NeedsRepair() || st.Err != "" || st.RecordErr != "" { |
| + t.Errorf("recorded stable = %+v, want nothing to repair", st) |
| + } |
| +} |