chore: remove dead code and sync the specs that described it - #8804
Merged
Merged
Conversation
Knip (production and comprehensive modes) over apps/* and libs/* surfaced code with no callers. Removed what verification confirmed dead, and updated the OpenSpec specs that still described it. Removed from apps/chat: - FileTypeIcon, collect-stream, server-api/models.ts (and the modelsApi singleton it was the only consumer of), rate.api.ts and its spec - OperationLoaderModal and UploadProgressModal with their specs: stale copies of components that now live in libs/chat-shared/src/file-manager. The app copies had already drifted behind (missing mobile:!w-full) while their tests duplicated the lib's own, so no coverage is lost. Removed from apps/chat-api: - list-items-debug, PinConversationDto (absent from the OpenAPI spec), and the ManagedConfigProvider placeholder, which threw when resolved and was never registered. The composite provider's comment now says "(future)" rather than pointing at a stub file. Specs updated in the same change: - model-listing, model-lookup: dropped the frontend server-api helper requirements. The endpoints stay and remain specified; a note records that apps/chat reads model metadata through deploymentsApi instead. - generated-api-client-integration: dropped the models domain requirement and modelsApi from the required api-client exports - applications-listing, unified-catalog: modelsApi replaced as the example - chat-hooks-domain-utilities: collect-stream.ts dropped from the list of files the change must not modify useThemeOptions is deliberately kept with no callers: openspec/changes/add-settings-preferences-tab requires it to survive as the parked theme row's entry point. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PolinaGurinovich97
requested review from
Alexander-Kezik,
hhharmEpm,
stropalov and
valerydluski
as code owners
September 14, 2026 21:56
|
✅ security-review: Dead-code removal PR. No new attack surface introduced; several security-relevant patterns improved or removed cleanly. |
|
Second pass over the same audit. Each removal was verified by hand rather than taken from the tool: the server-api wrappers each showed exactly two mentions in the tree — their own declaration and a call to the identically named method on the generated client, which is a different symbol. apps/chat/src/server-api: - del (base.ts), getConversationMetadata and deleteConversations (conversations.api.ts), createShareLink (share.api.ts), getUserLimits (user-limits.ts), plus the type imports left unused by those removals. Sibling wrappers in the same files stay; only the uncalled ones go. apps/chat/src/i18n/config.ts: - export default i18n. main.tsx imports the module for its side effect only, so the default binding had no reader. apps/chat-api: - ConfigValueType, which nothing referenced. libs/quotations, libs/conversation-input: - the duplicate `export default memo(X)` on CitationCard, CitationMarker, CitationDropdown and ChatSettingsModal, with the now-unused memo import. Each barrel re-exports the named binding only, so the default was unreachable from the package entry and no consumer can be relying on it. SaveSuccessMessage is left in place despite having no code reference: it is the only written record of the QuickApps iframe's SaveSuccess payload contract, and three JSDoc blocks point at it. Typing the parse site with it would be a better fix than deleting it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`FeedbackCategory` had no reference anywhere in the tree — only its own declaration. Callers work with `FEEDBACK_CATEGORIES` directly, which stays. Found by re-running the dead-code classification so that member-access occurrences (`someApi.name`) no longer count as references to a same-named local symbol; the earlier pass read the `FEEDBACK_CATEGORIES` mention on the declaration line as a use and hid this one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
) Two drift classes that nothing checked, both of which had already reached the main line: - One external declared at several ranges. `@epam/ai-dial-ui-kit` sat at `^0.14.0-dev.15`, `-dev.30` and `-dev.37` at once and `react` at `^19.0.0`, `^19.2.6` and `^19.2.7` — each lib pinning whatever the dependency was when it was scaffolded, not what it needs. A host installs one copy regardless, so the spread either agrees by luck or sends the host back to a `resolutions` pin. - A README citing a range its manifest no longer declares. That number is what a host copies, and `chat-hooks` advertised `@epam/pdf-highlighter-kit ^0.0.18` and `react-file-manager ^0.2.0-dev.10` after both manifests had moved on. Siblings under `libs/` stay exempt from the first check for the same reason they are exempt from the upper-bound one: their spec is a placeholder `publish-lib.mjs` rewrites to the release version. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… it (Issue #8719) `settings-panel` and `usage-dashboard` were scaffolded without the `@nx/dependency-checks` block every other lib carries, so nothing verified that what they import is what they declare — the mechanism behind the issue's first acceptance criterion. Enabling it immediately flagged `settings-panel`'s `@epam/ai-dial-ui-kit` peer as unused. The peer is real: the panel applies the kit's `dial-h1-text` / `dial-small-text` typography classes, which arrive through its stylesheet rather than an import the rule can see. Recorded that as an ignore with the reason instead of dropping a peer a host genuinely needs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Neither failure could happen on the Linux CI runners, so both sat unnoticed
while the packaging guards they block are exactly what an embedding host
depends on.
- `assertCoherentTarballs` handed `tar` an absolute path. GNU tar reads the
drive letter as a remote host ("Cannot connect to C: resolve failed").
Naming the archive relative to its own directory works on GNU and bsdtar
alike; `--force-local` would not, macOS having no such flag.
- npm resolves a `file:` dependency spec without percent-decoding it, while
`pathToFileURL` encodes `~` as `%7E`. On Windows `os.tmpdir()` is an 8.3
short path (`C:\Users\PALINA~1\...`) once the profile name is long enough,
so every fixture installed nothing and died with ENOENT on a path
containing `%7E`. Only `realpathSync.native` expands a short name — the JS
variant resolves symlinks and junctions but leaves `PALINA~1` alone — so
the temp root now comes from one `createTmpRoot` helper that all seven
fixture entry points share.
With both fixed, `publish:lib:coherent-release-test` passes locally: 2/2.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Knip (production + comprehensive modes) over
apps/*andlibs/*surfaced code with no callers. This removes what verification confirmed dead and updates the OpenSpec specs that still described it. No behaviour change — nothing removed here had a caller.Removed from
apps/chatFileTypeIcon,collect-stream,server-api/models.ts(and themodelsApisingleton it was the only consumer of),rate.api.tsand its specOperationLoaderModalandUploadProgressModalwith their specs — stale copies of components that now live inlibs/chat-shared/src/file-manager. The app copies had already drifted behind (missingmobile:!w-full), so the risk was someone fixing the dead copy. Their tests duplicated the lib's own line for line, so no coverage is lost.Removed from
apps/chat-apilist-items-debug,PinConversationDto(absent from the OpenAPI spec — the pin flow goes throughconversation-lifecycle.service.ts), and theManagedConfigProviderplaceholder, which threw when resolved and was never registered. The composite provider's comment now reads "(future)" instead of pointing at a stub file that no longer exists.Kept deliberately
useThemeOptionshas zero callers but stays:openspec/changes/add-settings-preferences-tabrequires it to survive as the parked theme row's entry point, anddocs/architecture.mddocuments it.Spec updates in the same change
model-listing,model-lookup— dropped the frontend server-api helper requirements. The endpoints themselves stay and remain fully specified; a note in eachPurposerecords thatapps/chatreads model metadata throughdeploymentsApiinstead, so nobody removes a live endpoint as unused or restores the helper as missing.generated-api-client-integration— dropped the models domain requirement andmodelsApifrom the requiredapi-client.tsexportsapplications-listing,unified-catalog—modelsApireplaced as the "follow this pattern" examplechat-hooks-domain-utilities—collect-stream.tsdropped from the list of files that must not be modifiedApplicable issues
No linked issue — this came out of a dead-code audit. Happy to add one if you'd like it tracked.
UI changes
None.
Verification
nx typecheck lint -p chat chat-api— chat green on both; chat-api lint greennx test chat-api— 189 files, 3194 tests, all passnx test chat— 157/158 files pass; the one failure (SkillEditorPreview"unrecognized text extension") is a pre-existing flake that times out only under the parallel run and passes in isolation, with no import path to anything removed herenpm run validate:docs— passeschat-api:typecheckreports 767 errors, identical on a cleanorigin/developmentcheckout — a pre-existingtsconfig.spec.json/ project-reference condition unrelated to this changeChecklist
🤖 Generated with Claude Code