Skip to content

fix(hash-persister): quote generated scoped query words - #26

Merged
mattnworb merged 1 commit into
mainfrom
mattbrown/fix-scoped-query-quoting
Oct 19, 2026
Merged

mattnworb merged 1 commit into
mainfrom
mattbrown/fix-scoped-query-quoting

Conversation

@mattnworb

@mattnworb mattnworb commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Problem

Seeded hashing falls back to full hashing when a carried target contains query punctuation. For example, the generated set() expression inserts //:.aspect_rules_js/node_modules/@work-graph+core@0.0.0/pkg without quoting it, so Bazel interprets + as query syntax and rejects the query. Dirty-package and probe patterns have the same quoting gap.

What changed

Quote each generated carried label, dirty-package :all pattern, and probe :* pattern using Bazel query delimiters. Sorting, wildcard selection, and manual-target filtering are preserved.

Words containing both quote delimiters cannot be represented safely. In that case, scoped hashing falls back to full computation, while a failed probe retains the unpruned dirty set.

Six related Bazel test targets pass, including regressions for the exact aspect_rules_js /pkg and /ref labels, punctuation in packages, root packages, and quote delimiters. Actual Bazel 9.2 query evaluation also confirms target selection and probe source/manual coverage.

Releasing the tool and updating the backend pin remain follow-up work. Repository-scale performance gains have not been measured.

@mattnworb
mattnworb marked this pull request as ready for review October 16, 2026 20:15
@mattnworb
mattnworb merged commit d9a5d37 into main Oct 19, 2026
2 checks passed
@mattnworb
mattnworb deleted the mattbrown/fix-scoped-query-quoting branch October 19, 2026 13:30
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.

2 participants