deepdoc 1.2.0__tar.gz → 1.4.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.
Files changed (132) hide show
  1. {deepdoc-1.2.0 → deepdoc-1.4.0}/PKG-INFO +139 -21
  2. {deepdoc-1.2.0 → deepdoc-1.4.0}/README.md +138 -20
  3. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/__init__.py +1 -1
  4. deepdoc-1.4.0/deepdoc/benchmark_v2.py +682 -0
  5. deepdoc-1.4.0/deepdoc/chatbot/deep_research.py +674 -0
  6. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/indexer.py +12 -0
  7. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/persistence.py +19 -0
  8. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/scaffold.py +12 -0
  9. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/service.py +611 -87
  10. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/settings.py +20 -7
  11. deepdoc-1.4.0/deepdoc/chatbot/source_archive.py +180 -0
  12. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/cli.py +202 -3
  13. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/config.py +20 -7
  14. deepdoc-1.4.0/deepdoc/generator/__init__.py +25 -0
  15. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/generator/generation.py +8 -0
  16. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/generator/post_processors.py +252 -14
  17. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/generator/validation.py +116 -13
  18. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/llm/json_utils.py +9 -2
  19. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/pipeline_v2.py +8 -0
  20. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/planner/heuristics.py +280 -20
  21. deepdoc-1.4.0/deepdoc/scanner/__init__.py +50 -0
  22. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/scanner/database.py +130 -14
  23. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/site/builder/templates.py +537 -39
  24. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc.egg-info/PKG-INFO +139 -21
  25. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc.egg-info/SOURCES.txt +3 -0
  26. {deepdoc-1.2.0 → deepdoc-1.4.0}/pyproject.toml +1 -1
  27. deepdoc-1.4.0/tests/test_benchmark_scorecard.py +409 -0
  28. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_config.py +24 -0
  29. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_query.py +1021 -16
  30. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_scaffold.py +38 -6
  31. deepdoc-1.4.0/tests/test_chatbot_source_archive.py +132 -0
  32. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_fumadocs_builder.py +238 -32
  33. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_generation_evidence.py +185 -0
  34. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_internal_docs_metadata.py +54 -8
  35. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_llm_json_utils.py +42 -3
  36. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_planner_granularity.py +104 -0
  37. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_runtime_scan.py +31 -0
  38. deepdoc-1.2.0/deepdoc/benchmark_v2.py +0 -150
  39. deepdoc-1.2.0/deepdoc/chatbot/deep_research.py +0 -333
  40. deepdoc-1.2.0/deepdoc/generator/__init__.py +0 -4
  41. deepdoc-1.2.0/deepdoc/scanner/__init__.py +0 -8
  42. {deepdoc-1.2.0 → deepdoc-1.4.0}/LICENSE +0 -0
  43. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/__main__.py +0 -0
  44. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/_legacy_types.py +0 -0
  45. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/call_graph.py +0 -0
  46. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/__init__.py +0 -0
  47. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/chunker.py +0 -0
  48. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/docs_summary.py +0 -0
  49. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/embeddings.py +0 -0
  50. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/linking.py +0 -0
  51. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/providers.py +0 -0
  52. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/chatbot/types.py +0 -0
  53. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/generator/evidence.py +0 -0
  54. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/llm/__init__.py +0 -0
  55. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/llm/client.py +0 -0
  56. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/llm/litellm_compat.py +0 -0
  57. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/manifest.py +0 -0
  58. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/openapi.py +0 -0
  59. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/__init__.py +0 -0
  60. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/api_detector.py +0 -0
  61. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/base.py +0 -0
  62. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/go_parser.py +0 -0
  63. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/js_ts_parser.py +0 -0
  64. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/php_parser.py +0 -0
  65. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/python_parser.py +0 -0
  66. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/registry.py +0 -0
  67. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/__init__.py +0 -0
  68. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/base.py +0 -0
  69. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/common.py +0 -0
  70. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/detector.py +0 -0
  71. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/django.py +0 -0
  72. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/express.py +0 -0
  73. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/falcon.py +0 -0
  74. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/fastify.py +0 -0
  75. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/go.py +0 -0
  76. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/js_shared.py +0 -0
  77. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/laravel.py +0 -0
  78. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/nestjs.py +0 -0
  79. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/python_shared.py +0 -0
  80. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/registry.py +0 -0
  81. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/routes/repo_resolver.py +0 -0
  82. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/parser/vue_parser.py +0 -0
  83. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/persistence_v2.py +0 -0
  84. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/planner/__init__.py +0 -0
  85. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/planner/common.py +0 -0
  86. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/planner/engine.py +0 -0
  87. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/planner/specializations.py +0 -0
  88. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/planner/utils.py +0 -0
  89. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/prompts_v2.py +0 -0
  90. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/py.typed +0 -0
  91. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/scanner/artifacts.py +0 -0
  92. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/scanner/clustering.py +0 -0
  93. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/scanner/common.py +0 -0
  94. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/scanner/endpoints.py +0 -0
  95. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/scanner/integrations.py +0 -0
  96. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/scanner/runtime.py +0 -0
  97. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/scanner/utils.py +0 -0
  98. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/site/__init__.py +0 -0
  99. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/site/builder/__init__.py +0 -0
  100. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/site/builder/common.py +0 -0
  101. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/site/builder/engine.py +0 -0
  102. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/site/builder/mdx_utils.py +0 -0
  103. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/smart_update_v2.py +0 -0
  104. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/source_metadata.py +0 -0
  105. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/updater_v2.py +0 -0
  106. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc/v2_models.py +0 -0
  107. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc.egg-info/dependency_links.txt +0 -0
  108. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc.egg-info/entry_points.txt +0 -0
  109. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc.egg-info/requires.txt +0 -0
  110. {deepdoc-1.2.0 → deepdoc-1.4.0}/deepdoc.egg-info/top_level.txt +0 -0
  111. {deepdoc-1.2.0 → deepdoc-1.4.0}/setup.cfg +0 -0
  112. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_call_graph.py +0 -0
  113. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_embeddings.py +0 -0
  114. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_eval.py +0 -0
  115. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_index.py +0 -0
  116. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_persistence.py +0 -0
  117. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_providers.py +0 -0
  118. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_chatbot_relationship.py +0 -0
  119. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_classify.py +0 -0
  120. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_cli_generate.py +0 -0
  121. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_cli_serve.py +0 -0
  122. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_cli_update.py +0 -0
  123. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_framework_fixtures.py +0 -0
  124. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_framework_support.py +0 -0
  125. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_litellm_compat.py +0 -0
  126. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_parallel_pipeline.py +0 -0
  127. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_parser_ranges.py +0 -0
  128. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_planner_consolidation.py +0 -0
  129. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_route_registry.py +0 -0
  130. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_smart_update.py +0 -0
  131. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_stale.py +0 -0
  132. {deepdoc-1.2.0 → deepdoc-1.4.0}/tests/test_state.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepdoc
