Skip to content

🤖 tests: fail on production exports that only tests (or nothing) reference - #7561

Open
ThomasK33 wants to merge 6 commits into
mainfrom
test-audit/p3-2-test-only-exports
Open

ThomasK33 wants to merge 6 commits into
mainfrom
test-audit/p3-2-test-only-exports

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

New static check check-test-only-exports (in make static-check): it fails when an export of a production file under src/ has no non-test reference, unless an allowlist entry gives a reason. Stacked on #7552, which adds the shared typescript guard.

Background

The 2026-10-26 audit found about 8 dead functions that only tests call (two orphaned by feature removals) and 21 exports that nothing references. check-test-seam-comments only reads comments, so all of them passed it. This check reads references instead.

Implementation

  1. The script parses only production files (isProductionSource, shared with the seam checker). Tests never count as references, and they are never parsed, so the run takes about 3 s and peaks under 300 MB.
  2. A reference is an import from another production file (resolved through @/, relative paths, ESM .js suffixes, index files, and named or export * barrels), a namespace import, import(), require() or a require wrapper (requireDesktopModule in main.ts), an import("x").T type, or a use in the export's own file. Property names (o.x, { x: 1 }) do not count.
  3. Built-in workflow scripts (src/node/builtinSkills/**/*.js) are skipped: the workflow runtime reads their meta and default exports by contract.
  4. settingsStoryUtils.tsx now counts as test support (*StoryUtils/*StoryHelpers names) in isProductionSource.
  5. Allowlist (scripts/check-test-only-exports.allowlist.json):
  6. Stale entries (the export is gone or gained a production reference) and duplicates fail, so the allowlist stays exact.
pendingDeletion handoff (11)

P3-4 (test-audit phase 3, frontend)

  • src/browser/features/RightSidebar/ArtifactsTab/artifactDocument.ts buildSandboxedHtmlDocument
  • src/browser/features/Settings/Sections/GoalsSection.tsx GoalsSection
  • src/browser/hooks/useModelsFromSettings.ts getSuggestedModels
  • src/browser/stores/DraftStore.ts DraftAttachmentMatchesChatAttachment
  • src/browser/utils/highlighting/highlightDiffChunk.ts highlightDiffChunk
  • src/browser/utils/messages/StreamingTPSCalculator.ts calculateTPS
  • src/browser/utils/messages/StreamingTPSCalculator.ts calculateTokenCount
  • src/browser/utils/messages/StreamingTPSCalculator.ts DeltaRecord
  • src/browser/utils/rightSidebarLayout.ts addToolToFocusedTabset
  • src/browser/utils/workflowRunMessages.ts filterWorkflowDisplayOnlyMessages
  • src/browser/utils/workspaceStorage.ts migrateWorkspaceStorage

Deferred follow-ups

  • Named re-exports (export { x } from "./a") are not checked as exports of the barrel yet. Checking them surfaces 32 more findings on main (compatibility re-exports in streamManager.ts, appConfigOnDisk.ts and others). Tracked in 🤖 tests: P3-2 seam-check test-audit residuals #7604 (item 1): a stacked PR after this one lands widens the gate and deletes or allowlists those 32. Owner: P3-2.

Validation

  • Unit tests cover each reference form, barrels, declaration forms, resolution and the list checks. Each of 10 mutations of the scanner (property names, export * and default, the require wrapper, import types, overload dedupe, default imports, named forwarding, local uses, dynamic imports) fails a test.
  • On the real tree, adding export function newTestOnlyHelper() to src/common/utils/drafts.ts plus a test that imports it fails the check with drafts.ts:243 export \newTestOnlyHelper` has no non-test reference` (exit 1). Without it the check passes.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

@ThomasK33
ThomasK33 added this pull request to stack #7562 October 26, 2026 12:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T14:56:59.466977Z f03ad32 New commits
🔒 Security Review ✅ Completed 2026-10-26T14:50:34.271297Z f03ad32 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33 ThomasK33 changed the title tests: fail on production exports that only tests (or nothing) reference 🤖 tests: fail on production exports that only tests (or nothing) reference Oct 26, 2026
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

22 agent steps · 7 replayed from cache · 15 model calls · 46.3k tokens (28% cached)
Spend: $0.09 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 1 step · 1 call 5.2s
🟢 a chat survives a restart of the server 1 step · 1 call 5.2s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 4.9s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 4.9s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 13.1s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 13.1s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 8.9s
🟢 a chat survives trips through Settings 2 steps · 1 call 8.9s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 5.3s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 5.3s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 2.6s
🟢 the agent opens the playground workspace 2 steps · 1 call 2.6s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 6.6s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 6.6s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 2.7s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 2.7s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 32.6s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 3.7s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 3.8s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 4.8s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.2s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 6.6s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 10.5s

e2e 0.20.0 · 1m 25s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 8.0k tokens (32% cached)
Spend: $0.01 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 5.4s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 5.4s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 5.6s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 5.6s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 5.1s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 5.1s

e2e 0.20.0 · 18.2s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f33ced46b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-only-exports.ts Outdated
Comment thread scripts/check-test-only-exports.ts Outdated
Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts Outdated
@ThomasK33
ThomasK33 force-pushed the test-audit/p3-2-test-only-exports branch from 2f33ced to b8e5235 Compare October 26, 2026 12:25
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8e5235154

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
@ThomasK33
ThomasK33 force-pushed the test-audit/p3-2-test-only-exports branch from b8e5235 to ff84a04 Compare October 26, 2026 12:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff84a0431e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-only-exports.ts Outdated
Comment thread scripts/check-test-only-exports.ts Outdated
Comment thread scripts/check-test-only-exports.ts
@ThomasK33
ThomasK33 force-pushed the test-audit/p3-2-test-only-exports branch from ff84a04 to e05c12a Compare October 26, 2026 13:01
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

P3-3 (node/common dead code, stack #7558): status of the 53 node/common pendingDeletion entries.

48 entries are deleted across #7554, #7555, #7556 (all three in the merge queue), #7557, #7600 and #7601. I ran this PR's checker against the top of that stack. It reports those 48 as stale and finds nothing new.

I keep 5 exports. Please move them from pendingDeletion to allowed with these reasons:

  • src/common/orpc/onChatCursorFingerprint.ts#computePriorHistoryFingerprint: the reference implementation. The tests of computePriorHistoryFingerprintAsync (production) require the same result for every input.
  • src/node/services/replay/replayFixture.ts#appendReplayFixtureCompactionBoundary: test-support, the replay golden-fixture harness.
  • src/node/services/replay/replayFixture.ts#generateReplayFixtureSession: test-support, the same harness.
  • src/common/staticWorkspaceView/phoneChrome.ts#PhoneChrome: test-support type. It types the generated PHONE_CHROME_JSON skeleton, which only tests parse.
  • src/node/worktree/codeWorkspaceSync.ts#updateCodeWorkspaceFile: the unit boundary of the .code-workspace edit algorithm (23 tests). syncProjectCodeWorkspace runs the same updateCodeWorkspaceFileLocked under its own lock.

If this PR merges first, I remove the stale keys from both lists in my open PRs and make these moves myself.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: e05c12aa06

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e05c12aa06

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Base automatically changed from test-audit/p3-2-seam-checks to main October 26, 2026 13:26
@ThomasK33
ThomasK33 force-pushed the test-audit/p3-2-test-only-exports branch from 64ed0f6 to f8d1727 Compare October 26, 2026 13:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8d1727823

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
@ThomasK33

Copy link
Copy Markdown
Member Author

P3-3 final state: #7554, #7555, #7556, #7557, #7565, #7600 and #7601 are all merged on main.

I ran this PR's checker (head f8d1727) against origin/main. It reports exactly 48 stale pendingDeletion entries, all of them node/common/cli entries for P3-3, and no other finding. When you rebase, remove those 48 from the JSON file and from FROZEN_PENDING_DELETION. Then move the 5 kept exports to allowed, with the reasons in my comment above (computePriorHistoryFingerprint, the two replayFixture.ts helpers, PhoneChrome, updateCodeWorkspaceFile). After that, pendingDeletion holds no node/common entries.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

@ThomasK33

Copy link
Copy Markdown
Member Author

P3-2: applied P3-3's handoff in f03ad32 (merge of main + allowlist update). I verified it: on main the checker reported exactly 48 stale pendingDeletion entries. I removed them from the JSON and FROZEN_PENDING_DELETION, and moved the 5 kept exports to allowed with P3-3's reasons. pendingDeletion now holds only the 11 P3-4 browser entries. make static-check passes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f03ad32166

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
Comment thread scripts/check-test-only-exports.ts
@ThomasK33

Copy link
Copy Markdown
Member Author

Early stop (AGENTS.md PR Workflow, cases 2 and 4). This PR needs a human decision before it can merge.

  1. The review loop does not converge. All six Codex rounds found new parser edge cases in the same area (scope shadowing, CommonJS forms, barrel and namespace forwarding). Rounds 1 to 4 fixed them. Rounds 5 and 6 raised six more P2 gaps, and none of them fails code on main. I declined them with reasons and tracked them in 🤖 tests: P3-2 seam-check test-audit residuals #7604 (items 7 and 8). The other deferred items are 1, 4 and 5.
  2. Codex has not approved the final head f03ad32166. Its round-6 review found the three gaps above, and a seventh review would exceed the six-round limit. So the Codex approval gate can only be cleared by a human.

Current state of the final head f03ad32166:

  • It is merged with main, and make static-check passes.
  • The checker passes on main. allowed has 35 entries. pendingDeletion has 11 entries, all owned by P3-4. P3-3's 48 deletions are applied, and its 5 kept exports are in allowed.
  • All review threads are resolved.

Options for the maintainer:

  • A: Merge as is. Tracked follow-ups stay in 🤖 tests: P3-2 seam-check test-audit residuals #7604.
  • B: Allow one more Codex round on this head.
  • C: Reduce scope. Drop the scope-shadowing analysis so that every same-name identifier counts as a use. That removes the false-finding class, and the remaining gaps only cause missed findings. It needs a new head and a new review.

My recommendation is A. Every remaining gap is a missed finding or a case that does not exist on main, and the gate already catches newly added test-only exports. That catch is proven in scripts/check-test-only-exports.test.ts.

@ThomasK33

Copy link
Copy Markdown
Member Author

P3-2 update while this PR waits for the early-stop decision above.

Main moved after the final head f03ad32166. On current main, this PR's checker now fails with 2 stale pendingDeletion entries, because P3-4's #7563 deleted buildSandboxedHtmlDocument and addToolToFocusedTabset. P3-4 also asked me to move DraftAttachmentMatchesChatAttachment to allowed. I checked it: it is a compile-time drift guard (DraftStore.ts:144), and noUnusedLocals rejects the alias if it is not exported.

I did not push that change to this PR, because a push starts a seventh Codex round. It is ready as 5b684cfd5a on branch test-audit/p3-2-test-only-exports-sync. That commit merges main into this branch and updates the allowlist, and make static-check passes on it. With it, allowed has 36 entries and pendingDeletion has 8, all owned by P3-4, which #7619 deletes. Fast-forward this PR to that commit after you choose option A or B. If #7619 merges first, those 8 entries become stale too, and I remove them the same way.

P3-4 also flagged the story helpers in settingsStoryUtils.tsx. They need no entry: this PR treats *StoryUtils files as test support, and the checker reports no finding there.

yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Oct 26, 2026
…ommon (coder#7600)

## Summary
Delete the type aliases, interfaces and re-exports in node/common that
nothing references. P3-2's new check (`check-test-only-exports`, coder#7561)
lists each of them in `pendingDeletion` for this workstream.

Deleted (no file imports them. Most hits for these names are other
declarations with the same name):
- `z.infer` aliases: `AgentPluginInstallSource` (and its unused
re-export from `appConfigOnDisk.ts`), `AnthropicSpeed`,
`FastModePreviousServiceTier`, `ThemePreferenceConfig`, `RawQueryColumn`
and `RawQueryResult` (`analytics.ts`; `queries.ts` declares its own),
`ArtifactVersionSource`, `SkillsCliCommand`,
`RuntimeEnablementOverrides` (and its unused re-export),
`EvaluationInput`, `EvaluationProviderOptions`, `SessionTapeEventLine`,
`SessionTapeLine` (and `SessionTapeLineSchema`, which only that alias
used), the three `AutoRetry*Event` aliases in `stream.ts`
(`retryManager.ts` declares the ones production uses),
`StatusUpdateToolArgs`, `PlanReviewSnapshotRecord`,
`PlanReviewFeedbackReply`, `PlanReviewThreadReply` and
`MappedCodexHookEvent`.
- `PersistedKeyScope`, and the localStorage-era `ReviewState` and
`ReviewsState` interfaces in `types/review.ts`. The DI tag `ReviewState`
and `ChatPane`'s local `ReviewsState` are other declarations.
- Re-exports nothing imports: `CLAUDE_DESIGN_SERVER_NAME` from
`claudeDesignService.ts` (callers import
`@/common/constants/claudeDesign`), and `AskUserQuestionOptionSchema`
from `toolDefinitions.ts`.

Test-only aliases. Each test now types its fixture with the production
type:
- `ProviderModelEntry` (`providerModelEntry.ts`):
`coderOauthService.test.ts` imports the `@/common/orpc/types` one, like
every other caller.
- `AWSCredentialStatus` (`orpc/types.ts`): `api.test.ts` uses
`ProviderConfigInfo["aws"]`.
- `PlanReviewFeedbackComment`: `prepareFeedback.test.ts` uses
`PlanReviewFeedbackRecord["comments"]`.

## Validation
`make typecheck` and `make lint-eslint` pass. The touched suites pass
(415 tests). I ran P3-2's checker from coder#7561 against this stack, and it
reports every deleted entry as stale and nothing new.

Part of test-audit phase 3, workstream P3-3.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high -->
yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Oct 26, 2026
…ion paths (coder#7601)

## Summary
Delete four node/common helpers that only tests called, and move their
tests to the code production runs. All four are in P3-2's
`pendingDeletion` list (coder#7561).

| Deleted | Why it was dead | Tests now |
|---|---|---|
| `src/cli/serverSecurity.ts` (`resolveServerAuthToken`,
`isLoopbackHost`) | Nothing imports the module. `xum server` uses
`serverAuthToken.ts`, an older policy with its own tests. | Deleted with
the module. The live resolver keeps `serverAuthToken.test.ts`. |
| `withReviewStateSection` (`reviewState.ts`) |
`ReviewStateService.importLegacy` imports through deltas. Only two test
doubles called it. | The doubles (`ReviewStateStore.test.ts` and the
story mock) call `assignSection`. |
| `ensureWorkspaceScratchDir` (`workspaceScratchDir.ts`) | Host scratch
dirs come from `ensureScratchDirForSpec`. | The mkdir-failure case moved
to `runtimeScratchDir.test.ts`. The why-comment moved to
`ensureScratchDirForSpec`. The path tests stay on
`getWorkspaceScratchDir`. |
| `buildToolCatalogOverview` (`toolCatalog.ts`) | Production builds the
overview inside `prepareToolSearch`. | The 8 overview assertions read
the `tool_catalog_search` description that `prepareToolSearch` builds
(`advertisedOverview` helper). |

## Kept (P3-2 moves these to `allowed`)
- `computePriorHistoryFingerprint`: the reference implementation that
the async twin's tests compare against.
- `replayFixture.ts` `appendReplayFixtureCompactionBoundary`,
`generateReplayFixtureSession`: the replay golden-fixture harness.
- `PhoneChrome`: the type of the generated `PHONE_CHROME_JSON` skeleton.
Only tests parse that JSON.
- `updateCodeWorkspaceFile`: the unit boundary of the `.code-workspace`
edit algorithm (23 tests). `syncProjectCodeWorkspace` runs the same
`updateCodeWorkspaceFileLocked` under its own lock.

## Validation
I broke the production code for each moved test, ran it, saw it fail,
and restored the code:
- `ensureScratchDirForSpec` host case with a throwing mkdir: the moved
failure test fails.
- In `buildOverview`/`groupCatalogByServer`: the "other tools" label,
the ", and more" suffix, the total budget, the name sort, and the label
clamp. Each mutant fails at least one overview test.

`make typecheck`, `make lint-eslint`, `fmt-check` and
`check-test-routing` pass. P3-2's checker passes on this stack once the
stale entries are removed. Only the four kept items above (five entries)
stay.

Part of test-audit phase 3, workstream P3-3.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high -->
yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Oct 26, 2026
## Summary

Deletes eight browser exports that only tests called, plus two story
helpers that nothing calls. The tests now go through the code that
production runs. No app behavior changes.

## Background

coder#7561 (P3-2) adds `check-test-only-exports` and lists these symbols
under `pendingDeletion` with owner P3-4 (frontend test audit). This PR
clears every P3-4 entry except `DraftAttachmentMatchesChatAttachment`
(see below).

| Export | Why it was dead | What the test does now |
| --- | --- | --- |
| `GoalsSection` | Settings never mounts it. Only its child
`GoalDefaultsControls` ships (in `GoalDefaultsSection`). | Renders
`GoalDefaultsControls`, the same inputs. |
| `highlightDiffChunk` | One-chunk wrapper. `DiffRenderer` calls
`highlightDiffChunks`. | A local helper calls
`highlightDiffChunks([chunk])` and asserts one result. |
| `migrateWorkspaceStorage` | coder#6620 removed its last caller. | Its two
tests guarded only its own "keep the source on failure" branch, so they
go with it. |
| `getSuggestedModels`, `calculateTPS`, `calculateTokenCount`,
`DeltaRecord`, `filterWorkflowDisplayOnlyMessages` | Browser re-exports
of `@/common` functions that only tests imported. | Tests import from
the `@/common` module directly. |
| `textContrastOnBase`, `opaqueBackgroundOwner` (story helpers) | coder#6978
removed their only caller, the project-badge story. | None. |

`DraftAttachmentMatchesChatAttachment` stays: it is a compile-time drift
check. Without `export`, `noUnusedLocals` and `no-unused-vars` both
reject it, so coder#7561 needs to move it to `allowed`.

## Validation

- I ran coder#7561's checker (`scripts/check-test-only-exports.ts` at
f8d1727) on this tree. It reports all eight targeted entries as
stale, which means they are gone.
- The six touched test files pass (92 tests). `make static-check` and
`make crap-check` pass.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high` • Cost: `$36.68`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high
costs=36.68 -->

This branch has not been deployed

No deployments
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