Skip to content

chore(extension): vendor Playwright locator helpers - #3187

Open
supremeboxlogos wants to merge 1 commit into
mainfrom
amel/role-text-locators-upstream
Open

supremeboxlogos wants to merge 1 commit into
mainfrom
amel/role-text-locators-upstream

Conversation

@supremeboxlogos

Copy link
Copy Markdown
Member

why

Isolate the upstream accessibility implementation from Stagehand's locator logic so each can be reviewed independently.

This is the first extension-stack PR. It introduces no SDK API or runtime wiring.

what changed

  • Vendor the five-file accessibility/text helper closure from Playwright 1.64.1, commit cfe490d941f992655948eee8fd4fd94e1c4234bf.
  • Preserve upstream behavior and formatting. Adapt only import paths and one TypeScript array annotation, with explicit adaptation notices.
  • Include licenses, provenance, source hashes, and reversible checks. Pin a test-only Playwright oracle to the same version for the following matching PR.

Almost all of this diff is attributed upstream source, not newly designed Stagehand code. Keeping the helper closure together preserves compilable imports and an auditable upstream algorithm. The Stagehand adapter, runtime wiring, and browser tests are separate PRs.

test plan

  • Eight source-provenance and version-pin checks passed.
  • Extension TypeScript check passed.
  • Formatting/lint exclusions are scoped only to immutable upstream TypeScript files.
  • Strict structural review completed; no runtime behavior or generated extension archive changes.

@changeset-bot

changeset-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 33bd424

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​playwright-core@​1.64.199100799980

View full report

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 16 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Repo as Monorepo
    participant Pkg as package.json
    participant Oracle as Playwright Oracle ([email protected])
    participant Vendor as Vendored Playwright Helpers
    participant Provenance as provenance.json
    participant Test as semanticSelectorVendor.test.ts
    participant Lint as Lint/Format Tooling
    
    Note over Repo,Test: Vendored Playwright helper closure (5 TS files)
    
    Pkg->>Oracle: NEW: devDependency "playwright-semantic-oracle"
    Oracle-->>Repo: Pin to [email protected]
    
    Repo->>Vendor: Vendored helper closure (5 files)
    Vendor->>Vendor: Adapted import paths + one type annotation
    Vendor->>Provenance: Source hashes, commit, version metadata
    Provenance-->>Test: Read-only reference for verification
    
    Repo->>Test: Execute provenance checks
    Test->>Vendor: Read source files
    Test->>Vendor: Strip adaptation notices, rewrite imports/types
    Test->>Vendor: Normalize CRLF if needed
    Test->>Test: Compute SHA256 of normalized source
    Test->>Provenance: Compare with stored hash
    
    alt Hash matches
        Test-->>Repo: Pass: upstream source preserved
    else Hash mismatch
        Test-->>Repo: Fail: vendored source diverged
    end
    
    Test->>Pkg: Verify oracle version matches provenance.version
    Test->>Provenance: Verify commit cfe490d941f992655948eee8fd4fd94e1c4234bf
    
    alt Version pinned correctly
        Test-->>Repo: Pass: oracle aligned with vendor
    else Version mismatch
        Test-->>Repo: Fail: oracle out of sync
    end
    
    Repo->>Lint: Format/lint exclusions for vendored files
    Lint->>Vendor: Apply ignore patterns (oxfmt + oxlint)
    Lint-->>Repo: Skip formatting/linting on immutable upstream files
Loading

View guided diff | Turn on auto-fix | Re-trigger cubic

This branch has not been deployed

No deployments
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.

1 participant