Report Viewer
Stellar Protocol Canary report viewer
Open a stellar-canary JSON report. It is read in this browser tab and is not uploaded anywhere.
<div id="drop" class="drop">
<label for="file">Choose a report file, or drop it here</label>
<input id="file" type="file" accept=".json,application/json">
</div>
<div id="inventory-drop" class="drop drop-optional">
<label for="inventory-file">Fixture inventory, optional: the output of <code>stellar-canary fixtures --format json</code></label>
<input id="inventory-file" type="file" accept=".json,application/json">
<p id="inventory-status" aria-live="polite"></p>
</div>
<section id="result" hidden>
<div id="protocol-mismatch" class="mismatch-banner" role="alert" hidden></div>
<div id="schema-version-warning" class="schema-warning-banner" role="alert" hidden></div>
<h2 id="heading"></h2>
<p id="status-line" aria-live="polite"></p>
<p id="invalid-reason" hidden></p>
<button id="open-source" type="button" hidden>View report JSON</button>
<ul id="warnings" hidden></ul>
<dl id="facts" hidden></dl>
<div id="findings" hidden>
<h3 id="findings-heading">Findings</h3>
<p class="hint">Select a fixture id to open its detail dialog: verification record, fixture SHA-256, pack digest and protocol.</p>
<div class="controls">
<div id="tabs" class="tabs" role="tablist" aria-label="Filter findings by surface">
<button id="tab-all" type="button" role="tab" aria-selected="true" tabindex="0" aria-controls="panel-findings" data-surface="all">All</button>
<button id="tab-rpc" type="button" role="tab" aria-selected="false" tabindex="-1" aria-controls="panel-findings" data-surface="rpc">RPC</button>
<button id="tab-xdr" type="button" role="tab" aria-selected="false" tabindex="-1" aria-controls="panel-findings" data-surface="xdr">XDR</button>
<button id="tab-soroban" type="button" role="tab" aria-selected="false" tabindex="-1" aria-controls="panel-findings" data-surface="soroban">Soroban</button>
</div>
<div class="search">
<label for="search">Search findings</label>
<input id="search" type="search" placeholder="Fixture id or summary" aria-controls="panel-findings">
</div>
</div>
<p id="search-status" aria-live="polite"></p>
<div id="panel-findings" role="tabpanel" aria-labelledby="tab-all">
<section id="group-ready" class="readiness" hidden>
<h4 id="ready-heading" class="readiness-heading">Ready</h4>
<ul id="ready-list"></ul>
</section>
<section id="group-attention" class="readiness" hidden>
<h4 id="attention-heading" class="readiness-heading">Attention Required</h4>
<ul id="attention-list"></ul>
</section>
<section id="group-incomplete" class="readiness" hidden>
<h4 id="incomplete-heading" class="readiness-heading">Incomplete</h4>
<ul id="incomplete-list"></ul>
</section>
<p id="findings-empty" hidden></p>
</div>
</div>
<div id="skipped-section" hidden>
<h3 id="skipped-heading">Skipped fixtures</h3>
<ul id="skipped-list"></ul>
</div>
</section>
<section id="compare">
<h2>Compare two reports</h2>
<p>
Load a baseline (earlier run) and a current (later run) report. The check-by-check
outcome table uses the same transition table as the engine. Both files are read in
this browser tab and are not uploaded anywhere.
</p>
<div id="compare-decision" class="compare-picks">
<div id="baseline-drop" class="drop">
<label for="baseline-file">Baseline report (earlier run), or drop it here</label>
<input id="baseline-file" type="file" accept=".json,application/json">
</div>
<div id="current-drop" class="drop">
<label for="current-file">Current report (later run), or drop it here</label>
<input id="current-file" type="file" accept=".json,application/json">
</div>
</div>
<p id="compare-status" hidden></p>
</section>
<section id="compare-result" hidden aria-live="polite">
<div id="compare-ineligible" class="mismatch-banner" role="alert" hidden></div>
<h3 id="compare-verdict" hidden></h3>
<p id="compare-summary"></p>
<table id="compare-table" hidden>
<caption>Check-by-check comparison</caption>
<thead>
<tr>
<th scope="col">Surface</th>
<th scope="col">Check</th>
<th scope="col">Baseline</th>
<th scope="col">Current</th>
<th scope="col">Outcome</th>
</tr>
</thead>
<tbody id="compare-body"></tbody>
</table>
</section>
<aside>
<h2>Before you share a report</h2>
<p>A report can contain the project directory name and the Git branch name. Check it before posting it publicly. This page has no upload feature; the copy control in the fixture detail dialog puts one value on your clipboard and sends nothing.</p>
</aside>
Protocol Canary
Protocol Canary is a command-line tool that checks whether a Stellar application or piece of infrastructure remains compatible with a target Stellar protocol version. It runs a set of explicit, declared compatibility assertions (“fixtures”) against three surfaces a Stellar project typically depends on: XDR encoding/decoding, Stellar RPC responses, and Soroban transaction simulation.
It is developer infrastructure — a CLI and a GitHub Action, not a frontend application, not a smart contract, not a wallet, and not a hosted service. It does not certify that an arbitrary application is completely compatible with a Stellar protocol version; it reports whether the compatibility assertions currently implemented in its fixture packs pass against your configured dependencies and RPC endpoint.
What it checks
| Surface | What it verifies |
|---|---|
| XDR | Decode, encode, and round-trip fixtures against the official stellar-xdr crate. Runs fully offline — no network call. |
| RPC | getNetwork/getLatestLedger response-shape and protocol-identity assertions against a configured Stellar RPC endpoint. |
| Soroban | Unsigned transaction construction and simulateTransaction behavior. Never submits a transaction and never requires a private key. |
Who this is for
- New to Protocol Canary? Start with What Problem Does It Solve? and How It Works.
- Evaluating Protocol 28 compatibility? Go straight to Protocol 28.
- Wiring this into CI? See the GitHub Action guide.
- Adding a compatibility fixture or engine check? See Fixtures and Authoring a Fixture.
- Reviewing this project? Architecture, Security, and Limitations are the three pages written specifically for that.
Quick example
cargo install --git https://github.com/StellarCanary/Protocol-Canary --tag v0.3.0 --locked
stellar-canary check --fixtures-dir <checkout-of-ProtocolCanary-Fixtures>/protocol-28 --protocol 28
Stellar Protocol Canary
────────────────────────────────────────
Project: Protocol-Canary (unknown)
Target protocol: 28
Network: testnet (observed protocol 28)
XDR
3/3 PASS
RPC
1/1 PASS
Soroban
1/1 PASS
────────────────────────────────────────
5/5 applicable checks passed.
Status: PASS
This is a real run’s output (not illustrative text) — see Your First Check to reproduce it yourself.
Current support
| CLI release | Protocol-Canary v0.3.0 |
| GitHub Action | ProtocolCanary-Action v1 (currently resolves to v0.1.1) |
| Fixture pack | ProtocolCanary-Fixtures protocol-28/ — 5 currently implemented checks |
| Protocol coverage | Protocol 28 only. CAP-0086 is a documented gap, not silently skipped. |
Ecosystem
Three repositories make up Protocol Canary:
| Repository | Purpose |
|---|---|
StellarCanary/Protocol-Canary | The compatibility engine — the stellar-canary CLI. |
StellarCanary/ProtocolCanary-Fixtures | Canonical, versioned compatibility fixtures (declarative TOML data, no executable code). |
StellarCanary/ProtocolCanary-Action | The GitHub Actions integration that installs a pinned CLI release and turns its report into a job summary, annotations, and an artifact. |
See Architecture for how they fit together, CLI Reference for every command, and Contributing to work on any of the three.
What Problem Does It Solve?
Think of Protocol Canary as an early-warning system: like the caged birds once carried into mines to detect dangerous gas before it reached the miners, it is meant to detect a compatibility problem before it reaches production — not to guarantee that no problem exists.
The real problem
Stellar protocols evolve. A protocol upgrade can add new XDR types (for
example, Protocol 28’s CAP-0083 StellarValue case), change RPC
response shapes, or add new Soroban host behavior. Applications and
infrastructure depend on the current shape of all three surfaces, often
implicitly — a hand-written XDR decoder, an assumption about an RPC
field, a Soroban call that happens to work today.
Normal unit tests primarily exercise application code against mocked or assumed protocol behavior. They do not, by themselves, test the boundary between that application code and the real, current behavior of the Stellar network and its official libraries. That boundary is exactly what changes when a protocol upgrades.
What Protocol Canary does about it
It makes that compatibility boundary explicit and repeatable:
- Explicit, because every check is a declared fixture — a specific XDR value, RPC assertion, or Soroban call, with a source reference (a CAP number or official spec) — not an implicit assumption baked into application code.
- Repeatable, because the same fixture pack and the same CLI produce the
same result locally and in CI, against the real
stellar-xdrcrate and a real RPC endpoint, rather than a mock.
What it does not claim
- It does not claim that every protocol change causes breakage — most fixtures simply keep passing.
- It does not prove an arbitrary application is compatible with a protocol version in any general sense. A passing run means the fixtures that are currently implemented for the target protocol passed against your configured dependencies and RPC endpoint — see Limitations.
- It does not replace testing against a real testnet or mainnet deployment.
How It Works
A single stellar-canary check run goes through the same pipeline whether
it runs on a developer’s machine or inside a GitHub Actions job:
- Configuration —
.stellar-canary.toml(or CLI flags, which take precedence) determines the target protocol, network, RPC endpoint, and which surfaces (xdr/rpc/soroban) are enabled. - Project detection — the CLI inspects the current directory and
classifies it as
soroban,rpc-consumer,stellar-sdk,generic-stellar, orunknown. This determines which fixtures’required_capabilitiesare satisfied. - Fixture loading — every
.tomlfile under--fixtures-diris loaded recursively and validated as a whole set: unique IDs, resolvable file references, schema conformance. A structurally invalid fixture fails the whole load (exit code4) — it is never silently skipped. - Planning — fixtures are filtered to the ones whose declared
protocolmatches the run’s target and whoserequired_capabilitiesthe detected project satisfies. Everything else is recorded as skipped, with a stated reason, never silently dropped and never counted as failed. - Execution — each planned fixture runs through the surface crate
that understands its
surfacefield:xdr— decodes/encodes against the officialstellar-xdrcrate. Offline, no network call.rpc— makes a live call (getNetwork,getLatestLedger) against the configured RPC endpoint and checks the declared assertions.soroban— builds an unsigned transaction and callssimulateTransaction. It never signs, never requires a private key, and never submits a transaction to any network.
- Policy evaluation — the set of per-fixture results is reduced to
one overall
status:pass,warning,fail, orerror.error(an execution problem, such as an unreachable RPC endpoint) takes precedence over what the pass/fail counts alone would suggest, and maps to its own exit code. - Reporting — the same result set renders as terminal output
(default),
--format json, or--format markdown.
Developer / CI
│
▼
.stellar-canary.toml + CLI flags
│
▼
project detection ──► fixture loading & validation
│ │
│ ▼
│ planner (protocol + capability match)
│ │
│ ┌────────────┼────────────┐
│ ▼ ▼ ▼
│ XDR RPC Soroban
│ (offline) (live, read) (live, simulate-only)
│ └────────────┼────────────┘
│ ▼
│ policy evaluation (status + exit code)
│ │
▼ ▼
terminal / JSON / markdown report
Only the XDR surface is offline. A run with rpc or soroban enabled in
.stellar-canary.toml (the default, and the case for the protocol-28
pack) genuinely requires network access to the configured --rpc-url — a
failure to reach it is reported as an execution error
(exit code 3), not silently skipped. See
Architecture for the full component breakdown and
Troubleshooting for how to
tell an RPC outage apart from a real compatibility failure.
Architecture
This page summarizes the verified architecture. The full, exhaustive
version — environment variables, external-dependency tables, and the
complete failure-boundary matrix — lives in
Protocol-Canary’s docs/architecture.md
and is authoritative; this page reproduces its key diagrams rather than
duplicating it in full, per this site’s own
documentation change discipline.
Component responsibilities
| Repository | Responsibility |
|---|---|
Protocol-Canary | The compatibility engine: the stellar-canary CLI, project detection, fixture loading/validation, the XDR/RPC/Soroban runners, policy evaluation, and terminal/JSON/Markdown reporting. |
ProtocolCanary-Fixtures | Canonical, versioned compatibility assertions (“fixtures”) for each protocol version. Declarative TOML data only — no business logic, no executable code. |
ProtocolCanary-Action | GitHub Actions integration. A thin wrapper that installs a pinned Protocol-Canary release, runs it, and turns its JSON report into a job summary, annotations, and an artifact. |
Protocol-Canary depends on nothing outside itself to run. ProtocolCanary-Action
depends on a released Protocol-Canary version and, in practice, a
ProtocolCanary-Fixtures checkout. Neither Protocol-Canary nor
ProtocolCanary-Fixtures depends on the Action — both work standalone
from the command line.
Execution topology
Protocol Canary runs in exactly two places, plus one external network it talks to. There is no hosted backend and no database.
LOCAL (developer machine) EXTERNAL (public network)
-------------------------- --------------------------
Developer
│
▼
stellar-canary check -------------------> Stellar RPC (Testnet by default)
│ │ │ getNetwork
│ `---------------------------> ` simulateTransaction
│ (read-only / simulation-only,
▼ no submission, no key)
fixture directory
(local path, or a
ProtocolCanary-Fixtures checkout)
│
▼
report (terminal / JSON / Markdown)
CI (GitHub-hosted, ephemeral per run)
--------------------------------------
Developer's repository
│
▼
GitHub Actions workflow
│
▼
StellarCanary/ProtocolCanary-Action@v1
│
▼
cargo install --git Protocol-Canary -> same LOCAL flow above, run
│ inside the runner's ephemeral VM
▼
JSON report
│
▼
GitHub job summary + annotations + workflow artifact
Both the local and CI flows run the identical stellar-canary binary
against the identical fixture format — the Action never reimplements or
reinterprets a compatibility result; it passes or fails the job according
to the CLI’s own exit code and status field.
Trust boundaries
- Fixtures are untrusted data, not code. A fixture file is declarative TOML; no field executes a shell command, script, or arbitrary code.
- No private keys. Nothing in this system ever reads, stores, or transmits a private key or seed phrase. The Soroban surface builds and simulates unsigned transactions only.
- No transaction submission. Every network interaction is read-only
(
getNetwork,getLatestLedger) or simulation-only (simulateTransaction). - The Action never reinterprets a result. It parses the CLI’s JSON and
passes or fails the job according to the CLI’s own exit code /
statusfield.
Stateful vs. ephemeral components
| Component | State model |
|---|---|
stellar-canary binary | No server state. From 0.2.0, check reads and writes a local result cache (canary_core::CacheStore, directory .stellar-canary-cache in the project root), so a run can replay an earlier result instead of calling RPC/Soroban (only offline XDR results by default; the key covers fixture contents, so an edited fixture is never answered from an old entry). See Limitations. |
ProtocolCanary-Fixtures | State lives only as version-controlled git history — a fixture pack is a fixed snapshot at a given commit. |
ProtocolCanary-Action | Fully ephemeral — runs inside a GitHub-hosted runner VM destroyed after the job. Its only durable output is the workflow artifact/job summary GitHub stores. |
| Stellar RPC / Testnet | External network state, owned by the Stellar network, outside this project. Protocol Canary only reads from it or simulates against it — never writes. |
No component in this system introduces its own persistent application storage: no database, no hosted API state, no server.
Cost / hosting model
No paid backend, persistent server, or database is required for any normal use of any of the three repositories. No Docker installation is required. GitHub-hosted Actions runners on the free tier are sufficient for the CI workflows in this ecosystem.
For the complete picture — including the environment-variable table, the
external-dependency table, and every documented failure boundary — see
docs/architecture.md
in the Protocol-Canary repository.
Installation
Prebuilt archives and checksum manifests for the current release, Engine
v0.3.0, are published on GitHub Releases. Alternatively,
install the current release from source using cargo install against the
pinned release tag.
Prebuilt archives
| Target | Asset |
|---|---|
| Linux x86_64 | stellar-canary-x86_64-unknown-linux-gnu.tar.gz (the bare stellar-canary-linux-x86_64 binary is published too) |
| macOS x86_64 | stellar-canary-x86_64-apple-darwin.tar.gz |
| macOS arm64 | stellar-canary-aarch64-apple-darwin.tar.gz |
| Windows x86_64 | stellar-canary-x86_64-pc-windows-msvc.zip |
Each archive contains the stellar-canary executable (stellar-canary.exe
on Windows). No Linux arm64 archive is published for v0.3.0.
Every asset has its own .sha256 file, and the release also publishes one
SHA256SUMS manifest covering all of them. Verify the download before
extracting it:
# Linux (and macOS with sha256sum installed)
curl -fsSLO https://github.com/StellarCanary/Protocol-Canary/releases/download/v0.3.0/SHA256SUMS
sha256sum -c SHA256SUMS --ignore-missing
On macOS without sha256sum, use the same manifest with
shasum -a 256 -c SHA256SUMS. On Windows, compare the archive against its
sidecar:
$actual = (Get-FileHash -Algorithm SHA256 stellar-canary-x86_64-pc-windows-msvc.zip).Hash
$expected = ((Get-Content stellar-canary-x86_64-pc-windows-msvc.zip.sha256) -split '\s+')[0]
$actual -eq $expected
The last line must print True; --ignore-missing on Unix only skips assets
you did not download, and never turns a mismatch into a pass.
Prerequisites
- A Rust/Cargo toolchain. The repository pins
1.91.0in its ownrust-toolchain.toml;cargo installwill use whatever toolchain is active on your machine (rustup will fetch a matching one automatically if you use it). - Network access to
crates.io(for dependency resolution) and GitHub (to fetch the source).
No other runtime dependency is required. There is no Docker requirement and no OS-specific instructions beyond “a working Rust toolchain” — this project does not claim support for a specific operating system beyond what the Rust toolchain itself supports.
Install the current release
cargo install --git https://github.com/StellarCanary/Protocol-Canary --tag v0.3.0 --locked
--tag v0.3.0pins the exact, currently verified release — nevermain, and never an unpinned “latest”.--lockeduses the exact dependency versions in the repository’s own committedCargo.lock, rather than whatever the latest compatible versions happen to be at install time.
Verify the install:
stellar-canary version
stellar-canary 0.3.0
Alternative: build from a local checkout
git clone https://github.com/StellarCanary/Protocol-Canary
cd Protocol-Canary
cargo install --path crates/canary-cli
Alternative: run without installing (development)
From a workspace checkout, every command can be run directly through Cargo without installing a binary at all:
cargo run -p canary-cli -- check
cargo run -p canary-cli -- inspect
cargo run -p canary-cli -- fixtures --protocol 28
Next step
Continue to Your First Check.
Your First Check
This walks through a real, historical run of Canary v0.1.1 against the
Protocol 28 fixture pack, with real output from the pinned fixture
revision e9d098df7931a9b94b183c6af807a58336b7b322 — nothing here is
illustrative text.
1. Install Canary
See Installation:
cargo install --git https://github.com/StellarCanary/Protocol-Canary --tag v0.1.1 --locked
stellar-canary version
# stellar-canary 0.1.1
2. Clone the fixture pack
Clone the repository and check out the exact historical fixture commit
e9d098df7931a9b94b183c6af807a58336b7b322 used for this run:
git clone https://github.com/StellarCanary/ProtocolCanary-Fixtures
git -C ProtocolCanary-Fixtures checkout e9d098df7931a9b94b183c6af807a58336b7b322
Pinning the fixture pack commit ensures the commands below reproduce the
exact five-result output shown in this guide. The main branch of
ProtocolCanary-Fixtures continues to add new fixtures over time, so an
unpinned checkout will produce different counts and checks.
3. Run the Protocol 28 check
stellar-canary check \
--fixtures-dir ProtocolCanary-Fixtures/protocol-28 \
--protocol 28
Stellar Protocol Canary
────────────────────────────────────────
Project: Protocol-Canary (unknown)
Target protocol: 28
Network: testnet (observed protocol 28)
XDR
3/3 PASS
RPC
1/1 PASS
Soroban
1/1 PASS
────────────────────────────────────────
5/5 applicable checks passed.
Status: PASS
4. Understand the PASS result
3/3XDR checks — these ran entirely offline, verifying that CAP-0083 and CAP-0085 XDR structures decode and round-trip byte-for-byte against the project’s local dependencies. Offline XDR checks are strictly deterministic and require no network access.1/1RPC and1/1Soroban checks — these were live network observations recorded againsttestnet(soroban-testnet.stellar.org). The RPC and Soroban surfaces made live calls to the endpoint, which observed Protocol 28, matching the target protocol. Unlike offline XDR checks, live network observations depend on remote endpoint availability and state at execution time.Status: PASSand exit code0— see Exit Codes for the full contract.
This is not a claim of complete Protocol 28 coverage — see Protocol 28 for exactly what these five fixtures do and do not prove.
5. Run JSON mode
stellar-canary check \
--fixtures-dir ProtocolCanary-Fixtures/protocol-28 \
--protocol 28 \
--json
{
"schemaVersion": 1,
"toolVersion": "0.1.1",
"targetProtocol": 28,
"project": { "name": "Protocol-Canary", "type": "unknown" },
"network": { "name": "testnet", "observedProtocol": 28 },
"status": "pass",
"counts": { "total": 5, "passed": 5, "failed": 0, "warnings": 0, "errors": 0, "skipped": 0 },
"results": [
{ "testId": "p28-xdr-cap83-empty-tx-set", "protocol": 28, "surface": "xdr", "status": "pass", "summary": "StellarValue round-tripped byte-for-byte", "durationMs": 0, "fixtureId": "p28-xdr-cap83-empty-tx-set" },
{ "testId": "p28-xdr-cap85-external-ref-malformed", "protocol": 28, "surface": "xdr", "status": "pass", "summary": "ContractExecutable was correctly rejected", "details": "failed to fill whole buffer", "durationMs": 0, "fixtureId": "p28-xdr-cap85-external-ref-malformed" },
{ "testId": "p28-xdr-cap85-external-ref-roundtrip", "protocol": 28, "surface": "xdr", "status": "pass", "summary": "ContractExecutable round-tripped byte-for-byte", "durationMs": 0, "fixtureId": "p28-xdr-cap85-external-ref-roundtrip" },
{ "testId": "p28-rpc-network", "protocol": 28, "surface": "rpc", "status": "pass", "summary": "GetNetwork response matched all 3 assertion(s)", "durationMs": 574, "fixtureId": "p28-rpc-network" },
{ "testId": "p28-soroban-native-asset-name", "protocol": 28, "surface": "soroban", "status": "pass", "summary": "simulation succeeded as expected", "durationMs": 380, "fixtureId": "p28-soroban-native-asset-name" }
],
"git": { "commit": "ffa072cb14c682bfa5ebf158ab9bbe6058962aef", "branch": "main", "isDirty": false }
}
This is a real, unedited historical run captured with Canary 0.1.1 and
fixture revision e9d098df7931a9b94b183c6af807a58336b7b322 against
soroban-testnet.stellar.org. The XDR results were evaluated completely
offline, while the RPC and Soroban entries record live network responses
observed during that historical run. Field-by-field meaning is in
JSON Report.
6. Understand the exit code
echo $?
# 0
0 means every applicable fixture passed. See Exit Codes
for the full table (0–5) and what each one means.
What’s next
- CLI Reference for every command and flag.
- Protocol 28 for exactly what these five fixtures do and do not cover.
- GitHub Action to run this in CI instead of locally.
CLI Reference
stellar-canary ships eleven subcommands. This reference matches the
shipped CLI, verified directly against the binary’s help output.
Rehearse Stellar protocol upgrades before they reach your production stack.
Usage: stellar-canary <COMMAND>
Commands:
check Run compatibility checks against the current project
inspect Print offline project diagnostics
fixtures List fixtures available for a protocol
report Render a previously generated JSON report
diff Compare two stored JSON reports and render the diff (CF-05)
cache Manage the local result cache
config Validate the project configuration without running any check
lock Manage the fixture-pack lockfile: bare `lock` writes the pin (CF-03-B), `lock verify` re-checks it (CF-03-D)
completions Print a shell completion script
version Print the tool version
fixture-pack Verify a fixture pack against its registry manifest
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help (see more with '--help')
-V, --version Print version
| Command | Purpose |
|---|---|
cache | Manage the local result cache — cache clear deletes cached fixture execution results and reports reclaimed disk space. |
check | Run compatibility checks against the current project. The main command. |
config | Validate .stellar-canary.toml — syntax, tables, types and loader rules — without running any check. |
inspect | Print offline project diagnostics — no fixtures run, no network call. |
fixtures | List the fixtures a given --fixtures-dir/--protocol combination would run. |
report | Re-render a previously saved JSON report in another format, without touching the network. |
diff | Compare two saved JSON reports and report the verdict, gating on the exit code. |
lock | Pin the fixture pack (lock) and re-check the pin (lock verify). |
completions | Print a shell completion script for bash, zsh, fish or powershell. |
version | Print the tool’s own version. See version. |
fixture-pack | Verify a fixture pack directory against its registry manifest (fixture-pack verify). |
Project root
check, inspect, fixtures, lock and config work on the current
directory by default.
--project-root <PATH> names a different directory instead, for example one
member of a monorepo. The path must exist and be a directory; otherwise the
command exits with code 2.
With --project-root, a relative --config, --fixtures-dir, --cache-dir
or --output is resolved against that directory, not against where the
command was run.
The engine never searches parent directories for a project root, so a
manifest in a parent directory is never picked up.
Every command accepts -h/--help for the exact, current flag list. If
this page and your installed binary’s --help output ever disagree,
trust --help — it is generated directly from the CLI’s own argument
parser (clap) and cannot drift from the shipped behavior the way a
document can.
stellar-canary cache
Manage the local result cache that check writes to .stellar-canary-cache
in the project root.
cache clear
Usage: stellar-canary cache clear [OPTIONS]
Options:
-h, --help Print help
--cache-dir <PATH> Directory for cached fixture execution results
(default: .stellar-canary-cache in the project root)
--project-root <PATH> Directory to treat as the project root
cache clear deletes every cached fixture execution result under the cache
directory and prints how much disk space was reclaimed, in a human-readable
form (bytes, KiB, MiB, …).
- The cache directory defaults to
.stellar-canary-cachein the project root. Use--cache-dir <PATH>to clear a different location, for example a CI runner’s persistent cache or a tmpfs mount. - Relative
--cache-dirpaths resolve against--project-rootwhen that flag is given. - An empty or missing cache directory is not an error:
cache clearreports0 bytes reclaimedand exits with code0. It never creates a missing directory.
The reclaimed count is measured before deletion, so the reported byte total always matches what was removed.
check
Runs compatibility checks against the current project. This is the command everything else in this documentation builds toward.
Run compatibility checks against the current project
Usage: stellar-canary check [OPTIONS]
Options:
--protocol <PROTOCOL> Target protocol version (overrides configuration)
--network <NETWORK> Network to run live checks against [default: testnet]
--rpc-url <RPC_URL> RPC endpoint to use for live checks
--network-passphrase <PASSPHRASE> Network passphrase used to verify the endpoint's identity and to sign transactions for this run (empty values are rejected)
--project-root <PATH> Directory to treat as the project root (default: the current directory)
--config <CONFIG> Path to a configuration file (default: .stellar-canary.toml in the project root)
--rpc-timeout <RPC_TIMEOUT> Request timeout for the RPC client in seconds [default: 10]
--rpc-max-retries <RPC_MAX_RETRIES> Maximum number of retries after a failed RPC attempt; 0 disables retries (attempts = n + 1) [default: 3]
--rpc-retry-delay-ms <RPC_RETRY_DELAY_MS> Base delay between RPC retry attempts in milliseconds, exponential backoff capped at 30s [default: 500]
--fixtures-dir <FIXTURES_DIR> Directory containing fixture files [default: fixtures]
--fixture <ID> Run only the fixture with this exact ID
--surface <SURFACE> Run fixtures from only this surface [possible values: xdr, rpc, soroban]
--cache-dir <PATH> Directory for cached fixture execution results [default: .stellar-canary-cache in the project root; created if missing]
--format <FORMAT> Output format [default: terminal] [possible values: terminal, json, markdown]
--json Shorthand for --format json
--output <PATH> Write the rendered report to this path, in addition to stdout.
--allow-empty Allow a run in which no fixture applies. Without it such a run fails with exit code 2.
--verbose Include skip reasons in Markdown/terminal output and populate the JSON report's verbose field.
--quiet Shorten terminal-format output to a single status line.
--max-concurrency <MAX_CONCURRENCY> Maximum number of concurrent network requests for RPC/Soroban fixtures [default: 4]
--no-cache Do not read or write the local result cache. Every fixture runs fresh.
--live-cache-ttl <SECONDS> Allow RPC and Soroban results from the local cache to be replayed for up to this many seconds. Off by default.
--locked Require .stellar-canary.lock to exist and its pinned fixtures.packDigest to match the current fixture pack (exit code 2 otherwise)
-h, --help Print help
Protocol selection
Precedence, highest first: --protocol flag, then .stellar-canary.toml’s
protocol field, then the built-in default of 28.
Fixture directory
--fixtures-dir defaults to fixtures relative to the project root: the
current directory, or the directory named by --project-root.
It accepts any local path — including a checkout of
ProtocolCanary-Fixtures
— and is loaded recursively. A directory that does not exist is loaded as
zero fixtures. In releases after 0.1.1 a run that then has nothing to execute
fails with exit code 2 (see No applicable fixtures);
0.1.1 and earlier reported a 0/0 pass. See Fixtures.
Targeting fixtures
Use --fixture <ID> to run one fixture by its exact ID, or --surface to run
only xdr, rpc or soroban fixtures. Combine the flags to select one
fixture on a specific surface. A filter with no matches exits 2 and reports
no matching fixtures found.
stellar-canary check --fixture p28-xdr-1
stellar-canary check --surface xdr
stellar-canary check --fixture p28-xdr-1 --surface xdr
Output formats
terminal(default) — human-readable, colorized when the output is a TTY.--format json(or the--jsonshorthand) — machine-readable, the contractProtocolCanary-Actionconsumes. See JSON Report.--format markdown— a Markdown table, suitable for a PR comment or job summary.
Note on verbosity: The
--quietflag only affects theterminaloutput format, condensing the output to a singleStatus:line instead of a full report. The--verboseflag affects the detail included: it adds skip reasons to bothmarkdownandterminaloutputs, and is passed through into thejsonreport’sverbosefield.--verbosealso logs every RPC attempt to stderr as one line — e.g.[RPC attempt 1/3: 124ms] getNetwork <url>— with basic-auth userinfo masked as***:***@and query values masked as***before printing (CF-08), so endpoint credentials never reach a CI log. Without--verboseno attempt lines are emitted at all.
The report is printed to stdout regardless of exit code, including on a compatibility failure — a caller does not need to inspect stderr to get the report.
Writing the report to a file
--output <PATH> writes the rendered report to PATH in addition to
printing it to stdout. Stdout behavior is unchanged, so an existing shell
redirection (stellar-canary check --json > result.json) still works, and
a caller that cannot capture stdout — for example one wrapped by a tool
that does not pass stdout through cleanly — has a direct way to get the
report into a file.
The file receives exactly the bytes stdout receives, in the format
selected by --format/--json, and including the trailing newline
println! adds. That also means --quiet writes its single Status:
line rather than a full report. The file is created if PATH does not
exist and truncated if it does, and it is written before anything is
printed, so an unusable path fails before a report reaches stdout.
stellar-canary check --json --output result.json
stellar-canary report result.json --format markdown
The exit code for the run itself is unchanged by --output: it never
turns a 0 into a 1 or the other way around. The one failure mode the
flag adds is PATH itself — a directory that does not exist, or one the
process cannot write — which is reported as a configuration error
(exit code 2) and prints nothing to stdout, since the report could not
be produced where it was asked for. See Exit Codes.
Network behavior
Not every check requires the network:
- XDR checks are offline. They decode/encode against the official
stellar-xdrcrate with no network call. - RPC and Soroban checks require a live, reachable
--rpc-url.--networkselects which network name is reported (testnetby default);--rpc-urlis the actual endpoint contacted. If RPC/Soroban checks are enabled (the default) and the endpoint is unreachable, that is reported as an execution error, not skipped — see Exit Codes and network troubleshooting. - The endpoint’s identity is validated against the run’s assumptions.
When
getNetworksucceeds, its passphrase is compared to--networkand its protocol version to--protocol: a passphrase mismatch aborts as a configuration error (exit2) before any check runs, since results from the wrong network must not be attributed to the requested one; an observed protocol that differs from the target prints awarning:line on stderr (e.g.warning: the RPC endpoint reports protocol 27, but this run targets protocol 28) and the run continues — observing a not-yet-upgraded network while rehearsing the next protocol is a legitimate use case, but it must be visible rather than only an(observed protocol N)annotation in the report. - Custom networks are verified with
--network-passphrase.testnet,mainnetandfuturenethave published passphrases that are used automatically; a custom--networkname has none, so the passphrase comparison is skipped unless you supply one with--network-passphrase <PASSPHRASE>. The flag also overrides the well-known default — for example when you deliberately point--network testnetat a private node that uses a different passphrase. An empty value is rejected as an argument validation error (exit2), because an empty passphrase would silently disable the very comparison the flag exists to enable. The same value is the one a signing consumer would use for this run.
Disable a surface in .stellar-canary.toml ([tests] rpc = false /
soroban = false) to run fully offline.
Example: PASS
stellar-canary check --fixtures-dir ProtocolCanary-Fixtures/protocol-28 --protocol 28
Stellar Protocol Canary
────────────────────────────────────────
Project: Protocol-Canary (unknown)
Target protocol: 28
Network: testnet (observed protocol 28)
XDR
3/3 PASS
RPC
1/1 PASS
Soroban
1/1 PASS
────────────────────────────────────────
5/5 applicable checks passed.
Status: PASS
Exit code 0.
Example: JSON
stellar-canary check --fixtures-dir ProtocolCanary-Fixtures/protocol-28 --protocol 28 --json
See the full real example in Your First Check and the field-by-field reference in JSON Report.
Example: FAIL
A real fixture deliberately given a wrong expected value:
Stellar Protocol Canary
────────────────────────────────────────
Project: Protocol-Canary (unknown)
Target protocol: 28
Network: testnet (observed protocol 28)
XDR
demo-xdr-fail ❌ FAIL
────────────────────────────────────────
0/1 applicable checks passed.
Status: NOT READY
Failure:
demo-xdr-fail
failed to decode StellarValue input
failed to fill whole buffer
Exit code 1. Note that the terminal reporter’s headline for a failing
run reads Status: NOT READY — the machine-readable status field in
--json output is "fail"; see JSON Report for the
exact string values a script should key off of instead of terminal text.
Result cache
check keeps a small file-backed cache in .stellar-canary-cache in the
project root (add it to .gitignore).
-
--cache-dir <PATH>stores the cache somewhere else — a CI runner’s persistent cache, a tmpfs mount, anywhere a pipeline can keep a directory between runs. The directory is created if it does not exist; a path that cannot be created exits2before any fixture runs, with an error naming the flag and the path. A relative path resolves against--project-rootwhen that flag is given. Without--cache-dirnothing changes. -
XDR results are cached. They depend only on the fixture bytes, so an entry stays valid until the fixture, a payload it references, the protocol or the tool version changes. Any of those changes is a cache miss.
-
RPC and Soroban results are not cached by default. A recorded answer from a network says nothing about what the network does now. Pass
--live-cache-ttl <SECONDS>to accept a replay no older than that, for example to stay under a provider’s rate limit. -
--no-cacheskips the cache entirely, for reading and for writing. -
A replayed result is marked
"source": "cache"in the JSON report, and the terminal and Markdown reports say how many results were replayed. -
A damaged, unreadable or old-layout entry is ignored and the fixture runs.
Strict pinning with –locked
--locked turns check into a CI gate over the fixture-pack pin
(.stellar-canary.lock, written by lock):
stellar-canary lock
stellar-canary check --locked
With the flag, the run first loads the lockfile from the project root and
compares its pinned [fixtures].packDigest against the canary-pack-v1
digest of the resolved fixture directory. If the lockfile is missing, unreadable,
or the pack has drifted — an edited or added fixture file changes the
digest — the run fails with exit code 2 before any fixture executes,
and the message names stellar-canary lock as the command that repairs the
pin. A fresh, matching lockfile lets the run proceed exactly as usual.
Without the flag the lockfile is not consulted at all, so --locked is
strictly opt-in. This is deliberately stricter than lock verify, which
reports the same conditions as a verification failure with exit code 1:
--locked fails with 2 so a CI pipeline can tell “the pin does not hold”
apart from “a fixture genuinely broke”.
No applicable fixtures
A run that executes zero fixtures proves nothing about compatibility, so after
0.1.1 it fails instead of passing:
error: configuration error: no checks ran: all 7 loaded fixtures were skipped. 7 target another protocol (this run targets protocol 29; the fixtures target protocol 28). Executing nothing is not evidence of compatibility; pass --allow-empty if an empty run is intended.
The exit code is 2 and no report is printed. The message says which case
applies: the fixtures directory is missing, it holds no *.toml files, or
every loaded fixture was skipped because of its protocol, a disabled surface
or a capability the project does not declare. --allow-empty makes the run
proceed, prints a warning, and reports counts.total: 0; it never hides a
failure in a run that does execute fixtures.
stellar-canary 0.1.1 and earlier exited 0 with Status: PASS in these
cases.
inspect
Prints offline project diagnostics. No fixtures run, and no network call is made.
Print offline project diagnostics
Usage: stellar-canary inspect [OPTIONS]
Options:
--protocol <PROTOCOL> Target protocol version (overrides configuration)
--fixtures-dir <FIXTURES_DIR> Directory containing fixture files to inspect [default: fixtures]
--project-root <PATH> Directory to treat as the project root (default: the current directory)
--config <CONFIG> Path to a configuration file (default: .stellar-canary.toml in the project root)
--format <FORMAT> Output format [default: terminal] [possible values: terminal, json]
--json Shorthand for --format json
--verbose Include verbose diagnostic details in output
-h, --help Print help
What it inspects
The same project-detection logic check uses internally, surfaced on its
own: the project root, its detected type, which Stellar-related
dependencies/artifacts were detected, the configured target protocol, and
which surfaces (xdr/rpc/soroban) are currently enabled.
With --fixtures-dir and --protocol, inspect drives the same
compatibility-planner preview described in the README: it lists fixtures that
would run and fixtures skipped for a protocol mismatch, disabled surface, or
missing project capability, without contacting Stellar RPC or Soroban endpoints.
Example
Run inside a checkout of Protocol-Canary itself:
stellar-canary inspect
Project root: /home/hollujay/Protocol-Canary
Project type: unknown
Detected Stellar SDK/XDR dependency: false
Detected Soroban contract usage: false
Detected RPC client dependency: false
Detected WASM artifact: false
Configured protocol: 28
Available compatibility surfaces:
xdr: enabled
rpc: enabled
soroban: enabled
Project type: unknown here is correct — this repository is Canary’s own
source code, not a Stellar application, so none of the detection
heuristics (Soroban contract, RPC client, stellar-sdk dependency, WASM
artifact) match. Run inspect inside your own project to see its actual
detected type and which fixtures’ required_capabilities it will satisfy.
inspect is useful before check when you want to confirm project
detection or configuration without waiting on a live network call.
JSON output (--format json)
--format json (or the shorthand --json) prints the CA-03 inspection
document: one JSON document on stdout, nothing on stderr. It still makes
no network call — offline is always true in the document. The output
is deterministic: no timestamps, and project.root is relative to the
current directory, never absolute. The full contract is
CA-03,
and the machine-readable schema is
inspect-v1.schema.json.
stellar-canary inspect --fixtures-dir ProtocolCanary-Fixtures/protocol-28 --protocol 28 --json
{
"inspectVersion": 1,
"toolVersion": "0.2.0",
"offline": true,
"project": {
"root": ".",
"rootSelectedBy": "current-directory",
"type": "soroban",
"typeSource": "detected",
"detectedType": "soroban",
"capabilities": [
"soroban-contract",
"wasm-artifact"
],
"workspace": {
"members": []
},
"detection": {
"evidenceVersion": 1,
"root": ".",
"capabilities": [],
"inspected": [
"Cargo.toml"
],
"diagnostics": [],
"projectType": {
"value": "soroban",
"source": "detected"
}
}
},
"config": {
"found": false,
"path": null,
"version": 1,
"protocol": 28,
"projectType": "auto",
"tests": {
"xdr": true,
"rpc": false,
"soroban": false
},
"policy": {
"warningsAreFailures": false
}
},
"target": {
"protocol": 28,
"source": "flag"
},
"fixtures": {
"directoryFound": true,
"loaded": 2
},
"plan": {
"wouldRun": [
{
"id": "p28-xdr-cap83-empty-tx-set",
"surface": "xdr"
}
],
"skipped": [
{
"id": "p27-xdr-old",
"surface": "xdr",
"code": "UNSUPPORTED_PROTOCOL",
"reason": "fixture targets protocol 27, this run targets protocol 28"
}
],
"checkWouldRefuse": false,
"refusal": null
},
"workspace": {
"members": []
},
"fingerprint": {
"fingerprintVersion": 1,
"detector": 1,
"digest": "sha256:859e9ac27cdbe3ee8bbaac66355d2e4ab98879e7c27f5d8a099e5a34ec0144bc",
"inputs": 1
}
}
(Example output trimmed; project.detection carries the evidence the
detector collected, and workspace.members lists workspace members
when one is detected.)
Field reference
| Field | Type | Meaning |
|---|---|---|
inspectVersion | integer | Document format version; always 1 today. Consumers must reject an unknown version. |
toolVersion | string | The CLI’s own semver. Informational — never use it for feature detection. |
offline | boolean | Always true: inspect is offline in every mode. |
project | object | Project root (root, relative), how it was selected (rootSelectedBy: current-directory or flag), the effective type and where it came from (typeSource: detected or config), what detection alone produced (detectedType), the sorted capabilities list, and the detection evidence block. |
config | object | Configuration file status and effective settings: found, path (null when absent), version, protocol, projectType, the per-surface tests switches, and policy.warningsAreFailures. |
target | object | The protocol actually targeted and its source: flag, config or default. |
fixtures | object | directoryFound and loaded: how many fixtures the directory yielded in total (all protocols), before planning. |
plan | object | The compatibility plan — see below. |
workspace | object | Workspace member diagnostics. |
fingerprint | object | The CA-04 project fingerprint: fingerprintVersion, detector, digest (sha256:<64 lowercase hex>) and inputs. The digest is not a secret and not anonymous; see CA-04. |
project.type and project.detectedType are one of soroban,
rpc-consumer, stellar-sdk, generic-stellar or unknown. Unknown
values in a newer document must be treated as unknown.
project.detection fields
project.detection is the evidence block collected by project detection.
It is always present, and its capabilities entries are the detailed
evidence behind the sorted name list in project.capabilities. All six keys
are always serialized:
| Field | JSON type | Meaning |
|---|---|---|
evidenceVersion | integer | Evidence format version (1 today). Treat an unknown value as unsupported rather than guessing at its contents. |
root | string | The root that was inspected, relative to the directory the command was started in (normally "."). |
capabilities | array of objects | One capability evidence entry per capability detection produced; [] when none were found. |
inspected | array of strings | Root-relative paths the detector read, such as Cargo.toml, sorted and deduplicated. |
diagnostics | array of objects | One detection diagnostic per non-fatal detection problem; [] when detection was clean. These do not fail inspect. |
projectType | object | The resolved project-type evidence. |
Capability evidence
Each object in capabilities names one capability and lists the matches
that produced it:
| Field | JSON type | Optional? | Meaning |
|---|---|---|---|
capability | string | no | Lowercase kebab-case name from project.capabilities, e.g. soroban-contract. |
evidence | array of evidence items | no | The individual matches supporting the capability; may be empty. |
Evidence item
Each object in a capability’s evidence has the keys below. Required keys
are always serialized; optional keys are omitted when absent (not
emitted as null), matching the serializer:
| Field | JSON type | Optional? | Meaning |
|---|---|---|---|
manifest | string | no | Root-relative manifest or artifact path the detector read. |
ecosystem | string | no | Source ecosystem, e.g. cargo, npm, go, python or wasm. |
dependency | string | yes | Dependency name for manifest evidence; omitted for artifact evidence. |
section | string | yes | Manifest section such as dependencies; omitted when not applicable. |
sourceFile | string | yes | Normalized root-relative path to the file that yielded the match. |
matchedText | string | yes | The matched dependency, string or artifact identifier. |
reason | string | yes | Human-readable reason the match assigns the capability. |
Detection diagnostic
Each object in diagnostics has two keys, both always serialized:
| Field | JSON type | Optional? | Meaning |
|---|---|---|---|
code | string | no | Machine-readable CF-07 diagnostic code, e.g. manifest-unparseable. |
detail | string | no | Human-readable context, including a root-relative path when one is involved. |
Project-type evidence
projectType records the effective type and where it came from:
| Field | JSON type | Optional? | Meaning |
|---|---|---|---|
value | string | no | Effective type, one of the five values listed for project.type above. |
source | string | no | detected when auto-detection chose the type, config when configuration overrode it. |
detectedValue | string | yes | The auto-detected type when source is config and it differs from value; omitted otherwise. |
The plan
plan mirrors what check would do with the same project, fixtures
directory and protocol, without running anything:
wouldRunis the ordered list of fixturescheckwould execute, in execution order: XDR first, then RPC, then Soroban, each in planned order. A consumer can compare it against a report’sresults.skippedlists every fixture left out, sorted byid, each with a machine-readablecode, thesurface, and the same free-textreasoncheckrecords. Codes are the CF-01 skip codes:UNSUPPORTED_PROTOCOL,SURFACE_DISABLED,MISSING_CAPABILITY, and theUNKNOWNfallback. New codes may be added by a changelog entry; consumers must treat a code they do not know as “other”.checkWouldRefuseistruewhen no fixture applies — the situation wherecheck(without--allow-empty) would fail with exit code2.refusalthen holds the human-readable explanationcheckwould print; otherwise it isnull.
An empty plan is reported in the document, not as an exit code:
inspect still exits 0, because its purpose is to explain the
situation.
Examples with jq
# How many fixtures check would run.
stellar-canary inspect --json | jq '.plan.wouldRun | length'
# Ids and reasons for everything that gets skipped.
stellar-canary inspect --json | jq -r '.plan.skipped[] | "\(.id): \(.code) (\(.reason))"'
# Fail a CI step when check would refuse to run anything.
stellar-canary inspect --json | jq -e '.plan.checkWouldRefuse | not' > /dev/null
# The project fingerprint, e.g. to key a CI cache on.
stellar-canary inspect --json | jq -r '.fingerprint.digest'
Failure behavior
| Situation | Exit code | stdout | stderr |
|---|---|---|---|
| Any successful inspection, including an empty plan | 0 | the document | empty |
Invalid or unreadable configuration, invalid --protocol, unreadable root | 2 | empty | the error |
| Invalid fixture, duplicate id, unsafe reference, symbolic link | 4 | empty | the error |
A failure never prints a partial or empty-looking JSON document, so a
consumer that parses stdout can treat “not parseable” as failure. See
Exit Codes for the full contract, and
fixtures --format json for the fixture inventory.
fixtures
Lists the fixtures available for a given protocol, without running them.
List fixtures available for a protocol
Usage: stellar-canary fixtures [OPTIONS]
Options:
--protocol <PROTOCOL> Protocol version to list fixtures for (default: the configured protocol, or 28 if there is no configuration file)
--fixtures-dir <FIXTURES_DIR> Directory containing fixture files [default: fixtures]
--project-root <PATH> Directory to treat as the project root (default: the current directory)
--config <CONFIG> Path to a configuration file (default: .stellar-canary.toml in the project root)
--format <FORMAT> Output format [default: terminal] [possible values: terminal, json]
--json Shorthand for --format json
--surface <SURFACE> Filter fixtures by compatibility surface [possible values: xdr, rpc, soroban]
--category <CATEGORY> Filter fixtures by category
-h, --help Print help
This loads and validates --fixtures-dir exactly the way check does
(so a malformed fixture is reported the same way, exit code 4), but
stops before running anything — no network call, regardless of the
fixtures’ surfaces.
As with check, a --fixtures-dir that does not exist is treated as zero
fixtures, not an error: the command exits 0 and prints the same message
as a real but empty directory, so check the path if you expected fixtures.
$ stellar-canary fixtures --fixtures-dir /does/not/exist --protocol 28
Protocol 28 fixtures
(no fixtures found in /does/not/exist)
Example
An unfiltered command prints every fixture for the target protocol. Because the pack grows over time, the terminal listing below is an excerpt of what a current checkout prints, not the complete result.
stellar-canary fixtures --fixtures-dir ProtocolCanary-Fixtures/protocol-28 --protocol 28
Protocol 28 fixtures
XDR
p28-xdr-cap83-empty-tx-set
p28-xdr-cap85-external-ref-malformed
p28-xdr-cap85-external-ref-roundtrip
RPC
p28-rpc-network
Soroban
p28-soroban-native-asset-name
(Excerpt: these five entries come from the immutable protocol-28 tag; a
checkout of the pack’s main branch lists more.)
For a reproducible subset, filter the listing. For example, --surface rpc
prints only the RPC group, with the other surfaces omitted:
stellar-canary fixtures --fixtures-dir ProtocolCanary-Fixtures/protocol-28 --protocol 28 --surface rpc
Protocol 28 fixtures
RPC
p28-rpc-network
Fixtures are grouped by surface and listed in sorted-path order, matching
check’s deterministic ordering. Use this to confirm which fixtures a
--fixtures-dir/--protocol combination will actually run before
spending a live network call on check — see Fixtures
for what a fixture is and how this list maps to the file layout.
JSON output (--format json)
--format json (or the shorthand --json) prints the CA-02 fixture
inventory: one JSON document on stdout, nothing on stderr, and no
terminal formatting. The document is deterministic — it contains no
timestamps, absolute paths or machine-dependent values — so it is safe
to diff between runs or key CI steps off of it. The full contract is
CA-02,
and the machine-readable schema is
fixtures-v1.schema.json.
stellar-canary fixtures --fixtures-dir ProtocolCanary-Fixtures/protocol-28 --protocol 28 --format json
{
"inventoryVersion": 1,
"toolVersion": "0.2.0",
"fixtureFormat": 1,
"protocol": 28,
"directoryFound": true,
"counts": {
"total": 5,
"xdr": 3,
"rpc": 1,
"soroban": 1
},
"otherProtocols": {
"27": 1
},
"fixtures": [
{
"id": "p28-rpc-network",
"protocol": 28,
"surface": "rpc",
"category": "network",
"description": "getNetwork basics",
"path": "rpc/network.toml",
"requiredCapabilities": [
"rpc-client"
],
"method": "getNetwork"
},
{
"id": "p28-soroban-native-asset-name",
"protocol": 28,
"surface": "soroban",
"category": "token",
"description": "native asset contract id",
"path": "soroban/native-asset-name.toml",
"requiredCapabilities": [
"soroban-contract",
"wasm-artifact"
],
"function": "asset"
},
{
"id": "p28-xdr-cap83-empty-tx-set",
"protocol": 28,
"surface": "xdr",
"category": "ledger",
"description": "empty transaction set roundtrip",
"path": "xdr/empty-tx-set.toml",
"requiredCapabilities": [
"stellar-sdk-dependency"
],
"type": "TransactionSet",
"kind": "roundtrip"
}
]
}
(Excerpt: counts describes the full directory in this illustrative example,
while the fixtures array is trimmed to one entry per surface for clarity.
A real directory lists every fixture of the protocol.)
Field reference
| Field | Type | Meaning |
|---|---|---|
inventoryVersion | integer | Inventory format version; always 1 today. Consumers must reject an unknown version. |
toolVersion | string | The CLI’s own semver. Informational — never use it for feature detection. |
fixtureFormat | integer | The fixture file format the engine reads; 1 today. |
protocol | integer | The protocol version this inventory lists fixtures for. |
directoryFound | boolean | Whether the fixture directory exists. false is not an error: it reports an empty inventory, exactly like the terminal listing. |
counts | object | total, xdr, rpc, soroban: fixture counts for protocol. |
otherProtocols | object | Count of fixtures in the directory for every other protocol, keyed by the protocol number as a string. |
fixtures | array | One entry per fixture of protocol, sorted by id (comparing UTF-8 bytes). |
Each fixtures[] entry always carries id, protocol, surface,
category, description, path (relative to the fixture directory,
with forward slashes on every platform) and requiredCapabilities
(sorted, lowercase kebab). It additionally carries the surface-specific
method (rpc), type and kind (xdr), or function
(soroban), plus the optional sourceReference and verification
(the CF-04 verification record, copied as stored). Optional fields are
omitted, not null, when the fixture file has no value for them.
sha256, payloads and packDigest are reserved for CF-02 and are
not emitted yet.
Filtering changes the counts
--surface and --category filter the inventory before the document
is built, so counts, otherProtocols and fixtures all describe the
filtered listing, not the whole directory:
stellar-canary fixtures --format json --surface rpc | jq '.counts'
Examples with jq
# Every fixture id for the target protocol.
stellar-canary fixtures --format json | jq -r '.fixtures[].id'
# Ids of the RPC fixtures only.
stellar-canary fixtures --format json | jq -r '.fixtures[] | select(.surface == "rpc") | .id'
# Fail CI when the pack is empty.
stellar-canary fixtures --format json | jq -e '.counts.total > 0' > /dev/null
# Which other protocols are present in the directory.
stellar-canary fixtures --format json | jq '.otherProtocols'
Failure behavior
| Situation | Exit code | stdout | stderr |
|---|---|---|---|
| Normal run, including zero fixtures or a missing directory | 0 | the document | empty |
Invalid or unreadable configuration, invalid --protocol, unsupported --format value | 2 | empty | the error or usage message |
| Invalid fixture, duplicate id, unsafe reference, symbolic link | 4 | empty | the error |
A failure never prints a partial or empty-looking JSON document, so a consumer that parses stdout can treat “not parseable” as failure. See Exit Codes for the full contract.
report
Renders a previously generated JSON report in another format, without touching the network.
Render a previously generated JSON report
Usage: stellar-canary report [OPTIONS] <PATH>
Arguments:
<PATH> Path to a JSON report produced by `stellar-canary check --json`
Options:
--format <FORMAT> Output format to render the stored report as [default: markdown] [possible values: terminal, json, markdown]
-h, --help Print help
This is a pure re-render: it parses the exact shape documented in
JSON Report (JsonReporter::parse) and reproduces it
in the requested format — it never re-runs a check or makes a network
call. Note the default output format here is markdown, unlike check’s
default of terminal.
Example
stellar-canary check --fixtures-dir ProtocolCanary-Fixtures/protocol-28 --protocol 28 --json > result.json
stellar-canary report result.json --format markdown
## Stellar Protocol Canary
Protocol 28 compatibility
| Surface | Result |
|---|---|
| XDR | ✅ Pass |
| RPC | ✅ Pass |
| Soroban | ✅ Pass |
**Result: PASS**
stellar-canary report result.json --format terminal
Stellar Protocol Canary
────────────────────────────────────────
Project: Protocol-Canary (unknown)
Target protocol: 28
Network: testnet (observed protocol 28)
XDR
3/3 PASS
RPC
1/1 PASS
Soroban
1/1 PASS
────────────────────────────────────────
5/5 applicable checks passed.
Status: PASS
There is no export format beyond terminal/json/markdown — do not
assume an HTML, PDF, or CSV output exists; it does not.
diff
Compares two previously generated JSON reports and renders the
comparison as machine-readable diffVersion: 1 JSON (CF-05). Nothing is
re-run and no network call is made — the diff is computed entirely from
the two stored files.
Compare two stored JSON reports and render the diff (CF-05)
Usage: stellar-canary diff <CURRENT_REPORT> <BASELINE_REPORT>
Arguments:
<CURRENT_REPORT> Path to the current report (produced by `stellar-canary check --json`)
<BASELINE_REPORT> Path to the baseline report to compare the current report against
Options:
-h, --help Print help
Note the argument order: current first, baseline second. The diff
answers “what changed since the baseline”, so pass -> fail (a
regression) is what you get when a test passed in the baseline and fails
now.
Exit codes (CF-05)
diff uses the same exit-code contract as check
and friends — CF-05 section 5 fixes its numbers to “mirror the existing
meanings of 1 and 2” — read through the comparison’s lens:
| Code | Global contract | diff meaning |
|---|---|---|
0 | Pass | Verdict no-change or improved — safe to merge. |
1 | CompatibilityFailure | Verdict regression or coverage-lost. |
2 | ConfigurationError | The two reports are not comparable, or a report file is missing or invalid (see below). |
Comparison eligibility
Two reports are only comparable when they carry the same, supported
schemaVersion and the same targetProtocol, with no identity
listed twice in either input. Comparing a Protocol 28 report against a
Protocol 29 baseline would otherwise produce a diff full of
cross-protocol noise that looks like a real regression, so diff
refuses instead: it prints a diagnostic explaining exactly why (a
schemaVersion mismatch, a protocol mismatch, a duplicate identity or
an invalid report) on stderr, produces no JSON, and exits 2.
Verdicts
The verdict field follows a strict precedence, evaluated in this
order, first match wins:
- regression — at least one entry has
regression: true. - coverage-lost —
missingis non-empty (a baseline test is absent from the current report) and nothing regressed. - improved — at least one entry is
resolved,improvedoradded; nothing regressed or vanished. - no-change — nothing differs.
Newly added tests appear in entries with an absent from state;
they never flip the verdict into a regression.
Output shape
{
"diffVersion": 1,
"comparable": true,
"baseline": { "toolVersion": "0.2.0", "targetProtocol": 28, "status": "pass" },
"current": { "toolVersion": "0.2.0", "targetProtocol": 28, "status": "fail" },
"fixturePackChanged": null,
"observedProtocolChanged": false,
"emptyBaseline": false,
"emptyCurrent": false,
"entries": [
{ "surface": "rpc", "id": "p28-rpc-1", "from": "pass", "to": "fail", "classification": "regressed", "regression": true }
],
"missing": [],
"summary": { "regressed": 1, "resolved": 0, "added": 0, "removed": 0, "unchanged": 0, "missing": 0 },
"verdict": "regression"
}
| Field | Meaning |
|---|---|
diffVersion | Integer, currently 1. |
comparable | Always true when a document is produced: an ineligible pair exits 2 with no output at all. |
baseline / current | Each side’s toolVersion, targetProtocol and overall status. |
fixturePackChanged | null — unknown until reports carry a fixturePack digest (never silently false). |
observedProtocolChanged | true only when both reports observed a protocol and they differ. |
emptyBaseline / emptyCurrent | Whether that side had no results (an empty side cannot establish a regression). |
entries | Every identity from either report: surface, id, from/to state (pass, warning, fail, error, skipped, absent), the CF-05 classification and the regression flag. Sorted by (surface, id) in UTF-8 byte order. |
missing | Baseline identities that passed but are absent or skipped now (coverage lost). |
summary | Counts over entries and missing. |
verdict | One of no-change, improved, coverage-lost, regression. |
Serialization is deterministic: the same pair of reports always produces byte-identical JSON, so the output can be committed, diffed, or hash-checked in CI.
Example
stellar-canary check --json > current.json # on the PR branch
git stash && stellar-canary check --json > baseline.json && git stash pop
stellar-canary diff current.json baseline.json
echo $? # 0 no-change/improved, 1 regression/coverage-lost, 2 invalid input
lock
Pins the project’s test dependencies for reproducible execution: writes
a .stellar-canary.lock at the project root capturing the active
fixture pack, the target protocol, and the tool version (CF-03).
Bare lock writes; lock verify is its read-only counterpart.
Manage the fixture-pack lockfile: bare `lock` writes the pin (CF-03-B), `lock verify` re-checks it (CF-03-D)
Usage: stellar-canary lock [OPTIONS] [COMMAND]
Commands:
verify Verify that the lockfile still matches the fixture pack
help Print this message or the help of the given subcommand(s)
Options:
--protocol <PROTOCOL> Target protocol version (overrides configuration)
--fixtures-dir <FIXTURES_DIR> Directory containing fixture files [default: fixtures]
--config <CONFIG> Path to a configuration file (default: .stellar-canary.toml in the project root)
-h, --help Print help
The lockfile
lockVersion = 1
[tool]
version = "0.2.0"
[fixtures]
protocol = 28
packDigest = "sha256:…"
registryVersion = 1
source = "directory"
| Field | Meaning |
|---|---|
lockVersion | Integer, currently 1. A future format change bumps this. |
tool.version | The Canary CLI version that produced the lock (MAJOR.MINOR.PATCH). |
fixtures.protocol | The pinned target protocol (from --protocol, else the configuration file, else the default). |
fixtures.packDigest | The pack’s canonical content digest (canary-pack-v1, CF-02): the ASCII header canary-pack-v1, then one <sha256> <size> <relative path> line per pack file, sorted by pack-relative path. Independent of where the pack is checked out — identical layout and content produce the same digest on any machine. |
fixtures.registryVersion | The pinned pack’s registry format version (required; currently 1). |
fixtures.source | Where the pack came from (directory here). Informational only. |
Serialization is deterministic (CF-03 section 3): keys in the contract’s
fixed order, \n line endings, a trailing newline and no comments, so
the same pack always produces a byte-identical lockfile and
regenerating it in CI and diffing is a reliable drift check.
Safety
The entire pack is resolved and validated before the lockfile is
touched. If the fixtures directory does not exist, or the pack is
invalid (duplicate ids, dangling file references, unparseable TOML),
lock reports a clear error using the standard
exit-code contract and leaves no partial
lockfile behind.
Example
stellar-canary lock --fixtures-dir ProtocolCanary-Fixtures/protocol-28
# Wrote /path/to/project/.stellar-canary.lock (lockVersion 1, protocol 28, packDigest sha256:…)
lock verify
stellar-canary lock verify is the read-only counterpart (CF-03-D): it
loads the lock under the parser rules of CF-03 section 3, recomputes the
canary-pack-v1 digest (CF-02) of the directory the configuration
resolves to, and compares the two. It never writes — the fixture pack,
the lockfile and the cache are left exactly as they are — and a stale
pin fails with the exit-code contract’s
configuration error (2), naming the expected and computed digests.
stellar-canary lock verify
# Verified: /path/to/project/.stellar-canary.lock matches the fixture pack at fixtures (…)
Additional flags: --project-root <PATH> (treat another directory as
the project root), --fixtures-dir <PATH> (verify a different pack
location — a flag chooses a location, it does not waive the pin) and
--config <PATH>.
config
Works with the project configuration file. config validate checks
.stellar-canary.toml for syntax, table structure and value types — and for
the rules the loader enforces after parsing — without loading a fixture,
running a check, or opening a network socket (issue #457).
Validate the project configuration without running any check
Usage: stellar-canary config <COMMAND>
Commands:
validate Check .stellar-canary.toml without running any compatibility check
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
config validate
stellar-canary config validate
Valid: /path/to/project/.stellar-canary.toml
version = 1
protocol = 28
network = (not set: defaults to testnet)
rpc_url = (not set)
fixtures_dir = (not set: defaults to fixtures)
project.type = auto
tests = xdr=true rpc=true soroban=true
policy.warnings_are_failures = false
The file is parsed by the same strict loader check uses, so a
configuration this command accepts is a configuration check reads
identically. Unknown keys and unknown tables are rejected rather than
ignored — that is what catches a misspelled [tests] — and so is a value of
the wrong type.
A key the file leaves unset is reported as not set, together with the
built-in default that then applies. --protocol, --network,
--rpc-url and --fixtures-dir still override the file at run time;
this report describes the file, not a run.
Errors point at the line
Every failure names the offending field and where it is, because the TOML parser’s own diagnostic is passed through:
stellar-canary config validate
error: failed to parse configuration file /path/to/project/.stellar-canary.toml: TOML parse error at line 4, column 2
|
4 | [test]
| ^^^^
unknown field `test`, expected one of `version`, `protocol`, `network`, `rpc_url`, `fixtures_dir`, `project`, `tests`, `policy`
Fix the line, re-run. The parser reports the first problem it finds.
Exit codes
| Code | Meaning |
|---|---|
0 | The configuration is valid — or there is no .stellar-canary.toml, in which case the project runs on the built-in defaults, which are valid. |
1 | The file is not a valid configuration. This is the answer to the question that was asked, not a broken invocation. |
2 | Validation could not start: --project-root does not resolve, or the file named by --config cannot be read. |
See Exit Codes.
Options
| Flag | Meaning |
|---|---|
--project-root <PATH> | Treat another directory as the project root. The root is never searched for in parent directories. |
--config <PATH> | Validate a specific file instead of .stellar-canary.toml in the project root. A relative path resolves against --project-root. Unlike the default location, a file named explicitly must exist: not being able to read it is exit 2. |
# A monorepo member, from the repository root.
stellar-canary config validate --project-root services/consumer
# A CI copy of the configuration, with no project root implied.
stellar-canary config validate --config ci/stellar-canary.toml
Typical use
Run it as the first step of a job, so a typo in the configuration fails before fixtures are fetched and a run is spent:
stellar-canary config validate || exit 1
stellar-canary check --offline --format json --output report.json
Nothing is written and no network call is made, so the check is safe to run in a pre-commit hook:
stellar-canary config validate --project-root "$(git rev-parse --show-toplevel)"
Schema
The configuration shape is published as
config-v1.schema.json,
a draft 2020-12 JSON Schema you can point an editor or a CI job at.
crates/canary-config/tests/schema.rs tests that file against the documented
shapes and the rejections version 1 states;
crates/canary-config/tests/schema_parity.rs tests it against this loader.
The two sides are deliberately not identical at one point. The schema also
constrains the shape of network, rpc_url and fixtures_dir — a name is one
token, an endpoint is an absolute http or https URL, a fixture directory is
a path relative to the project root — while the loader stores those three values
verbatim, so that a bad stored value cannot stop --network, --rpc-url or
--fixtures-dir from outranking it. The schema is therefore the stricter side
for exactly those documents, and that set is written down in the parity suite
rather than left to chance: nothing the schema accepts is something the loader
refuses, and every place the schema refuses more is listed, with its reason, and
re-tested.
completions
Prints a shell completion script on standard output, so you can save it to a file or source it directly from your shell configuration.
Print a shell completion script
Usage: stellar-canary completions <SHELL>
Arguments:
<SHELL>
Shell to generate a completion script for: bash, zsh, fish or powershell
Possible values:
- bash: Bourne-Again shell (`bash`)
- zsh: Z shell (`zsh`)
- fish: Friendly interactive shell (`fish`)
- powershell: Microsoft PowerShell (`powershell`)
Options:
-h, --help
Print help (see a summary with '-h')
Supported shells
Exactly four shells are accepted: bash, zsh, fish and powershell.
# bash: once, for all users
stellar-canary completions bash > /etc/bash_completion.d/stellar-canary
# zsh: into any directory on your $fpath
stellar-canary completions zsh > "${fpath[1]}/_stellar-canary"
# fish
stellar-canary completions fish > ~/.config/fish/completions/stellar-canary.fish
# PowerShell
stellar-canary completions powershell > stellar-canary.ps1
Reload the shell (or open a new one) after installing the file.
stdout is the script, stderr is everything else
The generated script is the only thing written to standard output, and a
successful run says nothing on standard error. That contract makes redirection
safe: stellar-canary completions bash > file writes exactly the script,
nothing more.
Errors and diagnostics go to standard error and never share stdout with a
script. An unsupported shell name — or a misspelling — is rejected by the
argument parser before anything is generated: the command exits with
exit code 2, the error on stderr lists the supported
shells (bash, zsh, fish, powershell), and stdout stays empty. The
same applies to a missing shell argument. There is no default shell: input is
never silently mapped onto one.
Generated from the real CLI
The script is produced from the same command definition the binary parses
with, so it always describes the actual command tree of your installed
version — every subcommand, option and flag, including ones added in later
releases. Nothing is duplicated by hand, so the completions cannot drift from
stellar-canary --help.
version
Prints the tool’s own version.
Print the tool version
Usage: stellar-canary version
Options:
-h, --help Print help
stellar-canary version
stellar-canary 0.3.0
Why version visibility matters here
toolVersion also appears in every JSON report,
independent of schemaVersion and targetProtocol. Because a fixture
pack can require a specific stellar-xdr/CLI capability (for example,
ContractExecutable XDR support was added in 0.1.1, not 0.1.0 — see
Releases), knowing exactly which CLI version produced a
given report matters when comparing results across machines, across CI
runs, or against the version compatibility table.
fixture-pack
Provides offline operations on fixture packs. Its primary subcommand,
fixture-pack verify, validates that a fixture pack directory matches
its registry-v1.json manifest by recomputing file checksums and the
canonical pack digest (CF-02).
Verify a fixture pack against its registry manifest
Usage: stellar-canary fixture-pack <COMMAND>
Commands:
verify Verify a fixture pack directory against its registry-v1.json manifest. Computes the CF-02 canonical pack digest and verifies file checksums. Exits 0 on success, 6 on checksum mismatch or verification failure
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
fixture-pack verify
Verify a fixture pack directory against its registry-v1.json manifest. Computes the CF-02 canonical pack digest and verifies file checksums. Exits 0 on success, 6 on checksum mismatch or verification failure
Usage: stellar-canary fixture-pack verify [OPTIONS] <PATH>
Arguments:
<PATH> Path to a fixture pack directory to verify
Options:
--registry <PATH> Path to the registry-v1.json manifest. If omitted, looks for registry.json in the pack root
-h, --help Print help
Arguments
| Argument | Description |
|---|---|
<PATH> | Required positional argument naming the fixture pack directory to verify. Must exist and be a directory. |
--registry <PATH> | Optional path to the registry manifest (registry-v1.json schema). When omitted, defaults to registry.json inside the root of the specified pack directory (<PATH>/registry.json). |
Verification behavior
stellar-canary fixture-pack verify operates completely offline: it
performs no network requests and executes no test fixtures. It validates
the pack directory against the registry manifest through the following
stages:
- Path and directory validation: Confirms that
<PATH>exists and is a directory. - Registry manifest loading: Loads the specified or default
registry.jsonfile, parses it strictly against theregistryVersion: 1schema (CF-02), and requiresregistryVersionto equal1. - Canonical pack digest calculation:
- Walks the fixture pack directory, excluding
.gitdirectories and rejecting any symbolic link, junction, or invalid path (CF-02). - Collects all regular
*.tomlfixture files and all payload files referenced byinput_fileorexpected_file. - Computes the SHA-256 hash and byte length of each distinct pack file.
- Formats lines of
<sha256> <size> <relative_path>\nsorted by pack-relative path in UTF-8 byte order, prefixed bycanary-pack-v1\n. - Computes the SHA-256 digest of this canonical representation (yielding
sha256:<hex>).
- Walks the fixture pack directory, excluding
- Pack digest check: Verifies that the computed pack digest matches the
packDigestrecorded in the registry manifest. - Fixture and payload checksum checks:
- For every fixture listed in the manifest, verifies that the file exists
and its SHA-256 hash matches the recorded
sha256. - For every payload entry associated with a fixture, verifies that the
payload file exists and its SHA-256 hash matches the recorded
sha256.
- For every fixture listed in the manifest, verifies that the file exists
and its SHA-256 hash matches the recorded
- Completeness check: Confirms that every file discovered during the pack walk is accounted for in the registry manifest (no unrecorded files are allowed in the pack digest).
Exit outcomes
fixture-pack verify strictly distinguishes between an unusable or
malformed invocation (exit 2) and a verification failure on an evaluated
pack (exit 6):
| Exit code | Name | Meaning |
|---|---|---|
0 | Pass | Verification succeeded: all fixture and payload file checksums match the manifest, and the computed pack digest matches packDigest. |
2 | ConfigurationError | Unusable invocation or invalid pack path: <PATH> does not exist or is not a directory; the registry file cannot be read or is invalid JSON; registryVersion is not 1; or the pack contains structural defects (e.g. symlinks, path traversal, or unparseable TOML). |
6 | VerificationFailure | Verification failed: the computed pack digest does not match the registry packDigest, a fixture or payload file is missing or has a checksum mismatch, or unrecorded files were found in the pack. |
Success output (Exit 0)
When verification passes, summary details are printed to standard output:
Fixture pack verification passed:
Protocol: 28
Registry version: 1
Pack digest: sha256:0123456789abcdef...
Fixtures verified: 5
All file checksums match registry.
Pack digest matches registry.
Verification failure output (Exit 6)
When an evaluated pack does not match the registry, specific failure diagnostics are printed to standard error:
error: pack digest mismatch
computed: 0123456789abcdef...
expected: fedcba9876543210...
Or for a file checksum mismatch:
error: fixture checksum mismatch for xdr/example.toml
computed: 0123456789abcdef...
expected: fedcba9876543210...
Examples
Verify a fixture pack directory containing registry.json at its root:
stellar-canary fixture-pack verify ./fixtures
Verify a fixture pack against an external or generated registry manifest:
stellar-canary fixture-pack verify ./protocol-28 --registry ./generated-registry.json
Exit Codes
stellar-canary’s process exit codes are a stable, documented contract —
GitHub automation and other callers rely on them rather than parsing
terminal text. They are defined in
crates/canary-core/src/errors.rs
as the ExitCode enum, and this page matches that source directly: the
exit_code_docs integration tests in canary-cli parse this file and
compare every table row and section heading against ExitCode::ALL, so a
new or renumbered exit code fails the test suite until this page is
updated (each value is also asserted by that source file’s own
exit_codes_match_the_documented_contract unit test).
| Code | Name | Meaning |
|---|---|---|
0 | Pass | Every applicable check passed. |
1 | CompatibilityFailure | At least one fixture’s compatibility assertion failed — a real incompatibility was found. |
2 | ConfigurationError | The invocation was unusable or no check applied, so no checks ran. |
3 | ExecutionError | At least one check could not complete — it was executed but hit an XDR, RPC, or Soroban execution problem. |
4 | InvalidFixture | A fixture file failed to load or validate, so the run never started. |
5 | InternalError | An internal error unrelated to configuration, fixtures, or the three compatibility surfaces. |
6 | VerificationFailure | Fixture pack verification failed — a file checksum or pack digest did not match the registry. |
Branching on the exit status
stellar-canary check --fixtures-dir ./fixtures
case $? in
0) echo "protocol-compatible" ;;
1) echo "incompatible: a check ran and failed (see report above)" ;;
2) echo "configuration error: no checks ran (see stderr)" >&2; exit 1 ;;
3) echo "execution error: checks could not complete (RPC down?)" >&2; exit 1 ;;
4) echo "invalid fixture: fix the fixture files first" >&2; exit 1 ;;
5) echo "internal error" >&2; exit 1 ;;
6) echo "verification failure: fixture pack does not match registry" >&2; exit 1 ;;
*) echo "unexpected exit code" >&2; exit 1 ;;
esac
The distinction CI usually cares about is 1 versus everything else:
exit 1 is compatibility evidence (a check ran and the surfaces
disagreed), while exits 2–6 mean the run itself needs attention and
prove nothing about compatibility either way.
0 — Pass
When it happens. Every applicable check passed. Concretely: check
finishes with a pass (or warning — warnings do not fail a run unless
warnings_are_failures is enabled in the policy or --fail-on-warning
is passed; the flag changes only the exit code, never the report status)
and no result recorded
an execution error; inspect, fixtures, report, cache clear, and
version complete successfully; config validate finds the project’s
.stellar-canary.toml valid (or no file at all, which is valid: the
built-in defaults apply); and check --allow-empty exits 0 on
a run in which no fixture applies.
Example. A nightly job runs stellar-canary check against the
Protocol 28 fixture pack after every merge; exit 0 is the “still
compatible, keep shipping” signal that lets the next stage publish the
release.
1 — CompatibilityFailure
When it happens. At least one fixture’s compatibility assertion
failed: the check ran and found a real mismatch (for example an XDR
value that no longer round-trips, or an RPC endpoint that no longer
reports the expected protocol). A warning result also becomes a
failure when the policy sets warnings_are_failures = true, or when
check --fail-on-warning is given. The run completed — exit 1 is
evidence, not an outage.
The read-only verdict commands use the same number for the same reason:
lock verify exits 1 when the pin does not hold and config validate
exits 1 when .stellar-canary.toml is not a valid configuration. In
each case the question the caller asked was answered, and the answer was
no — which is why neither is a 2, reserved for a call that could not be
answered at all.
Example. The configured RPC endpoint upgrades to protocol 29 while
the pack still asserts protocol 28: the identity fixture fails, check
exits 1, and CI blocks the release until the fixtures (or the
dependency) are updated.
2 — ConfigurationError
When it happens. No checks ran because the invocation itself was unusable:
--confignames a file that cannot be read or parsed;.stellar-canary.tomlcontains an unknown section or key (config is parsed strictly);--protocol 0or another invalid protocol value;--fixture/--surfacefilters that match no fixture;- the configured network passphrase does not match the one the endpoint reports;
--outputpoints at a path that cannot be written;- no fixture applies to the run — missing or empty fixtures directory,
or every fixture skipped by protocol, disabled surface, or missing
project capability — and
--allow-emptywas not given (since0.2.0).
Argument-parser usage errors (an unknown subcommand or flag) also exit
2: an unusable command line is a configuration problem too.
Example. A CI job passes --protocol 29 against a pack that only
contains Protocol 28 fixtures. Instead of the pre-0.2.0 vacuous exit
0, the run stops before executing anything and exits 2, forcing the
pipeline to notice that nothing was actually checked.
3 — ExecutionError
When it happens. A check was attempted but could not complete — most
commonly an unreachable or erroring RPC endpoint, but also an XDR or
Soroban execution problem. Any result with status error overrides the
pass/fail counts: a run that could not fully execute must never be
reported as a clean pass. Distinct from exit 1: here the check
couldn’t run, rather than running and finding a mismatch.
Example. A transient Stellar RPC outage lands mid-nightly: the XDR
checks still run and pass, the RPC fixture records an execution error,
and check exits 3. The CI step retries or pages — it does not mark
the protocol incompatible.
4 — InvalidFixture
When it happens. A fixture file failed to load or validate, so the
run never started: bad TOML, a missing required field, an unknown key
(fixture bodies are parsed strictly), an unrecognized surface, a
duplicate id across the fixture set, a dangling
input_file/expected_file reference, or a symbolic link, junction, or
unsafe path under the fixtures directory.
Example. A contributor adds a fixture but misspells description
as descrption: check exits 4 with the file, line, and missing
field, and the review bot fails the pull request before the fixture
pack ships broken.
5 — InternalError
When it happens. An error outside the configuration, fixture, and
execution categories: a Git-metadata or local-cache failure, or (for
inspect) a working directory that cannot be read. This page does not
fabricate a reproduction for it — triggering one requires an
environment fault (e.g. a corrupt local cache file) rather than a normal
CLI invocation. Its meaning is taken directly from the source’s
ErrorCategory::Internal mapping, not guessed.
Example. A corrupt entry in .stellar-canary-cache/ makes the run
abort before executing checks; check exits 5, and the fix is to
delete the cache directory (it is safe to remove) and re-run.
6 — VerificationFailure
When it happens. A fixture pack failed verification against its
registry manifest during fixture-pack verify: at least one fixture or
payload file has a checksum mismatch, a required file is missing from
the pack directory, an unrecorded file is present in the pack digest, or
the overall computed pack digest does not match the packDigest recorded
in the registry.
Like exit 1, this is evidence rather than an outage: the verification
command ran to completion and answered whether the fixture pack is intact
and matches its manifest.
Example. A fixture file was modified locally without updating the
registry manifest, or a file was corrupted in transit. Running
stellar-canary fixture-pack verify ./fixtures detects the mismatch,
prints the computed and expected checksums to stderr, and exits 6.
How the mapping works
Every error in the CLI is a CanaryError variant, which is classified
into one of four categories, which in turn maps to an exit code:
CanaryError variant | Category | Exit code |
|---|---|---|
Configuration, Project | Configuration | 2 |
Fixture | Fixture | 4 |
Xdr, Rpc, Soroban | Execution | 3 |
Git, Cache, Internal | Internal | 5 |
A check run that completes does not flow through CanaryError at all:
canary_core::exit_code_for_run turns the run’s results and policy
decision into the exit code — 3 if any result recorded an execution
error (overriding everything else), 1 for a fail decision, and 0
for pass or warning. Only main.rs terminates the process, and it
does so with ExitCode::code() — no exit status is produced anywhere
else, which the exit_code_docs tests also enforce for
crates/canary-cli/src.
Verified examples
Each of these was captured from a real run of the v0.1.1 binary, not
written from memory:
Exit 0 — check against the real Protocol 28 pack: 5/5 applicable checks passed.
Exit 1 — check against a fixture with a deliberately wrong
expected value:
error: (terminal output shows "❌ FAIL" and "Status: NOT READY";
the machine-readable status is "fail" — see JSON Report)
Exit 2 — check --config /does/not/exist.toml:
error: configuration error: failed to read configuration file /does/not/exist.toml: No such file or directory (os error 2)
Exit 3 — check with --rpc-url pointed at an unreachable host:
Failure:
p28-rpc-network
failed to call GetNetwork
network transport error calling getNetwork: error sending request for url (...)
Note that in this case the XDR checks still ran and passed (3/3 PASS)
— an RPC outage does not block offline checks. status in JSON output is
"error", which overrides whatever the pass/fail counts alone would
otherwise suggest.
Exit 4 — check against a fixture missing a required field:
error: invalid fixture: failed to parse fixture file /path/bad.toml: TOML parse error at line 1, column 1
|
1 | id = "demo-missing-field"
| ^^^^^^^^^^^^^^^^^^^^^^^^^
missing field `description`
Exit 5 is reserved for internal errors (Git metadata or local-cache
failures) — see when it happens above.
Exit 6 — fixture-pack verify against a pack whose computed digest
does not match the registry:
error: pack digest mismatch
computed: 0123456789abcdef...
expected: fedcba9876543210...
Protocol 28
Protocol 28 is the only protocol version Protocol Canary currently
supports. This page describes exactly what the currently implemented
Protocol 28 checks verify, using the real fixture pack in
ProtocolCanary-Fixtures/protocol-28
— and, just as importantly, what they do not.
Protocol 28 is implemented in Stellar Core 28.0.0, Stellar RPC 28.0.0, and
the official stellar-xdr 28.0.0 crate. Among its changes, three CAPs are
relevant to this project’s three compatibility surfaces:
Protocol 28
├── CAP-0083 (validators can vote to drop a transaction set)
├── CAP-0085 (externally managed contract executables / fleet upgrades)
└── CAP-0086 (sparse-map host functions for storage migration)
What the current pack contains
At fixture-pack revision e9d098d,
the protocol-28 pack holds 93 fixture definitions: 86 XDR, 2 RPC, and 5
Soroban. That is the pack’s inventory, not the number of checks any one
project runs: a run loads the fixtures for its target protocol, then applies
its own configuration (enabled surfaces, RPC endpoint, project capabilities,
--fixture/--surface), so a report covers only the applicable subset.
The five fixtures below are the historical first-run subset, verified
against https://soroban-testnet.stellar.org. They illustrate each surface;
they are not the pack:
| Fixture | Surface | What it proves |
|---|---|---|
p28-xdr-cap83-empty-tx-set | XDR | A StellarValue using CAP-0083’s STELLAR_VALUE_EMPTY_TX_SET case round-trips byte-for-byte through the official stellar-xdr crate. |
p28-xdr-cap85-external-ref-roundtrip | XDR | A well-formed CAP-0085 ContractExecutable::ExternalRef value round-trips byte-for-byte. |
p28-xdr-cap85-external-ref-malformed | XDR | A truncated encoding of the same CAP-0085 shape is correctly rejected, not silently accepted. |
p28-rpc-network | RPC | The configured RPC endpoint’s getNetwork response reports protocolVersion = 28 and includes a string passphrase field. |
p28-soroban-native-asset-name | Soroban | A real, unsigned InvokeHostFunction transaction can be built and simulated end-to-end, by calling the standard SEP-41 name() function on the network’s reserved native-asset Stellar Asset Contract. |
The “5/5 PASS” transcript quoted in early documentation is this five-fixture subset’s result, not a statement about the current pack and not a claim of full Protocol 28 compatibility. Fixture counts are not checks run, and neither is a network observation: only the RPC and Soroban fixtures contact a live network, and any claim about live behavior rests on the dated verification recorded in the pack’s evidence files.
What this pack does not check
- CAP-0085 host-function semantics beyond the wire format. The two
CAP-0085 fixtures prove the encoding round-trips; they do not deploy a
real externally-managed-executable contract fleet end-to-end (owner
contract,
ExecutableTagObjectentry, an instance referencing it, and a resolved invocation). Building that verifiably requires upstreamstellarCLI support for constructing such a deployment, which was not yet available (27.1.0) when this pack was authored. - CAP-0086 sparse-map host functions — a documented gap, not an
oversight. CAP-0086 adds no new top-level XDR type; it is
host-environment behavior only observable by invoking a deployed
contract that calls
sparse_map_new_from_linear_memory/sparse_map_unpack_to_linear_memory. As of this pack’s release, the latest publishedsoroban-sdkdoes not expose these functions at any stable, documented API surface, so no fixture exists for them yet. This gap closes once the SDK exposes them or a verified deployed contract using them can be pointed to — see Roadmap. - Anything about a specific downstream application beyond whether the fixtures applicable to it pass against its own configured dependencies and RPC endpoint.
- Mainnet. Every fixture in this pack was verified against Testnet
only. Running against mainnet requires
--network mainnet --rpc-url <endpoint>explicitly and has not itself been separately verified.
Consuming this pack
stellar-canary check --fixtures-dir <checkout>/protocol-28 --protocol 28 --json
# or, scanning every protocol pack in a fixtures checkout at once:
stellar-canary check --fixtures-dir <checkout> --protocol 28 --json
Both forms work identically — see Fixtures for why:
the loader filters by each fixture’s own declared protocol field, not
by directory path.
Adding more Protocol 28 fixtures
See Authoring a Fixture. Every new fixture must
cite a real upstream source (a CAP number, an XDR definition, or an
official RPC/host-function reference) in its source_reference field —
fixtures are never added merely to raise a coverage number.
Fixtures
A fixture is a single declarative compatibility assertion: one TOML file describing one concrete thing to check — an XDR value that must round-trip, an RPC response that must match a shape, or a Soroban call that must simulate successfully.
Why fixtures are separate from the engine
Fixtures live in their own repository,
ProtocolCanary-Fixtures,
deliberately separate from the Protocol-Canary engine that runs them:
- Fixtures are data, not code. A fixture file is plain TOML. There is no field that executes a shell command, script, or arbitrary code, and none will be added — this is a hard trust boundary, since fixtures are public and consumed by CI pipelines. See Security.
- Fixtures version independently of the engine. A new protocol pack
can be added to
ProtocolCanary-Fixtureswithout aProtocol-Canaryrelease, as long as it fits the existing schema. - Anyone can supply their own fixture directory.
--fixtures-diraccepts any local path — aProtocolCanary-Fixturescheckout is the canonical source, not the only possible one.
Directory structure
Any directory tree works. The loader recursively walks --fixtures-dir
and collects every file ending in .toml, at any depth. Subdirectory
names (xdr/, rpc/, soroban/, protocol-28/xdr/cap-0083/) are a
convention for human navigation only — the loader does not read directory
names to determine a fixture’s surface or protocol; only the fixture
file’s own surface and protocol fields matter. Non-.toml files
(READMEs, licenses) are silently ignored. Fixtures load in
sorted-by-path order, which is what makes stellar-canary fixtures and
stellar-canary check output deterministic.
To see which fixtures a directory actually contains before running them,
use stellar-canary fixtures --fixtures-dir <path> --protocol <N> — it
loads the directory exactly the way check does and lists everything it
picked up, grouped by surface, without executing a single assertion. See
fixtures for the full command reference.
The real protocol-28 pack looks like this:
protocol-28/
├── README.md
├── rpc/
│ └── p28-rpc-network.toml
├── soroban/
│ └── p28-soroban-native-asset-name.toml
└── xdr/
├── cap-0083/
│ └── p28-xdr-cap83-empty-tx-set.toml
└── cap-0085/
├── p28-xdr-cap85-external-ref-malformed.toml
└── p28-xdr-cap85-external-ref-roundtrip.toml
Schema
Every fixture file has this common shape (from
schemas/fixture-v1.schema.json
in ProtocolCanary-Fixtures, which mirrors the loader’s actual
implementation):
id = "unique-string" # required, pattern ^[a-z0-9][a-z0-9-]*$
protocol = 28 # required, integer
surface = "xdr" # required: "xdr" | "rpc" | "soroban"
category = "cap-0083" # required, free-text (avoid "misc"/"other")
description = "..." # required
source_reference = "CAP-0083" # strongly expected: an authoritative upstream reference
required_capabilities = ["soroban-contract"] # optional, see below
# optional: paths to externally stored input/expected data, relative to
# this file's own directory — existence-checked by the validator
input_file = "large-payload.xdr.b64"
expected_file = "expected.xdr.b64"
# everything else is surface-specific — see the per-surface tables below
required_capabilities values are kebab-case canary_core::Capability
names: soroban-contract, rpc-client, stellar-sdk-dependency,
wasm-artifact, raw-ledger-access. A fixture requiring a capability the
target project doesn’t have is skipped, not failed.
Per-surface body fields
surface | Required body fields |
|---|---|
xdr | type (StellarValue | ContractExecutable | ScVal | LedgerEntry | TransactionEnvelope), kind (decode-success | decode-failure | roundtrip | encode-equals | decode-json-equals), value_base64, expected_base64 (only for encode-equals), and expected_json (only for decode-json-equals) |
rpc | method (get-network | get-latest-ledger), assert — an array of {kind, field, value?, expected_type?} |
soroban | source_account, contract_id, function, sequence_number, optional args, and expect ({kind = "simulation-success"} or {kind = "simulation-error", message_contains?}; simulation-success may additionally declare [[expect.required_auth]] entries — {address, function_name?, min_sub_invocations?} — checked against the simulation’s reported authorization entries) |
Comparing decoded XDR to expected JSON
A decode-json-equals fixture decodes value_base64 as type and compares
the result with expected_json, so the expected contents can be written as
readable JSON instead of bytes:
type = "ScVal"
kind = "decode-json-equals"
value_base64 = "AAAABQAAAAAAAAAq"
expected_json = '''
{ "u64": "42" }
'''
- The JSON form is
stellar-xdr’s own (the onestellar xdr decode --output jsonprints):snake_casefield names, union arms as a single-key object (or a bare string for an arm without a payload), 64-bit integers as decimal strings, opaque bytes as lowercase hex, and keys as strkeys. expected_jsonis JSON text, not a TOML table, because decoded values can containnull, which TOML cannot express. Malformed JSON makes the fixture invalid (exit 4), with the position counted from the start of that text.- The comparison is exact on the parsed JSON. Object key order and whitespace
are ignored; every key, value, JSON type, array element and array position
must match. A field left out of
expected_jsonis reported as an unexpected field, not treated as a wildcard. - A mismatch fails the check and lists each difference by its JSON Pointer
path (RFC 6901, so
/in a key is written~1and~is~0), for example/tx/tx/fee: expected 200, found 100, or/tx/tx/time_bounds: missing field (expected null). Input that does not decode fails with the decode error.
For Soroban argument typing and XDR ScVal authoring details, see docs/fixtures/scval.md.
ID resolution and protocol filtering
The id field is the fixture’s identity everywhere — the string shown in
stellar-canary fixtures, the testId/fixtureId in results and the
JSON report, and what duplicate-checking validates against. IDs must be
unique across the entire loaded directory tree, not just one file.
Each fixture declares its own protocol. A run’s target protocol is
compared against every loaded fixture’s protocol; a mismatch is
skipped (with a stated reason), never failed. This means a single
--fixtures-dir can safely hold fixtures for multiple protocol versions
side by side.
Validation
ProtocolCanary-Fixtures ships a structural validator:
python3 tools/validate/validate.py
It checks schema conformance, unique IDs, protocol/surface enums, source
references, and that every referenced file actually exists. It is
structural only — it never executes a fixture’s assertion and never makes
a network call. python3 -m unittest discover tests runs its own test
suite.
Protocol-Canary’s own loader performs the load-time validation that
actually gates a check/fixtures run: a duplicate ID, a dangling
input_file/expected_file reference, an unsafe reference (absolute, ..,
backslash or drive prefix), a symbolic link anywhere in the fixture tree, or
a structurally invalid file
(bad TOML, missing required field, unrecognized surface) fails the
whole load with exit code 4 — never silently treated
as a project incompatibility.
Testing a fixture
stellar-canary fixtures --fixtures-dir <path> --protocol <N> # confirm it's picked up
stellar-canary check --fixtures-dir <path> --protocol <N> # actually run it
The fixtures command is the preview half of that pair — see
fixtures for its options and output format.
Adding a fixture or a protocol pack
See Authoring a Fixture for the contributor
workflow, and ProtocolCanary-Fixtures’s own CONTRIBUTING.md
for repository-specific review expectations. A new protocol pack follows
the same schema and directory convention as protocol-28/ — see
protocol-27/ in the Fixtures repository for a real example of an
intentionally not-yet-populated pack (fixtures are added only after their
upstream behavior is independently verified, never as placeholders).
Authoring a Fixture
This is the contributor workflow for adding one new fixture to
ProtocolCanary-Fixtures.
It exists to raise the bar on what counts as a real compatibility
assertion — fixtures are never added merely to increase a coverage
number, and a reviewer must be able to answer all of the following from
the fixture file and its header comment alone, without running anything:
- What Stellar behavior does this test?
- Why is that behavior important?
- What protocol/CAP introduced it?
- What is the expected result, and where does that expectation come from?
- Is the test deterministic?
Steps
- Identify a concrete compatibility assertion. Read the CAP text, the upstream XDR definition, the upstream implementation, or the official release/API docs — in that order of preference. Never cite a source you have not actually checked describes the specific behavior you are asserting.
- Determine the applicable protocol version and pick a stable ID
following
p<protocol>-<surface>-<slug>(e.g.p28-xdr-cap85-external-ref-roundtrip). IDs are lowercase and unique across the entire repository — the loader validates this across every*.tomlfile under a given--fixtures-dir, not just one file. Never rename an ID just because an implementation detail changed; if the semantic assertion itself changes, add a new ID instead of repurposing an old one. - Create a fixture matching the real schema — see Fixtures
for the exact common fields and per-surface body. Set
source_referenceto an authoritative URL or CAP identifier, and add a header comment (a#block above the TOML body) explaining, in prose, how the expected value was derived or observed — e.g. “built with the officialstellar-xdr28.0.0 crate against the CAP-0083StellarValuetype”, not “looks right”. Use deterministic input: no fixture may depend on ledger state that changes between runs (a current ledger sequence, “the latest anything”) unless the assertion is explicitly scoped and documented as a live-network check. - Validate it:
python3 tools/validate/validate.py - Run it through the real CLI:
stellar-canary fixtures --fixtures-dir <path> --protocol <N> stellar-canary check --fixtures-dir <path> --protocol <N> - Add or update documentation — the relevant
docs/protocol-NN.mdtable inProtocolCanary-Fixtures, and this site’s Protocol 28 page if you touched that pack. - Submit a pull request against
ProtocolCanary-Fixtures, following its ownCONTRIBUTING.md.
What does not belong in a fixture
- A shell command, script, or any other executable field — none exists in the schema, and a pull request introducing one is rejected regardless of stated purpose.
- A private key, seed phrase, or funded-account secret. A
source_accountis a public address only, used to build an unsigned transaction. - A fixture whose expected value was guessed, “probably correct”, or not independently checked against an authoritative source — see the CAP-0086 gap on the Protocol 28 page for what happens instead when a real fixture cannot yet be built responsibly: it is documented as a gap, not filled with an unverifiable guess.
JSON Report
This documents stellar-canary check --json (equivalently --format json)
output, as implemented in crates/canary-report/src/json.rs and verified
by running the real v0.1.1 binary against the real
ProtocolCanary-Fixtures protocol-28 pack. This is the exact contract
ProtocolCanary-Action consumes to build its GitHub
job summary and annotations.
schemaVersion is currently 1. A purely additive field (like git
and counts were, historically) does not bump it; an incompatible shape
change would.
Real example (PASS)
{
"schemaVersion": 1,
"toolVersion": "0.1.1",
"targetProtocol": 28,
"project": { "name": "Protocol-Canary", "type": "unknown" },
"network": { "name": "testnet", "observedProtocol": 28 },
"status": "pass",
"counts": { "total": 5, "passed": 5, "failed": 0, "warnings": 0, "errors": 0, "skipped": 0 },
"results": [
{ "testId": "p28-xdr-cap83-empty-tx-set", "protocol": 28, "surface": "xdr", "status": "pass", "summary": "StellarValue round-tripped byte-for-byte", "durationMs": 0, "fixtureId": "p28-xdr-cap83-empty-tx-set", "source": "live" }
],
"git": { "commit": "ffa072cb14c682bfa5ebf158ab9bbe6058962aef", "branch": "main", "isDirty": false },
"verbose": false
}
(Full five-result example in Your First Check.)
Field reference
| Field | Type | Always present? | Notes |
|---|---|---|---|
schemaVersion | integer | yes | Currently 1. |
toolVersion | string | yes | The CLI’s own semver, independent of schemaVersion/targetProtocol. |
targetProtocol | integer | yes | The protocol this run checked against. |
project.name | string | yes | Directory name of the project root. |
project.type | string | yes | One of soroban, rpc-consumer, stellar-sdk, generic-stellar, unknown. |
network | object | absent | only when rpc or soroban checks are enabled | Omitted entirely for a fully offline (XDR-only) run — its absence is the offline signal. |
network.name | string | when network present | testnet, mainnet, futurenet, or a custom network name. |
network.observedProtocol | integer | absent | when network present and getNetwork succeeded | Absent if the live call failed. Compare against targetProtocol to detect a protocol mismatch — do not assume they match. |
network.error | string | absent | when network present and getNetwork failed | Explanation of why the network identity could not be observed. |
status | string | yes | pass, warning, fail, or error. error means at least one result is error (an execution problem) and overrides what the pass/fail counts alone would suggest — the same precedence the process exit code follows. |
counts | object | yes | Aggregate over results only; skipped fixtures are counted separately and never included in counts.total. Always re-derivable from results[].status. |
counts.total | integer | yes | results.length. |
counts.passed / .failed / .warnings / .errors | integer | yes | Count of each status among results. |
counts.skipped | integer | yes | skipped.length. |
results | array | yes | One entry per fixture that actually ran. Empty is a valid shape, but after 0.1.1 check only produces it with --allow-empty; otherwise a run with no applicable fixture exits 2 and prints no report. 0.1.1 and earlier reported such a run as a pass. counts.total == 0 is never evidence of compatibility. |
results[].source | string | absent | "live" or "cache" | "live": executed during this run. "cache": replayed from the local result cache (an earlier run, not an observation made now). Absent in reports written by 0.1.1 and earlier, which means not recorded, not “live”. |
results[].testId / .fixtureId | string | yes (fixtureId may be null) | Currently always equal to each other and to the fixture’s id. |
results[].protocol | integer | yes | The fixture’s own declared protocol. |
results[].surface | string | yes | xdr, rpc, or soroban (lowercase). |
results[].status | string | yes | pass, warning, fail, error, or skipped (in practice, results[] entries are never skipped — see skipped below). |
results[].summary | string | yes | One-line human-readable outcome. |
results[].details | string | absent | only when there’s something to say | Present for failures/errors; absent (not null) when there’s nothing further. |
results[].durationMs | integer | yes | Wall-clock time for that fixture. |
skipped | array | only when non-empty | Fixtures the planner decided not to run, and why. Omitted entirely (not []) when there are none. |
skipped[].fixtureId / .surface / .reason | string | yes | reason is human-readable, e.g. "fixture targets protocol 27, this run targets protocol 28". |
skipped[].code | string | yes | Stable machine-readable skip reason (UNSUPPORTED_PROTOCOL, SURFACE_DISABLED, MISSING_CAPABILITY, OFFLINE, NETWORK_MISMATCH, or UNKNOWN). Absent in reports written before the field existed. |
git | object | yes | Always present, with null fields when unavailable (not a Git repo, detached HEAD) — never omitted, never an error. |
git.commit / .branch | string | null | yes | |
git.isDirty | boolean | null | yes | |
verbose | boolean | yes | Whether --verbose was enabled. |
run | object | absent | only when build provenance was recorded | Build provenance of the engine. Absent in reports written before the field existed (not recorded). Deliberately carries no timestamp so two builds of one commit stay byte-for-byte comparable. |
run.toolBuildCommit | string | null | when run present | The Git commit the binary was built from, or null when built without Git history. |
Backward compatibility around counts
counts and git were added after schemaVersion 1 was first shipped,
as purely additive fields. A consumer reading an older report that
predates counts should derive it from results[].status rather than
assume the field exists — this is exactly what
ProtocolCanary-Action does (see its
tests/unit/output.test.ts), so it works against both the 0.1.0 and
0.1.1 Protocol-Canary releases.
Real example (execution error)
Status: error
"results": [
{ "testId": "p28-rpc-network", "surface": "rpc", "status": "error",
"summary": "failed to call GetNetwork",
"details": "network transport error calling getNetwork: error sending request for url (...)" }
]
network.observedProtocol is correctly absent here — the live call
never returned a value — while network.name is still present and
network.error carries the transport failure details.
What a downstream consumer should key off of
- Overall pass/fail:
status, not the process exit code, if you’re parsing a saved file rather than checking$?directly — remembererrortakes precedence. - Per-check detail (a PR comment, an annotation): iterate
results, usingsurfaceto group andstatus/summary/detailsfor content. - “N/M passed” summaries:
counts.passed/counts.totaldirectly — never compute a percentage without stating the denominator. - Protocol mismatch detection: compare
targetProtocoltonetwork.observedProtocolwhen both are present.
Reading a saved report back
stellar-canary report result.json --format markdown
parses exactly this shape and re-renders it without touching the network
— see report.
Viewing a report in the browser
The same JSON report can be opened in the static
report viewer, a single local page published at
/viewer/ on this site. Drop the file onto that page: it is validated
in the browser, shown as an accessible findings list, and never
uploaded anywhere.
Selecting a fixture id in that list opens a detail dialog. The report provides the run-specific findings: the test and fixture identity, surface, outcome status, duration, summary, failure details, and the target and observed protocol numbers.
Additional fixture provenance — its SHA-256 hash, pack digest, category,
description, and required capabilities — is not stored in the JSON report.
To view these details, select the matching stellar-canary fixtures --format json
output in the optional second file picker. When an inventory is loaded,
the viewer joins it with the report findings in-browser and enables copy
controls for the cryptographic hashes.
Reports also do not carry verification records (verification evidence lives with the fixture pack, not within a run report). The dialog displays every unsupplied field as missing rather than guessing, so when verification records or fixture hashes are not present, it explicitly notes that no verification information is available.
GitHub Action
StellarCanary/ProtocolCanary-Action
is the official GitHub Actions integration. It is a thin wrapper around
the real stellar-canary CLI — it does not know what a CAP means, does
not reimplement XDR/RPC/Soroban testing, and never reinterprets a
compatibility result the CLI didn’t report.
What it does
- Installs the requested
Protocol-Canaryversion (from source, pinned to an immutable commit — see Installation & integrity). - Runs
stellar-canary check --format jsonwith your inputs. - Publishes a GitHub job summary and (optionally) annotations from that JSON.
- Optionally uploads the JSON report as a workflow artifact.
- Passes or fails the job according to Canary’s own exit code — never a result the Action computed itself.
What it does not do
- It does not reimplement any compatibility check itself.
- It does not require a private key, and never submits a transaction — same guarantee as the CLI it wraps.
- It does not use Docker, a paid service, or a hosted backend.
- There is deliberately no
formatinput: the Action always requests--format json(the only way it can build the summary and annotations), and never invokes Canary twice.
Quick start
- uses: actions/checkout@v4
- uses: StellarCanary/ProtocolCanary-Action@v1
with:
protocol: "28"
@v1 is the published, floating major-version tag — the documented
consumer path. (uses: ./ only appears inside this Action’s own internal
integration test workflow; it is not something a consumer should write.)
Inputs
| Input | Description | Default |
|---|---|---|
protocol | Target Stellar protocol version (--protocol). | (from .stellar-canary.toml, or 28) |
config | Path to .stellar-canary.toml (--config). Fails clearly if the given path does not exist. | (CLI default lookup) |
network | Network for live RPC/Soroban checks (--network). | testnet (CLI default) |
rpc-url | Stellar RPC endpoint (--rpc-url). Must be https://, or http://localhost/127.0.0.1 for local development. | (none) |
fixtures-dir | Path to a directory of fixtures, e.g. a checkout of ProtocolCanary-Fixtures (--fixtures-dir). | fixtures |
version | Protocol-Canary version to install, without a leading v. Pinned — never tracks main. | 0.1.1 |
upload-report | Upload the JSON report as a workflow artifact. | true |
annotations | Emit GitHub annotations for failures/warnings/errors. | true |
timeout-minutes | Maximum time to let Canary run before it is terminated. | 15 |
Outputs
| Output | Description |
|---|---|
status | pass, warning, fail, error, or execution-failed (the Action’s own value when Canary could not produce a report at all). |
passed | Number of checks that passed. |
warnings | Number of checks that produced a warning. |
failures | Number of checks that failed a compatibility assertion. |
errors | Number of checks that could not complete due to an execution error. |
report | Absolute path to the generated JSON report file. |
Fixtures checkout
The Action does not read fixture files itself — it only forwards
--fixtures-dir to the CLI. To check against the real Protocol 28 pack,
check it out as a separate step and point fixtures-dir at it:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: StellarCanary/ProtocolCanary-Fixtures
path: canary-fixtures
- uses: StellarCanary/ProtocolCanary-Action@v1
with:
protocol: "28"
fixtures-dir: canary-fixtures/protocol-28
network: testnet
rpc-url: https://soroban-testnet.stellar.org
Installation & integrity
The Engine (Protocol-Canary) does publish prebuilt release assets. The
v0.3.0 release
carries SHA256SUMS and downloadable archives for four target triples:
stellar-canary-x86_64-unknown-linux-gnu.tar.gz,
stellar-canary-x86_64-apple-darwin.tar.gz,
stellar-canary-aarch64-apple-darwin.tar.gz, and
stellar-canary-x86_64-pc-windows-msvc.zip. That describes what the Engine
publishes; it does not describe how the Action documented on this page
obtains it.
The v1 tag documented here is pinned to
source commit 42790008fa8ab4580c6de7900af57fba2f8766ed.
That commit’s installer still builds the requested Engine version from
source with cargo install --git --locked, pinned to the immutable commit
the version’s tag resolved to at run time (falling back to the tag itself,
with a visible warning, only if that resolution fails). It does not
download release assets, and its version input defaults to 0.1.1. A
Rust/Cargo toolchain is therefore required on the runner — GitHub-hosted
Ubuntu runners include one by default. A successful build is cached
(best-effort, via actions/cache; never required for correctness). See
Releases for the Engine/Action release split.
Summary, annotations, and artifact
- Job summary — a per-surface pass/fail table rendered from the JSON report.
- Annotations (when
annotations: true, the default) — each failing, warning, or errored fixture becomes a GitHub Actions annotation pointing at the specifictestId. - Artifact (when
upload-report: true, the default) — the raw JSON report is uploaded as a workflow artifact namedstellar-protocol-canary-report. Artifact upload is always auxiliary: if it fails, the underlying compatibility result is unaffected, and a warning is logged rather than the job failing on that account alone.
Failure behavior
See CI Workflows & Failure Behavior for the full distinction between a compatibility failure and an execution failure, and what each looks like in a real workflow run.
Timeout behavior
timeout-minutes (default 15) bounds how long the Canary process is
allowed to run. If it is exceeded, the process is terminated and the
Action reports status: execution-failed with a timeout diagnostic —
never a fabricated compatibility result.
Supported Canary versions
| Action | Protocol-Canary |
|---|---|
v1 | 0.1.1 (default; 0.1.0 also installable, but predates the ContractExecutable XDR type two current Protocol 28 fixtures require, and its report predates the counts field) |
This table grows as Protocol-Canary cuts new releases; a schemaVersion
change to its JSON report would be a breaking change for this Action and
would be called out here explicitly.
CI Workflows & Failure Behavior
A complete, minimal workflow
This is a real workflow, taken directly from
ProtocolCanary-Action’s examples/protocol-28.yml
— checking a project against the real Protocol 28 fixture pack, against a
live Testnet RPC endpoint:
name: Stellar Compatibility (Protocol 28)
on:
pull_request:
permissions:
contents: read
jobs:
compatibility:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Checkout Protocol 28 fixtures
uses: actions/checkout@v4
with:
repository: StellarCanary/ProtocolCanary-Fixtures
path: canary-fixtures
- name: Stellar Protocol Canary
uses: StellarCanary/ProtocolCanary-Action@v1
with:
protocol: "28"
fixtures-dir: canary-fixtures/protocol-28
network: testnet
rpc-url: https://soroban-testnet.stellar.org
permissions: contents: read is sufficient — the Action does not need
write access to your repository to check compatibility. A project with no
Soroban contracts, for example, can set [tests] soroban = false in its
own .stellar-canary.toml without this workflow needing to change.
Using the Action’s outputs
- name: Stellar Protocol Canary
id: canary
uses: StellarCanary/ProtocolCanary-Action@v1
with:
protocol: "28"
upload-report: "true"
- name: Show result
if: always()
run: |
echo "status: ${{ steps.canary.outputs.status }}"
echo "passed: ${{ steps.canary.outputs.passed }}"
echo "failures: ${{ steps.canary.outputs.failures }}"
(From examples/pull-request.yml.)
Two different kinds of “red”
The Action distinguishes a compatibility failure from an execution failure — they are not the same thing, and it never conflates them:
| Compatibility failure | Execution failure | |
|---|---|---|
| Meaning | Canary ran successfully and found a real incompatibility | Canary could not be installed, could not run, timed out, or produced output that could not be parsed |
status output | fail (or warning/error) | execution-failed |
| Job summary | A per-surface table naming the specific failing test IDs | “Protocol Canary could not be executed” with the actual diagnostic — never a fabricated compatibility message |
A third, separate case — the job summary itself failing to publish — is reported as “Failed to publish Canary summary,” distinct from both.
What a compatibility failure looks like
When a fixture’s assertion genuinely fails, the underlying CLI exits 1
(see Exit Codes), and:
- The job fails — the workflow step reports non-zero.
- The job summary shows the per-surface pass/fail table with the
specific failing
testId(s). - A GitHub annotation is created pointing at the failing fixture (when
annotations: true, the default). - The artifact (
stellar-protocol-canary-report, whenupload-report: true) still uploads — a compatibility failure is a real result, not an upload problem, so the report is preserved for inspection either way.
This has been verified end-to-end against the real, published @v1
Action: a deliberate FAIL run produced a failed job, an annotation naming
the exact failing fixture, status: fail, and the JSON artifact matching
the documented schema — the same pipeline as a PASS run, just with a
different, honestly reported result.
Network vs. compatibility failures
A failure to reach the configured RPC endpoint is not a compatibility
failure — it is an execution problem. status is error (not fail),
the affected fixtures report "status": "error" with a transport-error
message, and any offline (XDR) fixtures in the same run are unaffected and
still report their real pass/fail result. See
Network Troubleshooting
for how to tell the two apart when triaging a red CI job.
Troubleshooting
stellar-canary: command not found
Symptom. Shell reports the binary doesn’t exist after cargo install.
Likely cause. ~/.cargo/bin isn’t on your PATH, or the install
targeted a different Cargo home.
What to check. cargo install --list | grep canary-cli and
echo $PATH.
Fix. Add ~/.cargo/bin (or your $CARGO_HOME/bin) to PATH, or
invoke the binary by its full path.
Wrong version reported
Symptom. stellar-canary version prints a version other than the current
Engine release (0.3.0), or behavior doesn’t match this documentation.
Likely cause. An older install is still first on PATH, or cargo install
was run without the current release’s pinned --tag. A correct current
install is not expected to print 0.1.1; the 0.1.1 guidance is historical
and kept below only for readers maintaining that old release.
What to check. stellar-canary version, which stellar-canary, and the
version installed by the current installation instructions.
Fix. Follow Installation to install the pinned
current release with --force, and confirm that ~/.cargo/bin (or
$CARGO_HOME/bin) precedes any older binary directory on PATH. Readers
with a current install should use that guide, not the historical command
below.
Historical: v0.1.1 version-mismatch behavior
The old 0.1.1 release is the one that expected stellar-canary version to
print 0.1.1. If you deliberately need that release, its reinstall command
was:
cargo install --git https://github.com/StellarCanary/Protocol-Canary --tag v0.1.1 --locked --force.
Do not run that command to fix a current install: it replaces the binary with an old release.
Historical note for 0.1.0: 0.1.0 predates ContractExecutable XDR
support two current Protocol 28 fixtures require, and its report predates the
counts field — see Releases.
Fixture directory not found
Symptom. check fails with no checks ran: ... (exit code 2), or
fixtures reports no fixtures, when you expected fixtures to run. With
0.1.1 and earlier, check instead reported 0/0 applicable checks and
passed.
Likely cause. --fixtures-dir is missing, misspelled, or relative to
the wrong working directory. The error message says whether the directory is
missing, empty, or whether its fixtures were skipped because of the target
protocol, a disabled surface or a missing capability.
What to check. stellar-canary fixtures --fixtures-dir <path> --protocol <N>
first, to see exactly what would be loaded, before running check.
Fix. Correct the path, or confirm you’re in the directory you think you’re in.
Malformed .stellar-canary.toml
Symptom. check exits with code 2 and a failed to parse configuration file error, for example with protocol = "28" (a string
instead of a number):
error: configuration error: failed to parse configuration file .stellar-canary.toml: TOML parse error at line 2, column 12
|
2 | protocol = "28"
| ^^^^
invalid type: string "28", expected u32
Likely cause. The config file exists but isn’t valid for the schema:
a TOML syntax error (an unclosed quote or [table header), a value of
the wrong type, or a missing required field (version and protocol
are required). This applies both to a file passed with --config and to
a .stellar-canary.toml picked up from the project root.
What to check. The line and column in the error; the caret marks the offending text.
Fix. Correct that line and rerun. Nothing runs until the file parses.
Unsupported config version
Symptom. check exits with code 2 and:
error: configuration error: unsupported configuration version 2 in .stellar-canary.toml: this build supports version 1
Likely cause. The file’s version field doesn’t match the config
schema version (SUPPORTED_CONFIG_VERSION) of the installed CLI. This
is typically a config written for a newer or older Protocol Canary
release than the one you have installed. 0.1.1 supports version 1
only.
What to check. The version line in the config file, and
stellar-canary version.
Fix. Set version = 1 if the rest of the file matches this
release’s schema, or install the Protocol Canary release the config was
written for.
Malformed fixture
Symptom. check/fixtures exits with code 4 and a TOML parse
error or “missing field” message.
Likely cause. A required field is missing (every fixture needs id,
protocol, surface, category, description), a surface-specific
required field is missing (see Fixtures),
or the TOML itself doesn’t parse.
What to check. The exact file path in the error message, and the schema table in Fixtures.
Fix. Correct the file. No fixtures from that load run until it’s fixed — this is deliberate, not a partial-load bug.
Protocol mismatch
Symptom. A fixture you expect to run is missing from
stellar-canary fixtures output, or shows up in skipped in the JSON
report.
Likely cause. The fixture’s declared protocol doesn’t match the
run’s target protocol (--protocol, or .stellar-canary.toml’s
protocol field, or the default of 28).
What to check. skipped[].reason in --json output, e.g.
"fixture targets protocol 27, this run targets protocol 28".
Fix. Pass --protocol matching the fixture, or confirm you meant to
target a different protocol than your fixture pack provides.
RPC unreachable
Symptom. check exits 3, status is error, and RPC/Soroban
fixtures report a transport error.
Likely cause. The configured --rpc-url is wrong, the endpoint is
down, or there’s no network access from the current machine/runner.
What to check. The exact error text (e.g. error sending request for url (...)), and whether XDR-only fixtures in the same run still passed
(they should — see Network Troubleshooting
below).
Fix. Correct --rpc-url/--network, confirm connectivity, or
disable rpc/soroban checks in .stellar-canary.toml if you only need
the offline XDR surface.
Soroban simulation failure
Symptom. A Soroban fixture reports fail or error.
Likely cause. Either a genuine simulation-behavior mismatch (fail —
the fixture’s expect.kind didn’t match what simulateTransaction
actually returned), or a transport/execution problem reaching the
network (error).
What to check. results[].status (fail vs. error) and
results[].details in the JSON report — they are reported differently on
purpose; see JSON Report.
Fix. For fail: re-verify the fixture’s expected behavior against
the real network and its own header comment. For error: treat it as a
network problem — see RPC unreachable above.
GitHub Action failure
Symptom. The workflow step running ProtocolCanary-Action fails.
Likely cause. Either a real compatibility failure (status: fail) or
an execution failure (status: execution-failed — Canary couldn’t
install, run, or produce parseable output).
What to check. The job summary text: a compatibility failure names
the specific failing testId(s); an execution failure says “Protocol
Canary could not be executed” with the actual diagnostic. See
CI Workflows & Failure Behavior.
Fix. For a compatibility failure, fix the underlying incompatibility.
For an execution failure, check the diagnostic — commonly a missing Rust
toolchain issue on a non-standard runner, a bad version input, or a
timeout-minutes that’s too short for the runner’s cold-cache build time.
Action version/reference problem
Symptom. The Action can’t be resolved, or installs an unexpected
Protocol-Canary version.
Likely cause. uses: references a nonexistent tag, or the version
input doesn’t match a real Protocol-Canary release tag.
What to check. Releases for the currently verified
combination (Action @v1 installing Protocol-Canary 0.1.1).
Fix. Use uses: StellarCanary/ProtocolCanary-Action@v1 and either
omit version (defaults to 0.1.1) or set it to a real release tag
without a leading v.
JSON parsing problem
Symptom. A script consuming --json output fails to parse a field it
expected.
Likely cause. Assuming a field is always present when it’s actually
conditional — network (absent for offline runs), skipped (absent when
empty), or results[].details (absent, not null, when there’s nothing
to add).
What to check. The “Always present?” column in JSON Report.
Fix. Guard for absence rather than assuming presence; treat “missing
counts” as “derive it from results” rather than an error, matching
what the Action itself does.
Exit code interpretation
See the dedicated Exit Codes reference — do not guess
at a code’s meaning from a partial memory of it; the source
(crates/canary-core/src/errors.rs) and that page are the two places to
check.
Network Troubleshooting
Some compatibility checks (RPC, Soroban) genuinely require a live, reachable Stellar RPC endpoint — Protocol Canary does not claim to be fully offline; only the XDR surface is. This means a failure to reach RPC is a different kind of result than a real protocol compatibility failure, and the tool reports them differently on purpose:
| RPC/network failure | Compatibility failure | |
|---|---|---|
| Cause | Endpoint unreachable, DNS failure, timeout | The assertion ran and genuinely didn’t match |
status | error | fail |
| Exit code | 3 | 1 |
| Offline (XDR) fixtures in the same run | Unaffected — still run and report their real result | Unaffected |
| Terminal marker | ‼ ERROR with a transport error message | ❌ FAIL with the assertion’s own failure detail |
Do not treat every red CI run or non-zero exit code as “Protocol Canary
found an incompatibility” — check status/exit code first to know which
kind of red you’re looking at.
Security
This page summarizes the security posture documented across all three
repositories’ own SECURITY.md files, which remain authoritative:
Protocol-Canary,
ProtocolCanary-Fixtures,
ProtocolCanary-Action.
What Protocol Canary executes
- The CLI decodes/encodes XDR against the official
stellar-xdrcrate, makes read-only RPC calls (getNetwork,getLatestLedger), and builds/simulates unsigned Soroban transactions (simulateTransaction). - Fixtures are declarative TOML data, never executable code. No field in the fixture schema runs a shell command, script, or arbitrary code, and none will be added — a pull request introducing one is rejected regardless of stated purpose.
- The Action never executes a shell string built from fixture data,
repository configuration, PR body/title, issue text, or commit
messages. Arguments are always passed to the Canary process as an array
(
child_process.spawn(binary, [...args])), never through a shell.
What it does not execute
- No transaction submission, anywhere in the system. Every network interaction is read-only or simulation-only.
- No arbitrary code from a fixture file.
- No downloaded script executed by the Action — the toolchain performing
the build is
cargo, already present on the runner.
Network behavior
- Only outbound, read/simulate calls to a configured Stellar RPC endpoint
(Testnet by default). Nothing in a normal
checkrun mutates the target network. - A failure to reach the endpoint is reported as an execution error
(exit code
3), never silently ignored and never misreported as a compatibility result.
Private-key behavior
No component in this system ever reads, stores, or transmits a private
key, seed phrase, or any other signing credential. The Soroban surface
builds and simulates unsigned transactions only. This has been
verified directly against the source: the only std::env calls in
Protocol-Canary are temp_dir()/current_dir() — there is no key
material code path.
Fixture trust boundary
ProtocolCanary-Fixtures fixtures — and any third-party fixture
directory — must be treated as untrusted input by any consumer,
including Protocol-Canary itself. The schema has no executable field.
decode-failure fixtures deliberately feed malformed input to the XDR
decoder to prove it rejects bad input correctly, rather than crashing or
silently accepting it.
Action trust boundary
Pull request source code is treated as untrusted by the Action. It never
interpolates PR-controlled text into a shell command, and it enforces a
configurable timeout (timeout-minutes, default 15) that forwards
workflow cancellation signals to the child process, so a hung or
malicious process cannot outlive the job.
The Action’s minimum required permission is contents: read; it does not
call the GitHub API on your repository at all for its core function (it
does call the public, unauthenticated GitHub REST API against
StellarCanary/Protocol-Canary itself, to resolve a release tag to a
commit before installing it).
Report handling
The JSON report the CLI produces is plain data (see JSON Report). The Action parses it and never re-executes anything based on its content beyond deciding pass/fail and rendering text.
Reporting a vulnerability
Each repository documents the same private path: open a private report via GitHub’s “Report a vulnerability” feature on that repository, or contact the maintainers directly, rather than filing a public issue. Include a description of the issue and its impact, steps to reproduce, and the affected version or commit. Reports are acknowledged and worked through a fix and disclosure timeline before any public write-up.
Audit status
No formal third-party security audit has been performed on any of the three repositories. Confidence in the claims above comes from the design itself (no key-material code path exists) and each repository’s own automated test suite — not from an external review. This project does not claim, and has never claimed, any security certification.
Contributing
This page is a starting point across all three repositories. Each
repository’s own CONTRIBUTING.md remains authoritative for its
repository-specific process — this page does not duplicate them, only
orients you toward the right one.
Three contribution paths
Core engine — Protocol-Canary
Where to work: crates/canary-* (the CLI, project detection, fixture
loading, the XDR/RPC/Soroban runners, policy evaluation, reporting).
What belongs here: changes to how compatibility checks are executed or
reported — a new surface capability, a new report format, a bug in
project detection, a new configuration option. Protocol-specific
assertions belong in ProtocolCanary-Fixtures instead, not here.
How to test:
cargo fmt --all --check
cargo check --workspace --all-targets
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
All four must pass. Unit tests must not require network access; anything
that talks to a real RPC endpoint belongs in tests/integration and must
be explicitly opt-in.
How to submit: a pull request against
StellarCanary/Protocol-Canary,
following its CONTRIBUTING.md
(workspace structure, coding standards, and commit style).
Fixtures — ProtocolCanary-Fixtures
Where to work: a protocol-pack directory (e.g. protocol-28/), organized
by surface and CAP.
What belongs here: a new compatibility assertion for a real, verifiable piece of protocol behavior — never a fixture added just to raise a coverage number. See Authoring a Fixture for the full workflow.
How to test:
python3 tools/validate/validate.py
python3 -m unittest discover tests
No build system is required — the validator uses only the Python 3.11+ standard library.
How to submit: a pull request against
StellarCanary/ProtocolCanary-Fixtures,
following its CONTRIBUTING.md.
GitHub Action — ProtocolCanary-Action
Where to work: src/ (TypeScript), bundled to the committed dist/index.js.
What belongs here: changes to how CI consumes Canary’s report — the
summary, annotations, artifact handling, installation/pinning logic.
Compatibility logic itself belongs in Protocol-Canary, not here.
How to test:
npm run typecheck
npm run lint
npm test
npm run build
Unit and integration tests never require network access or a real
stellar-canary binary — they run against a mock CLI
(tests/fixtures/mock-canary.cjs) that simulates every documented result
state via the MOCK_CANARY_SCENARIO environment variable. The repository’s
own integration.yml workflow is the only place it talks to a real
Canary build and a real Testnet endpoint, and it never gates a pull
request.
How to submit: a pull request against
StellarCanary/ProtocolCanary-Action,
following its CONTRIBUTING.md.
Contributing to this documentation site
The site itself lives at docs-site/ in the Protocol-Canary repository.
See docs-site/README.md
for how to build and preview it locally with mdBook. Keep implementation
detail in each repository’s own docs//CONTRIBUTING.md and link to it
from here rather than duplicating it — this site is the developer
journey, not a second source of truth.
Roadmap
This reflects Protocol-Canary’s own ROADMAP.md.
It is practical, scoped work that fits the current architecture — not a
schedule with committed dates. Items move up when someone (maintainer
or contributor) picks them up.
Near term
- Additional Protocol 28 fixtures. CAP-0086 sparse-map host functions
have no fixture yet — the currently published Soroban SDK surface does
not expose the host functionality the intended fixture would need. See
Protocol 28. Track upstream SDK releases and add
the fixture (in
ProtocolCanary-Fixtures) once that changes. - More RPC compatibility assertions. Only
getNetworkhas a fixture today;getLatestLedgeris supported bycanary-rpcbut unused by any shipped fixture.
Medium term
- Protocol 29 support, once its CAPs are finalized and released
upstream — a new protocol pack entry, plus fixtures in
ProtocolCanary-Fixtures, following the same process as Protocol 28. No release currently supports Protocol 29 or any version beyond 28 — do not infer support from this roadmap entry. - Expanded Soroban compatibility assertions beyond the current construct → simulate → result smoke fixture, covering more host functions as they stabilize.
- Additional CI integrations beyond GitHub Actions, if a real need
arises, scoped as their own repository rather than bolted onto
ProtocolCanary-Action.
Explicitly out of scope for now
- A hosted backend, database, or web frontend — this is a CLI and CI tool.
- Remote/versioned fixture fetching (as opposed to a local checkout).
- Transaction submission of any kind.
How to propose an addition
Open an issue describing the real upstream behavior (a CAP, an RPC method, a host function) the work would cover. See Contributing.
Releases
Protocol-Canary
| Current version | v0.3.0 |
| Distribution | A git tag (v0.3.0), installed via cargo install --git https://github.com/StellarCanary/Protocol-Canary --tag v0.3.0 --locked, or a prebuilt archive from the GitHub Release. |
| GitHub Release | v0.3.0 is published (target commit 464c45d1bb100a009bb9dab9847c2c89ad033ab2). It carries archives for Linux x86_64 (stellar-canary-x86_64-unknown-linux-gnu.tar.gz), macOS x86_64 (stellar-canary-x86_64-apple-darwin.tar.gz), macOS arm64 (stellar-canary-aarch64-apple-darwin.tar.gz) and Windows x86_64 (stellar-canary-x86_64-pc-windows-msvc.zip), the bare stellar-canary-linux-x86_64 binary, a .sha256 sidecar for every asset, and one SHA256SUMS manifest. |
What changed in 0.3.0 | RPC assertions are evaluated against the endpoint’s raw JSON result, and get-version-info plus further read-only RPC methods are supported; XDR fixtures can compare a decoded value to expected JSON (decode-json-equals); check --fixture/--surface runs a targeted subset; inspect --format json publishes the versioned inspection document; CF-04 verification evidence renders as terminal badges; --project-root resolves config and fixture paths; --output writes atomically; JSON reports gain run.toolBuildCommit and skipped[].code. |
Installing v0.3.0
The Unix archives contain a stellar-canary executable; the Windows archive
contains stellar-canary.exe. Download the asset for your target, then verify
it against SHA256SUMS before extracting:
curl -fsSLO https://github.com/StellarCanary/Protocol-Canary/releases/download/v0.3.0/stellar-canary-x86_64-unknown-linux-gnu.tar.gz
curl -fsSLO https://github.com/StellarCanary/Protocol-Canary/releases/download/v0.3.0/SHA256SUMS
sha256sum -c SHA256SUMS --ignore-missing
tar -xzf stellar-canary-x86_64-unknown-linux-gnu.tar.gz
On macOS, shasum -a 256 -c SHA256SUMS verifies the same manifest. On
Windows, Get-FileHash -Algorithm SHA256 on the .zip must match its
.sha256 sidecar. See Installation for the full asset
list. The release does not include a Linux arm64 archive.
Previous engine release: v0.2.0
v0.2.0 is published (target commit 7e1eb63dd63be6aefcb9d248ae80afc66436c4c6), preserved unchanged. It carries the Linux x86_64 prebuilt binary stellar-canary-linux-x86_64 and SHA256SUMS, and no macOS or Windows assets; it installs from source via --tag v0.2.0. check failed by default when zero fixtures executed (exit code 2, --allow-empty opts out), fixture directories containing symbolic links or unsafe payload paths were rejected, and results recorded results[].source.
Earlier engine release: v0.1.1
v0.1.1 is published (target commit 919668859bc1bef3d58737f13695b486d67632ea), preserved unchanged. It carries no prebuilt binary and installs from source via --tag v0.1.1. ProtocolCanary-Action keeps its default pinned to 0.1.1.
ProtocolCanary-Action
| Current release | v0.1.1 (a real GitHub Release, since this is a JavaScript/Node action whose bundled dist/index.js is committed and released) |
| Floating tag | v1 — currently resolves to the same commit as the v0.1.1 release tag, per standard GitHub Actions convention for major-version tags. |
Default version input | 0.1.1 (the Protocol-Canary release it installs and runs) |
ProtocolCanary-Fixtures
| Current pack | protocol-28/ — Active |
| Distribution | The protocol-28/ pack is published as a tagged snapshot and GitHub Release — tag protocol-28, commit 75ec2c293a44f09d9c8c1f76722a24a2334ac20a — the immutable, verified Protocol 28 fixture pack. It is not a compiled or binary artifact: consumers still use a git checkout/clone (actions/checkout with repository: StellarCanary/ProtocolCanary-Fixtures, or a plain git clone, optionally at the protocol-28 tag/ref) and point --fixtures-dir at the resulting declarative TOML fixture corpus. |
| Other packs | protocol-27/ exists but is not yet populated — fixtures are added only after their upstream behavior is independently verified, never as placeholders. |
Version compatibility
Protocol-Canary | Fixture pack | Target protocol | ProtocolCanary-Action |
|---|---|---|---|
v0.3.0 | ProtocolCanary-Fixtures protocol-28/ | 28 | not yet verified with a published Action release (default input remains 0.1.1) |
v0.2.0 | ProtocolCanary-Fixtures protocol-28/ | 28 | v1 (explicit version: "0.2.0") |
v0.1.1 | ProtocolCanary-Fixtures protocol-28/ | 28 | v1 (default version: "0.1.1") |
v0.3.0 is the current Engine release. No ProtocolCanary-Action release pins
it yet — the Action’s default version input is still 0.1.1 — so this table
does not claim that combination. v0.2.0 is verified against both the
protocol-28 pack and ProtocolCanary-Action (including --allow-empty and
empty-run refusal handling). v0.1.0 is
installable but predates ContractExecutable XDR support (needed by two
current Protocol 28 fixtures) and the counts field in its JSON report —
the Action tolerates the missing field, but v0.1.1 is the version this
table verifies against.
Tags vs. releases vs. binaries — what actually exists
| Git tags | GitHub Releases | Prebuilt binaries | |
|---|---|---|---|
Protocol-Canary | Yes (v0.1.0, v0.1.1, v0.2.0, v0.3.0) | Yes (v0.1.1, v0.2.0, v0.3.0) | Yes (Linux x86_64, macOS x86_64, macOS arm64, and Windows x86_64 for v0.3.0; Linux x86_64 only for v0.2.0) |
ProtocolCanary-Action | Yes (v0.1.1, v1) | Yes | N/A (a JS action; its “binary” is the committed dist/index.js) |
ProtocolCanary-Fixtures | Yes (protocol-28) | Yes (protocol-28) | N/A (not a distributable binary) |
Prebuilt archives for all four targets are available for v0.3.0 on GitHub
Releases. Alternative install paths build from source via Cargo as documented
in Installation.
Limitations
Stated plainly, not hidden:
- Fixture coverage is not complete Protocol 28 coverage. The
protocol-28pack at revisione9d098dholds 93 fixture definitions (86 XDR, 2 RPC, 5 Soroban). That is pack inventory, not checks run: a project executes only the fixtures its configuration and capabilities select, and fixture counts say nothing about live network behavior. See Protocol 28 for exactly what is and isn’t checked. - CAP-0086 currently lacks a fixture. This is a documented, deliberate
gap — the published
soroban-sdkdoesn’t yet expose the relevant host functions at a stable API surface, and this project does not fabricate a fixture it cannot independently verify. See Roadmap. - Protocol Canary does not certify arbitrary applications. A passing run means the fixtures currently implemented for the target protocol passed against your configured dependencies and RPC endpoint — it is not a guarantee that an application cannot break in some other way, and it does not replace testing against a real testnet or mainnet deployment.
- Live RPC checks depend on network availability. The RPC and Soroban surfaces are not offline — see Network Troubleshooting. Only the XDR surface runs with no network call.
- The tool does not submit transactions as part of normal Soroban
simulation checks. Every Soroban check builds and simulates an
unsigned transaction; nothing in a normal
checkrun mutates the target network. - The current release does not publish prebuilt binaries. Every
documented install path builds from source via
cargo install. See Releases. --live-cache-ttlreplays recorded network answers. It is off by default. When set, a cached RPC or Soroban result is served for up to that many seconds and marked"source": "cache"; it says nothing about what the network does now. Seecheck.- No formal third-party security audit has been performed on any of the three repositories. See Security.
- Mainnet has not been separately verified. Every fixture in the
current pack was verified against Testnet only; running against
mainnet requires explicit
--network mainnet --rpc-url <endpoint>configuration. - Only Protocol 28 is supported. There is no Protocol 29 (or earlier,
beyond an unpopulated
protocol-27/placeholder pack) support in any released version.
FAQ
Why not just use unit tests?
Unit tests primarily exercise your application code against mocked or assumed protocol behavior. They don’t, by themselves, test the boundary between your code and the real, current behavior of the Stellar network and its official libraries — which is exactly what changes when a protocol upgrades. See What Problem Does It Solve?.
Does Canary send transactions?
No. Every Soroban check builds and simulates an unsigned transaction
via simulateTransaction. Nothing in a normal check run submits a
transaction to any network.
Does Canary need private keys?
No. No component in this system ever reads, stores, or transmits a private key or seed phrase — verified directly against the source. See Security.
Does Canary require Docker?
No. It’s a Rust CLI you cargo install, plus a Node-based GitHub Action
for CI. Neither requires Docker.
Does Canary require a server?
No. There is no hosted backend, no database, and no persistent server anywhere in this system. See Architecture.
What happens if RPC is unavailable?
The affected checks report an execution error (status: error, exit
code 3), not a compatibility failure. Offline (XDR) checks in the same
run are unaffected and still report their real result. See
Network Troubleshooting.
Does a passing run mean full Protocol 28 support?
No. It means the fixtures applicable to your project passed. The
protocol-28 pack at revision
e9d098d
contains 93 fixture definitions (86 XDR, 2 RPC, 5 Soroban), but a run only
executes the ones its target protocol, configured surfaces and project
capabilities select — a pack file count is not the number of checks run,
and neither is a network observation. The old “5/5 PASS” transcript is a
historical five-fixture subset, not the current inventory. CAP-0086 has no
fixture yet, and CAP-0085’s fixtures test wire encoding, not a full
deployed contract fleet. See Protocol 28 for exactly
what is and isn’t covered.
Why are fixtures separate from the engine?
So fixtures — public, declarative TOML data consumed by CI pipelines — stay a clean trust boundary: no field executes code, and the fixture pack can version independently of the CLI. See Fixtures.
How do I use Canary in GitHub Actions?
- uses: actions/checkout@v4
- uses: StellarCanary/ProtocolCanary-Action@v1
with:
protocol: "28"
See GitHub Action for inputs, outputs, and a complete workflow checking the real Protocol 28 fixture pack.
How do I add support for another protocol behavior?
If it’s a new compatibility assertion for an existing surface, add a
fixture — see Authoring a Fixture. If it
requires new engine capability (a new surface, a new XDR type the CLI
doesn’t yet decode), that’s a change to Protocol-Canary itself — see
Contributing. Either
way, it must cite a real, verifiable upstream source — this project does
not add speculative or guessed behavior.