Start with the script, not an install command.
A useful AI-assisted script should survive a handoff to your future self or a colleague. Before executing it, inspect imports, paths, network requests, subprocesses and secrets access. Confirm that dependency names point to the intended projects. This guide assumes you have reviewed the code and chosen a suitable execution environment.
An AI tool can help inventory imports, but its answer is a draft. Our proposed review prompt asks for third-party imports, Python requirements and uncertainties. We did not run that prompt or test an AI model. The practice code here was authored for the guide.
The small example converts three fictional timestamp strings with explicit offsets to UTC. This is a visible fixture you can check by hand: 09:00 at −07:00 and 17:00 at +01:00 both equal 16:00 UTC. It does not infer a location, resolve daylight-saving rules, or accept ambiguous dates.
Put requirements beside the code.
The Python packaging specification defines a comment block for single-file script requirements. The complete supplied script begins with this block:
# /// script
# requires-python = ">=3.13,<3.14"
# dependencies = ["python-dateutil==2.9.0.post0"]
# ///
"""Authored fictional fixture. No AI calls, files, or network in this body."""
import json
from datetime import timezone
from importlib.metadata import version
from dateutil.parser import isoparse
timestamps = [
"2026-10-21T09:00:00-07:00",
"2026-10-21T17:00:00+01:00",
"2026-10-21T16:00:00Z",
]
normalized = [isoparse(value).astimezone(timezone.utc).isoformat() for value in timestamps]
expected = ["2026-10-21T16:00:00+00:00"] * 3
if normalized != expected:
raise SystemExit("Fixture check failed: unexpected UTC timestamps")
print(json.dumps({"python_dateutil": version("python-dateutil"),
"inputs": timestamps, "utc": normalized,
"fixture_check": "passed"}, indent=2))requires-python limits this exercise to Python 3.13; it does not pin an exact patch release. python-dateutil is the distribution name; dateutil is its import name. The exact package pin is deliberate. Its PyPI release and isoparse documentation are the references for this fixture.
Download and inspect the handoff.
Prerequisite: Python 3.13 installed and available as python in Windows PowerShell. The official uv installation guide covers installation options; below we install the tested uv 0.13.4 release in a dedicated local tools environment. That keeps this exercise’s tool separate from a global installation.
Use a new empty folder. First download and inspect the files:
# Run in a NEW empty folder. Download, then inspect before execution.
Invoke-WebRequest 'https://jabsystems.io/ai-anonymous/Social/rerun-the-script-practice.zip' -OutFile '.\rerun-the-script-practice.zip'
Expand-Archive -LiteralPath '.\rerun-the-script-practice.zip' -DestinationPath '.\practice'
Set-Location '.\practice'
Get-Content .\normalize-times.py
Get-Content .\normalize-times.py.lock
Get-Content .\uv-practice-readme.txtAfter review, use these commands from the extracted practice folder:
# After inspecting the supplied files. Python 3.13 must be installed.
python --version
python -m venv .uv-tools
.\.uv-tools\Scripts\python.exe -m pip install "uv==0.13.4"
.\.uv-tools\Scripts\uv.exe --version
.\.uv-tools\Scripts\uv.exe run --locked --script .\normalize-times.py
# Repeat the same command; compare the output with uv-observed-results.json.
.\.uv-tools\Scripts\uv.exe run --locked --script .\normalize-times.pyInstallation and initial package resolution need network access. uv prepares a separate package environment for the script. That separation is not a sandbox: reviewed code still runs with your user’s permissions.
Save the adjacent lockfile.
As documented in uv’s script guide, a standalone script is locked explicitly. For this exercise, the generated file is normalize-times.py.lock; keep it beside normalize-times.py. The supplied ZIP already includes the reviewed lock, so you can run it without regenerating it.
When preparing your own handoff, generate the lock after reviewing requirements, inspect it, then keep both files together:
# For your OWN reviewed script, after choosing dependencies deliberately:
.\.uv-tools\Scripts\uv.exe lock --script .\normalize-times.py --default-index https://pypi.org/simple
# Review the generated normalize-times.py.lock and save it beside the script.
.\.uv-tools\Scripts\uv.exe run --locked --script .\normalize-times.pyThe lock records resolved dependencies, including the six dependency used by this dateutil release, with package sources and distribution hashes. It is a dependency record. It does not include your script’s source hash, inputs, operating system or the complete state of your machine.
The uv command reference distinguishes --locked, which checks whether requirements still match the lock, from --frozen, which uses the lock without that freshness check. This walkthrough uses --locked. A mismatch is a reason to inspect the change before deliberately updating the lock.
Check the rerun—and the lockfile’s boundary.
Actual local environment: Windows, Python 3.13.15, uv 0.13.4, python-dateutil 2.9.0.post0. Both normal runs produced the same JSON:
{
"python_dateutil": "2.9.0.post0",
"inputs": [
"2026-10-21T09:00:00-07:00",
"2026-10-21T17:00:00+01:00",
"2026-10-21T16:00:00Z"
],
"utc": [
"2026-10-21T16:00:00+00:00",
"2026-10-21T16:00:00+00:00",
"2026-10-21T16:00:00+00:00"
],
"fixture_check": "passed"
}The script checks the fixed expected UTC strings before reporting success. We also checked that the adjacent lockfile’s SHA-256 remained unchanged across both runs. Matching output on this small fixture is evidence about this example, not a guarantee about another script.
Two additional changes were made to separate copies, each starting with the original lock. These are authored checks, not observed AI mistakes:
- Changed requirement: replacing
python-dateutil==2.9.0.post0withpython-dateutil==2.8.2causeduv run --locked --scriptto exit 1 with a lockfile update error. - Changed code body: appending
print("AUTHORED_BODY_CHANGE")left dependency metadata intact. The same command exited 0 and printed the extra marker. The lockfile did not reject the code edit.
That second case is why you also keep a reviewed script version and a known expected result. Source review and fixture checks answer different questions from dependency locking. The ZIP includes the observed check report.
Make the next run reviewable.
Keep the reviewed script, adjacent lockfile, small fictional fixture, expected output, Python and uv versions, and a note explaining the intended behavior. Save the source in version control so later code edits are visible. Check actual results after every meaningful change.
Tested: lock creation, two identical local fixture runs, unchanged lock bytes, stale-requirement rejection, and acceptance of an appended code-body marker. The downloaded practice package was also extracted and rerun.
Not tested: AI code generation or review quality, real datasets, other operating systems, other Python builds, offline installation, malicious dependencies, permission or network isolation, production reliability, or performance. A lockfile improves the dependency handoff; it cannot prove safety, correctness or identical behavior on every machine.
Keep the whole handoff.
Practice ZIP · Complete script · Adjacent lockfile · Observed fixture output · Observed lock checks · Practice README · Proposed AI prompt
Primary sources were reviewed October 21, 2026. This is an established uv workflow, not a claim about a newly released AI capability. The original portrait is AI-generated conceptual artwork and was visually reviewed.

