Skip to content

Don't analyse CodeWiki's own output in the docs folder as repo code - #15

Merged
dandydarshan merged 2 commits into
mainfrom
fix/skip-own-docs-in-analysis
Nov 7, 2026
Merged

dandydarshan merged 2 commits into
mainfrom
fix/skip-own-docs-in-analysis

Conversation

@dandydarshan

@dandydarshan dandydarshan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

generate copies validate_module_tree_ownership.py into the docs folder, and the next run analysed it as the user's code. In a 4-component test repo, the graph after the second run had 38 components, 34 of them from that script. The extra functions inflate the graph and can get their own docs page, which costs LLM calls.

 DependencyGraphBuilder.build_dependency_graph
   exclude = user's --exclude patterns
+          + <docs>/temp                                   # CodeWiki's caches
+          + <docs>/validate_module_tree_ownership.py      # the copied helper

The patterns are added only when the docs folder is inside the repo and isn't the repo root. They're deliberately narrow: the docs folder may also hold the user's own files (e.g. a Sphinx conf.py), and the script's real source elsewhere in a repo must still be analysed. The filename moves to codewiki/src/config.py, so the HTML generator and the analyser share one definition.

Evidence

  • Before: test repo after two runs: docs/validate_module_tree_ownership.py 17 components, docs/b/validate_module_tree_ownership.py 17, inventory/core.py 4.
  • test_codewikis_own_output_is_not_analysed_as_repo_code:
    docs/validate_module_tree_ownership.py   → skipped   (copied by generate)
    docs/temp/cache.py                       → skipped
    docs/conf.py                             → analysed  (the user's own file)
    pkg/validate_module_tree_ownership.py    → analysed  (a real source copy)
    docs folder = repo root                  → nothing skipped
    
    It fails on the previous code.
  • 484 tests pass.

Merge Danger

Door: two-way

Blast Radius: analysis scope

Repos documented before this change lose those helper components on their next --update. If a page was generated for them, the updater treats them as deleted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd

Darshan M U and others added 2 commits November 7, 2026 07:17
`generate` copies validate_module_tree_ownership.py into the docs folder,
and the next run parsed it as the user's code: about 17 extra functions in
the graph (34 of 38 components in a small test repo), which could even get
their own docs page. Caches under docs/temp were in scope too.

The dependency analysis now skips <docs>/temp and <docs>/<validator> when
the docs folder is inside the repo. Only those: the docs folder may hold
the user's own files, and the script's real source elsewhere is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd
The wheel jobs run the tests from a copy outside the repo, where
tests/../codewiki/templates/... does not exist (FileNotFoundError on
Linux and Windows). The test is about which paths are skipped, so it now
writes a small script under the helper's name instead of copying it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd
@dandydarshan
dandydarshan force-pushed the fix/skip-own-docs-in-analysis branch from cd57647 to 90fdafb Compare November 7, 2026 01:53
@dandydarshan
dandydarshan merged commit a92269b into main Nov 7, 2026
14 checks passed
@dandydarshan
dandydarshan deleted the fix/skip-own-docs-in-analysis branch November 7, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant