{"slug": "code-freeze-human-verification-of-ai-generated-code", "title": "code-freeze, human verification of AI generated code", "summary": "Developer Javier López released code-freeze, a shell tool that tags individual functions with a review signature recording who read the function, when, and in which commit, then uses a --check flag to flag any signed function whose body has changed since that commit. Running code-freeze on his cmdfound project surfaced duplication that tests had missed, including a second definition of _channel_home that would have silently shadowed the frozen version, and led to 45 _api_ functions and 21 _util_ functions being called 333 times across 18 channel files. The tool does not block edits; it makes the cost of a change visible by requiring the author to re-read and re-sign any touched function.", "body_md": "## code-freeze, human verification of AI generated code\n\n###### 27 Oct 2026\n\nWhile building cmdfound, I found it painful to read and re-check versions that,\nalthough they met the specs from the outside, duplicated code and drifted away\nfrom the architecture I had defined. So I thought, why not freeze the functions\nI had already reviewed, to stabilize the code.\n[code-freeze](https://github.com/javier-lopez/learn/blob/master/sh/tools/code-freeze)\nis the smallest thing I could build for that.\n\n```\n_resolve()   { #@reviewed 2026-10-05 m@javier.io 2e226ed\n_lock_free() { #@frozen 2026-10-05 m@javier.io 2e226ed\n```\n\nThe tag says who read the function, when, and in which commit. `--check` takes\nevery signed function, finds its body in that commit and compares it with the\nbody today. Same body, silence. Anything else:\n\n``` bash\n$ code-freeze --check\ncode-freeze: cmdfound.in _first_catalogs changed since 2e226ed (reviewed 2026-10-09 by m@javier.io)\n```\n\n`--reviewed FILE FUNCTION` writes or refreshes a tag after you read it,\n`--frozen` marks the ones that should almost never move, and `--coverage`\ncounts, per file, what is signed and what drifted.\n\n### It is not a lock\n\nA frozen function can still be changed. Nothing stops the edit; the change just turns red until I read the new body and sign it again. That changed the job of the agent: it is free to touch anything, but it has to tell me which signed functions it touched, because those are the ones I re-read. The cost of a change became visible instead of forbidden.\n\n### What signing did to cmdfound\n\n[cmdfound](https://javier.io/blog/en/2026/10/27/cmdfound.html) was the first project that went\nthrough it, and signing meant reading every function, one at a time. Read side\nby side:\n\n- each channel fetched with its own wrapper around wget or curl, and its own idea of retries and partial files;\n- the machine was detected per channel under different names: `system` in\nnix-portable,`_platform` in github, for the same question;\n- checksums, json reading, temporary files, locks: each a few lines, each written again wherever it was needed.\n\nNothing was wrong, that is why the tests never complained. It only showed up because I had to approve each copy, and I kept approving the same thing.\n\nThe result: 45 `_api_` functions (cmdfound’s contract: answers, fetching, what\na valid name or version is) and 21 `_util_` ones (what would read the same in\nany shell program), that 18 channel files call 333 times. Later the same\nreading collapsed three package formats into one shared runner (`apk`, `rpm`\nand `apt` had grown the same catalog code), and the decompression of five\npackage formats into one function.\n\n### The bug it caught that tests could not\n\nIn sh, a second definition of a function silently replaces the first one, for\nthe whole program. A new `_channel_home` written in a channel would have\nshadowed the api’s frozen `_channel_home` and changed what every channel\nbelieved its directory was. Tests passed. `--check` refuses a file that defines\na name twice:\n\n```\ncode-freeze: cmdfound defines _channel_home more than once\n```\n\n### Signing in bulk\n\n`--reviewed` refuses a file with uncommitted changes: a tag has to name a\ncommit that holds the body I read. Signing one function per commit did not\nscale to a pass of fifty, so the agent learned to commit first, write all the\ntags against that commit, and then prove it with `--check`.\n\n### Takeaways\n\n- Review is a property of a function, not of a pull request. Put it where the code lives.\n- Make the cost of change visible, not impossible.\n- Reading every function is where duplication shows up, and where the real understanding is. Tests will not find code that is correct twice.\n\nHappy AI hacking! 😊", "url": "https://wpnews.pro/news/code-freeze-human-verification-of-ai-generated-code", "canonical_source": "https://javier.io/blog/en/2026/10/27/code-freeze.html", "published_at": "2026-10-27 00:00:00+00:00", "updated_at": "2026-10-28 17:15:29.849366+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["code-freeze", "cmdfound", "Javier López", "GitHub"], "also_reported_by": [], "takeaway": "code-freeze's --check compares each signed function's body against the commit named in its tag and also refuses files that define a name twice, catching the shell bug where a second _channel_home definition silently shadowed the frozen one.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/code-freeze-human-verification-of-ai-generated-code", "markdown": "https://wpnews.pro/news/code-freeze-human-verification-of-ai-generated-code.md", "text": "https://wpnews.pro/news/code-freeze-human-verification-of-ai-generated-code.txt", "jsonld": "https://wpnews.pro/news/code-freeze-human-verification-of-ai-generated-code.jsonld"}}