Skip to content

Fix global legacy note search retrieval - #2

Closed
andrei-hasna wants to merge 1 commit into
mainfrom
fix/global-note-search
Closed

Fix global legacy note search retrieval#2
andrei-hasna wants to merge 1 commit into
mainfrom
fix/global-note-search

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

  • include active JSON-store notes in hybrid search as keyword-only legacy_item results with knowledge://item/<id> refs
  • pass the active note store path through CLI/service search, context, and ask/build paths, including first-command global legacy migration from ~/.open-knowledge/db.json
  • document the note-store vs SQLite source/wiki reindex boundary and add focused regression coverage

Validation

  • bun test tests/search.test.ts tests/retrieval.test.ts tests/cli.test.ts --timeout 30000 passed: 45 tests, 460 assertions
  • targeted TypeScript check for changed source/tests passed
  • manual temp HOME smoke passed for current global notes and old ~/.open-knowledge/db.json first-command search migration
  • bun test passed: 122 tests, 1477 assertions
  • bun test tests/mcp.test.ts --timeout 30000 passed
  • bun run build passed
  • knowledge storage protect --scope project --json && knowledge storage validate --strict --scope project --json passed in the clean worktree

Notes

  • knowledge reindex remains scoped to SQLite source/wiki chunks and vector rows; JSON notes are keyword-searchable/context-packable, not embedded by reindex.
  • Repo-wide bunx tsc -p tsconfig.json --noEmit still fails on pre-existing unrelated test/rootDir/type drift; the targeted changed-file typecheck passes.
  • Adversarial review found the first-command legacy migration blocker; it was fixed and the reviewer re-check reported no blocker remains.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Closing as superseded / already-fixed-on-main.

Every element of this PR is already present on main (via the reconcile of main to the published 0.2.x line) and has since been extended:

  • src/search.ts: full legacy_item / active-JSON-note keyword search (readLegacyItems, selectLegacyItems, legacyItemResult, legacy_item SearchResultKind, kind-order) — present on main and further generalized into a shared selectItems that also serves the cloud api-mode item corpus (hybridSearchItems).
  • src/service.ts: legacyStorePath plumbing for search/context/ask — present on main, extended with legacyStorePathForRead.
  • src/retrieval.ts: authorityScore legacy_item 0.6 and RetrievalOptions legacyStorePath — present on main.
  • README.md + docs/architecture/hybrid-semantic-search.md: the compatibility-JSON-note / knowledge://item/<id> / reindex-boundary docs — present on main.
  • Tests: 'searches active legacy JSON notes as keyword results' (search), 'assembles context excerpts from legacy JSON notes' (retrieval), and 'global notes added through CLI are searchable and available as context' (cli) — all already on main.

Additionally, main deliberately reverses this PR's migrate-on-read behavior: main carries 'global search reads the old legacy note store without migration' and 'global list does not migrate legacy .open-knowledge data on read', and scopes ensureStore to ask/build (not search) and only outside api-mode. Rebasing this PR conflicts on cli.ts/search.ts/service.ts/cli.test.ts and would re-introduce the superseded migrate-on-read path. Nothing unique remains to salvage. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant