Skip to content

test: drop re from the chat_handlers base-name pin - #16695

Merged
bolichen97 merged 1 commit into
mainfrom
fix/chat-handlers-base-name-re
Oct 4, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/chat-handlers-base-name-re

Conversation

@chenmingwei23

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Make test/test_chat_handlers_composition_contract.py pass again on main and on every PR cut from it.

Two tests in that file fail on main since #15917 merged:

  • test_every_name_the_handlers_bound_at_the_base_still_resolves fails with assert ['re'] == [].
  • test_a_fresh_interpreter_sees_every_base_public_name fails because the child interpreter reports ['re'] missing.

Why it matters

Every open PR that runs the backend suite inherits these two failures, so its board is red for a reason unrelated to its own diff (seen on #16673, #16680 and #16682).

Not a goal

  • Changing what chat_handlers binds or exports.
  • Reworking how the composition contract records its base names.

What changed (motivation → approach → change)

Symptom: the contract test says the facade no longer binds re.

Root cause: #15917 replaced chat_handlers' only re.compile with the shared SOURCE_LABEL_CTRL_RE and removed the now-unused import re. _BASE_NAMES still lists re as a name the facade must bind.

Choice: the pin is stale, not the module. Nothing reads re off the facade: a grep of src/ and test/ for chat_handlers.re, ch.re. and from ... chat_handlers import re finds nothing, and no chat_api owner module reads a bare re global (test_every_global_an_owner_function_reads_is_bound_on_the_facade passes). Bringing the import back would add an unused stdlib import that flake8 rejects as F401.

Change: drop re from _BASE_NAMES.

Backwards compatibility

Compatible: the change edits a test pin only; no product code changes.

Removes nothing: re already left the module in #15917; this PR only stops the test from demanding it.

Tests

  • pytest -q -n 0 test/test_chat_handlers_composition_contract.py: on origin/main efd0181, 2 failed and 122 passed; with this change, 124 passed.
  • flake8 on the changed file: clean.
  • scripts/check_comment_history.py (selftest and diff scope): passed.

Manual verification

N/A: the change is a one-word edit to a test pin, and the test file itself is the verification.

Related Issues

Fixes #16693

Pattern harvest

Not generalizable: the pin is a snapshot of one module's names before a split; a later deliberate removal of an unused import is expected to update it, and the test already caught it on the first run.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

The note-source change replaced chat_handlers' only re.compile with the
shared SOURCE_LABEL_CTRL_RE and removed the now-unused import re. The
composition contract still listed re as a name the facade must bind, so
two surface tests failed on main and on every PR cut from it. Nothing
reads re off the facade, so the pin drops it.

Fixes #16693
@chenmingwei23
chenmingwei23 requested a review from a team as a code owner October 4, 2026 06:40
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 7d66718e13c0d74e2d23d0dd81395fb517c4f77d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 7d66718

Description read

[DESCRIPTION-READ] 1ac82fb5b0349a372a6bcca3ee9a49be4b60459d16a0895d3fa9d9fc9a89b2cc

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 7d66718e13c0d74e2d23d0dd81395fb517c4f77d — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 7d66718

Verdict parsed from the review's SHA-scoped output markers for commit 7d66718e13c0d74e2d23d0dd81395fb517c4f77d.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 7d66718e13c0d74e2d23d0dd81395fb517c4f77d: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 7d66718e13c0d74e2d23d0dd81395fb517c4f77d and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 7d66718

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 7d66718e13c0d74e2d23d0dd81395fb517c4f77d: <one-sentence reason>

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.

test: chat_handlers composition contract still pins re after #15917 removed the import (main red)

2 participants