Commit e02cffe
Remove unused files in @kbn/ai-assistant (dead code cleanup) (#266814)
## Summary
Removes **4 unused source files** (183 LoC) from `@kbn/ai-assistant`,
owned by `@elastic/unknown`. All verified to have **zero static
importers** anywhere in the repo.
This is one slice of a broader sweep across the codebase removing **399
files / 18.5k LoC** of dead code. Co-PRs cover the other ~28 teams'
slices. The methodology is in #266635 (skill PR).
## Files removed
See the diff. Removals span the package — common shapes include:
- Orphan barrel `index.ts` files where consumers consistently
deep-import the sibling modules directly.
- Dead React components, hooks, route handlers, or test helpers no
longer referenced anywhere.
## Verification
For every file:
1. **`knip` flagged it as unreachable** from the package's declared
entry points (`server/index.ts`, `public/index.ts`, `common/index.ts`,
plus deep-import-derived entries).
2. **Resolve-aware import scan** confirmed zero importers across the
repo (Node-style: `<base>.ts`, `<base>.tsx`, `<base>/index.ts`,
`<base>/index.tsx`).
3. **Package-id deep-import grep** for `@kbn/ai-assistant/<sub>`
references from other packages.
4. **`jest.mock()` string scan** for test mocks pointing at the path.
5. **Type-check passes** (`node scripts/type_check --project
x-pack/platform/packages/shared/kbn-ai-assistant/tsconfig.json`).
## Patterns observed (for context)
The most common dead-code shapes in this slice:
- **Orphan barrel `index.ts`** that re-exports from siblings — the
commonest shape across the cleanup.
- Other patterns vary by package (dead React components, dead route
handlers, dead test fixtures).
The full pattern catalog (across all teams) is in #266635.
🤖 Generated by an AI agent following a verification recipe at
`.agents/skills/dead-code-cleanup/SKILL.md` (PR #266635).
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent ee4a823 commit e02cffe
8 files changed
Lines changed: 0 additions & 203 deletions
File tree
- x-pack/platform
- plugins/private/translations/translations
Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11643 | 11643 | | |
11644 | 11644 | | |
11645 | 11645 | | |
11646 | | - | |
11647 | 11646 | | |
11648 | 11647 | | |
11649 | 11648 | | |
11650 | 11649 | | |
11651 | | - | |
11652 | | - | |
11653 | 11650 | | |
11654 | 11651 | | |
11655 | 11652 | | |
| |||
11731 | 11728 | | |
11732 | 11729 | | |
11733 | 11730 | | |
11734 | | - | |
11735 | | - | |
11736 | 11731 | | |
11737 | 11732 | | |
11738 | 11733 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11618 | 11618 | | |
11619 | 11619 | | |
11620 | 11620 | | |
11621 | | - | |
11622 | 11621 | | |
11623 | 11622 | | |
11624 | 11623 | | |
11625 | 11624 | | |
11626 | | - | |
11627 | | - | |
11628 | 11625 | | |
11629 | 11626 | | |
11630 | 11627 | | |
| |||
11706 | 11703 | | |
11707 | 11704 | | |
11708 | 11705 | | |
11709 | | - | |
11710 | | - | |
11711 | 11706 | | |
11712 | 11707 | | |
11713 | 11708 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11671 | 11671 | | |
11672 | 11672 | | |
11673 | 11673 | | |
11674 | | - | |
11675 | 11674 | | |
11676 | 11675 | | |
11677 | 11676 | | |
11678 | 11677 | | |
11679 | | - | |
11680 | | - | |
11681 | 11678 | | |
11682 | 11679 | | |
11683 | 11680 | | |
| |||
11759 | 11756 | | |
11760 | 11757 | | |
11761 | 11758 | | |
11762 | | - | |
11763 | | - | |
11764 | 11759 | | |
11765 | 11760 | | |
11766 | 11761 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11669 | 11669 | | |
11670 | 11670 | | |
11671 | 11671 | | |
11672 | | - | |
11673 | 11672 | | |
11674 | 11673 | | |
11675 | 11674 | | |
11676 | 11675 | | |
11677 | | - | |
11678 | | - | |
11679 | 11676 | | |
11680 | 11677 | | |
11681 | 11678 | | |
| |||
11757 | 11754 | | |
11758 | 11755 | | |
11759 | 11756 | | |
11760 | | - | |
11761 | | - | |
11762 | 11757 | | |
11763 | 11758 | | |
11764 | 11759 | | |
| |||
0 commit comments