Repository navigation
Delete low-quality tests found in a codebase-wide sweep - #961
Merged
Merged
Conversation
AGENTS.md says to write only tests that verify where bugs are possible. This change sweeps all 888 test files (7,910 cases) against that rule. Each candidate had to survive a mutation check. An agent opened the source under test, proposed realistic one-line bugs, and showed that none of them turn the test red. An independent skeptic pass then tried to save every candidate. It rejected 24 of the 38 flags. Delete the 14 tests that survived both passes: - Tautologies that assert type-guaranteed or literal values (create-via-prompt-examples, prompt-editor-serialization, timeline-cache). - Byte-identical duplicate cases (lifecycle-errors, thread-parent). - Zero-assertion smoke tests that asserting twins already dominate (sdk-session, runtime.lifecycle x3). - pi adapter process-config tests duplicated verbatim in provider-registry. - An AST export-name snapshot that no behavior change can fail (tools-public-exports). - A byte-size recording block that imports no source (payload-size). - A real-provider integration file whose assertions are a strict subset of provider-turns. Tests: typecheck passes for @bb/app, @bb/server, @bb/agent-runtime, @bb/host-daemon-contract, and @bb/integration-tests. Suites pass for @bb/app (307 files), @bb/agent-runtime (41), and @bb/host-daemon-contract (3). @bb/server passes 152 of 153 files. internal-skill-trees.test.ts fails identically at HEAD on this machine, because umask 0002 gives mode 0664 and the test expects 0644. Note: prompt-mention-extension.ts still declares promptMentionArgumentHintPlaceholder, which is now unreferenced. Its removal is a follow-up. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Collaborator
Author
|
🚨 SLOP COP 🚨 · I am the Slop Cop. I started the review for this pull request. I will review security, code quality, architecture, performance, and applicable end-to-end behavior. |
amadad
pushed a commit
to amadad/bb
that referenced
this pull request
Aug 14, 2026
## What AGENTS.md says to write only tests that verify where bugs are possible. This PR sweeps every test file against that rule and deletes the tests that fail it. Scope: all 888 test files, 7,910 test cases, 314,511 lines. Result: **14 tests deleted across 11 files. 366 lines removed, 1 line added** (an import rewrite). 888 → 886 files. 7,910 → 7,897 cases. ## How candidates were chosen Two passes, both adversarial: 1. **Mutation check.** For every candidate, an agent opened the source file under test, proposed realistic one-line bugs (inverted condition, dropped `await`, swapped arguments, off-by-one, removed field, early return), and had to show that none of them turn the test red. Any test that caught a mutation stayed. 2. **Skeptic pass.** An independent agent then tried to *save* every flagged test, with instructions to default to KEEP. It rejected 24 of the 38 flags. Contract tests, migration tests, permission and parsing tests, error paths, and sole-coverage tests were out of scope by rule. Each of the 14 survivors was then re-verified by hand against the real source. ## What was deleted | Test | File | Why | |---|---|---| | `gives every %s example a semantic launcher icon` | `apps/app/src/components/create-via-prompt-examples.test.ts` | `icon` is typed `IconName` on a static config and only field-copied. `icon.length > 0` is type-guaranteed. | | `does not render argument hint placeholders…` | `…/promptbox/editor/prompt-editor-serialization.test.ts` | Calls a `return null` stub whose declared return type is the literal `null`, with zero production callers. | | `environment_not_ready destroyed cleanup` | `apps/app/src/lib/lifecycle-errors.test.ts` | Byte-identical to the case above it. Only the `name` string differs. | | *whole file* — `Tools Hub public export contracts` | `apps/app/src/views/tools-public-exports.test.ts` | AST export-name snapshot. No behavior change can fail it. Real removals are caught by typecheck. | | `is stable for identical inputs` | `apps/server/test/services/threads/timeline-cache.test.ts` | Pure template-join key builder. No realistic mutation fails it while the two sibling tests stay green. | | `is false for a root thread with no parent` | `apps/server/test/threads/thread-parent.test.ts` | Byte-for-byte duplicate of the preceding test. | | `pushInput queues messages before start` | `…/claude-code/bridge/__tests__/sdk-session.test.ts` | Zero assertions. Dominated by the rejection test 25 lines below. | | `renames a thread`, `stops a thread`, `steers an active turn` | `packages/agent-runtime/src/runtime.lifecycle.test.ts` | Zero assertions. Verified by injecting throws: each mutation reddened asserting twins elsewhere, never these. | | `has correct process config`, `uses the configured bridge bundle directory…` | `packages/agent-runtime/src/pi/adapter.test.ts` | Same assertions on the same path as `provider-registry.test.ts`, which asserts strictly more. | | *describe block* — `server-to-daemon watch payload sizes` | `packages/host-daemon-contract/test/payload-size.test.ts` | Imports no source. Measures gzip bytes of a hand-rolled untyped literal. Schema coverage is in `contract.test.ts`. | | *whole file* — `real provider registry integration` | `tests/integration/real/provider-registry.test.ts` | Same setup as `provider-turns.test.ts` with a strict subset of its assertions. Also saves a real-provider CI run. | The sibling `daemon-to-server` block in `payload-size.test.ts` was kept: it asserts that grouping shrinks the payload, which is a real invariant. ## Tests - `turbo run typecheck` passes for `@bb/app`, `@bb/server`, `@bb/agent-runtime`, `@bb/host-daemon-contract`, `@bb/integration-tests`. - `turbo run test` passes for `@bb/app` (307 files), `@bb/agent-runtime` (41), `@bb/host-daemon-contract` (3). - `@bb/server` passes 152 of 153 files. `internal-skill-trees.test.ts` fails identically at HEAD on the dev machine, because `umask 0002` gives file mode `0664` where the test expects `0644`. It is unrelated to this change. - The real-provider integration suite was not run locally. It needs live provider credentials. ## Risk Low. The change deletes test code only. No source file is touched. One judgment call to flag: `tools-public-exports.test.ts` was created deliberately as a frozen export surface. It matched the implementation-mirror category exactly, so it was deleted. Its documentation reference in `plans/tools-hub-plugin-detail-handoff.md` disappeared with get-bb#958, so no stale pointer remains. ## Follow-up `promptMentionArgumentHintPlaceholder` in `prompt-mention-extension.ts` is now unreferenced. Removing the function is a separate change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AGENTS.md says to write only tests that verify where bugs are possible. This PR sweeps every test file against that rule and deletes the tests that fail it.
Scope: all 888 test files, 7,910 test cases, 314,511 lines.
Result: 14 tests deleted across 11 files. 366 lines removed, 1 line added (an import rewrite). 888 → 886 files. 7,910 → 7,897 cases.
How candidates were chosen
Two passes, both adversarial:
await, swapped arguments, off-by-one, removed field, early return), and had to show that none of them turn the test red. Any test that caught a mutation stayed.Contract tests, migration tests, permission and parsing tests, error paths, and sole-coverage tests were out of scope by rule. Each of the 14 survivors was then re-verified by hand against the real source.
What was deleted
gives every %s example a semantic launcher iconapps/app/src/components/create-via-prompt-examples.test.tsiconis typedIconNameon a static config and only field-copied.icon.length > 0is type-guaranteed.does not render argument hint placeholders……/promptbox/editor/prompt-editor-serialization.test.tsreturn nullstub whose declared return type is the literalnull, with zero production callers.environment_not_ready destroyed cleanupapps/app/src/lib/lifecycle-errors.test.tsnamestring differs.Tools Hub public export contractsapps/app/src/views/tools-public-exports.test.tsis stable for identical inputsapps/server/test/services/threads/timeline-cache.test.tsis false for a root thread with no parentapps/server/test/threads/thread-parent.test.tspushInput queues messages before start…/claude-code/bridge/__tests__/sdk-session.test.tsrenames a thread,stops a thread,steers an active turnpackages/agent-runtime/src/runtime.lifecycle.test.tshas correct process config,uses the configured bridge bundle directory…packages/agent-runtime/src/pi/adapter.test.tsprovider-registry.test.ts, which asserts strictly more.server-to-daemon watch payload sizespackages/host-daemon-contract/test/payload-size.test.tscontract.test.ts.real provider registry integrationtests/integration/real/provider-registry.test.tsprovider-turns.test.tswith a strict subset of its assertions. Also saves a real-provider CI run.The sibling
daemon-to-serverblock inpayload-size.test.tswas kept: it asserts that grouping shrinks the payload, which is a real invariant.Tests
turbo run typecheckpasses for@bb/app,@bb/server,@bb/agent-runtime,@bb/host-daemon-contract,@bb/integration-tests.turbo run testpasses for@bb/app(307 files),@bb/agent-runtime(41),@bb/host-daemon-contract(3).@bb/serverpasses 152 of 153 files.internal-skill-trees.test.tsfails identically at HEAD on the dev machine, becauseumask 0002gives file mode0664where the test expects0644. It is unrelated to this change.Risk
Low. The change deletes test code only. No source file is touched.
One judgment call to flag:
tools-public-exports.test.tswas created deliberately as a frozen export surface. It matched the implementation-mirror category exactly, so it was deleted. Its documentation reference inplans/tools-hub-plugin-detail-handoff.mddisappeared with #958, so no stale pointer remains.Follow-up
promptMentionArgumentHintPlaceholderinprompt-mention-extension.tsis now unreferenced. Removing the function is a separate change.🤖 Generated with Claude Code