Skip to content

Invalidate cached caller results when dependencies change - #617

Open
killtheprompt wants to merge 1 commit into
boxed:mainfrom
killtheprompt:fix/cross-call-invalidation-597
Open

killtheprompt wants to merge 1 commit into
boxed:mainfrom
killtheprompt:fix/cross-call-invalidation-597

Conversation

@killtheprompt

Copy link
Copy Markdown

Changing a callee currently leaves cached mutant verdicts in its callers untouched. In a local reproduction of #597 on main, editing add re-tested its own mutant but none of the 13 mutants in total and double_total.

Walk the previous dependency graph before pruning it and reset verdicts in affected functions, including transitive callers and callers of deleted functions. Recollect test statistics after source changes to rebuild the observed graph for subsequent edits. Unrelated mutant verdicts remain cached; unchanged runs and track_dependencies = false retain their previous behavior. The tradeoff is a full statistics collection after a source change when dependency tracking is enabled.

Closes #597.

Validation on macOS / Python 3.13.16:

  • Five regression/control cases; three fail on the original code and all five pass with the fix. Focused suite: 256 passed, 1 skipped.
  • Actual CLI sequence: callee edit → 14 mutant executions; caller edit → 13; another callee edit → 14. Unchanged runs execute no mutants; the two unrelated mutants remain cached.
  • Full suite: 476 passed, 4 failed, 2 skipped. Unmodified main in the same environment: 471 passed, the same 4 failures, 2 skipped. Failures concern two type-checking snapshots (empty Pyrefly output), coverage exclusion expectations, and a macOS setproctitle crash expectation.
  • Ruff lint/format, configured mypy on the changed production file, and dependency consistency checks pass. Linux/container CI and the full Python matrix were not run.

AI assistance. The implementation, regression cases, and local checks were prepared with AI assistance.

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.

Cross-call invalidation: changing a callee does not re-test mutants in its callers (3.8.0)

1 participant