30 KiB
30 KiB
Findings
Last Updated: 2026-04-01T12:05:23.000Z
Initializer Summary
- JIRA: TRUEREF-0023
- Refresh mode: REFRESH_IF_REQUIRED
- Result: Refreshed ARCHITECTURE.md and FINDINGS.md. CODE_STYLE.md remained trusted — sqlite-vec, worker-status, and write-worker additions follow the established conventions already documented.
Research Performed
- Counted 149 TypeScript/JavaScript source files in the repository-wide scan and verified the live, non-generated source mix as 147
.tsfiles and 2.jsfiles. - Read
package.json,.prettierrc, andeslint.config.jsto verify dependencies, formatting rules, and linting conventions. - Read
sqlite-vec.ts,sqlite-vec.store.ts,vector.search.ts,hybrid.search.service.ts,schema.ts,client.ts, and startup wiring to verify the accepted sqlite-vec implementation and current retrieval architecture. - Read
worker-pool.ts,worker-types.ts,write-worker-entry.ts, and/api/v1/workers/+server.tsto verify the current worker topology and status surface. - Compared
docs/docs_cache_state.yamlagainst the live docs and codebase to identify stale cache evidence and architecture drift. - Confirmed
CODE_STYLE.mdstill matches the codebase: tabs, single quotes,trailingComma: none, ESM imports withnode:built-ins, flat ESLint config, and descriptive PascalCase/camelCase naming remain consistent.
Open Questions For Planner
- Verify whether the write-worker protocol should become part of the active indexing flow or remain documented as optional infrastructure only.
- Verify whether worker-status and SSE event payloads should be documented in a dedicated API reference for external consumers.
- Verify whether sqlite-vec operational details such as per-profile vec-table lifecycle and backfill behavior should move into a separate persistence document if the subsystem grows further.
- Assess whether the WorkerPool fallback mode (main-thread execution when worker scripts are missing) still belongs in the runtime contract or should be removed in favour of a hard build requirement.
Planner Notes Template
Add subsequent research below this section.
Entry Template
- Date:
- Task:
- Files inspected:
- Findings:
- Risks / follow-ups:
2026-04-01 — TRUEREF-0023 initializer refresh audit
- Task: Refresh only stale or invalid documentation after the accepted sqlite-vec implementation.
- Files inspected:
docs/docs_cache_state.yamldocs/ARCHITECTURE.mddocs/CODE_STYLE.mddocs/FINDINGS.mdpackage.json.prettierrceslint.config.jssrc/hooks.server.tssrc/lib/server/db/client.tssrc/lib/server/db/schema.tssrc/lib/server/db/sqlite-vec.tssrc/lib/server/search/sqlite-vec.store.tssrc/lib/server/search/vector.search.tssrc/lib/server/search/hybrid.search.service.tssrc/lib/server/pipeline/startup.tssrc/lib/server/pipeline/worker-pool.tssrc/lib/server/pipeline/worker-types.tssrc/lib/server/pipeline/write-worker-entry.tssrc/routes/api/v1/workers/+server.tsscripts/build-workers.mjs
- Findings:
- The trusted cache metadata was no longer reliable as evidence for planning:
docs/docs_cache_state.yamlstill referenced 2026-03-27 hashes whileARCHITECTURE.mdandFINDINGS.mdhad been edited later. ARCHITECTURE.mdwas stale. It still described only parse and embed worker concurrency, omitted thesqlite-vecproduction dependency, and did not document the current per-profile vec-table storage layer, worker-status endpoint, or write-worker infrastructure.- The current retrieval stack uses sqlite-vec concretely:
loadSqliteVec()bootstraps connections,SqliteVecStoremanages vec0 tables plus rowid mapping tables, andVectorSearchdelegates nearest-neighbor lookup to that store instead of brute-force scoring. - The worker architecture now includes parse, embed, and write worker protocols in
worker-types.ts, build-time bundling for all three entries, and a/api/v1/workersroute that returnsWorkerPoolstatus snapshots. CODE_STYLE.mdremained valid and did not require refresh. The observed source and config files still use tabs, single quotes,trailingComma: none, flat ESLint config, ESM imports, PascalCase class names, and camelCase helpers exactly as already documented.FINDINGS.mditself was stale because the initializer summary still referred toTRUEREF-0022instead of the requestedTRUEREF-0023refresh.
- The trusted cache metadata was no longer reliable as evidence for planning:
- Risks / follow-ups:
- The write-worker protocol exists and is bundled, but the active indexing path is still centered on parse plus optional embed flow. Future documentation should keep distinguishing implemented infrastructure from the currently exercised path.
- Cache validity should continue to be driven by deterministic hash evidence rather than document timestamps or trust text alone.
2026-03-27 — FEEDBACK-0001 initializer refresh audit
- Task: Refresh only stale documentation after changes to retrieval, formatters, token budgeting, and parser behavior.
- Files inspected:
docs/docs_cache_state.yamldocs/ARCHITECTURE.mddocs/CODE_STYLE.mddocs/FINDINGS.mdpackage.jsonsrc/routes/api/v1/context/+server.tssrc/lib/server/api/formatters.tssrc/lib/server/api/token-budget.tssrc/lib/server/search/query-preprocessor.tssrc/lib/server/search/search.service.tssrc/lib/server/search/hybrid.search.service.tssrc/lib/server/mappers/context-response.mapper.tssrc/lib/server/models/context-response.tssrc/lib/server/models/search-result.tssrc/lib/server/parser/index.tssrc/lib/server/parser/code.parser.tssrc/lib/server/parser/markdown.parser.ts
- Findings:
- The documentation cache was trusted, but the architecture summary no longer captured current retrieval behavior: query preprocessing now sanitizes punctuation-heavy input for FTS5, semantic mode can bypass FTS entirely, and auto or hybrid retrieval can fall back to vector search when keyword search returns no candidates.
- Plain-text and JSON context formatting now carry repository and version metadata, and the text formatter emits an explicit no-results section instead of an empty body.
- Token budgeting now skips individual over-budget snippets and continues evaluating lower-ranked candidates, which changes the response-selection behavior described at the architecture level.
- Parser coverage now explicitly includes Markdown, code, config, HTML-like, and plain-text inputs, so the architecture summary needed to reflect that broader file-type handling.
- The conventions documented in CODE_STYLE.md still match the current repository: strict TypeScript, tab indentation, ESM imports, Prettier and ESLint flat config, and pragmatic service-oriented server modules.
- Risks / follow-ups:
- Future cache invalidation should continue to distinguish between behavioral changes that affect architecture docs and localized implementation changes that do not affect the style guide.
- If the public API contract becomes externally versioned, the new context metadata fields likely deserve a dedicated API document instead of only architecture-level coverage.
2026-03-27 — FEEDBACK-0001 planning research
- Task: Plan the retrieval-fix iteration covering FTS query safety, hybrid fallback, empty-result behavior, result metadata, token budgeting, and parser chunking.
- Files inspected:
package.jsonsrc/routes/api/v1/context/+server.tssrc/lib/server/search/query-preprocessor.tssrc/lib/server/search/search.service.tssrc/lib/server/search/hybrid.search.service.tssrc/lib/server/search/vector.search.tssrc/lib/server/api/token-budget.tssrc/lib/server/api/formatters.tssrc/lib/server/mappers/context-response.mapper.tssrc/lib/server/models/context-response.tssrc/lib/server/models/search-result.tssrc/lib/server/parser/code.parser.tssrc/lib/server/search/search.service.test.tssrc/lib/server/search/hybrid.search.service.test.tssrc/lib/server/api/formatters.test.tssrc/lib/server/parser/code.parser.test.tssrc/routes/api/v1/api-contract.integration.test.tssrc/mcp/tools/query-docs.tssrc/mcp/client.ts
- Findings:
better-sqlite3^12.6.2backs the affected search path; the code already uses bound parameters forMATCH, so the practical fix belongs in query normalization and fallback handling rather than SQL string construction.query-preprocessor.tsonly strips parentheses and appends a trailing wildcard. Other code-like punctuation currently reaches the FTS execution path unsanitized.search.service.tssends the preprocessed text directly tosnippets_fts MATCH ?and already returns[]for blank processed queries.hybrid.search.service.tsalways executes keyword search before semantic branching. In the current flow, an FTS parse failure can abortauto,hybrid, andsemanticrequests before vector retrieval runs.vector.search.tsalready preservesrepositoryId,versionId, andprofileIdfiltering and does not need architectural changes for this iteration.token-budget.tsstops at the first over-budget snippet instead of skipping that item and continuing through later ranked results.formatContextTxt([], [])returns an empty string, so/api/v1/context?type=txtcan emit an empty200 OKbody today.context-response.mapper.tsandcontext-response.tsexpose snippet content and breadcrumb/page title but do not identify local TrueRef origin, repository source metadata, or normalized snippet origin labels.code.parser.tssplits primarily at top-level declarations; class/object member functions remain in coarse chunks, which limits method-level recall for camelCase API queries.- Existing relevant automated coverage is concentrated in the search, formatter, and parser unit tests;
/api/v1/contextcontract coverage currently omits the context endpoint entirely.
- Risks / follow-ups:
- Response-shape changes must be additive because
src/mcp/client.ts,src/mcp/tools/query-docs.ts, and UI consumers expect the current top-level keys to remain present. - Parser improvements should stay inside
parseCodeFile()and existing chunking helpers to avoid turning this fix iteration into a schema or pipeline redesign.
- Response-shape changes must be additive because
2026-03-27 — FEEDBACK-0001 SQLite FTS5 syntax research
- Task: Verify the FTS5 query-grammar constraints that affect punctuation-heavy local search queries.
- Files inspected:
package.jsonsrc/lib/server/search/query-preprocessor.tssrc/lib/server/search/search.service.tssrc/lib/server/search/hybrid.search.service.ts
- Findings:
better-sqlite3is pinned at^12.6.2inpackage.json, and the application binds theMATCHstring as a parameter instead of interpolating SQL directly.- The canonical SQLite FTS5 docs state that barewords may contain letters, digits, underscore, non-ASCII characters, and the substitute character; strings containing other punctuation must be quoted or they become syntax errors in
MATCHexpressions. - The same docs state that prefix search is expressed by placing
*after the token or phrase, not inside quotes, which matches the current trailing-wildcard strategy inquery-preprocessor.ts. - SQLite documents that FTS5 is stricter than FTS3/4 about unrecognized punctuation in query strings, which confirms that code-like user input should be normalized before it reaches
snippets_fts MATCH ?. - Based on the current code path, the practical fix remains application-side sanitization and fallback behavior in
query-preprocessor.tsandhybrid.search.service.ts, not SQL construction changes.
- Risks / follow-ups:
- Over-sanitizing punctuation-heavy inputs could erase useful identifiers, so the implementation should preserve searchable alphanumeric and underscore tokens while discarding grammar-breaking punctuation.
- Prefix expansion should remain on the final searchable token only so the fix preserves current query-cost expectations and test semantics.
2026-03-27 — LINT-0001 planning research
- Task: Plan the lint-fix iteration covering the reported ESLint and eslint-plugin-svelte violations across Svelte UI, SvelteKit routes, server modules, and Vitest suites.
- Files inspected:
package.jsoneslint.config.jsdocs/FINDINGS.mdprompts/LINT-0001/prompt.yamlprompts/LINT-0001/progress.yamlsrc/lib/components/FolderPicker.sveltesrc/lib/components/RepositoryCard.sveltesrc/lib/components/search/SnippetCard.sveltesrc/lib/server/crawler/local.crawler.test.tssrc/lib/server/embeddings/embedding.service.test.tssrc/lib/server/embeddings/local.provider.tssrc/lib/server/embeddings/provider.tssrc/lib/server/embeddings/registry.tssrc/lib/server/models/context-response.tssrc/lib/server/parser/code.parser.tssrc/lib/server/pipeline/indexing.pipeline.tssrc/lib/server/search/hybrid.search.service.test.tssrc/lib/server/search/query-preprocessor.tssrc/lib/server/services/repository.service.test.tssrc/lib/server/services/version.service.test.tssrc/lib/server/services/version.service.tssrc/routes/+layout.sveltesrc/routes/+page.sveltesrc/routes/api/v1/libs/search/+server.tssrc/routes/api/v1/settings/embedding/+server.tssrc/routes/repos/[id]/+page.sveltesrc/routes/search/+page.sveltesrc/routes/settings/+page.svelte
- Findings:
- The project lint stack is ESLint
^9.39.2withtypescript-eslintrecommended rules andeslint-plugin-svelterecommended plus SvelteKit-aware rules, running over Svelte^5.51.0and SvelteKit^2.50.2. - Context7 documentation for
eslint-plugin-svelteconfirmssvelte/no-navigation-without-baseflags root-relative<a href="/...">links andgoto('/...')calls in SvelteKit projects; compliant fixes must use$app/pathsbase-aware links or base-prefixedgotocalls. - Context7 documentation for Svelte 5 confirms event handlers are regular element properties such as
onclick, while side effects belong in$effect; repo memory also records that client-only fetch bootstrap should not be moved indiscriminately into$effectwhenonMountor load is the correct lifecycle boundary. - Concrete navigation violations already exist in
src/routes/+layout.svelte,src/routes/repos/[id]/+page.svelte,src/routes/search/+page.svelte, andsrc/lib/components/RepositoryCard.svelte, each using hard-coded root-relative internal navigation. - Static diagnostics currently expose at least one direct TypeScript lint error in
src/lib/server/embeddings/registry.ts, where_configis defined but never used. src/routes/api/v1/libs/search/+server.tsimportsjsonfrom@sveltejs/kitwithout using it, making that endpoint a concrete unused-import cleanup target.src/lib/server/services/version.service.tsstill uses CommonJSrequire(...)to reach git utilities from TypeScript, which is inconsistent with the repository's ESM style and is a likely lint target under the current ESLint stack.- The affected Svelte pages and settings UI already use Svelte 5 event-property syntax, so the lint work should preserve that syntax and focus on base-aware navigation, lifecycle correctness, and unused-symbol cleanup rather than regressing to legacy
on:directives. - Existing automated coverage for the lint-touching backend areas already lives in
src/lib/server/crawler/local.crawler.test.ts,src/lib/server/embeddings/embedding.service.test.ts,src/lib/server/search/hybrid.search.service.test.ts,src/lib/server/services/repository.service.test.ts, andsrc/lib/server/services/version.service.test.ts; route and component changes rely on build and lint validation rather than dedicated browser tests in this iteration.
- The project lint stack is ESLint
- Risks / follow-ups:
- Base-aware navigation fixes must preserve internal app routing semantics and should not replace intentional external navigation, because SvelteKit
goto(...)no longer accepts external URLs. - Settings and search page lifecycle changes must avoid reintroducing SSR-triggered fetches or self-triggered URL loops; client-only bootstrap logic should remain mounted once and URL-sync effects must stay idempotent.
- Base-aware navigation fixes must preserve internal app routing semantics and should not replace intentional external navigation, because SvelteKit
2026-03-27 — ROUTING-0001 planning research
- Task: Plan the repository-detail routing fix for slash-bearing repository IDs causing homepage SSR failures and invalid
/repos/[id]navigation. - Files inspected:
package.jsonsrc/lib/components/RepositoryCard.sveltesrc/routes/+page.sveltesrc/routes/+page.server.tssrc/routes/repos/[id]/+page.server.tssrc/routes/repos/[id]/+page.sveltesrc/routes/api/v1/api-contract.integration.test.tssrc/lib/types.ts
- Findings:
- The app is on SvelteKit
^2.50.2and uses$app/paths.resolve(...)for internal navigation, includingresolveRoute('/repos/[id]', { id: repo.id })inRepositoryCard.svelte. - SvelteKit’s
[id]route is a single-segment dynamic parameter. Context7 routing docs show slash-containing values belong to rest parameters like[...param], so raw repository IDs containing/are invalid inputs forresolveRoute('/repos/[id]', ...). - The repository model intentionally stores slash-bearing IDs such as
/facebook/react, and the existing API surface consistently treats those IDs as percent-encoded path segments. The integration contract already passesparams.id = encodeURIComponent('/facebook/react')for/api/v1/libs/[id]handlers, which then calldecodeURIComponent(params.id). - The homepage SSR failure is therefore rooted in UI link generation, not repository listing fetches: rendering
RepositoryCard.sveltewith a raw slash-bearingrepo.idcan throw before page load completes, which explains repeated500responses on/. - The repo detail page currently forwards
params.iddirectly intoencodeURIComponent(...)for downstream API requests. Once detail links are generated as encoded single segments, the page loader and client-side refresh/delete/reindex flows need one normalization step so API calls continue targeting the stored repository ID instead of a doubly encoded value. - No existing browser-facing test covers homepage card navigation or
/repos/[id]loader behavior; the closest current evidence is the API contract test file, which already exercises encoded repository IDs on HTTP endpoints and provides reusable fixtures for slash-bearing IDs.
- The app is on SvelteKit
- Risks / follow-ups:
- The fix should preserve the existing
/repos/[id]route shape instead of redesigning it to a rest route unless a broader navigation contract change is explicitly requested. - Any normalization helper introduced for the repo detail page should be reused consistently across server load and client event handlers to avoid mixed encoded and decoded repository IDs during navigation and fetches.
- The fix should preserve the existing
2026-04-01 — TRUEREF-0023 sqlite-vec replanning research
- Task: Replan the rejected libSQL-native vector iteration around sqlite-vec using the current worktree and verified runtime constraints.
- Files inspected:
package.jsondocs/docs_cache_state.yamlprompts/TRUEREF-0023/prompt.yamlprompts/TRUEREF-0023/progress.yamlprompts/TRUEREF-0023/iteration_0/review_report.yamlprompts/TRUEREF-0023/iteration_0/plan.mdprompts/TRUEREF-0023/iteration_0/tasks.yamlsrc/lib/server/db/client.tssrc/lib/server/db/index.tssrc/lib/server/db/schema.tssrc/lib/server/db/fts.sqlsrc/lib/server/db/vectors.sqlsrc/lib/server/db/schema.test.tssrc/lib/server/search/vector.search.tssrc/lib/server/search/hybrid.search.service.test.tssrc/lib/server/embeddings/embedding.service.tssrc/lib/server/embeddings/embedding.service.test.tssrc/lib/server/pipeline/job-queue.tssrc/lib/server/pipeline/progress-broadcaster.tssrc/lib/server/pipeline/progress-broadcaster.test.tssrc/lib/server/pipeline/worker-pool.tssrc/lib/server/pipeline/worker-entry.tssrc/lib/server/pipeline/embed-worker-entry.tssrc/lib/server/pipeline/worker-types.tssrc/lib/server/pipeline/startup.tssrc/lib/server/pipeline/indexing.pipeline.tssrc/lib/server/pipeline/indexing.pipeline.test.tssrc/routes/api/v1/jobs/+server.tssrc/routes/api/v1/jobs/stream/+server.tssrc/routes/api/v1/jobs/[id]/stream/+server.tssrc/routes/api/v1/sse-and-settings.integration.test.tssrc/routes/admin/jobs/+page.sveltesrc/lib/components/IndexingProgress.sveltesrc/lib/components/admin/JobStatusBadge.sveltesrc/lib/components/admin/JobSkeleton.sveltesrc/lib/components/admin/Toast.sveltesrc/lib/components/admin/WorkerStatusPanel.sveltescripts/build-workers.mjsnode_modules/libsql/types/index.d.tsnode_modules/libsql/index.js
- Findings:
- Iteration 0 already changed the workspace materially: direct DB imports were switched from
better-sqlite3tolibsql, the extra WAL-related pragmas were added in the main DB clients and embed worker, composite indexes plusvec_embeddingwere added to the Drizzle schema and migration metadata,IndexingProgress.sveltenow uses SSE, the admin jobs page was overhauled, andWorkerPoolnow serializes on(repositoryId, versionId)instead of repository only. - The rejected vector implementation is still invalid in the current tree.
src/lib/server/db/vectors.sqlcontains the rejected libSQL-native assumptions, including a danglingUSING libsql_vector_idx(...)clause with no validCREATE INDEXstatement, andsrc/lib/server/search/vector.search.tsstill performs full-table JS cosine scoring oversnippet_embeddingsinstead of true in-database KNN. sqlite-vecis not currently present inpackage.jsonor the lockfile, and there is no existingsqliteVec.load(...),db.loadExtension(...),vec0, or extension bootstrap code anywhere undersrc/.- Context7 sqlite-vec docs confirm the supported Node integration path is
import * as sqliteVec from 'sqlite-vec'; sqliteVec.load(db);, storing vectors in avec0virtual table and querying withWHERE embedding MATCH ? ORDER BY distance LIMIT ?. The docs also show vec0 metadata columns can be filtered directly, which fits the repositoryId, versionId, and profileId requirements. - Context7
better-sqlite3v12.6.2 docs confirmdb.loadExtension(path)exists. The installedlibsqlpackage in this workspace also exposesloadExtension(path): thisinnode_modules/libsql/types/index.d.tsandloadExtension(...args)innode_modules/libsql/index.js, so extension loading is not obviously blocked by the driver API surface alone. - The review report remains the only verified runtime evidence for the current libsql path:
vector_from_float32(...)is unavailable andlibsql_vector_idxDDL is rejected in this environment. That invalidates the original native-vector approach but does not by itself prove sqlite-vec extension loading succeeds through the currentlibsqlpackage alias, so the replan must include explicit connection-bootstrap and test coverage for real extension loading on the main DB client and worker-owned connections. - Two iteration-0 deliverables referenced in the rejected plan do not exist in the current worktree:
src/lib/server/pipeline/write-worker-entry.tsandsrc/routes/api/v1/workers/+server.ts.scripts/build-workers.mjsand the adminWorkerStatusPanel.sveltealready reference those missing paths, so iteration 1 must either create them or revert those dangling references as part of a consistent plan. - The existing admin/SSE work is largely salvageable.
src/routes/api/v1/jobs/stream/+server.ts,src/routes/api/v1/jobs/[id]/stream/+server.ts,src/lib/server/pipeline/progress-broadcaster.ts,src/lib/components/IndexingProgress.svelte,src/lib/components/admin/JobSkeleton.svelte,src/lib/components/admin/Toast.svelte, andsrc/lib/components/admin/WorkerStatusPanel.svelteprovide a usable foundation, butsrc/routes/admin/jobs/+page.sveltestill containsconfirm(...)and the queue API still only supports exactrepository_id = ?and single-status filtering. - The existing tests still encode the rejected pre-sqlite-vec model:
embedding.service.test.ts,schema.test.ts,hybrid.search.service.test.ts, andindexing.pipeline.test.tsseed and assert againstsnippet_embeddings.embeddingblobs only. The sqlite-vec replan therefore needs new DB bootstrap helpers, vec-table lifecycle assertions, and vector-search tests that validate actual vec0 writes and filtered KNN queries.
- Iteration 0 already changed the workspace materially: direct DB imports were switched from
- Risks / follow-ups:
- The current worktree is dirty with iteration-0 partial changes and generated migration metadata, so iteration-1 tasks must explicitly distinguish keep/revise/revert work to avoid sibling tasks fighting over the same files.
- Because the current
libsqlpackage appears to exposeloadExtension, the replan should avoid assuming an immediate full revert to upstreambetter-sqlite3; instead it should sequence a driver/bootstrap compatibility decision around actual sqlite-vec extension loading behavior with testable acceptance criteria.
2026-04-01 — TRUEREF-0023 iteration-2 current-worktree verification
- Task: Replan iteration 2 against the post-iteration-1 workspace state so the first validation unit no longer leaves a known vec_embedding mismatch behind.
- Files inspected:
package.jsonpackage-lock.jsonscripts/build-workers.mjssrc/lib/server/db/client.tssrc/lib/server/db/index.tssrc/lib/server/db/schema.tssrc/lib/server/db/vectors.sqlsrc/lib/server/db/migrations/0006_yielding_centennial.sqlsrc/lib/server/db/schema.test.tssrc/lib/server/embeddings/embedding.service.tssrc/lib/server/embeddings/embedding.service.test.tssrc/lib/server/search/vector.search.tssrc/lib/server/search/hybrid.search.service.tssrc/lib/server/search/hybrid.search.service.test.tssrc/lib/server/pipeline/job-queue.tssrc/lib/server/pipeline/worker-pool.tssrc/lib/server/pipeline/worker-entry.tssrc/lib/server/pipeline/embed-worker-entry.tssrc/lib/server/pipeline/worker-types.tssrc/lib/server/pipeline/indexing.pipeline.tssrc/lib/server/pipeline/indexing.pipeline.test.tssrc/lib/server/pipeline/startup.tssrc/lib/server/pipeline/progress-broadcaster.tssrc/routes/api/v1/jobs/+server.tssrc/routes/api/v1/jobs/stream/+server.tssrc/routes/api/v1/sse-and-settings.integration.test.tssrc/routes/admin/jobs/+page.sveltesrc/lib/components/IndexingProgress.sveltesrc/lib/components/admin/JobStatusBadge.sveltesrc/lib/components/admin/JobSkeleton.sveltesrc/lib/components/admin/Toast.sveltesrc/lib/components/admin/WorkerStatusPanel.svelteprompts/TRUEREF-0023/iteration_1/plan.mdprompts/TRUEREF-0023/iteration_1/tasks.yaml
- Findings:
- Iteration 1 already completed the direct-driver reset in the working tree:
package.jsonandpackage-lock.jsonnow contain realbetter-sqlite3plussqlite-vec, and the current production/test files read in this pass importbetter-sqlite3, notlibsql. - The remaining failing intermediate state is exactly the schema/write mismatch called out in the review report:
src/lib/server/db/schema.tsandsrc/lib/server/db/migrations/0006_yielding_centennial.sqlstill declarevec_embedding,src/lib/server/db/index.tsstill executesvectors.sql, andsrc/lib/server/embeddings/embedding.service.tsstill inserts(embedding, vec_embedding)intosnippet_embeddings. src/lib/server/db/vectors.sqlis still invalid startup SQL. It contains a danglingUSING libsql_vector_idx(...)clause with no enclosingCREATE INDEX, so leaving it in the initialization path keeps the rejected libSQL-native design alive.- The first iteration-1 task boundary was therefore wrong for the current baseline: the package/import reset is already present, but it only becomes a valid foundation once the relational
vec_embeddingartifacts andEmbeddingServiceinsert path are cleaned up in the same validation unit. - The current search path is still the pre-sqlite-vec implementation.
src/lib/server/search/vector.search.tsreads every candidate embedding blob and scores in JavaScript; novec0,sqliteVec.load(db), or sqlite-vec KNN query exists anywhere undersrc/yet. - The write worker and worker-status backend are still missing in the live tree even though they are already referenced elsewhere:
scripts/build-workers.mjsincludessrc/lib/server/pipeline/write-worker-entry.ts,src/lib/components/admin/WorkerStatusPanel.sveltefetches/api/v1/workers, andsrc/routes/api/v1/jobs/stream/+server.tscurrently has no worker-status event source. - The admin jobs page remains incomplete but salvageable:
src/routes/admin/jobs/+page.sveltestill usesconfirm(...)andalert(...), whileJobSkeleton.svelte,Toast.svelte,WorkerStatusPanel.svelte,JobStatusBadge.svelte, andIndexingProgress.sveltealready provide the intended UI foundation. src/lib/server/pipeline/job-queue.tsstill only supports exactrepository_id = ?and singlestatus = ?filtering, so API-side filter work remains a separate backend task and does not need to block the vector-storage implementation.
- Iteration 1 already completed the direct-driver reset in the working tree:
- Risks / follow-ups:
- Iteration 2 task decomposition must treat the current dirty code files from iterations 0 and 1 as the validation baseline, otherwise the executor will keep rediscovering pre-existing worktree drift instead of new task deltas.
- The sqlite-vec bootstrap helper and the relational cleanup should be planned as one acceptance unit before any downstream vec0, worker-status, or admin-page tasks, because that is the smallest unit that removes the known broken intermediate state.