Skip to content

fix(ai): read the host of a URL word in the search query check - #7332

Merged
dan-petty merged 2 commits into
mainfrom
fix/7329-search-query-check-url-host
Nov 26, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/7329-search-query-check-url-host

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The check of a web search query reads the host of each word. For a word that is a URL with a scheme, the parser call gave the scheme as the host, so the check did not read the host that the word names.

The check now reads a word with the standard URL parser in each form: a URL with a scheme, a scheme-relative URL, a URL inside a longer word, and a URL in the path or the query of another URL, percent-encoded one time or not. A URL word gives the result of its bare host. Upper-case letters and a dot at the end of a host do not change the result. A text that the URL parser refuses raises no error: the check reads each part of it as a host.

url_candidates in devops_cli.http.urls finds the URL candidates of a text for the check and for urls_in_order. The refusal messages and the order of the checks stay.

Closes #7329

Change: openspec/changes/archive/2026-11-26-7329-search-query-check-url-host/

The check of a web search query reads the host of each word. For a word
that is a URL with a scheme, the parser call gave the scheme as the host.
The check now reads the word and each URL in it with the standard URL
parser, and a URL word gives the result of its bare host.

`url_candidates` in `devops_cli.http.urls` finds the URL candidates of a
text for the check and for `urls_in_order`.

Refs #7329
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/ai AI review pipeline, personas, prompts, LLM client, or RAG labels Nov 26, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 982325c8dc30e02f93a68c82a357ed29107d0a0b

Check Conclusion Link
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
Trivy neutral run
Changed-Test Independence success run
Plan Check skipped run
CodeQL success run
Tests on Main skipped run
Dependency Freshness skipped run
Test Job Duration skipped run
Changed-Test Independence (run 2 of 3) success run
Tests & Coverage (shard 1 of 5) success run
Tests & Coverage (shard 2 of 5) success run
Tests & Coverage (shard 5 of 5) success run
Tests & Coverage (shard 3 of 5) success run
Design Tokens success run
Tests & Coverage (shard 4 of 5) success run
Fail-to-Pass Check success run
Service Image success run
Changed-Test Independence (run 3 of 3) success run
Changed-Test Independence (run 1 of 3) success run
Static Analysis success run
Docs Site Build success run
Runner Image success run
Semantic PR title success run
Analyze (python) success run
Analyze (actions) success run

Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/45882818627/job/140126100974

Skipped check: Trivy
Skipped check: Plan Check
Skipped check: Tests on Main
Skipped check: Dependency Freshness
Skipped check: Test Job Duration

@dan-petty

Copy link
Copy Markdown
Owner Author

Local checks

Head commit 982325c8dc30e02f93a68c82a357ed29107d0a0b, on origin/main at 9a65c7774.

  • uv run devops ci --check --only lint,format,docs,deps,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: each row passes.
  • uv run devops ci test src/devops_cli/ai/web_search.py src/devops_cli/http/urls.py src/devops_cli/roadmap/page_fetch.py src/devops_cli/roadmap/references/queries.py tests/ai/test_web_search.py tests/roadmap/references/test_reference_queries.py: 1038 tests pass.
  • uv run mypy on the 4 changed files under src/: no problem.
  • uv run devops ci fail-to-pass --base origin/main: exit 0. The check results comment links the run of the same check on GitHub.
  • The tests give 22 URL forms and 4 forms with no scheme for 5 hosts and for 1 public host (tests/ai/test_web_search.py), and 1 case of the reference step (tests/roadmap/references/test_reference_queries.py).

The classifier error that a generated word found during this work is #7333. It is not a part of this change.

@dan-petty
dan-petty marked this pull request as ready for review November 26, 2026 19:31
@dan-petty
dan-petty merged commit 2927816 into main Nov 26, 2026
28 checks passed
@dan-petty
dan-petty deleted the fix/7329-search-query-check-url-host branch November 26, 2026 19:33
dan-petty-release Bot added a commit that referenced this pull request Nov 26, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.223.1](v0.223.0...v0.223.1)
(2026-11-26)


### Bug Fixes

* **ai:** read the host of a URL word in the search query check
([#7332](#7332))
([2927816](2927816))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ai AI review pipeline, personas, prompts, LLM client, or RAG type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ai): read the host of a URL word in the search query check

1 participant