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 of pkg/observe has no row in the table below.
  • TestVersionedDocumentsOnlyGainMembers (internal/cli) holds the JSON members of each document in internal/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").

  1. A document of one version (/1) only gains members in a later ka2a revision. A new member can be absent or null in an older document.
  2. 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.
  3. A set of fixed values (for example outcome, result or a check status) can gain values. An error reference token keeps its meaning.
  4. 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 format it does not know.
  5. 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

FormatWritten byGo typeContent
ka2a.version/1ka2a versionversionResult (internal/cli/version.go)Version, commit, Go version, platform, wire profile, store schema version and snapshot format.
ka2a.doctor/1ka2a doctordoctorResult (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/1ka2a observe, the file of ka2a snapshot export, MCP node_status and list_operationsobserve.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/1ka2a snapshot export --out FILEexportResult (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/1ka2a snapshot diffobserve.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/1ka2a operation show, MCP get_operationobserve.OperationView (pkg/observe/snapshot.go)One operation with its source, identifier mode, node and the four acceptance stages.
ka2a.topics.verify/1ka2a topics verifytopicResult (internal/cli/topics.go)The topic, the profile, the result (see topic check results) and each check.
ka2a.topics.provision/1ka2a topics provisiontopicResult (internal/cli/topics.go)As ka2a.topics.verify/1, and whether the command created the topic.
ka2a.topics.acl-plan/1ka2a topics acl-planaclPlan (internal/cli/aclplan.go)The principal, endpoint, mailbox topic, consumer group, the minimal ACLs, the matching kafka-acls.sh commands and notes.
ka2a.init/1ka2a initinitResult (internal/cli/init.go)The state directory, the node identity, the catalog digest, the signing key and whether the store was created.
ka2a.scaffold/1ka2a scaffoldscaffoldResult (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/1ka2a 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/1the 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/1ka2a restorerestoreResult (internal/cli/store.go)Backup ID, source, restore time, the path of the previous database and the next step.
ka2a.quarantine.release/1ka2a quarantine releasereleaseResult (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/1ka2a held releaseheldResult (internal/cli/held.go)The decided row: kind, operation, previous and new state and reason, attempts and the next step.
ka2a.held.abandon/1ka2a held abandonheldResult (internal/cli/held.go)As ka2a.held.release/1, for an abandoned row or operation.
ka2a.recovery.simulate/1ka2a recovery simulatesimulationReport (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/1ka2a recovery planplanWritten (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/1the plan file of ka2a recovery plan --out FILErecoveryPlan (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/1ka2a 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/1ka2a 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/1ka2a 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/1ka2a sendrequestResult (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/1ka2a probeprobeResult (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/1ka2a task getrequestResult (internal/cli/request.go)As ka2a.send/1.
ka2a.tasks.list/1ka2a tasks listrequestResult (internal/cli/request.go)As ka2a.send/1, with a page of tasks.
ka2a.task.cancel/1ka2a task cancelrequestResult (internal/cli/request.go)As ka2a.send/1.
ka2a.keys.generate/1ka2a keys generatekeyResult (internal/cli/keys.go)The key file and the catalog key entry. Never the private key.
ka2a.keys.public/1ka2a keys publickeyResult (internal/cli/keys.go)As ka2a.keys.generate/1, for an existing key.
ka2a.catalog.validate/1ka2a catalog validatecatalogValidateResult (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/1ka2a catalog diffcatalogDiffResult (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/1ka2a catalog digestcatalogDigestResult (internal/cli/catalog.go)Path, SHA-256 digest of the exact bytes and the endpoints.
ka2a.catalog.explain/1ka2a catalog explaincatalogExplainResult (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/1ka2a run --probe-listen (/livez, /readyz, /connectz), Node.HealthHandlerka2a.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/1commands that fail with --output json, except ka2a mcperrorDocument (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:

StageCauseMeaning
locally_queuednot_grantedThe catalog of the prober grants it no SendMessage on the peer. Nothing was sent.
locally_queuedunknown_peerThe peer is not an endpoint of the catalog.
locally_queuedresponse_route_missingThe 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_queuedtimeoutThe node did not start within --timeout.
broker_acknowledgedbroker_unreachableNo broker answered the node.
broker_acknowledgedrequest_route_deniedThe broker denied the write to the mailbox of the peer (a missing ACL).
broker_acknowledgedpublish_rejectedThe broker refused the request permanently.
broker_acknowledgedexpiredThe request expired before a broker acknowledged it.
broker_acknowledgedheldThe publication is held for an operator.
broker_acknowledgedtimeoutNo acknowledgement within --timeout, for another reason.
remote_recordedno_responseNo 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_recordedresponse_rejectedAn 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_recordedheldThe exchange is held or abandoned.
resultprobe_handler_offThe peer answered without the probe echo: it does not enable the probe handler.
resultprobe_refusedThe peer answered with another A2A error.
resultnonce_mismatchThe 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.

FormatWritten by
ka2a.mcp-app-build/1mcpweb/scripts/build.mjs; copied into releases as mcp-app-build.json.
ka2a.example.embedded/1The summary line of examples/embedded.
ka2a.example.recovery/1The result of examples/recovery.
ka2a.qualification.embedded/1TestEmbeddedConsumerQualification (internal/qualification).
ka2a.qualification.recovery/1The recovery walkthrough test (internal/qualification).
ka2a.campaign-manifest/1The manifest of the KH campaign (internal/qualification/campaign).
ka2a.campaign/1The summary of the KH campaign (internal/qualification/campaign).
ka2a.protected-evaluator/1The pins of the protected evaluator (internal/qualification/evaluator).
ka2a.evaluator-attempt/1One attempt of the protected evaluator (internal/qualification/evaluator).
ka2a.model-results/1The Quint model summary (verification/scripts/pilot.mjs), read by the release evidence (internal/release).
ka2a.model-bridge-traces/1The model-to-Go trace corpus (internal/modelbridge).
ka2a.rapid-regression/1The Rapid regression corpus (internal/archtest).
ka2a.load-report/1The load runs (benchmarks).
ka2a.fresh-environment/1make fresh-environment (scripts/fresh_environment.py).
ka2a.micro-benchmarks/1An 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.

FormatFile
ka2a.catalog.v1The trusted catalog. See Catalog format.
ka2a.signing-key.v1A signing key file of ka2a keys generate.
ka2a.store-epoch.v1The epoch witness store.epoch of a state directory.
ka2a.recovery-marker.v1The 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 documentMeaning
ka2a.recovery-rehearsal/1Sanitized retained simulation, never an applied receipt. See MCP.
model-implementation-replay/1Bounded 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.

All ka2a documents