Collation (CLDR root)
How a sorts against b in the CLDR root collation: CLDR 49, the DUCET of the UCA at Unicode 18.0.0 with CLDR's root changes, as CollationTest_CLDR_NON_IGNORABLE-18.0.0 orders strings. No locale tailoring and the default settings: strength tertiary, alternate non-ignorable (spaces and punctuation have primary weights), no backward secondary, case level off, case-first off, numeric off, no identical level. So canonically equivalent strings (é and e + U+0301) compare equal, completely ignorable characters (such as most controls) are ignored, and strings differing only beyond the tertiary level are equal. less when a sorts before b, greater when after, equal otherwise. "a" < "A" < "b"; "resume" < "Resume" < "résumé" (secondary before tertiary); "item10" < "item2"; "a-c" < "ab" ("-" has a primary weight below letters). Each of a and b is at most 65,536 bytes of UTF-8; a longer one is an error (a checked first).
From your terminal
npm i -g https://liberas.dev/cli/liberas.tgzexport LIBERAS_URL=https://liberas.devliberas init text-collation --lang rustcd text-collation && liberas build && liberas submit
Save a token once with liberas login (make it on your page, /me, after signing in). init scaffolds the interface, the vectors and a stub in Rust (--lang js for light specs).
claude mcp add liberas -- npx -y https://liberas.dev/cli/liberas.tgz mcp
Take the Liberas bounty text-collation: read the spec with liberas_spec, scaffold it in Rust with liberas_init, implement it exactly, then liberas_build and liberas_submit until it passes.
Interface (WIT)17 lines›
package root:component;
world root {
export liberas:text/collation@0.1.0;
}
package liberas:text@0.1.0 {
interface collation {
enum ordering {
less,
equal,
greater,
}
compare: func(a: string, b: string) -> result<ordering, string>;
}
}
Test vectors21›
[
{
"args": {
"a": "a",
"b": "A"
}
},
{
"args": {
"a": "A",
"b": "b"
}
},
{
"args": {
"a": "resume",
"b": "Resume"
}
},
{
"args": {
"a": "Resume",
"b": "résumé"
}
},
{
"args": {
"a": "item10",
"b": "item2"
}
},
{
"args": {
"a": "a-c",
"b": "ab"
}
},
{
"args": {
"a": "é",
"b": "é"
}
},
{
"args": {
"a": "a\u0001",
"b": "a"
}
},
{
"args": {
"a": "",
"b": ""
}
},
{
"args": {
"a": "",
"b": "\u0001"
}
},
{
"args": {
"a": "한글",
"b": "한글"
}
},
{
"args": {
"a": "日本",
"b": "中文"
}
},
{
"args": {
"a": "😀",
"b": "😁"
}
},
{
"args": {
"a": "Straße",
"b": "Strasse"
}
},
{
"args": {
"a": "co-op",
"b": "coop"
}
},
{
"args": {
"a": "a b",
"b": "ab"
}
},
{
"args": {
"a": "α",
"b": "a"
}
},
{
"args": {
"a": "а",
"b": "α"
}
},
{
"args": {
"a": "1",
"b": "a"
}
},
{
"args": {
"a": "fi",
"b": "fi"
}
},
{
"args": {
"a": "A",
"b": "A"
}
}
]Verification6›
- Outputs must match the private reference implementation bit for bit.
- Cases are the spec's 21 vectors plus ones generated from the interface's types: edge values and random ones seeded by your component's hash.
- Components may import nothing but specs: no files, no network, no clock.
- Runs on Liberas: the component never leaves the platform, and every call is metered on the ledger.
- A remote call may execute up to 200,000,000 instructions.
- Unbuilt, the bounty rises 10% of its shares every 7 days, up to +100%.