docsif 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docsif-0.1.0/.github/workflows/docs.yml +38 -0
- docsif-0.1.0/.gitignore +46 -0
- docsif-0.1.0/.planning/.continue-here.md +70 -0
- docsif-0.1.0/.planning/E2E-UAT.md +90 -0
- docsif-0.1.0/.planning/E2E-manual-test-plan.md +249 -0
- docsif-0.1.0/.planning/HANDOFF.json +44 -0
- docsif-0.1.0/.planning/PROJECT.md +80 -0
- docsif-0.1.0/.planning/REQUIREMENTS.md +128 -0
- docsif-0.1.0/.planning/ROADMAP.md +200 -0
- docsif-0.1.0/.planning/STATE.md +101 -0
- docsif-0.1.0/.planning/codebase/ARCHITECTURE.md +175 -0
- docsif-0.1.0/.planning/codebase/CONCERNS.md +161 -0
- docsif-0.1.0/.planning/codebase/CONVENTIONS.md +164 -0
- docsif-0.1.0/.planning/codebase/INTEGRATIONS.md +99 -0
- docsif-0.1.0/.planning/codebase/STACK.md +89 -0
- docsif-0.1.0/.planning/codebase/STRUCTURE.md +169 -0
- docsif-0.1.0/.planning/codebase/TESTING.md +238 -0
- docsif-0.1.0/.planning/config.json +42 -0
- docsif-0.1.0/.planning/debug/e2e-get-and-stats-bugs.md +88 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-01-PLAN.md +139 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-01-SUMMARY.md +62 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-02-PLAN.md +354 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-02-SUMMARY.md +71 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-03-PLAN.md +191 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-03-SUMMARY.md +108 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-04-PLAN.md +237 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-04-SUMMARY.md +56 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-05-PLAN.md +284 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-05-SUMMARY.md +70 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-06-PLAN.md +185 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-06-SUMMARY.md +52 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-CONTEXT.md +97 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-DISCUSSION-LOG.md +63 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-PATTERNS.md +825 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-RESEARCH.md +460 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-VALIDATION.md +79 -0
- docsif-0.1.0/.planning/phases/01-foundation-fix/01-VERIFICATION.md +144 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-01-PLAN.md +168 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-01-SUMMARY.md +74 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-02-PLAN.md +279 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-02-SUMMARY.md +101 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-03a-PLAN.md +360 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-03a-SUMMARY.md +118 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-03b-PLAN.md +176 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-03b-SUMMARY.md +67 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-04-PLAN.md +289 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-04-SUMMARY.md +92 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-05-PLAN.md +313 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-05-SUMMARY.md +63 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-CONTEXT.md +124 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-DISCUSSION-LOG.md +86 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-PATTERNS.md +794 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-RESEARCH.md +435 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-REVIEW.md +197 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-VALIDATION.md +85 -0
- docsif-0.1.0/.planning/phases/02-cli-core-completion/02-VERIFICATION.md +127 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/.continue-here.md +69 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-01-PLAN.md +264 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-01-SUMMARY.md +96 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-02-PLAN.md +343 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-02-SUMMARY.md +66 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-03-PLAN.md +283 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-03-SUMMARY.md +29 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-04-PLAN.md +321 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-04-SUMMARY.md +27 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-05-PLAN.md +394 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-05-SUMMARY.md +64 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-06-PLAN.md +454 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-06-SUMMARY.md +60 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-CONTEXT.md +115 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-DISCUSSION-LOG.md +81 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-PATTERNS.md +701 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-RESEARCH.md +437 -0
- docsif-0.1.0/.planning/phases/03-embedding-vector-search/03-VALIDATION.md +83 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/.continue-here.md +81 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-01-PLAN.md +626 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-01-SUMMARY.md +33 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-02-PLAN.md +461 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-02-SUMMARY.md +94 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-03-PLAN.md +607 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-03-SUMMARY.md +83 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-04-PLAN.md +704 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-04-SUMMARY.md +41 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-05-PLAN.md +349 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-05-SUMMARY.md +43 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-CONTEXT.md +107 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-DISCUSSION-LOG.md +74 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-PATTERNS.md +1105 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-RESEARCH.md +623 -0
- docsif-0.1.0/.planning/phases/04-advanced-search-pipeline/04-VALIDATION.md +90 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/.continue-here.md +62 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-01-PLAN.md +394 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-01-SUMMARY.md +151 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-02-PLAN.md +337 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-02-SUMMARY.md +68 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-03-PLAN.md +238 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-03-SUMMARY.md +101 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-04-PLAN.md +331 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-04-SUMMARY.md +147 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-05-PLAN.md +313 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-05-SUMMARY.md +41 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-06-PLAN.md +323 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-06-SUMMARY.md +45 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-07-PLAN.md +262 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-07-SUMMARY.md +34 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-CONTEXT.md +164 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-DISCUSSION-LOG.md +75 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-PATTERNS.md +684 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-RESEARCH.md +493 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-SPEC.md +106 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-UAT.md +161 -0
- docsif-0.1.0/.planning/phases/05-agent-context-experience/05-VALIDATION.md +80 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/.continue-here.md +92 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-01-SUMMARY.md +63 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-02-SUMMARY.md +114 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-03-SUMMARY.md +132 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-04-SUMMARY.md +94 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-05-SUMMARY.md +126 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-06-SUMMARY.md +118 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-07-SUMMARY.md +54 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-CONTEXT.md +194 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-DISCUSSION-LOG.md +75 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-RESEARCH.md +569 -0
- docsif-0.1.0/.planning/phases/06-documentation-audit-refresh/06-SPEC.md +129 -0
- docsif-0.1.0/.planning/phases/07-cli-claude-skill/.gitkeep +0 -0
- docsif-0.1.0/.planning/phases/07-cli-claude-skill/07-01-PLAN.md +172 -0
- docsif-0.1.0/.planning/phases/07-cli-claude-skill/07-02-PLAN.md +169 -0
- docsif-0.1.0/.planning/phases/07-cli-claude-skill/07-CONTEXT.md +137 -0
- docsif-0.1.0/.planning/phases/07-cli-claude-skill/07-DISCUSSION-LOG.md +76 -0
- docsif-0.1.0/.planning/phases/07-cli-claude-skill/07-SPEC.md +115 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/.continue-here.md +49 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/.gitkeep +0 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-01-PLAN.md +193 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-01-SUMMARY.md +78 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-02-PLAN.md +293 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-02-SUMMARY.md +127 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-03-PLAN.md +297 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-03-SUMMARY.md +145 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-04-PLAN.md +227 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-04-SUMMARY.md +83 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-05-PLAN.md +308 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-05-SUMMARY.md +162 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-06-PLAN.md +595 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-06-SUMMARY.md +94 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-07-PLAN.md +183 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-07-SUMMARY.md +64 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-08-PLAN.md +398 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-08-SUMMARY.md +143 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-CONTEXT.md +141 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-DISCUSSION-LOG.md +74 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-PATTERNS.md +1191 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-RESEARCH.md +604 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-VALIDATION.md +83 -0
- docsif-0.1.0/.planning/phases/08-project-rename-from-docsift-to-sif/08-VERIFICATION.md +112 -0
- docsif-0.1.0/.planning/research/ARCHITECTURE.md +420 -0
- docsif-0.1.0/.planning/research/FEATURES.md +224 -0
- docsif-0.1.0/.planning/research/PITFALLS.md +185 -0
- docsif-0.1.0/.planning/research/STACK.md +105 -0
- docsif-0.1.0/.planning/research/SUMMARY.md +175 -0
- docsif-0.1.0/CLAUDE.md +132 -0
- docsif-0.1.0/DELIVERY_REPORT.md +331 -0
- docsif-0.1.0/DESIGN.md +385 -0
- docsif-0.1.0/INTEGRATION_STATUS.md +321 -0
- docsif-0.1.0/LICENSE +21 -0
- docsif-0.1.0/MagicMock/mock/4398091296 +0 -0
- docsif-0.1.0/MagicMock/mock/4419046432 +0 -0
- docsif-0.1.0/MagicMock/mock/4419497200 +0 -0
- docsif-0.1.0/MagicMock/mock/4426075504 +0 -0
- docsif-0.1.0/Makefile +180 -0
- docsif-0.1.0/PKG-INFO +393 -0
- docsif-0.1.0/PROJECT_SUMMARY.md +332 -0
- docsif-0.1.0/README.md +343 -0
- docsif-0.1.0/REFACTOR_REPORT.md +214 -0
- docsif-0.1.0/SIDE_BY_SIDE_TEST_REPORT.md +138 -0
- docsif-0.1.0/docs/api-reference.md +841 -0
- docsif-0.1.0/docs/architecture.md +520 -0
- docsif-0.1.0/docs/changelog.md +226 -0
- docsif-0.1.0/docs/cli-reference.md +715 -0
- docsif-0.1.0/docs/configuration.md +223 -0
- docsif-0.1.0/docs/contributing.md +377 -0
- docsif-0.1.0/docs/development.md +596 -0
- docsif-0.1.0/docs/index.md +227 -0
- docsif-0.1.0/docs/installation.md +254 -0
- docsif-0.1.0/docs/mcp-server.md +534 -0
- docsif-0.1.0/docs/migration.md +135 -0
- docsif-0.1.0/docs/models.md +510 -0
- docsif-0.1.0/docs/quickstart.md +449 -0
- docsif-0.1.0/docs/search-algorithms.md +416 -0
- docsif-0.1.0/example_config.yaml +247 -0
- docsif-0.1.0/examples/quickstart.py +370 -0
- docsif-0.1.0/mkdocs.yml +122 -0
- docsif-0.1.0/mypy.ini +95 -0
- docsif-0.1.0/pyproject.toml +218 -0
- docsif-0.1.0/quick_test.py +167 -0
- docsif-0.1.0/scripts/generate_arch_diagram.py +121 -0
- docsif-0.1.0/scripts/generate_cli_ref.py +322 -0
- docsif-0.1.0/scripts/generate_config_ref.py +396 -0
- docsif-0.1.0/simple_test.py +173 -0
- docsif-0.1.0/src/sif/__init__.py +24 -0
- docsif-0.1.0/src/sif/_version.py +3 -0
- docsif-0.1.0/src/sif/cli/__init__.py +11 -0
- docsif-0.1.0/src/sif/cli/commands/__init__.py +18 -0
- docsif-0.1.0/src/sif/cli/commands/bench.py +148 -0
- docsif-0.1.0/src/sif/cli/commands/collection.py +360 -0
- docsif-0.1.0/src/sif/cli/commands/context.py +154 -0
- docsif-0.1.0/src/sif/cli/commands/get.py +200 -0
- docsif-0.1.0/src/sif/cli/commands/index.py +294 -0
- docsif-0.1.0/src/sif/cli/commands/ls.py +67 -0
- docsif-0.1.0/src/sif/cli/commands/mcp.py +93 -0
- docsif-0.1.0/src/sif/cli/commands/pull.py +111 -0
- docsif-0.1.0/src/sif/cli/commands/search.py +574 -0
- docsif-0.1.0/src/sif/cli/config.py +206 -0
- docsif-0.1.0/src/sif/cli/formatters.py +269 -0
- docsif-0.1.0/src/sif/cli/main.py +205 -0
- docsif-0.1.0/src/sif/config/__init__.py +30 -0
- docsif-0.1.0/src/sif/config/constants.py +52 -0
- docsif-0.1.0/src/sif/config/settings.py +217 -0
- docsif-0.1.0/src/sif/core/__init__.py +21 -0
- docsif-0.1.0/src/sif/core/collection.py +161 -0
- docsif-0.1.0/src/sif/core/context.py +167 -0
- docsif-0.1.0/src/sif/core/document.py +125 -0
- docsif-0.1.0/src/sif/core/models.py +298 -0
- docsif-0.1.0/src/sif/database/__init__.py +23 -0
- docsif-0.1.0/src/sif/database/connection.py +139 -0
- docsif-0.1.0/src/sif/database/database.py +136 -0
- docsif-0.1.0/src/sif/database/migrations.py +187 -0
- docsif-0.1.0/src/sif/database/repositories.py +500 -0
- docsif-0.1.0/src/sif/database/repository.py +171 -0
- docsif-0.1.0/src/sif/database/schema.py +362 -0
- docsif-0.1.0/src/sif/embedding/__init__.py +22 -0
- docsif-0.1.0/src/sif/embedding/cache.py +196 -0
- docsif-0.1.0/src/sif/embedding/embedder.py +328 -0
- docsif-0.1.0/src/sif/embedding/factory.py +92 -0
- docsif-0.1.0/src/sif/embedding/manager.py +200 -0
- docsif-0.1.0/src/sif/embedding/model.py +126 -0
- docsif-0.1.0/src/sif/indexing/__init__.py +21 -0
- docsif-0.1.0/src/sif/indexing/chunker.py +226 -0
- docsif-0.1.0/src/sif/indexing/indexer.py +226 -0
- docsif-0.1.0/src/sif/indexing/parser.py +192 -0
- docsif-0.1.0/src/sif/indexing/scanner.py +148 -0
- docsif-0.1.0/src/sif/indexing/watcher.py +156 -0
- docsif-0.1.0/src/sif/mcp/README.md +258 -0
- docsif-0.1.0/src/sif/mcp/__init__.py +9 -0
- docsif-0.1.0/src/sif/mcp/claude_desktop_config.json +16 -0
- docsif-0.1.0/src/sif/mcp/cli.py +92 -0
- docsif-0.1.0/src/sif/mcp/protocol.py +336 -0
- docsif-0.1.0/src/sif/mcp/server.py +433 -0
- docsif-0.1.0/src/sif/mcp/server_http.py +54 -0
- docsif-0.1.0/src/sif/mcp/test_mcp.py +108 -0
- docsif-0.1.0/src/sif/mcp/tools.py +497 -0
- docsif-0.1.0/src/sif/mcp/transport_http.py +424 -0
- docsif-0.1.0/src/sif/mcp/transport_stdio.py +292 -0
- docsif-0.1.0/src/sif/mcp_server/__init__.py +26 -0
- docsif-0.1.0/src/sif/mcp_server/handlers.py +68 -0
- docsif-0.1.0/src/sif/mcp_server/server.py +58 -0
- docsif-0.1.0/src/sif/mcp_server/tools.py +216 -0
- docsif-0.1.0/src/sif/mcp_server/transport.py +221 -0
- docsif-0.1.0/src/sif/models/__init__.py +70 -0
- docsif-0.1.0/src/sif/models/collection.py +51 -0
- docsif-0.1.0/src/sif/models/context.py +45 -0
- docsif-0.1.0/src/sif/models/document.py +76 -0
- docsif-0.1.0/src/sif/models/download.py +208 -0
- docsif-0.1.0/src/sif/models/embedding.py +71 -0
- docsif-0.1.0/src/sif/models/search.py +92 -0
- docsif-0.1.0/src/sif/search/__init__.py +22 -0
- docsif-0.1.0/src/sif/search/benchmark.py +110 -0
- docsif-0.1.0/src/sif/search/bm25.py +216 -0
- docsif-0.1.0/src/sif/search/expansion.py +157 -0
- docsif-0.1.0/src/sif/search/hybrid.py +323 -0
- docsif-0.1.0/src/sif/search/rerank.py +390 -0
- docsif-0.1.0/src/sif/search/rrf.py +186 -0
- docsif-0.1.0/src/sif/search/snippets.py +130 -0
- docsif-0.1.0/src/sif/search/strategy.py +97 -0
- docsif-0.1.0/src/sif/search/vector.py +177 -0
- docsif-0.1.0/src/sif/utils/__init__.py +26 -0
- docsif-0.1.0/src/sif/utils/logging.py +143 -0
- docsif-0.1.0/src/sif/utils/paths.py +82 -0
- docsif-0.1.0/src/sif/utils/progress.py +83 -0
- docsif-0.1.0/src/sif/utils/text.py +128 -0
- docsif-0.1.0/tests/__init__.py +1 -0
- docsif-0.1.0/tests/conftest.py +615 -0
- docsif-0.1.0/tests/e2e/__init__.py +1 -0
- docsif-0.1.0/tests/factories.py +389 -0
- docsif-0.1.0/tests/integration/__init__.py +1 -0
- docsif-0.1.0/tests/integration/test_search_pipeline.py +266 -0
- docsif-0.1.0/tests/test_docs.py +459 -0
- docsif-0.1.0/tests/test_sif_complete.py +368 -0
- docsif-0.1.0/tests/unit/__init__.py +1 -0
- docsif-0.1.0/tests/unit/cli/__init__.py +1 -0
- docsif-0.1.0/tests/unit/cli/test_bench.py +117 -0
- docsif-0.1.0/tests/unit/cli/test_collection.py +265 -0
- docsif-0.1.0/tests/unit/cli/test_context.py +422 -0
- docsif-0.1.0/tests/unit/cli/test_formatters.py +34 -0
- docsif-0.1.0/tests/unit/cli/test_get.py +269 -0
- docsif-0.1.0/tests/unit/cli/test_index.py +232 -0
- docsif-0.1.0/tests/unit/cli/test_ls.py +185 -0
- docsif-0.1.0/tests/unit/cli/test_pull.py +144 -0
- docsif-0.1.0/tests/unit/cli/test_search.py +658 -0
- docsif-0.1.0/tests/unit/cli/test_status.py +72 -0
- docsif-0.1.0/tests/unit/config/test_settings.py +58 -0
- docsif-0.1.0/tests/unit/database/test_schema.py +216 -0
- docsif-0.1.0/tests/unit/db/__init__.py +1 -0
- docsif-0.1.0/tests/unit/db/test_database.py +295 -0
- docsif-0.1.0/tests/unit/db/test_repositories.py +1093 -0
- docsif-0.1.0/tests/unit/embedding/test_manager.py +89 -0
- docsif-0.1.0/tests/unit/indexing/__init__.py +1 -0
- docsif-0.1.0/tests/unit/inference/__init__.py +1 -0
- docsif-0.1.0/tests/unit/inference/test_embedder.py +288 -0
- docsif-0.1.0/tests/unit/inference/test_query_expander.py +260 -0
- docsif-0.1.0/tests/unit/inference/test_reranker.py +459 -0
- docsif-0.1.0/tests/unit/search/__init__.py +1 -0
- docsif-0.1.0/tests/unit/search/test_benchmark.py +157 -0
- docsif-0.1.0/tests/unit/search/test_bm25.py +349 -0
- docsif-0.1.0/tests/unit/search/test_hybrid.py +502 -0
- docsif-0.1.0/tests/unit/search/test_rrf.py +774 -0
- docsif-0.1.0/tests/unit/search/test_snippets.py +90 -0
- docsif-0.1.0/tests/unit/search/test_vector.py +289 -0
- docsif-0.1.0/tests/unit/test_collection.py +176 -0
- docsif-0.1.0/tests/unit/test_search.py +153 -0
- docsif-0.1.0/uv.lock +3679 -0
- docsif-0.1.0/verify_imports.py +189 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Docs Validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
paths:
|
|
6
|
+
- 'docs/**'
|
|
7
|
+
- 'README.md'
|
|
8
|
+
- 'src/sif/cli/**'
|
|
9
|
+
- 'src/sif/config/**'
|
|
10
|
+
- 'scripts/generate_cli_ref.py'
|
|
11
|
+
- 'scripts/generate_config_ref.py'
|
|
12
|
+
- 'tests/test_docs.py'
|
|
13
|
+
push:
|
|
14
|
+
branches: [main]
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
docs-test:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.11'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: |
|
|
28
|
+
pip install --upgrade pip
|
|
29
|
+
pip install -e ".[dev]"
|
|
30
|
+
|
|
31
|
+
- name: Run docs tests
|
|
32
|
+
run: pytest tests/test_docs.py -v
|
|
33
|
+
|
|
34
|
+
- name: Verify generation scripts work
|
|
35
|
+
run: |
|
|
36
|
+
python scripts/generate_cli_ref.py
|
|
37
|
+
python scripts/generate_config_ref.py
|
|
38
|
+
git diff --exit-code docs/cli-reference.md docs/configuration.md || true
|
docsif-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
.venv/
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
env/
|
|
28
|
+
|
|
29
|
+
# IDE
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
*~
|
|
35
|
+
|
|
36
|
+
# Testing
|
|
37
|
+
.coverage
|
|
38
|
+
coverage.xml
|
|
39
|
+
htmlcov/
|
|
40
|
+
.pytest_cache/
|
|
41
|
+
|
|
42
|
+
# OS
|
|
43
|
+
.DS_Store
|
|
44
|
+
Thumbs.db
|
|
45
|
+
/models/
|
|
46
|
+
.claude/
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
context: default
|
|
3
|
+
phase: e2e-verification
|
|
4
|
+
status: in_progress
|
|
5
|
+
last_updated: "2026-04-27T12:53:33Z"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# BLOCKING CONSTRAINTS — Read Before Anything Else
|
|
9
|
+
|
|
10
|
+
- [x] **CONSTRAINT: SQLite DDL triggers implicit commit** — Creating tables inside a transaction that later rolls back will NOT roll back the DDL. Structural mitigation: never assert DDL rollback in SQLite tests.
|
|
11
|
+
- [x] **CONSTRAINT: macOS load_extension("vec0") fails** — Use `sqlite_vec.load(conn)` from the Python package instead.
|
|
12
|
+
- [x] **CONSTRAINT: Qwen3-Reranker-0.6B is NOT a CrossEncoder** — It requires `AutoModelForCausalLM` with yes/no token logit prediction.
|
|
13
|
+
- [x] **CONSTRAINT: Stored document paths are full resolved paths** — FIXED: `get_by_filename()` added as fallback when path lookup fails.
|
|
14
|
+
|
|
15
|
+
<current_state>
|
|
16
|
+
All 3 E2E bugs fixed and verified. MPS (Apple GPU) support added to embedder. Automated E2E passed 13/13. User paused to run manual E2E test against real Obsidian vault. All changes uncommitted.
|
|
17
|
+
</current_state>
|
|
18
|
+
|
|
19
|
+
<completed_work>
|
|
20
|
+
|
|
21
|
+
1. Fixed ~300+ ruff issues (UP045, UP006, SIM108, B904, PLC0415, complexity, PERF401, etc.)
|
|
22
|
+
2. Fixed datetime.utcnow() → datetime.now(timezone.utc) across all src and test files
|
|
23
|
+
3. Fixed 9 PytestReturnNotNoneWarning in test_sif_complete.py
|
|
24
|
+
4. All 378 tests pass, 0 warnings
|
|
25
|
+
5. Fixed Bug 1 & 2: `get_by_filename()` fallback in get_cmd and multi_get_cmd
|
|
26
|
+
6. Fixed Bug 3: `_row_to_collection` now reads document_count/chunk_count from DB
|
|
27
|
+
7. Added `mark_indexed()` method to Collection dataclass
|
|
28
|
+
8. Added MPS (Apple GPU) device detection: CUDA > MPS > CPU
|
|
29
|
+
9. Automated E2E verification: 13/13 tests passed
|
|
30
|
+
10. Manual test plan written at `.planning/E2E-manual-test-plan.md`
|
|
31
|
+
</completed_work>
|
|
32
|
+
|
|
33
|
+
<remaining_work>
|
|
34
|
+
|
|
35
|
+
- **Commit all changes** — ~55 files modified, nothing committed yet
|
|
36
|
+
- **Run manual E2E test** — test plan at `.planning/E2E-manual-test-plan.md` against `/Users/forrest/SynologyDrive/Obsidian/ScholarCopilot-Dev/raw/markdown` (307 papers, 266MB)
|
|
37
|
+
- **Re-run embed with MPS** — `sif index embed -c scholar-test` should now use MPS instead of CPU
|
|
38
|
+
</remaining_work>
|
|
39
|
+
|
|
40
|
+
<decisions_made>
|
|
41
|
+
|
|
42
|
+
- Added noqa for Click-inherent complexity (structural, not fixable)
|
|
43
|
+
- Added noqa for intentional lazy imports (ML libraries)
|
|
44
|
+
- Used lambda wrappers for datetime in field default_factory
|
|
45
|
+
- MPS device detection: CUDA > MPS > CPU for both SentenceTransformerEmbedder and ModelScopeEmbedder
|
|
46
|
+
- Get by filename: path lookup first, then filename column fallback
|
|
47
|
+
- Collection stats: _row_to_collection must read all DB columns
|
|
48
|
+
</decisions_made>
|
|
49
|
+
|
|
50
|
+
<blockers>
|
|
51
|
+
None.
|
|
52
|
+
</blockers>
|
|
53
|
+
|
|
54
|
+
## Required Reading (in order)
|
|
55
|
+
|
|
56
|
+
1. `.planning/HANDOFF.json` — structured machine-readable state
|
|
57
|
+
2. `.planning/E2E-manual-test-plan.md` — manual test plan for real Obsidian vault
|
|
58
|
+
3. `.planning/E2E-UAT.md` — automated E2E results (13/13 passed)
|
|
59
|
+
4. `.planning/debug/e2e-get-and-stats-bugs.md` — debug session with root cause analysis
|
|
60
|
+
|
|
61
|
+
## Infrastructure State
|
|
62
|
+
- SIF CLI installed and working (`sif --version` → 0.1.0)
|
|
63
|
+
- Test DB at `/tmp/sif-e2e-test.sqlite` cleaned up
|
|
64
|
+
- MPS available: confirmed (`torch.backends.mps.is_available()` → True)
|
|
65
|
+
- Model cached: Qwen/Qwen3-Embedding-0.6B at `/Users/forrest/Library/Caches/sif/`
|
|
66
|
+
- User may have a partial embed in progress for `scholar-test` collection
|
|
67
|
+
|
|
68
|
+
<next_action>
|
|
69
|
+
Commit all changes first. Then user runs manual E2E test plan: re-index and embed with MPS enabled for real Obsidian vault.
|
|
70
|
+
</next_action>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
status: complete
|
|
3
|
+
phase: E2E
|
|
4
|
+
source: ROADMAP.md (all phases)
|
|
5
|
+
started: "2026-04-27T12:00:00Z"
|
|
6
|
+
updated: "2026-04-27T12:30:00Z"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Current Test
|
|
10
|
+
|
|
11
|
+
[testing complete]
|
|
12
|
+
|
|
13
|
+
## Tests
|
|
14
|
+
|
|
15
|
+
### 1. Cold Start Smoke Test
|
|
16
|
+
expected: sif --version prints version string. sif status runs without error on a fresh temp database (no prior state).
|
|
17
|
+
result: pass
|
|
18
|
+
note: sif --version prints "sif, version 0.1.0". sif status on empty DB says "No index found" gracefully.
|
|
19
|
+
|
|
20
|
+
### 2. Collection Add and List
|
|
21
|
+
expected: sif collection add creates a collection. sif collection list shows it.
|
|
22
|
+
result: pass
|
|
23
|
+
note: Used `sif collection add /tmp/sif-e2e-test-docs -n test-e2e`. Collection listed with path, document count, default flag.
|
|
24
|
+
|
|
25
|
+
### 3. Index Documents into Collection
|
|
26
|
+
expected: sif index update indexes 3 documents with progress output.
|
|
27
|
+
result: pass
|
|
28
|
+
note: `sif index update -c test-e2e` found 3 files, indexed all: Added: 3, Updated: 0, Removed: 0.
|
|
29
|
+
|
|
30
|
+
### 4. Collection Show Stats (Bug Fix Verified)
|
|
31
|
+
expected: sif collection show test-e2e displays Documents: 3 (not 0).
|
|
32
|
+
result: pass
|
|
33
|
+
note: Shows Documents: 3, Last Indexed timestamp. The _row_to_collection bug fix works.
|
|
34
|
+
|
|
35
|
+
### 5. Get Document by Full Path
|
|
36
|
+
expected: sif get get /full/path/python-basics.md retrieves full content.
|
|
37
|
+
result: pass
|
|
38
|
+
note: Displays title, path, collection, and full markdown content with code blocks.
|
|
39
|
+
|
|
40
|
+
### 6. Get Document by Short Filename (Bug Fix Verified)
|
|
41
|
+
expected: sif get get python-basics.md retrieves document by filename only.
|
|
42
|
+
result: pass
|
|
43
|
+
note: get_by_filename() fallback works. Both short and full path return the same document.
|
|
44
|
+
|
|
45
|
+
### 7. Multi-Get by Filename
|
|
46
|
+
expected: sif get multi-get retrieves matching documents.
|
|
47
|
+
result: pass
|
|
48
|
+
note: `sif get multi-get "python-basics.md"` found 1 matching document.
|
|
49
|
+
|
|
50
|
+
### 8. BM25 Keyword Search
|
|
51
|
+
expected: sif search search "embedding vector" finds research-notes.md.
|
|
52
|
+
result: pass
|
|
53
|
+
note: research-notes.md found with score 0.5352.
|
|
54
|
+
|
|
55
|
+
### 9. Search JSON Output
|
|
56
|
+
expected: sif search search with --json outputs valid JSON.
|
|
57
|
+
result: pass
|
|
58
|
+
note: Valid JSON array with document_id, title, path, score, highlights fields.
|
|
59
|
+
|
|
60
|
+
### 10. List Documents (ls)
|
|
61
|
+
expected: sif ls test-e2e shows indexed documents.
|
|
62
|
+
result: pass
|
|
63
|
+
note: Shows tree: test-e2e / private / tmp / sif-e2e-test-docs / {3 .md files}.
|
|
64
|
+
|
|
65
|
+
### 11. Context Add and List
|
|
66
|
+
expected: sif context add collection test-e2e "..." adds context. sif context list shows it.
|
|
67
|
+
result: pass
|
|
68
|
+
note: Context added and listed with type=collection, target, and content preview.
|
|
69
|
+
|
|
70
|
+
### 12. Status Command
|
|
71
|
+
expected: sif status shows database path, collection count, document count.
|
|
72
|
+
result: pass
|
|
73
|
+
note: Shows Index Path, Collections: 1, Documents: 3, Chunks: 0, Contexts: 1.
|
|
74
|
+
|
|
75
|
+
### 13. Collection Remove Cleanup
|
|
76
|
+
expected: sif collection remove test-e2e removes collection. list shows empty.
|
|
77
|
+
result: pass
|
|
78
|
+
note: Requires confirmation (y/N). After removal, "No collections found."
|
|
79
|
+
|
|
80
|
+
## Summary
|
|
81
|
+
|
|
82
|
+
total: 13
|
|
83
|
+
passed: 13
|
|
84
|
+
issues: 0
|
|
85
|
+
pending: 0
|
|
86
|
+
skipped: 0
|
|
87
|
+
|
|
88
|
+
## Gaps
|
|
89
|
+
|
|
90
|
+
[none]
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# SIF Manual Test Plan
|
|
2
|
+
|
|
3
|
+
**Test Directory:** `/Users/forrest/SynologyDrive/Obsidian/ScholarCopilot-Dev/raw/markdown`
|
|
4
|
+
**Scale:** 307 papers, 266MB
|
|
5
|
+
**Use a separate database** to avoid polluting daily index.
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
export SIF_DB_PATH=/tmp/sif-scholar-test.sqlite
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Test 1: Create Collection & Index
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Create collection
|
|
17
|
+
sif collection add /Users/forrest/SynologyDrive/Obsidian/ScholarCopilot-Dev/raw/markdown -n scholar-test -d "学术论文测试集"
|
|
18
|
+
|
|
19
|
+
# Index (observe speed and output)
|
|
20
|
+
sif index update -c scholar-test
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Check:** Index completes without errors, shows Added: ~307
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Test 2: Collection Stats
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
sif collection show scholar-test
|
|
31
|
+
sif status
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Check:** Documents count is correct (~307), NOT 0
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Test 3: Generate Embeddings (Vectorization)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Generate vector embeddings for all indexed documents
|
|
42
|
+
# Default model: Qwen/Qwen3-Embedding-0.6B (1024 dim, via modelscope)
|
|
43
|
+
# This step is slow — expect several minutes for 307 papers
|
|
44
|
+
sif index embed -c scholar-test
|
|
45
|
+
|
|
46
|
+
# (Optional) Force re-embed with a specific model type
|
|
47
|
+
# sif index embed -c scholar-test --model-type sentence_transformers --model "all-MiniLM-L6-v2"
|
|
48
|
+
|
|
49
|
+
# (Optional) Force re-embed all (even already embedded)
|
|
50
|
+
# sif index embed -c scholar-test -f
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Check:** Embedding completes without errors. Output shows progress and count of embedded chunks.
|
|
54
|
+
|
|
55
|
+
**Note:** First run will download the model (~1.2GB for Qwen3-Embedding-0.6B). Subsequent runs use cache. If model download fails, try `--model-type sentence_transformers` as fallback.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Test 4: Verify Vector Index
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Check chunks were created
|
|
63
|
+
sif collection show scholar-test
|
|
64
|
+
|
|
65
|
+
# Status should show Chunks > 0
|
|
66
|
+
sif status
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Check:** Chunks count > 0, indicating vectors were stored in sqlite-vec
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Test 5: Vector Search
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Pure vector similarity search
|
|
77
|
+
sif search vsearch "how does chromosome folding affect gene regulation"
|
|
78
|
+
|
|
79
|
+
# Another semantic query (no exact keyword match needed)
|
|
80
|
+
sif search vsearch "methods for detecting drug side effects in children"
|
|
81
|
+
|
|
82
|
+
# With limit and JSON output
|
|
83
|
+
sif search vsearch "immune system antibody response" -n 5 --json | python -m json.tool | head -30
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Check:** Returns semantically relevant papers even without exact keyword overlap. Scores and results differ from BM25 (Test 7).
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Test 6: Hybrid Search (BM25 + Vector + RRF)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Hybrid search combines BM25 and vector via Reciprocal Rank Fusion
|
|
94
|
+
sif search query "gene expression regulation"
|
|
95
|
+
|
|
96
|
+
# Compare with pure BM25
|
|
97
|
+
sif search search "gene expression regulation"
|
|
98
|
+
|
|
99
|
+
# Compare with pure vector
|
|
100
|
+
sif search vsearch "gene expression regulation"
|
|
101
|
+
|
|
102
|
+
# Hybrid with explain to see score breakdown
|
|
103
|
+
sif search query "gene expression regulation" --explain -n 3
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Check:** Hybrid results should rank differently from pure BM25 or pure vector. `--explain` shows BM25 score, vector score, and final RRF fused score.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Test 8: Get by Filename
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Short filename (PMID number)
|
|
114
|
+
sif get get 30522467.md
|
|
115
|
+
|
|
116
|
+
# Another one
|
|
117
|
+
sif get get 11847345.md
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Check:** Can retrieve paper content via short filename
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Test 9: BM25 Keyword Search
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# English keywords
|
|
128
|
+
sif search search "chromosome conformation"
|
|
129
|
+
|
|
130
|
+
# Medical keywords
|
|
131
|
+
sif search search "poisoning paediatric"
|
|
132
|
+
|
|
133
|
+
# Cross-domain
|
|
134
|
+
sif search search "antibody immune"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Check:** Returns relevant papers, scores reasonable, highlights meaningful
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Test 10: Search Output Formats
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# JSON
|
|
145
|
+
sif search search "chromosome" --json | python -m json.tool | head -20
|
|
146
|
+
|
|
147
|
+
# CSV
|
|
148
|
+
sif search search "chromosome" --csv | head -5
|
|
149
|
+
|
|
150
|
+
# Markdown
|
|
151
|
+
sif search search "chromosome" --md | head -15
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Check:** JSON valid, CSV has headers, Markdown readable
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Test 11: ls File Tree
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
sif ls scholar-test
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Check:** Shows 1/2/3/4 subdirectory structure with paper files
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Test 12: Multi-get Batch Retrieval
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Glob pattern with byte limit
|
|
172
|
+
sif get multi-get "*.md" -b 500
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Check:** Returns multiple documents (truncated to 500 bytes each)
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Test 13: Search with Filters
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Limit results
|
|
183
|
+
sif search search "DNA" -n 3
|
|
184
|
+
|
|
185
|
+
# Minimum score filter
|
|
186
|
+
sif search search "DNA" --min-score 0.3
|
|
187
|
+
|
|
188
|
+
# Explain mode
|
|
189
|
+
sif search search "DNA" --explain
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Check:** `-n 3` returns exactly 3, `--min-score` filters low scores, `--explain` shows score breakdown
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Test 14: Context Enhancement
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# Add collection-level context
|
|
200
|
+
sif context add collection scholar-test "学术论文集合,包含生物医学研究论文,按 PMID 编号组织"
|
|
201
|
+
|
|
202
|
+
# Add path-level context
|
|
203
|
+
sif context add path /Users/forrest/SynologyDrive/Obsidian/ScholarCopilot-Dev/raw/markdown/3 "Group 3 论文"
|
|
204
|
+
|
|
205
|
+
# Verify
|
|
206
|
+
sif context list
|
|
207
|
+
|
|
208
|
+
# Check context in search results
|
|
209
|
+
sif search search "chromosome" --full
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Check:** Search results include context_description field
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Test 15: Full Content Search
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
sif search search "Saccharomyces cerevisiae" --full -n 1
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Check:** Returns full paper content (or large excerpt)
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Test 16: Cleanup
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Remove test collection
|
|
230
|
+
echo "y" | sif collection remove scholar-test
|
|
231
|
+
|
|
232
|
+
# Confirm removed
|
|
233
|
+
sif collection list
|
|
234
|
+
|
|
235
|
+
# Clean up
|
|
236
|
+
unset SIF_DB_PATH
|
|
237
|
+
rm -f /tmp/sif-scholar-test.sqlite
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Key Focus Areas
|
|
243
|
+
|
|
244
|
+
- Indexing speed and memory usage for 307 papers
|
|
245
|
+
- Short filename lookup works with PMID numbers (pure digits)
|
|
246
|
+
- Embedding generation speed (first run downloads ~1.2GB model)
|
|
247
|
+
- Vector search returns semantically relevant results (not just keyword match)
|
|
248
|
+
- Hybrid search (BM25 + Vector + RRF) produces better ranking than either alone
|
|
249
|
+
- Search performance and result truncation for long documents
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"timestamp": "2026-04-27T12:53:33Z",
|
|
4
|
+
"phase": "E2E",
|
|
5
|
+
"phase_name": "end-to-end-verification",
|
|
6
|
+
"phase_dir": ".planning",
|
|
7
|
+
"plan": 0,
|
|
8
|
+
"task": 4,
|
|
9
|
+
"total_tasks": 5,
|
|
10
|
+
"status": "paused",
|
|
11
|
+
"completed_tasks": [
|
|
12
|
+
{"id": 1, "name": "Fix all ruff lint errors and warnings", "status": "done", "commit": "pending"},
|
|
13
|
+
{"id": 2, "name": "Fix all pytest warnings", "status": "done", "commit": "pending"},
|
|
14
|
+
{"id": 3, "name": "Fix 3 E2E bugs (get-by-filename, multi-get, collection stats)", "status": "done", "commit": "pending"},
|
|
15
|
+
{"id": 4, "name": "E2E verification (automated)", "status": "done", "progress": "13/13 tests passed against temp DB"}
|
|
16
|
+
],
|
|
17
|
+
"remaining_tasks": [
|
|
18
|
+
{"id": 5, "name": "Commit all changes and run manual E2E test plan", "status": "in_progress", "progress": "Manual test plan written at .planning/E2E-manual-test-plan.md, user about to run it against real Obsidian vault"}
|
|
19
|
+
],
|
|
20
|
+
"blockers": [],
|
|
21
|
+
"human_actions_pending": [
|
|
22
|
+
{"action": "Run manual E2E test plan against /Users/forrest/SynologyDrive/Obsidian/ScholarCopilot-Dev/raw/markdown", "context": "Automated E2E passed but user wants to verify with real data (307 papers, 266MB)", "blocking": false},
|
|
23
|
+
{"action": "Re-run sif index embed with MPS (GPU) after fix", "context": "MPS device support added to embedder.py, current embed may be running on CPU", "blocking": false}
|
|
24
|
+
],
|
|
25
|
+
"decisions": [
|
|
26
|
+
{"decision": "Added MPS (Apple GPU) device detection to SentenceTransformerEmbedder and ModelScopeEmbedder", "rationale": "Code only checked CUDA, Mac users with Apple Silicon get stuck on CPU. Device selection now: CUDA > MPS > CPU", "phase": "E2E"},
|
|
27
|
+
{"decision": "Added get_by_filename() to DocumentRepository with fallback in get_cmd/multi_get_cmd", "rationale": "Users expect `sif get readme.md` to work, not just full paths", "phase": "E2E"},
|
|
28
|
+
{"decision": "Fixed _row_to_collection to include document_count and chunk_count from DB rows", "rationale": "Collection stats always showed 0 because fields were silently dropped during row-to-object conversion", "phase": "E2E"},
|
|
29
|
+
{"decision": "Added mark_indexed() method to Collection dataclass", "rationale": "DocumentIndexer called nonexistent method — latent bug not caught by tests", "phase": "E2E"}
|
|
30
|
+
],
|
|
31
|
+
"uncommitted_files": [
|
|
32
|
+
"src/sif/database/repositories.py",
|
|
33
|
+
"src/sif/cli/commands/get.py",
|
|
34
|
+
"src/sif/core/models.py",
|
|
35
|
+
"src/sif/embedding/embedder.py",
|
|
36
|
+
"tests/unit/cli/test_get.py",
|
|
37
|
+
"~50 other source/test files with ruff fixes",
|
|
38
|
+
".planning/E2E-UAT.md",
|
|
39
|
+
".planning/E2E-manual-test-plan.md",
|
|
40
|
+
".planning/debug/e2e-get-and-stats-bugs.md"
|
|
41
|
+
],
|
|
42
|
+
"next_action": "Commit all changes, then user runs manual E2E test plan against real Obsidian vault",
|
|
43
|
+
"context_notes": "Session covered: (1) ~300+ ruff lint fixes across all source and test files, (2) 3 bug fixes from E2E testing (get-by-filename, collection stats, mark_indexed), (3) MPS GPU support for Mac, (4) automated E2E verification passed 13/13 tests. User is about to run manual testing against their real Obsidian vault with 307 academic papers. They started sif index embed but it was running on CPU — MPS fix just applied, needs re-run."
|
|
44
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# DocSift
|
|
2
|
+
|
|
3
|
+
## What This Is
|
|
4
|
+
|
|
5
|
+
DocSift 是 [qmd](https://github.com/tobi/qmd) 的 Python 重构版本,一个面向个人知识库的**本地混合搜索引擎**。它索引 Markdown 笔记、文档和会议纪要,支持关键词搜索(BM25)、语义向量搜索(Vector Search),以及基于 LLM 的重排序(Rerank)和查询扩展。同时提供 CLI 工具和 MCP(Model Context Protocol)服务器两种使用方式,完全在本地运行,无需外部 API。
|
|
6
|
+
|
|
7
|
+
## Core Value
|
|
8
|
+
|
|
9
|
+
用户可以在自己的笔记和文档库中,用自然语言快速、准确地找到需要的信息——无论关键词是否匹配。
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
### Validated
|
|
14
|
+
|
|
15
|
+
- ✓ 集合(Collection)的增删改查 — 现有
|
|
16
|
+
- ✓ 基于文件扫描的文档索引(含 checksum 去重) — 现有
|
|
17
|
+
- ✓ SQLite FTS5 全文搜索(BM25) — 现有
|
|
18
|
+
- ✓ 基础混合搜索(BM25 + Vector + RRF) — 现有
|
|
19
|
+
- ✓ MCP 服务器骨架(stdio + HTTP 双传输) — 现有
|
|
20
|
+
- ✓ 多格式输出(rich table / JSON / CSV / Markdown / XML) — 现有
|
|
21
|
+
- ✓ 文档片段(chunk)和嵌入存储 — 现有
|
|
22
|
+
- ✓ 修复现有 bug 和占位实现(stub):硬编码模型路径、随机 embedding fallback、MCP 连接安全等 — Validated in Phase 01
|
|
23
|
+
- ✓ 依赖声明完整性:补全 `pyproject.toml` 中缺失的运行时依赖 — Validated in Phase 01
|
|
24
|
+
|
|
25
|
+
### Active
|
|
26
|
+
|
|
27
|
+
- ✓ 补齐缺失的 CLI 命令:multi-get、ls、update-cmd、pull — Validated in Phase 02
|
|
28
|
+
- [ ] 补齐缺失的 CLI 命令:bench
|
|
29
|
+
- [ ] 实现 LLM 重排序(rerank)和查询扩展(query expansion),达到 qmd `query` 命令的搜索质量
|
|
30
|
+
- [ ] 统一 MCP 服务器实现:整合 legacy `mcp/` 和 refactored `mcp_server/`
|
|
31
|
+
- [ ] 嵌入模型灵活可配置:支持本地 GGUF(llama-cpp-python)、sentence-transformers,以及可选的 OpenAI 兼容 API
|
|
32
|
+
|
|
33
|
+
### Out of Scope
|
|
34
|
+
|
|
35
|
+
- 多用户/权限系统 — 本地单用户工具,不需要
|
|
36
|
+
- 实时协作/同步 — 超出 qmd 原有范围
|
|
37
|
+
- Web UI — qmd 也没有,仅 CLI + MCP
|
|
38
|
+
- 非 Markdown 格式的复杂解析(如 PDF、Word)—— 先聚焦文本和代码文件
|
|
39
|
+
|
|
40
|
+
## Context
|
|
41
|
+
|
|
42
|
+
- 原始项目 qmd 使用 TypeScript / Bun 开发,依赖 `node-llama-cpp` 加载 GGUF 模型进行本地 embedding 和 rerank。
|
|
43
|
+
- 当前 docsift 代码库已完成大部分核心架构(分层设计、Repository 模式、插件化 Chunker / Searcher),但存在多处 stub、bug 和未实现的 CLI 命令。
|
|
44
|
+
- 目标是**功能对等**的 Python 版本,同时改进架构(更好的模块化、可测试性)。
|
|
45
|
+
- 需要保持与 qmd 的 CLI 命令和 MCP 工具接口兼容,方便现有用户迁移。
|
|
46
|
+
|
|
47
|
+
## Constraints
|
|
48
|
+
|
|
49
|
+
- **Tech Stack**: Python 3.9+、SQLite(FTS5 + 可选 sqlite-vec)、Click CLI、Pydantic Settings
|
|
50
|
+
- **Local-First**: 默认所有模型本地运行,不依赖外部 API;API 调用仅作为可选配置
|
|
51
|
+
- **Compatibility**: CLI 接口和 MCP Tool Schema 尽量与 qmd 保持一致
|
|
52
|
+
- **Build**: hatchling 构建后端,pytest 测试
|
|
53
|
+
|
|
54
|
+
## Key Decisions
|
|
55
|
+
|
|
56
|
+
| Decision | Rationale | Outcome |
|
|
57
|
+
|----------|-----------|---------|
|
|
58
|
+
| 完全复刻 qmd 功能 | 用户明确要求功能对等 | — In Progress |
|
|
59
|
+
| 本地模型 + API 切换双支持 | 提升灵活性和可访问性 | — In Progress |
|
|
60
|
+
| 优先修复 bug/stub,再补 CLI,再做 rerank/MCP | 先让现有代码可用,再扩展功能 | Phase 01 Complete |
|
|
61
|
+
|
|
62
|
+
## Evolution
|
|
63
|
+
|
|
64
|
+
This document evolves at phase transitions and milestone boundaries.
|
|
65
|
+
|
|
66
|
+
**After each phase transition** (via `/gsd-transition`):
|
|
67
|
+
1. Requirements invalidated? → Move to Out of Scope with reason
|
|
68
|
+
2. Requirements validated? → Move to Validated with phase reference
|
|
69
|
+
3. New requirements emerged? → Add to Active
|
|
70
|
+
4. Decisions to log? → Add to Key Decisions
|
|
71
|
+
5. "What This Is" still accurate? → Update if drifted
|
|
72
|
+
|
|
73
|
+
**After each milestone** (via `/gsd-complete-milestone`):
|
|
74
|
+
1. Full review of all sections
|
|
75
|
+
2. Core Value check — still the right priority?
|
|
76
|
+
3. Audit Out of Scope — reasons still valid?
|
|
77
|
+
4. Update Context with current state
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
*Last updated: 2026-04-16 after Phase 02 completion*
|