13 KiB
13 KiB
Findings
Last Updated: 2026-03-27T00:24:13.000Z
Initializer Summary
- JIRA: FEEDBACK-0001
- Refresh mode: REFRESH_IF_REQUIRED
- Result: refreshed affected documentation only. ARCHITECTURE.md and FINDINGS.md were updated from current repository analysis; CODE_STYLE.md remained trusted and unchanged because the documented conventions still match the codebase.
Research Performed
- Discovered source-language distribution, dependency manifest, import patterns, and project structure.
- Read the retrieval, formatter, token-budget, parser, mapper, and response-model modules affected by the latest implementation changes.
- Compared the trusted cache state with current behavior to identify which documentation files were actually stale.
- Confirmed package scripts for build and test.
- Confirmed Linux-native md5sum availability for documentation trust metadata.
Open Questions For Planner
- Verify whether the retrieval response contract should document the new repository and version metadata fields formally in a public API reference beyond the architecture summary.
- Verify whether parser chunking should evolve further from file-level and declaration-level boundaries to member-level semantic chunks for class-heavy codebases.
Planner Notes Template
Add subsequent research below this section.
Entry Template
- Date:
- Task:
- Files inspected:
- Findings:
- Risks / follow-ups:
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