{"record":{"id":"e08723cf40afc876","repo":"dagger/dagger","slug":"builtin-scalar-boolean-did-not-decode-to-typed-t","errorCode":null,"errorMessage":"builtin scalar Boolean did not decode to Typed: %T","messagePattern":"builtin scalar Boolean did not decode to Typed: %T","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dagql/cache_persistence_self.go","lineNumber":369,"sourceCode":"\t\treturn typed, nil\n\tcase \"Float\":\n\t\tinput, err := Float(0).DecodeInput(raw)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttyped, ok := input.(Typed)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"builtin scalar Float did not decode to Typed: %T\", input)\n\t\t}\n\t\treturn typed, nil\n\tcase \"Boolean\":\n\t\tinput, err := Boolean(false).DecodeInput(raw)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttyped, ok := input.(Typed)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"builtin scalar Boolean did not decode to Typed: %T\", input)\n\t\t}\n\t\treturn typed, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown scalar type %q and no dagql server in context\", typeName)\n\t}\n}\n\n// PersistedSnapshotRefLink is a generic non-opaque link from a persisted result\n// self payload to one durable snapshot ref key.\ntype PersistedSnapshotRefLink struct {\n\tRefKey string\n\tRole   string\n}\n\n// PersistedSnapshotRefLinkProvider is the shared interface used by persistable\n// self payloads to expose snapshot ref links for `result_snapshot_links`.\ntype PersistedSnapshotRefLinkProvider interface {\n\tPersistedSnapshotRefLinks() []PersistedSnapshotRefLink","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/dagql/cache_persistence_self.go#L351-L387","documentation":"Same invariant as the Float case: when decoding a persisted envelope's Boolean scalar without a dagql server, decodeBuiltinPersistedScalar requires Boolean(false).DecodeInput(raw) to return a Typed. If it does not, decoding aborts with this error because the value cannot be used as a dagql Typed value.","triggerScenarios":"decodePersistedResultEnvelope processes a scalar of type \"Boolean\"; the assertion `input.(Typed)` on the value returned by Boolean(false).DecodeInput(raw) fails.","commonSituations":"Decoding persisted results across library versions where Boolean was changed; custom Boolean implementations missing the Typed interface; tampered persisted envelopes.","solutions":["Use a matching library version for encode and decode of persisted envelopes","Restore the built-in Boolean implementation whose DecodeInput returns a Typed","Re-persist the result with the current version rather than decoding legacy files"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// sanity-check raw Boolean payload before decode\nif b, ok := raw.(bool); !ok {\n    return fmt.Errorf(\"Boolean scalar payload is %T, want bool\", raw)\n}","typeGuard":"func isTyped(v any) bool {\n    _, ok := v.(dagql.Typed)\n    return ok\n}","tryCatchPattern":"typed, err := decodeBuiltinPersistedScalar(\"Boolean\", raw)\nif err != nil {\n    if strings.Contains(err.Error(), \"did not decode to Typed\") {\n        return nil, fmt.Errorf(\"incompatible Boolean encoding: %w\", err)\n    }\n    return nil, err\n}","preventionTips":["Match library versions between writer and reader","Never hand-edit persisted envelopes","Regenerate envelopes rather than decoding legacy formats"],"tags":["go","scalar-decoding","type-assertion","persistence"],"backgroundTag":"scalar-did-not-decode-to-typed","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}