The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(e2e): update protected owner file paths
Steven Enamakel8b2b9b36a176
diff --git a/app/scripts/e2e-web-selection-contract.json b/app/scripts/e2e-web-selection-contract.jsonindex a44e51974d..33b66f86b6 100644--- a/app/scripts/e2e-web-selection-contract.json+++ b/app/scripts/e2e-web-selection-contract.json@@ -1,57 +1,57 @@{"protectedOwnerFiles": [- "app/test/playwright/specs/agent-review.spec.ts",- "app/test/playwright/specs/auth-access-control.spec.ts",- "app/test/playwright/specs/card-payment-flow.spec.ts",- "app/test/playwright/specs/channels-smoke.spec.ts",- "app/test/playwright/specs/chat-conversation-history.spec.ts",- "app/test/playwright/specs/chat-harness-cancel.spec.ts",- "app/test/playwright/specs/chat-harness-scroll-render.spec.ts",- "app/test/playwright/specs/chat-harness-send-stream.spec.ts",- "app/test/playwright/specs/chat-harness-wallet-flow.spec.ts",- "app/test/playwright/specs/chat-multi-tool-round.spec.ts",- "app/test/playwright/specs/chat-tool-call-flow.spec.ts",- "app/test/playwright/specs/chat-tool-error-recovery.spec.ts",- "app/test/playwright/specs/command-palette-keyboard.spec.ts",- "app/test/playwright/specs/command-palette.spec.ts",- "app/test/playwright/specs/composio-triggers-flow.spec.ts",- "app/test/playwright/specs/connections-tab-aliases.spec.ts",- "app/test/playwright/specs/connections-tab-deeplinks.spec.ts",- "app/test/playwright/specs/connector-gmail-composio.spec.ts",- "app/test/playwright/specs/conversations-web-channel-flow.spec.ts",- "app/test/playwright/specs/cron-jobs-flow.spec.ts",- "app/test/playwright/specs/crypto-payment-flow.spec.ts",- "app/test/playwright/specs/gmail-flow.spec.ts",- "app/test/playwright/specs/guided-tour-gates.spec.ts",- "app/test/playwright/specs/harness-composio-tool-flow.spec.ts",- "app/test/playwright/specs/local-model-runtime.spec.ts",- "app/test/playwright/specs/login-flow.spec.ts",- "app/test/playwright/specs/logout-relogin-onboarding.spec.ts",- "app/test/playwright/specs/navigation-settings-panels.spec.ts",- "app/test/playwright/specs/navigation-smoothness.spec.ts",- "app/test/playwright/specs/navigation.spec.ts",- "app/test/playwright/specs/notifications.spec.ts",- "app/test/playwright/specs/onboarding-modes.spec.ts",- "app/test/playwright/specs/runtime-picker-login.spec.ts",- "app/test/playwright/specs/settings-account-preferences.spec.ts",- "app/test/playwright/specs/settings-advanced-config.spec.ts",- "app/test/playwright/specs/settings-ai-skills.spec.ts",- "app/test/playwright/specs/settings-channels-permissions.spec.ts",- "app/test/playwright/specs/settings-data-management.spec.ts",- "app/test/playwright/specs/settings-feature-preferences.spec.ts",- "app/test/playwright/specs/skill-execution-flow.spec.ts",- "app/test/playwright/specs/skill-lifecycle.spec.ts",- "app/test/playwright/specs/skill-multi-round.spec.ts",- "app/test/playwright/specs/skill-oauth.spec.ts",- "app/test/playwright/specs/skill-socket-reconnect.spec.ts",- "app/test/playwright/specs/skills-registry.spec.ts",- "app/test/playwright/specs/skills-search-install.spec.ts",- "app/test/playwright/specs/smoke.spec.ts",- "app/test/playwright/specs/user-journey-full-task.spec.ts",- "app/test/playwright/specs/user-journey-settings-round-trip.spec.ts",- "app/test/playwright/specs/voice-mode.spec.ts",- "app/test/playwright/specs/webhooks-ingress-flow.spec.ts",- "app/test/playwright/specs/webhooks-tunnel-flow.spec.ts"+ "test/playwright/specs/agent-review.spec.ts",+ "test/playwright/specs/auth-access-control.spec.ts",+ "test/playwright/specs/card-payment-flow.spec.ts",+ "test/playwright/specs/channels-smoke.spec.ts",+ "test/playwright/specs/chat-conversation-history.spec.ts",+ "test/playwright/specs/chat-harness-cancel.spec.ts",+ "test/playwright/specs/chat-harness-scroll-render.spec.ts",+ "test/playwright/specs/chat-harness-send-stream.spec.ts",+ "test/playwright/specs/chat-harness-wallet-flow.spec.ts",+ "test/playwright/specs/chat-multi-tool-round.spec.ts",+ "test/playwright/specs/chat-tool-call-flow.spec.ts",+ "test/playwright/specs/chat-tool-error-recovery.spec.ts",+ "test/playwright/specs/command-palette-keyboard.spec.ts",+ "test/playwright/specs/command-palette.spec.ts",+ "test/playwright/specs/composio-triggers-flow.spec.ts",+ "test/playwright/specs/connections-tab-aliases.spec.ts",+ "test/playwright/specs/connections-tab-deeplinks.spec.ts",+ "test/playwright/specs/connector-gmail-composio.spec.ts",+ "test/playwright/specs/conversations-web-channel-flow.spec.ts",+ "test/playwright/specs/cron-jobs-flow.spec.ts",+ "test/playwright/specs/crypto-payment-flow.spec.ts",+ "test/playwright/specs/gmail-flow.spec.ts",+ "test/playwright/specs/guided-tour-gates.spec.ts",+ "test/playwright/specs/harness-composio-tool-flow.spec.ts",+ "test/playwright/specs/local-model-runtime.spec.ts",+ "test/playwright/specs/login-flow.spec.ts",+ "test/playwright/specs/logout-relogin-onboarding.spec.ts",+ "test/playwright/specs/navigation-settings-panels.spec.ts",+ "test/playwright/specs/navigation-smoothness.spec.ts",+ "test/playwright/specs/navigation.spec.ts",+ "test/playwright/specs/notifications.spec.ts",+ "test/playwright/specs/onboarding-modes.spec.ts",+ "test/playwright/specs/runtime-picker-login.spec.ts",+ "test/playwright/specs/settings-account-preferences.spec.ts",+ "test/playwright/specs/settings-advanced-config.spec.ts",+ "test/playwright/specs/settings-ai-skills.spec.ts",+ "test/playwright/specs/settings-channels-permissions.spec.ts",+ "test/playwright/specs/settings-data-management.spec.ts",+ "test/playwright/specs/settings-feature-preferences.spec.ts",+ "test/playwright/specs/skill-execution-flow.spec.ts",+ "test/playwright/specs/skill-lifecycle.spec.ts",+ "test/playwright/specs/skill-multi-round.spec.ts",+ "test/playwright/specs/skill-oauth.spec.ts",+ "test/playwright/specs/skill-socket-reconnect.spec.ts",+ "test/playwright/specs/skills-registry.spec.ts",+ "test/playwright/specs/skills-search-install.spec.ts",+ "test/playwright/specs/smoke.spec.ts",+ "test/playwright/specs/user-journey-full-task.spec.ts",+ "test/playwright/specs/user-journey-settings-round-trip.spec.ts",+ "test/playwright/specs/voice-mode.spec.ts",+ "test/playwright/specs/webhooks-ingress-flow.spec.ts",+ "test/playwright/specs/webhooks-tunnel-flow.spec.ts"],"diagnostics": [{diff --git a/app/scripts/e2e-web-selection.mjs b/app/scripts/e2e-web-selection.mjsnew file mode 100644index 0000000000..d963f6b374--- /dev/null+++ b/app/scripts/e2e-web-selection.mjs@@ -0,0 +1,133 @@+#!/usr/bin/env node+import { execFileSync } from 'node:child_process';+import { createHash } from 'node:crypto';+import { readFileSync } from 'node:fs';+import path from 'node:path';+import { fileURLToPath } from 'node:url';++const appRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const contractPath = path.join(appRoot, 'scripts/e2e-web-selection-contract.json');++function sortedUnique(paths, label) {+ const sorted = [...paths].sort();+ if (new Set(sorted).size !== sorted.length) {+ throw new Error(`${label} contains duplicate spec paths`);+ }+ return sorted;+}++export function classifySpecFiles(discoveredPaths, contract) {+ const discovered = sortedUnique(discoveredPaths, 'discovery');+ if (discovered.length === 0) throw new Error('Playwright spec discovery is empty');+ const discoveredSet = new Set(discovered);+ const diagnosticEntries = contract.diagnostics;+ if (!Array.isArray(diagnosticEntries) || diagnosticEntries.length === 0) {+ throw new Error('diagnostic inventory must be non-empty');+ }++ const diagnostic = sortedUnique(+ diagnosticEntries.map(entry => entry.path),+ 'diagnostic inventory'+ );+ const unknownDiagnostics = diagnostic.filter(file => !discoveredSet.has(file));+ if (unknownDiagnostics.length) {+ throw new Error(`stale or unknown diagnostic spec: ${unknownDiagnostics.join(', ')}`);+ }++ const owners = sortedUnique(contract.protectedOwnerFiles, 'protected owner inventory');+ const unknownOwners = owners.filter(file => !discoveredSet.has(file));+ if (unknownOwners.length) {+ throw new Error(`stale or unknown protected owner spec: ${unknownOwners.join(', ')}`);+ }+ const demotedOwners = owners.filter(file => diagnostic.includes(file));+ if (demotedOwners.length) {+ throw new Error(`protected browser owners cannot be diagnostic: ${demotedOwners.join(', ')}`);+ }++ const overlap = diagnostic.filter(file => owners.includes(file));+ if (overlap.length) throw new Error(`diagnostic and required owner overlap: ${overlap.join(', ')}`);+ const required = discovered.filter(file => !diagnostic.includes(file));+ if (required.length === 0 || diagnostic.length === 0) {+ throw new Error('required and diagnostic selections must both be non-empty');+ }+ if (new Set([...required, ...diagnostic]).size !== discovered.length) {+ throw new Error('required and diagnostic selections are not disjoint and exhaustive');+ }++ for (const entry of diagnosticEntries) {+ if (+ !/^https:\/\/github\.com\/[^/]+\/[^/]+\/issues\/\d+#issuecomment-\d+$/.test(+ entry.issue ?? ''+ ) ||+ !/^\d+$/.test(entry.baselineRun ?? '') ||+ !/^\d+$/.test(entry.afterRun ?? '') ||+ !/^[a-f0-9]{40}$/.test(entry.baselineHead ?? '') ||+ !/^[a-f0-9]{40}$/.test(entry.afterHead ?? '') ||+ !entry.caseLabel ||+ !entry.reason ||+ !/^[a-f0-9]{64}$/.test(entry.sha256 ?? '')+ ) {+ throw new Error(`diagnostic entry lacks linked issue and immutable evidence: ${entry.path}`);+ }+ }++ return { all: discovered, required, diagnostic };+}++export function verifyDiagnosticBytes(contract, readFile = readFileSync) {+ for (const entry of contract.diagnostics) {+ const absolutePath = path.join(appRoot, entry.path);+ const digest = createHash('sha256').update(readFile(absolutePath)).digest('hex');+ if (digest !== entry.sha256) {+ throw new Error(+ `diagnostic source changed for ${entry.path}; review and resolve its exact issue before scheduling`+ );+ }+ }+}++export function discoverSpecFiles() {+ const result = execFileSync('rg', ['--files', '--glob', '*.spec.ts', 'test/playwright/specs'], {+ cwd: appRoot,+ encoding: 'utf8',+ });+ return result+ .split(/\r?\n/)+ .filter(Boolean)+ .map(file => file.replaceAll(path.sep, '/'));+}++export function resolveSelection(selection, { contract, discovered = discoverSpecFiles() }) {+ if (!['all', 'required', 'diagnostic'].includes(selection)) {+ throw new Error(`unknown Playwright selection: ${selection}`);+ }+ const sets = classifySpecFiles(discovered, contract);+ verifyDiagnosticBytes(contract);+ const files = sets[selection];+ if (!files.length) throw new Error(`${selection} Playwright selection is empty`);+ return { selection, files, ...sets };+}++function main(args) {+ let selection = 'all';+ let asJson = false;+ for (const arg of args) {+ if (arg.startsWith('--selection=')) selection = arg.slice('--selection='.length);+ else if (arg === '--json') asJson = true;+ else throw new Error(`unknown argument: ${arg}`);+ }+ const contract = JSON.parse(readFileSync(contractPath, 'utf8'));+ const result = resolveSelection(selection, { contract });+ process.stdout.write(+ asJson ? `${JSON.stringify(result)}\n` : `${result.files.join('\n')}\n`+ );+}++if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {+ try {+ main(process.argv.slice(2));+ } catch (error) {+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);+ process.exitCode = 2;+ }+}