Strengthen assertions in test_tools_dispatch.py and test_doctor.py#1977
Merged
Trecek merged 1 commit intoMay 6, 2026
Merged
Conversation
Replace weak negative-inequality and disjunction assertions with precise
positive checks per audit findings C4-1 and C4-3:
- C4-1: Five tests in TestDispatchFoodTruckHaltEnforcement now use
assert "dispatch_id" in result instead of
assert result.get("error") != "fleet_campaign_halted"
- C4-3: Two tests in test_doctor.py now use
assert checks[0]["severity"] == "warning" instead of
assert checks[0]["severity"] in ("warning", "error")
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Trecek
commented
May 6, 2026
Collaborator
Author
Trecek
left a comment
There was a problem hiding this comment.
AutoSkillit PR Review — Verdict: approved
Trecek
added a commit
that referenced
this pull request
May 8, 2026
…1977) ## Summary Fix two validated audit findings (C4-1 and C4-3) by replacing weak test assertions with precise positive checks. No production code changes are required. **Finding C4-1** — `tests/server/test_tools_dispatch_halt.py`: Five tests that verify dispatch proceeds past the halt gate use `assert result.get("error") != "fleet_campaign_halted"`. Each test calls `_setup_standard_dispatch()` which wires a valid recipe and executor, so the expected outcome is that the dispatch proceeds past the halt gate — `assert "dispatch_id" in result` is the correct assertion. **Finding C4-3** — `tests/cli/test_doctor.py` lines 448 and 464: Two tests assert `checks[0]["severity"] in ("warning", "error")`. Source inspection of `_check_plugin_cache_exists` and `_check_installed_plugins_entry` confirms both return `Severity.WARNING` unconditionally under the test conditions. Closes #1887 ## Implementation Plan Plan file: `/home/talon/projects/autoskillit-runs/strengthen-assertions-20260505-211450-512860/.autoskillit/temp/make-plan/strengthen_assertions_plan_2026-05-05_211450.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) via AutoSkillit <!-- autoskillit:pipeline-signature steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr --> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Fix two validated audit findings (C4-1 and C4-3) by replacing weak test assertions with precise positive checks. No production code changes are required.
Finding C4-1 —
tests/server/test_tools_dispatch_halt.py: Five tests that verify dispatch proceeds past the halt gate useassert result.get("error") != "fleet_campaign_halted". Each test calls_setup_standard_dispatch()which wires a valid recipe and executor, so the expected outcome is that the dispatch proceeds past the halt gate —assert "dispatch_id" in resultis the correct assertion.Finding C4-3 —
tests/cli/test_doctor.pylines 448 and 464: Two tests assertchecks[0]["severity"] in ("warning", "error"). Source inspection of_check_plugin_cache_existsand_check_installed_plugins_entryconfirms both returnSeverity.WARNINGunconditionally under the test conditions.Closes #1887
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/strengthen-assertions-20260505-211450-512860/.autoskillit/temp/make-plan/strengthen_assertions_plan_2026-05-05_211450.md🤖 Generated with Claude Code via AutoSkillit