Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmux-tui/bindings/ERGONOMICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The seven public SDKs expose handwritten resource handles over the reviewed
125-operation `cmux.protocol/2` catalog. The raw protocol inventory is a
separate compatibility surface with 101 commands and 46 events. Deterministic
separate compatibility surface with 104 commands and 47 events. Deterministic
generation is limited to those private protocol-12 models under each package's
explicit `raw` namespace. Consumers do not run a generator or install a
generator runtime.
Expand Down Expand Up @@ -74,7 +74,9 @@ and secret redaction.
The exact-binary live matrix adds one isolated create, run, exit, restart, and
cleanup flow per language. TypeScript repeats it over authenticated WebSocket,
for eight live transport runs. The separate raw protocol-12 suite runs 266
compatibility checks over its 101 commands and 46 events.
compatibility checks across seven language adapters: 34 fake cases, one metadata
audit, and three live cases per language. Those checks cover the 104 generated
commands and 47 event shapes.

Each package suite also opens a stream with a short request deadline, leaves it
idle past that deadline, then delivers and cancels normally. This separates
Expand Down
46 changes: 46 additions & 0 deletions cmux-tui/bindings/conformance/raw/test_runner.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from __future__ import annotations

import json
import re
import socket
import unittest

from runner import (
BINDINGS,
FIXTURES,
LANGUAGES,
RAW_CATALOGS,
Expand Down Expand Up @@ -97,6 +99,50 @@ def test_live_lifecycle_covers_every_required_transition(self) -> None:
)
self.assertTrue(all(expected.values()))

def test_ergonomics_documents_current_inventory_and_matrix_count(self) -> None:
docs = (BINDINGS / "ERGONOMICS.md").read_text()
schema = json.loads((BINDINGS.parent / "spec" / "sdk-schema.json").read_text())
command_count = len(schema["commands"])
event_count = len(schema["events"])
fake_count = len(self.fixtures["fake_cases"])
real_count = len(self.fixtures["real_cases"])
check_count = len(LANGUAGES) * (fake_count + 1 + real_count)

inventory = re.search(
r"raw protocol inventory is a\s+separate compatibility surface with "
r"(?P<commands>\d+) commands and (?P<events>\d+) events\.",
docs,
)
self.assertIsNotNone(inventory)
assert inventory is not None
self.assertEqual(int(inventory.group("commands")), command_count)
self.assertEqual(int(inventory.group("events")), event_count)

go_readme = (BINDINGS / "go" / "raw" / "README.md").read_text()
go_inventory = re.search(
r"The Go SDK covers all (?P<commands>\d+) protocol-12 commands and "
r"(?P<events>\d+) event shapes",
go_readme,
)
self.assertIsNotNone(go_inventory)
assert go_inventory is not None
self.assertEqual(int(go_inventory.group("commands")), command_count)
self.assertEqual(int(go_inventory.group("events")), event_count)

matrix = re.search(
r"The separate raw protocol-12 suite runs\s+(?P<checks>\d+)\s+"
r"compatibility checks across seven language adapters:\s+"
r"(?P<fake>\d+) fake cases, one metadata\s+audit, and\s+"
r"(?P<real>three) live cases per language\.",
docs,
)
self.assertIsNotNone(matrix)
assert matrix is not None
self.assertEqual(int(matrix.group("checks")), check_count)
self.assertEqual(int(matrix.group("fake")), fake_count)
self.assertEqual(matrix.group("real"), "three")
self.assertEqual(real_count, 3)


class MatchingTests(unittest.TestCase):
def test_partial_match_allows_extra_fields_but_not_missing_fields(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion cmux-tui/bindings/go/raw/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cmux Go SDK

The Go SDK covers all 101 protocol-12 commands and 46 event shapes using only
The Go SDK covers all 104 protocol-12 commands and 47 event shapes using only
the Go standard library.

```go
Expand Down
Loading