3
- Version: 1.2.0
3
+ Version: 1.4.0
4
4
  Summary: Auto-generate beautiful docs from any codebase
5
5
  Author: Pranav Kumar
6
6
  License: MIT
@@ -55,6 +55,8 @@ DeepDoc scans your repo, builds a bucket-based documentation plan, generates ric
55
55
  - **Five-Phase Pipeline** — Scan, plan, generate, playground, build. Planning and generation are separated so large repos and large files are handled more cleanly.
56
56
  - **Multi-Step AI Planner** — The planner classifies the repo, proposes buckets, then assigns files, symbols, artifacts, and dependencies into the final doc structure.
57
57
  - **Giant-File Handling** — Large files are decomposed into feature-aligned clusters so giant controllers or service files can feed multiple doc pages.
58
+ - **Reader-First Repo-Agnostic Nav** — The planner normalizes bucket output into a natural onboarding flow (for backend repos: Start Here → Core Workflows → API Reference → Data Model → runtime/integrations/ops) while preserving full coverage.
59
+ - **Large-Database Anti-Noise Grouping** — Sparse singleton model files are coalesced into stable aggregate groups (for example `core-models`) so huge schemas stay complete without one-file-per-page nav spam.
58
60
  - **Endpoint-Family + Per-Endpoint Docs** — High-level endpoint family pages are AI-planned, and individual `endpoint_ref` pages are derived from scan data and generated separately.
59
61
  - **Integration Discovery** — Third-party systems like payment gateways, delivery providers, warehouse systems, and webhook integrations can be grouped into integration docs.
60
62
  - **Incremental Updates** — `deepdoc update` uses persisted plan and ledger data to regenerate only stale or structurally affected docs.
@@ -310,6 +312,22 @@ deepdoc config set output_dir documentation # Change output dir
310
312
  deepdoc config set llm.api_key_env AZURE_API_KEY # Change API key env var
