Skip to content

Stop publishing the checkout's absolute path with the docs - #14

Merged
dandydarshan merged 1 commit into
mainfrom
fix/no-local-paths-in-docs
Nov 7, 2026
Merged

dandydarshan merged 1 commit into
mainfrom
fix/no-local-paths-in-docs

Conversation

@dandydarshan

Copy link
Copy Markdown
Owner

Summary

Every generated docs site published the absolute path of the user's checkout, e.g. C:/Users/<name>/projects/app. It was found by publishing a test GitHub Pages site.

 docs/metadata.json                       (also embedded in docs/index.html)
-  generation_info.repo_path: "/home/<name>/work/app"
+  generation_info.repo_path: ".."               # relative to the docs folder
-  last_update.revision.repo_path / update_history[].revision.repo_path: absolute
+  same, relative; entries from older versions rewritten when read back
-  last_update.previous_docs: "/home/<name>/work/app/docs.prev-1a2b3c4d"
+  last_update.previous_docs: "../docs.prev-1a2b3c4d"
 docs/update_record.json
-  revision.repo_path: absolute
+  relative

serve uses the recorded path to find the repo, so it now resolves a relative value against the docs folder. Old absolute values keep working. On Windows, when the docs and the repo are on different drives no relative path exists; then nothing is recorded and serve falls back to the docs folder's parent, as before.

The dependency graph's absolute file_paths are fixed separately in #13, which starts committing the graph.

Evidence

  • Before: in a test Pages site, metadata.json, index.html and update_record.json each contained the scratch checkout path.
    After: real CLI against a scripted LLM (generate, code change, --update): no file under docs/ (outside temp/) contains the checkout path, and metadata.json holds "repo_path": ".." in all three places.
  • test_serve_finds_the_repo_from_a_relative_or_an_old_absolute_path: docs copied away from the repo, recorded ../../repo. On the old code repo_path is None; now it finds the repo, and an old absolute value still works.
  • test_repo_path_is_recorded_relative_to_the_docs: .., ../.., and None across Windows drives.
  • 485 tests pass.

Merge Danger

Door: two-way

Blast Radius: metadata

Existing published sites keep their absolute path until the next generate/--update rewrites metadata.json and index.html, and older commits keep it in git history. Anything external that parsed generation_info.repo_path as an absolute path would now get a relative one; nothing in CodeWiki does.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd

metadata.json (and so index.html, which embeds it) recorded
generation_info.repo_path as an absolute path; update records and the
metadata's update history did too, and a full-build fallback recorded the
absolute path of the docs backup. Published with the docs, that reveals
where each user keeps the checkout (C:/Users/<name>/...).

They are now recorded relative to the docs folder (usually ".."), and
history entries from older versions are rewritten when read back. serve,
which uses the recorded path to find the repo, resolves it against the
docs folder; old absolute values keep working.

Found by publishing a test GitHub Pages site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd
@dandydarshan
dandydarshan force-pushed the fix/no-local-paths-in-docs branch from ad4e38d to 3e11b81 Compare November 7, 2026 01:53
@dandydarshan
dandydarshan merged commit a166cfb into main Nov 7, 2026
14 checks passed
@dandydarshan
dandydarshan deleted the fix/no-local-paths-in-docs branch November 7, 2026 03:10
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