ECSS Simulation Infrastructure — Event (space-systems/ecss/e4008-event)
Use when the task is the event mechanism of ECSS-E-ST-40-08C clause 5.4.6
-- how a simulator publishes an event, who is allowed to subscribe to it,
what an emission may carry, and what the infrastructure owes the
remaining subscribers when one of them fails. The clause carries fourteen
normative items and a design is graded against all of them.
Domain quick reference
- An event source is a named publication point with exactly one declared
argument type drawn from the infrastructure primitive set. A void
source publishes the fact that something happened and nothing else, so
handing it a payload is an error and not a convenience.
- Subscription is by sink identity, not by callable. A repeated
subscription by the same sink is refused rather than folded into one,
because the alternative makes the delivered notification count depend
on how many times the model tree was walked during assembly.
- Sink identity has to be canonical before it is compared. Two names that
differ only by case, hyphen or blank are the same subscriber; letting
them both in means an unsubscribe removes one of a pair the design
believed was single.
- Notification order is the subscription order. It is the only order a
replay can reproduce, so a set-backed or hash-backed subscriber store
is a reproducibility defect even when every sink is eventually reached.
- Emission is a state-dependent operation. A simulator that has not yet
built its model tree, or that is already unwinding, has no consistent
set of sinks to notify; those states refuse the emission instead of
dropping it silently.
- One sink raising is a sink defect, not an event defect. The emission
records the failure and carries on down the list, so a single bad
subscriber cannot quietly starve every subscriber added after it.
- The delivery walks a snapshot of the subscriber list. A sink that
unsubscribes from inside its own notification changes the next
emission, never the one in flight.
Workflow
- Validate each source name and argument type at declaration; a
repeated name inside one publisher is refused rather than shadowed.
- Record a declared subscriber ceiling where the design states one, and
whether the source has a documented emitter -- a source nothing ever
raises is dead interface surface.
- Canonicalise every sink name to its identity token before subscribing,
and refuse both an exact repeat and an aliased repeat.
- Refuse an unsubscribe naming a sink the source does not hold; an
ignored unsubscribe hides a wiring error in the model tree.
- On emission, resolve the simulator state, reject a state that cannot
honour a notification, then check the argument against the declared
type with the void case handled explicitly.
- Stamp the emission with the next sequence number, notify the snapshot
in subscription order, and collect the raising sinks separately from
the delivered ones.
- Grade the fourteen normative items, separating a violated item from
one the evidence never exercised, and report coverage alongside the
verdict so an untested item cannot read as a pass.
Pitfalls
- Treating a repeated subscription as idempotent. Collapsing it silently
makes the notification count depend on assembly order, and the defect
only shows up as a duplicated telemetry sample much later.
- Comparing sink names raw. A subscriber added as one spelling and
removed as another leaves a stale entry that keeps receiving
notifications after the model believes it detached.
- Storing subscribers in a set or dictionary keyed by object identity.
Every sink is still reached, so the tests pass, but two runs of the
same scenario notify them in different orders and the recorded output
stops being reproducible.
- Swallowing an exception raised by a sink and stopping the walk. The
sinks registered after the raising one never learn the event happened,
and nothing in the run log says so.
- Mutating the subscriber list from inside a notification. The walk then
skips the sink that moved into the vacated slot, which is the hardest
class of missed-notification defect to reproduce.
- Reporting an item as satisfied because no evidence contradicted it. An
item no scenario exercised is not a pass; it is a coverage gap and the
assessment reports it as its own status.
Behavior contract (gate 3)
Name and type validation, sink identity canonicalisation, subscription
and unsubscription refusal, ordered snapshot delivery, state-guarded
emission, argument type checking, raising-sink isolation and the
fourteen-item conformance grading are exercised by the gate 3 contract
test: scripts/test_e4008_event.py against scripts/e4008_event_logic.py
(stdlib unittest, offline). Run:
python3 scripts/test_e4008_event.py
Compliance
- ECSS standards are freely downloadable (ESA); cite the source and
paraphrase per standards-map.yaml.
- compliance: STANDARDS-REF, gated: false.
1---2name: e4008-event3description: "Validate the event publish-and-subscribe design of a space simulator against ECSS-E-ST-40-08C clause 5.4.6. Use when the task is declaring an event source with one typed argument, refusing a repeated subscription or an unsubscribe by a sink that never subscribed, holding notification in subscription order, checking an emitted argument against the declared type, keeping an emission out of a simulator state that cannot honour it, isolating one raising sink so the sinks behind it are still notified, and grading the design against the fourteen normative items the clause carries. Trigger: ecss, e-st-40-08c, simulator-event-source, simulator-event-sink, event-subscription-order, event-argument-type-check, duplicate-event-subscription, event-sink-failure-isolation, event-emission-state-guard."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/e4008-event15 domain: space-systems16 subdomain: ecss17 tags: [ecss, e-st-40-08-simulation-scope, e4008-event, simulator-event-source, simulator-event-sink, event-subscription-order, event-argument-type-check, event-sink-failure-isolation]18 version: 0.1.019 author: Aero Agent Skills20---2122# ECSS Simulation Infrastructure — Event (space-systems/ecss/e4008-event)2324Use when the task is the event mechanism of ECSS-E-ST-40-08C clause 5.4.625-- how a simulator publishes an event, who is allowed to subscribe to it,26what an emission may carry, and what the infrastructure owes the27remaining subscribers when one of them fails. The clause carries fourteen28normative items and a design is graded against all of them.2930## Domain quick reference3132- An event source is a named publication point with exactly one declared33 argument type drawn from the infrastructure primitive set. A void34 source publishes the fact that something happened and nothing else, so35 handing it a payload is an error and not a convenience.36- Subscription is by sink identity, not by callable. A repeated37 subscription by the same sink is refused rather than folded into one,38 because the alternative makes the delivered notification count depend39 on how many times the model tree was walked during assembly.40- Sink identity has to be canonical before it is compared. Two names that41 differ only by case, hyphen or blank are the same subscriber; letting42 them both in means an unsubscribe removes one of a pair the design43 believed was single.44- Notification order is the subscription order. It is the only order a45 replay can reproduce, so a set-backed or hash-backed subscriber store46 is a reproducibility defect even when every sink is eventually reached.47- Emission is a state-dependent operation. A simulator that has not yet48 built its model tree, or that is already unwinding, has no consistent49 set of sinks to notify; those states refuse the emission instead of50 dropping it silently.51- One sink raising is a sink defect, not an event defect. The emission52 records the failure and carries on down the list, so a single bad53 subscriber cannot quietly starve every subscriber added after it.54- The delivery walks a snapshot of the subscriber list. A sink that55 unsubscribes from inside its own notification changes the next56 emission, never the one in flight.5758## Workflow59601. Validate each source name and argument type at declaration; a61 repeated name inside one publisher is refused rather than shadowed.622. Record a declared subscriber ceiling where the design states one, and63 whether the source has a documented emitter -- a source nothing ever64 raises is dead interface surface.653. Canonicalise every sink name to its identity token before subscribing,66 and refuse both an exact repeat and an aliased repeat.674. Refuse an unsubscribe naming a sink the source does not hold; an68 ignored unsubscribe hides a wiring error in the model tree.695. On emission, resolve the simulator state, reject a state that cannot70 honour a notification, then check the argument against the declared71 type with the void case handled explicitly.726. Stamp the emission with the next sequence number, notify the snapshot73 in subscription order, and collect the raising sinks separately from74 the delivered ones.757. Grade the fourteen normative items, separating a violated item from76 one the evidence never exercised, and report coverage alongside the77 verdict so an untested item cannot read as a pass.7879## Pitfalls8081- Treating a repeated subscription as idempotent. Collapsing it silently82 makes the notification count depend on assembly order, and the defect83 only shows up as a duplicated telemetry sample much later.84- Comparing sink names raw. A subscriber added as one spelling and85 removed as another leaves a stale entry that keeps receiving86 notifications after the model believes it detached.87- Storing subscribers in a set or dictionary keyed by object identity.88 Every sink is still reached, so the tests pass, but two runs of the89 same scenario notify them in different orders and the recorded output90 stops being reproducible.91- Swallowing an exception raised by a sink and stopping the walk. The92 sinks registered after the raising one never learn the event happened,93 and nothing in the run log says so.94- Mutating the subscriber list from inside a notification. The walk then95 skips the sink that moved into the vacated slot, which is the hardest96 class of missed-notification defect to reproduce.97- Reporting an item as satisfied because no evidence contradicted it. An98 item no scenario exercised is not a pass; it is a coverage gap and the99 assessment reports it as its own status.100101## Behavior contract (gate 3)102103Name and type validation, sink identity canonicalisation, subscription104and unsubscription refusal, ordered snapshot delivery, state-guarded105emission, argument type checking, raising-sink isolation and the106fourteen-item conformance grading are exercised by the gate 3 contract107test: scripts/test_e4008_event.py against scripts/e4008_event_logic.py108(stdlib unittest, offline). Run:109python3 scripts/test_e4008_event.py110111## Compliance112113- ECSS standards are freely downloadable (ESA); cite the source and114 paraphrase per standards-map.yaml.115- compliance: STANDARDS-REF, gated: false.