RFD: predicate caching#262
Open
kurasaiteja wants to merge 4 commits into
Open
Conversation
Add design for caching predicate results using file-based watch paths. Two mechanisms: syntactic (watch field on skill groups) and runtime (stdout JSON from shell predicates). Coordinates with PM interface for depends-on() caching via Cargo.lock.
nikomatsakis
requested changes
Jul 14, 2026
nikomatsakis
left a comment
Member
There was a problem hiding this comment.
Thanks! Left some notes here.
kurasaiteja
force-pushed
the
rfd-predicate-caching
branch
from
July 14, 2026 17:47
d1f0781 to
d699619
Compare
nikomatsakis
requested changes
Jul 16, 2026
nikomatsakis
left a comment
Member
There was a problem hiding this comment.
Much better! Left a few more comments.
nikomatsakis
requested changes
Jul 22, 2026
switch to granular events on a non_exhaustive enum, and replace Volatile with WatchTime.
|
|
||
| ## SDK helper | ||
|
|
||
| The `symposium-sdk` crate provides a helper that reads an environment variable and emits its watch event: |
Member
There was a problem hiding this comment.
(we should probably also have a helper to e.g. read and deserialize a JSON/TOML file or just to read a file to a string)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Updated V4
RFD for predicate caching. Custom predicates currently fork a process on every sync. This adds a small JSONL protocol that lets a predicate report the inputs its result depends on, so Symposium can cache the result and skip reevaluation until one of those inputs changes.
Protocol
We add three granular events on a #[non_exhaustive] enum:
WatchFile(PathBuf)- result depends on this fileWatchEnv(String)- result depends on this environment variableWatchTime(usize)- result becomes stale after this many millisecondsA predicate can emit any number of events during one run. Its exit status still determines true or false. No events means cached indefinitely.
WatchTime(0)means never cached.shell(cmd)emits WatchTime(0).Storage
Cache lives at
~/.symposium/cache/predicates.jsonand is discarded on Symposium version upgrade.Disclosure questions
AI disclosure.I used an AI tool for research, autocomplete, or in other minimal ways.
AI tool authored most of this RFD