Skip to content

Add deterministic E2E settings personas#5813

Merged
BillLeoutsakosvl346 merged 6 commits into
e2e/settings-playwrightfrom
e2e/02-personas
Jul 21, 2026
Merged

Add deterministic E2E settings personas#5813
BillLeoutsakosvl346 merged 6 commits into
e2e/settings-playwrightfrom
e2e/02-personas

Conversation

@BillLeoutsakosvl346

@BillLeoutsakosvl346 BillLeoutsakosvl346 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a validated, namespaced settings-persona graph seeded through production APIs with trusted database probes and real Better Auth UI state capture
  • harden the one-shot stack with per-run secrets, least-privilege environments, safe build reuse, process/run locking, fail-closed leak detection, and deterministic cleanup; deliberately remove the unused exact-ID cleanup module until retained-stack support exists
  • verify restored persona contracts, restricted direct routes, and two-worker cross-world isolation, with the complete project dependency chain wired into CI

Test plan

  • bun run type-check
  • bun run check:utils
  • bunx biome check e2e package.json
  • focused security, cache, and lifecycle regression tests
  • full E2E under pinned Bun 1.3.13: 57 passed, 0 failed

Bill Leoutsakos and others added 3 commits July 20, 2026 21:09
Separate build-time inputs from per-run services so verified artifacts can accelerate local iteration without weakening fresh database or provider boundaries.
Model settings personas as deterministic, serializable resource graphs and provide production-first factories with exact-ID cleanup so impossible or cross-world fixture states fail before browser tests run.

Co-authored-by: Cursor <cursoragent@cursor.com>
Provision the validated world through real product boundaries, capture isolated sessions through the login UI, and assert persona contracts plus two-worker cross-world isolation without exposing credentials to Playwright.

Co-authored-by: Cursor <cursoragent@cursor.com>
@BillLeoutsakosvl346
BillLeoutsakosvl346 requested a review from a team as a code owner July 21, 2026 20:13
@gitguardian

gitguardian Bot commented Jul 21, 2026

Copy link
Copy Markdown

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 21, 2026 8:55pm

Request Review

Comment thread apps/sim/e2e/scripts/signal-cleanup.ts Outdated
Comment thread apps/sim/e2e/scripts/seed-world.ts
@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds deterministic settings personas to the guarded E2E stack. The main changes are:

  • Production-API persona seeding with validated manifests and database probes.
  • Real UI login capture and persona contract and isolation tests.
  • Per-run secrets, isolated child environments, process locking, and deterministic cleanup.
  • Verified local build reuse and sandbox-bundle integrity checks.
  • A serialized Playwright project chain wired into CI.

Confidence Score: 4/5

The malformed-canary cleanup path needs a fix before merging.

  • Invalid canary data can leave persona secrets out of the final artifact scan.
  • Interrupted build-cache writes can leave large temporary directories across later cache hits.
  • The remaining lifecycle and environment boundaries include strong ownership and cleanup guards.

apps/sim/e2e/scripts/run.ts; apps/sim/e2e/support/build-manifest.ts

Security Review

The PR strengthens secret isolation and artifact scanning, but a malformed persona canary file can remove persona secrets from the leak scan before its only durable copy is deleted.

Important Files Changed

Filename Overview
apps/sim/e2e/scripts/run.ts Adds the guarded orchestration lifecycle, secret handoff, cleanup supervisor, and artifact leak scan; malformed canary state can reduce scan coverage.
apps/sim/e2e/support/build-manifest.ts Adds content-addressed build caching and atomic activation; cache-hit runs leave interrupted temporary artifacts untouched.
apps/sim/e2e/support/run-lock.ts Adds token- and process-identity-based locking, stale-owner recovery, supervisor transfer, and failure retention.
apps/sim/e2e/support/deployment-profile.ts Defines narrow child environments with isolated home directories and separate build and runtime secrets.
apps/sim/e2e/fixtures/e2e-world.ts Defines validated scenario manifests, persona credentials, storage-state paths, and secret-field checks.
apps/sim/playwright.config.ts Adds the serialized navigation, workflow, persona, and two-worker isolation project chain.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Acquire orchestrator lock] --> B[Create isolated database and services]
  B --> C[Build or restore verified app]
  C --> D[Seed validated persona worlds]
  D --> E[Capture auth states through login UI]
  E --> F[Run dependent Playwright projects]
  F --> G[Stop managed processes]
  G --> H[Drop database and remove private state]
  H --> I[Scan diagnostics for secret leaks]
  I --> J[Release or retain lock]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
  A[Acquire orchestrator lock] --> B[Create isolated database and services]
  B --> C[Build or restore verified app]
  C --> D[Seed validated persona worlds]
  D --> E[Capture auth states through login UI]
  E --> F[Run dependent Playwright projects]
  F --> G[Stop managed processes]
  G --> H[Drop database and remove private state]
  H --> I[Scan diagnostics for secret leaks]
  I --> J[Release or retain lock]
