Commit Graph

7 Commits

Author SHA1 Message Date
Giancarmine Salucci
7630740403 feat(TRUEREF-0022): complete iteration 0 — worker-thread indexing, parallel jobs, SSE progress
- Move IndexingPipeline.run() into Worker Threads via WorkerPool
- Add dedicated embedding worker thread with single model instance
- Add stage/stageDetail columns to indexing_jobs schema
- Create ProgressBroadcaster for SSE channel management
- Add SSE endpoints: GET /api/v1/jobs/:id/stream, GET /api/v1/jobs/stream
- Replace UI polling with EventSource on repo detail and admin pages
- Add concurrency settings UI and API endpoint
- Build worker entries separately via esbuild
2026-03-30 17:08:23 +02:00
Giancarmine Salucci
1c5b634ea4 fix(MULTIVERSION-0001): fix multi-version indexing — jobs never created or triggered for secondary versions
Two bugs prevented secondary versions from ever being indexed:

1. JobQueue.enqueue() and RepositoryService.createIndexingJob() deduplication
   only checked repository_id, so a queued default-branch job blocked all
   version-specific jobs for the same repo. Fix: include version_id in the
   WHERE clause so only exact (repository_id, version_id) pairs are deduped.

2. POST /api/v1/libs/:id/versions used repoService.createIndexingJob() which
   inserts a job record but never triggers queue processing. Fix: use
   queue.enqueue() (same fallback pattern as the libs endpoint) so setImmediate
   fires processNext() after the job is inserted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 09:32:27 +01:00
Giancarmine Salucci
781d224adc feat(EMBEDDINGS-0001): enable local embedder by default and overhaul settings page
- Wire local embedding provider as the default on startup when no profile is configured
- Refactor embedding settings into dedicated service, DTOs, mappers and models
- Rebuild settings page with profile management UI and live test feedback
- Expose index summary (indexed versions + embedding count) on repo endpoints
- Harden indexing pipeline and context search with additional test coverage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 09:28:01 +01:00
Giancarmine Salucci
da661efc91 chore(LINT-0001) fix lint errors 2026-03-27 03:01:37 +01:00
Giancarmine Salucci
5a3c27224d chore(FEEDBACK-0001): linting 2026-03-27 02:23:01 +01:00
Giancarmine Salucci
215cadf070 refactor: introduce domain model classes and mapper layer
Replace ad-hoc inline row casting (snake_case → camelCase) spread across
services, routes, and the indexing pipeline with explicit model classes
(Repository, IndexingJob, RepositoryVersion, Snippet, SearchResult) and
dedicated mapper classes that own the DB → domain conversion.

- Add src/lib/server/models/ with typed model classes for all domain entities
- Add src/lib/server/mappers/ with mapper classes per entity
- Remove duplicated RawRow interfaces and inline map functions from
  job-queue, repository.service, indexing.pipeline, and all API routes
- Add dtoJsonResponse helper to standardise JSON responses via SvelteKit json()
- Add api-contract.integration.test.ts as a regression baseline

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 14:29:49 +01:00
Giancarmine Salucci
3d1bef5003 feat(TRUEREF-0002): implement repository management service and REST API
Add RepositoryService with full CRUD, ID resolution helpers, input
validation, six SvelteKit API routes (GET/POST /api/v1/libs,
GET/PATCH/DELETE /api/v1/libs/:id, POST /api/v1/libs/:id/index), and
37 unit tests covering all service operations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:43:06 +01:00