ECSS SpaceWire RMAP — Error Codes (space-systems/ecss/e5052-error-codes)
Use when the task is the error-code set of ECSS-E-ST-50-52C clause 5.6 —
deciding which single status a target puts in a reply, whether a reply
is sent at all, and whether a captured reply is self-consistent with the
status it carries.
Domain quick reference
- The status field carries one value, not a list. A command can trip
several conditions at once — a rejected key on a packet that also
ended early — and the target still reports one of them, so the order
in which conditions are detected is part of the specification, not an
implementation choice.
- The order runs outwards in. Whether the packet reached the right
target comes before whether the sender was entitled to command it,
which comes before whether the command code means anything, which
comes before whether the payload survived. A target that reports a
payload fault on a command it should have rejected on the key has
answered the wrong question.
- One condition produces no status at all. If the header check fails,
nothing in the header can be relied on — including the fields a reply
would be addressed with — so the command is dropped and the initiator
learns of it by timeout rather than by status.
- A failure reply carries no data. Anything read out of the payload of a
reply whose status is non-zero is whatever the buffer held before, so
a non-zero status with a non-zero returned length is a defect in the
target, not a partial result.
- Values outside the defined set are kept aside, not free. A target that
reports one has invented a code an initiator cannot act on, and an
initiator that grades one as a generic failure has hidden a defect.
- Fault families are what a campaign is read by. Routing, authorisation,
command and payload faults point at different parts of the system, and
a run that is all authorisation faults is a key-management problem
rather than a link problem.
Workflow
- Normalise the observed conditions into the known condition tokens. An
unrecognised token is an input error, because a condition nobody
named cannot be placed in the detection order.
- Walk the detection order and take the first condition present. When
that condition is the untrusted header, the answer is that no status
exists and no reply is built.
- Decide separately whether a reply leaves the target: an untrusted
header silences it, and so does a command that asked for no
acknowledgement.
- Look the reported value up for its slug and family, and grade a
reported value that is kept aside as a finding in its own right.
- Compare the reported value with the one the observed conditions call
for, and check the returned length against the status: zero bytes
whenever the status is not success.
- Roll a run of transaction records into per-family counts plus a count
of the commands dropped without a reply, and index every finding by
the record it came from.
Pitfalls
- Reporting the last condition detected rather than the first in the
order. Later conditions are usually consequences of earlier ones, and
reporting a consequence sends the investigation to the wrong place.
- Treating a dropped command as a link fault. A command dropped for an
untrusted header never produced a status, so the initiator sees a
timeout; reading that timeout as a lost packet hides a corrupted
header the link layer did not catch.
- Reading data out of a failed reply. The payload of a non-zero-status
reply is not a partial result and concatenating it with a retry
produces a buffer that never existed in the target.
- Folding a value kept aside into a generic failure bucket. It is
evidence that a target is reporting outside the defined set, and the
bucket makes it disappear.
- Counting faults without their families. A total fault count says
nothing about where to look; the same count split across routing,
authorisation, command and payload families usually names the
subsystem outright.
Behavior contract (gate 3)
The registry lookups, family assignment, reserved-value handling,
condition normalisation, detection precedence, reply-or-drop decision,
reply consistency checks and run summary are exercised by the gate 3
contract test: scripts/test_e5052_error_codes.py against
scripts/e5052_error_codes_logic.py (stdlib unittest, offline). Run:
python3 scripts/test_e5052_error_codes.py
Compliance
- ECSS standards are freely downloadable (ESA); cite the source and
paraphrase per standards-map.yaml.
- compliance: STANDARDS-REF, gated: false.
1---2name: e5052-error-codes3description: "Determine which status a SpaceWire RMAP target reports and whether the reply agrees with it. Use when an ECSS-E-ST-50-52C clause 5.6 error-code question arises: look a status value up in the registry for its slug and fault family, walk the detection precedence so a command that trips several conditions is answered with the one a target settles on, decide whether a reply leaves the target at all when the header cannot be trusted, check that a failure status carries no returned data and that no value kept aside is reported, then summarise a run of transactions by family. Trigger: ecss, e-st-50-52c, rmap-status-code-registry, rmap-error-detection-precedence, rmap-silently-dropped-command, rmap-reserved-status-value, rmap-reply-status-consistency, rmap-fault-family-summary."4license: Apache-2.05compliance: STANDARDS-REF6standards:7 - id: ecss8 reference-only: true9gated: false10domain: space-systems11pack: space-systems12compatibility: "agentskills.io SKILL.md; any SKILL.md host (Claude Code, Hermes, OpenClaw)"13metadata:14 source: https://skillmd.com/skills/ashfordeou/e5052-error-codes15 domain: space-systems16 subdomain: ecss17 tags: [ecss, e-st-50-52-rmap-scope, e5052-error-codes, rmap-status-code-registry, rmap-error-detection-precedence, rmap-silently-dropped-command, rmap-reserved-status-value, rmap-fault-family-summary]18 version: 0.1.019 author: Aero Agent Skills20---2122# ECSS SpaceWire RMAP — Error Codes (space-systems/ecss/e5052-error-codes)2324Use when the task is the error-code set of ECSS-E-ST-50-52C clause 5.6 —25deciding which single status a target puts in a reply, whether a reply26is sent at all, and whether a captured reply is self-consistent with the27status it carries.2829## Domain quick reference3031- The status field carries one value, not a list. A command can trip32 several conditions at once — a rejected key on a packet that also33 ended early — and the target still reports one of them, so the order34 in which conditions are detected is part of the specification, not an35 implementation choice.36- The order runs outwards in. Whether the packet reached the right37 target comes before whether the sender was entitled to command it,38 which comes before whether the command code means anything, which39 comes before whether the payload survived. A target that reports a40 payload fault on a command it should have rejected on the key has41 answered the wrong question.42- One condition produces no status at all. If the header check fails,43 nothing in the header can be relied on — including the fields a reply44 would be addressed with — so the command is dropped and the initiator45 learns of it by timeout rather than by status.46- A failure reply carries no data. Anything read out of the payload of a47 reply whose status is non-zero is whatever the buffer held before, so48 a non-zero status with a non-zero returned length is a defect in the49 target, not a partial result.50- Values outside the defined set are kept aside, not free. A target that51 reports one has invented a code an initiator cannot act on, and an52 initiator that grades one as a generic failure has hidden a defect.53- Fault families are what a campaign is read by. Routing, authorisation,54 command and payload faults point at different parts of the system, and55 a run that is all authorisation faults is a key-management problem56 rather than a link problem.5758## Workflow59601. Normalise the observed conditions into the known condition tokens. An61 unrecognised token is an input error, because a condition nobody62 named cannot be placed in the detection order.632. Walk the detection order and take the first condition present. When64 that condition is the untrusted header, the answer is that no status65 exists and no reply is built.663. Decide separately whether a reply leaves the target: an untrusted67 header silences it, and so does a command that asked for no68 acknowledgement.694. Look the reported value up for its slug and family, and grade a70 reported value that is kept aside as a finding in its own right.715. Compare the reported value with the one the observed conditions call72 for, and check the returned length against the status: zero bytes73 whenever the status is not success.746. Roll a run of transaction records into per-family counts plus a count75 of the commands dropped without a reply, and index every finding by76 the record it came from.7778## Pitfalls7980- Reporting the last condition detected rather than the first in the81 order. Later conditions are usually consequences of earlier ones, and82 reporting a consequence sends the investigation to the wrong place.83- Treating a dropped command as a link fault. A command dropped for an84 untrusted header never produced a status, so the initiator sees a85 timeout; reading that timeout as a lost packet hides a corrupted86 header the link layer did not catch.87- Reading data out of a failed reply. The payload of a non-zero-status88 reply is not a partial result and concatenating it with a retry89 produces a buffer that never existed in the target.90- Folding a value kept aside into a generic failure bucket. It is91 evidence that a target is reporting outside the defined set, and the92 bucket makes it disappear.93- Counting faults without their families. A total fault count says94 nothing about where to look; the same count split across routing,95 authorisation, command and payload families usually names the96 subsystem outright.9798## Behavior contract (gate 3)99100The registry lookups, family assignment, reserved-value handling,101condition normalisation, detection precedence, reply-or-drop decision,102reply consistency checks and run summary are exercised by the gate 3103contract test: scripts/test_e5052_error_codes.py against104scripts/e5052_error_codes_logic.py (stdlib unittest, offline). Run:105python3 scripts/test_e5052_error_codes.py106107## Compliance108109- ECSS standards are freely downloadable (ESA); cite the source and110 paraphrase per standards-map.yaml.111- compliance: STANDARDS-REF, gated: false.