Skip to content

Follow-up hardening for the LLM knowledge index - #3494

Merged
deruyter92 merged 17 commits into
devfrom
jaap/knowledge-index-improvements
Sep 14, 2026
Merged

deruyter92 merged 17 commits into
devfrom
jaap/knowledge-index-improvements

Conversation

@deruyter92

@deruyter92 deruyter92 commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

#3453 introduced a new knowledge-indexing system that deploys indexes of the user docs and API references in JSONL files and a central llms.txt that points to the latest sources.

This follow-up PR implements some follow-up hardening based on additional review and testing (thanks to @C-Achard):

  • add dependency bounds to the knowledge-indexing group
  • instead of a single link in the llms.txt, reference two pages for the dev API docs: the latest stable release (alias) + the rolling main."
  • Reject --skip-api on non-main labels when that would leave nothing to do (was a silent success).
  • Write empty JSONL as an empty file (no stray blank line).
  • Check API provenance before creating a version directory, so failed skip-api runs do not leave empty dirs that keep_files deploys forever.
  • Keep published-anchor occurrence counts aligned when a heading has no usable section id.
  • Add focused regression tests for docs link resolution, frontmatter hiding, and package-root API re-export URLs.

Review points not implemented:

  • ::::{warning} admonitions are still ignored in the summaries (they only exist in some hardly-used recipes)
  • the dev-docs dependency extra is not re-implemented. I kept the dev-docs depencency group as a group not extra. I think we are the only ones using them so I believe it is fine to "break" the old installation contract of --extra dev-docs.

docs are only indexed for the rolling main and old versions should not be accepted or reported as succesfull
Headings without a usable section id skipped the occurrence counter while
markdown still counted them, so later repeats could deep-link to the wrong
section. Count every titled heading; only record anchors when present.
@deruyter92 deruyter92 changed the title Fix remaining issues with knowledge indexing system Follow-up hardening for the LLM knowledge index Sep 9, 2026
@deruyter92
deruyter92 requested a review from C-Achard September 9, 2026 07:07
@deruyter92
deruyter92 marked this pull request as ready for review September 9, 2026 07:07
@C-Achard

C-Achard commented Sep 9, 2026

Copy link
Copy Markdown
Member

I kept the dev-docs depencency group as a group not extra. I think we are the only ones using them so I believe it is fine to "break" the old installation contract of --extra dev-docs

Agreed

Use each target symbol's canonical path when building `docs_url` entries in the API index. This keeps generated links pointed at the defining module instead of the exporting module, which fixes documentation URLs for re-exported or aliased symbols.
Improve the CLI error shown when knowledge indexing has no work to do. The message now explains whether docs were skipped explicitly or excluded because the version label is not the docs index version, making the failure easier to understand.
Update API symbol indexing so class method URLs are built from the class’s canonical module path instead of the re-exporting module path. This keeps method anchors aligned with mkdocstrings output while preserving the re-exported name in the indexed symbol. Tests were updated to assert both the class URL and its method URL for a root-level re-export.
Add a brief comment to the llms.txt knowledge indexing test explaining why the stable and rolling API URLs point to landing pages instead of `reference/`, which would 404 for `api-autonav`.
`API_ROOT_URI` and `EXCLUDED_MODULES` in `api_index.py` mirror `plugins.api-autonav` in `dev-docs/mkdocs.yml`. The module docstring and `tools/knowledge_indexing/README.md` both state they must be kept in sync, which is now tested.
@C-Achard

C-Achard commented Sep 9, 2026

Copy link
Copy Markdown
Member

@deruyter92 See the follow-up fixes; thanks!

@deruyter92 deruyter92 added enhancement New feature or request 3.0.2 labels Sep 9, 2026
@deruyter92 deruyter92 added this to the Improve agentic interaction milestone Sep 9, 2026
@deruyter92
deruyter92 merged commit 1c38232 into dev Sep 14, 2026
36 checks passed
@deruyter92
deruyter92 deleted the jaap/knowledge-index-improvements branch September 14, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0.2 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants