Skip to content

Phase-2 prerequisite: integration test for blocking-mode submit-only→exit-2 path with real metadata #487

Description

@michael-wojcik

Context

Surfaced during PR #477 round-8 blind review by round8-tester. Task #89 / review round 8, #401 teachback gate.

Finding (HIGH, Phase-2 scope)

The existing TestMainBlockingMode test suite mocks _check_tool_allowed, so the end-to-end path of:

submit-only teachback_submit → real scanner → classify → template → exit-2 block

is NOT integration-tested with real metadata. The unit-level pieces are well-covered, but the full pipeline under _TEACHBACK_MODE = "blocking" has no integration assertion.

Matters for: issue #481 Phase-2 flip. Before flipping advisory → blocking, this integration test must exist or the first real-world blocking-mode call could trip a latent state-machine bug that structure-only unit tests wouldn't catch.

Proposal

Add test_blocking_submit_only_real_scan_exits_2 to pact-plugin/tests/test_teachback_gate.py as a Phase-2 prerequisite.

  • Mode: _TEACHBACK_MODE = "blocking" (monkeypatch)
  • Input: a task with teachback_submit metadata but no teachback_approved
  • Assert: scanner runs for real (not mocked), classifier produces awaiting-approval reason_code, template renders the blocking-mode denial, hook exits with code 2

Non-goals

Background

Priority: HIGH for Phase-2, not urgent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions