Skip to content

fix(cache): print one warning line per build for ignored file-fact cache entries (#4888) - #4894

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/project-thread-2rk3d2-cache-warn
Sep 29, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/project-thread-2rk3d2-cache-warn

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Before: with an unusable cache directory (for example RIPR_CACHE_DIR pointing at a file), ripr check on this repository printed 723 ripr: repo file fact cache entry ignored (...) lines to stderr, one per source file. The single relevant warning came after all of them. The result was still correct and the run exited 0.

After: a build prints one line, ripr: 723 repo file fact cache entries ignored; first: (<reason>). A single bad entry keeps its old message. A cancelled lookup still reports the entries it saw. FileFactCacheStats.corrupt_ignored still counts every entry.

How: build_index_with_file_fact_cache keeps the first reason during the lookup loop and emits corrupt_entries_warning(count, reason) once, after the loop or before a cancellation return.

Fixes #4888.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Plan item: 0.11 shared-state hunt
Governing issue or accepted claim: #4888
Acceptance delta (one sentence): an unusable file-fact cache yields one stderr line per build, not one per file.

Candidate Relationships

Candidate branch: claude/project-thread-2rk3d2-cache-warn
Stack parent or prerequisite PR: none. #4383 added the path to this message and is compatible.

Scope

  • crates/ripr/src/analysis/facts/build.rs
  • crates/ripr/tests/cli_smoke.rs
  • CHANGELOG.md

Scope Classification

  • One production behavior

Non-goals: the seam-inventory cache warnings already print once per run.

Support-tier Impact

  • none

Policy Impact

  • none

Proof

cargo test -p ripr --lib -- facts::build                         # 32 passed
cargo test -p ripr --test cli_smoke -- unusable_cache_directory  # 1 passed
cargo xtask precommit                                             # exit 0
cargo clippy -p ripr --all-targets --locked -- -D warnings        # exit 0
RIPR_CACHE_DIR=<a file> ripr check --root . --diff d.patch --format json
# before: 724 stderr lines (723 cache lines); after: 2 lines, exit 0 both
  • corrupt_entries_collapse_into_one_warning_line pins the one-entry and several-entry messages.
  • unusable_cache_directory_is_reported_once_per_build runs the real binary and asserts exactly one warning line in the several-entries form.
  • The cancelled-lookup flush has no regression test, because the warning goes to stderr through eprintln! and a cancellation cannot land deterministically between two lookups.

Claim Boundary

  • Claimable: one warning line per index build for ignored file-fact entries.
  • Not claimable: a single line across several builds in one process, because the LSP rebuilds on each refresh.

Rollback

Revert the commit.

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented.

Gates

  • cargo fmt --check
  • cargo xtask precommit

🤖 Generated with Claude Code

https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx

…che entries (#4888)

An unusable cache directory made every lookup fail the same way and printed
one stderr line per source file (723 on this repository). Report the count
and the first reason once per build.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 29, 2026 07:55

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head self-review of 4860454. No blocking findings.

  • Behavior. Cache stats and control flow are unchanged: the corrupt entries are still counted and re-parsed. Only the stderr emission moves out of the loop.
  • Ordering. The phase-1 comment promised "corrupt-entry stderr ordering byte-identical". There is now one line, emitted before any parse, so it still comes before the phase-2/3 output. Nothing depends on interleaving; I grepped the tests and none match on this message.
  • Wording. "entry ignored" stays for a single entry, so the #4383 path attribution is kept.
  • Oracle. The unit test pins both message shapes. The end-to-end receipt with 723 files is in the PR body.

CodeRabbit (rate limit), Gemini (quota) and droid-review reviews are missing, not clean. Hosted CI is pending.


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a470b8e6-04a4-4fc1-8cfd-4fbafa01f115

📥 Commits

Reviewing files that changed from the base of the PR and between bda41a8 and 9b8edc2.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • crates/ripr/src/analysis/facts/build.rs
  • crates/ripr/tests/cli_smoke.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EffortlessSteven
EffortlessSteven enabled auto-merge (squash) September 29, 2026 07:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T07:57:33.080777Z 4860454 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aggregates corrupt cache entry warnings during a build into a single log message instead of printing one warning per source file. It introduces a helper function corrupt_entries_warning to format the message based on the count of ignored entries, tracks the first corruption reason, and adds a unit test to verify this behavior. There are no review comments, so I have no feedback to provide.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment thread crates/ripr/src/analysis/facts/build.rs Resolved
Comment thread crates/ripr/src/analysis/facts/build.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4860454e48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/ripr/src/analysis/facts/build.rs Resolved
Comment thread crates/ripr/src/analysis/facts/build.rs Resolved
…test the CLI path (#4888 review)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review of 7a7f070. Disposition: no blocking findings; merge waits on required CI.

What I inspected:

  • analysis/facts/build.rs: the lookup loop counts corrupt entries and keeps the first reason. It emits one warning after the loop, or before an early cancellation return.
  • The message formatter:
    • one entry: "entry ignored (reason)";
    • several: "N entries ignored; first: (reason)";
    • it no longer claims any re-parsing happened.
  • Oracles:
    • the unit test corrupt_entries_collapse_into_one_warning_line checks both forms;
    • the cli_smoke test unusable_cache_directory_is_reported_once_per_build runs the real binary with RIPR_CACHE_DIR set to a regular file and asserts exactly one warning line, in the several-entries form. It fails if the per-entry emission returns or the emission is removed.
  • CHANGELOG: #4888 entry present.

Local results:

  • facts::build unit tests: 32/32 passed.
  • The cli_smoke test passed.
  • cargo clippy -p ripr --all-targets --locked -D warnings: 0.
  • cargo xtask precommit: 0.

Known gap: the cancelled-lookup flush has no regression test. The reason is in the Devin thread.

Review providers: CodeRabbit is missing (rate-limited) and droid-review is missing (queued). Neither counts as a clean review.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven enabled auto-merge (squash) September 29, 2026 09:05
…-2rk3d2-cache-warn

# Conflicts:
#	CHANGELOG.md
#	crates/ripr/tests/cli_smoke.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cache): an unusable cache directory prints one stderr warning per source file

2 participants