ka2a documentation

Output formats

Developer preview. Not yet production ready. This page is rendered from docs/output-formats.md of the ka2a repository at revision 96fb45e5e5f6693e779837998c3aa9581d6a37f2. It describes the behavior of that revision.

Contents

With --output json, each ka2a command prints one JSON document on stdout. 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 serve-ui --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 exportobserve.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.operation/1ka2a operation showobserve.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.serve-ui/1ka2a serve-ui (one line when it listens)uiReady (internal/cli/serveui.go)The UI address, the token file and the source. Never the token.
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.backup/1ka2a backupbackupResult (internal/cli/store.go)Backup ID, path, time, schema version, SHA-256, size, source node, live epoch and coverage.
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.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 and metrics addresses.
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.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.digest/1ka2a catalog digestcatalogDigestResult (internal/cli/catalog.go)Path, SHA-256 digest of the exact bytes and the endpoints.
ka2a.error/1every command that fails with --output jsonerrorDocument (internal/cli/cli.go)The command, the error code, the message and the exit code.

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.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.

All ka2a documents