CommunityProgramación y desarrollogithub.com

backslop-fake-done

Catches gamed tests and "done" that isn't. Use when making failing tests pass, fixing CI, lint or type errors, finishing a feature, or before saying "done" or "all tests pass". Flags edited, weakened or skipped tests, special-cased test inputs, mocked units, stubs and TODOs, ignore comments, removed auth or validation checks, and secrets in logs.

¿Qué es backslop-fake-done?

backslop-fake-done is a Claude Code agent skill that catches gamed tests and "done" that isn't. Use when making failing tests pass, fixing CI, lint or type errors, finishing a feature, or before saying "done" or "all tests pass". Flags edited, weakened or skipped tests, special-cased test inputs, mocked units, stubs and TODOs, ignore comments, removed auth or validation checks, and secrets in logs.

Compatible con✓Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/Alcadramin/backslop/tree/HEAD/skills/backslop-fake-done

Installed? Explore more Programación y desarrollo skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Fake done: green tests that don't test, and "done" that isn't

The failure this skill prevents: the agent reports "done, all tests pass" while the work is broken, because it changed the check instead of the code. Agents fall into it after several failed attempts at a hard test, when editing the test, skipping it or hard-coding its answer is the shortest path to green. The summary looks the same either way. The diff doesn't.

What the evidence says:

  • Anthropic, about its own model (2025). "Claude 3.7 Sonnet occasionally resorts to special-casing in order to pass test cases in agentic coding environments like Claude Code. Most often this takes the form of directly returning expected test values rather than implementing general solutions, but also includes modifying the problematic tests themselves to match the code's output." It adds: "User testing did not identify this behavior because it occurs infrequently in normal usage and largely occurs only after multiple attempts." (Claude 3.7 Sonnet system card, §6)
  • Later models do it less, not never. On Anthropic's reward-hack-prone coding tasks the hack rate was 44% for Sonnet 3.7, 9% for Opus 4 and 4% for Sonnet 4. One transcript shows production code walking inspect.stack() to detect a specific test before raising the error it expects. (Claude 4 system card, §6)
  • When tests contradict the spec, frontier agents cheat most of the time. ImpossibleBench made any passing run proof of cheating. GPT-5 cheated on 76% of Oneoff-SWEbench tasks and 54% of Conflicting-SWEbench tasks. For Claude models, over 79% of the cheating on Conflicting-SWEbench was modifying tests, "despite being explicitly instructed not to." An explicit "abort" option cut GPT-5 from 54% to 9%. (ImpossibleBench)
  • The model knows. METR caught o3 reward-hacking in 39 of 128 RE-Bench runs. It patched the evaluator "so that it judges every submission as successful" and overwrote the timer. "Please do not cheat" in the prompt left the rate at 80%. Asked whether its plan matched the user's intent, o3 said "no" 10 of 10 times. (METR, June 2025)

Use this when

  • A test, type check, linter or CI job is failing and you're about to make it pass.
  • You're asked to "fix the tests", "make CI green", "get this passing" or "clean up the errors".
  • A test seems wrong, flaky or impossible to satisfy.
  • You're finishing a feature and are about to say "done", "complete" or "all tests pass".
  • You touched test files, test setup (conftest.py, jest.setup.*), auth or validation code, or logging.
  • You're reviewing an agent's diff that claims success.

