Repository navigation
Repin six UI contracts on what they guard, not how it was spelled - #8197
Conversation
Repo tests (CPU) is red on main with six failures. All six are source-shape contracts whose subject was rewritten by #8082 and #8149; in every case the behaviour they exist to protect is intact, and in two cases it is better than what the assertion described. Three in test_update_release_notes.py asserted the literal Tailwind class max-h-[calc(100dvh_-_2rem)]. #8082 replaced that fixed cap with stackGeometry, which subtracts the same 2rem when nothing is in the way and subtracts more when the Live monitor is, so the stack dodges it instead of sitting under it. The arithmetic is checked numerically in monitor-stack-inset.test.ts, which pins stackGeometry(null, W, H).maxHeight to H - 32 among thirteen other cases. What these tests can still add is that every stack element reads it, so they now count stack containers and require a cap on each. Counting matters: there are two such elements, browser and desktop, and capping one and not the other is the mistake worth catching. A fourth test names the node test, so deleting the numeric check does not quietly leave the cap unguarded. Three in test_model_picker_contracts.py: - The routed pick test pinned diffusionRoutePick's second argument, which was respelled from routeSearch.quant to routedFilename. The catalog spec is the third argument and is the thing the test is named for, so the second is no longer matched. - The GGUF guard test required a toast.error in a branch that used to reject a repo-id pick. #8149 made that branch resolve the repo's own .gguf instead, which is the better answer. The invariant that survives is that the branch does something: a bare return there drops the pick with no request and no message. - The deferred-load test required the flush effect to end with }, [active]); and to call handleLoadRef directly. The load body moved into runStagedLoad, shared with the visible path, so the dependency array grew. It now accepts either spelling and, when the helper is used, follows through into it. Mutation-tested, all eight caught: cap dropped from the browser stack; from the desktop stack alone; desktop stack stops measuring itself; node test stops pinning H - 32; repo-id GGUF pick returns bare; routed pick drops its catalog spec; deferred flush clears the flag and stops; runStagedLoad loads nothing. The first two survived an earlier draft that used a plain substring check, which is why the counting form is there. tests/studio: 3 failed, 2795 passed. The three are test_studio_gguf_export_script_pin.py, which fails identically on main and is outside this job's scope.
Keying the closing boundary on `[active` let a validly reordered dependency array run the match past the effect and on to the next hook, where loadOrStage's own handleLoadRef call satisfied the loader assertion for a flush that loads nothing. Stop at the first boundary and check the deps separately.
The capture is every argument after `wanted`, so a substring check did not prove the spec reached the third parameter. `diffusionRoutePick(wanted, routedFilename ?? loadSpecFor(wanted, IMAGE_CATALOG)?.filename)` type-checks, passes the catalog filename as the quant and drops the spec, which sends curated single-file artifacts down the GGUF branch, and it satisfied the old assertion. Split the argument list on its own commas and pin the third.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6301786fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert ( | ||
| "stackGeometry(null, W, H).maxHeight, H - 32" in src | ||
| ), "nothing pins the no-obstacle cap to the 2rem the class used to spell" |
There was a problem hiding this comment.
Verify the hook forwards the tested geometry
The new numeric check exercises stackGeometry directly, while the provider checks only count calls to useStackGeometry() and uses of stack.maxHeight; nothing verifies that the hook forwards the helper's result unchanged. If useStackGeometry overrides maxHeight with Number.POSITIVE_INFINITY or another uncapped value after calling the helper, the node geometry test and all four affected Python contract tests still pass while both overlay stacks can again overflow the viewport. Add a check of the hook-to-helper connection or exercise the hook result directly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Passing on this one. useStackGeometry ends in return stackGeometry(published, viewport.width, viewport.height); - the hook is the memoised viewport read and nothing else, so the gap is a single return with no branch that could rewrite the value. Guarding it would mean pinning that spelling in a Python source-scan test, which is the exact class of assertion this PR is removing: the previous version pinned max-h-[calc(100dvh_-_2rem)] and broke when the cap moved from a class to arithmetic, without the cap ever changing. The arithmetic is owned by monitor-stack-inset.test.ts, the provider side is pinned to using the hook's value for every stack, and a hook that discarded its own result is not a refactor anyone reaches by accident.
|
main's CI red is three independent causes, not one, and none of the three PRs is green on its own. That is why these have all been sitting at CI_FAILING with no review items of their own.
The two Studio PRs each cover exactly the other's failure. On #8197, Chat UI fails on the overlay intercept and Repo tests (CPU) passes. On #8190, Chat UI passes and Repo tests (CPU) fails with those same 6. Core fails on both, because its cause is in zoo. Checked together on a staging repo rather than on the org queue: unsloth main 32 checks pass, 0 fail. The zoo suite inside Core goes from So the merge order that clears the board is zoo#1018 first, then #8197 and #8190 in either order. Once those land, #7867, #7951, #8051, #8121 and #8128 should all go green as well; every one of them has zero open review items and is red only because it inherits this. The staging composition used #8197 at |
|
Checked on current main ( Every other red check on this PR belongs to a different open PR, not to this one:
So none of the four PRs can go green on its own. Merged together onto ( |
Repo tests (CPU)is red onmain. Six failures, all in source-shape contract tests, all caused by their subject being rewritten under them:I checked each one against the code before touching the test. In every case the behaviour the test exists to protect is intact, and in two cases it is better than what the assertion described. Nothing in
studio/changes here.The overlay stack cap
The three release-notes tests asserted the literal class
max-h-[calc(100dvh_-_2rem)]. #8082 replaced that fixed cap withstackGeometry, which subtracts the same 2rem when nothing is in the way and subtracts more when the Live monitor is, so the stack dodges the monitor instead of sitting under it.The arithmetic is already checked numerically, in
studio/frontend/tests/monitor-stack-inset.test.ts, fourteen cases including the exact successor of the old class:So the python test should not try to re-check the number. What it can still add is that every stack element reads the geometry, which it now does by counting:
Counting rather than checking presence is the point. There are two such elements, browser and desktop, and capping one and forgetting the other is precisely the mistake worth catching; a substring check cannot see it. A fourth, new test names the node test by path, so deleting the numeric check does not quietly leave the cap unguarded.
The three picker contracts
Routed pick. The test pinned
diffusionRoutePick's second argument, which was respelled fromrouteSearch.quanttoroutedFilename ?? undefined. The catalog spec is the third argument and is the thing the test is named for. The regex no longer pins the second; theloadSpecFor(wanted, IMAGE_CATALOG)assertion is unchanged.GGUF guard. The test required a
toast.errorin the branch that used to reject a repo-id pick outright. #8149 made that branch resolve the repo's own.ggufthroughloadGgufRepoPickinstead, which is the better answer for the user. The invariant that survives the rewrite is that the branch does something: a barereturnthere drops the pick with no request and no message, which is the failure the test is named for.Deferred load. The test required the flush effect to end with
}, [active]);and to callhandleLoadRefdirectly. The load body moved intorunStagedLoad, now shared with the visible path, so the dependency array grew to[active, runStagedLoad]. The test accepts either spelling and, when the helper is used, follows through into it to confirm it actually loads.Mutation results
Eight mutations, all caught. Each breaks one thing an assertion claims to guard; the tree was restored and re-run green after each.
H - 32runStagedLoadloads nothingThe first two survived an earlier draft that used a plain
incheck on the provider source, since the other stack still carried the string. That is why the counting form is there rather than a substring test.Verification
tests/studio/: 3 failed, 2795 passed, 4 skipped, 1 error. The three aretest_studio_gguf_export_script_pin.pyand the error istest_rocm_rdna_routing.py; both fail identically on a cleanmainworktree and are outside this job's scope.I did not run the frontend node suite locally: this worktree has no
node_modules, and without it every test fails to resolvereact. Frontend CI is green onmainand coversmonitor-stack-inset.test.ts, and no frontend source changes here.