ka2a documentation
Output formats
This guide describes ka2a at revision a34b8bc9d319502002f104d28f90d18c325a5d26. Source: docs/output-formats.md. Source links require repository access. The App examples on the product page use reviewed revision a7c8ac4a85f5.
Contents
With --output json, each result-producing ka2a command prints one JSON document on
stdout. ka2a mcp instead reserves stdout for the MCP protocol and sends diagnostics to
stderr in every output mode. pkg/observe writes the snapshot documents. Each document has a member format that names its format and
its version, for example ka2a.doctor/1. Use this member to select a parser.
Tests keep this reference complete:
TestOutputFormatsReferenceListsEveryFormat(internal/cli) fails when the source names a format identifier that this reference does not name, or when a document of the command line or ofpkg/observehas no row in the table below.TestVersionedDocumentsOnlyGainMembers(internal/cli) holds the JSON members of each document ininternal/cli/testdata/output-members.golden, with their JSON kind. It enforces the compatibility rule below.
Compatibility rule
The rule is a product guarantee (KA2A-R1-017, scenario "Versioned output document").
- A document of one version (
/1) only gains members in a later ka2a revision. A new member can be absent ornullin an older document. - ka2a never removes, renames or retypes a member of a published version, and never changes
the meaning of a member or of one of its fixed values. Such a change makes the next version
(for example
ka2a.snapshot/2), with a new identifier. - A set of fixed values (for example
outcome,resultor a check status) can gain values. An error reference token keeps its meaning. - A consumer ignores members that it does not know, and treats an unknown value of a fixed
set as "needs attention". A consumer refuses a document whose
formatit does not know. - The text output (without
--output json) has no compatibility guarantee. Scripts use the JSON output and the exit codes.
observe.Decode (and ka2a mcp --snapshot FILE) reads ka2a.snapshot/1 strictly: it
refuses unknown members, so that a damaged or foreign file cannot pass as a snapshot. Read a
snapshot file with the ka2a revision that wrote it, or with a newer one. An older revision can
refuse the file of a newer revision with invalid_snapshot.
The members of a version are in the golden list. A new version gets its own lines, and the lines of the earlier version stay as long as ka2a writes it.
Product documents
| Format | Written by | Go type | Content |
|---|---|---|---|
ka2a.version/1 | ka2a version | versionResult (internal/cli/version.go) | Version, commit, Go version, platform, wire profile, store schema version and snapshot format. |
ka2a.doctor/1 | ka2a doctor | doctorResult (internal/cli/doctor.go) | The state directory, the check time, the result (ok or problems), the counts of problems, warnings and unverified settings, and each check with its name, status and detail. |
ka2a.snapshot/1 | ka2a observe, the file of ka2a snapshot export, MCP node_status and list_operations | observe.Snapshot (pkg/observe/snapshot.go) | A bounded, read-only view of one store: source and freshness, identifier mode, node, quarantine, storage, configuration, broker, counts, outbox, operations, dispatch, rejections, partitions and incidents. Lists are pages with a cursor. |
ka2a.snapshot.export/1 | ka2a snapshot export --out FILE | exportResult (internal/cli/observe.go) | The path and size of the written file, its snapshot format, capture time, identifier mode and whether an owner held the store lock. |
ka2a.snapshot.diff/1 | ka2a snapshot diff | observe.SnapshotDiff (pkg/observe/diff.go) | Exact input digests, capture times, node identities, counts and section coverage; bounded operation and partition changes. See Snapshot comparison. |
ka2a.operation/1 | ka2a operation show, MCP get_operation | observe.OperationView (pkg/observe/snapshot.go) | One operation with its source, identifier mode, node and the four acceptance stages. |
ka2a.topics.verify/1 | ka2a topics verify | topicResult (internal/cli/topics.go) | The topic, the profile, the result (see topic check results) and each check. |
ka2a.topics.provision/1 | ka2a topics provision | topicResult (internal/cli/topics.go) | As ka2a.topics.verify/1, and whether the command created the topic. |
ka2a.topics.acl-plan/1 | ka2a topics acl-plan | aclPlan (internal/cli/aclplan.go) | The principal, endpoint, mailbox topic, consumer group, the minimal ACLs, the matching kafka-acls.sh commands and notes. |
ka2a.init/1 | ka2a init | initResult (internal/cli/init.go) | The state directory, the node identity, the catalog digest, the signing key and whether the store was created. |
ka2a.scaffold/1 | ka2a scaffold | scaffoldResult (internal/cli/scaffold.go) | The project directory, module path, trust domain, the ka2a version and replace path of go.mod, each written file with its mode and whether it replaced a file, and the next steps. Never key material. |
ka2a.backup/1 | ka2a backup, ka2a backup --online (the answer of the control socket of ka2a run --control) | backupResult (internal/cli/store.go) | Backup ID, path, time, schema version, SHA-256, size, source node, live epoch and coverage. |
ka2a.control.error/1 | the control socket of ka2a run --control (a refused request) | controlError (internal/cli/control.go) | The error code (for example storage_full, invalid_input or busy) and a message. ka2a backup --online reports the code as its own. |
ka2a.restore/1 | ka2a restore | restoreResult (internal/cli/store.go) | Backup ID, source, restore time, the path of the previous database and the next step. |
ka2a.quarantine.release/1 | ka2a quarantine release | releaseResult (internal/cli/store.go) | The released reason, the quarantine start, the operator, the previous generation, the node, the held rows and the next step. |
ka2a.held.release/1 | ka2a held release | heldResult (internal/cli/held.go) | The decided row: kind, operation, previous and new state and reason, attempts and the next step. |
ka2a.held.abandon/1 | ka2a held abandon | heldResult (internal/cli/held.go) | As ka2a.held.release/1, for an abandoned row or operation. |
ka2a.recovery.simulate/1 | ka2a recovery simulate | simulationReport (internal/cli/recoverycmd.go) | The source store (state directory, live owner, node, generation), each action with its outcome and the before and after state of its target, every record transition, the invariant checks, the published record count (always 0), broker contact (always false) and the next step. |
ka2a.recovery.plan/1 | ka2a recovery plan | planWritten (internal/cli/recoverycmd.go) | The path and digest of the written plan file, the store it names and the simulation (ka2a.recovery.simulate/1) that filled it. |
ka2a.recovery-plan/1 | the plan file of ka2a recovery plan --out FILE | recoveryPlan (internal/cli/recoverycmd.go) | The creation time, the store (node, trust domain, endpoint, generation, schema version), each action with its index, target, reason or operator and note, expected state and intended transition, and digest: sha256: and the SHA-256 of the compact JSON encoding of the plan with an empty digest. |
ka2a.recovery-receipt/1 | ka2a recovery apply (stdout and the file of --receipt) | recoveryReceipt (internal/cli/recoverycmd.go) | The plan digest and path, the apply time, the store generations (planned, before, after), each action with its outcome (applied, already_applied, refused, untouched), the refused precondition, the counts and a stopping failure. If receipt-file publication fails after apply, stdout keeps the receipt with receipt_error; exit 1 does not undo applied actions. |
ka2a.restore-rehearsal/1 | ka2a restore rehearse (stdout and the file of --report) | rehearsalReport (internal/cli/rehearse.go) | The rehearsal time, the result (pass or fail), the first defect, the backup file (path, SHA-256, size, backup ID, schema version, source node), each check, the state after the isolated start (quarantine, epoch, held rows, Kafka clients created), the kept work directory and broker contact (always false). |
ka2a.run/1 | ka2a run (one line when the node is ready) | runReady (internal/cli/run.go) | Endpoint, mailbox topic, profile, handler, and the UI, token file, metrics and probe addresses and the control socket path. |
ka2a.send/1 | ka2a send | requestResult (internal/cli/request.go) | Operation, peer, operation ID, whether the operation is new, the outcome, the stages, the task or message, an A2A error, the result (only with --show-result), the identifier mode and a note. |
ka2a.probe/1 | ka2a probe | probeResult (internal/cli/probe.go) | Endpoint, peer, the result (pass or fail), the operation ID, the nonce and the echoed nonce, the timeout, the start time and elapsed time, the four delivery stages with their state, time and elapsed time, and the failure: the first stage that the probe did not observe and its cause. |
ka2a.task.get/1 | ka2a task get | requestResult (internal/cli/request.go) | As ka2a.send/1. |
ka2a.tasks.list/1 | ka2a tasks list | requestResult (internal/cli/request.go) | As ka2a.send/1, with a page of tasks. |
ka2a.task.cancel/1 | ka2a task cancel | requestResult (internal/cli/request.go) | As ka2a.send/1. |
ka2a.keys.generate/1 | ka2a keys generate | keyResult (internal/cli/keys.go) | The key file and the catalog key entry. Never the private key. |
ka2a.keys.public/1 | ka2a keys public | keyResult (internal/cli/keys.go) | As ka2a.keys.generate/1, for an existing key. |
ka2a.catalog.validate/1 | ka2a catalog validate | catalogValidateResult (internal/cli/catalog.go) | Path, digest, counts of endpoints, keys and grants, whether a node can load the catalog, and the findings with their class. |
ka2a.catalog.diff/1 | ka2a catalog diff | catalogDiffResult (internal/cli/catalogdiff.go) | The before and after paths and exact digests, semantic changed flag, per-section detail limit, scope, and endpoint, key and grant change sections. See Catalog comparison. |
ka2a.catalog.digest/1 | ka2a catalog digest | catalogDigestResult (internal/cli/catalog.go) | Path, SHA-256 digest of the exact bytes and the endpoints. |
ka2a.catalog.explain/1 | ka2a catalog explain | catalogExplainResult (internal/cli/explain.go) | The catalog path and digest, the request (sender, receiver, operation, key ID or "", signing time), the decision (allow or deny), the refusal code and the admission class (the disposition reason that the receiver records; "" for allow), each condition with its status (met, missing, not_evaluated), code and detail, the names of the missing conditions, the grant of the sender to the receiver (or null) and the evaluated keys with their windows. |
ka2a.health/1 | ka2a run --probe-listen (/livez, /readyz, /connectz), Node.HealthHandler | ka2a.HealthReport (pkg/ka2a/health.go) | The probe (liveness, readiness, connectivity), the status (alive/not_alive, ready/not_ready, connected/degraded/unknown), the fixed reason code, the scope of an authorization denial (or "") and the observation time. No identifier, address or body. See Health and readiness. |
ka2a.error/1 | commands that fail with --output json, except ka2a mcp | errorDocument (internal/cli/cli.go) | The command, the error code, the message and the exit code. |
Snapshot comparison
ka2a.snapshot.diff/1 compares recorded operations and partitions from two
raw-identifier ka2a.snapshot/1 files. It does not open a store or contact Kafka.
The inputs must have the same node ID, trust domain, endpoint ID, store generation
and schema version. The after capture must not precede the before capture.
Pseudonyms are specific to one capture, so pseudonymized inputs are refused.
before and after each contain digest (sha256: and the exact file hash),
captured_at, node, counts, and operations and partitions coverage. Each
coverage object has complete, observed, retained and reasons. Counts and
node epochs identify the captured input; changes to them alone do not set
changed. That flag covers differences in the compared operation and partition
rows only.
The result's operations and partitions sections each have total, items and
truncated. total counts all differences before the detail limit is applied.
The default limit is 50 per section; the maximum is 200. Input list order does not
change the comparison. File spacing can change an input digest without changing
the recorded observations.
Each item has kind (changed, only_before or only_after), presence,
before, after, changes and review. presence is observed_both for a
matched row. The missing side of a one-sided row is null. changes names the
changed observations; review names recorded differences that need attention.
Coverage is complete only for an included, unfiltered list with no following page
whose unique rows reconcile with the global counts. Operations also reconcile
each exchange-state count. An omitted, filtered, truncated or final continuation
page can leave coverage incomplete. A row missing from an incomplete opposite
capture is not_observed. When the opposite capture is complete, the row is
absent_from_retained_snapshot. Retention can remove terminal records; this
absence does not establish data loss.
Operations match by raw operation identity internally. Output uses local before
and after sequence numbers (seq). It keeps send, exchange and observed
task changes separate. Direct broker acknowledgement and response evidence
remain independent. send.reason_present and exchange.reason_present say
whether a reason exists. A changed reason is named in changes, but the reason
text itself is omitted. Changed hidden identity fields are also named without
printing their values.
A held-to-queued change is not ranked as a backward delivery stage. Removed or
changed evidence and changed immutable request identity are marked for review.
Partition changes keep accounted and committed offsets separate, including
decreases. These are recorded differences, not a finding of runtime corruption.
The result omits raw message identifiers, record digests, request fingerprints, message bodies and source paths. Store identity and partition names remain visible. Each input is at most 16 MiB and each input list at most 200 rows. The formatted JSON result is at most 4 MiB. Invalid, ambiguous, inconsistent or incompatible input and excessive results fail without a partial comparison.
Exit 0 means the comparison succeeded, including when differences exist. Invalid input exits with 1; invalid arguments exit with 2. The report does not authenticate the files or establish journal continuity, live state or remote effects. It is not a recovery plan. Follow the capture and comparison procedure.
Catalog comparison
ka2a.catalog.diff/1 compares configured values from two valid files. changed
is true when at least one endpoint, key or operation grant differs. JSON spacing,
list order and an explicit mailbox topic equal to the derived topic do not count
as changes. The input digests still identify the exact bytes of each file.
Each of endpoints, keys and grants contains total, truncated and items.
total counts all changes in that section. items contains at most limit details,
sorted by endpoint name, key ID or source/destination/operation. truncated is true
when details were omitted. The default limit is 100 per section; the maximum is 200.
Each item has change (added, removed or changed), before and after.
The absent side is null. A grant is one source, destination and operation tuple,
so a grant is added or removed. An endpoint contains its resolved mailbox_topic
and pinned agent_card (or null). A key contains its binding, SHA-256 fingerprint
of the public key bytes, validity window, revocation and replacement. An empty
not_after means no end. Raw public and private key material is never included.
The report does not evaluate live access or the effect on already admitted work.
A configured grant can still lack a usable signing key. Use catalog explain for
a request and signing time. Exit 0 means the comparison succeeded, even when it
finds changes. Invalid catalogs exit with 1; invalid arguments exit with 2.
Probe stages and causes
ka2a.probe/1 lists the stages locally_queued, broker_acknowledged, remote_recorded
and result in this order. The state of a stage is yes, no, implied (no direct
evidence, but a later stage shows it) or unknown. The times of locally_queued,
broker_acknowledged and result come from the store of the prober, in this order. The
time of remote_recorded is the time when the peer recorded the request, by the clock of the
peer. The peer can record the request before the prober reads the broker acknowledgement.
failure is null when the probe passes. Otherwise failure.stage names the first stage
that the probe did not observe, and failure.cause is one of these tokens:
| Stage | Cause | Meaning |
|---|---|---|
locally_queued | not_granted | The catalog of the prober grants it no SendMessage on the peer. Nothing was sent. |
locally_queued | unknown_peer | The peer is not an endpoint of the catalog. |
locally_queued | response_route_missing | The mailbox topic of the prober, where the answer arrives, is missing or does not meet the profile. The node did not start, and nothing was sent. |
locally_queued | timeout | The node did not start within --timeout. |
broker_acknowledged | broker_unreachable | No broker answered the node. |
broker_acknowledged | request_route_denied | The broker denied the write to the mailbox of the peer (a missing ACL). |
broker_acknowledged | publish_rejected | The broker refused the request permanently. |
broker_acknowledged | expired | The request expired before a broker acknowledged it. |
broker_acknowledged | held | The publication is held for an operator. |
broker_acknowledged | timeout | No acknowledgement within --timeout, for another reason. |
remote_recorded | no_response | No answer within --timeout. The peer node is not running, its catalog does not grant the probe, or its answer has no route to the mailbox of the prober. The prober cannot read the store of the peer, so it cannot tell these apart. |
remote_recorded | response_rejected | An answer arrived, but the node of the prober refused it, for example after a key change that the catalog of the prober does not have. |
remote_recorded | held | The exchange is held or abandoned. |
result | probe_handler_off | The peer answered without the probe echo: it does not enable the probe handler. |
result | probe_refused | The peer answered with another A2A error. |
result | nonce_mismatch | The answer echoes another nonce. |
The set of causes can gain tokens (rule 3).
Development and qualification documents
The tests, examples and release tools of the repository write these documents. They are not part of the product interface. They follow the same rule while a report uses them, but a change to them needs no new product version.
| Format | Written by |
|---|---|
ka2a.mcp-app-build/1 | mcpweb/scripts/build.mjs; copied into releases as mcp-app-build.json. |
ka2a.example.embedded/1 | The summary line of examples/embedded. |
ka2a.example.recovery/1 | The result of examples/recovery. |
ka2a.qualification.embedded/1 | TestEmbeddedConsumerQualification (internal/qualification). |
ka2a.qualification.recovery/1 | The recovery walkthrough test (internal/qualification). |
ka2a.campaign-manifest/1 | The manifest of the KH campaign (internal/qualification/campaign). |
ka2a.campaign/1 | The summary of the KH campaign (internal/qualification/campaign). |
ka2a.protected-evaluator/1 | The pins of the protected evaluator (internal/qualification/evaluator). |
ka2a.evaluator-attempt/1 | One attempt of the protected evaluator (internal/qualification/evaluator). |
ka2a.model-results/1 | The Quint model summary (verification/scripts/pilot.mjs), read by the release evidence (internal/release). |
ka2a.model-bridge-traces/1 | The model-to-Go trace corpus (internal/modelbridge). |
ka2a.rapid-regression/1 | The Rapid regression corpus (internal/archtest). |
ka2a.load-report/1 | The load runs (benchmarks). |
ka2a.fresh-environment/1 | make fresh-environment (scripts/fresh_environment.py). |
ka2a.micro-benchmarks/1 | An earlier micro-benchmark report under reports/. No current tool writes it. |
File formats
These files are inputs or state, not command output. Their format names use the form .v1.
| Format | File |
|---|---|
ka2a.catalog.v1 | The trusted catalog. See Catalog format. |
ka2a.signing-key.v1 | A signing key file of ka2a keys generate. |
ka2a.store-epoch.v1 | The epoch witness store.epoch of a state directory. |
ka2a.recovery-marker.v1 | The recovery marker of a restored state directory. |
MCP App build manifest
ka2a.mcp-app-build/1 is a development and release inventory, not an MCP tool
result. format names the version. source_sha256 binds the production frontend
and build inputs. asset_sha256 identifies the generated HTML, and
notices_sha256 identifies THIRD_PARTY_MCP_NOTICES.md. node_version and
npm_version record the build tools. packages lists only rendered npm packages,
with each package's name, version, reviewed license, lockfile integrity
and resolved archive URL.
The release loader checks the source, HTML and notices against these hashes. It refuses missing or stale assets, HTML above 2 MiB, a manifest above 1 MiB and an invalid package inventory. Each binary's SPDX document includes the rendered npm packages and their SHA-512 archive checksums. The release evidence records the App and source hashes and the build-tool versions. See Releasing.
The removed custom web command no longer emits ka2a.serve-ui/1. Its historical
documents remain recognizable; MCP Apps replace the browser interface. The
ka2a.run/1 UI fields are deprecated and omitted.
| MCP document | Meaning |
|---|---|
ka2a.recovery-rehearsal/1 | Sanitized retained simulation, never an applied receipt. See MCP. |
model-implementation-replay/1 | Bounded model and implementation observations. See MCP. |
source.retained_file is true when an MCP server serves a saved snapshot. The
recorded capture time remains unchanged. The file contains fixed recorded pages.