From 22e7eb4ad7ee6f3a556771dcbce2885263079466 Mon Sep 17 00:00:00 2001 From: wishforge Date: Wed, 11 Nov 2026 07:59:03 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Pass=20local=20auth=20settings?= =?UTF-8?q?=20to=20the=20production=20web=20build=20and=20ignore=20AGENTS.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running the local console with WF_WEB_SERVE_MODE=production starts Next.js with NODE_ENV=production, which previously disabled development sign-in even when WF_DEPLOYMENT_MODE=development was explicitly set. Keep the deployment-mode gate explicit, forward the console's auth and API variables from scripts/dev.mjs, narrow the Temporal worker grace-time literal for TypeScript, and ignore local AGENTS.md instructions. --- .gitignore | 1 + apps/web/src/lib/auth.ts | 2 +- scripts/dev.mjs | 12 +++++++++++- tests/integration/temporal.test.ts | 6 +++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 1c38c9e..57ee999 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ next-env.d.ts infra/compose.local.yaml .agents/ .agent-teams/ +AGENTS.md # Local-only runtime state (cluster kubeconfig, operator notes) local-data/ diff --git a/apps/web/src/lib/auth.ts b/apps/web/src/lib/auth.ts index 4e17795..5fe4263 100644 --- a/apps/web/src/lib/auth.ts +++ b/apps/web/src/lib/auth.ts @@ -41,7 +41,7 @@ type Discovery = { }; /** Development conveniences need the explicit development deployment mode; anything else fails closed. */ export function isDevelopment() { - return process.env.WF_DEPLOYMENT_MODE === 'development' && process.env.NODE_ENV !== 'production'; + return process.env.WF_DEPLOYMENT_MODE === 'development'; } export function isDevelopmentAuth() { return !localAccessEnabled() && isDevelopment() && Boolean(process.env.WF_DEV_AUTH_TOKEN); diff --git a/scripts/dev.mjs b/scripts/dev.mjs index 9c4be04..7416983 100644 --- a/scripts/dev.mjs +++ b/scripts/dev.mjs @@ -83,7 +83,17 @@ await startServices( String(web.port), ], env: environment( - [/^WF_LOCAL_ACCESS$/, /^WF_LOCAL_ACCESS_FILE$/, /^WF_LOCAL_ALLOWED_ORIGINS$/, /^WF_LOCAL_API_TOKEN$/], + [ + /^WF_LOCAL_ACCESS/, + /^WF_LOCAL_ACCESS_FILE$/, + /^WF_LOCAL_ALLOWED_ORIGINS$/, + /^WF_LOCAL_API_TOKEN$/, + /^WF_DEV_AUTH_TOKEN$/, + /^WF_API_URL$/, + /^WF_PUBLIC_URL$/, + /^WF_SESSION_SECRET$/, + /^OIDC_/, + ], { NODE_ENV: productionWeb ? 'production' : 'development' }, ), url: `http://${web.probe}:${web.port}${process.env.WF_LOCAL_ACCESS === 'true' ? '/login' : '/api/session'}`, diff --git a/tests/integration/temporal.test.ts b/tests/integration/temporal.test.ts index b446d23..83c68f6 100644 --- a/tests/integration/temporal.test.ts +++ b/tests/integration/temporal.test.ts @@ -35,7 +35,7 @@ describe.skipIf(!enabled)('Temporal durable runWorkflow recovery (fixture activi recordWaiting: (i: RunInput & { reason: string }) => Promise<{ status: 'waiting' }>; }, ) { - const options = { connection: native, namespace, shutdownGraceTime: '1 second', maxCachedWorkflows: 0 }; + const options = { connection: native, namespace, shutdownGraceTime: '1 second' as const, maxCachedWorkflows: 0 }; const workers = await Promise.all([ Worker.create({ ...options, @@ -272,7 +272,7 @@ describe.skipIf(!enabled)('Temporal durable runWorkflow recovery (fixture activi connection: native, namespace, taskQueue: `wishforge-executor-${next.tenantId}-${next.runId}-${next.generation}`, - shutdownGraceTime: '1 second', + shutdownGraceTime: '1 second' as const, activities: { executeRun: async () => { newExecutions++; @@ -302,7 +302,7 @@ describe.skipIf(!enabled)('Temporal durable runWorkflow recovery (fixture activi namespace, taskQueue: 'wishforge-runs', workflowBundle: bundle, - shutdownGraceTime: '1 second', + shutdownGraceTime: '1 second' as const, activities: { inspectRunState: async () => ({ status: 'running' }), recordWaiting: async (i: RunInput & { reason: string }) => {