Repository navigation
The Stop test gate takes a failed pytest run, or the last run of a command, as an answer and words untested functions as the index's view - #1675
Merged
Conversation
…mes no untested function beside tests the checkout has The gate blocked a stop whose transcript showed pytest over the named test after the last change whenever that run's summary counted a failure. In a checkout where some tests fail with or without the change, a session that ran the whole suite, read the failures and reported them was told to run one file of that suite again: one more model request and one more reply. The reason also said "no test reaches" a constructor that every test of the named file calls by building the object, because the index's graph held no edge to it. A summary line that counts tests failed or passed and none deselected answers. A line that counts a failure or an error does not when the run has -x, --exitfirst or --maxfail, since it stopped before the files after it, and a collection that stopped at an error does not. A command's runs count from the first pytest after which it only runs pytest and prints output, so the second run of `git stash; pytest tests; git stash pop; pytest tests` answers. A command that changes the tree after its last pytest answers nothing, as before. A reason that names tests, each of them in the checkout, names no untested function. The functions are named when the gate names no test, or one the checkout lacks. Both plugin manifests move to 1.2.63. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…the tests to run, and refuses a run pytest ended early
A reason that named a test the checkout has dropped every untested
function, so a change to a tested function and an untested one was
told only to run the tests. The functions are named again. Beside
tests to run they read as the index's view, "the index links no test
to: X (the tests named here may still reach it)": the graph is a
floor, and a test that builds an object reaches a constructor the
graph holds no edge to. With no test to run the reason reads "no test
reaches: X" and asks for a test, as before.
A failed run answers the gate only when it ran to its end:
- Output that holds the line pytest prints above the summary of a run
it ended early ("stopping after N failures", "Interrupted: ...")
does not answer. That line shows a failure limit or --sw set in
PYTEST_ADDOPTS or a configuration file, which the command's flags
do not.
- A command with --continue-on-collection-errors does not answer: a
named file that failed to import is one error among the tests that
ran.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…a-covering-run Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 99f4185. Configure here.
| return ( | ||
| !all.some((l) => ENDED.test(l)) && | ||
| lines.length >= runs.length && | ||
| lines.every((l) => WHOLE.test(l) && !(stops && /\d (?:failed|error)/.test(l))) |
There was a problem hiding this comment.
Stop check treats reportchars as exitfirst
Medium Severity
STOPS treats any short flag that contains x as --exitfirst, so a finished suite that used pytest -rx (or -rfx, -rxX) with failures still does not answer. In pytest, -r takes report chars: -rx only adds xfailed lines to the extra summary, and it does not stop the run. The gate then still blocks after the session already ran the named tests and read the failures.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 99f4185. Configure here.
9 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
The Stop test gate of the Claude Code plugin no longer blocks a session that ran pytest over the named tests after its last change and read failures in the result. Beside tests to run, its reason lists a function with no linked test as the index's view (
the index links no test to: …), not as a fact about those tests.Why
In 14 recorded coding sessions with the plugin, on one issue of one repository whose suite fails 8 tests with or without the change, the gate blocked 3. Each of the 3 had run
python -m pytest tests -qon the changed tree, read8 failed, 467 passed, 10 skipped, shown that the same 8 tests fail without the change and said so in its reply. The gate then told each to run the one test file the change obliges, which that suite run had covered. Each block cost one more model request that ran the file (60 passed) and one more reply: 4.7 to 5.7 seconds and 173 to 222 output tokens per blocked session. The 11 sessions that ran the one file alone were not blocked.Three rules caused it:
allPassedtook only a summary line that starts atN passed. A run with a failure answered nothing, although the session had read the failures and the gate's ask is "run the tests, or say why not".onlyRunswas applied from a command's first pytest. Two of the three sessions rangit stash -q; python -m pytest tests -q | tail; git stash pop -q; python -m pytest tests -q | tail: the last run tested the tree as it stands, and thegit stash popbetween the runs discarded the whole command.no test reaches, beside the test file to run. Every test of that file builds the object. The index's graph held no edge from a test to the constructor, andcounts_flooralready says the graph is a floor. Two of the three replies told the user the claim was wrong.The change:
WHOLE), when the run reached its end:--exitfirst,--maxfailor a short flag holdingx. Two of the recorded sessions first ranpytest tests -q -x, which stopped 39 tests in, before the named file.stopping after 1 failures,Interrupted: …). That line also shows a failure limit or--swset inPYTEST_ADDOPTSor a configuration file, which the command's flags do not.--continue-on-collection-errorsdoes not answer: a named file that failed to import is one error among the tests that ran (1 failed, 2 passed, 1 error).1 error in 0.12s) counts no test and does not answer.tail,head,grepandecho. What stands before that run forgets every earlier run, as a command's lead did before.renderGatestill names every untested function. Beside tests to run that the checkout has, it words themthe index links no test to: X (the tests named here may still reach it). With no such test the reason readsno test reaches: Xand asks for a test, as onmain.The three behaviours are one pull request because they are the one recorded block: the first two decide that the three sessions are not blocked, and the third corrects the sentence the same three sessions were shown and two of them disputed. The wording change is one branch in
renderGate; it changes no block decision.Alternatives not taken:
git stash … git stash popas a round trip that leaves the tree unchanged. The third recorded session ranpytest tests | grep FAILED; git stash -q; pytest tests | tail -1; git stash pop -q. Its run on the changed tree printed no summary line, and the pop rewrote the files after the last run. Accepting it needs the gate to trust that a pop restores the tree and to accept a run with no summary. That session still blocks, with the reworded reason.Scope and risk
lib/test-gate.mjs(the Codex copy is regenerated), its tests, two paragraphs of the plugin README, one row ofdocs/features/integrations/claude-code.mdand both plugin manifests (1.2.63). The hook filehooks/loom-test-gate.mjs,hooks/HOOKS.mdand the README's hook table are unchanged: the reason names the tests and the untested functions, as they say.| tail -1); the README says so.--ignoreor--lfset in a configuration file were not seen before and are not seen now.code.test_gaterequest.Compatibility, rollout and rollback
Tests
Run locally:
node --test integrations/claude-code-plugin/tests/test-gate.test.mjs: 39 tests, 38 pass, 1 skipped (Windows only). The new cases are a suite that fails 8 tests with or without the change, a run that stopped at its first failure, the same with the limit inPYTEST_ADDOPTS, a--swstop, and--continue-on-collection-errors.node --testonhooks-doc.test.mjs,hooks-json.test.mjs,code-hooks-failopen.test.mjsandpath-under.test.mjs: 25 tests, 23 pass, 2 skipped.main, with every assertion recorded instead of thrown, against both versions of the lib: 242 checks. Againstmain's lib 0 differ. Against this branch 4 differ, all intended: the two failed-summary cases (answered([edit(), bash(SUITE, FAILED)])and the same after a passed run) flip from blocked to answered, and two render cases that name tests readthe index links no test to: …where they readno test reaches: ….runAnswered:mainpython -m pytest tests -q | tail -3,1 failed, 2 passed in 0.02sPYTEST_ADDOPTS=-x python -m pytest tests -q | tail -3,stopping after 1 failuresabove1 failed, 2 passed in 0.02spython -m pytest tests -q | tail -3with--swset outside the command,Interrupted: Test failed, continuing from this test next run.above1 failed in 0.06spython -m pytest tests -q --continue-on-collection-errors | tail -3,1 failed, 2 passed, 1 error in 0.02scode.test_gatewith the response the recorded reason implies. The replay script and the transcripts are not in the repository.maingit stash; pytest tests; git stash pop; pytest tests,8 failed, 467 passedpytest tests | grep FAILED; git stash; pytest tests; git stash poppytest tests -q -xstopped at the first failure<edit>; pytest tests | tail -3; git diff --statThe reworded reason, in each of those rows:
Loom test gate (graph is a floor): run: python3 -m pytest tests/test_blueprints.py · the index links no test to: Blueprint::__init__ (the tests named here may still reach it). Run the tests before finishing, or say why not.ruff format --check .,ruff check, the function-length and secret gates, every generator--checkinmake lintincludingagent_plugin_sync.py --check,biome formaton both plugin directories,prettier --checkon the three changed Markdown files,node --checkon everyhooks/andlib/file of both plugins, andclaude plugin validate integrations/claude-code-plugin --profile directory --strictpass. The mypy gate reports 5 errors, all inserver/llm/vertex_auth.py, from missing type stubs of an optional dependency in the local environment; this diff changes no Python.tests/unit/test_public_copy.py(5) andtests/unit/test_codex_plugin.py(16) that take no fixture were called directly and pass.Not run locally: the pytest unit and integration suites, the rest of the plugin's node tests, and a live session. No session has run with the changed gate; the replay shows the hook's decision on recorded transcripts, not the seconds or tokens a live session saves.
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked by hand: the three blocked transcripts and the eleven unblocked ones, the replay results above against the recorded outcomes, and each rule against the recorded commands.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code
Note
Medium Risk
Changes Stop-hook blocking logic for indexed repos—more sessions skip the gate, but mis-parsed transcripts could still pass incorrectly; scope is limited to client-side transcript parsing, not server auth or data handling.
Overview
The Stop test gate in the Claude Code and Codex plugins (1.2.63) no longer treats a full pytest run as unanswered just because the summary shows failures—sessions that already ran the obligated tests and saw a complete summary line can finish without an extra block.
Answered-stop detection now accepts a whole pytest summary (failed or passed, no deselected-only subsets), while still rejecting early exits (
-x,--maxfail,PYTEST_ADDOPTS,--swinterruption lines) and--continue-on-collection-errors.wholeRunsreplaces the old “clean pass only” scan and counts pytest invocations from the first run in a command whose tail is only pytest/tail/head/grep/echo, so patterns likegit stash; pytest; stash pop; pytestcredit the final run on the current tree.Gate messaging beside named tests reframes untested symbols as
the index links no test to: … (the tests named here may still reach it)instead of statingno test reachesas fact about those tests; the stricter phrase remains when no tests are listed.Docs (
claude-code.md, plugin README) andtest-gate.test.mjsalign with the new rules; Codexlib/test-gate.mjsmirrors Claude Code.Reviewed by Cursor Bugbot for commit 99f4185. Bugbot is set up for automated code reviews on this repo. Configure here.