docs(agents): path prefix-root conventions + cross-project cache-key pitfalls#961
Conversation
…pitfalls
Adds agents/docs/path-conventions.md documenting the two path prefix-root
families (~/.fbuild/{dev|prod}/cache via get_cache_root/Cache factories vs
<project>/.fbuild/build/{env}/{profile} via BuildLayout), the factory
functions that pick them, and the cross-project cache-key pitfall found
while profiling #942/#952: comparing an un-normalized path against a
canonicalized project dir silently defeats a cache key. Includes a
pre-commit checklist and wires the doc into the CLAUDE.md routing table
and agents/docs README.
Part of #942
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds a new documentation file, ChangesPath conventions documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Related PRs: References #695 and #952. Suggested labels: documentation Suggested reviewers: None identified from the provided information. 🐰 A rabbit hops through docs anew, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds
agents/docs/path-conventions.md— durable guidance that came out of the #942/#952 profiling work. Documents:~/.fbuild/{dev|prod}/cache/…viaget_cache_root()/Cache::new(project_dir).*_dir()(packages/ toolchains/ platforms/ libraries/ core/), the global root viaget_fbuild_root(), and per-project<project>/.fbuild/build/{env}/{profile}/viaBuildLayout.{dev|prod}segment must come fromis_dev_mode()(never hardcoded) and why global caches ignoreproject_dir.project_dirwith rawPath::starts_withsilently misses, so a cache key encodes the project directory and never hits across project dirs. Normalize both sides throughfbuild_core::path::normalize_for_key; keep cross-project keys project-independent; keep zccache-visible compile keys workspace-relative.Wired into the root
CLAUDE.mdrouting table and theagents/docs/README.mdindex.Docs-only; no code changes.
Part of #942 (the perf sub-issues #952/#953 remain open — see the #952 root-cause comment).
🤖 Generated with Claude Code
Summary by CodeRabbit