Change only starter/ship_check.py. Standard library only. Never modify the
scenario projects except through copies.
run_checks(command, cwd) -> dict: run[sys.executable, *command]in cwd, capture output, and return{"command": " ".join(command), "exit_code": int, "ran": int, "result": str}:ranis the test count parsed fromRan N tests in ....resultis"no-tests"whenran == 0(regardless of exit code — modern Pythons exit nonzero for "NO TESTS RAN"),"failed"when the exit code is nonzero, otherwise"ok".
build_record(checks, *, verified_on, unverified=None) -> dict:{"verified_on", "checks", "all_passed", "unverified"}whereall_passedis true only when every check has exit code 0 AND result"ok"(zero-test projects never pass), andunverifieddefaults to an empty list.write_record(record, destination): write JSON (UTF-8, indent 2, trailing newline) atomically via a sibling temp file plusos.replace; create missing parent directories; never leave a.tmpfile on success.run_project(project_dir, *, verified_on) -> dict: readship.json(command, optionalunverified), run the checks in the project directory, build the record, writeSHIP-RECORD.jsonthere, return it.main(argv=None) -> int:ship_check.py <project-dir> [--verified-on YYYY-MM-DD]; otherwise print usage to stderr and return 2. Without--verified-onuse today's date.- Print
all_passed=... checks=...to stdout; return 0 whenall_passed, otherwise 1.
Done means python verify.py starter exits 0 with all ten tests passing.