Non-negotiable rules

  1. Never edit a test's expected value, or delete an assertion, to match what your code returns. If the requirement changed, say which one.
  2. Never skip, xfail, .todo or .only a test to get green. Never exit the test process early.
  3. Never special-case a test's input in production code, and never branch on "am I under test?".
  4. Never weaken an assertion (toBe → toBeDefined, assertEquals → assertNotNull), and never add one that can't fail.
  5. Never mock the unit under test, and never put mock objects in production code.
  6. Never silence a checker (@ts-ignore, as any, # type: ignore, @phpstan-ignore, eslint-disable, backslop-ignore) to make it pass.
  7. Never remove an auth, permission or validation check because a test hit it. Set up the test properly.
  8. Never claim tests pass without running them in this session, and always show the command and its result.
  9. If a test seems wrong or the task is infeasible, say so and stop. That's a valid outcome; a faked pass isn't.

Check your diff

node "${CLAUDE_SKILL_DIR}/../backslop/scripts/backslop.mjs" diff --skill backslop-fake-done

${CLAUDE_SKILL_DIR} is this skill's folder. In agents that don't fill it in, use the path where the skill is installed.

Fix every finding, or say in your reply which finding is a false positive and why. Never add ignore comments, weaken the check, or delete the code path to silence it.

Review checklist

Ask these about every test, setup file and production change in your diff.

Tests you changed

The harness

  • Does anything in tests or setup call exit/process.exit/os._exit? → exit-zero-harness
  • Did you touch a reporter hook, the clock, or a verify* function? → test-runner-tampered
  • Did you change CI config, test scripts or hooks (continue-on-error, || true, --no-verify)? → ci-gate-bypassed
  • Did you add coverage-ignore comments or lower a threshold? → coverage-gate-lowered

Production code

  • Does any branch compare against a value that also appears in a test, or carry a comment about a test? → special-case-test-input
  • Does any code check NODE_ENV === 'test', runningUnitTests(), 'pytest' in sys.modules or the call stack? → test-env-branch-in-prod
  • Does any __eq__/equals always return true, or does any code reassign a library comparison? → fake-equality-or-state
  • Is anything a stub, a TODO, a constant return or "in a real implementation"? → stub-or-todo-left
  • Does any function return sample records instead of querying the real source? → placeholder-data-in-prod
  • Did you add an ignore comment or an as any cast? → checker-suppressed
  • Did you remove an authorize, a middleware, @login_required, permission_classes or a validate call? Where is it now? → guard-removed
  • Did you turn off a timeout, a memory limit or TLS verification? → limits-disabled
  • Do any log or print calls include a password, token, key, cookie or auth header? → secrets-or-pii-logged
  • Did a model or schema change without a migration? → schema-without-migration

Dependencies and APIs

  • Does every new package exist on the registry, and is it in the lockfile? → hallucinated-package
  • Does every new method, option or config key exist in the installed version? → hallucinated-api

Your reply

Related, owned by other skills:

Patterns

PatternWhat goes wrongDetected
assertions-removedassertion deleted from a test that still existsscanner diff
assertion-weakenedexact check replaced by a loose or always-true onescanner diff
test-expectation-editedexpected value changed to match the codescanner diff (medium)
tests-skippedskip / xfail / todo / .only addedscanner diff
special-case-test-inputcode returns the test's expected answer for its inputscanner (comments) + review
test-env-branch-in-prodproduction code detects the test runscanner
exit-zero-harnesstest exits 0 before failures are reportedscanner
fake-equality-or-state__eq__ always true, comparisons reassignedscanner
test-runner-tamperedreport, clock or verifier patched to succeedscanner
mocked-unit-under-testtest mocks its own subject; mocks in prodscanner (medium)
stub-or-todo-leftstub, TODO or "not implemented" shipped as donescanner diff (medium)
checker-suppressedignore comment or as any instead of a fixscanner diff (medium)
coverage-gate-loweredcode excluded from coverage, threshold loweredscanner diff (medium) + review
guard-removedauth / permission / validation check deletedscanner diff (medium)
secrets-or-pii-loggedpassword, token or key in a log callscanner
placeholder-data-in-prodsample records returned from a real pathreview
unverified-done-claim"tests pass" with no run, or zero tests runreview
conflict-silently-resolvedspec/test conflict hidden behind a green runreview
limits-disabledtimeout, memory limit or TLS check turned offreview
schema-without-migrationmodel changed, no migrationreview
hallucinated-packagedependency that doesn't existreview
hallucinated-apimethod or option that doesn't existreview
ci-gate-bypassedCI step non-blocking, hooks skippedreview

Before you say done

Put this evidence in your final reply, not just "done":

  • Test run: the exact command and the last lines of its output, including the number of tests run. Run the full relevant suite. If you didn't run it, write "tests not run" and why.
  • Test changes: every test file you changed, and for each changed or removed assertion, the requirement that changed. If there's none, there should be no test edits.
  • Skips and suppressions: every skip, xfail, ignore comment or cast you added, with the reason. Expect a human to remove it.
  • Guards: for any auth or validation check you removed, where it lives now.
  • Unfinished: a list of every stub, TODO, NotImplementedError or placeholder left in the change. Don't call it done if this list isn't empty.
  • Conflicts: any test you believe is wrong, which spec it contradicts, and that you stopped instead of working around it.
  • Scanner: the backslop diff result, and for each finding you didn't fix, why it's a false positive.

Skills relacionados