Skip to content

Remove duplicate host and runtime tests and test-only exports - #4376

Merged
SawyerHood merged 1 commit into
mainfrom
bb/test-audit-host-thr_s3kmw74uzx
Sep 25, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/test-audit-host-thr_s3kmw74uzx

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Host and runtime tests covered the same contracts at two layers. Examples:

Others tested a shared helper instead of their subject: the plugin-host env test called the process-utils sanitizer directly and never touched PluginHostManager. Two could not detect their bug:

  • the concurrent skill-staging test lacks a pinned clock, so it catches a same-millisecond temp-dir collision only by chance;
  • the watcher recovery harness is env-gated and asserts constants it hard-codes.

A few tests kept exports alive only for themselves: listPathsRecursively, diffCumulativeText, sendJsonRpc and toJsonRpcMessage.

What changed

Found by a read-only test audit using the repo test-audit skill (#4361).

  • Duplicate tests deleted. Tests were tightened first where needed; for example, the relative-path handler test now asserts the error code and message.
  • runtime.fake-approvals.test.ts deleted: its unique assertions move into runtime.interactive-requests.test.ts, which now asserts the full command approval payload (reason, cwd, actions).
  • listPathsRecursively: its depth and exclusion cases now run through listWorkspacePaths, and the function is no longer exported. The dispatch test lists a nested directory.
  • diffCumulativeText: its tests fold into the assembler test, and it is no longer exported.
  • sendJsonRpc: inlined into sendJsonRpcRequest. toJsonRpcMessage is no longer exported.
  • Unchanged: request bytes, published Plugin SDK output and host-daemon wire shapes.
  • Not in this PR: the opt-in root-recovery benchmark (Keep FSEvents overflow recovery subscription-scoped #2666), pending its author.

Production +4/−15, tests +176/−1080.

How you verified

  • pnpm exec turbo run test lint typecheck is green across host-daemon, agent-runtime, host-watcher, host-workspace, provider-bridge-acp, provider-bridge-protocol and provider-parity.
    • The only failures are the two command-discovery tests that fail on this machine when /tmp/.agents exists; they pass with TMPDIR=/var/tmp/....
  • Off-pipeline suites:
    • provider-parity: 59/59.
    • integration environment-actions: 5/5.
    • agent-runtime test:integration: only the two real-Codex tests that also fail on base.
  • An independent verifier used before and after worktrees on 175d5ac and one mutation per removed test (39 tests).
    • Result: 31 OK, 4 with no unique failure mode, 4 partial losses. All 4 are restored here, and each fails under its mutation.
    • It also built @get-bb/plugin-sdk in both trees: dist/ and bundled-types/ are byte-identical.

AGENT GENERATED

🤖 Generated with Claude Code

Remove host daemon, agent runtime, watcher, workspace and bridge tests
that duplicate a stronger test of the same behavior, test a helper
directly and again through its real caller, or assert values they
supply themselves.

- Host file reads: drop dispatch-layer copies of the host-files handler
  tests. The handler's relative-path test now pins the error code and
  message.
- Watcher: drop the env-gated recovery count harness. Its assertions
  restated its own constants.
- Plugin host: drop a test that called the shared env sanitizer directly
  instead of going through PluginHostManager.
- Agent runtime: drop archived-session, stale-steer and per-provider-id
  registry tests that the recovery, input-accepted and registry suites
  already cover. Fold the scripted approval directive suite into the
  interactive-requests tests, and pin the full approval payload (reason,
  cwd, actions) that reaches the user.
- Workspace: drop mocked gh "no PR" and "not installed" cases, which
  real-process tests already cover, and the provisioned-workspace
  delegation test, which the integration smoke covers.
- Server move: drop rewriteManagedConfigServer cases that the
  server-moved service tests assert exactly.
- Skill staging: drop the nondeterministic concurrent-staging twin.
- Path listing: run the excluded-names and deep-directory tests through
  listWorkspacePaths and stop exporting listPathsRecursively. The
  dispatch list_paths test now covers a nested directory's name.
- ACP bridge: drop the Electron env test covered by its superset, and
  make the superset fail on the wrong value instead of timing out.
- Bridge protocol:
  - Drop a restated notification-method constant test.
  - Test diffCumulativeText only through the assembler and stop
    exporting it. Remove its redundant first-snapshot branch, because
    the append branch already handles an empty previous snapshot. Add
    empty-snapshot and first-snapshot no-reset checks to the assembler
    test.
  - Drop coverage-only tests for sendJsonRpc and toJsonRpcMessage.
    Inline sendJsonRpc and stop exporting toJsonRpcMessage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@SawyerHood
SawyerHood force-pushed the bb/test-audit-host-thr_s3kmw74uzx branch from 9f9aca5 to c1a9824 Compare September 25, 2026 22:27
@SawyerHood
SawyerHood merged commit 9c9bae7 into main Sep 25, 2026
18 checks passed
@SawyerHood
SawyerHood deleted the bb/test-audit-host-thr_s3kmw74uzx branch September 25, 2026 22:33
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