Skip to content

Add project rule context diagnostics#10164

Draft
szgupta wants to merge 3 commits intomasterfrom
suraj/debug-active-rule-files
Draft

Add project rule context diagnostics#10164
szgupta wants to merge 3 commits intomasterfrom
suraj/debug-active-rule-files

Conversation

@szgupta
Copy link
Copy Markdown
Member

@szgupta szgupta commented May 5, 2026

Description

Adds warn-level diagnostics around project rule context propagation to help debug inconsistent active_rule_files population.

Specifically, this logs when:

  • project rule scans cannot read metadata, are pointed at a non-directory, fail to build the file tree, exceed the scan file limit, or cannot read an individual rule file
  • project rule lookup finds indexed rules but no active rule files for the current path
  • pending AI context has project rules with no active rules or empty rule content
  • API conversion produces empty or mismatched active_rule_files
  • restored conversation context has project rules with missing active_rule_files

The scan now continues after a single unreadable rule file instead of aborting the rest of the candidate rule files. The logs include paths and counts, but not rule file contents.

Oz conversation: https://staging.warp.dev/conversation/ef46e7dd-4e1f-4c9f-aa80-a743789d309e

Linked Issue

N/A

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Screenshots / Videos

N/A — logging-only change.

Testing

  • cargo fmt
  • cargo check -p warp --lib --features local_fs
  • cargo clippy --workspace --all-targets --all-features --tests -- -D warnings
  • Re-ran cargo fmt and cargo clippy --workspace --all-targets --all-features --tests -- -D warnings after merging origin/master.
  • After adding scan failure diagnostics: cargo fmt, cargo check -p warp --lib --features local_fs, and cargo clippy --workspace --all-targets --all-features --tests -- -D warnings.

No new tests were added because this is diagnostic logging only and does not change project-rule behavior, aside from continuing a scan after a single unreadable candidate rule file.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz oz-agent@warp.dev

szgupta and others added 2 commits May 5, 2026 13:30
Add warn-level logging around project rule discovery, pending context assembly, API serialization, and conversation restoration so missing active_rule_files can be diagnosed without logging rule contents.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 5, 2026
Add targeted warnings for metadata, non-directory, file tree, file-limit, and per-file read failures during project rule scans. Continue scanning after an unreadable rule file so one bad file does not suppress later active_rule_files.

Co-Authored-By: Oz <oz-agent@warp.dev>
@szgupta
Copy link
Copy Markdown
Member Author

szgupta commented May 5, 2026

I will likely revert this one I've found the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant