MYTHOSAI

Offline learning workbooks · Fictional cases

Dependency lock consistency using an offline manifest

Compare a fictional declared dependency range with a precise pinned version.

What this miniature lab demonstrates

Compare a fictional declared dependency range with a precise pinned version.

Set up a harmless offline test

Requires Python 3. Run only on your own computer in a text console. No packages, accounts, network connections, malware, production logs or cloud credentials are required. Copy the example into a file or download the runnable script. The script includes assertions that fail if the expected behaviour changes.

manifest = {"example-lib": "2.4.1", "widget-kit": "1.9.3"}
lockfile = {"example-lib": "2.4.1", "widget-kit": "1.9.3"}
changed = dict(lockfile)
changed["widget-kit"] = "1.9.4"

def exact_match(requested, locked):
    return all(locked.get(name) == version for name, version in requested.items())

assert exact_match(manifest, lockfile)
assert not exact_match(manifest, changed)
print("Original pinned graph matches:", exact_match(manifest, lockfile))
print("Changed graph matches:", exact_match(manifest, changed))

Output from the bundled script

The following text was generated by running this exact script in an offline Python environment during package validation. It is not a product or attacker simulation result.

Original pinned graph matches: True
Changed graph matches: False

Interpretation and limits

This simple equality model illustrates change visibility, not vulnerability scoring or a real package-manager resolution algorithm. For production, validate provenance, signed artifacts and test behaviour.

Questions to discuss

Why must a version update still pass compatibility and security review even when it is recorded correctly?

To practise further, open the supply chain learning track and download a three-case CSV from any individual guide. Those records are fictional and deliberately contain an ambiguous case for analysis.

Primary sources

Scope: An illustrative educational model tested for deterministic output; no real-world security effectiveness or deployed vulnerability assessment is claimed. If a command, API or framework changes, follow the current official documentation and obtain approval before changes to real systems.