Skip to content

Delete low-quality tests found in a codebase-wide sweep - #961

Merged
SawyerHood merged 1 commit into
mainfrom
bb/low-quality-test-thr_n4bh85m46h
Aug 3, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/low-quality-test-thr_n4bh85m46h

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

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 #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

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]>
@SawyerHood

Copy link
Copy Markdown
Collaborator Author

🚨 SLOP COP 🚨 · review

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.

@SawyerHood
SawyerHood merged commit c59c39b into main Aug 3, 2026
10 checks passed
@SawyerHood
SawyerHood deleted the bb/low-quality-test-thr_n4bh85m46h branch August 3, 2026 22:57
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]>
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.

1 participant