Open lesson

Mission: the command that arrived late

Command palette

This mission workspace keeps code and notes in this browser tab. Export them before closing it. Running code is practice, not an automatic grade for the mission.

Brief

Rebuild factual order from event time, measure arrival delay, and check clock reliability.

Voss puts E2 after the crash on a timeline based on receipt and calls it a reaction. Imani hands you the controller's time and three raw messages. Mara wants a timeline the team can check without accusing anyone from one timestamp. The story's meeting is near; the exercise has no timer.

Your mission

  1. Order E1, CRASH, and E2 by receipt and then event time.
  2. Calculate E2's delay and its gap from the crash.
  3. Explain Z and why mixing UTC and local time is dangerous.
  4. Name one clock check and the limit of today's conclusion.

How to check your work

  • Receipt E1–CRASH–E2; event E1–E2–CRASH.
  • E2 arrives 18 minutes after its stated time and precedes the crash by 7 minutes on that clock.
  • Z means UTC; comparing unconverted zones can mislead.
  • Independent clock check; SUPPLIER-SVC still does not identify a person.

Course example

from datetime import datetime

events = [
    {"id": "E1", "kind": "OPEN-17",
     "event_at": "2026-04-12T21:05:00Z", "received_at": "2026-04-12T21:07:00Z"},
    {"id": "CRASH", "kind": "accident",
     "event_at": "2026-04-12T21:25:00Z", "received_at": "2026-04-12T21:26:00Z"},
    {"id": "E2", "kind": "OPEN-18",
     "event_at": "2026-04-12T21:18:00Z", "received_at": "2026-04-12T21:36:00Z"},
]
def instant(value):
    return datetime.fromisoformat(value.replace("Z", "+00:00"))

by_arrival = sorted(events, key=lambda e: instant(e["received_at"]))
by_event = sorted(events, key=lambda e: instant(e["event_at"]))
e2 = next(e for e in events if e["id"] == "E2")
delay = instant(e2["received_at"]) - instant(e2["event_at"])
print("arrival_order", [e["id"] for e in by_arrival])
print("event_order", [e["id"] for e in by_event])
print("E2_delay_minutes", int(delay.total_seconds() / 60))

Code

Use Tab to leave the editor. Ctrl+Enter runs the source. The lines beginning with # are task reminders. Python ignores them. Write your code beneath them.

Python console

Loading laboratory…

Explore Python or SQL here; this is not an operating-system shell.

This is a disposable browser experiment. The code run here is not recorded as a completed mission.

Each command starts a fresh disposable worker: it runs a captured copy of your current source, then your command with the lesson fixtures. Changes are discarded afterward. Commands never save source or award XP. Ctrl+Enter executes the command.

Virtual workspace files

Source and declarative assets are readable here without JavaScript. Python input files are created at runtime; SQL setup initializes the disposable database.

source.py

Current editor source. Inspection shows your current edits.

# Order E1, CRASH, and E2 by receipt and then event time.
# Calculate E2's delay and its gap from the crash.
# Explain Z and why mixing UTC and local time is dangerous.
# Name one clock check and the limit of today's conclusion.

exemple.py

Declarative lesson asset; this is not a file created in the Python filesystem.

from datetime import datetime

events = [
    {"id": "E1", "kind": "OPEN-17",
     "event_at": "2026-04-12T21:05:00Z", "received_at": "2026-04-12T21:07:00Z"},
    {"id": "CRASH", "kind": "accident",
     "event_at": "2026-04-12T21:25:00Z", "received_at": "2026-04-12T21:26:00Z"},
    {"id": "E2", "kind": "OPEN-18",
     "event_at": "2026-04-12T21:18:00Z", "received_at": "2026-04-12T21:36:00Z"},
]
def instant(value):
    return datetime.fromisoformat(value.replace("Z", "+00:00"))

by_arrival = sorted(events, key=lambda e: instant(e["received_at"]))
by_event = sorted(events, key=lambda e: instant(e["event_at"]))
e2 = next(e for e in events if e["id"] == "E2")
delay = instant(e2["received_at"]) - instant(e2["event_at"])
print("arrival_order", [e["id"] for e in by_arrival])
print("event_order", [e["id"] for e in by_event])
print("E2_delay_minutes", int(delay.total_seconds() / 60))