Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
build(web): replace the platform-compat tooling with ast-grep rules (#9281)
teob23daa6ffb4f
diff --git a/.agents/rules/checks.md b/.agents/rules/checks.mdnew file mode 100644index 0000000000..fdb4800e00--- /dev/null+++ b/.agents/rules/checks.md@@ -0,0 +1,35 @@+---+description: "Guard against a repeated mistake with the checks the repository already runs (ast-grep, oxlint, Biome, clippy, a test), not a new tool."+paths:+ - "tooling/**"+ - "rules/ast-grep/**"+ - "sgconfig.yml"+ - ".github/workflows/**"+ - "**/.oxlintrc.json"+ - "**/biome*.jsonc"+ - "clippy.toml"+ - "**/eslint.config.*"+ - "**/.eslintrc*"+globs: "tooling/**,rules/ast-grep/**,sgconfig.yml,.github/workflows/**,**/.oxlintrc.json,**/biome*.jsonc,clippy.toml,**/eslint.config.*,**/.eslintrc*"+alwaysApply: false+---++# Add checks to the tools the repository already runs++A browser-floor guard once arrived as a new ESLint package: its own lockfile,+CI install steps and about 900 lines. All it caught was two API calls that two+ast-grep patterns now catch.++- Write a structural "never write this" check as an ast-grep rule in+ `rules/ast-grep/`, as a `ts-`/`tsx-` pair for TypeScript.+- Before writing a rule, look for one in a linter the repository already runs:+ oxlint, Biome or clippy. Check behaviour with a test.+- Cover the mistake that happened and its close relatives, not every possible+ variant.+- Ask the user before adding a linter, a tool package or a dependency for a+ check.+- A check that must block merging runs in a required CI job. Conventions, which+ runs every ast-grep rule, isn't required.++Check: the change adds no new linter configuration, tool package or lockfile for+a check, and each new check fails on the mistake it guards against.diff --git a/.github/workflows/web-app-check-main.yml b/.github/workflows/web-app-check-main.ymlindex 497d8b9945..e8123ddd0e 100644--- a/.github/workflows/web-app-check-main.yml+++ b/.github/workflows/web-app-check-main.yml@@ -48,7 +48,6 @@ jobs:- 'packages/sdk-docs/**'- 'services/ai-editing-worker/**'- 'packages/code-mode-sdk/**'- - 'tooling/platform-compat/**'- 'crates/code_execution/src/outbound/deno/*.mjs'- 'crates/agent_code_mode/src/domain/documentation.json'- 'crates/agent_code_mode/SKILL.md'@@ -377,12 +376,8 @@ jobs:- name: Run Collaboration Package Biomerun: biome ci --changed --no-errors-on-unmatched --error-on-warningsworking-directory: packages/collaboration- - name: Install Platform Compatibility Tooling- run: bun install --frozen-lockfile- working-directory: tooling/platform-compat- name: Check Browser Floor and Native Permissions- run: bun run check- working-directory: tooling/platform-compat+ run: bunx --yes @ast-grep/[email protected] scan --filter '^(tsx?-browser-floor-apis|plist-media-.+)$'- name: Teardown Nixif: always()uses: './.github/actions/teardown-nix'diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.mdindex b9db05b919..b727c1e18a 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -10,9 +10,10 @@- Email rendering is isolated in `packages/email-renderer` at the repository root. Run `just test-email-rendering` for its Node and Chromium suites. Add fixtures under `packages/email-renderer/tests/fixtures`, run `just test-email-rendering-update`, and review changed images. These are renderer tests, not inbox e2e.- Supported browsers are the `browserslist` in `package.json`. Safari and iOS16.4 is the oldest WebKit the app starts on: startup code, including- `@pierre/diffs`, evaluates regex lookbehind. `vite.base.ts` builds to it- and `tooling/platform-compat` lints for newer APIs; feature-detect them or- raise the floor there.+ `@pierre/diffs`, evaluates regex lookbehind. `vite.base.ts` builds to it,+ and the ast-grep rules `ts-browser-floor-apis` and `tsx-browser-floor-apis`+ ban APIs that turned out to be newer; add one there when it bites, or raise+ the floor.- The app does not register a service worker. Keep `public/sw.js` as a retirementendpoint for existing installations; see the [startup bundle rule](../../.agents/rules/web/startup-bundle.md).Loro uses async WASM loading and HTML preloads independently of service workers.diff --git a/apps/web/src/features/email-compose/primitives/draft-persistence.test.ts b/apps/web/src/features/email-compose/primitives/draft-persistence.test.tsindex ea83004aa2..2c2d47e067 100644--- a/apps/web/src/features/email-compose/primitives/draft-persistence.test.ts+++ b/apps/web/src/features/email-compose/primitives/draft-persistence.test.ts@@ -4,9 +4,7 @@ import { createComposeContext } from '../tests/capabilities';import { createDraftPersistence } from './draft-persistence';import { createDraftSession } from './draft-session';-it('deletes an emptied draft on webviews without Promise.withResolvers', async () => {- const withResolvers = Promise.withResolvers;- Reflect.deleteProperty(Promise, 'withResolvers');+it('deletes an emptied draft', async () => {const deleteDraft = vi.fn(async () => {});const { dispose, session, persistence } = createRoot((dispose) => {const session = createDraftSession({@@ -31,7 +29,6 @@ it('deletes an emptied draft on webviews without Promise.withResolvers', async ();expect(session.draftId()).toBeUndefined();} finally {- Object.assign(Promise, { withResolvers });dispose();}});diff --git a/apps/web/src/features/slack-import/queries/import-source.test.ts b/apps/web/src/features/slack-import/queries/import-source.test.tsindex 75bbf9e221..7ba75d6728 100644--- a/apps/web/src/features/slack-import/queries/import-source.test.ts+++ b/apps/web/src/features/slack-import/queries/import-source.test.ts@@ -660,28 +660,22 @@ describe('import commands', () => {expect(h.client.cancelSlackImport).toHaveBeenCalledWith({ jobId });});- it('uploads with a caller signal on webviews without AbortSignal.any', async () => {- const { any } = AbortSignal;- Reflect.deleteProperty(AbortSignal, 'any');- try {- const h = mount();- h.client.registerSlackImportUploads.mockResolvedValue(ok([grant]));- const [capability] = await h.commands.register(identity, [- grant.descriptor,- ]);- h.upload.mockResolvedValue(ok('uploaded'));- const caller = new AbortController();- const listen = vi.spyOn(caller.signal, 'addEventListener');+ it('stops listening to the caller signal once an upload finishes', async () => {+ const h = mount();+ h.client.registerSlackImportUploads.mockResolvedValue(ok([grant]));+ const [capability] = await h.commands.register(identity, [+ grant.descriptor,+ ]);+ h.upload.mockResolvedValue(ok('uploaded'));+ const caller = new AbortController();+ const listen = vi.spyOn(caller.signal, 'addEventListener');- expect(- await capability.put(new Blob(['{}']), { signal: caller.signal })- ).toBe('uploaded');- // A finished upload stops listening to the long-lived caller signal.- const options = listen.mock.calls[0]?.[2];- expect(typeof options === 'object' && options.signal?.aborted).toBe(true);- } finally {- Object.assign(AbortSignal, { any });- }+ expect(+ await capability.put(new Blob(['{}']), { signal: caller.signal })+ ).toBe('uploaded');+ // A finished upload stops listening to the long-lived caller signal.+ const options = listen.mock.calls[0]?.[2];+ expect(typeof options === 'object' && options.signal?.aborted).toBe(true);});it('rejects stale commands, late mutation responses and stale upload grants', async () => {diff --git a/apps/web/src/lib/filesystem/open.ts b/apps/web/src/lib/filesystem/open.tsindex 9dacc04d52..eb889cf826 100644--- a/apps/web/src/lib/filesystem/open.ts+++ b/apps/web/src/lib/filesystem/open.ts@@ -14,7 +14,6 @@ async function openInBrowser(filters: Array<FileFilter>,multiple: boolean): Promise<FileHandle[]> {- // eslint-disable-next-line platform-compat/browser-floor -- checked before use below.const openFilePicker = window?.showOpenFilePicker;if (!openFilePicker) {throw new FileSystemError(diff --git a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.tsindex 4cef5eb215..f94ded65e6 100644--- a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts+++ b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts@@ -4762,9 +4762,6 @@ describe('normalizedCacheExchange', () => {.spyOn(AbortSignal, 'timeout').mockReturnValue(timeoutSignal);const operationFetch = vi.fn().mockResolvedValue(new Response());- // Webviews below Safari 17.4 have no AbortSignal.any.- const { any } = AbortSignal;- Reflect.deleteProperty(AbortSignal, 'any');try {const mutation = makeMutationOp(1, optimistic);const mutationWithFetch = makeOperation(mutation.kind, mutation, {@@ -4791,7 +4788,6 @@ describe('normalizedCacheExchange', () => {expect(signal.reason).toBe('cancelled');await fetched;} finally {- Object.assign(AbortSignal, { any });timeout.mockRestore();}});diff --git a/apps/web/src/lib/graphql-cache/worker/coordinator-page-adapter.ts b/apps/web/src/lib/graphql-cache/worker/coordinator-page-adapter.tsindex 4cc17a58db..fb05212c33 100644--- a/apps/web/src/lib/graphql-cache/worker/coordinator-page-adapter.ts+++ b/apps/web/src/lib/graphql-cache/worker/coordinator-page-adapter.ts@@ -116,7 +116,6 @@ const defaultSharedWorkerFactory = (scope: string,buildTime: number): SharedWorkerLike =>- // eslint-disable-next-line platform-compat/browser-floor -- connect() checks for SharedWorker before calling this.new SharedWorker(new URL('./cache.coordinator.shared-worker.ts', import.meta.url),{ type: 'module', name: `graphql-cache-coordinator:${scope}:${buildTime}` }diff --git a/apps/web/src/lib/queries/email/server-sends.test.ts b/apps/web/src/lib/queries/email/server-sends.test.tsindex 34cc05b737..7a481a442a 100644--- a/apps/web/src/lib/queries/email/server-sends.test.ts+++ b/apps/web/src/lib/queries/email/server-sends.test.ts@@ -50,18 +50,6 @@ it('loads sends from other devices on sign-in without a local send or rollout flexpect(readPendingEmailSends).toHaveBeenCalledTimes(1);});-it('loads sends on webviews without AbortSignal.any', async () => {- const { any } = AbortSignal;- Reflect.deleteProperty(AbortSignal, 'any');- try {- setServerSendSession('owner');- await refreshServerEmailSends();- expect(serverEmailSends()).toEqual(pending.pendingEmailSends.attempts);- } finally {- Object.assign(AbortSignal, { any });- }-});-it('waits offline and refreshes server sends on reconnect', async () => {vi.spyOn(navigator, 'onLine', 'get').mockReturnValue(false);setServerSendSession('owner');diff --git a/apps/web/src/lib/queries/soup/request-timeout.test.ts b/apps/web/src/lib/queries/soup/request-timeout.test.tsindex 54567e44a9..9150e71c48 100644--- a/apps/web/src/lib/queries/soup/request-timeout.test.ts+++ b/apps/web/src/lib/queries/soup/request-timeout.test.ts@@ -29,21 +29,6 @@ describe('createSoupRequestSignal', () => {timeout.mockRestore();});- it('works on webviews without AbortSignal.any', () => {- const { any } = AbortSignal;- Reflect.deleteProperty(AbortSignal, 'any');- try {- const query = new AbortController();- const signal = createSoupRequestSignal(query.signal);-- query.abort();-- expect(signal.aborted).toBe(true);- } finally {- Object.assign(AbortSignal, { any });- }- });-it('pauses while offline and resumes when connectivity returns', async () => {onlineManager.setOnline(false);const queryFn = vi.fn(async () => 'loaded');diff --git a/apps/web/src/lib/split-router/tests/router.test.ts b/apps/web/src/lib/split-router/tests/router.test.tsindex 8cc1351491..e259675c43 100644--- a/apps/web/src/lib/split-router/tests/router.test.ts+++ b/apps/web/src/lib/split-router/tests/router.test.ts@@ -304,29 +304,6 @@ describe('split router', () => {expect(routeIds(router.entry(pane(0)))).toEqual(['mail']);});- it('navigates on webviews without Promise.withResolvers', async () => {- const withResolvers = Promise.withResolvers;- Reflect.deleteProperty(Promise, 'withResolvers');- try {- const { router, pane } = track(setup('/home'));- let allow: (value: boolean) => void = () => {};- router.registerGuard(- pane(0),- PANE_ROUTE_LEVEL,- () =>- new Promise<boolean>((resolve) => {- allow = resolve;- })- );- const result = router.navigatePane(pane(0), '/mail');- allow(true);- await expect(result).resolves.toMatchObject({ status: 'committed' });- expect(routeIds(router.entry(pane(0)))).toEqual(['mail']);- } finally {- Object.assign(Promise, { withResolvers });- }- });-it('a newer navigation in the same pane supersedes a pending one', async () => {const { router, pane } = track(setup('/home', {diff --git a/apps/web/tauri/desktop-cef/AGENTS.md b/apps/web/tauri/desktop-cef/AGENTS.mdindex 1b02a7f59d..5b6415e11c 100644--- a/apps/web/tauri/desktop-cef/AGENTS.md+++ b/apps/web/tauri/desktop-cef/AGENTS.md@@ -67,6 +67,8 @@ thin binary over `../src-tauri` (`app_lib::run_with`) that selectsentitlements under the hardened runtime. Calls and dictation need its cameraand audio-input entitlements, plus the usage descriptions in`../src-tauri/icons/macos/Info.plist`; without either, macOS refuses capture.+ The ast-grep rules `plist-media-entitlements` and `plist-media-usage-strings`+ check both.- Keep the HTTP/WebSocket fork revision and Nix source hash aligned with theshared native workspace; native cookies use Application Support as documentedin `../src-tauri/README.md#native-authentication-cookies`.diff --git a/docs/development/style-guide.md b/docs/development/style-guide.mdindex 29e5717b17..131bccb5f6 100644--- a/docs/development/style-guide.md+++ b/docs/development/style-guide.md@@ -4,8 +4,7 @@ Code conventions are agent rules in [`.agents/rules/`](../../.agents/rules/). Agload each file when they touch matching paths; reviewers and CodeRabbit read thesame files. This page explains the scheme and indexes the rule files.-**Check locally.** `just check` is the single gate: format, lint, code rules, the-web browser floor ([`tooling/platform-compat`](../../tooling/platform-compat/AGENTS.md)),+**Check locally.** `just check` is the single gate: format, lint, code rules,and a PII scan of added lines, scoped to your changes against `origin/main`, withevery finding printed as `file:line [rule-id]` and the command that fixes it.`just check full` adds `tsc`@@ -25,6 +24,7 @@ ID; deletions leave gaps and new rules take the next free number. A rule line re| [`config-and-service-urls.md`](../../.agents/rules/config-and-service-urls.md) | CS 14–18 | Everywhere || [`CODING.md`](../../CODING.md) | CS 24, 26, 28, 29, 32–35, 71 | Everywhere; read before writing code || [`observability.md`](../../.agents/rules/observability.md) | | Everywhere |+| [`checks.md`](../../.agents/rules/checks.md) | | Adding a lint, code rule or CI check: `tooling/`, `rules/ast-grep/`, linter configs, workflows || [`rust/guardrails.md`](../../.agents/rules/rust/guardrails.md) | | Backend: tests, migrations, crate boundaries || [`rust/db.md`](../../.agents/rules/rust/db.md) | CS | Migrations, SQL, DB clients, outbound adapters || [`rust/architecture.md`](../../.agents/rules/rust/architecture.md) | CS | Rust |diff --git a/packages/collaboration/src/sync-service/source.test.ts b/packages/collaboration/src/sync-service/source.test.tsindex 0308182468..704ecb7775 100644--- a/packages/collaboration/src/sync-service/source.test.ts+++ b/packages/collaboration/src/sync-service/source.test.ts@@ -370,21 +370,6 @@ describe('SyncServiceSource', () => {expect((await pending)._unsafeUnwrap()).toEqual(bytes);});- it('waits for replies on webviews without Promise.withResolvers', async () => {- const withResolvers = Promise.withResolvers;- Reflect.deleteProperty(Promise, 'withResolvers');- try {- const ws = new FakeSocket();- const src = new SyncServiceSource(ws, 'doc1');- const pending = src.requestSnapshot();- const bytes = new Uint8Array([7]);- ws.deliver(remote.snapshot(bytes));- expect((await pending)._unsafeUnwrap()).toEqual(bytes);- } finally {- Object.assign(Promise, { withResolvers });- }- });-it('re-syncs and emits reconnect after a Reconnect event', async () => {const ws = new FakeSocket();const src = new SyncServiceSource(ws, 'doc1');diff --git a/rules/ast-grep/plist-media-entitlements.yml b/rules/ast-grep/plist-media-entitlements.ymlnew file mode 100644index 0000000000..6f60ade568--- /dev/null+++ b/rules/ast-grep/plist-media-entitlements.yml@@ -0,0 +1,17 @@+id: plist-media-entitlements+language: html+# .plist files parse as HTML through sgconfig.yml `languageGlobs`.+severity: error+message: The macOS entitlements need com.apple.security.device.camera and com.apple.security.device.audio-input set to true.+note: |-+ A hardened-runtime macOS app can't capture camera or microphone without these+ entitlements. This is the `entitlements` file in+ apps/web/tauri/desktop-cef/tauri.conf.json; update `files` here if that moves.+files:+ - apps/web/tauri/desktop-cef/entitlements.plist+rule:+ kind: document+ not:+ all:+ - regex: <key>com\.apple\.security\.device\.camera</key>\s*<true\s*/>+ - regex: <key>com\.apple\.security\.device\.audio-input</key>\s*<true\s*/>diff --git a/rules/ast-grep/plist-media-usage-strings.yml b/rules/ast-grep/plist-media-usage-strings.ymlnew file mode 100644index 0000000000..d72ade7b9e--- /dev/null+++ b/rules/ast-grep/plist-media-usage-strings.yml@@ -0,0 +1,19 @@+id: plist-media-usage-strings+language: html+# .plist files parse as HTML through sgconfig.yml `languageGlobs`.+severity: error+message: This Info.plist needs a non-empty NSCameraUsageDescription and NSMicrophoneUsageDescription.+note: |-+ macOS and iOS refuse camera and microphone access to an app without these+ usage strings, so the webview never exposes `navigator.mediaDevices` and+ meetings and dictation can't capture. The macOS file is the `infoPlist` in+ apps/web/tauri/desktop-cef/tauri.conf.json; update `files` here if that moves.+files:+ - apps/web/tauri/src-tauri/Info.ios.plist+ - apps/web/tauri/src-tauri/icons/macos/Info.plist+rule:+ kind: document+ not:+ all:+ - regex: <key>NSCameraUsageDescription</key>\s*<string>\s*[^<\s][^<]*</string>+ - regex: <key>NSMicrophoneUsageDescription</key>\s*<string>\s*[^<\s][^<]*</string>diff --git a/rules/ast-grep/ts-browser-floor-apis.yml b/rules/ast-grep/ts-browser-floor-apis.ymlnew file mode 100644index 0000000000..2918c027c8--- /dev/null+++ b/rules/ast-grep/ts-browser-floor-apis.yml@@ -0,0 +1,69 @@+id: ts-browser-floor-apis+language: typescript+# Twin of tsx-browser-floor-apis — ast-grep rules are single-language, and+# `tsx` only scans .tsx files.+severity: error+message: This API is newer than the browsers in apps/web/package.json `browserslist` (Safari/iOS 16.4, Chrome 111, Firefox 128). Guard it with `typeof` or a `??` fallback, or use a helper such as `anyAbortSignal` from `@core/util/abort-signal`.+note: |-+ The iOS app's WebKit follows the device's iOS version, and esbuild lowers+ syntax to the floor but never adds missing APIs. Below Safari 17.4,+ `AbortSignal.any` threw before every list request, so mail and Home never+ loaded. Each API below is missing from at least one browser in the floor,+ according to MDN browser-compat-data (checked November 2026). Allowed: a+ `typeof X.y` check, and `X.y ?? fallback`. Replace `Promise.withResolvers`+ with `new Promise`. Add an API when one turns out to be newer than the floor,+ and update this list when the floor moves.+files:+ - apps/web/src/**+ - packages/collaboration/src/**+ - packages/email-renderer/src/**+ - packages/graphics/src/**+ - packages/lexical-core/**+ - packages/loro-mirror/src/**+ - packages/machine/src/**+ - packages/observability/src/**+ - packages/spreadsheet/src/**+ignores:+ # Tests and browser harnesses run in Node or current Chromium, not the+ # supported webviews.+ - '**/*.test.ts'+ - '**/*.spec.ts'+ - '**/*.e2e.ts'+ - '**/*.d.ts'+ - '**/__tests__/**'+ - '**/browser-test/**'+ - '**/fuzz/**'+ - '**/tests/**'+ - '**/test-utils/**'+ - '**/scripts/**'+ - '**/testing.ts'+rule:+ any:+ - pattern: AbortSignal.any+ - pattern: Array.fromAsync+ - pattern: Atomics.waitAsync+ - pattern: Error.isError+ - pattern: Intl.DurationFormat+ - pattern: Iterator.from+ - pattern: Map.groupBy+ - pattern: Math.sumPrecise+ - pattern: Object.groupBy+ - pattern: Promise.try+ - pattern: Promise.withResolvers+ - pattern: RegExp.escape+ - pattern: Response.json+ - pattern: URL.canParse+ - pattern: URL.parse+ - pattern: Uint8Array.fromBase64+ - pattern: Uint8Array.fromHex+ not:+ any:+ - inside:+ pattern: typeof $API+ # `X.y ?? fallback`: only when the API is the left operand.+ - inside:+ kind: binary_expression+ field: left+ has:+ field: operator+ regex: ^\?\?$diff --git a/rules/ast-grep/tsx-browser-floor-apis.yml b/rules/ast-grep/tsx-browser-floor-apis.ymlnew file mode 100644index 0000000000..17d4990c42--- /dev/null+++ b/rules/ast-grep/tsx-browser-floor-apis.yml@@ -0,0 +1,67 @@+id: tsx-browser-floor-apis+language: tsx+# Twin of ts-browser-floor-apis — ast-grep rules are single-language, and+# `tsx` only scans .tsx files.+severity: error+message: This API is newer than the browsers in apps/web/package.json `browserslist` (Safari/iOS 16.4, Chrome 111, Firefox 128). Guard it with `typeof` or a `??` fallback, or use a helper such as `anyAbortSignal` from `@core/util/abort-signal`.+note: |-+ The iOS app's WebKit follows the device's iOS version, and esbuild lowers+ syntax to the floor but never adds missing APIs. Below Safari 17.4,+ `AbortSignal.any` threw before every list request, so mail and Home never+ loaded. Each API below is missing from at least one browser in the floor,+ according to MDN browser-compat-data (checked November 2026). Allowed: a+ `typeof X.y` check, and `X.y ?? fallback`. Replace `Promise.withResolvers`+ with `new Promise`. Add an API when one turns out to be newer than the floor,+ and update this list when the floor moves.+files:+ - apps/web/src/**+ - packages/collaboration/src/**+ - packages/email-renderer/src/**+ - packages/graphics/src/**+ - packages/lexical-core/**+ - packages/loro-mirror/src/**+ - packages/machine/src/**+ - packages/observability/src/**+ - packages/spreadsheet/src/**+ignores:+ # Tests and browser harnesses run in Node or current Chromium, not the+ # supported webviews.+ - '**/*.test.tsx'+ - '**/*.spec.tsx'+ - '**/*.e2e.tsx'+ - '**/__tests__/**'+ - '**/browser-test/**'+ - '**/fuzz/**'+ - '**/tests/**'+ - '**/test-utils/**'+ - '**/scripts/**'+rule:+ any:+ - pattern: AbortSignal.any+ - pattern: Array.fromAsync+ - pattern: Atomics.waitAsync+ - pattern: Error.isError+ - pattern: Intl.DurationFormat+ - pattern: Iterator.from+ - pattern: Map.groupBy+ - pattern: Math.sumPrecise+ - pattern: Object.groupBy+ - pattern: Promise.try+ - pattern: Promise.withResolvers+ - pattern: RegExp.escape+ - pattern: Response.json+ - pattern: URL.canParse+ - pattern: URL.parse+ - pattern: Uint8Array.fromBase64+ - pattern: Uint8Array.fromHex+ not:+ any:+ - inside:+ pattern: typeof $API+ # `X.y ?? fallback`: only when the API is the left operand.+ - inside:+ kind: binary_expression+ field: left+ has:+ field: operator+ regex: ^\?\?$diff --git a/sgconfig.yml b/sgconfig.ymlindex a210a9750a..cbc31f686d 100644--- a/sgconfig.yml+++ b/sgconfig.yml@@ -11,3 +11,7 @@# violations are burned down.ruleDirs:- rules/ast-grep+# Native permission rules read Apple property lists, which parse as HTML.+languageGlobs:+ html:+ - '*.plist'diff --git a/tooling/just/check.just b/tooling/just/check.justindex bafa89c4c3..8d6603744a 100644--- a/tooling/just/check.just+++ b/tooling/just/check.just@@ -7,7 +7,6 @@# typescript/no-floating-promises, so apps/web files are linted --type-aware.## just check fast: rustfmt + biome + oxlint + ast-grep + PII (~seconds)-# + browser floor and native permissions (tooling/platform-compat)# just check full also runs tsc + clippy (~minutes)## Override the diff base with CHECK_BASE=<ref> (useful in shallow clones,@@ -31,8 +30,8 @@ check *ARGS:rs=$(grep -E '^(crates|services|tooling)/.*\.rs$' <<<"$changed" || true)# Match the SDK and collaboration Biome configs: preserve generator output verbatim.- js=$(grep -E '^(apps/(web|marketing)|packages|services/(analytics-proxy|ai-editing-worker|lexical-service|websocket-service)|tooling/platform-compat)/.*\.(ts|tsx)$' <<<"$changed" | grep -Ev '^packages/(sdk/generated|collaboration/src/sync-service/generated)/' || true)- sg=$(grep -E '^(apps|crates|packages|services|tooling)/.*\.(rs|ts|tsx)$' <<<"$changed" || true)+ js=$(grep -E '^(apps/(web|marketing)|packages|services/(analytics-proxy|ai-editing-worker|lexical-service|websocket-service))/.*\.(ts|tsx)$' <<<"$changed" | grep -Ev '^packages/(sdk/generated|collaboration/src/sync-service/generated)/' || true)+ sg=$(grep -E '^(apps|crates|packages|services|tooling)/.*\.(rs|ts|tsx|plist)$' <<<"$changed" || true)fail=0if [ -n "$rs" ]; then@@ -101,25 +100,6 @@ check *ARGS:echo "── ast-grep code rules (rule ids map to docs/development/style-guide.md)"bunx --yes @ast-grep/[email protected] scan --report-style=short $sg || fail=1fi- # A changed floor or rule rechecks all of the web sources (~40 s).- # lint-web.ts skips files outside its configured web sources.- web_src=$(grep -E '^(apps/web/src|packages)/.*\.(ts|tsx)$' <<<"$changed" || true)- compat_changed=$(grep -E '^(apps/web/package\.json|tooling/platform-compat/)' <<<"$changed" || true)- native_changed=$(grep -E '^(apps/web/tauri/(src-tauri|desktop-cef)/(.*\.plist|tauri.*\.json)|tooling/platform-compat/)' <<<"$changed" || true)- if [ -n "$web_src$compat_changed$native_changed" ] && [ ! -d tooling/platform-compat/node_modules ]; then- (\cd tooling/platform-compat && bun install --frozen-lockfile) || fail=1- fi- if [ -n "$compat_changed" ]; then- echo "── browser floor (all web sources vs apps/web/package.json browserslist)"- (\cd tooling/platform-compat && ./node_modules/.bin/tsc -p . && bun test && bun src/lint-web.ts) || fail=1- elif [ -n "$web_src" ]; then- echo "── browser floor (changed web sources vs apps/web/package.json browserslist)"- bun tooling/platform-compat/src/lint-web.ts $web_src || fail=1- fi- if [ -n "$native_changed" ]; then- echo "── native media permissions (Info.plist usage strings, macOS entitlements)"- bun tooling/platform-compat/src/check-native-permissions.ts || fail=1- fiecho "── PII scan (added lines vs merge-base)"python3 tooling/pii/scan.py --changed --skip-gitleaks || fail=1if grep -q '^tooling/pii/' <<<"$changed"; thendiff --git a/tooling/platform-compat/AGENTS.md b/tooling/platform-compat/AGENTS.mddeleted file mode 100644index 2cd44147f8..0000000000--- a/tooling/platform-compat/AGENTS.md+++ /dev/null@@ -1,50 +0,0 @@-# platform-compat--## What it is--Guards that keep the web app running on the oldest webviews it supports: an-ESLint rule that checks `apps/web/src` against the `browserslist` in-`apps/web/package.json`, and a check that the native bundles keep the camera and-microphone permissions meetings and dictation need: the usage strings in the-macOS (`desktop-cef/tauri.conf.json`) and iOS Info.plists, and the macOS-entitlements.--## How it works--`src/browser-floor-rule.ts` finds references to globals (`SharedWorker`),-their statics (`AbortSignal.any`), members of singleton globals-(`navigator.permissions`), and regex syntax (lookbehind, the `v` flag). It looks-each up in `@mdn/browser-compat-data` and reports any the floor lacks, unless a-feature check guards the use. `src/lint-web.ts` runs it from the repository root.--## Start here--- `src/browser-floor-rule.ts`: what counts as a use and as a guard.-- `src/compat-data.ts`: how a reference maps to a compatibility-data key.--## Scope--- Owns: the browser-floor lint and the native media permission check.-- Not here: the floor itself (`apps/web/package.json` `browserslist`, which- `apps/web/vite.base.ts` also turns into the esbuild target); signed-DMG- validation (`tooling/xtask/crates/xtask_workflows/src/workflows/scripts/validate_signed_dmg.sh`).--## Checks--- `bun install --frozen-lockfile && bun run check` (types, tests, native- permissions, full `apps/web/src` lint; CI runs this in Web App Check).-- `just check` lints changed `apps/web/src` files, or everything when the floor- or this package changes.--## Gotchas--- This package has its own `bun.lock` and is not a root workspace, so it does- not change the Nix `node_modules` hash. Install it here, not from the root.-- Only `browser >= version` queries are allowed: the Vite config maps them- one-to-one to esbuild targets.-- Prototype methods (`array.toSorted()`) need type information and are not- checked. Neither is partial support such as Chrome for Android's throwing- `Notification` constructor, because the data marks common APIs like- `window.open` partial too.-- Silence a guarded use the rule cannot see with- `// eslint-disable-next-line platform-compat/browser-floor -- <why it is safe>`.diff --git a/tooling/platform-compat/CLAUDE.md b/tooling/platform-compat/CLAUDE.mddeleted file mode 120000index 47dc3e3d86..0000000000--- a/tooling/platform-compat/CLAUDE.md+++ /dev/null@@ -1 +0,0 @@-AGENTS.md\ No newline at end of filediff --git a/tooling/platform-compat/bun.lock b/tooling/platform-compat/bun.lockdeleted file mode 100644index a2fa0f5dd0..0000000000--- a/tooling/platform-compat/bun.lock+++ /dev/null@@ -1,226 +0,0 @@-{- "lockfileVersion": 1,- "configVersion": 1,- "workspaces": {- "": {- "name": "@macro/platform-compat",- "devDependencies": {- "@mdn/browser-compat-data": "8.1.6",- "@types/bun": "1.4.3",- "@typescript-eslint/parser": "8.71.2",- "browserslist": "4.29.3",- "eslint": "10.13.0",- "typescript": "6.0.3",- },- },- },- "packages": {- "@cacheable/memory": ["@cacheable/[email protected]", "", { "dependencies": { "@cacheable/utils": "^2.5.0", "@keyv/bigmap": "^1.3.1", "hookified": "^1.15.1", "keyv": "^5.6.0" } }, "sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ=="],-- "@cacheable/utils": ["@cacheable/[email protected]", "", { "dependencies": { "hashery": "^1.5.1", "keyv": "^5.6.0" } }, "sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA=="],-- "@eslint-community/eslint-utils": ["@eslint-community/[email protected]", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg=="],-- "@eslint-community/regexpp": ["@eslint-community/[email protected]", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="],-- "@eslint/config-array": ["@eslint/[email protected]", "", { "dependencies": { "@eslint/object-schema": "^3.0.5", "debug": "^4.3.1", "minimatch": "^10.2.4" } }, "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA=="],-- "@eslint/config-helpers": ["@eslint/[email protected]", "", { "dependencies": { "@eslint/core": "^1.2.1" } }, "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw=="],-- "@eslint/core": ["@eslint/[email protected]", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ=="],-- "@eslint/object-schema": ["@eslint/[email protected]", "", {}, "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw=="],-- "@eslint/plugin-kit": ["@eslint/[email protected]", "", { "dependencies": { "@eslint/core": "^1.2.1", "levn": "^0.4.1" } }, "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q=="],-- "@humanfs/core": ["@humanfs/[email protected]", "", { "dependencies": { "@humanfs/types": "^0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="],-- "@humanfs/node": ["@humanfs/[email protected]", "", { "dependencies": { "@humanfs/core": "^0.19.2", "@humanfs/types": "^0.15.0", "@humanwhocodes/retry": "^0.4.0" } }, "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ=="],-- "@humanfs/types": ["@humanfs/[email protected]", "", {}, "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q=="],-- "@humanwhocodes/module-importer": ["@humanwhocodes/[email protected]", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="],-- "@humanwhocodes/retry": ["@humanwhocodes/[email protected]", "", {}, "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ=="],-- "@keyv/bigmap": ["@keyv/[email protected]", "", { "dependencies": { "hashery": "^1.4.0", "hookified": "^1.15.0" }, "peerDependencies": { "keyv": "^5.6.0" } }, "sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ=="],-- "@keyv/serialize": ["@keyv/[email protected]", "", {}, "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA=="],-- "@mdn/browser-compat-data": ["@mdn/[email protected]", "", {}, "sha512-bTP5c58cBsgMOokwa/ECLcAxTkIwBe9csIts92Nq2wviediIJadh9iHI4Ezn2q6RiZhy7b54SNRn/tZpPKtTsA=="],-- "@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.4.3" } }, "sha512-N67Pqy8JXbAY/j0tNraS3V5mubGvc6rrrNDmDCtZLlFzccbUJPDb0tvgUBC5q4m8ybkP93Jcn1QB+RYQ6PvBhw=="],-- "@types/esrecurse": ["@types/[email protected]", "", {}, "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw=="],-- "@types/estree": ["@types/[email protected]", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="],-- "@types/json-schema": ["@types/[email protected]", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="],-- "@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg=="],-- "@typescript-eslint/parser": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.71.2", "@typescript-eslint/types": "8.71.2", "@typescript-eslint/typescript-estree": "8.71.2", "@typescript-eslint/visitor-keys": "8.71.2", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-aTtmZjp/x3gsGHkDs04/1I8kNogBJkpQaeGaN0PfiG43NzDEmW2n+OP5im9wfsvyX0yP1UZWBrAGtDBfH9jEVw=="],-- "@typescript-eslint/project-service": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.71.2", "@typescript-eslint/types": "^8.71.2", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-Pd68GsLVh5ZXlcEccFPdhSOvtHZ/2WU0XsA8zmXOS3F158lVlcTLhfQ6qvtL1RzbMie0Kp8xtbVwAg4nejKPHw=="],-- "@typescript-eslint/scope-manager": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/types": "8.71.2", "@typescript-eslint/visitor-keys": "8.71.2" } }, "sha512-YF4wgg5iUX5Obywoac27B56FhozMNFhdJSbh11H5GBAwmBtfyRhmgTQqW9tRNNmHDvsZ2CX6UGzoz+YfYn2Leg=="],-- "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/[email protected]", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-jz49TAWokm/7yWD9/o837nYax9DyALxIPOImdImvVzo6canBCZYzin8zJyqNR5k1j9K1DE0bVvr0XYB+99uAdg=="],-- "@typescript-eslint/types": ["@typescript-eslint/[email protected]", "", {}, "sha512-y5Ukl3oVp7e/VGxqIoEXoeb/Roj71PAJ4WG/N/RGj+eeDvKRLM15kGr9MijLbN0i03S52zxu31Z98E5gWChJKw=="],-- "@typescript-eslint/typescript-estree": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/project-service": "8.71.2", "@typescript-eslint/tsconfig-utils": "8.71.2", "@typescript-eslint/types": "8.71.2", "@typescript-eslint/visitor-keys": "8.71.2", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-DgNOEsl4pdYzwSL+N/Cl33tX1Hlw3FvId73LnKXfq7jnrF2viOEn7X+P7RBkkSWCVm92gnWd28GIC5vJuLREeA=="],-- "@typescript-eslint/visitor-keys": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/types": "8.71.2", "eslint-visitor-keys": "^5.0.0" } }, "sha512-zozlN0UA32bSG2zkKAgQyRYSbEISVoyU6vvkKYo2aSny74D8Jh4e+POkJ6Lk0dlezZi5x7TtD+88Xb06IB8nhg=="],-- "acorn": ["[email protected]", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw=="],-- "acorn-jsx": ["[email protected]", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],-- "ajv": ["[email protected]", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw=="],-- "balanced-match": ["[email protected]", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],-- "baseline-browser-mapping": ["[email protected]", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-YeesxhUmR4h5y5V8KF8iBCqJb8YFrBJ++XBTeGcWIaQOYXGN19JM0FoiOjAhwuDoln8owMgXcWBmgHtYSkky2w=="],-- "brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ=="],-- "browserslist": ["[email protected]", "", { "dependencies": { "baseline-browser-mapping": "^2.11.26", "caniuse-lite": "^1.0.30001813", "electron-to-chromium": "^1.5.439", "node-releases": "^2.0.57", "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA=="],-- "bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*", "undici-types": "*" } }, "sha512-tinRJNGOmUN+tEAsn2y2e942n9JHRHR42iUYzDH75NmhJqVBokGSQkkfSFdNWwsANIdrK6ACH9t01M452YyTwg=="],-- "cacheable": ["[email protected]", "", { "dependencies": { "@cacheable/memory": "^2.2.0", "@cacheable/utils": "^2.5.0", "hookified": "^1.15.0", "keyv": "^5.6.0", "qified": "^0.10.1" } }, "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g=="],-- "caniuse-lite": ["[email protected]", "", {}, "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw=="],-- "cross-spawn": ["[email protected]", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],-- "debug": ["[email protected]", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],-- "deep-is": ["[email protected]", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="],-- "electron-to-chromium": ["[email protected]", "", {}, "sha512-/hIH2gRSmxrf4/X4Nw/t/Wc8PVS22l8/3HnWjWTWsTOM5dsnMUPZF/+u+yr3LqweNuTBJE1rq6qAQzKkZVwMfA=="],-- "escalade": ["[email protected]", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],-- "escape-string-regexp": ["[email protected]", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="],-- "eslint": ["[email protected]", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", "@eslint/config-array": "^0.23.5", "@eslint/config-helpers": "^0.7.0", "@eslint/core": "^1.2.1", "@eslint/plugin-kit": "^0.7.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.14.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^9.1.2", "eslint-visitor-keys": "^5.0.1", "espree": "^11.2.0", "esquery": "^1.7.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "11.1.5 || >11.1.6 <12", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "minimatch": "^10.2.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-UohDjD4zSzEwhf58M3O7vc/ycc8O1I7dNlhtD0WxE8Px8EHNJKtUwzBqrzeGhisRuv2ag4sAYswszCJRgKXYUg=="],-- "eslint-scope": ["[email protected]", "", { "dependencies": { "@types/esrecurse": "^4.3.1", "@types/estree": "^1.0.8", "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ=="],-- "eslint-visitor-keys": ["[email protected]", "", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="],-- "espree": ["[email protected]", "", { "dependencies": { "acorn": "^8.16.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^5.0.1" } }, "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw=="],-- "esquery": ["[email protected]", "", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g=="],-- "esrecurse": ["[email protected]", "", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="],-- "estraverse": ["[email protected]", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="],-- "esutils": ["[email protected]", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="],-- "fast-deep-equal": ["[email protected]", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],-- "fast-json-stable-stringify": ["[email protected]", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="],-- "fast-levenshtein": ["[email protected]", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="],-- "fdir": ["[email protected]", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],-- "file-entry-cache": ["[email protected]", "", { "dependencies": { "flat-cache": "^6.1.23" } }, "sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q=="],-- "find-up": ["[email protected]", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="],-- "flat-cache": ["[email protected]", "", { "dependencies": { "cacheable": "^2.5.0", "flatted": "^3.4.2", "hookified": "^1.15.0" } }, "sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA=="],-- "flatted": ["[email protected]", "", {}, "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q=="],-- "glob-parent": ["[email protected]", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="],-- "hashery": ["[email protected]", "", { "dependencies": { "hookified": "^1.15.0" } }, "sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ=="],-- "hookified": ["[email protected]", "", {}, "sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg=="],-- "ignore": ["[email protected]", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],-- "imurmurhash": ["[email protected]", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],-- "is-extglob": ["[email protected]", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="],-- "is-glob": ["[email protected]", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="],-- "isexe": ["[email protected]", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],-- "json-schema-traverse": ["[email protected]", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="],-- "json-stable-stringify-without-jsonify": ["[email protected]", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="],-- "keyv": ["[email protected]", "", { "dependencies": { "@keyv/serialize": "^1.1.1" } }, "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw=="],-- "levn": ["[email protected]", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="],-- "locate-path": ["[email protected]", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],-- "minimatch": ["[email protected]", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="],-- "ms": ["[email protected]", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],-- "natural-compare": ["[email protected]", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="],-- "node-releases": ["[email protected]", "", {}, "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA=="],-- "optionator": ["[email protected]", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="],-- "p-limit": ["[email protected]", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],-- "p-locate": ["[email protected]", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="],-- "path-exists": ["[email protected]", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],-- "path-key": ["[email protected]", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],-- "picocolors": ["[email protected]", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],-- "picomatch": ["[email protected]", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="],-- "prelude-ls": ["[email protected]", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="],-- "punycode": ["[email protected]", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],-- "qified": ["[email protected]", "", { "dependencies": { "hookified": "^2.1.1" } }, "sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA=="],-- "semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="],-- "shebang-command": ["[email protected]", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],-- "shebang-regex": ["[email protected]", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],-- "tinyglobby": ["[email protected]", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="],-- "ts-api-utils": ["[email protected]", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA=="],-- "type-check": ["[email protected]", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="],-- "typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="],-- "undici-types": ["[email protected]", "", {}, "sha512-VoMeD2O0KdHhcn+oPqOrpivN+7aDOklVSwOLD7JNjbzV1CboAFek9IFOXnreoufTUtAsCsOK0iETiERPNR/fDA=="],-- "update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A=="],-- "uri-js": ["[email protected]", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="],-- "which": ["[email protected]", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],-- "word-wrap": ["[email protected]", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="],-- "yocto-queue": ["[email protected]", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],-- "@eslint-community/eslint-utils/eslint-visitor-keys": ["[email protected]", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],-- "@types/node/undici-types": ["[email protected]", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="],-- "qified/hookified": ["[email protected]", "", {}, "sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA=="],- }-}diff --git a/tooling/platform-compat/eslint.config.ts b/tooling/platform-compat/eslint.config.tsdeleted file mode 100644index 711976d2ab..0000000000--- a/tooling/platform-compat/eslint.config.ts+++ /dev/null@@ -1,36 +0,0 @@-import typescriptParser from '@typescript-eslint/parser';-import type { Linter } from 'eslint';-import { browserFloorRule } from './src/browser-floor-rule';-import { WEB_SOURCES } from './src/web-sources';--// Paths are relative to the repository root, where src/lint-web.ts runs ESLint.-const config: Linter.Config[] = [- {- files: WEB_SOURCES.map((source) => `${source}/**/*.{ts,tsx}`),- ignores: [- // Tests and browser harnesses run in Node or current Chromium, not the- // supported webviews.- '**/*.test.{ts,tsx}',- '**/*.spec.{ts,tsx}',- '**/*.e2e.{ts,tsx}',- '**/*.d.ts',- '**/__tests__/**',- '**/browser-test/**',- '**/fuzz/**',- '**/tests/**',- '**/test-utils/**',- '**/scripts/**',- '**/testing.ts',- ],- languageOptions: {- parser: typescriptParser,- parserOptions: { ecmaFeatures: { jsx: true } },- },- plugins: {- 'platform-compat': { rules: { 'browser-floor': browserFloorRule } },- },- rules: { 'platform-compat/browser-floor': 'error' },- },-];--export default config;diff --git a/tooling/platform-compat/package.json b/tooling/platform-compat/package.jsondeleted file mode 100644index e46085d486..0000000000--- a/tooling/platform-compat/package.json+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "@macro/platform-compat",- "private": true,- "type": "module",- "scripts": {- "lint-web": "bun src/lint-web.ts",- "check-native-permissions": "bun src/check-native-permissions.ts",- "test": "bun test",- "check": "tsc -p . && bun test && bun src/check-native-permissions.ts && bun src/lint-web.ts"- },- "devDependencies": {- "@mdn/browser-compat-data": "8.1.6",- "@types/bun": "1.4.3",- "@typescript-eslint/parser": "8.71.2",- "browserslist": "4.29.3",- "eslint": "10.13.0",- "typescript": "6.0.3"- }-}diff --git a/tooling/platform-compat/src/browser-floor-rule.ts b/tooling/platform-compat/src/browser-floor-rule.tsdeleted file mode 100644index 25845d0359..0000000000--- a/tooling/platform-compat/src/browser-floor-rule.ts+++ /dev/null@@ -1,260 +0,0 @@-import bcd from '@mdn/browser-compat-data' with { type: 'json' };-import type { Rule, Scope, SourceCode } from 'eslint';-import type * as ESTree from 'estree';-import { parseBrowserFloor, WEB_BROWSER_FLOOR } from './browser-floor';-import {- constructorFeature,- type Feature,- globalFeature,- memberFeature,- missingSupport,- regexFeatures,-} from './compat-data';--const GLOBAL_OBJECTS = new Set(['window', 'globalThis', 'self']);--function isTypeOnly(reference: object): boolean {- return (- 'isValueReference' in reference && reference.isValueReference === false- );-}--function exits(statement: ESTree.Statement): boolean {- switch (statement.type) {- case 'ReturnStatement':- case 'ThrowStatement':- case 'BreakStatement':- case 'ContinueStatement':- return true;- case 'BlockStatement': {- const last = statement.body.at(-1);- return last !== undefined && exits(last);- }- default:- return false;- }-}--function precedingStatements(- parent: ESTree.Node,- child: ESTree.Node-): readonly ESTree.Node[] {- const body =- parent.type === 'BlockStatement' ||- parent.type === 'Program' ||- parent.type === 'StaticBlock'- ? parent.body- : parent.type === 'SwitchCase'- ? parent.consequent- : [];- const index = body.findIndex((statement) => statement === child);- return index < 0 ? [] : body.slice(0, index);-}--/**- * Whether the use sits behind a feature check: an optional call or access,- * `typeof`, an existence check in a condition, a branch whose condition names- * the feature, or an earlier early-exit check. Calling the feature inside a- * condition is not a check, and neither is a `try` block: its `catch` usually- * reports a failure instead of falling back.- */-function isGuarded(- chain: readonly ESTree.Node[],- featureName: string,- sourceCode: SourceCode-): boolean {- const node = chain.at(-1);- const parent = chain.at(-2);- if (- node?.type === 'MemberExpression' &&- ((parent?.type === 'MemberExpression' &&- parent.object === node &&- parent.optional) ||- (parent?.type === 'CallExpression' &&- parent.callee === node &&- parent.optional))- ) {- return true;- }- // An existence check reads the feature without calling, constructing or- // dereferencing it.- const checksExistence =- !(- (parent?.type === 'CallExpression' || parent?.type === 'NewExpression') &&- parent.callee === node- ) && !(parent?.type === 'MemberExpression' && parent.object === node);- const namePattern = new RegExp(- `\\b${featureName.replace(/[$]/g, '\\$&')}\\b`- );- const mentions = (test: ESTree.Node) =>- namePattern.test(sourceCode.getText(test));- for (let index = chain.length - 1; index > 0; index--) {- const child = chain[index];- const ancestor = chain[index - 1];- switch (ancestor.type) {- case 'UnaryExpression':- if (ancestor.operator === 'typeof') return true;- break;- case 'IfStatement':- case 'ConditionalExpression':- if (child === ancestor.test ? checksExistence : mentions(ancestor.test))- return true;- break;- case 'LogicalExpression':- if (child === ancestor.left ? checksExistence : mentions(ancestor.left))- return true;- break;- default:- for (const statement of precedingStatements(ancestor, child)) {- if (- statement.type === 'IfStatement' &&- exits(statement.consequent) &&- mentions(statement.test)- ) {- return true;- }- }- }- }- return false;-}--function stringArgument(node: ESTree.Node | undefined): string | undefined {- return node?.type === 'Literal' && typeof node.value === 'string'- ? node.value- : undefined;-}--export const browserFloorRule: Rule.RuleModule = {- meta: {- type: 'problem',- docs: {- description:- 'Disallow web platform features that the browsers in apps/web/package.json `browserslist` lack, unless feature-detected',- },- schema: [- {- type: 'object',- properties: {- browserslist: { type: 'array', items: { type: 'string' } },- },- additionalProperties: false,- },- ],- messages: {- unsupported:- '{{feature}} is missing in {{browser}} {{floor}} ({{added}}), which apps/web/package.json `browserslist` supports. Feature-detect it, add a fallback, or raise the floor.',- },- },- create(context) {- const options: { browserslist?: string[] } | undefined = context.options[0];- const floor = options?.browserslist- ? parseBrowserFloor(options.browserslist)- : WEB_BROWSER_FLOOR;- const sourceCode = context.sourceCode;-- function report(- found: Feature | undefined,- node: ESTree.Node,- label: string,- chain: readonly ESTree.Node[],- featureName: string- ) {- if (!found) return;- const missing = missingSupport(found.compat, floor);- if (!missing || isGuarded(chain, featureName, sourceCode)) return;- context.report({- node,- messageId: 'unsupported',- data: {- feature: label,- browser: bcd.browsers[missing.browser].name,- floor: missing.floorVersion,- added: missing.addedVersion- ? `added in ${missing.addedVersion}`- : 'never released there',- },- });- }-- function checkGlobalReference(reference: Scope.Reference) {- const identifier = reference.identifier;- if (identifier.type !== 'Identifier' || isTypeOnly(reference)) return;- const ancestors = sourceCode.getAncestors(identifier);- const parent = ancestors.at(-1);- const name = identifier.name;-- if (- parent?.type === 'MemberExpression' &&- parent.object === identifier &&- !parent.computed &&- parent.property.type === 'Identifier'- ) {- const property = parent.property.name;- const label = GLOBAL_OBJECTS.has(name)- ? property- : `${name}.${property}`;- report(- memberFeature(name, property),- parent,- label,- ancestors,- property- );- }- if (GLOBAL_OBJECTS.has(name)) return;-- const chain = [...ancestors, identifier];- const invoked =- (parent?.type === 'NewExpression' ||- parent?.type === 'CallExpression') &&- parent.callee === identifier- ? parent- : undefined;- if (invoked?.type === 'NewExpression') {- report(- constructorFeature(name),- identifier,- `new ${name}()`,- chain,- name- );- } else {- report(globalFeature(name), identifier, name, chain, name);- }-- const pattern =- name === 'RegExp' ? stringArgument(invoked?.arguments[0]) : undefined;- if (invoked && pattern !== undefined) {- for (const found of regexFeatures(- pattern,- stringArgument(invoked.arguments[1]) ?? ''- )) {- report(found, invoked, found.key, ancestors, name);- }- }- }-- return {- Literal(node) {- if (!('regex' in node) || !node.regex) return;- for (const found of regexFeatures(- node.regex.pattern,- node.regex.flags- )) {- report(found, node, found.key, [], found.key);- }- },- 'Program:exit'(program) {- const globalScope = sourceCode.getScope(program);- for (const reference of globalScope.through)- checkGlobalReference(reference);- for (const variable of globalScope.variables) {- if (variable.defs.length > 0) continue;- for (const reference of variable.references)- checkGlobalReference(reference);- }- },- };- },-};diff --git a/tooling/platform-compat/src/browser-floor.ts b/tooling/platform-compat/src/browser-floor.tsdeleted file mode 100644index d6277e87af..0000000000--- a/tooling/platform-compat/src/browser-floor.ts+++ /dev/null@@ -1,45 +0,0 @@-import type { BrowserName } from '@mdn/browser-compat-data';-import webPackage from '../../../apps/web/package.json' with { type: 'json' };--/** Compatibility-data ids for the browserslist names the web app may target. */-const COMPAT_BROWSERS: Readonly<Record<string, BrowserName>> = {- safari: 'safari',- ios_saf: 'safari_ios',- chrome: 'chrome',- and_chr: 'chrome_android',- edge: 'edge',- firefox: 'firefox',-};--/** The oldest version of each browser the code must run on. */-export type BrowserFloor = ReadonlyMap<BrowserName, string>;--export function compareVersions(left: string, right: string): number {- const leftParts = left.split('.').map(Number);- const rightParts = right.split('.').map(Number);- for (- let index = 0;- index < Math.max(leftParts.length, rightParts.length);- index++- ) {- const difference = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);- if (difference !== 0) return difference;- }- return 0;-}--/** Parses `browser >= version` queries, the only form apps/web/vite.base.ts can map to esbuild targets. */-export function parseBrowserFloor(queries: readonly string[]): BrowserFloor {- const floor = new Map<BrowserName, string>();- for (const query of queries) {- const match = /^(\w+) >= (\d+(?:\.\d+)?)$/.exec(query);- const browser = match ? COMPAT_BROWSERS[match[1]] : undefined;- if (!match || !browser) {- throw new Error(`Unsupported browserslist query: ${query}`);- }- floor.set(browser, match[2]);- }- return floor;-}--export const WEB_BROWSER_FLOOR = parseBrowserFloor(webPackage.browserslist);diff --git a/tooling/platform-compat/src/check-native-permissions.ts b/tooling/platform-compat/src/check-native-permissions.tsdeleted file mode 100644index fafce645a2..0000000000--- a/tooling/platform-compat/src/check-native-permissions.ts+++ /dev/null@@ -1,53 +0,0 @@-// Fails when a native bundle lacks what meetings and dictation need for camera-// and microphone access.-import { readFileSync } from 'node:fs';-import { relative, resolve } from 'node:path';-import {- MEDIA_ENTITLEMENTS,- MEDIA_USAGE_KEYS,- missingStrings,- missingTrue,-} from './native-permissions';--const repoRoot = resolve(import.meta.dir, '../../..');-const tauriDir = resolve(repoRoot, 'apps/web/tauri');-// The macOS release bundles from the Chromium (CEF) config; iOS from src-tauri.-const macosDir = resolve(tauriDir, 'desktop-cef');-const iosPlist = resolve(tauriDir, 'src-tauri/Info.ios.plist');-const read = (path: string) => readFileSync(path, 'utf8');-const show = (path: string) => relative(repoRoot, path);--const macosConfigPath = resolve(macosDir, 'tauri.conf.json');-const macosConfig: {- bundle?: { macOS?: { infoPlist?: string; entitlements?: string } };-} = JSON.parse(read(macosConfigPath));-const macos = macosConfig.bundle?.macOS;-const problems: string[] = [];--if (!macos?.infoPlist || !macos.entitlements) {- problems.push(- `${show(macosConfigPath)} must set bundle.macOS.infoPlist and bundle.macOS.entitlements`- );-}-const plists = [- macos?.infoPlist ? resolve(macosDir, macos.infoPlist) : undefined,- iosPlist,-];-for (const plist of plists) {- if (!plist) continue;- for (const key of missingStrings(read(plist), MEDIA_USAGE_KEYS)) {- problems.push(`${show(plist)} needs a non-empty ${key}`);- }-}-if (macos?.entitlements) {- const entitlements = resolve(macosDir, macos.entitlements);- for (const key of missingTrue(read(entitlements), MEDIA_ENTITLEMENTS)) {- problems.push(`${show(entitlements)} needs ${key} set to true`);- }-}--if (problems.length > 0) {- console.error('Native media permissions are incomplete:');- for (const problem of problems) console.error(` ${problem}`);- process.exit(1);-}diff --git a/tooling/platform-compat/src/compat-data.ts b/tooling/platform-compat/src/compat-data.tsdeleted file mode 100644index ca3fdde1a9..0000000000--- a/tooling/platform-compat/src/compat-data.ts+++ /dev/null@@ -1,155 +0,0 @@-import bcd from '@mdn/browser-compat-data' with { type: 'json' };-import type {- BrowserName,- CompatStatement,- Identifier,- SimpleSupportStatement,-} from '@mdn/browser-compat-data';-import { type BrowserFloor, compareVersions } from './browser-floor';--export type Feature = { key: string; compat: CompatStatement };--export type MissingSupport = {- browser: BrowserName;- floorVersion: string;- addedVersion: string | undefined;-};--function child(- identifier: Identifier | undefined,- name: string-): Identifier | undefined {- if (!identifier || name === '__compat' || !Object.hasOwn(identifier, name))- return undefined;- return identifier[name];-}--function feature(- root: 'api' | 'javascript',- path: readonly string[]-): Feature | undefined {- let identifier: Identifier | undefined = bcd[root];- for (const name of path) identifier = child(identifier, name);- const compat = identifier?.__compat;- return compat ? { key: [root, ...path].join('.'), compat } : undefined;-}--/** A global such as `SharedWorker`, `structuredClone` or `WeakRef`. */-export function globalFeature(name: string): Feature | undefined {- return (- feature('api', [name]) ??- feature('api', ['Window', name]) ??- feature('javascript', ['builtins', name])- );-}--/** `new Name()`, whose constructor can lag behind the interface. */-export function constructorFeature(name: string): Feature | undefined {- return feature('api', [name, name]) ?? globalFeature(name);-}--const GLOBAL_OBJECTS = new Set(['window', 'globalThis', 'self']);--/** Globals that are instances of an interface, keyed to that interface. */-const GLOBAL_INSTANCES: Readonly<Record<string, string>> = {- navigator: 'Navigator',- document: 'Document',- crypto: 'Crypto',- performance: 'Performance',- screen: 'Screen',- location: 'Location',- history: 'History',- localStorage: 'Storage',- sessionStorage: 'Storage',- indexedDB: 'IDBFactory',- visualViewport: 'VisualViewport',-};--function isStaticBuiltin(object: string, property: string): boolean {- const value: unknown = Reflect.get(globalThis, object);- return (- (typeof value === 'function' || typeof value === 'object') &&- value !== null &&- property in value- );-}--/** `object.property` where `object` is a global. */-export function memberFeature(- object: string,- property: string-): Feature | undefined {- if (GLOBAL_OBJECTS.has(object)) return globalFeature(property);- const instanceOf = GLOBAL_INSTANCES[object];- if (instanceOf) return feature('api', [instanceOf, property]);- if (property === 'prototype') return undefined;- // Compatibility data lists builtin statics next to prototype methods, so- // only a property this runtime has on the constructor is a static.- return (- feature('api', [object, `${property}_static`]) ??- (isStaticBuiltin(object, property)- ? feature('javascript', ['builtins', object, property])- : undefined)- );-}--export function regexFeatures(pattern: string, flags: string): Feature[] {- const features: (Feature | undefined)[] = [];- if (/\(\?<[=!]/.test(pattern)) {- features.push(- feature('javascript', ['regular_expressions', 'lookbehind_assertion'])- );- }- if (flags.includes('v'))- features.push(feature('javascript', ['builtins', 'RegExp', 'unicodeSets']));- if (flags.includes('d'))- features.push(feature('javascript', ['builtins', 'RegExp', 'hasIndices']));- return features.filter((found) => found !== undefined);-}--function supportedAt(- statement: SimpleSupportStatement,- version: string-): boolean {- if (statement.flags || statement.prefix || statement.alternative_name)- return false;- const added = statement.version_added;- if (typeof added !== 'string' || added === 'preview') return false;- if (compareVersions(added.replace('≤', ''), version) > 0) return false;- const removed = statement.version_removed;- return (- typeof removed !== 'string' ||- compareVersions(removed.replace('≤', ''), version) > 0- );-}--function firstRelease(- statements: readonly SimpleSupportStatement[]-): string | undefined {- return statements- .filter(- (statement) =>- !statement.flags && !statement.prefix && !statement.alternative_name- )- .map((statement) => statement.version_added)- .find(- (added): added is string =>- typeof added === 'string' && added !== 'preview'- );-}--/** The first floor browser without unprefixed, unflagged support. Browsers the data omits count as supported. */-export function missingSupport(- compat: CompatStatement,- floor: BrowserFloor-): MissingSupport | undefined {- for (const [browser, floorVersion] of floor) {- const support = compat.support[browser];- if (!support) continue;- const statements = Array.isArray(support) ? support : [support];- if (statements.some((statement) => supportedAt(statement, floorVersion)))- continue;- return { browser, floorVersion, addedVersion: firstRelease(statements) };- }- return undefined;-}diff --git a/tooling/platform-compat/src/lint-web.ts b/tooling/platform-compat/src/lint-web.tsdeleted file mode 100644index a13a15e38d..0000000000--- a/tooling/platform-compat/src/lint-web.ts+++ /dev/null@@ -1,42 +0,0 @@-// Lints the web app's sources against its browserslist floor. Pass files to-// lint only those that the config covers; with no arguments it lints them all.-import { relative, resolve } from 'node:path';-import { ESLint } from 'eslint';-import { WEB_SOURCES } from './web-sources';--const repoRoot = resolve(import.meta.dir, '../../..');-const requested = process.argv- .slice(2)- .map((file) => relative(repoRoot, resolve(file)));--const eslint = new ESLint({- cwd: repoRoot,- overrideConfigFile: resolve(import.meta.dir, '../eslint.config.ts'),- errorOnUnmatchedPattern: false,- warnIgnored: false,-});-const linted = await eslint.lintFiles(- requested.length > 0 ? requested : WEB_SOURCES-);-// The code also carries disable comments for oxlint and generated-code rules-// that this config does not load; only this rule and parse failures count.-const results = linted.map((result) => {- const messages = result.messages.filter(- (message) =>- message.fatal || message.ruleId === 'platform-compat/browser-floor'- );- return {- ...result,- messages,- errorCount: messages.length,- fatalErrorCount: messages.filter((message) => message.fatal).length,- warningCount: 0,- fixableErrorCount: 0,- fixableWarningCount: 0,- suppressedMessages: [],- };-});-const formatter = await eslint.loadFormatter('stylish');-const output = await formatter.format(results);-if (output) console.log(output);-if (results.some((result) => result.errorCount > 0)) process.exit(1);diff --git a/tooling/platform-compat/src/native-permissions.ts b/tooling/platform-compat/src/native-permissions.tsdeleted file mode 100644index 696fb6d68a..0000000000--- a/tooling/platform-compat/src/native-permissions.ts+++ /dev/null@@ -1,36 +0,0 @@-/** Info.plist keys without which macOS and iOS refuse camera and microphone capture. */-export const MEDIA_USAGE_KEYS = [- 'NSCameraUsageDescription',- 'NSMicrophoneUsageDescription',-];--/** Hardened-runtime entitlements a signed macOS app needs to capture media. */-export const MEDIA_ENTITLEMENTS = [- 'com.apple.security.device.camera',- 'com.apple.security.device.audio-input',-];--function escapeKey(key: string): string {- return key.replace(/[.]/g, '\\.');-}--/** Keys that are absent or have an empty string value. */-export function missingStrings(- plist: string,- keys: readonly string[]-): string[] {- return keys.filter(- (key) =>- !new RegExp(- `<key>${escapeKey(key)}</key>\\s*<string>[^<\\s][^<]*</string>`- ).test(plist)- );-}--/** Keys that are absent or not set to `<true/>`. */-export function missingTrue(plist: string, keys: readonly string[]): string[] {- return keys.filter(- (key) =>- !new RegExp(`<key>${escapeKey(key)}</key>\\s*<true\\s*/>`).test(plist)- );-}diff --git a/tooling/platform-compat/src/web-sources.ts b/tooling/platform-compat/src/web-sources.tsdeleted file mode 100644index 2bf6c873e4..0000000000--- a/tooling/platform-compat/src/web-sources.ts+++ /dev/null@@ -1,12 +0,0 @@-/** Source the web app bundles: its own and the workspace packages it depends on, relative to the repository root. */-export const WEB_SOURCES = [- 'apps/web/src',- 'packages/collaboration/src',- 'packages/email-renderer/src',- 'packages/graphics/src',- 'packages/lexical-core',- 'packages/loro-mirror/src',- 'packages/machine/src',- 'packages/observability/src',- 'packages/spreadsheet/src',-];diff --git a/tooling/platform-compat/test/browser-floor-rule.test.ts b/tooling/platform-compat/test/browser-floor-rule.test.tsdeleted file mode 100644index 1885038a58..0000000000--- a/tooling/platform-compat/test/browser-floor-rule.test.ts+++ /dev/null@@ -1,155 +0,0 @@-import { describe, it } from 'bun:test';-import typescriptParser from '@typescript-eslint/parser';-import { RuleTester } from 'eslint';-import { browserFloorRule } from '../src/browser-floor-rule';--RuleTester.describe = describe;-RuleTester.it = it;--const safari = [{ browserslist: ['safari >= 15.4'] }];-const tester = new RuleTester({- languageOptions: { parser: typescriptParser },-});--tester.run('browser-floor', browserFloorRule, {- valid: [- { code: 'structuredClone(value); crypto.randomUUID();', options: safari },- { code: 'let worker: SharedWorker | undefined;', options: safari },- {- code: 'const SharedWorker = class {}; new SharedWorker();',- options: safari,- },- {- code: "if (typeof SharedWorker === 'function') new SharedWorker('worker.js');",- options: safari,- },- {- code: 'const worker = window.SharedWorker ? new SharedWorker("w.js") : undefined;',- options: safari,- },- { code: 'navigator.vibrate?.(10);', options: safari },- {- code: 'const signal = AbortSignal.any && AbortSignal.any([a, b]);',- options: safari,- },- {- code: 'const status = navigator.permissions?.query({ name: "camera" });',- options: safari,- },- {- code: "function connect() { if (!('SharedWorker' in window)) return; return () => new SharedWorker('w.js'); }",- options: safari,- },- {- code: "function start() { if (typeof SharedWorker !== 'function') throw new Error('unsupported'); return new SharedWorker('w.js'); }",- options: safari,- },- { code: "'a<br/>'.replace(/(.)<br\\/>$/, '$1');", options: safari },- {- code: 'AbortSignal.any([signal]);',- options: [{ browserslist: ['safari >= 17.4'] }],- },- ],- invalid: [- {- code: 'AbortSignal.any([signal]);',- options: safari,- errors: [- {- messageId: 'unsupported',- data: {- feature: 'AbortSignal.any',- browser: 'Safari',- floor: '15.4',- added: 'added in 17.4',- },- },- ],- },- {- code: 'AbortSignal.timeout(1000);',- options: [{ browserslist: ['ios_saf >= 15.4'] }],- errors: [- {- messageId: 'unsupported',- data: {- feature: 'AbortSignal.timeout',- browser: 'Safari on iOS',- floor: '15.4',- added: 'added in 16',- },- },- ],- },- {- code: 'const deferred = Promise.withResolvers();',- options: safari,- errors: [{ messageId: 'unsupported' }],- },- {- code: "if (ready) new SharedWorker('w.js');",- options: safari,- errors: [{ messageId: 'unsupported' }],- },- {- code: 'if (AbortSignal.any([signal]).aborted) cancel();',- options: safari,- errors: [{ messageId: 'unsupported' }],- },- {- code: 'const deferred = Promise.withResolvers() || fallback();',- options: safari,- errors: [{ messageId: 'unsupported' }],- },- {- code: 'try { load(AbortSignal.any([signal])); } catch { fail(); }',- options: safari,- errors: [{ messageId: 'unsupported' }],- },- {- code: 'navigator.permissions.query({ name: "camera" });',- options: safari,- errors: [{ messageId: 'unsupported' }],- },- {- code: 'window.requestIdleCallback(work);',- options: safari,- errors: [- {- messageId: 'unsupported',- data: {- feature: 'requestIdleCallback',- browser: 'Safari',- floor: '15.4',- added: 'never released there',- },- },- ],- },- {- code: 'const endBreak = /(?<=.)<br\\/>$/;',- options: safari,- errors: [- {- messageId: 'unsupported',- data: {- feature: 'javascript.regular_expressions.lookbehind_assertion',- browser: 'Safari',- floor: '15.4',- added: 'added in 16.4',- },- },- ],- },- {- code: "const pattern = new RegExp('(?<=a)b');",- options: safari,- errors: [{ messageId: 'unsupported' }],- },- {- code: 'const pattern = /[\\p{L}--a]/v;',- options: safari,- errors: [{ messageId: 'unsupported' }],- },- ],-});diff --git a/tooling/platform-compat/test/native-permissions.test.ts b/tooling/platform-compat/test/native-permissions.test.tsdeleted file mode 100644index 4d3b3ff925..0000000000--- a/tooling/platform-compat/test/native-permissions.test.ts+++ /dev/null@@ -1,51 +0,0 @@-import { describe, expect, it } from 'bun:test';-import { parseBrowserFloor } from '../src/browser-floor';-import {- MEDIA_ENTITLEMENTS,- MEDIA_USAGE_KEYS,- missingStrings,- missingTrue,-} from '../src/native-permissions';--describe('native media permissions', () => {- it('requires a non-empty usage string for each key', () => {- const plist = `<dict>- <key>NSCameraUsageDescription</key>- <string>Macro uses the camera for calls.</string>- <key>NSMicrophoneUsageDescription</key>- <string></string>- </dict>`;- expect(missingStrings(plist, MEDIA_USAGE_KEYS)).toEqual([- 'NSMicrophoneUsageDescription',- ]);- });-- it('requires each entitlement to be true', () => {- const plist = `<dict>- <key>com.apple.security.device.camera</key>- <true/>- <key>com.apple.security.device.audio-input</key>- <false/>- </dict>`;- expect(missingTrue(plist, MEDIA_ENTITLEMENTS)).toEqual([- 'com.apple.security.device.audio-input',- ]);- });-});--describe('browser floor', () => {- it('maps browserslist names to compatibility data ids', () => {- expect([- ...parseBrowserFloor(['ios_saf >= 15.4', 'and_chr >= 111']),- ]).toEqual([- ['safari_ios', '15.4'],- ['chrome_android', '111'],- ]);- });-- it('rejects queries the build target cannot use', () => {- expect(() => parseBrowserFloor(['last 2 versions'])).toThrow(- 'Unsupported browserslist query: last 2 versions'- );- });-});diff --git a/tooling/platform-compat/tsconfig.json b/tooling/platform-compat/tsconfig.jsondeleted file mode 100644index 90fe8cc997..0000000000--- a/tooling/platform-compat/tsconfig.json+++ /dev/null@@ -1,13 +0,0 @@-{- "compilerOptions": {- "target": "esnext",- "module": "preserve",- "moduleResolution": "bundler",- "resolveJsonModule": true,- "strict": true,- "noEmit": true,- "skipLibCheck": true,- "types": ["bun"]- },- "include": ["src", "test", "eslint.config.ts"]-}diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rsindex ba780732cc..f22c814db6 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs@@ -182,8 +182,7 @@ fn biome_check() -> Job {.add_step(steps::setup_dev_shell()).add_step(run_biome()).add_step(run_collaboration_biome())- .add_step(install_platform_compat())- .add_step(check_platform_compat())+ .add_step(check_platform_rules()).add_step(steps::teardown_nix())}@@ -295,7 +294,7 @@ fn paths_filter() -> Step<Use> {.add_with(("filters",format!(- "should_run:\n{artifact_paths} - 'services/lexical-service/**'\n - 'packages/sdk/**'\n - 'packages/sdk-docs/**'\n - 'services/ai-editing-worker/**'\n - 'packages/code-mode-sdk/**'\n - 'tooling/platform-compat/**'\n - 'crates/code_execution/src/outbound/deno/*.mjs'\n - 'crates/agent_code_mode/src/domain/documentation.json'\n - 'crates/agent_code_mode/SKILL.md'\n - 'crates/ai_tools/src/display_results/schema.generated.json'\n - '.github/actions/setup-reqs-web/**'\ncodegen_changed:\n - 'crates/**/*.rs'\n - 'services/**/*.rs'\n - 'Cargo.toml'\n - 'Cargo.lock'\n - 'apps/web/scripts/generate-api-schema.ts'\n - 'apps/web/scripts/services.ts'\n - 'packages/sdk/**'\n - 'apps/docs/**'\n - '.github/actions/setup-reqs-web/**'\ni18n_changed:\n - 'apps/web/src/lib/i18n/**'\n - 'apps/web/src/lib/core/component/ContextMenu.tsx'\n - 'apps/web/src/lib/core/constant/settingsTabsConfig.tsx'\n - 'apps/web/src/components/ui/components/Dropdown.tsx'\n - 'apps/web/src/features/settings/**'\n"+ "should_run:\n{artifact_paths} - 'services/lexical-service/**'\n - 'packages/sdk/**'\n - 'packages/sdk-docs/**'\n - 'services/ai-editing-worker/**'\n - 'packages/code-mode-sdk/**'\n - 'crates/code_execution/src/outbound/deno/*.mjs'\n - 'crates/agent_code_mode/src/domain/documentation.json'\n - 'crates/agent_code_mode/SKILL.md'\n - 'crates/ai_tools/src/display_results/schema.generated.json'\n - '.github/actions/setup-reqs-web/**'\ncodegen_changed:\n - 'crates/**/*.rs'\n - 'services/**/*.rs'\n - 'Cargo.toml'\n - 'Cargo.lock'\n - 'apps/web/scripts/generate-api-schema.ts'\n - 'apps/web/scripts/services.ts'\n - 'packages/sdk/**'\n - 'apps/docs/**'\n - '.github/actions/setup-reqs-web/**'\ni18n_changed:\n - 'apps/web/src/lib/i18n/**'\n - 'apps/web/src/lib/core/component/ContextMenu.tsx'\n - 'apps/web/src/lib/core/constant/settingsTabsConfig.tsx'\n - 'apps/web/src/components/ui/components/Dropdown.tsx'\n - 'apps/web/src/features/settings/**'\n"),))}@@ -418,18 +417,12 @@ fn run_biome() -> Step<Run> {.working_directory(xtask_paths::repo_dir!("apps/web"))}-fn install_platform_compat() -> Step<Run> {- Step::new("Install Platform Compatibility Tooling")- .run("bun install --frozen-lockfile")- .working_directory(xtask_paths::repo_dir!("tooling/platform-compat"))-}--/// Lints all of `apps/web/src` against its `browserslist` floor and checks the-/// native bundles keep their camera and microphone permissions.-fn check_platform_compat() -> Step<Run> {- Step::new("Check Browser Floor and Native Permissions")- .run("bun run check")- .working_directory(xtask_paths::repo_dir!("tooling/platform-compat"))+/// Runs the browser-floor and native media permission ast-grep rules here+/// because Conventions, which runs every ast-grep rule, is not a required check.+fn check_platform_rules() -> Step<Run> {+ Step::new("Check Browser Floor and Native Permissions").run(+ "bunx --yes @ast-grep/[email protected] scan --filter '^(tsx?-browser-floor-apis|plist-media-.+)$'",+ )}fn run_collaboration_biome() -> Step<Run> {