Harden Go SDK head store persistence

This commit is contained in:
Codex
2026-06-17 15:14:54 +02:00
parent b4f47fb17a
commit 76349a6b55
3 changed files with 87 additions and 14 deletions
+3 -2
View File
@@ -476,8 +476,9 @@ func (a *app) doctor(ctx context.Context, args []string) error {
}
headStore := attesto.NewFileHeadStore("")
headStore.Set("__doctor__", 1, strings.Repeat("0", 64))
if seq, hash, ok := headStore.Get("__doctor__"); ok && seq == 1 && hash == strings.Repeat("0", 64) {
if err := headStore.SetWithError("__doctor__", 1, strings.Repeat("0", 64)); err != nil {
fail("head_store", err)
} else if seq, hash, ok := headStore.Get("__doctor__"); ok && seq == 1 && hash == strings.Repeat("0", 64) {
pass("head_store", nil)
} else {
fail("head_store", errors.New("head store readback failed"))