Repository navigation
Check the lockfile with --locked, not --frozen - #62
Conversation
Follow-up to #61, which merged before this was caught. The availability probe passed `--frozen` to keep itself from writing to the repo while deciding whether a worker may start. That works, but it is the wrong flag for the question: `--frozen` means "sync without updating the lock", which is permission to proceed on a stale one. `--locked` means "assert `uv.lock` will remain unchanged", which is a check that it is current — and it is equally read-only. So a worker whose environment matches a lockfile that no longer matches pyproject passed the gate, launched with `--no-sync`, and failed later on the dependency it never got, instead of being sent to `field setup`. #61 recorded a deliberate cost for `--frozen`: staleness measured against the lockfile rather than against pyproject. That was not a cost of the goal, it was a cost of the wrong flag, and the record in ace-generation.md §6 now says so. The regression test asks real uv, because uv's semantics are the thing under test. It syncs a project, moves pyproject past the lock without touching the environment, and asserts the probe reports stale and the lockfile is byte-identical afterwards. Two details it needs, both of which cost me four failed reproductions before I understood them: the project must be one uv does not reinstall on every pyproject edit, because that reinstall masks the divergence and makes both flags look identical, and the console script is placed by hand because the probe only asks uv anything once the worker looks installed. CI installs uv before `pnpm test` now, on both lanes. It was installed after, so that test would have skipped in CI and run only on my machine — which is the failure mode this gate has already produced twice.
|
Starting review of daf9e29. |
ninjudd
left a comment
There was a problem hiding this comment.
Review of daf9e29. The flag change itself is right and I verified it against real uv 0.11.30 rather than taking the description on trust: sync a project at requires-python = ">=3.11", move pyproject to >=3.12 without touching the environment, and uv sync --check --frozen --no-python-downloads exits 0 while --locked exits 1 with "The lockfile at uv.lock needs to be updated". That is exactly the gap the PR describes, and --locked leaves the lockfile byte-identical, so nothing about the read-only promise is given up. pnpm vitest run src/workers/lockfile.test.ts passes here in 194ms and leaves no python/.test-lock-* behind. The ace-generation.md §6 citation checks out — line 120 is ## 6, and the new paragraph lands inside it.
Three findings, all about the regression test and the CI move rather than the production change.
Three review findings on #62, all about a test that could be green while proving nothing — the same failure this PR's CI change exists to remove, reproduced inside the test itself. The setup bail is gone. `uv sync` failing returned early, which vitest reports as a pass with no assertions run and nothing to distinguish it from a real one. `uvUsable` now asks both halves of the question — uv present, and an interpreter satisfying the constraint — with `uv python find --no-python-downloads`, so an unusable machine skips visibly and a failed sync is a failure. The staleness lever widens instead of narrowing. Narrowing `requires-python` is a lock/pyproject divergence and an interpreter demand at once, so on a machine without the newer interpreter the probe failed for the wrong reason and the assertion still passed. Verified: against a constraint nothing satisfies, `--frozen` and `--locked` both exit 2 — identical, so the test would no longer detect a revert to `--frozen`, which is its entire purpose. Widening cannot fail that way, since anything satisfying the lock satisfies the wider constraint, and it leaves the lockfile just as out of date. And the comment above `environmentVerdict` justified its purity by saying CI has no uv when `pnpm test` runs, which this branch's own CI change made false in the same commit. The reason purity was chosen outlives the justification, so it is reworded rather than dropped.
|
Starting review of f385b5f. |
|
Reviewed f385b5f — no findings. All three from the daf9e29 review are fixed, and I checked the fixes rather than the diff's description of them. The The widening is the part worth confirming end to end, so I mutated One observation, not a finding, since the outcome is now honest either way: setup-uv installs uv but not an interpreter, so whether this test runs in CI still rests on the runner image shipping a discoverable system Python. Today's
|
Make field-voiced work against the actual model Five merged pull requests built this worker and every one of them said, accurately, that nothing had loaded Chatterbox yet. Generating creek's line is the first time anything did, and it found three things — two of them mine. `chatterbox-tts` needs `pkg_resources` and nothing in the graph asks for it. Chatterbox watermarks every generation through `perth`, whose `perth_net/__init__.py` imports `pkg_resources`; Python 3.12 no longer ships it and uv does not install it unasked. perth catches that ImportError and sets `PerthImplicitWatermarker = None`, so the failure surfaced one layer up as `'NoneType' object is not callable` from Chatterbox's constructor, naming neither perth nor setuptools. Declared as `setuptools>=70,<81` — the upper bound is not decoration, since setuptools removed `pkg_resources` itself and 83.0.0 satisfies a bare `>=70` while leaving perth exactly as broken. The #60 leak fix never worked. Restoring the builtin voice before each unreferenced variant went through `copy.deepcopy(model.conds)`, and torch refuses: "Only Tensors created explicitly by the user (graph leaves) support the deepcopy protocol." Some of those tensors come out of a forward pass. The fix was right about the leak and inoperative against the model, and it was verified by reading `chatterbox/tts.py` rather than by running it — which is precisely the distinction that review round could not make, because loading the model was the one thing the harness existed to avoid. `clone_conds` rebuilds the dataclass field by field with each tensor detached, which is the same shape Chatterbox's own `save`/`load` round-trip uses. A model-side failure left no trace. The lifecycle turned every exception into a one-line protocol error and logged nothing, so the first of these presented as a single sentence with no stack anywhere, and diagnosing it meant rebuilding the whole model load by hand outside the daemon. The wire still carries one line; the daemon's log now also carries the traceback that explains it. The regression test for that last one gets its own interpreter rather than the shared harness's. The existing one prefers `python/voiced/.venv` when it exists, which after a real `field setup voiced` contains Chatterbox — so a test wanting the backend to fail on import would instead load a 2 GB model, and would do so only on machines where setup had been run. Stating the precondition beats inheriting it; that is the same ambient-state trap the environment gate hit twice in #61 and #62. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes voice worker runtime dependencies, conditional cloning on every default-voice variant, and error logging; no auth surface, but incorrect cond cloning could still affect voice provenance. > > **Overview** > Fixes **field-voiced** so the first real Chatterbox load works: **`setuptools>=70,<81`** is declared so **`perth`** can import **`pkg_resources`** (otherwise **`'NoneType' object is not callable`** with no useful name on the wire). > > Replaces **`copy.deepcopy(model.conds)`** with **`clone_conds`**, which rebuilds conditionals field-by-field with detached tensor clones—the prior #60 leak fix failed on real tensors from the forward pass. > > The shared worker daemon now logs full tracebacks to stderr (the voiced log) on request and generation failures while clients still get one-line protocol errors. > > Adds a Vitest block that uses a **bare** Python (no Chatterbox) so a backend import failure is asserted to appear in **`voiced.log`**, avoiding the main harness’s venv that would load the model. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b520227. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Check the lockfile with --locked, not --frozen
Follow-up to #61, which merged before this was caught.
The availability probe passed
--frozento keep itself from writing to the repo while deciding whether a worker may start. That works, but it is the wrong flag for the question:--frozenmeans "sync without updating the lock", which is permission to proceed on a stale one.--lockedmeans "assertuv.lockwill remain unchanged", which is a check that it is current — and it is equally read-only. So a worker whose environment matches a lockfile that no longer matches pyproject passed the gate, launched with--no-sync, and failed later on the dependency it never got, instead of being sent tofield setup.#61 recorded a deliberate cost for
--frozen: staleness measured against the lockfile rather than against pyproject. That was not a cost of the goal, it was a cost of the wrong flag, and the record in ace-generation.md §6 now says so.The regression test asks real uv, because uv's semantics are the thing under test. It syncs a project, moves pyproject past the lock without touching the environment, and asserts the probe reports stale and the lockfile is byte-identical afterwards. Two details it needs, both of which cost me four failed reproductions before I understood them: the project must be one uv does not reinstall on every pyproject edit, because that reinstall masks the divergence and makes both flags look identical, and the console script is placed by hand because the probe only asks uv anything once the worker looks installed.
CI installs uv before
pnpm testnow, on both lanes. It was installed after, so that test would have skipped in CI and run only on my machine — which is the failure mode this gate has already produced twice.Note
Medium Risk
Changes worker launch gating and uv probe semantics; incorrect behavior could block valid workers or allow stale envs, but the change aligns the gate with documented “explicit setup” intent and adds CI coverage for the regression test.
Overview
The worker availability probe now passes
--lockedtouv sync --checkinstead of--frozen. Both flags keep the probe from writinguv.lock, but only--lockedtreats a lockfile that no longer matchespyproject.tomlas out of date—so workers are refused with “runfield setup” instead of starting with--no-syncand failing later on missing deps.lockfile.test.tsexercises this against realuv(skipped whenuvis absent).setup.test.tsasserts the probe argv includes--lockedand never--frozen.ace-generation.md§6 is updated to record that the old “staleness vs lockfile” tradeoff was from the wrong flag, not the design goal.CI runs
astral-sh/setup-uvbeforepnpm teston Linux and macOS so the new test is not unconditionally skipped in CI (it was only running locally whenuvwas installed after tests).Reviewed by Cursor Bugbot for commit daf9e29. Configure here.