Relative predicate file watches ignore the workspace directory

Open
#531 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start in src/predicate_cache.rs at Fingerprints::capture, which passes the stored relative watchFile path to FileFingerprint::of; compare that with PredicateContext::cwd and the validation lookup. The regression case is relative_watch_tracks_the_declared_workspace in anchor-book/reconciliation/probes.rs; run python3 anchor-book/reconciliation/run-probes.py to see the counter stay at one line. Done means the relative path resolves against the workspace for both storage and lookup, that probe passes, and existing cache tests stay green.

Written by the indexing model from the issue text.

Description

bug
What happens

A custom predicate's relative watchFile path is fingerprinted against the process working directory instead of the predicate's workspace directory. Creating the watched file in that workspace does not invalidate the persisted result when the two directories differ.

Steps to reproduce
  1. With Rust 1.99.1, Python 3, and a POSIX shell available, start from a clean checkout of the published reproduction branch:

    git clone --branch codex/configuration-trial https://github.com/kwdev/symposium.git symposium-cache-repro
    cd symposium-cache-repro
    git checkout 12df46340d2e125b61577bbc427d256ea4ab11b0
    cargo fetch --locked
    python3 anchor-book/reconciliation/run-probes.py
    

    The initial dependency fetch needs network access; the diagnostic runs Cargo offline. The runner temporarily exposes the existing predicate module and installs a test target, then restores the source and removes that target. It changes no implementation logic and launches no agent or model.

  2. Inspect relative_watch_tracks_the_declared_workspace in the committed probe. It creates a fresh temporary workspace, cache, and counter, then registers this custom predicate script; $1 is the absolute counter path:

    echo x >> "$1"
    echo '{"watchFile":"book-reconciliation-watched-file"}'
    

    This is a library-level reproduction, so no config.toml or plugin manifest is required. The context is created with PredicateContext::with_custom_predicates, .with_cwd(Some(workspace)), and .with_disk_cache(cache_path). The process stays in the repository directory.

  3. Evaluate the predicate with the watched file absent, then persist the cache.

  4. Create book-reconciliation-watched-file inside the temporary workspace. Create a fresh context with the same workspace and cache, and evaluate again. Assert that the counter contains two lines, proving the file's appearance caused reevaluation.

The runner executes four reconciliation probes. This report concerns the named relative-watch test; the disablement failures are already covered by #290 and PR #423.

Actual result

The counter contains one line. Exact assertion output from the published revision:

assertion `left == right` failed: workspace file appearance did not invalidate the cache
  left: 1
 right: 2

The test is reported as relative_watch_tracks_the_declared_workspace ... FAILED; the diagnostic exits 101. A fresh context is used for the second evaluation, so this result demonstrates persistent-cache behavior independently of same-context memory reuse.

Expected result

The relative watch refers to the file inside the declared workspace. Its transition from absent to present invalidates the cached result, executes the predicate again, and produces two counter lines.

The existing predicate-caching RFD explicitly says “Files are relative to the workspace root” and that a change to any watched input causes reevaluation.

Environment
  • Symposium: 0.7.0; reproduced on fork commit 12df46340d2e125b61577bbc427d256ea4ab11b0, containing upstream 3516c051c07838bdde94ea780138a8ac1c3a79a1. The reproduction branch adds Book content and diagnostics; it does not fix this behavior.
  • Agent: N/A — direct library test, no vendor agent involved.
  • OS: Linux x86_64, kernel 6.12.115-140.210.amzn2023.x86_64.
  • Rust: rustc 1.99.1 (58cf8f9c3 2026-10-13).
  • Reproduced: 2026-11-24.
Notes

Suspected cause: Fingerprints::capture passes the stored relative path directly to FileFingerprint::of. Both entry creation and validation use that path without resolving it against PredicateContext::cwd. A fix should preserve workspace meaning across storage and lookup and retain this assertion as a regression test.

How this was found: During an AI-assisted reconciliation with Codex before proposing Anchor Book integration, we compared the draft Book's A-cache-declared-validity anchor and cache-boundaries criterion with the existing RFD, code, and test assertions. The relative-path obligation prompted a probe with an explicit workspace distinct from process cwd. The existing workspace suite passed 2,160 tests, with 29 skipped, during the reconciliation; this additional probe exposed an uncovered case. The draft Book helped direct the investigation; the workspace-relative rule already exists in the RFD.

Dominant language
Rust
Stars
247
Forks
30
Avg merge
4d 19h
Merged PRs (30d)
44

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from symposium-dev/symposium

All issues in symposium-dev/symposium

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.