Skip to content

Strengthen assertions in test_tools_dispatch.py and test_doctor.py#1977

Merged
Trecek merged 1 commit into
developfrom
strengthen-assertions-in-test-tools-dispatch-py-and-test-doc/1887
May 6, 2026
Merged

Strengthen assertions in test_tools_dispatch.py and test_doctor.py#1977
Trecek merged 1 commit into
developfrom
strengthen-assertions-in-test-tools-dispatch-py-and-test-doc/1887

Conversation

@Trecek
Copy link
Copy Markdown
Collaborator

@Trecek Trecek commented May 6, 2026

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-1tests/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-3tests/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 via AutoSkillit

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>
Copy link
Copy Markdown
Collaborator Author

@Trecek Trecek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoSkillit PR Review — Verdict: approved

@Trecek Trecek added this pull request to the merge queue May 6, 2026
Merged via the queue into develop with commit 78c136f May 6, 2026
2 checks passed
@Trecek Trecek deleted the strengthen-assertions-in-test-tools-dispatch-py-and-test-doc/1887 branch May 6, 2026 04:55
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant