Skip to content

patch-cc 0.2.2 — repair the 2.1.224 zod-factory drift

Choose a tag to compare

@anfreire anfreire released this 07 Aug 10:04
· 31 commits to main since this release

Repairs max-effort and codex-models on Claude 2.1.224. On that build both
were dropped at bake time, so a patched binary silently lost /effort max
persistence and every registered Codex model. Re-run patch-cc (or
patch-cc apply --from-cache) to get them back.

What broke

2.1.224 re-minified most of the bundle's zod schemas from a per-module namespace
alias (w.enum([...])) to a bare call of the standalone factory (Ir([...])) —
.enum([ drops from 241 sites to 23 in a single release. Two matchers named
that member access and lost their required steps. Because MODEL_ENUM is the one
home discover_models reads, model discovery also fell back to its hardcoded
haiku/sonnet/opus, dropping fable along with every imported Codex id — the
visible tell in doctor's models: line.

The fix

The callee was never what identified those schemas. It is minifier noise that
churns every few releases — E.enum(, A.enum(, b.enum(, v.enum(,
w.enum(, Ir( for one unchanged schema across 2.1.216–224 — so nothing about
it is modelled any more. base.ARRAY_CALL skips from the property name to the
array literal, bounded only by statement and block edges. Enumerating the
spellings seen so far would only have deferred the same break to the next one.

Two things fell out of that:

  • max-effort's schema rewrite now splices the level list into the array it
    found rather than rebuilding the call, so it is idempotent by construction and
    its already-applied branch — provably a no-op on every callee spelling — is
    gone.
  • Dissolving the callee raises what the surviving anchors must carry, per
    site. effortLevel: plus its level array is unique on every build; model:
    plus an array is not (6 sites on 2.1.216–220, 12 on 2.1.221–224), so
    MODEL_ENUM's describe-string tail is its sole discriminator rather than
    redundancy. That is now recorded in the playbook with the method behind it:
    measure an anchor's match count on every backup before removing any part of it.

Verification

doctor green against all eight pristine backups, 2.1.216 → 2.1.224 — both sides
of the migration — plus a real 2.1.224 bake.

No behaviour changes and no new options; upgrading is only worthwhile if you are
on 2.1.224 or later.

Full changelog: v0.2.1...v0.2.2