311
313
  ```
312
314
 
315
+ ### `deepdoc benchmark`
316
+
317
+ Run planner benchmark cases and optionally generate a combined docs+chatbot quality scorecard.
318
+
319
+ ```bash
320
+ deepdoc benchmark --catalog benchmarks/catalog.json
321
+ deepdoc benchmark --repo /path/to/repo --gold benchmarks/gold.json
322
+ deepdoc benchmark --catalog benchmarks/catalog.json --chatbot-eval benchmarks/chatbot_eval.json
323
+ deepdoc benchmark --catalog benchmarks/catalog.json --chatbot-eval benchmarks/chatbot_eval.json --scorecard-out .deepdoc/quality_scorecard.json --strict-scorecard
324
+ deepdoc benchmark --generated-root /Users/apple/autodoc/docs --scorecard-out /Users/apple/autodoc/docs/_scorecards/latest.json
325
+ ```
326
+
327
+ Use `--strict-scorecard` to fail the command when completeness gates are not met.
328
+
329
+ When you do not have a hand-written benchmark catalog or chatbot eval file yet, use artifact mode (`--generated-root` or `--artifact-repo`) to compute a provisional scorecard directly from persisted `.deepdoc/` outputs.
330
+
313
331
  ---
314
332
 
315
333
  ## LLM Provider Setup
@@ -618,7 +636,9 @@ chatbot:
618
636
  base_url: ""
619
637
  api_version: ""
620
638
  temperature: 0.1
621
- max_tokens: 16000
639
+ max_tokens: 24000
640
+ continuation_retries: 2 # Auto-continue if answer ends abruptly
641
+ continuation_context_chars: 12000 # Tail chars included in continuation prompt
622
642
 
623
643
  embeddings: # LLM used for embedding code/docs
624
644
  provider: "azure"
@@ -643,16 +663,25 @@ chatbot:
643
663
  top_k_code: 15
644
664
  top_k_artifact: 8
645
665
  top_k_docs: 6
646
- top_k_relationship: 6
666
+ top_k_relationship: 8
647
667
  candidate_top_k_code: 30
648
668
  candidate_top_k_artifact: 16
649
669
  candidate_top_k_docs: 12
650
670
  candidate_top_k_relationship: 12
651
671
  max_prompt_code_chunks: 12
652
672
  max_prompt_artifact_chunks: 6
653
- max_prompt_doc_chunks: 4
654
- max_prompt_relationship_chunks: 4
655
- max_prompt_chars: 200000
673
+ max_prompt_doc_chunks: 6
674
+ max_prompt_relationship_chunks: 6
675
+ max_prompt_chars: 120000
676
+ fast_mode_use_llm_retrieval_steps: false # Fast mode skips expansion/rerank by default
677
+ fast_mode_iterative_retrieval: false # Fast mode skips second-pass follow-up retrieval
678
+ fast_mode_max_prompt_chars: 90000 # Smaller prompt budget for faster /query answers
679
+ deep_mode_max_prompt_chars: 140000 # Larger budget for /deep-research synthesis
680
+ code_deep_mode_max_prompt_chars: 180000 # Largest prompt budget for /code-deep
681
+ code_deep_top_k: 16 # Code chunks retrieved for code-aware mode
682
+ code_deep_top_k_relationship: 12 # Relationship chunks retrieved for code-aware mode
683
+ code_deep_top_k_docs: 4 # Cap docs chunks in code-aware mode
684
+ code_deep_file_inventory_limit: 18 # Max files listed in code-aware inventory
656
685
  lexical_retrieval: true
657
686
  lexical_candidate_limit: 24
658
687
  query_expansion: true
@@ -666,7 +695,8 @@ chatbot:
666
695
  graph_neighbor_relationship_chunks_per_file: 2
667
696
  graph_neighbor_max_docs: 4
668
697
  rerank: true
669
- rerank_candidate_limit: 20
698
+ rerank_candidate_limit: 32
699
+ rerank_candidate_limit_per_kind: 8
670
700
  rerank_preview_chars: 450
671
701
  stitch_adjacent_code_chunks: true
672
702
  stitch_max_adjacent_chunks: 2
@@ -674,7 +704,8 @@ chatbot:
674
704
  live_fallback_max_files: 6
675
705
  live_fallback_max_per_file: 2
676
706
  live_fallback_context_lines: 12
677
- deep_research_chunk_chars: 1600
707
+ deep_research_chunk_chars: 3200
708
+ deep_research_top_k: 10
678
709
 
679
710
  chunking:
680
711
  code_chunk_lines: 120
@@ -709,7 +740,9 @@ chatbot:
709
740
  | `chatbot.answer.base_url` | `""` | Custom endpoint (for Azure, Ollama, etc.) |
710
741
  | `chatbot.answer.api_version` | `""` | Azure API version string |
711
742
  | `chatbot.answer.temperature` | `0.1` | Sampling temperature (lower = more deterministic) |
712
- | `chatbot.answer.max_tokens` | `16000` | Max tokens per answer |
743
+ | `chatbot.answer.max_tokens` | `24000` | Max tokens per answer |
744
+ | `chatbot.answer.continuation_retries` | `2` | Extra completion attempts when an answer appears truncated |
745
+ | `chatbot.answer.continuation_context_chars` | `12000` | Number of trailing chars passed when asking the model to continue |
713
746
  | **Embeddings LLM** | | |
714
747
  | `chatbot.embeddings.provider` | `azure` | Provider for the embedding model |
715
748
  | `chatbot.embeddings.model` | `azure/text-embedding-3-large` | Embedding model |
@@ -721,16 +754,25 @@ chatbot:
721
754
  | `chatbot.retrieval.top_k_code` | `15` | Top code chunks retrieved per query |
722
755
  | `chatbot.retrieval.top_k_artifact` | `8` | Top artifact chunks retrieved per query |
723
756
  | `chatbot.retrieval.top_k_docs` | `6` | Top generated-doc and repo-doc chunks retrieved per query |
724
- | `chatbot.retrieval.top_k_relationship` | `6` | Top relationship chunks retrieved per query |
757
+ | `chatbot.retrieval.top_k_relationship` | `8` | Top relationship chunks retrieved per query |
725
758
  | `chatbot.retrieval.candidate_top_k_code` | `30` | Candidate code chunks gathered before reranking |
726
759
  | `chatbot.retrieval.candidate_top_k_artifact` | `16` | Candidate artifact chunks gathered before reranking |
727
760
  | `chatbot.retrieval.candidate_top_k_docs` | `12` | Candidate doc chunks gathered before reranking |
728
761
  | `chatbot.retrieval.candidate_top_k_relationship` | `12` | Candidate relationship chunks gathered before reranking |
729
762
  | `chatbot.retrieval.max_prompt_code_chunks` | `12` | Max code chunks included in the final prompt |
730
763
  | `chatbot.retrieval.max_prompt_artifact_chunks` | `6` | Max artifact chunks in the final prompt |
731
- | `chatbot.retrieval.max_prompt_doc_chunks` | `4` | Max doc chunks in the final prompt |
732
- | `chatbot.retrieval.max_prompt_relationship_chunks` | `4` | Max relationship chunks included in the final prompt |
733
- | `chatbot.retrieval.max_prompt_chars` | `200000` | Total character budget for the assembled prompt |
764
+ | `chatbot.retrieval.max_prompt_doc_chunks` | `6` | Max doc chunks in the final prompt |
765
+ | `chatbot.retrieval.max_prompt_relationship_chunks` | `6` | Max relationship chunks included in the final prompt |
766
+ | `chatbot.retrieval.max_prompt_chars` | `120000` | Default character budget for assembled prompts |
767
+ | `chatbot.retrieval.fast_mode_use_llm_retrieval_steps` | `false` | In `/query` fast mode, disable LLM query expansion and reranking |
768
+ | `chatbot.retrieval.fast_mode_iterative_retrieval` | `false` | In `/query` fast mode, disable iterative follow-up retrieval |
769
+ | `chatbot.retrieval.fast_mode_max_prompt_chars` | `90000` | Prompt budget used by `/query` fast mode |
770
+ | `chatbot.retrieval.deep_mode_max_prompt_chars` | `140000` | Prompt budget used by `/deep-research` |
771
+ | `chatbot.retrieval.code_deep_mode_max_prompt_chars` | `180000` | Prompt budget used by `/code-deep` |
772
+ | `chatbot.retrieval.code_deep_top_k` | `16` | Code chunks retrieved in code-aware mode |
773
+ | `chatbot.retrieval.code_deep_top_k_relationship` | `12` | Relationship chunks retrieved in code-aware mode |
774
+ | `chatbot.retrieval.code_deep_top_k_docs` | `4` | Docs chunk cap in code-aware mode |
775
+ | `chatbot.retrieval.code_deep_file_inventory_limit` | `18` | Max files listed in code-aware inventory |
734
776
  | `chatbot.retrieval.lexical_retrieval` | `true` | Blend exact-match retrieval with embedding retrieval |
735
777
  | `chatbot.retrieval.lexical_candidate_limit` | `24` | Max lexical candidates gathered before merge/rerank |
736
778
  | `chatbot.retrieval.query_expansion` | `true` | Use LLM to generate alternative search queries |
@@ -744,7 +786,8 @@ chatbot:
744
786
  | `chatbot.retrieval.graph_neighbor_relationship_chunks_per_file` | `2` | Relationship chunks per linked file during graph expansion |
745
787
  | `chatbot.retrieval.graph_neighbor_max_docs` | `4` | Max linked docs pulled in during graph expansion |
746
788
  | `chatbot.retrieval.rerank` | `true` | Use LLM to rerank retrieved chunks |
747
- | `chatbot.retrieval.rerank_candidate_limit` | `20` | Max candidates sent to the reranker |
789
+ | `chatbot.retrieval.rerank_candidate_limit` | `32` | Max candidates sent to the reranker |
790
+ | `chatbot.retrieval.rerank_candidate_limit_per_kind` | `8` | Per-kind candidate cap before filling the global rerank pool |
748
791
  | `chatbot.retrieval.rerank_preview_chars` | `450` | Characters of each chunk shown to the reranker |
749
792
  | `chatbot.retrieval.stitch_adjacent_code_chunks` | `true` | Expand exact-match code hits with adjacent windows from the same file |
750
793
  | `chatbot.retrieval.stitch_max_adjacent_chunks` | `2` | Max adjacent code windows stitched onto a top hit |
@@ -752,7 +795,8 @@ chatbot:
752
795
  | `chatbot.retrieval.live_fallback_max_files` | `6` | Max repo files inspected during a deep-research live fallback |
753
796
  | `chatbot.retrieval.live_fallback_max_per_file` | `2` | Max fallback snippets returned per inspected file |
754
797
  | `chatbot.retrieval.live_fallback_context_lines` | `12` | Lines per fallback snippet around each exact match |
755
- | `chatbot.retrieval.deep_research_chunk_chars` | `1600` | Max chars per evidence chunk passed into deep-research step answers |
798
+ | `chatbot.retrieval.deep_research_chunk_chars` | `3200` | Max chars per evidence chunk passed into deep-research step answers |
799
+ | `chatbot.retrieval.deep_research_top_k` | `10` | Retrieved chunks per deep-research sub-question |
756
800
  | **Chunking** | | |
757
801
  | `chatbot.chunking.code_chunk_lines` | `120` | Lines per code chunk |
758
802
  | `chatbot.chunking.code_chunk_overlap` | `20` | Overlap lines between code chunks |
@@ -829,22 +873,26 @@ During `deepdoc generate`, six corpora are built and stored in `.deepdoc/chatbot
829
873
 
