Open lesson

Mission: preserve the recovered page

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

Preserve a raw response and checkable provenance record to distinguish a content change from the still-open question of who made it.

In the story, Imani must preserve page 2 before Voss presents an empty report. Mara gives you A bytes {"events":["TRANSFER-7"],"next":3} received from https://api.example.test/events?page=2 at 20:30 UTC, and B bytes {"events":[],"next":3} in a report lacking a reliable creation time. Both versions must stay available to investigators.

Your mission

  1. List the provenance fields for A and distinguish byte size from event count.
  2. Give the Python method for fingerprinting A without rewriting its JSON.
  3. Compare sizes and fingerprints given in the lesson and describe the change.
  4. Explain what the fingerprints establish and what must still be checked to attribute that change.

How to check your work

  • The record has URL, UTC time, response code if known, size 34 and fingerprint; 34 is not an event count.
  • sha256(raw).hexdigest() uses A’s bytes.
  • A has 34 bytes and contains TRANSFER-7; B has 22 and does not; fingerprints differ.
  • The copy difference is established; B’s author and source remain to be found in other logs.

Course example

from datetime import datetime, timezone
from hashlib import sha256

source_url = 'https://api.example.test/events?page=2'
raw = b'{"events":["TRANSFER-7"],"next":3}'
received_at = datetime(2026, 10, 12, 20, 30, tzinfo=timezone.utc)

record = {
    'source_url': source_url,
    'received_at_utc': received_at.isoformat(),
    'byte_count': len(raw),
    'sha256': sha256(raw).hexdigest(),
}
print(record['byte_count'])
print(record['sha256'])

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.

# List the provenance fields for A and distinguish byte size from event count.
# Give the Python method for fingerprinting A without rewriting its JSON.
# Compare sizes and fingerprints given in the lesson and describe the change.
# Explain what the fingerprints establish and what must still be checked to attribute that change.

exemple.py

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

from datetime import datetime, timezone
from hashlib import sha256

source_url = 'https://api.example.test/events?page=2'
raw = b'{"events":["TRANSFER-7"],"next":3}'
received_at = datetime(2026, 10, 12, 20, 30, tzinfo=timezone.utc)

record = {
    'source_url': source_url,
    'received_at_utc': received_at.isoformat(),
    'byte_count': len(raw),
    'sha256': sha256(raw).hexdigest(),
}
print(record['byte_count'])
print(record['sha256'])