Repository navigation
chore(ci): run the slow-marked backend guardrails — they have never run, and #12701 slipped past the LLM inventory pin because of it - #12727
Conversation
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 3/5
backend/scripts/run-slow-guardrails-ci.shcan pass when the manifest contains existing files even if the selected slow-test set is empty or incomplete, allowing newly added@pytest.mark.slowtests to be omitted from CI coverage; strengthen the guard to verify the selected set is non-empty and complete.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/scripts/run-slow-guardrails-ci.sh">
<violation number="1" location="backend/scripts/run-slow-guardrails-ci.sh:43">
P2: The lane's non-vacuity guard only checks that the manifest lists existing files, not that the slow test set it selects is non-empty or complete. A newly added @pytest.mark.slow test file is still selected by select_backend_unit_tests.py --all (so check_unit_test_discovery.py will not flag it), but it is excluded from the fast lane by `not slow` and, unless the author manually adds it to the manifest, never runs in this lane either — the exact "slow guardrail runs nowhere" failure #12701 slipped past. The manifest comment documents manual enrollment ("Files are added, never silently dropped"), but nothing enforces it. Consider a check that every slow-marked file under tests/unit/ is present in the manifest (or that pytest collection with the -m expression is non-empty), so a slow test can't silently drop out of both lanes.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| fi | ||
|
|
||
| echo "Running slow-marked guardrails across ${#files[@]} file(s)." | ||
| exec "$PYTHON_BIN" -m pytest -q -p no:cacheprovider -m "slow and not integration" "${files[@]}" |
There was a problem hiding this comment.
P2: The lane's non-vacuity guard only checks that the manifest lists existing files, not that the slow test set it selects is non-empty or complete. A newly added @pytest.mark.slow test file is still selected by select_backend_unit_tests.py --all (so check_unit_test_discovery.py will not flag it), but it is excluded from the fast lane by not slow and, unless the author manually adds it to the manifest, never runs in this lane either — the exact "slow guardrail runs nowhere" failure #12701 slipped past. The manifest comment documents manual enrollment ("Files are added, never silently dropped"), but nothing enforces it. Consider a check that every slow-marked file under tests/unit/ is present in the manifest (or that pytest collection with the -m expression is non-empty), so a slow test can't silently drop out of both lanes.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/scripts/run-slow-guardrails-ci.sh, line 43:
<comment>The lane's non-vacuity guard only checks that the manifest lists existing files, not that the slow test set it selects is non-empty or complete. A newly added @pytest.mark.slow test file is still selected by select_backend_unit_tests.py --all (so check_unit_test_discovery.py will not flag it), but it is excluded from the fast lane by `not slow` and, unless the author manually adds it to the manifest, never runs in this lane either — the exact "slow guardrail runs nowhere" failure #12701 slipped past. The manifest comment documents manual enrollment ("Files are added, never silently dropped"), but nothing enforces it. Consider a check that every slow-marked file under tests/unit/ is present in the manifest (or that pytest collection with the -m expression is non-empty), so a slow test can't silently drop out of both lanes.</comment>
<file context>
@@ -0,0 +1,43 @@
+fi
+
+echo "Running slow-marked guardrails across ${#files[@]} file(s)."
+exec "$PYTHON_BIN" -m pytest -q -p no:cacheprovider -m "slow and not integration" "${files[@]}"
</file context>
… hour `run-unit-ci.sh` is the only backend unit lane and it runs `not integration and not slow`. Nothing overrides that mark expression anywhere, so 22 files and 126 assertions — coverage ratchets, hermeticity contracts, the direct-provider boundary, the LLM-endpoint inventory pin — have been executing nowhere. The README told authors to mark codebase greps `slow` rather than allowlist them, which is a sound rule if `slow` means "runs in the other lane". There was no other lane, and an exact-set pin that fails nothing is a comment. It is not hypothetical. #12701 added two managed `get_llm` call sites that `test_managed_call_sites_absent_from_the_inventory_fail_ci` rejects, and merged anyway, within an hour of that pin landing, because nothing ran it. The file it changed also does not select the test that pins it, which is why the new lane is unconditional: a check whose job is to notice a change nobody anticipated cannot be gated on the change set that triggered the run. The cost premise does not survive measurement. The pin runs in 2.6 seconds; all 19 currently-green files run in 31. The three files that are red today are named in the manifest header rather than omitted from it, so the gap stays countable. Each needs its own fix. Co-Authored-By: Claude Opus 5 <[email protected]>
aeccfc3 to
c094859
Compare
The repository's codebase guardrails have never run in CI
backend/scripts/run-unit-ci.shis the only backend unit lane, and it runsnot integration and not slow. No workflow anywhere overrides that markexpression. So every test marked
@pytest.mark.slow— 22 files, 126assertions, including coverage ratchets, hermeticity contracts, the
direct-provider boundary guardrail and the LLM-endpoint inventory pin —
executes nowhere.
This is not one author's slip.
backend/tests/README.mdinstructs thatcodebase-wide greps be marked
slow"rather than being allowlisted", and theduration-allowlist header repeats it. The rule assumes
slowmeans runs insome other lane. There was no other lane.
It is already costing us. #12701 (belief model) added two managed
get_llmcall sites:
test_managed_call_sites_absent_from_the_inventory_fail_cirejects both. Itmerged anyway, within an hour of the pin landing, because nothing ran the pin.
That is the exact failure the pin was written to prevent, on its first
opportunity.
The cost premise does not survive measurement either. These are greps, not
stress tests:
What this adds
backend/scripts/run-slow-guardrails-ci.sh— runsslow and not integrationover the files named in a manifest. It fails loudly if themanifest is missing, names a file that does not exist, or selects nothing: a
lane that runs zero tests must not pass.
backend/tests/slow_guardrail_manifest.txt— the 19 files that are greentoday, and, named in the header rather than silently omitted, the three that
are not:
Each needs its own fix and its own PR. Listing them keeps the gap countable
instead of invisible — which is the whole failure being repaired here.
One step in
backend-unit-tests.yml, unselected and unconditional. Aguardrail whose job is to notice a change nobody anticipated cannot be gated
on the change set that triggered the run — that is the second half of why
feat(memory): belief model — weights, not deletion (flag-gated) #12701 slipped through, since the file it changed does not select the test
that pins it.
The two missing inventory rows, so the pin is green the moment it starts
running. Both belong to
langchain_feature_routing: they are internalmemory-formation calls reached through
canonical_memory_adapter, not a newuser-triggerable entrypoint.
tests/README.md— the rule that produced this is now qualified, so thenext guardrail author lands in the lane instead of outside it.
Automatic-or-dead check
The lane is its own check, and it is not vacuous by construction: delete the
manifest, empty it, or list a path that does not exist and
run-slow-guardrails-ci.shexits non-zero rather than reporting success overnothing. Revert either inventory row and
test_managed_call_sites_absent_from_the_inventory_fail_cifails in CI —which is the thing that was not true before this PR.
Proof
PYTHON=.venv/bin/python bash scripts/run-slow-guardrails-ci.sh→126 passed, 516 deselected, 31.03s.
pytest -m slow tests/unit/test_llm_gateway_coverage_guardrails.py→AssertionError: managed call sites absent from the inventory: utils/memory/belief_backfill.py::feature:<dynamic>; utils/memory/belief_evidence.py::feature:memory_conflict. Restored byputting the lines back, not by
git checkout.three exclusions are the measured failures, not guesses.
Cut list
own diagnosis; bundling them here would make this PR unreviewable and would
couple a CI-plumbing change to three unrelated product judgements.
tests/services/ortests/integration/.run-unit-ci.shselects. The PR lane keeps its latencybudget exactly as it is; this is a second, additive lane.
Product invariants
none — no locked invariant path glob matched.
Failure class
No
fix:commits in this range.Failure-Class: none
🤖 Generated with Claude Code