830
874
  ### Chatbot Query Pipeline
831
875
 
832
- When a user asks a question, the backend runs a multi-step retrieval pipeline:
876
+ When a user asks a question, the backend runs a mode-aware retrieval pipeline:
833
877
 
834
- 1. **Query expansion** — The LLM generates up to 3 alternative search queries to improve recall.
878
+ 1. **Query expansion** — In default/deep/code-aware mode, the LLM can generate alternative search queries to improve recall. Fast mode disables this by default.
835
879
  2. **Embedding** — All queries are embedded using the configured embedding model.
836
880
  3. **Hybrid retrieval** — FAISS similarity search and exact-match lexical search both gather candidates from each corpus.
837
- 4. **Follow-up retrieval** — The backend can derive focused second-pass searches and pull linked files/docs via graph-neighbor expansion.
881
+ 4. **Follow-up retrieval** — The backend can derive focused second-pass searches and pull linked files/docs via graph-neighbor expansion. Fast mode can skip follow-up queries for lower latency.
838
882
  5. **Chunk stitching** — Exact-match code hits can pull adjacent code windows from the same file so larger implementations survive chunk boundaries.
839
- 6. **Reranking** — The LLM scores and reranks the retrieved chunks for relevance.
883
+ 6. **Reranking** — In default/deep/code-aware mode, the LLM can rerank candidates for relevance. Fast mode disables this by default.
840
884
  7. **Prompt assembly** — Query-type-aware budgets reserve space for the most important evidence types within the character budget.
841
- 8. **Answer generation** — The answer LLM produces a grounded response with code, artifact, doc, repo-doc, relationship, and live-fallback citations when used.
885
+ 8. **Answer generation + continuity guard** — The answer LLM produces a grounded response, and if the output appears truncated (for example ending on a dangling heading), DeepDoc retries with a continuation prompt so the response finishes cleanly.
842
886
 
843
887
  `POST /deep-research` uses the same indexed corpora first, but it can also inspect a small bounded set of live repo files when exact-match evidence is missing from the index. This fallback respects the repo's exclude rules, skips oversized/binary files, and is only used in deep research mode.
844
888
 
889
+ `POST /code-deep` uses a code-heavy retrieval profile and returns an explicit file inventory plus step trace so users can see where evidence came from while answering file-oriented questions such as “where is auth defined?”.
890
+
891
+ `POST /query`, `POST /deep-research`, and `POST /code-deep` return `response_mode` in the payload (`fast`, `deep`, `code_deep`, or `default`) so clients can confirm which retrieval profile generated the result.
892
+
845
893
  ### Chatbot API Endpoints
846
894
 
847
- The generated `chatbot_backend/` exposes two endpoints:
895
+ The generated `chatbot_backend/` exposes five endpoints:
848
896
 
849
897
  **Health check:**
