Skip to content

[Task]: run knip:production in verify #88

Open

Description

@PerfectPan

Problem

CI runs knip since #84 (through pnpm verify), but not the production analysis. lint-config's README asks for both, because they answer different questions: knip counts a use in a test as a use, while knip --production follows only the production entries, so a file or export that only tests reach shows up only there.

On main (2026-11-18), knip --production exits 1: 4 unused files, 93 unused exports, 16 unused exported types. The knip:production script already exists; #84 left it out of verify because it fails.

pnpm knip:production on main
Unused files (4)
src/integrations/deepseek/provider.ts
src/integrations/doubao/provider.ts
src/integrations/github/repository/mapper.ts
src/integrations/grok/provider.ts
Unused exports (93)
GrokProcess  class  src/acquisition/application/ports.ts:82:14
fallbackTriggerCodes  src/acquisition/application/services/with-fallback.ts:41:14
retryDelayMs  function  src/acquisition/application/services/with-retry.ts:18:17
retryEffect  function  src/acquisition/application/services/with-retry.ts:43:17
searchWithRetry  function  src/acquisition/application/services/with-retry.ts:83:17
cacheKeyMaterial  src/acquisition/domain/budget/index.ts:5:3
cacheKeyMaterial  function  src/acquisition/domain/budget/value-objects/budget.ts:42:17
parseFeedSubscriptions  src/acquisition/domain/source/index.ts:10:3
parseIndustrySources  src/acquisition/domain/source/index.ts:11:3
parseFeedSubscriptions  src/acquisition/index.ts:18:31
parseIndustrySources  src/acquisition/index.ts:18:55
writeGithubHomeHelp  function  src/app/cli/github-home.ts:14:17
packageAsset  function  src/app/config/assets.ts:11:17
optionalString  function  src/app/config/parse.ts:47:17
requireBoundedInteger  function  src/app/config/parse.ts:64:17
requireBoundedNumber  function  src/app/config/parse.ts:81:17
requireStringList  function  src/app/config/parse.ts:115:17
deploymentStateRoot  function  src/app/config/state-root.ts:17:17
dailyAiDiagnosticsDir  function  src/app/config/state-root.ts:22:17
AcquisitionLive  function  src/app/layers.ts:124:17
AppLive  function  src/app/layers.ts:165:17
appLiveOptions  function  src/app/layers.ts:173:17
AllNewsQueriesFailedError  class  src/app/products/news/flow.ts:82:14
resolveNewsEditionWindow  function  src/app/products/news/flow.ts:124:17
parseNewsTopics  function  src/app/products/news/topics.ts:131:17
parseResearchSuggestions  function  src/app/products/research/cli.ts:44:17
candidateIdentity  src/app/products/subscriptions/output.ts:85:10
markCandidateResearched  function  src/app/products/subscriptions/output.ts:88:17
renderAutomationPresentation  function  src/app/render/automation.ts:176:17
candidateCopy  function  src/app/render/layouts/candidate.ts:48:17
formatStarCount  src/app/render/markdown.ts:8:14
commitDailyAiDeliveryReceipt  src/delivery/domain/receipt/index.ts:2:3
commitDailyAiDeliveryReceipt  function  src/delivery/domain/receipt/value-objects/daily-ai-receipt.ts:27:23
createEmptyFeedState  src/delivery/index.ts:14:3
NotifierLive  src/delivery/index.ts:37:10
saveFeedState  src/delivery/index.ts:38:25
FeedStateFileLive  src/delivery/index.ts:38:40
listRunArtifacts  src/delivery/index.ts:40:3
loadRunArtifact  src/delivery/index.ts:41:3
runArtifactLabel  src/delivery/index.ts:42:3
saveRunArtifact  src/delivery/index.ts:43:3
RunArchiveFilesLive  src/delivery/index.ts:44:3
saveFeedState  function  src/delivery/infra/repository/feed-state-file.ts:20:17
saveRunArtifact  function  src/delivery/infra/repository/run-archive-files.ts:11:17
listRunArtifacts  function  src/delivery/infra/repository/run-archive-files.ts:29:17
loadRunArtifact  function  src/delivery/infra/repository/run-archive-files.ts:40:17
runArtifactLabel  function  src/delivery/infra/repository/run-archive-files.ts:44:17
validateEditorialDraft  src/editorial/domain/daily-ai/index.ts:1:10
validateSubscriptionEditorialDraft  src/editorial/domain/evidence/index.ts:4:3
buildNewsStories  function  src/editorial/domain/news/policies/news-funnel.ts:198:17
selectNewsStories  function  src/editorial/domain/news/policies/news-funnel.ts:253:17
presentationDepthForCandidate  src/editorial/domain/subscription/index.ts:3:3
presentationDepthForCandidate  function  src/editorial/domain/subscription/policies/presentation.ts:75:17
validateEditorialDraft  src/editorial/index.ts:7:3
validateSubscriptionEditorialDraft  src/editorial/index.ts:12:3
presentationDecisionForCandidate  src/editorial/index.ts:19:3
presentationDepthForCandidate  src/editorial/index.ts:20:3
validateDeepSeekInput  function  src/integrations/deepseek/client.ts:21:17
deepSeekOutgoingQuery  function  src/integrations/deepseek/client.ts:38:17
credibilityForAuthority  function  src/integrations/deepseek/mapper.ts:11:17
validateDoubaoInput  function  src/integrations/doubao/client.ts:21:17
DoubaoSearchError  src/integrations/doubao/index.ts:2:10
credibilityForAuthLevel  function  src/integrations/doubao/mapper.ts:9:17
githubHeaders  src/integrations/github/client.ts:13:14
normalizeEvent  function  src/integrations/github/event/dto.ts:109:17
readConduitSnapshots  function  src/integrations/github/home-browser.ts:116:17
readRenderedSnapshots  function  src/integrations/github/home-browser.ts:144:17
hasGitHubHomeFeedMarkup  function  src/integrations/github/home/dto.ts:100:17
normalizeHomeCardSnapshot  function  src/integrations/github/home/mapper.ts:150:17
acquireHomeCard  function  src/integrations/github/home/mapper.ts:175:17
githubHeaders  src/integrations/github/index.ts:1:10
normalizeEvent  src/integrations/github/index.ts:3:10
GlmSearchLive  src/integrations/glm/search/provider.ts:81:14
errorAudit  function  src/integrations/grok/audit.ts:12:17
withPageAudit  function  src/integrations/grok/audit.ts:16:17
clonePageAudit  function  src/integrations/grok/audit.ts:20:17
isNativeCall  function  src/integrations/grok/search/dto.ts:34:17
isNativeReceipt  function  src/integrations/grok/search/dto.ts:46:17
rssHeaders  src/integrations/rss/client.ts:9:14
rssHeaders  src/integrations/rss/index.ts:1:10
rssPublicationType  function  src/integrations/rss/mapper.ts:28:17
parseFeed  function  src/integrations/rss/mapper.ts:159:17
publicationAcquired  src/integrations/shared/index.ts:1:10
acquireActivityCard  src/integrations/shared/index.ts:2:10
projectActivity  src/integrations/shared/index.ts:2:52
projectActivity  function  src/integrations/shared/scoring-trace.ts:131:17
searchProviderLayer  function  src/integrations/shared/search-plumbing.ts:68:17
webHeaders  src/integrations/web-page/client.ts:10:14
webHeaders  src/integrations/web-page/index.ts:1:10
acquireWebPage  function  src/integrations/web-page/mapper.ts:25:17
isOk  function  src/kernel/result.ts:11:17
isPrivateIpv4  function  src/reading/domain/document/policies/url-policy.ts:1:17
documentMethods  src/reading/domain/document/value-objects/document.ts:1:14
Unused exported types (16)
OpenSearchBudget  type  src/acquisition/application/use-cases/collect-x-posts.ts:60:13
NewsSearchPage  type  src/acquisition/domain/search/index.ts:7:3
NewsSearchResult  type  src/acquisition/domain/search/index.ts:8:3
NewsSearchResult  type  src/acquisition/domain/search/value-objects/search.ts:123:13
NewsSearchPage  type  src/acquisition/domain/search/value-objects/search.ts:124:13
NewsSearchResult  type  src/acquisition/index.ts:43:8
SearchUsage  type  src/acquisition/index.ts:47:8
AcquisitionOptions  type  src/app/layers.ts:114:13
AppLiveOptions  type  src/app/layers.ts:154:13
NewsBriefEdition  type  src/app/products/news/flow.ts:51:15
RivusNewsBriefInput  type  src/app/products/news/flow.ts:53:13
CandidateCopy  type  src/app/render/layouts/candidate.ts:9:13
CandidateCopyOptions  type  src/app/render/layouts/candidate.ts:18:13
RunDelivery  type  src/delivery/index.ts:21:30
DailyAiDiagnosticSnapshot  type  src/delivery/index.ts:27:8
Document  type  src/reading/domain/document/value-objects/document.ts:26:13

Proposed Solution

  1. Mark the production entry and project patterns in the Knip config with Knip's ! suffix, so test support, fixtures, and test-only code stay out of the production analysis.
  2. For each finding left, delete the file, export, or dependency; for an export kept on purpose for tests, tag it @internal (Knip ignores @internal exports in production mode).
  3. Add pnpm knip:production to verify after pnpm knip, update the two tests that pin the verify string (tests/repo/ci-harness.test.ts, tests/repo/package-bin.test.ts), and list it wherever ci(checks): run Knip during verification #84 listed knip.

Acceptance Criteria

  • knip --production exits 0 on the PR and in CI, and CI runs it on every PR.
  • The PR explains each ! pattern and @internal tag it adds.

Activity

  1. added
    taskMaintenance, refactoring, dependency, or tooling work
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskMaintenance, refactoring, dependency, or tooling work

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions