Skip to content

Co-authored test files flagged out-of-scope by validate_mutation_boundary despite test-alongside policy #163

@azalio

Description

@azalio

Summary

validate_mutation_boundary flags test files that are co-authored with the implementation as "outside affected_files", emitting a Scope warning that blocks the first validate_step 2.4 call — on essentially every subtask. The decomposer's blueprint affected_files lists only production files, but the plan's own test policy is "tests alongside implementation (validation = pytest green)". So a test file like python/pipeline/test_<module>.py is always "unexpected".

Environment

  • mapify_version: 3.10.0
  • workflow: /map-efficient (batch), 25-subtask plan; test-alongside policy.

Repro

  1. Implement a subtask producing python/pipeline/foo.py (in affected_files) and its test python/pipeline/test_foo.py (NOT in affected_files, but required by the test policy / HC-3 contract).
  2. Run validate_step 2.4 --recommendation proceed with the changes uncommitted (working tree dirty).

Actual

{"valid": false, "message": "Scope warning (mutation-boundary): these files are outside ST-002's affected_files: ['python/pipeline/test_evidence_graph.py']. Revert the out-of-scope changes; OR, if they are genuinely required, STOP and report a blocker for a contract update — do not silently keep them. ..."}

A second validate_step 2.4 passes (once-per-subtask scope_feedback_subtasks guard, map_orchestrator.py:1184).

Root cause (hypothesis)

The decomposer (task-decomposer) emits affected_files containing only production modules, even when the subtask's validation_criteria explicitly require pytest coverage (HC-3 [AC-x] tags). validate_mutation_boundary then treats the accompanying test file as out-of-scope.

Suggested fix (one of)

  1. In validate_mutation_boundary, auto-allow files matching test conventions (test_*.py, *_test.py, conftest.py, files under tests/) that sit beside a declared affected_file — they are implied by any subtask whose contract requires tests.
  2. OR have the decomposer automatically add the corresponding test path(s) to each subtask's affected_files when the validation_criteria/test_strategy require tests.
  3. OR add a blueprint field test_files: [] that the boundary check unions into affected_files.

Impact

A spurious "revert the out-of-scope changes / report a blocker" warning on nearly every subtask; requires a redundant second validate_step 2.4. Combined with the False-progress issue (separate report), the close path needs two validate calls regardless of whether you commit before or after validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions