Skip to content

Skip rediscovery for unchanged AST#130

Merged
thejchap merged 1 commit into
mainfrom
codex/tracked-ast-discovery
May 30, 2026
Merged

Skip rediscovery for unchanged AST#130
thejchap merged 1 commit into
mainfrom
codex/tracked-ast-discovery

Conversation

@thejchap
Copy link
Copy Markdown
Owner

Context

Discovery was keyed directly off source text, so trivia-only edits still forced test rediscovery even when the parsed AST did not change.

Changes

  • Add a tracked parsed-AST layer before file discovery.
  • Compare parsed AST bodies so unchanged ASTs can backdate downstream discovery work.
  • Add a regression test covering comment-only edits versus real AST changes.
  • Update README and docs index examples to import describe, Depends, fixture, test, and expect directly instead of using t.* qualification.

Test plan

  • cargo test -p tryke_discovery
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run --workspace --all-features
  • uv run cargo run -- test --reporter llm
  • uvx prek run -a

@thejchap thejchap added rust Pull requests that update rust code performance Performance regression or opportunity feature changelog label labels May 30, 2026
@thejchap thejchap marked this pull request as ready for review May 30, 2026 15:48
Copilot AI review requested due to automatic review settings May 30, 2026 15:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an incremental parsed-AST layer to tryke_discovery so discovery can be skipped when source edits do not change the parsed AST, and updates public documentation examples to use direct tryke imports.

Changes:

  • Introduces ParsedAst and parse_file as a Salsa-tracked parsing layer before file discovery.
  • Refactors discovery to consume parsed ASTs and adds a regression test for unchanged-AST edits.
  • Updates README and docs examples from t.* usage to direct imports.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/tryke_discovery/src/db.rs Adds ParsedAst, tracked parsing, and test-only discovery execution counting.
crates/tryke_discovery/src/lib.rs Refactors discovery from source parsing to AST-based discovery.
crates/tryke_discovery/src/discoverer.rs Adds regression coverage for unchanged AST rediscovery behavior.
README.md Updates example imports and call sites to direct tryke symbols.
docs/index.md Mirrors README example import and call-site updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/tryke_discovery/src/db.rs
@thejchap thejchap merged commit 7824435 into main May 30, 2026
23 checks passed
@thejchap thejchap deleted the codex/tracked-ast-discovery branch May 30, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature changelog label performance Performance regression or opportunity rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants