Skip to content

Harden Playwright foundation and persona fidelity#5820

Merged
BillLeoutsakosvl346 merged 8 commits into
e2e/settings-playwrightfrom
e2e/02b-foundation-persona-hardening
Jul 21, 2026
Merged

Harden Playwright foundation and persona fidelity#5820
BillLeoutsakosvl346 merged 8 commits into
e2e/settings-playwrightfrom
e2e/02b-foundation-persona-hardening

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • close browser-egress, diagnostic-upload, signal-cleanup, and stale-process ownership gaps in the guarded E2E lifecycle
  • align lapsed organization personas and first-write superuser defaults with production behavior, including the super_user_mode_enabled = false migration
  • verify fresh sandbox bundle output and build-harness cache identity, with reviewed bundles regenerated under pinned Bun 1.3.13

Test plan

  • Sim and database type-checks
  • Sim/database lint and utility enforcement
  • Stripe client configuration tests (21 passed)
  • Full hermetic Playwright run with pinned Bun (60 passed)
  • Verified build-cache rerun (1 focused test passed on cache hit)

Made with Cursor

Close production-state and cleanup gaps so the settings E2E platform fails closed without sacrificing useful diagnostics.
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 21, 2026 11:38pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR hardens the guarded Playwright lifecycle and aligns E2E personas with production behavior. The main changes are:

  • Browser-origin isolation and safer diagnostic uploads.
  • Persisted process-group ownership and stale-process cleanup.
  • Fresh sandbox-bundle verification and expanded build-cache identity.
  • Lapsed-organization persona updates and disabled superuser defaults.

Confidence Score: 4/5

The signal cleanup race needs to be fixed before merging.

  • Opposite signal types can start two detached supervisors for the same resources.
  • The browser isolation, build verification, settings defaults, and stale-process handling are otherwise consistent.

apps/sim/e2e/scripts/run.ts

Important Files Changed

Filename Overview
apps/sim/e2e/scripts/run.ts Adds process ownership, safer supervisor startup, and leak-scan markers, but opposite signal types can start concurrent cleanup supervisors.
apps/sim/e2e/support/run-lock.ts Persists managed process groups and verifies leader identity before stale cleanup.
apps/sim/e2e/support/browser-network.ts Adds a default-deny HTTP(S) origin guard for Playwright browser contexts.
apps/sim/e2e/support/stack.ts Regenerates sandbox bundles in a temporary directory and verifies their reviewed hashes.
apps/sim/app/api/users/me/settings/route.ts Applies complete defaults on first settings insertion while preserving partial update behavior.
packages/db/migrations/0264_settings_super_user_default.sql Changes the default superuser mode for newly created settings rows to disabled.

Reviews (1): Last reviewed commit: "Harden Playwright lifecycle and persona ..." | Re-trigger Greptile

Comment thread apps/sim/e2e/scripts/run.ts Outdated
Comment on lines +231 to +232
const handleSigint = (): void => void handleSignal('SIGINT')
const handleSigterm = (): void => void handleSignal('SIGTERM')

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.

P1 Opposite Signals Start Duplicate Cleanup

After SIGINT, the separate SIGTERM listener remains active, so a following SIGTERM can enter handleSignal concurrently and start a second cleanup supervisor for the same lock, database, directories, and process groups. One supervisor can release the lock while the other is still cleaning, allowing the next run to race with that cleanup.

Suggested change
const handleSigint = (): void => void handleSignal('SIGINT')
const handleSigterm = (): void => void handleSignal('SIGTERM')
const handleSigint = (): void => {
process.off('SIGTERM', handleSigterm)
void handleSignal('SIGINT')
}
const handleSigterm = (): void => {
process.off('SIGINT', handleSigint)
void handleSignal('SIGTERM')
}

Comment thread apps/sim/e2e/scripts/run.ts
Prevent opposite signals and normal finalization from racing detached cleanup or releasing its run lock.
Comment thread apps/sim/e2e/fixtures/browser-test.ts
Report network isolation violations without masking the original Playwright test or fixture error.
Comment thread apps/sim/e2e/scripts/run.ts Outdated
Comment thread apps/sim/e2e/scripts/run.ts
Keep cleanup single-flight across repeated signals and retain lock ownership when supervisor logging or startup fails.
Comment thread apps/sim/e2e/fixtures/factories/billing.ts
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/sim/e2e/scripts/seed-world.ts Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/sim/e2e/support/run-lock.ts
Comment thread apps/sim/e2e/fixtures/scenario-billing.ts
Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4633f06. Configure here.

Comment thread .github/workflows/test-build.yml Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>
@BillLeoutsakosvl346
BillLeoutsakosvl346 merged commit fc8a7c2 into e2e/settings-playwright Jul 21, 2026
19 checks passed
@waleedlatif1
waleedlatif1 deleted the e2e/02b-foundation-persona-hardening branch July 22, 2026 00:02
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