Repository navigation
Delete verified dead code: QA log, finished plans, orphan files, dead exports - #1377
Conversation
qa/manual-pass-log.md was a single historical manual QA run log full of dead thread/environment IDs; nothing references it (the root qa/ directory is unrelated to tests/qa/). plans/environment-archive-grace-period.md documents work its own header marks "implemented 2026-06-17" (managedEnvironmentRetireGraceMs and the retireRequestedAt clock are live in apps/server). Repo precedent: PR #958 deletes plans whose work shipped. plans/composer-extraction.md is self-invalidated: its own 2026-08-03 status says the premise moved (the side-chat site now shares hooks via EmbeddedThreadChat and the motivating 4th call site never landed). Co-Authored-By: Claude Fable 5 <[email protected]>
Every deletion was re-verified against the current tree by repo-wide
reference counting (any occurrence of the identifier in any tracked
file, including strings, JSON, and docs, counted as a reference), plus
symbol-level git log -S checks to avoid touching in-flight work.
Orphaned files (zero importers): child-thread-environment.ts,
cursor-pagination.ts, CodexIcon.tsx (codex renders OpenAiIcon),
file-mention.ts (+ its test), json-parsing.ts, and the
useThreadTimelinePages.ts rename-alias shim. The shim's merge tests
covered helpers the controller's own test does not, so they move next
to useThreadTimelineController and import the real module.
Dead runtime exports (~40 symbols) across apps/app, apps/server,
apps/host-daemon, and packages/{db,domain,host-daemon-contract,
host-workspace,server-contract}, together with their arg-type
interfaces, orphaned private helpers, and now-orphaned test blocks.
Tests that exercised live logic through a dead alias were retargeted
(beginThreadMetadataTransaction, resolveLocalBbExecutablePath) rather
than deleted.
BB_CLI_ENV in packages/config/src/env-vars.ts was a definition orphan:
all call sites read env.BB_CLI directly and defineEnvVar has no
registry, so the definition served nothing.
The hostDaemonRetryableOnlineRpcCommandSchema removal is value-only;
the HostDaemonRetryableOnlineRpcCommand type used by online-rpc.ts is
unchanged and nothing on the wire changes, so no
HOST_DAEMON_PROTOCOL_VERSION bump.
Deliberately kept: shared-ui scaffold components, agent-runtime (owned
by a separate PR), all .stories.tsx exports (Storybook collects named
exports by convention), test seams (__testing, getPromptDecorationSet),
the published bb-app public-sdk entry, createMachineCodeFn (touched
yesterday by #1168), CLOUD_PAT_PREFIX (documented policy scaffold), and
everything in the plugin runtime ABI manifest.
Co-Authored-By: Claude Fable 5 <[email protected]>
packages/plugin-sdk/bundled-types/** and packages/templates/src/generated/** are committed build outputs that get re-serialized constantly; linguist-generated collapses them in review diffs and keeps them out of language stats. Co-Authored-By: Claude Fable 5 <[email protected]>
|
🚨 SLOP COP 🚨 · ELI5: This PR removes files and code that the project no longer uses. I am SlopCop. I am reviewing this PR under the stated review rules. I will check security, code quality, performance, architecture, and the product route. |
| }); | ||
| } | ||
|
|
||
| export function useReorderProject() { |
There was a problem hiding this comment.
🚨 slopcop/review — This deletion leaves the project reorder cache code unused.
Please delete ReorderProjectTransaction, the private reorder helpers, and the three transaction functions from project-cache-owner.ts. A project-wide search at this SHA finds no other use.
| }); | ||
| } | ||
|
|
||
| export function useUpdateSkill(projectId: string) { |
There was a problem hiding this comment.
🚨 slopcop/review — This deletion leaves the skill content invalidation code unused.
Please delete invalidateSkillContentMutationQueries and its argument interface from skills-cache-effects.ts. A project-wide search at this SHA finds no other use.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
ELI5: This PR removes old files and code that the product does not use.
This cleanup looks safe. I found no blocking security, correctness, performance, or architecture issue.
I found two low-severity cleanup gaps:
- The removed project reorder hook leaves its cache transaction code unused.
- The removed skill update hook leaves its cache invalidation code unused.
I left inline comments at both deletion sites. These findings do not change behavior and do not block this PR.
The security review found no removed check or validation with a live caller. The performance review found no removed live cache, query, or worker path.
The architecture scan found no duplicate live behavior. This PR removes one duplicate plugin frontend parser and one route wrapper.
I tested the exact head SHA. Eight touched runtime packages passed the Turbo typecheck. All GitHub checks passed.
The development app started successfully. The root page loaded, the new-thread composer opened, and the right panel opened without browser errors.
git diff --check reports extra final blank lines in five files. This is a minor style issue only.
Removing the reorder-project mutation and the skill-content mutation hook left their cache-owner support code unreferenced: - project-cache-owner.ts: drop the ReorderProjectTransaction interface, begin/rollback/apply reorder transaction functions, and the two private project-order helpers, plus the now-unused ReorderProjectRequest, applyNeighborReorder, and invalidateProjectListQueries imports. - skills-cache-effects.ts: drop invalidateSkillContentMutationQueries and its SkillContentInvalidationArg interface. - query-keys.ts: drop skillContentQueryKeyPrefix, whose only caller was the deleted skill-content invalidation helper; remove it from the cache-owner-registry allowlist as well. Also strip the stray final blank lines the sweep left in five files (git diff --check is clean against main again). Co-Authored-By: Claude Fable 5 <[email protected]>
|
Addressed the SlopCop review findings in eaf22b5: 1. Orphaned reorder-project cache code — verified zero references repo-wide at the previous head, then deleted from 2. Orphaned skill-content invalidation helper — verified, then deleted 3. Trailing blank lines — 4. Cascade follow-through — deleting the skill-content helper orphaned Verification: full-repo Updated PR delta:
|
Dead-code sweep based on the de-slop audit (
plans/deslop-report.mdon the audit branch, section 5). Every deletion below was re-verified against the current tree by repo-wide reference counting (apps/, packages/, plugins/, examples/, tests/, scripts/, docs/ — any occurrence of the identifier anywhere, including strings, JSON, and markdown, counted as a reference). Net delta: +67 / −2,565 lines across 77 files.1. Historical QA log
qa/manual-pass-log.md(668 lines) — a single manual QA run log full of dead thread/environment IDs. Zero references. The rootqa/directory is unrelated to the livetests/qa/package; only this log was deleted (the runbooks inqa/stay).2. Stale plans (deleted 2 of 5, kept 3)
environment-archive-grace-period.mdmanagedEnvironmentRetireGraceMsand theretireRequestedAtgrace clock are live inapps/servercomposer-extraction.mdEmbeddedThreadChatand the motivating 4th call site never landedbb-browser.mdbb-settings.mdbb settingsshipped in a different shape) but its own status re-scopes it to the remaining browser-link-settings workin-app-browser-open-behavior-improvements.md3. Orphaned files (6 found, all with zero importers)
apps/app/src/lib/child-thread-environment.ts—resolveChildThreadEnvironmenthas no callerspackages/db/src/data/cursor-pagination.ts— not re-exported by the@bb/dbbarrel, no callersapps/app/src/components/icons/CodexIcon.tsx— the codex provider rendersOpenAiIcon(provider-icon.ts)apps/app/src/components/promptbox/mentions/file-mention.ts(+ its test) — only its own test referenced itapps/server/src/services/lib/json-parsing.ts— module never importedapps/app/src/views/thread-detail/useThreadTimelinePages.ts— a pure rename-alias re-export shim overuseThreadTimelineController. Its 400-line test covered merge helpers the controller's own test does not, so the test moved toapps/app/src/components/thread/timeline/useThreadTimelineController.merge.test.tsand imports the real module; only the shim was deleted.4. Dead runtime exports (~40 symbols)
Re-verified individually: zero references outside the defining file and its own test, and unused inside the defining file (declaration-only). Symbol-level
git log -Sconfirmed none are recent/in-flight work. Deleted, with their arg-type interfaces and now-orphaned test blocks:isPluginSlotInstanceCrashed,isFileOpenerPanelTab,PROMPT_STACK_COMPACT_INLAY_INSET_CLASS,PROMPT_STACK_COMPACT_INLAY_SEGMENT_CLASS,promptMentionArgumentHintPlaceholder,commandTriggerForComposerActions,resolveShowPanelControl(plus the now-unreachable"show-panel"action variant + presentation entry),isHostFilePreviewTab,getOpenSecondaryPanelTab,SIDEBAR_PLUGIN_WORKING_STATUS_COLOR_CLASS,isKnownSkillScope,seedSystemExecutionOptionsCache,hydrateSystemConfigCache,beginThreadTitleTransaction(alias of livebeginThreadMetadataTransaction; its test retargeted to the real function),useReorderProject,usePluginCatalogStatus(plus its privatefetchPluginCatalogStatus/toPluginCatalogStatus/PluginCatalogStatuschain),allThreadTabsQueryKeyPrefix,threadHostFilePreviewQueryKeyPrefix,useUpdateSkill,fetchHostId,looksLikeUrl(its test cases are fully duplicated by theresolveBrowserAddressInputsuite),findFileOpenersForPath,interpretPluginFrontends(dead duplicate —plugin-frontend.tsinlines the same logic),getPluginFrontendRecords,getPullRequestSignalDisplays,buildQueuedMessageReorderRequest,getToolsRoutePath,isBusyThread, the wholeworkspace-open-target-preference.tsguard family (isWorkspaceDirectoryOpenTarget,isWorkspaceFileOpenTarget,isRemoteSshWorkspaceDirectoryOpenTarget,isRemoteSshWorkspaceFileOpenTarget),RootComposeRoute(routes register throughSplitWorkspaceRouteinApp.tsx;LegacyProjectComposeRedirectis still live and stays),reconcileLayoutForRoute,focusedThreadRoute,resolveThreadLocalWorkspaceRootPath,CreateViaPromptExamplesresolveLocalBbExecutableDirectory(5-linedirnamewrapper; its 4 tests covered real entry-path validation and were retargeted toresolveLocalBbExecutablePath)assertPrimaryHostId(+ privateunsupportedHostError),directoryExists,swapDirIntoPlace(superseded by the durable-promote path in the same file),getTurnExecutionOptionslistTrackedThreadStorageTargetsOnHostALL_REASONING_EFFORTS,threadProvisioningReasonSchema,turnLifecycleEventDataSchemahostDaemonRetryableOnlineRpcCommandSchema(+ its private union builder and descriptor filter). Runtime-value only; theHostDaemonRetryableOnlineRpcCommandtype used byonline-rpc.tsis untouched, nothing on the wire changes, so noHOST_DAEMON_PROTOCOL_VERSIONbump.decodeGitQuotedPathenvironmentActionTypeSchema,domainErrorCodeSchema, and the three alias-shim constshostPathsExistResponseSchema,hostPickFolderResponseSchema,hostProviderCliStatusResponseSchema(their type aliases are still consumed and stay)5.
BB_CLI_ENVdefinition orphanpackages/config/src/env-vars.tsdefinedBB_CLI_ENVbut nothing imported it — all four call sites (bb-cli-reexec.ts,runtime-shell-env.ts, tests) read/writeenv.BB_CLIdirectly, anddefineEnvVarhas no global registry, so the definition served nothing. Deleted the definition only; call sites untouched.6.
.gitattributesMarked the committed generated artifacts as
linguist-generatedso they collapse in review diffs:packages/plugin-sdk/bundled-types/**packages/templates/src/generated/**Deliberately NOT deleted
packages/shared-ui/src/components/ui/**+ Radix deps — intentional scaffold library, owner said keep (audit's largest line item, excluded by instruction).packages/agent-runtime/**— a separate in-flight PR owns dead-code removal there (./capturesubpath,resolveAdapterPermissionPolicy, test-harness exports)..stories.tsxexports — Storybook collects named exports by convention; they are framework-reachable, not dead.__testing(apps/host-daemon/src/provider-usage.ts) andgetPromptDecorationSet(prompt-decoration extension) — exported only for their own tests, which verify live production behavior through them.createBBSdk(packages/bb-app/src/public-sdk.ts) — apackage.jsonexports entry point of the publishedbb-apppackage; external consumers are invisible to repo-wide grep.createMachineCodeFn(apps/web/src/server/fns.ts) — unused TanStack server fn, but the file was touched yesterday by the Cloud dev-workflow PR (Add a usable local Cloud development workflow #1168); plausibly in-flight, left alone.CLOUD_PAT_PREFIX(packages/connect-db/src/constants.ts) — unreferenced, but it is a documented policy constant ("token prefixes mirror bb's host-key convention") in a deliberate policy-constants file; ambiguous scaffold, left alone.workspaceOpenTargetPreferenceAtomatoms, storage-key consts) — de-exporting them deletes no lines; skipped to keep the diff pure deletion.plugin-build/src/runtime-export-manifest.ts— the plugin runtime ABI was checked before every deletion; no deleted symbol appears in it.Verification
pnpm exec turbo run typecheck— all 58 tasks pass.pnpm exec turbo run testfor every touched package — all pass:@bb/app2529,@bb/server1436,@bb/host-daemon541,@bb/db379,@bb/host-workspace194,@bb/domain128,@bb/config106,@bb/host-daemon-contract49,@bb/server-contract42 tests. (One guardrail test,cache-owner-registry.test.ts, correctly flagged a stale allowlist entry for the deletedseedSystemExecutionOptionsCacheimport; the entry was removed.)package.jsondependencies were removed, so the lockfile is unchanged.🤖 Generated with Claude Code