APEX CNO

APEX Daily Pulse — 2026-11-14

Saved Reference Is Not Evidence Snapshot

[✅ Verified] Pillar: Telemetry and evidence

[❓ Unverified] Estimated duration: 3–5 minutes

Reactivation target: Prevent later collector updates from changing an earlier in-memory evidence record.

Prerequisites

- Python 3.12+ and a Bash-compatible terminal.

- Owned equipment; synthetic sensor data only.

- No privileges, network access, or external packages.

Actions

  1. 1. Predict which saved values will change when the collector updates a nested measurement.
  1. 2. Run this complete fixture. It compares a shallow dictionary copy, a deep copy, and serialized bytes:
python3 - <<'PY'
import json
from copy import deepcopy
from typing import TypedDict

class Measurement(TypedDict):
 rssi_dbm: int

class Record(TypedDict):
 sensor_id: str
 measurement: Measurement

live: Record = {
 "sensor_id": "sensor-7",
 "measurement": {"rssi_dbm": -42},
}

shallow = live.copy()
snapshot = deepcopy(live)
encoded = json.dumps(live, sort_keys=True).encode("utf-8")

shared_nested_object = (
 shallow["measurement"] is live["measurement"]
)

# Simulate the next sensor update.
live["measurement"]["rssi_dbm"] = -91

serialized_rssi = json.loads(encoded)["measurement"]["rssi_dbm"]

passed = (
 shared_nested_object
 and live["measurement"]["rssi_dbm"] == -91
 and shallow["measurement"]["rssi_dbm"] == -91
 and snapshot["measurement"]["rssi_dbm"] == -42
 and serialized_rssi == -42
 and snapshot["measurement"] is not live["measurement"]
)

print(f"shared_nested_object={shared_nested_object}")
print(f"live_rssi={live['measurement']['rssi_dbm']}")
print(f"shallow_rssi={shallow['measurement']['rssi_dbm']}")
print(f"snapshot_rssi={snapshot['measurement']['rssi_dbm']}")
print(f"serialized_rssi={serialized_rssi}")
print(f"drill_passed={passed}")

raise SystemExit(0 if passed else 1)
PY
  1. 3. Compare shallow_rssi with the two independent snapshots. The shallow record changes without any assignment to shallow itself.
  1. 4. Identify the capture boundary: the nested data must become independent before the collector reuses or updates it—not when a delayed writer eventually processes the record.

Observable signal

[❓ Unverified] Expected output; this fixture was not executed in this run:

shared_nested_object=True
live_rssi=-91
shallow_rssi=-91
snapshot_rssi=-42
serialized_rssi=-42
drill_passed=True

[✅ Verified] Mechanism: dict.copy() creates a new outer dictionary but retains references to nested objects. Both dictionaries therefore address the same measurement. For this plain-data fixture, deepcopy() creates an independent nested dictionary. Serialization captures the value in immutable bytes.

Success condition

The live and shallow records change to −91 dBm. Both independent snapshots retain the original −42 dBm. Every assertion passes.

Failure signature

[✅ Verified] An earlier record changes to the latest measurement without a new observation for that record. In this fixture, shared nested state—not sensor behavior—causes the change.

Python unavailable: Node.js alternative

Use object spread for the shallow copy and a JSON round trip for this JSON-only snapshot:

node <<'JS'
"use strict";

const live = {
 sensor_id: "sensor-7",
 measurement: { rssi_dbm: -42 }
};

const shallow = { ...live };
const snapshot = JSON.parse(JSON.stringify(live));

live.measurement.rssi_dbm = -91;

const passed =
 shallow.measurement === live.measurement &&
 shallow.measurement.rssi_dbm === -91 &&
 snapshot.measurement.rssi_dbm === -42 &&
 snapshot.measurement !== live.measurement;

console.log("shallow_rssi=" + shallow.measurement.rssi_dbm);
console.log("snapshot_rssi=" + snapshot.measurement.rssi_dbm);
console.log("drill_passed=" + passed);
process.exitCode = passed ? 0 : 1;
JS

[❓ Unverified] Expected alternative output: shallow_rssi=-91, snapshot_rssi=-42, and drill_passed=true.

Boundary check

[✅ Verified] Hidden assumption: nothing changes the source during copying. Neither deep copying nor serialization alone creates a transaction across concurrent updates. Use one owner or a lock while capturing a record. A deep copy is also still mutable; it is not tamper-proof evidence.

[✅ Verified] The JSON alternative applies only to JSON-compatible values. It is not a general copy mechanism for objects, binary buffers, dates, or cyclic structures.

[❌ Speculative] Copy cost can encourage operators to bypass snapshot capture under load. Limit record size and capture one independent record at the producer boundary. Share that record downstream instead of repeatedly copying live state.

Adaptation question

Which APEX collectors queue references to reusable dictionaries or buffers instead of independent observations?