APEX CNO

APEX Daily Pulse — 2026-11-16

Smaller Counter Is Not Older Record

[✅ Verified] Pillar: Timing and synchronization

[❓ Unverified] Estimated duration: 3–5 minutes

Reactivation target: Preserve record ordering across a fixed-width sequence counter rollover.

Prerequisites

- Python 3.12+ and a Bash-compatible terminal.

- Owned equipment; synthetic eight-bit counters only.

- No privileges, network access, or external packages.

Actions

  1. 1. Start with sequence 253. Predict which records are newer in this stream: 254, 255, 0, 1, 1, 253, 129.
  1. 2. Run the complete fixture. Compare ordinary integer ordering with modular ordering:
python3 - <<'PY'
def classify(candidate: int, previous: int) -> str:
 """Compare eight-bit serials within a half-range ordering window."""
 if not (0 <= candidate < 256 and 0 <= previous < 256):
 raise ValueError("counter outside eight-bit range")
 delta = (candidate - previous) % 256
 match delta:
 case 0:
 return "DUPLICATE"
 case 128:
 return "AMBIGUOUS"
 case _ if delta < 128:
 return "ADVANCE"
 case _:
 return "STALE"

stream = [254, 255, 0, 1, 1, 253, 129]
naive_last = guarded_last = 253
naive_accepted: list[int] = []
guarded_accepted: list[int] = []
decisions: list[str] = []

for candidate in stream:
 if candidate > naive_last:
 naive_accepted.append(candidate)
 naive_last = candidate

 decision = classify(candidate, guarded_last)
 decisions.append(decision)
 print(
 f"previous={guarded_last} candidate={candidate} "
 f"decision={decision}"
 )
 if decision == "ADVANCE":
 guarded_accepted.append(candidate)
 guarded_last = candidate

passed = (
 naive_accepted == [254, 255]
 and guarded_accepted == [254, 255, 0, 1]
 and decisions == [
 "ADVANCE", "ADVANCE", "ADVANCE", "ADVANCE",
 "DUPLICATE", "STALE", "AMBIGUOUS",
 ]
)

print(f"naive_accepted={naive_accepted}")
print(f"guarded_accepted={guarded_accepted}")
print(f"drill_passed={passed}")
raise SystemExit(0 if passed else 1)
PY
  1. 3. Inspect the transition from 255 to zero. Its modular distance is one, not minus 255.
  1. 4. Inspect the final three controls relative to accepted sequence one: duplicate one, stale 253, and ambiguous 129. None must update the accepted sequence.

Observable signal

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

previous=253 candidate=254 decision=ADVANCE
previous=254 candidate=255 decision=ADVANCE
previous=255 candidate=0 decision=ADVANCE
previous=0 candidate=1 decision=ADVANCE
previous=1 candidate=1 decision=DUPLICATE
previous=1 candidate=253 decision=STALE
previous=1 candidate=129 decision=AMBIGUOUS
naive_accepted=[254, 255]
guarded_accepted=[254, 255, 0, 1]
drill_passed=True

[✅ Verified] Mechanism: an eight-bit counter wraps modulo 256. A forward modular distance from one through 127 defines advancement within the declared window. Zero is a duplicate. Exactly 128 has no unique ordering. Larger distances are treated as stale under that window assumption.

Success condition

The guarded receiver accepts four records across rollover. It rejects the duplicate, stale record, and half-range ambiguity without changing its last accepted sequence. Every assertion passes.

Failure signature

[✅ Verified] The naive receiver remains at 255 and rejects zero and one. Ordinary integer comparison has converted valid post-rollover records into apparent old records.

Python unavailable: POSIX awk alternative

printf '%s\n' 254 255 0 1 1 253 129 |
awk '
BEGIN { previous = 253; accepted = 0 }
{
 candidate = $1
 delta = (candidate - previous + 256) % 256
 if (delta == 0) decision = "DUPLICATE"
 else if (delta == 128) decision = "AMBIGUOUS"
 else if (delta < 128) decision = "ADVANCE"
 else decision = "STALE"

 printf "previous=%d candidate=%d decision=%s\n",
 previous, candidate, decision

 if (decision == "ADVANCE") {
 previous = candidate
 accepted++
 }
}
END {
 print "accepted=" accepted
 print "last_accepted=" previous
 exit(accepted == 4 && previous == 1 ? 0 : 1)
}'

[❓ Unverified] Expected final values: accepted=4 and last_accepted=1.

Boundary check

[✅ Verified] Hidden assumption: the true forward gap is less than half the counter range, and the producer has not restarted its counter. After a long outage or restart, these rules cannot prove order. Use an authenticated producer epoch or a defined resynchronization exchange; do not silently reset the receiver on any smaller value.

[✅ Verified] This gate orders serials. It does not prove continuity or authenticate records. A forward jump can still contain loss, and a forged advance can move receiver state.

Adaptation question

Which APEX sensor or reachback counters can wrap or restart without an explicit ordering window and producer epoch?