Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: show browser suite selection and fidelity receipt requirement in pregate plan output (#11725)
[._.]/ Adam Eivy65d7c17d942e
diff --git a/scripts/pregate.js b/scripts/pregate.jsindex 9f0153ee13..b98eab9d55 100644--- a/scripts/pregate.js+++ b/scripts/pregate.js@@ -38,6 +38,7 @@ import { fileURLToPath } from 'url';import { ALWAYS_RUN_TESTS, structuralTestsFor } from './ci-test-plan.js';import { assertNodeVersion } from './checkNodeVersion.js';import { isDirectlyInvoked } from './lib/directInvocation.js';+import { needsBrowserFidelity } from './lib/browserFidelity.js';const REPO_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');@@ -56,6 +57,27 @@ export const UNCOVERED_SUITES = Object.freeze({smoke: 'npm run smoke',});+/**+ * Plan lines for the cross-workspace browser selection CI consumes+ * (`browser_files`). `receipt` is the native fidelity receipt state when known+ * ('valid' | 'absent'); the receipt is a PR-head commit status, so a local plan+ * normally cannot see it and says CI verifies it.+ */+export function describeBrowserSelection(files, receipt = null) {+ if (files.length === 0) return ['ℹ️ Browser suites: none selected — no native browser-fidelity receipt required.'];+ const lines = [`ℹ️ Browser suites: ${files.length} selected (${files.join(', ')}).`];+ if (!needsBrowserFidelity(files)) {+ lines.push('ℹ️ Native browser-fidelity receipt: not required for this selection.');+ } else if (receipt === 'valid') {+ lines.push('ℹ️ Native browser-fidelity receipt: required — present and valid.');+ } else if (receipt === 'absent') {+ lines.push('⚠️ Native browser-fidelity receipt: required — ABSENT; CI will fail until the trusted receipt for the PR head is posted.');+ } else {+ lines.push('⚠️ Native browser-fidelity receipt: required — not checkable locally; CI verifies a trusted receipt for the exact PR head.');+ }+ return lines;+}+/** Local pregate worker budget per Vitest workspace; see scripts/vitestCiPool.js. */export const PREGATE_DEFAULT_MAX_WORKERS = '4';@@ -299,6 +321,7 @@ function main() {server: { mode: raw.server_mode, files: JSON.parse(raw.server_files), sources: JSON.parse(raw.server_sources) },client: { mode: raw.client_mode, files: JSON.parse(raw.client_files), sources: JSON.parse(raw.client_sources) },lint: { mode: raw.lint_mode, files: JSON.parse(raw.lint_files) },+ browser: { files: JSON.parse(raw.browser_files ?? '[]') },db: raw.db,windows: raw.windows,build: raw.build,@@ -317,6 +340,8 @@ function main() {console.log(`ℹ️ CI will also run: ${key} — not covered here; run ${UNCOVERED_SUITES[key]}`);});+ describeBrowserSelection(plan.browser?.files ?? []).forEach((line) => console.log(line));+if (options.planOnly) {stages.forEach((stage) => {console.log(`• ${stage.name}: ${stage.script} ${stage.args.join(' ')}`);diff --git a/scripts/pregate.test.js b/scripts/pregate.test.jsindex cc292ede4e..8662e2d62a 100644--- a/scripts/pregate.test.js+++ b/scripts/pregate.test.js@@ -23,6 +23,7 @@ import {import {collectPregateChangedFiles,resolvePlanStages,+ describeBrowserSelection,downgradeFullPlan,parseArgs,pregateWorkerEnv,@@ -30,6 +31,9 @@ import {unmergedIndexPaths,} from './pregate.js';+import { BROWSER_SUITES } from './lib/browserSuites.js';+import { BROWSER_FIDELITY_FILES } from './lib/browserTestProfiles.js';+const REPO_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');const planWith = (overrides = {}) => ({@@ -120,7 +124,7 @@ describe('pregate hidden-content invocation', () => {for (const path of ['scripts/pregate.js', 'scripts/checkNodeVersion.js', 'scripts/scan-diff-hidden-content.js','scripts/ci-test-plan.js', 'scripts/ci-base-sha.js', 'server/lib/staticImportGraph.js',- 'scripts/lib/directInvocation.js', 'scripts/lib/githubOutput.js', 'scripts/lib/dbTestFiles.js',+ 'scripts/lib/directInvocation.js', 'scripts/lib/browserFidelity.js', 'scripts/lib/browserTestProfiles.js', 'scripts/lib/githubOutput.js', 'scripts/lib/dbTestFiles.js','scripts/lib/browserSuites.js','server/lib/diffHiddenContentScan.js', 'server/lib/modelAbuseGuard.js','server/lib/textUtils.js',@@ -482,7 +486,7 @@ describe('the gate end to end', () => {for (const path of ['scripts/pregate.js', 'scripts/checkNodeVersion.js', 'scripts/scan-diff-hidden-content.js','scripts/ci-test-plan.js', 'scripts/ci-base-sha.js', 'server/lib/staticImportGraph.js',- 'scripts/lib/directInvocation.js', 'scripts/lib/githubOutput.js', 'scripts/lib/dbTestFiles.js',+ 'scripts/lib/directInvocation.js', 'scripts/lib/browserFidelity.js', 'scripts/lib/browserTestProfiles.js', 'scripts/lib/githubOutput.js', 'scripts/lib/dbTestFiles.js','scripts/lib/browserSuites.js','server/lib/diffHiddenContentScan.js', 'server/lib/modelAbuseGuard.js','server/lib/textUtils.js',@@ -524,3 +528,29 @@ describe('the gate end to end', () => {}});});++describe('describeBrowserSelection', () => {+ const selected = BROWSER_SUITES.slice(0, 10);+ const fidelity = BROWSER_FIDELITY_FILES[0];++ it('distinguishes no selection from a selection that needs a receipt', () => {+ const none = describeBrowserSelection([]).join('\n');+ expect(none).toContain('none selected');+ expect(none).toContain('no native browser-fidelity receipt required');+ const some = describeBrowserSelection([fidelity, ...selected]).join('\n');+ expect(some).toContain('selected');+ expect(some).toContain('receipt: required');+ });++ it('reports absent and valid receipt state', () => {+ expect(describeBrowserSelection([fidelity], 'absent').join('\n')).toContain('ABSENT');+ expect(describeBrowserSelection([fidelity], 'valid').join('\n')).toContain('present and valid');+ });++ it('shows the selection in --plan-only output', () => {+ const out = execFileSync(process.execPath, [join(REPO_ROOT, 'scripts', 'pregate.js'), '--plan-only', '--skip-lint', '--base', 'HEAD'], {+ cwd: REPO_ROOT, encoding: 'utf8',+ });+ expect(out).toContain('Browser suites:');+ });+});