chore: fix TypeScript + ESLint no-redeclare + add CI workflow - #4
Merged
Conversation
Brings `npm run type-check` and `npm run build --workspaces` to a clean
state from ~16 long-standing TS errors, updates the ESLint config so
the TS value+type-namespace enum-like pattern stops flagging as
redeclares, and wires a CI workflow for the repo (which previously had
no .github/workflows/ at all).
Type-check fixes:
- MarkdownMemoryStore.parseMarkdown: narrow `currentSection` to the
`ListSection` union so indexing `ctx[currentSection]` is type-safe
without casting.
- SkillScanner: drop a bogus `as const` on an enum reference.
- Qdrant CollectionManager/SearchEngine/VectorOperations: align with
the qdrant-js 1.15.1 API surface —
- `optimizer_config` → `optimizers_config` in createCollection
- `getCollection` no longer returns `name`; use caller-supplied
collectionName; widen status ("grey" → "red") and optimizer_status
({error:string} → "error") to match our stricter CollectionInfo
schema; map response.config defensively through optional fields
- `createAlias` / `deleteAlias` removed from QdrantClient; rewrite
to use `updateCollectionAliases({actions: [{create_alias|delete_alias}]})`
- `search({vector: {id}})` no longer supported; implement
`searchByPointId` as retrieve-then-search
- `recommend` positive/negative now take IDs directly
(`string | number` or raw vectors), not `{id}` wrappers
- `discover` renamed to `discoverPoints`; flatten context pairs;
target accepted bare
- VectorOperations.getPoint/scrollPoints: narrow `point.id` through
String(), `point.vector` through Array.isArray, and cast payload
through `Record<string,unknown>|undefined`; stringify
`next_page_offset` when present
All existing qdrant unit tests updated to match new mock call shapes
(CollectionManager alias/getInfo; SearchEngine searchByPointId/recommend/discover).
Tests: 1082/1082 pass across 35 files.
ESLint config:
- Add jest globals (expect/test/describe/beforeEach) plus NodeJS and
BufferEncoding type globals, bringing ESLint error count from ~130 to
~43 (remaining are pre-existing unused-imports and no-case-declarations
out of scope for this change).
- Turn off `no-redeclare` and `@typescript-eslint/no-redeclare` in TS
files — TypeScript already catches actual redeclares at compile
time, and both rules false-positive on the standard value+type
enum-like pattern used in @symbi/types (`export const X = {...} as
const; export type X = typeof X[keyof typeof X]`).
CI workflow (.github/workflows/ci.yml):
- Matrix on Node 18/20/22
- Install → build workspaces → type-check → lint (non-blocking while
pre-existing lint debt is cleaned up incrementally) → vitest
- Second job builds and uploads per-package tarball artifacts for
every PR, so reviewers can spot publish-shape regressions
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.
Summary
Brings `npm run type-check`, `npm run build --workspaces`, and a new `.github/workflows/ci.yml` to a clean, green state. Fixes 16 long-standing TypeScript errors, unblocks the ESLint `no-redeclare` false-positive on the `@symbi/types` enum-like pattern, and wires CI for the repo (which had no workflows at all).
TypeScript fixes
`MarkdownMemoryStore` (1 error)
Narrow `currentSection` to the `'facts' | 'procedures' | 'learned_patterns'` union so indexing `ctx[currentSection]` is type-safe without casting.
`SkillScanner` (1 error)
Drop a bogus `as const` on an enum member reference.
Qdrant client (13 errors)
Align `CollectionManager`, `SearchEngine`, and `VectorOperations` with the qdrant-js 1.15.1 API surface:
All existing qdrant unit tests updated to match the new mock call shapes.
ESLint fixes
Add jest globals (`expect`, `test`, `describe`, `beforeEach`) plus `NodeJS` and `BufferEncoding` type globals. Brings error count from ~130 to ~43.
Turn off both `no-redeclare` and `@typescript-eslint/no-redeclare` in TS files. TypeScript already catches real redeclares at compile time, and both rules false-positive on the value+type enum-like pattern used throughout `@symbi/types`:
```ts
export const WebhookProviderType = { ... } as const;
export type WebhookProviderType = typeof WebhookProviderType[keyof typeof WebhookProviderType];
```
Remaining 43 lint errors are pre-existing unused-imports and `no-case-declarations` in CLI / tests — out of scope for this change, tracked as incremental cleanup.
CI workflow
New `.github/workflows/ci.yml`:
Test plan