Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ include fmt.mk
.PHONY: storybook storybook-run storybook-build storybook-flake-check test-storybook storybook-budget
.PHONY: benchmark-terminal bench bench-compare test-loop-baseline first-load-js page-timing first-run-view-parity bug-bash mcp-apps-e2e test-stories generate-phone-chrome check-phone-chrome
.PHONY: ensure-deps mux
.PHONY: check-startup-imports check-startup-imports-runtime check-react-compiler check-test-routing check-test-seam-comments test-bench-scripts
.PHONY: check-startup-imports check-startup-imports-runtime check-react-compiler check-test-routing check-test-seam-comments check-test-only-exports test-bench-scripts

# Use the package binary instead of its internal path so native-preview can change wrappers safely.
TSGO := bun run tsgo
Expand Down Expand Up @@ -539,7 +539,7 @@ build/icon.png: docs/img/logo-white.svg scripts/generate-icons.ts
# (.oxlintrc.json, kept in step by check-oxlint-config); static-check-full also runs type-aware
# ESLint on all files, so CI still catches what oxlint cannot check, including type-aware
# findings that a change surfaces in files it did not touch.
STATIC_CHECKS := typecheck fmt-check check-startup-imports check-react-compiler check-code-docs-links check-test-routing check-test-seam-comments check-oxlint-config lint-shellcheck lint-hadolint
STATIC_CHECKS := typecheck fmt-check check-startup-imports check-react-compiler check-code-docs-links check-test-routing check-test-seam-comments check-test-only-exports check-oxlint-config lint-shellcheck lint-hadolint

static-check: lint $(STATIC_CHECKS) ## Run fast local static checks

Expand Down Expand Up @@ -622,6 +622,11 @@ check-test-seam-comments: node_modules/.installed ## Fail when production code g
@bun test ./scripts/check-test-seam-comments.test.ts
@bun scripts/check-test-seam-comments.ts

# ~3 s: fails when a production export under src/ has no non-test reference (see the script).
check-test-only-exports: node_modules/.installed ## Fail when a production export under src/ is unlisted and only tests (or nothing) reference it
@bun test ./scripts/check-test-only-exports.test.ts
@bun scripts/check-test-only-exports.ts

check-bench-agent: node_modules/.installed src/version.ts $(BUILTIN_SKILLS_GENERATED) $(BUILTIN_WORKFLOWS_GENERATED) $(WORKFLOW_RUNTIME_SOURCES_GENERATED) ## Verify terminal-bench agent configuration and imports
@./scripts/check-bench-agent.sh

