docs: document the kaptan-native protocol

This commit is contained in:
Onur Özkan committed 2026-08-24 00:56:32 +03:00
1 parent 5f91465e66
commit 4bc98adbc6
10 files changed
+314 -307

No files matched your search

+11 -10
View File
@@ -53,30 +53,31 @@ backpressure, retry, and untrusted-input results remain unannotated. In
particular, transient SPI/I²C `Busy` and unavailable range measurements stay
inside their service retry/idle paths. In contrast, every logging
macro—including `kaptan_log::error!`—produces only
`KAPTAN_LOG`. Error reporting is not a replacement for safety state,
`LOG`. Error reporting is not a replacement for safety state,
actuator inhibit, or typed configuration results.
`kaptan-err-reportable` owns reportable-error identity and its independent
one-slot ingress. A pending record contains only the compact ID and a static
reference to the reporting point's `file:line`. The MAVLink adapter copies that
location into its fixed field when constructing `KAPTAN_ERROR`. Producers never
location into its fixed field when constructing `ERROR`. Producers never
encode or transmit MAVLink themselves. Admission is bounded and lossy if a
different reportable error is already pending.
## What the receiver sees
- Configuration writes receive authoritative structured failures through
`KAPTAN_CONFIG_RESULT`: operation, lifecycle state, field IDs, validation
rule, and protocol error code. A reportable persistence failure also emits
the storage-only `CommitTransactionError::Store` ID once as
`KAPTAN_ERROR`; replaying the cached command result does not repeat the error
or the flash operation.
- A rejected KCFG upload receives an authoritative `FILE_CONTROL`
status and bounded readable detail. Invalid user content is not a firmware
error. A durable-storage failure additionally emits one stable
`PersistConfigurationError` ID that distinguishes journal geometry, model,
sequence, flash-controller, bounds, unlock, and verification
failures. Replaying the cached close result does not repeat the report or
flash operation.
- Reported `ReportableError` values reach the F722 MAVLink worker as a
`KAPTAN_ERROR`, subject to bounded transport admission. The payload is
`ERROR`, subject to bounded transport admission. The payload is
`{ error_id, raised_at[96] }`. `raised_at` is a zero-padded UTF-8
`file:line` prefix for the reporting point.
The message kind itself identifies an error; no level is duplicated in the
payload. Dynamic human-readable context belongs in `KAPTAN_LOG`, while
payload. Dynamic human-readable context belongs in `LOG`, while
structured protocol failures remain in their owning response message.
- Control, navigation, safety, and simulator error types are derive-ready but
their live owners are not yet attached to a MAVLink worker.