Fix/compile cache self reference - #84
Conversation
… inputs Documents the filesystem-feedback (not graph-cycle) self-reference that keeps compile from cache-hitting and re-hashes the class tree every build. Adds the rule to AGENTS.md and a caching.md anti-pattern section; fixes stale 'compile always runs' claims (compile is a CachedTask now). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The pinned v0.17.0 config schema no longer parses the current deder.pkl (Pkl ConversionException on cold server start), breaking the self-build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
compile's cache key transitively included its own output dirs, whose contents it writes — making the key change every build so it never hit (re-running Zinc and re-hashing ~14k class files on every no-op): - via compileClasspath -> allClassesDirs -> classes (own classes dir) - semanticdbDir (semanticdb output) - generatedSources (javac annotation-processing output) These are filesystem feedback loops, not graph cycles, so cycle detection never caught them; non-deterministic .class/.semanticdb bytes compounded it. Fix: compile no longer depends on those output dirs. It derives their paths at execute time (ctx.out/classes, etc.) and builds its compile classpath from the dependency coordinates + upstream modules' transitive compile outputs + its own (derived) classes dir for javac annotation processing. compileClasspathTask is untouched, so runClasspath/BSP/publish keep the full classpath. Verified on deder itself (deder-common, plugin-api) and sample-projects/multi: compile now hits on an unchanged second run. Adds a CachedTaskSuite regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthrough
ChangesCompile Cache Self-Reference Fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/content/reference/caching.md`:
- Around line 99-100: The tracked-offender note in the caching.md file at lines
99-100 describes the compileTask dependencies and self-referential classes
wiring as current issues, but the implementation has since removed these
dependencies in CoreTasks.scala. Reword this note to present it as historical
context rather than an active offender, making clear that this issue has been
resolved. Additionally, update the corresponding wording at line 65 in AGENTS.md
to align with this same historical framing, ensuring both documents consistently
reflect that these are no longer current implementation problems.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 7c7966df-06c9-493e-9fbb-a35092197c20
⛔ Files ignored due to path filters (1)
deder.pklis excluded by!**/*.pkl
📒 Files selected for processing (4)
AGENTS.mddocs/content/reference/caching.mdintegration/test/src/ba/sake/deder/CachedTaskSuite.scalaserver/src/ba/sake/deder/CoreTasks.scala
| > **Tracked offenders (2026-06-14):** `compileTask` depends on `semanticdbDirTask`, and (via `compileClasspathTask → allClassesDirsTask`) on its own `classesTask` — both directories `compile` writes. Until they're removed from `compile`'s cache key (derive the paths at execute time instead), `compile` re-runs Zinc and re-hashes its class tree on every no-op. | ||
|
|
There was a problem hiding this comment.
Update the tracked-offender note; it no longer matches the implementation.
Line 99 still says compileTask currently depends on semanticdbDirTask / self-referential classes wiring, but this PR’s server/src/ba/sake/deder/CoreTasks.scala removes those deps. Please reword this as historical context (or remove the block), and align AGENTS.md Line 65 wording with that update.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/content/reference/caching.md` around lines 99 - 100, The
tracked-offender note in the caching.md file at lines 99-100 describes the
compileTask dependencies and self-referential classes wiring as current issues,
but the implementation has since removed these dependencies in CoreTasks.scala.
Reword this note to present it as historical context rather than an active
offender, making clear that this issue has been resolved. Additionally, update
the corresponding wording at line 65 in AGENTS.md to align with this same
historical framing, ensuring both documents consistently reflect that these are
no longer current implementation problems.
Summary by CodeRabbit
Documentation
Tests
Bug Fixes