Skip to content

fix(web-search): stop rendering Chinese punctuation on English pages - #212

Merged
lanyue-llk merged 1 commit into
mainfrom
fix/web-search-english-punctuation
Nov 4, 2026
Merged

lanyue-llk merged 1 commit into
mainfrom
fix/web-search-english-punctuation

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What, why and how of this PR

Issues

Closes #191

Summary

English Web Search pages no longer render the three Chinese punctuation marks from the issue. The Chinese edition keeps its bytes.

Place Before (English) After (English) Chinese
Review findings list, review.py Corrected:1 findings Corrected: 1 findings unchanged
Requested sites, report.py one.invalid、two.invalid one.invalid, two.invalid unchanged
Population scopes, report.py A 1 queries;B 1 queries A 1 queries; B 1 queries unchanged

All three now go through the message catalog. The catalog gains ", " and "{label}: {count} findings". The second key replaces " findings", which nothing else used. "; " was already there.

Release check

check() now fails when an English route has one of these marks in the findings list, the population note or the requested-sites paragraph.

It looks only at those places, not the whole page. English routes keep measured queries and responses verbatim, so a Chinese query may contain these marks, and a whole-page scan would reject valid reports. A test covers this case: a query containing all three marks still passes.

test_messages.py also rejects the marks in catalog keys and renderer source, so a new inline use fails even outside those three places.

Golden snapshot

One route moved:

  • manifest.json: only renderer_sha256 changed, because the manifest records the hash of report.py, which this PR edits. I diffed a normalized base build against this branch to confirm that this is the only changed line.

No HTML route moved. The snapshot's example builds the Chinese edition plus the English not-generated notice, so it doesn't cover English pages or any of the three places. The new tests in test_search_languages.py cover those instead.

I also built a richer two-edition synthetic report on base and on this branch, with requested sites and independent benchmark populations, and rendered the review summary directly with findings:

  • Chinese routes and the Chinese review summary were identical.
  • The HTML differences were en/index.html, the two en/details/fixture-1-*.html pages and the English review summary, each with the expected separator change.

Test plan

  • tests/web_search, tests/test_golden_reports.py and tests/test_source_language_policy.py: 551 passed, 45 subtests passed.
  • New negative controls: each of the three marks, put back into an English route, fails check().
  • Lint gate (ruff check with F,TID252, then default): passed.
  • Browser visual gate: not run. The change only swaps separators in text.
  • Linux CI is the full-suite gate.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Review complete · 86b64db

No findings in this review.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Independent review, round 1

Reviewed head 86b64db8 against base 0565b4ab, which is still the tip of main. No defects found.

What I verified

  • Separator swaps, byte level. t(", ") and report_text("; ", zh) resolve to the old 、 and ; in Chinese. "{label}: {count} findings" yields the same label:N 条发现 bytes as the old concatenation. In English they yield , , ; and : . Removing " findings" leaves no other callers.

  • Base and head builds compared. I built a two-edition synthetic report on each commit, with requested sites, independent benchmark populations and a query containing all three marks. I also rendered the review summary directly with all five resolutions.

    • The only HTML routes that differ are en/index.html and the two en/details/fixture-1-*.html pages.
    • manifest.json differs only in renderer_sha256 and the hash of browser-eval-version.json, which records the checkout it was built from.
    • The Chinese review summary is byte-identical. The English summary differs only at the separator.
  • Marks left on English pages. In that build they appear only in the measured query, on en/dataset.html, the two detail pages and the data script in en/results.html. No literal or escaped mark remains in any src/harness/web_search/*.py file, apart from the check's own regex.

  • Golden snapshot. The only moved entry is manifest.json, which matches the PR's explanation. renderer_sha256 is written only to the build manifest, so no profile or evidence binding depends on it.

  • Tests fail without the fix. Each mutation below made the relevant tests fail:

    • restoring the literal 、 or ;
    • disabling _check_english_separators
    • dropping either of its selectors
    • setting the catalog value for ", " to an English comma

    The findings separator has no separate mutation. Its assertion compares the exact rendered text of both editions, and the source scan in test_messages.py rejects a literal mark.

  • Release check scope. The selectors match only report-authored places, so a measured query with all three marks still passes. check() skips the scan only for evidence_only=True, which the evidence-reading callers use. Scanning only these places instead of the whole page follows the AGENTS.md rule that measured text stays verbatim.

  • Scope. Closes #191 is accurate: all three marks, the snapshot explanation and the negative controls are done. The diff touches no evidence, profile or receipt.

Test results

  • tests/web_search, tests/test_golden_reports.py and tests/test_source_language_policy.py: 551 passed, 45 subtests passed.
  • Lint gate: passed.
  • CI on this head: all checks pass, including "Tests and static checks", "Installation and packaging" and "Rendered reference and report checks".

Not verified

  • I did not run the browser visual gate.
  • I did not run the check against a real report instance. A real report whose English population label contains one of these marks would now fail the check. That looks like the intended result, because those labels are report-authored.

lanyue-llk added a commit that referenced this pull request Nov 4, 2026
The review findings list, requested sites and population scopes now take their separators from the message catalog, so English pages use English punctuation and the Chinese edition keeps its bytes. The release check rejects those marks in these report-authored places on English pages, and leaves measured queries and responses verbatim.
@lanyue-llk
lanyue-llk force-pushed the fix/web-search-english-punctuation branch from 86b64db to 05c86a5 Compare November 4, 2026 02:48

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Review complete · 05c86a5

No findings in this review.

@lanyue-llk
lanyue-llk merged commit 3760b18 into main Nov 4, 2026
7 checks passed
@lanyue-llk
lanyue-llk deleted the fix/web-search-english-punctuation branch November 4, 2026 02:55
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.

Stop rendering Chinese punctuation on English Web Search pages

1 participant