Loading

Reviews (1): Last reviewed commit: "Harden E2E persona orchestration and rem..." | Re-trigger Greptile

Comment on lines 342 to 351
try {
assertNoForbiddenProviderTraffic(
[app?.logPath, realtime?.logPath].filter((value): value is string => Boolean(value))
)
leakCanarySecrets = loadSyntheticSecretCanaryForScan(leakCanarySecrets, canarySecretsPath)
} catch (error) {
failed = true
process.exitCode = 1
console.error(error)
} finally {
rmSync(credentialsPath, { force: true })
rmSync(canarySecretsPath, { force: true })
}

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 security Malformed Canary Weakens Leak Scan

If the seeded canary file is truncated or invalid, loading it throws before persona passwords and invitation tokens are added to leakCanarySecrets, but this finally block deletes the only durable copy. Cleanup can then scan reports and traces with only the initial runtime secrets, allowing a persona secret leak to go undetected.

Comment thread apps/sim/e2e/support/build-manifest.ts Outdated
Comment on lines +199 to +203
if (!existsSync(buildCacheDirectory)) return []
const entries = readdirSync(buildCacheDirectory)
for (const name of entries.filter((entry) => entry.includes('.tmp-'))) {
rmSync(path.join(buildCacheDirectory, name), { recursive: true, force: true })
}

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.

P2 Restores Skip Temporary Cache Cleanup

An interrupted storeCompletedBuild can leave a multi-gigabyte .tmp-* directory. Because pruning runs only after a fresh build, later cache-hit runs never remove that directory, so repeated interruptions followed by restores can exhaust the checkout disk.

Generate runtime secrets per run, fail closed when diagnostics cannot be scanned, and harden cache and process cleanup while removing the unused exact-ID cleanup module until retained-stack support has a real consumer.
Make local-only parser scenarios explicit so the safety suite tests the intended policy instead of inheriting the GitHub runner environment.
@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Large E2E-only surface area touching auth, billing seed paths, and CI diagnostics, but production app code is largely untouched and guards (loopback DB, secret scrubbing, lock/cleanup) are explicit.

Overview
Adds a deterministic hosted-billing settings persona stack on top of the existing one-shot E2E runner: a validated scenario graph (12 primary personas plus an isolation twin), production-API seeding with narrow trusted DB arrangements, UI auth capture into per-persona storage states, and Playwright projects for persona contracts and two-worker cross-world isolation.

The orchestrator now seeds → captures auth → runs tests with a non-secret persona manifest, separate private credentials, per-child least-privilege envs (build sentinels vs runtime), an exclusive run lock, optional local --reuse-build cache, and post-run synthetic-secret canary scans (CI skips cancelled-run artifact uploads and excludes private/auth paths).

Supporting changes include co-locating POST /v1/traces on the Stripe fake, tightening CLI/project rules (--no-deps, new projects, stricter forbidden flags), signal-cleanup/lock handoff, and expanded foundation tests plus README/CI workflow tweaks (drops Next E2E cache restore step).

Reviewed by Cursor Bugbot for commit 428a54b. Bugbot is set up for automated code reviews on this repo. Configure here.

@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 2 potential issues.

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 27878e0. Configure here.

Comment thread apps/sim/e2e/fixtures/factories/invitations.ts
Comment thread apps/sim/e2e/fixtures/http-client.ts Outdated
Match production organization invitations even when workspace grants are attached, and remove an unused cookie-reset method from the E2E client.
@BillLeoutsakosvl346
BillLeoutsakosvl346 merged commit b0b0470 into e2e/settings-playwright Jul 21, 2026
19 checks passed
@waleedlatif1
waleedlatif1 deleted the e2e/02-personas 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