Skip to content

test(diffs): remove private icon source mirrors - #124196

Merged
steipete merged 1 commit into
mainfrom
test/remove-diffs-source-mirrors
Aug 15, 2026
Merged

steipete merged 1 commit into
mainfrom
test/remove-diffs-source-mirrors

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes two Diffs viewer tests that copy private implementation details from viewer-client.ts:

  • an eight-name toolbar icon key inventory;
  • a blacklist of five obsolete private icon helper function names.

Both tests fail under harmless internal refactors without detecting a user-visible or security regression.

Why This Change Was Made

The meaningful security and behavior coverage remains:

  • iconMarkup: string is still forbidden;
  • innerHTML must still read from the sealed toolbarIconSvg lookup;
  • SVG source is still checked for unsafe markup patterns;
  • DOM/controller tests still exercise all four toolbar toggles, state initialization, toolbar rendering, and image-mode omission.

The deleted cases preserve only the current names and refactor shape.

User Impact

No behavior change. The Diffs viewer retains its security guards and functional toolbar coverage with less source coupling.

Evidence

  • Diffs viewer client suite: 16 tests passed.
  • The extensionTests changed gate passed through the documented trusted-source local fallback because no Crabbox/Testbox provider was ready. Typecheck, formatting, lint, dead-export scans, plugin boundaries, and architecture guards passed.
  • git diff --check passed.
  • Fresh structured autoreview reported no accepted/actionable findings.

Production delta: 0. Tests: -32. No docs, config, schema, protocol, dependency, or changelog change.

AI-assisted: yes.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 15, 2026 15:28
@Avi974

Avi974 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Looks good—removes brittle implementation-detail tests while preserving the meaningful security, functional, and architecture coverage. No user-facing behavior change.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 11:33 AM ET / 15:33 UTC.

ClawSweeper review

What this changes

The PR deletes two Diffs viewer tests that enumerate private toolbar icon names and removed helper-function names.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings. This focused test cleanup removes implementation-name inventories while retaining the viewer’s typed icon path and behavioral toolbar coverage; it remains open for normal maintainer handling because it is maintainer-authored and carries the protected maintainer label.

Priority: P3
Reviewed head: 87b0d6063ef6161d5e09930b4aa02fc001ed9e07

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-neutral cleanup with retained runtime and toolbar coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only cleanup changes no user-visible behavior; focused test evidence and exact-head CI are the relevant merge proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only cleanup changes no user-visible behavior; focused test evidence and exact-head CI are the relevant merge proof.
Evidence reviewed 5 items Focused test-only diff: The branch removes only the icon-name inventory and obsolete-helper blacklist; no runtime, dependency, configuration, or asset code changes.
Runtime safety boundary remains typed: The viewer accepts only the closed toolbar icon union and resolves markup from its local icon lookup before assigning button content.
Behavioral toolbar coverage remains: Existing tests still exercise layout, theme, wrap, and background toggles plus viewer/image header behavior rather than asserting the private icon helper names.
Findings None None.
Security None None.

How this fits together

The Diffs plugin renders diff input into HTML cards and a browser-loaded viewer hydrates those cards into interactive diffs. The viewer’s toolbar changes display settings, while the surrounding tests cover hydration, toolbar actions, and image-mode behavior.

flowchart LR
A[Diff input] --> B[Diff renderer]
B --> C[HTML cards and payload]
C --> D[Viewer runtime]
D --> E[Interactive toolbar]
E --> F[Rendered diff]
Loading

Before merge

  • Complete next step (P2) - This fresh maintainer-owned cleanup has no concrete repair action for the automated work lane.
Agent review details

Security

None.

PR surface

Tests -32. Total -32 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 0 32 -32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 0 32 -32

Review metrics

Metric Value Why it matters
Production versus test LOC production 0, tests -32 The patch removes two implementation-coupled tests and leaves the shipped viewer runtime unchanged.

Technical review

Best possible solution:

Keep the behavior- and safety-oriented viewer coverage while omitting tests whose only contract is the current private icon inventory or retired helper names.

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

Not applicable: this is test-maintenance cleanup, not a report of broken runtime behavior.

Is this the best way to solve the issue?

Yes. Removing the two name-based assertions is the narrowest maintainable path because typed production code and behavioral toolbar tests still cover the relevant contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7ce902c8b600.

Labels

Label changes:

  • add P3: This is low-risk test-maintenance cleanup with no user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is low-risk test-maintenance cleanup with no user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • steipete: Git history and blame show this contributor introduced the current viewer client and its original test suite, including the assertions removed here. (role: introduced current viewer and test coverage; confidence: high; commits: 160e368a8902; files: extensions/diffs/src/viewer-client.ts, extensions/diffs/src/viewer-client.test.ts)

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for 87b0d6063ef6161d5e09930b4aa02fc001ed9e07:

Production delta: 0. Tests: -32. No behavior, docs, config, schema, protocol, dependency, or changelog change.

@steipete
steipete merged commit a560368 into main Aug 15, 2026
164 checks passed
@steipete
steipete deleted the test/remove-diffs-source-mirrors branch August 15, 2026 15:36
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for 87b0d6063ef6161d5e09930b4aa02fc001ed9e07:

Production delta: 0. Tests: -32. No behavior, docs, config, schema, protocol, dependency, or changelog change.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants