{
  "contractVersion": 1,
  "description": "Conformance corpus for Morphir IR v4 name canonicalization. Accompanies kb decisions 0001-0003 and docs/design/proposals/ir-v4-name-encoding.md. Generated by tools/gen-naming-corpus.ts; per decision 0003 it is intended to become a build output of the Morphir model of the naming codec.",
  "styles": [
    "uppercase",
    "doubledHyphen"
  ],
  "shippedStyle": "uppercase",
  "notes": [
    "legacyDecodeCases apply the rule from decision 0001: a maximal run of two or more single-letter words collapses into one initialism, and a run of one stays a word. That run-of-one rule is what makes a single-letter type variable decode as the word \"a\" rather than as an initialism.",
    "The legacy array [\"f\",\"r\",\"2052\",\"a\"] is inherently ambiguous, because the multi-character token 2052 breaks the letter run. The deterministic result recorded here renders identically to FR2052A in both PascalCase conventions but differs in snakeCase. Implementations must match the recorded value rather than guess.",
    "rejectCases record validity per style. An input legal under one style and not the other is the disjointness property that decision 0002 relies on for its union decoder.",
    "Path-length truncation from decision 0001 is not covered here, because it depends on a SHA-256 digest that the Morphir SDK cannot express. Those cases are host-verified."
  ],
  "patterns": {
    "name": {
      "uppercase": "^([a-z0-9]+|[A-Z0-9]+)(-([a-z0-9]+|[A-Z0-9]+))*$",
      "doubledHyphen": "^(--)?[a-z0-9]+(--?[a-z0-9]+)*$"
    },
    "fileStem": "^_?[a-z0-9]+(-_?[a-z0-9]+)*_?$"
  },
  "reservedDeviceStems": [
    "con",
    "prn",
    "aux",
    "nul",
    "com0",
    "com1",
    "com2",
    "com3",
    "com4",
    "com5",
    "com6",
    "com7",
    "com8",
    "com9",
    "lpt0",
    "lpt1",
    "lpt2",
    "lpt3",
    "lpt4",
    "lpt5",
    "lpt6",
    "lpt7",
    "lpt8",
    "lpt9"
  ],
  "roundTripCases": [
    {
      "name": "plain two-word name",
      "segments": [
        {
          "kind": "word",
          "text": "user"
        },
        {
          "kind": "word",
          "text": "account"
        }
      ],
      "canonical": {
        "uppercase": "user-account",
        "doubledHyphen": "user-account"
      },
      "escapedStem": "user-account",
      "rendered": {
        "camelCase": "userAccount",
        "pascalCaseUpperInitialism": "UserAccount",
        "pascalCasePascalInitialism": "UserAccount",
        "snakeCase": "user_account",
        "kebabCase": "user-account",
        "screamingSnakeCase": "USER_ACCOUNT"
      },
      "legacyArray": [
        "user",
        "account"
      ]
    },
    {
      "name": "trailing initialism",
      "segments": [
        {
          "kind": "word",
          "text": "value"
        },
        {
          "kind": "word",
          "text": "in"
        },
        {
          "kind": "initialism",
          "text": "usd"
        }
      ],
      "canonical": {
        "uppercase": "value-in-USD",
        "doubledHyphen": "value-in--usd"
      },
      "escapedStem": "value-in-_usd",
      "rendered": {
        "camelCase": "valueInUSD",
        "pascalCaseUpperInitialism": "ValueInUSD",
        "pascalCasePascalInitialism": "ValueInUsd",
        "snakeCase": "value_in_usd",
        "kebabCase": "value-in-usd",
        "screamingSnakeCase": "VALUE_IN_USD"
      },
      "legacyArray": [
        "value",
        "in",
        "u",
        "s",
        "d"
      ]
    },
    {
      "name": "word that looks like an initialism",
      "segments": [
        {
          "kind": "word",
          "text": "in"
        },
        {
          "kind": "word",
          "text": "usd"
        }
      ],
      "canonical": {
        "uppercase": "in-usd",
        "doubledHyphen": "in-usd"
      },
      "escapedStem": "in-usd",
      "rendered": {
        "camelCase": "inUsd",
        "pascalCaseUpperInitialism": "InUsd",
        "pascalCasePascalInitialism": "InUsd",
        "snakeCase": "in_usd",
        "kebabCase": "in-usd",
        "screamingSnakeCase": "IN_USD"
      },
      "legacyArray": [
        "in",
        "usd"
      ]
    },
    {
      "name": "initialism at end",
      "segments": [
        {
          "kind": "word",
          "text": "get"
        },
        {
          "kind": "initialism",
          "text": "html"
        }
      ],
      "canonical": {
        "uppercase": "get-HTML",
        "doubledHyphen": "get--html"
      },
      "escapedStem": "get-_html",
      "rendered": {
        "camelCase": "getHTML",
        "pascalCaseUpperInitialism": "GetHTML",
        "pascalCasePascalInitialism": "GetHtml",
        "snakeCase": "get_html",
        "kebabCase": "get-html",
        "screamingSnakeCase": "GET_HTML"
      },
      "legacyArray": [
        "get",
        "h",
        "t",
        "m",
        "l"
      ]
    },
    {
      "name": "initialism in the middle",
      "segments": [
        {
          "kind": "word",
          "text": "my"
        },
        {
          "kind": "initialism",
          "text": "api"
        },
        {
          "kind": "word",
          "text": "client"
        }
      ],
      "canonical": {
        "uppercase": "my-API-client",
        "doubledHyphen": "my--api-client"
      },
      "escapedStem": "my-_api-client",
      "rendered": {
        "camelCase": "myAPIClient",
        "pascalCaseUpperInitialism": "MyAPIClient",
        "pascalCasePascalInitialism": "MyApiClient",
        "snakeCase": "my_api_client",
        "kebabCase": "my-api-client",
        "screamingSnakeCase": "MY_API_CLIENT"
      },
      "legacyArray": [
        "my",
        "a",
        "p",
        "i",
        "client"
      ]
    },
    {
      "name": "two-letter initialism",
      "segments": [
        {
          "kind": "word",
          "text": "user"
        },
        {
          "kind": "initialism",
          "text": "id"
        }
      ],
      "canonical": {
        "uppercase": "user-ID",
        "doubledHyphen": "user--id"
      },
      "escapedStem": "user-_id",
      "rendered": {
        "camelCase": "userID",
        "pascalCaseUpperInitialism": "UserID",
        "pascalCasePascalInitialism": "UserId",
        "snakeCase": "user_id",
        "kebabCase": "user-id",
        "screamingSnakeCase": "USER_ID"
      },
      "legacyArray": [
        "user",
        "i",
        "d"
      ]
    },
    {
      "name": "leading initialism",
      "segments": [
        {
          "kind": "initialism",
          "text": "io"
        },
        {
          "kind": "word",
          "text": "error"
        }
      ],
      "canonical": {
        "uppercase": "IO-error",
        "doubledHyphen": "--io-error"
      },
      "escapedStem": "_io-error",
      "rendered": {
        "camelCase": "ioError",
        "pascalCaseUpperInitialism": "IOError",
        "pascalCasePascalInitialism": "IoError",
        "snakeCase": "io_error",
        "kebabCase": "io-error",
        "screamingSnakeCase": "IO_ERROR"
      },
      "legacyArray": [
        "i",
        "o",
        "error"
      ]
    },
    {
      "name": "leading initialism, four letters",
      "segments": [
        {
          "kind": "initialism",
          "text": "html"
        },
        {
          "kind": "word",
          "text": "parser"
        }
      ],
      "canonical": {
        "uppercase": "HTML-parser",
        "doubledHyphen": "--html-parser"
      },
      "escapedStem": "_html-parser",
      "rendered": {
        "camelCase": "htmlParser",
        "pascalCaseUpperInitialism": "HTMLParser",
        "pascalCasePascalInitialism": "HtmlParser",
        "snakeCase": "html_parser",
        "kebabCase": "html-parser",
        "screamingSnakeCase": "HTML_PARSER"
      },
      "legacyArray": [
        "h",
        "t",
        "m",
        "l",
        "parser"
      ]
    },
    {
      "name": "single-letter word is a type variable",
      "segments": [
        {
          "kind": "word",
          "text": "a"
        }
      ],
      "canonical": {
        "uppercase": "a",
        "doubledHyphen": "a"
      },
      "escapedStem": "a",
      "rendered": {
        "camelCase": "a",
        "pascalCaseUpperInitialism": "A",
        "pascalCasePascalInitialism": "A",
        "snakeCase": "a",
        "kebabCase": "a",
        "screamingSnakeCase": "A"
      },
      "legacyArray": [
        "a"
      ]
    },
    {
      "name": "single-letter word after a word",
      "segments": [
        {
          "kind": "word",
          "text": "max"
        },
        {
          "kind": "word",
          "text": "n"
        }
      ],
      "canonical": {
        "uppercase": "max-n",
        "doubledHyphen": "max-n"
      },
      "escapedStem": "max-n",
      "rendered": {
        "camelCase": "maxN",
        "pascalCaseUpperInitialism": "MaxN",
        "pascalCasePascalInitialism": "MaxN",
        "snakeCase": "max_n",
        "kebabCase": "max-n",
        "screamingSnakeCase": "MAX_N"
      },
      "legacyArray": [
        "max",
        "n"
      ]
    },
    {
      "name": "digits-only segment is a word",
      "segments": [
        {
          "kind": "word",
          "text": "2052"
        }
      ],
      "canonical": {
        "uppercase": "2052",
        "doubledHyphen": "2052"
      },
      "escapedStem": "2052",
      "rendered": {
        "camelCase": "2052",
        "pascalCaseUpperInitialism": "2052",
        "pascalCasePascalInitialism": "2052",
        "snakeCase": "2052",
        "kebabCase": "2052",
        "screamingSnakeCase": "2052"
      },
      "legacyArray": [
        "2052"
      ]
    },
    {
      "name": "initialism containing digits",
      "segments": [
        {
          "kind": "initialism",
          "text": "fr2052a"
        }
      ],
      "canonical": {
        "uppercase": "FR2052A",
        "doubledHyphen": "--fr2052a"
      },
      "escapedStem": "_fr2052a",
      "rendered": {
        "camelCase": "fr2052a",
        "pascalCaseUpperInitialism": "FR2052A",
        "pascalCasePascalInitialism": "Fr2052a",
        "snakeCase": "fr2052a",
        "kebabCase": "fr2052a",
        "screamingSnakeCase": "FR2052A"
      }
    },
    {
      "name": "multi-segment name with an initialism",
      "segments": [
        {
          "kind": "word",
          "text": "data"
        },
        {
          "kind": "initialism",
          "text": "id"
        },
        {
          "kind": "word",
          "text": "tables"
        }
      ],
      "canonical": {
        "uppercase": "data-ID-tables",
        "doubledHyphen": "data--id-tables"
      },
      "escapedStem": "data-_id-tables",
      "rendered": {
        "camelCase": "dataIDTables",
        "pascalCaseUpperInitialism": "DataIDTables",
        "pascalCasePascalInitialism": "DataIdTables",
        "snakeCase": "data_id_tables",
        "kebabCase": "data-id-tables",
        "screamingSnakeCase": "DATA_ID_TABLES"
      },
      "legacyArray": [
        "data",
        "i",
        "d",
        "tables"
      ]
    },
    {
      "name": "windows reserved device name",
      "segments": [
        {
          "kind": "word",
          "text": "aux"
        }
      ],
      "canonical": {
        "uppercase": "aux",
        "doubledHyphen": "aux"
      },
      "escapedStem": "aux_",
      "rendered": {
        "camelCase": "aux",
        "pascalCaseUpperInitialism": "Aux",
        "pascalCasePascalInitialism": "Aux",
        "snakeCase": "aux",
        "kebabCase": "aux",
        "screamingSnakeCase": "AUX"
      },
      "legacyArray": [
        "aux"
      ]
    },
    {
      "name": "windows reserved name as initialism",
      "segments": [
        {
          "kind": "initialism",
          "text": "con"
        }
      ],
      "canonical": {
        "uppercase": "CON",
        "doubledHyphen": "--con"
      },
      "escapedStem": "_con",
      "rendered": {
        "camelCase": "con",
        "pascalCaseUpperInitialism": "CON",
        "pascalCasePascalInitialism": "Con",
        "snakeCase": "con",
        "kebabCase": "con",
        "screamingSnakeCase": "CON"
      },
      "legacyArray": [
        "c",
        "o",
        "n"
      ]
    },
    {
      "name": "reserved word is safe when not the whole stem",
      "segments": [
        {
          "kind": "word",
          "text": "nul"
        },
        {
          "kind": "word",
          "text": "pointer"
        }
      ],
      "canonical": {
        "uppercase": "nul-pointer",
        "doubledHyphen": "nul-pointer"
      },
      "escapedStem": "nul-pointer",
      "rendered": {
        "camelCase": "nulPointer",
        "pascalCaseUpperInitialism": "NulPointer",
        "pascalCasePascalInitialism": "NulPointer",
        "snakeCase": "nul_pointer",
        "kebabCase": "nul-pointer",
        "screamingSnakeCase": "NUL_POINTER"
      },
      "legacyArray": [
        "nul",
        "pointer"
      ]
    },
    {
      "name": "reserved device name with digit",
      "segments": [
        {
          "kind": "word",
          "text": "com1"
        }
      ],
      "canonical": {
        "uppercase": "com1",
        "doubledHyphen": "com1"
      },
      "escapedStem": "com1_",
      "rendered": {
        "camelCase": "com1",
        "pascalCaseUpperInitialism": "Com1",
        "pascalCasePascalInitialism": "Com1",
        "snakeCase": "com1",
        "kebabCase": "com1",
        "screamingSnakeCase": "COM1"
      },
      "legacyArray": [
        "com1"
      ]
    }
  ],
  "legacyDecodeCases": [
    {
      "legacyArray": [
        "value",
        "in",
        "u",
        "s",
        "d"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "value"
        },
        {
          "kind": "word",
          "text": "in"
        },
        {
          "kind": "initialism",
          "text": "usd"
        }
      ],
      "canonical": {
        "uppercase": "value-in-USD",
        "doubledHyphen": "value-in--usd"
      }
    },
    {
      "legacyArray": [
        "a"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "a"
        }
      ],
      "canonical": {
        "uppercase": "a",
        "doubledHyphen": "a"
      }
    },
    {
      "legacyArray": [
        "morphir",
        "s",
        "d",
        "k"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "morphir"
        },
        {
          "kind": "initialism",
          "text": "sdk"
        }
      ],
      "canonical": {
        "uppercase": "morphir-SDK",
        "doubledHyphen": "morphir--sdk"
      }
    },
    {
      "legacyArray": [
        "point",
        "x",
        "y"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "point"
        },
        {
          "kind": "initialism",
          "text": "xy"
        }
      ],
      "canonical": {
        "uppercase": "point-XY",
        "doubledHyphen": "point--xy"
      }
    },
    {
      "legacyArray": [
        "max",
        "n"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "max"
        },
        {
          "kind": "word",
          "text": "n"
        }
      ],
      "canonical": {
        "uppercase": "max-n",
        "doubledHyphen": "max-n"
      }
    },
    {
      "legacyArray": [
        "get",
        "h",
        "t",
        "m",
        "l"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "get"
        },
        {
          "kind": "initialism",
          "text": "html"
        }
      ],
      "canonical": {
        "uppercase": "get-HTML",
        "doubledHyphen": "get--html"
      }
    },
    {
      "legacyArray": [
        "u",
        "s"
      ],
      "segments": [
        {
          "kind": "initialism",
          "text": "us"
        }
      ],
      "canonical": {
        "uppercase": "US",
        "doubledHyphen": "--us"
      }
    },
    {
      "legacyArray": [
        "f",
        "r",
        "2052",
        "a"
      ],
      "segments": [
        {
          "kind": "initialism",
          "text": "fr"
        },
        {
          "kind": "word",
          "text": "2052"
        },
        {
          "kind": "word",
          "text": "a"
        }
      ],
      "canonical": {
        "uppercase": "FR-2052-a",
        "doubledHyphen": "--fr-2052-a"
      }
    },
    {
      "legacyArray": [
        "1",
        "2"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "1"
        },
        {
          "kind": "word",
          "text": "2"
        }
      ],
      "canonical": {
        "uppercase": "1-2",
        "doubledHyphen": "1-2"
      }
    },
    {
      "legacyArray": [
        "u",
        "1"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "u"
        },
        {
          "kind": "word",
          "text": "1"
        }
      ],
      "canonical": {
        "uppercase": "u-1",
        "doubledHyphen": "u-1"
      }
    },
    {
      "legacyArray": [
        "v",
        "2",
        "api"
      ],
      "segments": [
        {
          "kind": "word",
          "text": "v"
        },
        {
          "kind": "word",
          "text": "2"
        },
        {
          "kind": "word",
          "text": "api"
        }
      ],
      "canonical": {
        "uppercase": "v-2-api",
        "doubledHyphen": "v-2-api"
      }
    }
  ],
  "rejectCases": [
    {
      "input": "Usd",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "value-in-(usd)",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "user_id",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "-user",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "user-",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "value-in--usd",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": true
      }
    },
    {
      "input": "value-in-USD",
      "validAs": {
        "uppercase": true,
        "doubledHyphen": false
      }
    },
    {
      "input": "user--id",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": true
      }
    },
    {
      "input": "morphir/SDK",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "user---id",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "--",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    },
    {
      "input": "USD-usd",
      "validAs": {
        "uppercase": true,
        "doubledHyphen": false
      }
    },
    {
      "input": "MyName",
      "validAs": {
        "uppercase": false,
        "doubledHyphen": false
      }
    }
  ],
  "pathCases": [
    {
      "canonical": {
        "uppercase": "morphir/SDK",
        "doubledHyphen": "morphir/--sdk"
      },
      "escapedPath": "morphir/_sdk"
    },
    {
      "canonical": {
        "uppercase": "US/FR2052A/data-tables",
        "doubledHyphen": "--us/--fr2052a/data-tables"
      },
      "escapedPath": "_us/_fr2052a/data-tables"
    },
    {
      "canonical": {
        "uppercase": "my-org/domain/users",
        "doubledHyphen": "my-org/domain/users"
      },
      "escapedPath": "my-org/domain/users"
    }
  ],
  "fqNameCases": [
    {
      "canonical": {
        "uppercase": "morphir/SDK:list#map",
        "doubledHyphen": "morphir/--sdk:list#map"
      },
      "documentTreePath": "pkg/morphir/_sdk/list/map.value.json"
    },
    {
      "canonical": {
        "uppercase": "my-org:domain#value-in-USD",
        "doubledHyphen": "my-org:domain#value-in--usd"
      },
      "documentTreePath": "pkg/my-org/domain/value-in-_usd.value.json"
    }
  ]
}
