The situation. An operation depended on an old script to collect videos and web pages. It was on no server; the only copy was recovered from a personal drive.
What we found. Three flaws nobody had seen:
- command injection through the address (URL) given to it;
- a retry loop that downloaded everything again on every check and read the wrong stream;
- a page archive built from an arbitrary directory entry.
What we did. We rewrote it as a tool:
- Every item traceable: each item gets a hash and a manifest. A custody log chains the items by hash, and a verify command detects the substitution of any file.
- Built-in protections: private network addresses are refused. Nothing is deleted: earlier attempts move to their own folder, and each item is frozen read-only.
- Checked before use: a self-test runs before every real job, and five independent reviews passed the tool before its first use.
The result. The tool went into real use. Its first job exposed a new defect: an error on subtitles brought down the whole download, and five of six videos came back empty. The next version fetches subtitles in a separate pass.
What it shows. Modernizing means finding what the old code does wrong without anyone noticing, and proving that the new code does it right.
Some facts were omitted to protect the client's identity.