Expand Down
52 changes: 52 additions & 0 deletions scripts/check-test-only-exports.allowlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"allowed": [
{ "file": "src/browser/contexts/ChatHostContext.tsx", "symbol": "ChatHostContextProvider", "reason": "consumer outside src/: packages/chat-components/src/index.ts re-exports it and vscode/src/webview/App.tsx renders it" },
{ "file": "src/browser/stores/DraftStore.ts", "symbol": "resetDraftStoreForTests", "reason": "module-singleton reset hook named ...ForTests: chatCommands.fork.test.ts; no production caller" },
{ "file": "src/browser/utils/aiSelectionIntent.ts", "symbol": "resetAiSelectionIntentForTests", "reason": "module-singleton reset hook named ...ForTests: aiSelectionIntent.test.ts, chatCommands.test.ts, tests/ui/agents/creationSlashCommands.test.ts, vscode/src/webview/App.test.tsx and the Storybook meta decorator; no production caller" },
{ "file": "src/browser/utils/highlighting/highlightWorkerClient.ts", "symbol": "__pendingWorkerCallCountForTests", "reason": "module-singleton reset hook named ...ForTests: highlightWorkerClient.test.ts (read-only retention witness, #6303); no production caller" },
{ "file": "src/browser/utils/highlighting/highlightWorkerClient.ts", "symbol": "__resetForTests", "reason": "module-singleton reset hook named ...ForTests: highlightWorkerClient.test.ts and HighlightedCode.test.tsx; no production caller" },
{ "file": "src/browser/utils/workspaceStorageGc.ts", "symbol": "resetWorkspaceStorageGcForTests", "reason": "module-singleton reset hook named ...ForTests: workspaceStorageGc.test.ts and WorkspaceContext.test.tsx; no production caller" },
{ "file": "src/common/compat/macPackagedApp.ts", "symbol": "resolveMacPackagedAppNames", "reason": "consumers outside src/: scripts/checkMacAttachFileRuntime.ts and the Makefile's macOS packaging recipe" },
{ "file": "src/common/orpc/schemas/drafts.ts", "symbol": "CreationDraftScope", "reason": "story helper type: the Storybook drafts mock (src/browser/stories/mocks/drafts.ts) types its creation-draft scope with it" },
{ "file": "src/common/orpc/schemas/reviewState.ts", "symbol": "ReviewSchemasMatchTypes", "reason": "compile-time guard: the type fails typecheck when the persisted Review schemas and the shared Review types diverge; it is exported only so no-unused-vars accepts it" },
{ "file": "src/common/utils/sessionTapes/sessionTapeLoader.ts", "symbol": "summarizeSessionTape", "reason": "consumer outside src/: scripts/perf/tapeInfo.ts" },
{ "file": "src/common/utils/tokens/updateModelsData.ts", "symbol": "pruneModelData", "reason": "consumer outside src/: scripts/update_models.ts (the logic lives in src so unit tests cover it)" },
{ "file": "src/common/utils/tokens/updateModelsData.ts", "symbol": "sanitizePricing", "reason": "consumer outside src/: scripts/update_models.ts (the logic lives in src so unit tests cover it)" },
{ "file": "src/common/utils/tokens/updateModelsData.ts", "symbol": "validateModelData", "reason": "consumer outside src/: scripts/update_models.ts (the logic lives in src so unit tests cover it)" },
{ "file": "src/common/utils/tokens/updateModelsData.ts", "symbol": "serializeModelData", "reason": "consumer outside src/: scripts/update_models.ts (the logic lives in src so unit tests cover it)" },
{ "file": "src/constants/layout.ts", "symbol": "MOBILE_TOUCH_TARGET_PX", "reason": "consumer outside src/: .storybook/test-runner.ts checks touch targets with it (globals.css keeps the same value)" },
{ "file": "src/constants/layout.ts", "symbol": "TABLET_TOUCH_TARGET_PX", "reason": "consumer outside src/: .storybook/test-runner.ts checks tablet touch targets with it" },
{ "file": "src/node/runtime/containerCli.ts", "symbol": "resetContainerCliCacheForTests", "reason": "module-singleton reset hook named ...ForTests: containerCli.test.ts; no production caller" },
{ "file": "src/node/services/log.ts", "symbol": "__resetFileSinkForTests", "reason": "module-singleton reset hook named ...ForTests: log.test.ts; no production caller" },
{ "file": "src/node/services/mock/mockAiRouter.ts", "symbol": "buildMockStreamStartGateMessage", "reason": "test-support builder kept next to the mock router's parser of the same gate prompt, so tests/ipc/streaming/queuedMessages.starting.test.ts and tests/ipc/tasks/persistentSubagentCompaction.test.ts cannot drift from the format" },
{ "file": "src/node/services/ptc/staticAnalysis.ts", "symbol": "disposeAnalysisContextForTests", "reason": "module-singleton reset hook named ...ForTests: staticAnalysis.test.ts; no production caller" },
{ "file": "src/node/services/ptc/typeGenerator.ts", "symbol": "clearTypeCacheForTests", "reason": "module-singleton reset hook named ...ForTests: typeGenerator.test.ts; no production caller" },
{ "file": "src/node/utils/concurrency/processLiveness.ts", "symbol": "setSelfIdentityForTests", "reason": "module-singleton reset hook named ...ForTests: crossProcessLock.test.ts; no production caller" },
{ "file": "src/node/utils/extensionMetadata.ts", "symbol": "readExtensionMetadata", "reason": "consumer outside src/: vscode/src/xumConfig.ts" },
{ "file": "src/node/utils/main/bashPath.ts", "symbol": "resetBashPathCacheForTests", "reason": "module-singleton reset hook named ...ForTests: bashPath.test.ts; no production caller" },
{ "file": "src/node/utils/main/tokenizer.ts", "symbol": "__resetTokenizerForTests", "reason": "module-singleton reset hook named ...ForTests: tokenizer.test.ts and tokenizerWarmModels.test.ts; no production caller" },
{ "file": "src/vite/devServerEnv.ts", "symbol": "resolveViteDevServerEnv", "reason": "consumer outside src/: vite.config.ts" },
{ "file": "src/vite/novncCompatPlugin.ts", "symbol": "novncCompatPlugin", "reason": "consumer outside src/: vite.config.ts" },
{ "file": "src/vite/reactCompilerConfig.ts", "symbol": "reactCompilerConfig", "reason": "consumers outside src/: vite.config.ts and scripts/check_react_compiler_coverage.ts" },
{ "file": "src/vite/streamdownRehypeKatexPlugin.ts", "symbol": "streamdownRehypeKatexPlugin", "reason": "consumer outside src/: vite.config.ts" },
{ "file": "src/vite/streamdownShikiLangsPlugin.ts", "symbol": "streamdownShikiLangsPlugin", "reason": "consumer outside src/: vite.config.ts" },
{ "file": "src/common/orpc/onChatCursorFingerprint.ts", "symbol": "computePriorHistoryFingerprint", "reason": "reference implementation: the tests of computePriorHistoryFingerprintAsync (production) require the same result for every input" },
{ "file": "src/node/services/replay/replayFixture.ts", "symbol": "appendReplayFixtureCompactionBoundary", "reason": "test-support: the replay golden-fixture harness" },
{ "file": "src/node/services/replay/replayFixture.ts", "symbol": "generateReplayFixtureSession", "reason": "test-support: the replay golden-fixture harness" },
{ "file": "src/common/staticWorkspaceView/phoneChrome.ts", "symbol": "PhoneChrome", "reason": "test-support type: it types the generated PHONE_CHROME_JSON skeleton, which only tests parse" },
{ "file": "src/node/worktree/codeWorkspaceSync.ts", "symbol": "updateCodeWorkspaceFile", "reason": "unit boundary of the .code-workspace edit algorithm (23 tests); syncProjectCodeWorkspace runs the same updateCodeWorkspaceFileLocked under its own lock" }
],
"pendingDeletion": [
{ "file": "src/browser/features/RightSidebar/ArtifactsTab/artifactDocument.ts", "symbol": "buildSandboxedHtmlDocument", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/features/Settings/Sections/GoalsSection.tsx", "symbol": "GoalsSection", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/hooks/useModelsFromSettings.ts", "symbol": "getSuggestedModels", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/stores/DraftStore.ts", "symbol": "DraftAttachmentMatchesChatAttachment", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/utils/highlighting/highlightDiffChunk.ts", "symbol": "highlightDiffChunk", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/utils/messages/StreamingTPSCalculator.ts", "symbol": "calculateTPS", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/utils/messages/StreamingTPSCalculator.ts", "symbol": "calculateTokenCount", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/utils/messages/StreamingTPSCalculator.ts", "symbol": "DeltaRecord", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/utils/rightSidebarLayout.ts", "symbol": "addToolToFocusedTabset", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/utils/workflowRunMessages.ts", "symbol": "filterWorkflowDisplayOnlyMessages", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" },
{ "file": "src/browser/utils/workspaceStorage.ts", "symbol": "migrateWorkspaceStorage", "owner": "P3-4 (test-audit phase 3, frontend)", "reason": "no non-test reference at 7d2498b1d0 (2026-10-26 audit); the owner deletes it, or moves it to \"allowed\" with a reason" }
]
}
Loading
Loading