Bryton GitHub issue

vibecode
{"vibecode": {
    "doc": "bryton",
    "role": "overview of Bryton, Puck's language-agnostic testing framework; introduces the runner, Xeme result format, and per-language helper libraries",
    "key_concepts": ["language_agnostic_runner", "xeme_results", "per_language_helpers",
        "first_contact_surface", "json_emitting_tests"]
}}

Bryton is a software testing framework. It's the primary testing tool for Caspian and is language-agnostic at the runner level — it can execute and aggregate tests written in any language that can emit JSON.

Bryton is also a first-contact surface for the Puck ecoverse: someone can write a useful Bryton test in any language without buying into anything else. A shell script that echos a JSON line is a complete, working Bryton test.


Architecture GitHub issue

Bryton consists of three cooperating parts:

Test scripts produce Xemes. The runner walks directory trees, runs scripts, and assembles their results. The Xeme format is the contract between them.


Core principles GitHub issue

Tests are runnable scripts GitHub issue

Every test file is an ordinary executable. You can run it directly at the CLI like any script — no special runner, no special tooling. The runner is for batch execution; it's not required for running one.

bash
./test_foo.casp            # works
bryton.casp ./test_foo.casp   # also works
bryton.casp path/to/dir    # runs everything in a directory

Test files don't need a library GitHub issue

A script that emits Xeme JSON to stdout IS a Bryton test. No imports, no boilerplate, no setup. This is the first-contact promise — the absolute minimum to participate in Bryton is one line of JSON output.

bash
#!/usr/bin/env bash
echo '{"success": true}'

Per-language libraries (when present) make scripts richer: assertion helpers, fail-fast support, personal config reading, human-readable output for direct invocations. All optional.

Tree-shaped results from tree-shaped tests GitHub issue

Tests live in a directory tree. Each file produces a Xeme; each directory produces a Xeme that contains its children's Xemes via nested. Failures propagate upward via the resolution rule; the runner walks the tree from the test-tree root (marked by bryton.root) outward.

The structure of the result tree mirrors the structure of the test tree. Run a single file → one Xeme. Run a directory → one Xeme with nested results. Same data shape, different scope.

Bottom-up scaling GitHub issue

The development workflow Bryton is designed for:

  1. Fix a specific bug; run the test for that bug.
  2. Once it passes, run the immediate directory of related tests.
  3. Once those pass, run the directory above.
  4. Continue until the whole tree passes.

Each step is just executing an existing file or directory at broader scope. No reconfiguration, no menu of test-runner incantations. The hierarchy of investigation matches the hierarchy of the filesystem.


Configuration GitHub issue

Three layers, in precedence order (lowest to highest):

  1. Factory defaults — built-in, {}.
  2. Personal config~/.config/bryton/config.json. The developer's preferences (fail_fast, trim, etc.) for direct invocations.
  3. bryton.json chain — per-directory configuration, shallow-merged through the test tree from root to leaf. The project's deliberate testing config.

The runner overlays these to produce the BRYTON env var that each test script reads. The runner ignores any shell-set BRYTON — the chain is built from scratch every run.

See runner.md § Official precedence for the full chain.


Priorities (from initial design discussion) GitHub issue


What ships in v1 GitHub issue

What's deferred to future versions:


Where to read more GitHub issue


© 2026 Puck.uno