Skip to content

test(browser): guard archive expression locale labels against silent drift - #416

Open
OfficialAbhinavSingh wants to merge 2 commits into
steipete:mainfrom
OfficialAbhinavSingh:test/archive-locale-label-drift
Open

test(browser): guard archive expression locale labels against silent drift#416
OfficialAbhinavSingh wants to merge 2 commits into
steipete:mainfrom
OfficialAbhinavSingh:test/archive-locale-label-drift

Conversation

@OfficialAbhinavSingh

@OfficialAbhinavSingh OfficialAbhinavSingh commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a locale-label drift guard for the ChatGPT archive-conversation matcher (buildArchiveConversationExpression).
  • Test-only. No production code changed.

Problem

docs/browser-mode.md names this gap directly:

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

The archive matcher is the clearest recent example. It carries four separate per-locale label lists (menu "more options", archive item/confirm, unarchive/restore exclusion, confirmation toast), each independently extended locale-by-locale (#407 added Japanese; Polish predates that). Nothing asserted the full set together — only a handful of Japanese literals were spot-checked. A future PR touching any one of these .includes(...) chains could silently drop or mistype an existing locale's label, and it would only surface later as a live-account regression report.

Change

tests/browser/archiveConversation.test.ts: one inventory test per matcher (menu, archive action, unarchive exclusion, confirmation toast), asserting every locale label currently in buildArchiveConversationExpression is present. A drop or typo in any of them now fails CI at review time instead of live.

Update: scoped assertions per matcher (addresses review feedback)

The first version checked each label against the whole serialized expression. Several labels ("archive", "アーカイブ") are legitimately repeated across findArchiveMenuItem and findArchiveConfirmationButton, so a global toContain(label) stayed green even when a label was deleted from just one of them — reviewed and flagged correctly.

Fixed: the expression is now sliced per matcher function before asserting, so a check can only be satisfied by that matcher's own labels. Labels are also matched as quoted literals ('label') rather than bare substrings — "アーカイブ" is itself a substring of "アーカイブする", so a bare check would still pass after the standalone literal is removed as long as the longer one survives.

Verified against exactly the flagged scenario: removed the 'アーカイブ' exact-match line from findArchiveConfirmationButton only (left it in findArchiveMenuItem). First attempt (unquoted slice check) stayed green — a false negative, confirming the substring issue above. Fixed to quoted matching, reran: failed on exactly that label. Restored the source, confirmed green again (14/14).

Original drift-catch proof (still holds against the current version): temporarily removed one Polish literal (opcje), reran, restored:

FAIL  tests/browser/archiveConversation.test.ts > archive expression locale label inventory > conversation menu ('more options') labels are present
AssertionError: ...to contain '\'opcje\''

git diff --stat src/browser/actions/archiveConversation.ts → no diff after both restores; production code was never touched.

Checks

  • pnpm vitest run tests/browser/archiveConversation.test.ts — 14 passed
  • pnpm test — 152 files / 1795 passed / 44 skipped (unchanged skip count)
  • pnpm run typecheck — clean
  • npx oxlint tests/browser/archiveConversation.test.ts — clean
  • npx oxfmt --check — clean

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

Scope note

This is a pilot on one file to establish the pattern before extending it — thinkingTime.ts (behind #405's effort-label locale fixes) and the other action files with per-locale matchers are natural next candidates, as follow-up PRs.

…drift

The conversation-menu, archive-item, unarchive, and confirmation-toast
matchers in buildArchiveConversationExpression each carry their own
per-locale label list (steipete#407 added Japanese, earlier work added Polish).
Nothing asserted the full set together, so a future edit could drop or
mistype an existing locale's label without any test noticing — it would
only surface as a live-account regression report, the exact gap named
in docs/browser-mode.md's "Model picker drift" note.

Add one inventory test per matcher enumerating every label it currently
relies on. Verified these actually catch drift: temporarily removed one
Polish literal from the source and reran — the new test failed with the
literal it expected, confirmed, then restored the source unchanged.

No production code touched.
@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 merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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:19 AM ET / 10:19 UTC.

ClawSweeper review

What this changes

The PR adds test inventories for each localized-label matcher in Oracle’s ChatGPT archive-conversation browser flow.

Merge readiness

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

Keep open: the follow-up fixes the prior matcher-scope false negative and no remaining code defect was found, but the external-PR real-behavior proof gate is still unmet.

Priority: P3
Reviewed head: 01b0a6a158f837804a76a127b2c6b44226303b41

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused test repair is sound, but real behavior proof remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The mutation and Vitest results demonstrate the test harness, but are not after-fix browser archive-flow evidence; add a redacted real browser trace before merge. 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 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The mutation and Vitest results demonstrate the test harness, but are not after-fix browser archive-flow evidence; add a redacted real browser trace before merge. 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 4 items Current archive matcher: The current-main expression contains separate localized label checks for the conversation menu, archive action, confirmation action, unarchive exclusion, and confirmation toast.
Scoped test repair: The branch slices the generated expression by adjacent matcher boundaries and checks quoted literals, preventing the duplicate-label and substring false negatives identified in the prior review.
Feature provenance: Current main records the localized archive-control implementation as the merged browser fix for pull request 407.
Findings None None.
Security None None.

Live Verification

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

Result: PASS (completed)

pnpm vitest run tests/browser/archiveConversation.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-416-m6sGqa/target$ pnpm vitest run tests/browser/archiveConversation.test.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-416-m6sGqa/target

 ✓ tests/browser/archiveConversation.test.ts (14 tests) 13ms

pnpm vitest run tests/browser/archiveConversation.test.ts Test Files  1 passed (1)
      Tests  14 passed (14)
   Start at  10:19:32
   Duration  217ms (transform 53ms, setup 35ms, import 40ms, tests 13ms, environment 0ms)


runner@runnervm76f27:/tmp/clawsweeper-live-proof-416-m6sGqa/target$ pnpm vitest run tests/browser/archiveConversation.test.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-416-m6sGqa/target

 ✓ tests/browser/archiveConversation.test.ts (14 tests) 12ms

 Test Files  1 passed (1)
      Tests  14 passed (14)
   Start at  10:19:33
   Duration  214ms (transform 50ms, setup 35ms, import 38ms, tests 12ms, environment 0ms)

runner@runnervm76f27:/tmp/clawsweeper-live-proof-416-m6sGqa/target$


























Assertions:

  • PASS expect_output: 14 passed

How this fits together

Oracle serializes archive-control matching logic into a ChatGPT browser page to locate menus, archive actions, confirmation controls, and success messages. These tests inspect that generated matcher expression so removal of known locale labels fails during validation.

flowchart LR
  A[ChatGPT localized controls] --> B[Archive browser action]
  B --> C[Generated page matcher]
  C --> D[Localized label lists]
  D --> E[Archive menu and confirmation]
  F[Inventory tests] --> C
  E --> G[Archived conversation]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The mutation and Vitest results demonstrate the test harness, but are not after-fix browser archive-flow evidence; add a redacted real browser trace before merge. 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.
  • Resolve merge risk (P1) - The submitted evidence is confined to Vitest and mutation-harness results; it does not demonstrate the archive path against real ChatGPT controls after this test change.
  • Complete next step (P2) - No code repair is indicated; contributor-supplied real browser behavior proof is needed before a merge decision.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Test-only delta 97 added, 0 removed; 1 test file affected The branch adds preventive coverage without changing the archive runtime.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the focused test and add a redacted browser trace showing a localized archive control reaches a successful archive result, then re-review this head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the focused test and add a redacted browser trace showing a localized archive control reaches a successful archive result, then re-review this head.

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

Not applicable: this PR adds preventive regression coverage rather than repairing a presently reported runtime failure.

Is this the best way to solve the issue?

Yes: scoped matcher slices and quoted-literal assertions directly address the earlier duplicate-label and substring false negatives.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove merge-risk: 🚨 other: Current PR review selected no merge-risk labels.

Label justifications:

  • P3: This is a narrowly scoped test-only maintenance change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The mutation and Vitest results demonstrate the test harness, but are not after-fix browser archive-flow evidence; add a redacted real browser trace before merge. 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

What I checked:

Likely related people:

  • moeuu: Authored the merged pull request that added the Japanese archive controls now covered by this test. (role: localized archive behavior contributor; confidence: high; commits: 79e483bd9dc8; files: src/browser/actions/archiveConversation.ts)
  • Eiji Morita: Authored the current-main merge commit for the archive-control implementation. (role: recent current-main committer; confidence: medium; commits: 79e483bd9dc8; files: src/browser/actions/archiveConversation.ts)

Rank-up moves

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

  • Add redacted browser evidence that shows localized archive controls reaching a successful archive result.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-25T10:01:02.999Z sha 3a05252 :: needs real behavior proof before merge. :: [P2] Scope label checks to their individual matcher

clawsweeper caught a real gap: the inventory tests added in this PR
checked each label against the whole serialized expression, not the
specific matcher function that consumes it. Several labels ("archive",
"アーカイブ") are legitimately repeated across findArchiveMenuItem and
findArchiveConfirmationButton, so a global toContain(label) stayed
green even when a label was deleted from just one of them.

Slice the expression per matcher function before asserting, and match
each label as a quoted literal ('label') rather than a bare substring
- "アーカイブ" is itself a substring of "アーカイブする", so a bare
check would still pass after the standalone literal is removed as long
as the longer one survives.

Verified against exactly clawsweeper's scenario: removed the 'アーカイブ'
exact-match line from findArchiveConfirmationButton only (left it in
findArchiveMenuItem). First attempt (unquoted slice check) stayed
green - false negative, confirming the deeper substring issue above.
Fixed to quoted matching, reran: failed on exactly that label. Restored
the source, confirmed green again (14/14).
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 25, 2026
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