850
898
  ```
@@ -865,6 +913,43 @@ POST /query
865
913
 
866
914
  The response includes the answer text, code citations (file path + line range), artifact citations, and links to relevant generated doc pages.
867
915
 
916
+ `/query` is optimized for speed: it runs retrieval in fast mode (no LLM query expansion/rerank by default) and returns an answer plus citations.
917
+
918
+ **Code-aware deep query:**
919
+ ```
920
+ POST /code-deep
921
+ {
922
+ "question": "Where is authentication defined?",
923
+ "history": [],
924
+ "max_rounds": 4
925
+ }
926
+ ```
927
+
928
+ `/code-deep` returns a code-aware answer plus `trace` and `file_inventory` fields so clients can show reasoning progress and files considered.
929
+
930
+ **Code-aware live stream (SSE):**
931
+ ```
932
+ POST /code-deep/stream
933
+ {
934
+ "question": "Where is authentication defined?",
935
+ "history": [],
936
+ "max_rounds": 4
937
+ }
938
+ ```
939
+
940
+ `/code-deep/stream` emits `trace` events while researching, then a final `result` event and `done`.
941
+
942
+ **Retrieve context only (no answer generation):**
943
+ ```
944
+ POST /query-context
945
+ {
946
+ "question": "Where is reshipping implemented?",
947
+ "history": []
948
+ }
949
+ ```
950
+
951
+ `/query-context` returns selected citations/chunks only. Use this endpoint to inspect retrieval quality independently from answer generation.
952
+
868
953
  ### Deploying the Chatbot
869
954
 
870
955
  For local development, `deepdoc serve` handles everything automatically. For production:
@@ -1111,6 +1196,15 @@ Add your API key to repo Settings → Secrets → Actions → `ANTHROPIC_API_KEY
1111
1196
 
1112
1197
  DeepDoc now supports automated releases through GitHub Actions.
1113
1198
 
1199
+ ### Release tracks
1200
+
1201
+ This repository now has two independent release tracks:
1202
+
1203
+ - **Python package (`deepdoc`)**: controlled by `pyproject.toml`, root `CHANGELOG.md`, and `.github/workflows/release.yml`.
1204
+ - **VS Code extension (`vscode-extension/`)**: controlled by `vscode-extension/package.json`, `vscode-extension/CHANGELOG.md`, and `.github/workflows/release-vscode-extension.yml`.
1205
+
1206
+ Keep versions and changelog entries separated by track.
1207
+
1114
1208
  ### What happens automatically
1115
1209
 
1116
1210
  When you push to `main`, the release workflow checks the version in `pyproject.toml`.
@@ -1168,6 +1262,30 @@ If the matching version section is missing, GitHub falls back to auto-generated
1168
1262
 
1169
1263
  After that, every new version pushed to `main` can publish without a PyPI token.
1170
1264
 
1265
+ ### VS Code extension release flow
1266
+
1267
+ The VS Code extension release is automated from `main` when files under `vscode-extension/` change.
1268
+
1269
+ What the extension workflow does:
1270
+
1271
+ - reads `vscode-extension/package.json` version
1272
+ - checks whether tag `vscode-extension-v<version>` already exists
1273
+ - builds and packages the extension
1274
+ - publishes to Marketplace using `VSCE_PAT`
1275
+ - creates and pushes the matching git tag
1276
+ - creates a GitHub release with notes from `vscode-extension/CHANGELOG.md` (fallback to generated notes)
1277
+
1278
+ One-time setup for extension publishing:
1279
+
1280
+ 1. Create a VS Code Marketplace PAT with Manage scope for publisher `Pranawww`
1281
+ 2. Add repo secret `VSCE_PAT` in GitHub Actions secrets
1282
+
1283
+ Extension release flow on each version:
1284
+
1285
+ 1. Update `vscode-extension/package.json` version
1286
+ 2. Add matching section to `vscode-extension/CHANGELOG.md`
1287
+ 3. Commit and push to `main`
1288
+
1171
1289
  ---
1172
1290
 
1173
1291
  ## Typical Workflow
@@ -16,6 +16,8 @@ DeepDoc scans your repo, builds a bucket-based documentation plan, generates ric
16
16
  - **Five-Phase Pipeline** — Scan, plan, generate, playground, build. Planning and generation are separated so large repos and large files are handled more cleanly.
17
17
  - **Multi-Step AI Planner** — The planner classifies the repo, proposes buckets, then assigns files, symbols, artifacts, and dependencies into the final doc structure.
18
18
  - **Giant-File Handling** — Large files are decomposed into feature-aligned clusters so giant controllers or service files can feed multiple doc pages.
19
+ - **Reader-First Repo-Agnostic Nav** — The planner normalizes bucket output into a natural onboarding flow (for backend repos: Start Here → Core Workflows → API Reference → Data Model → runtime/integrations/ops) while preserving full coverage.
20
+ - **Large-Database Anti-Noise Grouping** — Sparse singleton model files are coalesced into stable aggregate groups (for example `core-models`) so huge schemas stay complete without one-file-per-page nav spam.
19
21
  - **Endpoint-Family + Per-Endpoint Docs** — High-level endpoint family pages are AI-planned, and individual `endpoint_ref` pages are derived from scan data and generated separately.
20
22
  - **Integration Discovery** — Third-party systems like payment gateways, delivery providers, warehouse systems, and webhook integrations can be grouped into integration docs.
21
23
  - **Incremental Updates** — `deepdoc update` uses persisted plan and ledger data to regenerate only stale or structurally affected docs.
@@ -271,6 +273,22 @@ deepdoc config set output_dir documentation # Change output dir
271
273
  deepdoc config set llm.api_key_env AZURE_API_KEY # Change API key env var
272
274
  ```
273
275
 
276
+ ### `deepdoc benchmark`
277
+
278
+ Run planner benchmark cases and optionally generate a combined docs+chatbot quality scorecard.
279
+
280
+ ```bash
281
+ deepdoc benchmark --catalog benchmarks/catalog.json
282
+ deepdoc benchmark --repo /path/to/repo --gold benchmarks/gold.json
283
+ deepdoc benchmark --catalog benchmarks/catalog.json --chatbot-eval benchmarks/chatbot_eval.json
284
+ deepdoc benchmark --catalog benchmarks/catalog.json --chatbot-eval benchmarks/chatbot_eval.json --scorecard-out .deepdoc/quality_scorecard.json --strict-scorecard
285
+ deepdoc benchmark --generated-root /Users/apple/autodoc/docs --scorecard-out /Users/apple/autodoc/docs/_scorecards/latest.json
286
+ ```
287
+
288
+ Use `--strict-scorecard` to fail the command when completeness gates are not met.
289
+
290
+ When you do not have a hand-written benchmark catalog or chatbot eval file yet, use artifact mode (`--generated-root` or `--artifact-repo`) to compute a provisional scorecard directly from persisted `.deepdoc/` outputs.
291
+
274
292
  ---
275
293
 
276
294
  ## LLM Provider Setup
@@ -579,7 +597,9 @@ chatbot:
579
597
  base_url: ""
580
598
  api_version: ""
581
599
  temperature: 0.1
582
- max_tokens: 16000
600
+ max_tokens: 24000
601
+ continuation_retries: 2 # Auto-continue if answer ends abruptly
602
+ continuation_context_chars: 12000 # Tail chars included in continuation prompt
583
603
 
584
604
  embeddings: # LLM used for embedding code/docs
585
605
  provider: "azure"
@@ -604,16 +624,25 @@ chatbot:
604
624
  top_k_code: 15
605
625
  top_k_artifact: 8
606
626
  top_k_docs: 6
607
- top_k_relationship: 6
627
+ top_k_relationship: 8
608
628
  candidate_top_k_code: 30
609
629
  candidate_top_k_artifact: 16
610
630
  candidate_top_k_docs: 12
611
631
  candidate_top_k_relationship: 12
612
632
  max_prompt_code_chunks: 12
613
633
  max_prompt_artifact_chunks: 6
614
- max_prompt_doc_chunks: 4
615
- max_prompt_relationship_chunks: 4
616
- max_prompt_chars: 200000
634
+ max_prompt_doc_chunks: 6
635
+ max_prompt_relationship_chunks: 6
636
+ max_prompt_chars: 120000
637
+ fast_mode_use_llm_retrieval_steps: false # Fast mode skips expansion/rerank by default
638
+ fast_mode_iterative_retrieval: false # Fast mode skips second-pass follow-up retrieval
639
+ fast_mode_max_prompt_chars: 90000 # Smaller prompt budget for faster /query answers
640
+ deep_mode_max_prompt_chars: 140000 # Larger budget for /deep-research synthesis
641
+ code_deep_mode_max_prompt_chars: 180000 # Largest prompt budget for /code-deep
642
+ code_deep_top_k: 16 # Code chunks retrieved for code-aware mode
643
+ code_deep_top_k_relationship: 12 # Relationship chunks retrieved for code-aware mode
644
+ code_deep_top_k_docs: 4 # Cap docs chunks in code-aware mode
645
+ code_deep_file_inventory_limit: 18 # Max files listed in code-aware inventory
617
646
  lexical_retrieval: true
618
647
  lexical_candidate_limit: 24
619
648
  query_expansion: true
@@ -627,7 +656,8 @@ chatbot:
627
656
  graph_neighbor_relationship_chunks_per_file: 2
628
657
  graph_neighbor_max_docs: 4
629
658
  rerank: true
630
- rerank_candidate_limit: 20
659
+ rerank_candidate_limit: 32
660
+ rerank_candidate_limit_per_kind: 8
631
661
  rerank_preview_chars: 450
632
662
  stitch_adjacent_code_chunks: true
633
663
  stitch_max_adjacent_chunks: 2
@@ -635,7 +665,8 @@ chatbot:
635
665
  live_fallback_max_files: 6
636
666
  live_fallback_max_per_file: 2
637
667
  live_fallback_context_lines: 12
638
- deep_research_chunk_chars: 1600
668
+ deep_research_chunk_chars: 3200
669
+ deep_research_top_k: 10
639
670
 
640
671
  chunking:
641
672
  code_chunk_lines: 120
@@ -670,7 +701,9 @@ chatbot:
670
701
  | `chatbot.answer.base_url` | `""` | Custom endpoint (for Azure, Ollama, etc.) |
671
702
  | `chatbot.answer.api_version` | `""` | Azure API version string |
672
703
  | `chatbot.answer.temperature` | `0.1` | Sampling temperature (lower = more deterministic) |
673
- | `chatbot.answer.max_tokens` | `16000` | Max tokens per answer |
704
+ | `chatbot.answer.max_tokens` | `24000` | Max tokens per answer |
705
+ | `chatbot.answer.continuation_retries` | `2` | Extra completion attempts when an answer appears truncated |
706
+ | `chatbot.answer.continuation_context_chars` | `12000` | Number of trailing chars passed when asking the model to continue |
674
707
  | **Embeddings LLM** | | |
675
708
  | `chatbot.embeddings.provider` | `azure` | Provider for the embedding model |
676
709
  | `chatbot.embeddings.model` | `azure/text-embedding-3-large` | Embedding model |
@@ -682,16 +715,25 @@ chatbot:
682
715
  | `chatbot.retrieval.top_k_code` | `15` | Top code chunks retrieved per query |
683
716
  | `chatbot.retrieval.top_k_artifact` | `8` | Top artifact chunks retrieved per query |
684
717
  | `chatbot.retrieval.top_k_docs` | `6` | Top generated-doc and repo-doc chunks retrieved per query |
685
- | `chatbot.retrieval.top_k_relationship` | `6` | Top relationship chunks retrieved per query |
718
+ | `chatbot.retrieval.top_k_relationship` | `8` | Top relationship chunks retrieved per query |
686
719
  | `chatbot.retrieval.candidate_top_k_code` | `30` | Candidate code chunks gathered before reranking |
687
720
  | `chatbot.retrieval.candidate_top_k_artifact` | `16` | Candidate artifact chunks gathered before reranking |
688
721
  | `chatbot.retrieval.candidate_top_k_docs` | `12` | Candidate doc chunks gathered before reranking |
689
722
  | `chatbot.retrieval.candidate_top_k_relationship` | `12` | Candidate relationship chunks gathered before reranking |
690
723
  | `chatbot.retrieval.max_prompt_code_chunks` | `12` | Max code chunks included in the final prompt |
691
724
  | `chatbot.retrieval.max_prompt_artifact_chunks` | `6` | Max artifact chunks in the final prompt |
692
- | `chatbot.retrieval.max_prompt_doc_chunks` | `4` | Max doc chunks in the final prompt |
693
- | `chatbot.retrieval.max_prompt_relationship_chunks` | `4` | Max relationship chunks included in the final prompt |
694
- | `chatbot.retrieval.max_prompt_chars` | `200000` | Total character budget for the assembled prompt |
725
+ | `chatbot.retrieval.max_prompt_doc_chunks` | `6` | Max doc chunks in the final prompt |
726
+ | `chatbot.retrieval.max_prompt_relationship_chunks` | `6` | Max relationship chunks included in the final prompt |
727
+ | `chatbot.retrieval.max_prompt_chars` | `120000` | Default character budget for assembled prompts |
728
+ | `chatbot.retrieval.fast_mode_use_llm_retrieval_steps` | `false` | In `/query` fast mode, disable LLM query expansion and reranking |
729
+ | `chatbot.retrieval.fast_mode_iterative_retrieval` | `false` | In `/query` fast mode, disable iterative follow-up retrieval |
730
+ | `chatbot.retrieval.fast_mode_max_prompt_chars` | `90000` | Prompt budget used by `/query` fast mode |
731
+ | `chatbot.retrieval.deep_mode_max_prompt_chars` | `140000` | Prompt budget used by `/deep-research` |
732
+ | `chatbot.retrieval.code_deep_mode_max_prompt_chars` | `180000` | Prompt budget used by `/code-deep` |
733
+ | `chatbot.retrieval.code_deep_top_k` | `16` | Code chunks retrieved in code-aware mode |
734
+ | `chatbot.retrieval.code_deep_top_k_relationship` | `12` | Relationship chunks retrieved in code-aware mode |
735
+ | `chatbot.retrieval.code_deep_top_k_docs` | `4` | Docs chunk cap in code-aware mode |
736
+ | `chatbot.retrieval.code_deep_file_inventory_limit` | `18` | Max files listed in code-aware inventory |
695
737
  | `chatbot.retrieval.lexical_retrieval` | `true` | Blend exact-match retrieval with embedding retrieval |
696
738
  | `chatbot.retrieval.lexical_candidate_limit` | `24` | Max lexical candidates gathered before merge/rerank |
697
739
  | `chatbot.retrieval.query_expansion` | `true` | Use LLM to generate alternative search queries |
@@ -705,7 +747,8 @@ chatbot:
705
747
  | `chatbot.retrieval.graph_neighbor_relationship_chunks_per_file` | `2` | Relationship chunks per linked file during graph expansion |
706
748
  | `chatbot.retrieval.graph_neighbor_max_docs` | `4` | Max linked docs pulled in during graph expansion |
707
749
  | `chatbot.retrieval.rerank` | `true` | Use LLM to rerank retrieved chunks |
708
- | `chatbot.retrieval.rerank_candidate_limit` | `20` | Max candidates sent to the reranker |
750
+ | `chatbot.retrieval.rerank_candidate_limit` | `32` | Max candidates sent to the reranker |
751
+ | `chatbot.retrieval.rerank_candidate_limit_per_kind` | `8` | Per-kind candidate cap before filling the global rerank pool |
709
752
  | `chatbot.retrieval.rerank_preview_chars` | `450` | Characters of each chunk shown to the reranker |
710
753
  | `chatbot.retrieval.stitch_adjacent_code_chunks` | `true` | Expand exact-match code hits with adjacent windows from the same file |
711
754
  | `chatbot.retrieval.stitch_max_adjacent_chunks` | `2` | Max adjacent code windows stitched onto a top hit |
@@ -713,7 +756,8 @@ chatbot:
713
756
  | `chatbot.retrieval.live_fallback_max_files` | `6` | Max repo files inspected during a deep-research live fallback |
714
757
  | `chatbot.retrieval.live_fallback_max_per_file` | `2` | Max fallback snippets returned per inspected file |
715
758
  | `chatbot.retrieval.live_fallback_context_lines` | `12` | Lines per fallback snippet around each exact match |
716
- | `chatbot.retrieval.deep_research_chunk_chars` | `1600` | Max chars per evidence chunk passed into deep-research step answers |
759
+ | `chatbot.retrieval.deep_research_chunk_chars` | `3200` | Max chars per evidence chunk passed into deep-research step answers |
760
+ | `chatbot.retrieval.deep_research_top_k` | `10` | Retrieved chunks per deep-research sub-question |
717
761
  | **Chunking** | | |
718
762
  | `chatbot.chunking.code_chunk_lines` | `120` | Lines per code chunk |
719
763
  | `chatbot.chunking.code_chunk_overlap` | `20` | Overlap lines between code chunks |
@@ -790,22 +834,26 @@ During `deepdoc generate`, six corpora are built and stored in `.deepdoc/chatbot
790
834
 
791
835
  ### Chatbot Query Pipeline
792
836
 
793
- When a user asks a question, the backend runs a multi-step retrieval pipeline:
837
+ When a user asks a question, the backend runs a mode-aware retrieval pipeline:
794
838
 
795
- 1. **Query expansion** — The LLM generates up to 3 alternative search queries to improve recall.
839
+ 1. **Query expansion** — In default/deep/code-aware mode, the LLM can generate alternative search queries to improve recall. Fast mode disables this by default.
796
840
  2. **Embedding** — All queries are embedded using the configured embedding model.
797
841
  3. **Hybrid retrieval** — FAISS similarity search and exact-match lexical search both gather candidates from each corpus.
798
- 4. **Follow-up retrieval** — The backend can derive focused second-pass searches and pull linked files/docs via graph-neighbor expansion.
842
+ 4. **Follow-up retrieval** — The backend can derive focused second-pass searches and pull linked files/docs via graph-neighbor expansion. Fast mode can skip follow-up queries for lower latency.
799
843
  5. **Chunk stitching** — Exact-match code hits can pull adjacent code windows from the same file so larger implementations survive chunk boundaries.
800
- 6. **Reranking** — The LLM scores and reranks the retrieved chunks for relevance.
844
+ 6. **Reranking** — In default/deep/code-aware mode, the LLM can rerank candidates for relevance. Fast mode disables this by default.
801
845
  7. **Prompt assembly** — Query-type-aware budgets reserve space for the most important evidence types within the character budget.
