[Drift Audit] Update URL classification rule to match isUrl() and the useUrlPredictor flag#9153
Draft
daxmobile wants to merge 1 commit into
Draft
Conversation
…flag The architecture rule's "URL vs. Search Classification" section taught a manual isReady() + classify() + isWebUrl() fallback and implied the only fallback trigger was native-lib readiness. The code now exposes QueryUrlPredictor.isUrl(query), which the search-only/unified omnibar code uses, and gates classification behind the useUrlPredictor remote flag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: (app.asana.com/redacted)
Tech Design URL (if applicable):
Description
.cursor/rules/architecture.mdc— "URL vs. Search Classification".What the doc described: it taught a hand-rolled classification helper —
if (queryUrlPredictor.isReady()) { classify(query) is Decision.Navigate } else { UriString.isWebUrl(query) }— and stated that theisWebUrlfallback exists only "while the native library loads" (i.e. the sole fallback trigger isisReady()).The code change that invalidated it:
QueryUrlPredictor(inbrowser-api) now exposes a first-classisUrl(query): Booleanconvenience method, and the implementation gates the native predictor behind auseUrlPredictorremote feature flag:isUrl()is what the recent search-only / unified-omnibar work calls —BrowserTabViewModel,NativeInputManager, andInputScreenViewModelall usequeryUrlPredictor.isUrl(...)rather than the manual pattern. Two facts had drifted:isUrl(), not a hand-rolledisReady()/classify()/isWebUrl()block.useUrlPredictorflag (AndroidBrowserConfigFeature) in addition to native-lib readiness. The doc implied readiness was the only fallback trigger; the fallback also fires whenever the flag is disabled.How the doc now reads: it recommends
isUrl(query)for a boolean decision (showing the real implementation, flag gate included), keepsclassify()+isReady()for callers that need the resolvedDecision(notingclassifydoes not check the flag), and corrects the fallback note to mention both theuseUrlPredictorflag and readiness. TheDecisionshape andbrowser-api/AppScopefacts were verified against the code and left unchanged.Note: I could not confirm the exact merged PR that introduced
isUrl()/useUrlPredictorvia commit history (integrity-filtered), but the omnibar/URL-classification area was heavily touched by recent search-only-omnibar changes, and the current code plainly diverges from the doc.🤖 AI-docs Drift Auditor
Steps to test this PR
QueryUrlPredictor(browser-apiinterface + app-sideQueryUrlPredictorImpl.isUrl) and its callers (BrowserTabViewModel,NativeInputManager,InputScreenViewModel) and confirm it now matches.UI changes
Note
🔒 Integrity filter blocked 20 items
The following items were blocked because they don't meet the GitHub integrity level.
search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_commits: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter: