Mandela Test-Oracle & Leakage Guard
Eliminate test-oracle self-grading, tautological assertions, and circular mock confirmations.
Why This Skill Is Needed & Target State
The "Mandela Effect" in LLM testing occurs when a test suite passes not because the code works, but because the test grades itself. Common failure modes:
- Tautological Assertions:
assert True,expect(true).toBe(true), or self-comparisonsexpect(val).toBe(val). - Circular Mock Confirmation: Mocking a return value
mock.return_value = 'x'and immediately assertingassert mock() == 'x'without exercising real domain logic. - Swallowed Test Failures:
try: ... except AssertionError: passsilently turning test breakages into passes. - Frame-Injected Evals: Prompt benchmarks where the prompt tells the evaluator to confirm success.
The target state is independent ground truth: every test assertion must be capable of failing when the implementation is broken (A/B/A falsification).
Invariant Rules
- External Ground Truth: Assertions must evaluate computed outputs against independent expected constants, not self-derived values.
- Zero Swallowed AssertionErrors: Never catch
AssertionErrorin tests unless specifically testing an assertion library via an inverted test runner. - No Circular Mocking: Mock only at system boundaries (I/O, network, clocks). Never mock the function under test.
CLI Usage
# Scan test directory for Mandela leakage patterns
bunx anti-slop-engineering mandela tests/ --json
# Run in strict mode (fails on warnings)
bunx anti-slop-engineering mandela --strict