802
- 8. **Answer generation** — The answer LLM produces a grounded response with code, artifact, doc, repo-doc, relationship, and live-fallback citations when used.
846
+ 8. **Answer generation + continuity guard** — The answer LLM produces a grounded response, and if the output appears truncated (for example ending on a dangling heading), DeepDoc retries with a continuation prompt so the response finishes cleanly.
803
847
 
804
848
  `POST /deep-research` uses the same indexed corpora first, but it can also inspect a small bounded set of live repo files when exact-match evidence is missing from the index. This fallback respects the repo's exclude rules, skips oversized/binary files, and is only used in deep research mode.
805
849
 
850
+ `POST /code-deep` uses a code-heavy retrieval profile and returns an explicit file inventory plus step trace so users can see where evidence came from while answering file-oriented questions such as “where is auth defined?”.
851
+
852
+ `POST /query`, `POST /deep-research`, and `POST /code-deep` return `response_mode` in the payload (`fast`, `deep`, `code_deep`, or `default`) so clients can confirm which retrieval profile generated the result.
853
+
806
854
  ### Chatbot API Endpoints
807
855
 
808
- The generated `chatbot_backend/` exposes two endpoints:
856
+ The generated `chatbot_backend/` exposes five endpoints:
809
857
 
810
858
  **Health check:**
811
859
  ```
@@ -826,6 +874,43 @@ POST /query
826
874
 
827
875
  The response includes the answer text, code citations (file path + line range), artifact citations, and links to relevant generated doc pages.
828
876
 
877
+ `/query` is optimized for speed: it runs retrieval in fast mode (no LLM query expansion/rerank by default) and returns an answer plus citations.
878
+
879
+ **Code-aware deep query:**
880
+ ```
881
+ POST /code-deep
882
+ {
883
+ "question": "Where is authentication defined?",
884
+ "history": [],
885
+ "max_rounds": 4
886
+ }
887
+ ```
888
+
889
+ `/code-deep` returns a code-aware answer plus `trace` and `file_inventory` fields so clients can show reasoning progress and files considered.
890
+
891
+ **Code-aware live stream (SSE):**
892
+ ```
893
+ POST /code-deep/stream
894
+ {
895
+ "question": "Where is authentication defined?",
896
+ "history": [],
897
+ "max_rounds": 4
898
+ }
899
+ ```
900
+
901
+ `/code-deep/stream` emits `trace` events while researching, then a final `result` event and `done`.
902
+
903
+ **Retrieve context only (no answer generation):**
904
+ ```
905
+ POST /query-context
906
+ {
907
+ "question": "Where is reshipping implemented?",
908
+ "history": []
909
+ }
910
+ ```
911
+
912
+ `/query-context` returns selected citations/chunks only. Use this endpoint to inspect retrieval quality independently from answer generation.
913
+
829
914
  ### Deploying the Chatbot
830
915
 
831
916
  For local development, `deepdoc serve` handles everything automatically. For production:
@@ -1072,6 +1157,15 @@ Add your API key to repo Settings → Secrets → Actions → `ANTHROPIC_API_KEY
1072
1157
 
1073
1158
  DeepDoc now supports automated releases through GitHub Actions.
1074
1159
 
1160
+ ### Release tracks
1161
+
1162
+ This repository now has two independent release tracks:
1163
+
1164
+ - **Python package (`deepdoc`)**: controlled by `pyproject.toml`, root `CHANGELOG.md`, and `.github/workflows/release.yml`.
1165
+ - **VS Code extension (`vscode-extension/`)**: controlled by `vscode-extension/package.json`, `vscode-extension/CHANGELOG.md`, and `.github/workflows/release-vscode-extension.yml`.
1166
+
1167
+ Keep versions and changelog entries separated by track.
1168
+
1075
1169
  ### What happens automatically
1076
1170
 
1077
1171
  When you push to `main`, the release workflow checks the version in `pyproject.toml`.
@@ -1129,6 +1223,30 @@ If the matching version section is missing, GitHub falls back to auto-generated
1129
1223
 
1130
1224
  After that, every new version pushed to `main` can publish without a PyPI token.
1131
1225
 
1226
+ ### VS Code extension release flow
1227
+
1228
+ The VS Code extension release is automated from `main` when files under `vscode-extension/` change.
1229
+
1230
+ What the extension workflow does:
1231
+
1232
+ - reads `vscode-extension/package.json` version
1233
+ - checks whether tag `vscode-extension-v<version>` already exists
1234
+ - builds and packages the extension
1235
+ - publishes to Marketplace using `VSCE_PAT`
1236
+ - creates and pushes the matching git tag
1237
+ - creates a GitHub release with notes from `vscode-extension/CHANGELOG.md` (fallback to generated notes)
1238
+
1239
+ One-time setup for extension publishing:
1240
+
1241
+ 1. Create a VS Code Marketplace PAT with Manage scope for publisher `Pranawww`
1242
+ 2. Add repo secret `VSCE_PAT` in GitHub Actions secrets
1243
+
1244
+ Extension release flow on each version:
1245
+
1246
+ 1. Update `vscode-extension/package.json` version
1247
+ 2. Add matching section to `vscode-extension/CHANGELOG.md`
1248
+ 3. Commit and push to `main`
1249
+
1132
1250
  ---
1133
1251
 
1134
1252
  ## Typical Workflow
@@ -1,3 +1,3 @@
1
1
  """DeepDoc — Auto-generate beautiful docs from any codebase."""
2
2
 
3
- __version__ = "1.2.0"
3
+ __version__ = "1.4.0"