{"title":
 "R3: Data: the type language closed under records and variants as Ty growth",
 "producer":
 ["GENERATED by tools/Drivers/Semantics.lean (make gen-semantics); do not edit",
  "format: effect4-semantics-report v8",
  "command: make gen-semantics",
  "inputs: tools/ProofGraph/Registry.lean, tools/Tools/Semantics.lean, tools/Drivers/Semantics.lean, tools/Tools/SemanticsDisplay.lean, tools/Tools/SemanticsDocument.lean, tools/Tools/Document.lean, tools/Tools/Document/Json.lean, src/Effect4/Laws/Auto/Semantics.lean, Test/Counterexamples/REGISTER.md, docs/core/decisions.md, lean-toolchain"],
 "format": "effect4-document/1",
 "body":
 [{"lines":
   [[{"text":
      "Open, not triaged: variants: the tag select over records landed (decisions row 195 (d)); catchTag's residual, the caught tag subtracted from the error column, waits on decisions row 130"}],
    [{"text":
      "Open, waits on a ruling (decisions row 124: recursive types as declarations of the application): recursive types are row 124 (open): nominal Σ_app declarations through Ty.app"}],
    [{"text":
      "Open, not triaged: error payloads: the carrier (decisions row 120, part E1) and the face (part E2: one Data.TaggedError class per tag, printed and read back) landed; open: catchTag's residual over records (decisions row 130), int and number fields (row 121; a number field is refused by name as unreadable), a field typed by another class (refused by name), a record update of a class instance (it answers a structural object), and a host row answering a payload (R6, parked)"}],
    [{"text":
      "Open, waits on a ruling (decisions row 108: the owner places the numbers slice; row 121 is ruled): int inhabited inside row 108's profile: ruled 2026-10-02 (decisions row 121); carried since decisions row 317, which removes the admission's int scan; the JSON wires since row 316; the computing rows (plus, minus, and lt and eq at int) since row 319; the Lean judgment and OCaml profile bound landed in row 321, and the TypeScript prelude refusal landed in row 322; the host truth record and comparison of an outside-profile result remain open (slice 7)"}],
    [{"text":
      "Open, not triaged: the Schema and JSON images of app, null, undefined, number and bytes: unlowered or refused by name (decisions rows 121, 158, 160, 161)"}],
    [{"text":
      "Open, after other work (a program that compares records (decisions row 126)): equality at records: eq stays refused at records until a program compares them (decisions row 126)"}]],
   "kind": "items"},
  {"title": "Requirement R3: First-order data types",
   "kind": "part",
   "key": "about:req:R3",
   "body":
   [{"line":
     [{"text":
       "This page explains requirement R3 in Effect4. It covers what the requirement asks for records and variants, why structured data types matter, and how the property is checked."}],
     "kind": "para"},
    {"title": "What the requirement asks",
     "kind": "part",
     "key": "about:req:R3:what-it-asks",
     "body":
     [{"line":
       [{"text": "Requirement R3 asks that the static type language "},
        {"code": "Ty"},
        {"text": " closes under structured first-order data types ("},
        {"code": "docs/core/system-map.md"},
        {"text": " §8, DB-15):"}],
       "kind": "para"},
      {"lines":
       [[{"text":
          "Records: represented by a single constructor over field lists sorted in canonical name order (decisions row 119)."}],
        [{"text":
          "Variants: tagged union representations with normalized membership (decisions row 130)."}],
        [{"text":
          "Maps and tuples: pointwise and key-indexed compound data structures."}]],
       "kind": "items"},
      {"line":
       [{"text": "Every added constructor must provide its "},
        {"code": "Fits"},
        {"text":
         " membership rule, exact codecs, catamorphic folds, assignability order, and inhabitance characterization."}],
       "kind": "para"}]},
    {"title": "Why it matters",
     "kind": "part",
     "key": "about:req:R3:why-it-matters",
     "body":
     [{"line":
       [{"text":
         "Application workflows manipulate rich domain models including structured records, optional attributes, error payloads, and payload classes."}],
       "kind": "para"},
      {"line":
       [{"text":
         "If the type system lacked direct representations for compound data, applications would need informal encodings that escape verification."}],
       "kind": "para"},
      {"line":
       [{"text": "Closing "},
        {"code": "Ty"},
        {"text":
         " under records and variants provides thorough end-to-end verification for realistic application data structures."}],
       "kind": "para"}]},
    {"title": "How it is checked",
     "kind": "part",
     "key": "about:req:R3:how-it-is-checked",
     "body":
     [{"line":
       [{"text":
         "The requirement is checked by proving algebra, membership, codec, and inhabitance theorems across all constructors:"}],
       "kind": "para"},
      {"lines":
       [[{"text": "Value membership under normalization is stated by "},
         {"code": "fits_normalize"},
         {"text": " and "},
         {"code": "fits_subN"},
         {"text": " ("},
         {"code": "src/Effect4/Laws/Program/Typed/Membership.lean"},
         {"text": ")."}],
        [{"text": "Semantic inhabitance equivalence is stated by "},
         {"code": "inhabited_iff_fits"},
         {"text": " in the same file."}],
        [{"text": "Exact serialization embeddings are stated by "},
         {"code": "decode_iff"},
         {"text": " ("},
         {"code": "src/Effect4/Laws/Schema/Codec.lean"},
         {"text": ") and "},
         {"code": "ofSchema_exact"},
         {"text": " ("},
         {"code": "src/Effect4/Schema/Bridge.lean"},
         {"text": ")."}],
        [{"text": "Error payload round-trip fidelity is stated by "},
         {"code": "errOf_valOfErr"},
         {"text": " ("},
         {"code": "src/Effect4/Laws/Program/Admit.lean"},
         {"text": ")."}]],
       "kind": "items"},
      {"line":
       [{"text":
         "The plan on this page gives each theorem's status and the goals it rests on."}],
       "kind": "para"}]}]},
  {"nodes":
   [{"status": "proved",
     "ref": "concept:residual-program-typing",
     "label": "Residual Program Typing",
     "key": "residual-program-typing",
     "detail": "2 nodes"},
    {"status": "proved",
     "label": "No concept",
     "key": "none",
     "detail": "7 nodes"},
    {"status": "proved",
     "ref": "concept:store-typing",
     "label": "Store Typing",
     "key": "store-typing",
     "detail": "5 nodes"},
    {"status": "proved",
     "ref": "concept:exact-codecs",
     "label": "Exact Codecs",
     "key": "exact-codecs",
     "detail": "6 nodes"},
    {"status": "proved",
     "ref": "concept:subtyping-algebra",
     "label": "Subtyping Algebra",
     "key": "subtyping-algebra",
     "detail": "2 nodes"}],
   "kind": "graph",
   "key": "fig:concepts:R3",
   "edges":
   [["store-typing", "subtyping-algebra"],
    ["store-typing", "none"],
    ["none", "exact-codecs"],
    ["exact-codecs", "none"],
    ["residual-program-typing", "none"],
    ["residual-program-typing", "exact-codecs"],
    ["residual-program-typing", "store-typing"],
    ["exact-codecs", "store-typing"]],
   "caption":
   "R3 by concept: each concept its nodes are placed at, by tag or by module. An arrow goes where a node's proof reaches a node of another concept."},
  {"rows":
   [[[{"code": "checkInput_eq_none_iff"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "fits_normalize"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "subN_trans"}, {"text": ", "}, {"code": "normalize_idem"}]],
    [[{"code": "fits_subN"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "subN_trans"}, {"text": ", "}, {"code": "fits_normalize"}]],
    [[{"code": "inhabited_iff_fits"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "subN_refl"}]],
    [[{"code": "hom_eq_cata_ty"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "decode_iff"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "ofSchema_exact"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "readTerm_printTerm"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "type_metadata_exact"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "errOf_valOfErr"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "errOf_payload"}]],
    [[{"code": "admitModule_classDecls"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "checkInput_eq_none_iff"}]],
    [[{"code": "errOf_ne_boom_of_supported"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "hom_eq_cata_ty"},
      {"text": ", "},
      {"code": "errOf_payload"},
      {"text": ", "},
      {"code": "isPayload_of_hasTy_record"}]],
    [[{"code": "errOf_payload"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "isPayload_of_hasTy_record"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "handles_of_payloadFieldTy"}]],
    [[{"code": "frame_laws"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "member"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "codec_roundtrip"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "decode_encode"},
      {"text": ", "},
      {"code": "member"},
      {"text": ", "},
      {"code": "hom_eq_cata_ty"},
      {"text": ", "},
      {"code": "normalize_idem"}]],
    [[{"code": "subN_trans"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "normalize_idem"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "subN_refl"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "handles_of_payloadFieldTy"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "decode_encode"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]]],
   "kind": "table",
   "headers": ["Node", "Status", "Rests on", "Nearest nodes"]}]}
