fix: refresh workspace discovery for each operation - #267
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughWorkspace discovery now uses operation-scoped filesystem caches. Core operations refresh workspace roots, patterns, and members. Direct scans can skip unused skill metadata and unrelated workspace enumeration. Tests cover repeated workspace changes and direct resolution. ChangesWorkspace discovery refresh
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant listIntentSkills
participant resolveProjectContext
participant workspaceDiscovery
participant skillScanner
listIntentSkills->>resolveProjectContext: pass operation fsCache
resolveProjectContext->>workspaceDiscovery: refresh roots and patterns
workspaceDiscovery-->>resolveProjectContext: return workspace context
listIntentSkills->>skillScanner: scan candidate package roots
skillScanner-->>listIntentSkills: return matching skills without unused metadata
Merge Risk: ⚪ Minimal · up to Workspace changes are refreshed between core operations while per-operation caching and direct-load safeguards remain intact. No merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 4.76% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 8 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
View your CI Pipeline Execution ↗ for commit bb9c6a5
☁️ Nx Cloud last updated this comment at |
commit: |
Merging this PR will improve performance by 47.1%
Performance Changes
Tip Curious why performance improved? Comment Comparing |
bb9c6a5 to
7ef4453
Compare
7ef4453 to
ea6b9d6
Compare
ea6b9d6 to
68ad8e3
Compare
🎯 Changes
Stacked on #266. Fixes #236.
Replace four process-wide workspace caches with reuse scoped to the existing filesystem cache for each core operation. Repeated list and load calls observe new workspace roots, added and removed members, changed patterns, and workspace/npm source-kind changes.
The initial implementation slowed direct loads and was rejected. Commit
bb9c6a5removes the extra work while preserving fresh state:No watcher, daemon, dependency, persistent invalidation mechanism, or guide changes.
Verification
node ../../node_modules/vitest/vitest.mjs run --no-file-parallelism --exclude tests/integration/distribution-installers.test.tsfrompackages/intent.git diff --checkpassed. Eight existing lint warnings remain. Live external installer checks were not rerun.Performance
Compared the unchanged list/load benchmarks in isolated worktrees using the same installed tools. Baseline: #266 at
259ce1b; repaired:bb9c6a5. Run frombenchmarks/intent:./node_modules/.bin/vitest bench list.bench.ts load.bench.ts --run --no-file-parallelismafter building each revision.Means are milliseconds per existing benchmark batch, not per command.
Repaired relative margins of error: 0.35–0.55%; baseline: 0.46–1.12%. These are local fixture measurements, not a universal speed claim. List performance is comparable within measurement noise. The earlier 6.3870 ms large-workspace result is superseded; no material standalone regression remains in these checks.
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit