State Reconstruction¶
State reconstruction is a disciplined observer hypothesis, not machine truth.
| Status | Examples | Runtime example | Source posture |
|---|---|---|---|
final-copy |
synthetic/passive |
available |
project governance plus synthetic workbook evidence |
A Concrete Artifact¶
# synthetic passive observer workbook
t=12:00:00.000 DBC ENGINE_STATUS.EngineSpeed = 1000 rpm source=samples/first-workbook/expected/dbc.yml
t=11:59:57.000 DBC ENGINE_STATUS.EngineState = Off source=samples/first-workbook/expected/dbc.yml
t=12:00:00.500 DBC ENGINE_STATUS.EngineLoad = 45 percent source=synthetic future-dated record
expected freshness window: 1 s
expected signal: HydraulicPressure
t=11:59:59.900 EngineSpeed = 850 rpm from synthetic alternate authority
Synthetic
Synthetic offline sample for explanation; not a real operational trace or live-system instruction.
Inspection Trap¶
A decoded value can look like state even when it is only a recent observation under one authority. The trap is to collapse freshness, missingness, source confidence, and conflict into a single convenient truth value.
This page inspects synthetic workbook evidence as observer state: one signal can be fresh, stale, missing, or unknown, and it can also be conflicting or low-confidence depending on timestamp, provenance, and expected evidence.
Worked Decode¶
- The DBC fixture in
samples/first-workbook/maps CAN identifier0x123toENGINE_STATUS. - The matching synthetic payload decodes
EngineSpeedas1000 rpmandEngineStateasOff. - At observer time
12:00:00,EngineSpeedwas observed100 msago, so it is fresh under a1 sfreshness window. EngineStatewas observed3 sago, so it is stale under the same window.HydraulicPressureis expected by the workbook DBC but absent from this observer state, so the assessment is missing.EngineLoadcarries a timestamp later than the observer time. Its evidence cannot be ordered on this time base, so its assessment is unknown with zero confidence.- A near-contemporaneous second
EngineSpeedobservation of850 rpm, with the same unit but a different synthetic authority, creates a conflict under the stated overlap rule. The conflict does not prove which value is right.
What The Evidence Supports¶
- The artifact supports explicit observer assessments for fresh, stale, missing, conflicting, and low-confidence evidence.
- It supports source-aware reasoning over decoded synthetic values, timestamps, expected signals, and alternate authority.
- It supports a cautious state hypothesis with reasons, not a hidden-machine-state claim.
What The Evidence Does Not Support¶
- The artifact does not prove physical state, sensor health, safety effect, actuator intent, or application consumption.
- It does not choose the correct value when sources conflict.
- It does not replace domain-specific timing, redundancy, synchronization, or certification analysis.
Passive Reconstruction Cases¶
| Case | Evidence in the synthetic workbook | Observer-safe claim | What remains unknown |
|---|---|---|---|
| Fresh value | EngineSpeed = 1000 rpm within the 1 s freshness window |
Recent observed value under the named synthetic DBC authority. | Physical engine truth, sensor health, and controller use. |
| Stale value | EngineState = Off last seen 3 s ago |
Previously observed value now outside the stated freshness window. | Whether the machine changed, the capture missed updates, or the expected window is wrong. |
| Missing value | HydraulicPressure expected but absent |
Expected evidence was not present in this observer state. | Whether the signal was never scheduled, filtered out, unavailable, or outside the capture window. |
| Future-dated value | EngineLoad = 45 percent dated after the observer time |
Timing evidence cannot be ordered; status is unknown with zero confidence. | Whether clocks disagree, metadata was transformed, or the record belongs to another time base. |
| Conflicting value | near-contemporaneous EngineSpeed = 850 rpm from an alternate synthetic authority |
comparable values disagree across distinct provenance within the overlap window. | Which authority, time base, or decode is appropriate. |
| Low source confidence | value exists but source provenance is weak | Treat the value as a hypothesis requiring provenance review. | Whether the database, formatter, or integration context matches the artifact. |
Field Layout / Anatomy¶
| Element | Shape | Inspection meaning |
|---|---|---|
| Signal | name, value, optional unit, source | Decoded claim from a parser or description authority. |
| Observation | signal, source, timestamp, quality | Evidence that the value was seen at a time under a stated source. |
| State | latest observation by signal name | Current observer memory, not complete machine state. |
| Assessment | status, confidence, reason | Cautious freshness or missingness judgment for one signal. |
| Conflict | same signal, different values | Disagreement evidence requiring source and timing context. |
Visual Model¶
Timing And Authority¶
Timing authority comes from the observer clock and the expected freshness window. Semantic authority comes from the DBC or another description source. State authority is weaker than both: it is a hypothesis over observed evidence. A fresh decode can still be semantically wrong if the authority is wrong, and a semantically correct decode can still be stale. Evidence dated after the observer time is not extra-fresh evidence; it is an ordering anomaly that remains unknown until the time bases are reconciled.
Semantic authority
Bytes rarely explain themselves. Name the source that defines meaning before naming engineering values: standard metadata, label table, DBC, PGN/SPN definition, object dictionary, register map, DID catalog, LDF, ARXML, channel metadata, or vendor profile.
Failure And Ambiguity¶
- Missing can mean never observed, filtered out, outside the capture window, or not scheduled in the current mode.
- Stale can mean the machine stopped publishing, the capture missed traffic, a gateway cached a value, or the expected freshness window is wrong.
- A future timestamp can indicate clock disagreement, metadata conversion, or evidence from another time base. The observer does not infer which explanation is correct.
- Conflict requires comparable units, distinct sources, timestamp evidence, and a stated overlap window. Same-source evolution is not conflict. Remaining disagreements can still come from wrong authority, clock error, gateway conversion, or a real state transition seen through independent sources.
- Confidence decay is observer confidence only. It does not prove sensor health, safety effect, physical truth, actuator intent, or application consumption.
Python Model¶
The current package exposes a concrete passive reconstruction example:
"""Runnable passive state reconstruction example for the schoolbus binder."""
from datetime import UTC, datetime, timedelta
from schoolbus.core import Observation, Signal, Unit
from schoolbus.formats.dbc import DbcDatabase
from schoolbus.observe import PassiveObserver, assess_latest, find_conflicts
from schoolbus.protocols.examples import DBC_TEACHING_TEXT
now = datetime(2026, 5, 21, 12, 0, tzinfo=UTC)
max_age = timedelta(seconds=1)
database = DbcDatabase.from_text(
DBC_TEACHING_TEXT,
source="samples/first-workbook/raw/dbc_engine_status.dbc",
)
signals = database.decode(0x123, bytes.fromhex("00 40 1f 40 1f 00 00 00"))
observer = PassiveObserver()
observer.observe(
Observation(
signal=signals["EngineSpeed"],
source="samples/first-workbook/expected/dbc.yml",
timestamp=now - timedelta(milliseconds=100),
)
)
observer.observe(
Observation(
signal=signals["EngineState"],
source="samples/first-workbook/expected/dbc.yml",
timestamp=now - timedelta(seconds=3),
)
)
state = observer.state()
print(assess_latest(state, "EngineSpeed", max_age, now=now).show_fields())
print(assess_latest(state, "EngineState", max_age, now=now).show_fields())
print(assess_latest(state, "HydraulicPressure", max_age, now=now).explain())
conflicts = find_conflicts(
[
Observation(
signal=signals["EngineSpeed"],
source="samples/first-workbook/expected/dbc.yml",
timestamp=now - timedelta(milliseconds=100),
),
Observation(
signal=Signal(
"EngineSpeed",
850,
Unit("rpm"),
source="synthetic alternate authority",
),
source="synthetic alternate authority",
timestamp=now - timedelta(milliseconds=100),
),
]
)
for conflict in conflicts:
print(conflict.show_fields())
print(conflict.explain())
The model keeps assessment local and explicit: one signal, one status, one confidence score, one reason. It reports conflicts without selecting a winning source.
See the passive state reconstruction lab for the runnable workbook view.
Source Notes¶
Source confidence: High for project-local observer concepts, synthetic workbook evidence, and API behavior. Physical state and signal semantics remain authority-dependent.
| Teaching claim | Source role | Limit |
|---|---|---|
| Observations attach decoded signals to time. | schoolbus governance/source policy | not a complete event-sourcing framework |
| Confidence decays with age in this helper. | synthetic teaching artifact | not a safety, reliability, or sensor-health calculation |
| DBC-derived values need DBC provenance. | synthetic teaching artifact | not operational signal truth |
| Conflicts require source and timing context. | project source policy | helper does not choose a correct value |
| Passive reconstruction cannot prove hidden state. | schoolbus governance/source policy | not a certification or monitoring claim |
Simplification
The confidence score is deliberately linear and local to this workbook. Real systems may require richer timing, source-quality, synchronization, redundancy, and domain models before making operational claims.
References¶
Repo-Owned Context¶
docs/governance/project-charter.mddocs/concepts/observer-model.mddocs/binder/foundations/observer-reconstruction.mddocs/binder/foundations/timing-and-cadence.mdsamples/first-workbook/
Public Cross-Checks¶
This page is project pedagogy over synthetic evidence. Protocol-specific public cross-checks live on the relevant binder pages, especially CAN and DBC.
Project posture is aggregated in the protocol support policy, source policy, and project charter.