Skip to content

phpunit-mcp incremental validator returns stale result after a fix (false 'N err') #265

Closed

Description

@fdaviddpt

Friction

After fixing Style::$src/$media (added = '' defaults to resolve an uninitialized-typed-prop fatal), the edit:@file.json validator chain still reported:

phpunit-mcp : 1 err  (unchanged)

A clean full run — ./supertool 'phpunit:tests/unit/Shared/Components' — showed OK (471 tests). The incremental phpunit-mcp result was stale.

Context

This mirrors the documented phpstan-mcp incremental false-positive pattern (right after an edit the incremental validator reports surprising errors that clear on a clean run). Same behaviour on phpunit-mcp.

Impact

Reads as "your fix didn't work" when it did — wastes a verification cycle / can send an agent chasing a non-issue.

Ask

Invalidate/rerun the phpunit-mcp cache for the affected test target after a mutating op, or label incremental results as provisional and direct to a clean run for ground truth.

Activity

  1. fdaviddpt commented on May 30, 2026

    @fdaviddpt
    Author

    Root cause confirmed and fixed in mcp-phpunit-warm: a warm PHP process can't reload an autoloaded class, so the in-process runner kept executing the first-loaded version of every edited source/test class → stale result that doesn't match disk.

    Fix (fork-per-call): Digital-Process-Tools/mcp-phpunit-warm#1 — daemon parent stays framework-warm, each phpunit_run forks a child that autoloads the user's code fresh per call. Lands in v0.4.0.

    Note for DVSI: this needs a packagist release + composer update of dpt/mcp-phpunit-warm, then a daemon restart, before the stale results stop locally.

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