Skip to content

test(browser): guard thinking-effort locale word lists against silent drift - #417

Open
OfficialAbhinavSingh wants to merge 1 commit into
steipete:mainfrom
OfficialAbhinavSingh:test/thinking-effort-locale-label-drift
Open

test(browser): guard thinking-effort locale word lists against silent drift#417
OfficialAbhinavSingh wants to merge 1 commit into
steipete:mainfrom
OfficialAbhinavSingh:test/thinking-effort-locale-label-drift

Conversation

@OfficialAbhinavSingh

Copy link
Copy Markdown
Contributor

Summary

Problem

Same gap named in docs/browser-mode.md:

Model picker drift – we rely on heuristics… Consider snapshot tests or a small "self check" command.

thinkingTime.ts already has good multilingual test coverage (#377, #405 both added regression tests), but on inspection each existing check only pins a word list's leading entry as a stand-in for "unchanged", e.g.:

expect(buildThinkingTimeExpressionForTest("extended")).toContain(
  "extended: ['extended', 'high'",
);

That proves 'extended' and 'high' are still first — it says nothing about 'hoch', 'erweitert', '高い', '扩展', '深度', '加强', or '高', the other 7 words in that same array. Same shape for EFFORT_WORDS (2 of 11 words checked) and ADVANCED_WORDS (0 of 8 checked anywhere). A word dropped from the middle or end of any of these arrays passes every existing test.

Change

tests/browser/thinkingTime.test.ts: three new tests, each asserting every word in LEVEL_TOKENS (per tier), EFFORT_WORDS, and ADVANCED_WORDS is present in the generated expression.

Verification that this actually catches drift

Temporarily removed esforco — a mid-array EFFORT_WORDS entry none of the existing tests touch — reran, restored:

FAIL  tests/browser/thinkingTime.test.ts > browser thinking-time selection expression > keeps every EFFORT_WORDS locale word
AssertionError: EFFORT_WORDS should still list 'esforco': expected ... to contain '\'esforco\''

Restored the source (git diff --stat src/browser/actions/thinkingTime.ts → no diff) and confirmed green again.

Checks

  • pnpm vitest run tests/browser/thinkingTime.test.ts — 63 passed (was 60 before this PR)
  • pnpm test — 152 files / 1797 passed / 44 skipped (unchanged skip count)
  • pnpm run typecheck — clean
  • npx oxlint tests/browser/thinkingTime.test.ts — clean
  • npx oxfmt --check — clean

CHANGELOG.md left as-is (mis-formatted on main; release owner per #349).

Scope note

Second in the same series as #416 (archive matcher pilot). Same pattern, applied to the file with the most locale-drift history (#377, #405). Remaining action files with per-locale matchers (modelSelection.ts, navigation.ts, attachments.ts, etc.) are natural next candidates.

… drift

LEVEL_TOKENS, EFFORT_WORDS, and ADVANCED_WORDS in thinkingTime.ts each
carry a per-locale word list, grown language-by-language across steipete#377,
steipete#405, and other fixes (German, Chinese, Japanese, Spanish, Portuguese,
Italian, Dutch, Polish). The existing tests only assert each list's
leading word(s) as a stand-in for "the array still starts the same
way" - a word dropped from the middle or end of any list would pass
every existing test unnoticed, the exact gap docs/browser-mode.md's
"self check" note is about.

Add three tests asserting every word in every list is still present.

Verified these actually catch drift: temporarily removed 'esforco'
(mid-array in EFFORT_WORDS, a word none of the existing tests touch)
from the source and reran - the new test failed on exactly that word,
confirmed, then restored the source unchanged.

No production code touched. Same pattern as steipete#416, piloted on
archiveConversation.ts.
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 25, 2026, 6:07 AM ET / 10:07 UTC.

ClawSweeper review

What this changes

The PR adds browser tests intended to preserve every localized thinking-level, effort-menu, and advanced-menu label in the generated ChatGPT picker expression.

Merge readiness

Blocked until real behavior proof from a real setup is added - 4 items remain

Keep open: the new assertions search the entire generated expression, so they do not reliably prove membership in each declared locale list; real behavior proof is also still needed before merge.

Priority: P3
Reviewed head: bfed0b26ca555a2ae9fba0c7abcfeb30a802b314

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The test-only intent is useful, but the current assertion structure misses a concrete duplicate-label case and no qualifying after-fix proof is attached.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Needs real behavior proof before merge: the PR reports tests and checks, which are supplemental evidence only. Attach a redacted terminal artifact showing an intentional overlapping-label deletion fails and the restored PR head passes; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Needs real behavior proof before merge: the PR reports tests and checks, which are supplemental evidence only. Attach a redacted terminal artifact showing an intentional overlapping-label deletion fails and the restored PR head passes; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 3 items Overlapping source terms: Current main defines erweitert in both LEVEL_TOKENS.extended and ADVANCED_WORDS, so a whole-expression search cannot prove which list retains it.
Patch assertion scope: The added tests call the expression builder and search the complete returned string for each word, rather than isolating the corresponding literal array.
Feature-history provenance: The Japanese effort-label support was merged in the recent browser thinking-time fix, making that contributor a relevant owner for the locale-list behavior.
Findings 1 actionable finding [P2] Scope locale assertions to their declared lists
Security None None.

Live Verification

Command: pnpm vitest run tests/browser/thinkingTime.test.ts

Result: PASS (completed)

pnpm vitest run tests/browser/thinkingTime.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-417-gurXIi/target$ pnpm vitest run tests/browser/thinkingTime.test.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-417-gurXIi/target

pnpm vitest run tests/browser/thinkingTime.test.ts
 ✓ tests/browser/thinkingTime.test.ts (63 tests) 150ms

 Test Files  1 passed (1)
      Tests  63 passed (63)
   Start at  10:07:49
   Duration  579ms (transform 200ms, setup 33ms, import 265ms, tests 150ms, environment 0ms)

runner@runnervm76f27:/tmp/clawsweeper-live-proof-417-gurXIi/target$ pnpm vitest run tests/browser/thinkingTime.test.ts





































Assertions:

  • PASS expect_output: tests/browser/thinkingTime.test.ts

How this fits together

Oracle’s browser mode generates JavaScript that finds ChatGPT’s multilingual thinking-effort picker controls and selects a requested tier. That expression runs in the active browser page before the prompt is submitted.

flowchart LR
  A[CLI thinking-time option] --> B[Browser thinking-time action]
  B --> C[Generated page expression]
  C --> D[Localized picker labels]
  D --> E[Select and verify effort]
  E --> F[Browser prompt submission]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Needs real behavior proof before merge: the PR reports tests and checks, which are supplemental evidence only. Attach a redacted terminal artifact showing an intentional overlapping-label deletion fails and the restored PR head passes; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Scope locale assertions to their declared lists (P2) - The generated expression contains every list. In particular, erweitert is present in both LEVEL_TOKENS.extended and ADVANCED_WORDS, so deleting it from either list still satisfies these whole-expression checks. Isolate each literal array (or export the data for direct comparison) so the claimed per-list drift guard fails correctly.
  • Resolve merge risk (P1) - The PR body provides only test and static-check claims; an external contributor still needs after-fix, redacted real-behavior evidence before merge.
  • Complete next step (P2) - A focused test-only repair can make the intended list-inventory guard mechanically correct; contributor proof remains a separate merge requirement.

Findings

  • [P2] Scope locale assertions to their declared lists — tests/browser/thinkingTime.test.ts:101-105
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Test-only delta production +0, tests +58 The narrow scope limits runtime blast radius, so the assertion semantics are the central merge-quality concern.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Make each inventory test inspect only its corresponding literal array or export immutable locale data for direct equality checks, then show that removing an overlapping term fails and restoring it passes.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Make each inventory test inspect only its corresponding literal array or export immutable locale data for direct equality checks, then show that removing an overlapping term fails and restoring it passes.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: removing erweitert from either of its two source lists still leaves the other occurrence in the generated expression, so the broad assertion can pass.

Is this the best way to solve the issue?

No: the tests must scope checks to each named array; global string presence cannot enforce the claimed per-list inventory contract.

Full review comments:

  • [P2] Scope locale assertions to their declared lists — tests/browser/thinkingTime.test.ts:101-105
    The generated expression contains every list. In particular, erweitert is present in both LEVEL_TOKENS.extended and ADVANCED_WORDS, so deleting it from either list still satisfies these whole-expression checks. Isolate each literal array (or export the data for direct comparison) so the claimed per-list drift guard fails correctly.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found, but no applicable review policy affected this item.

Codex review notes: model internal, reasoning high; reviewed against 79e483bd9dc8.

Labels

Label changes:

  • add P3: This is low-risk regression-test coverage, with a bounded test-correctness repair and no production behavior change.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Needs real behavior proof before merge: the PR reports tests and checks, which are supplemental evidence only. Attach a redacted terminal artifact showing an intentional overlapping-label deletion fails and the restored PR head passes; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is low-risk regression-test coverage, with a bounded test-correctness repair and no production behavior change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Needs real behavior proof before merge: the PR reports tests and checks, which are supplemental evidence only. Attach a redacted terminal artifact showing an intentional overlapping-label deletion fails and the restored PR head passes; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Acceptance criteria:

  • [P1] pnpm vitest run tests/browser/thinkingTime.test.ts.
  • [P1] pnpm run typecheck.

What I checked:

Likely related people:

  • kiyo-e: Their merged change added the Japanese effort-label coverage in the source list now being guarded. (role: recent browser locale-label contributor; confidence: high; commits: 61d202a2c4ed; files: src/browser/actions/thinkingTime.ts, tests/browser/thinkingTime.test.ts)
  • steipete: Their merged browser alias-routing work established adjacent thinking-time selection and regression coverage. (role: browser thinking-time feature contributor; confidence: medium; commits: 39b0d416a937; files: src/browser/actions/thinkingTime.ts, tests/browser/thinkingTime.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Scope every check to the exact LEVEL_TOKENS, EFFORT_WORDS, or ADVANCED_WORDS literal it claims to protect.
  • Attach a redacted terminal transcript showing removal of overlapping erweitert fails and restoration passes.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant