Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
Session Lock & Session Termination under CUI — implementation plan
Status: IMPLEMENTED 2026-08-18 (residual: /test browser verification + passkey-unlock
addition — see .ai/plans/2026-08-15-nist-800-171-app-remediation.md).
Spec: .ai/specs/implemented/2026-08-17-session-lock-timeout.md Research: .ai/research/session-lock-timeout.md Branch: nist-800-110-audit (single PR #1414)
NIST 800-171 3.1.10 (session lock) + 3.1.11 (session termination), gated on
CONTROLLED_ENVIRONMENT, inert otherwise. No DB migration — two optional cookie
fields on AuthSession. Server-authoritative enforcement in requireAuthSession;
client idle UX drives concealment + a throttled activity heartbeat.
Progress
- Task 1: Add session-timeout constants to
@carbon/env - Task 2: Add
createdAt/lastActiveAttoAuthSession - Task 3: Stamp at mint, preserve across refresh; add predicates +
touchAuthSession(+ unit tests) - Task 4: Enforce idle-lock + absolute-termination in
requireAuthSession - Task 5: Heartbeat route (ERP + MES)
- Task 6:
/unlockTOTP route (ERP + MES) - Task 7:
useIdleclient hook (activity + heartbeat + cross-tab) - Task 8:
SessionLockOverlay+ wire into ERP/MES shells - Task 9: MES console idle-lock (tighten pin-in window under CUI)
- Task 10: Browser verification via
/test
Dependencies
- Task 3 needs Tasks 1–2 (constants + type fields).
- Task 4 needs Task 3 (predicates).
- Tasks 5 and 6 need Task 3 (
touchAuthSession/completeMfaChallengestamping). Tasks 5 and 6 are independent of each other. - Task 7 needs Task 5 (heartbeat endpoint path). Task 8 needs Tasks 6–7. Task 9 is independent of Tasks 5–8 (separate console mechanism).
- Task 10 is last (needs everything).
Task 1: Add session-timeout constants to @carbon/env
Depends on: none Files:
- Modify:
packages/env/src/index.ts— add three numeric constants next to the existing session constants. - Copy from (precedent): the existing
SESSION_MAX_AGE/REFRESH_ACCESS_TOKEN_THRESHOLDdeclarations atpackages/env/src/index.ts:372-373(plain literalexport const, seconds/ms literals — NOTgetEnv).
Steps:
- After line 373 (
export const REFRESH_ACCESS_TOKEN_THRESHOLD = 60 * 10; // ...), add:// Session lock / termination (NIST 800-171 3.1.10 / 3.1.11). All in MILLISECONDS // (unlike SESSION_MAX_AGE above, which is seconds for the cookie maxAge). Enforced // only when CONTROLLED_ENVIRONMENT is true. Plain literals, matching SESSION_MAX_AGE // precedent (not env-overridable in v1). export const SESSION_IDLE_LOCK_MS = 15 * 60 * 1000; // 15 min — DISA App-Sec STIG web-app idle export const SESSION_ABSOLUTE_MAX_MS = 12 * 60 * 60 * 1000; // 12 h — absolute session cap export const SESSION_HEARTBEAT_MS = 60 * 1000; // client activity heartbeat throttle - These are re-exported automatically:
@carbon/authdoesexport * from "@carbon/env"(via@carbon/config/config/env). No change needed to@carbon/authexports. - Do NOT add them to
getBrowserEnv()— the client receives the values as loader data (Task 8), matching howsession.expiresAtreachesCarbonProvider.
Verify:
pnpm exec turbo run typecheck --filter=@carbon/env
# Expected: typecheck passes (1 successful)
Out of scope: Do not touch SESSION_MAX_AGE, getBrowserEnv, or the Window.env interface.
Task 2: Add createdAt/lastActiveAt to AuthSession
Depends on: none Files:
- Modify:
packages/auth/src/types.ts— add two optional fields to theAuthSessioninterface.
Steps:
- In the
AuthSessioninterface (currently ends at themfaVerified?: boolean;field,packages/auth/src/types.ts:3-19), add aftermfaVerified:/** * Session start (unix ms). Stamped once at mint; PRESERVED across token * refresh (never reset by refreshAuthSession). Basis of the 12h absolute cap * (SESSION_ABSOLUTE_MAX_MS). Optional for back-compat with sessions minted * before this shipped — treated as "now" on first sight. */ createdAt?: number; /** * Last real user activity (unix ms). Updated only by the activity heartbeat * and on unlock — NOT by background requests or token refresh. Basis of the * 15min idle lock (SESSION_IDLE_LOCK_MS). Optional for back-compat. */ lastActiveAt?: number;
Verify:
pnpm exec turbo run typecheck --filter=@carbon/auth
# Expected: typecheck passes
Out of scope: Do not change any other field or the Company/Permission/Result types.
Task 3: Stamp at mint, preserve across refresh; add predicates + touchAuthSession (+ unit tests)
Depends on: Tasks 1, 2 Files:
- Modify:
packages/auth/src/services/auth.server.ts— stampcreatedAt/lastActiveAtinmakeAuthSession. - Modify:
packages/auth/src/services/session.server.ts— preserve both across refresh inrefreshAuthSession; addisSessionExpiredAbsolute/isSessionIdleLockedpure predicates andtouchAuthSession. - Create:
packages/auth/src/services/session-timeout.test.ts— unit tests. - Copy from (precedent): the existing preserve block in
refreshAuthSession(session.server.ts:330-337, which preservesconsole/mfaVerified); the existingmfa-session.test.tsfor the test harness shape.
Steps:
- Stamp at mint — in
makeAuthSession(auth.server.ts:146-157), addcreatedAt/lastActiveAtto the returned object. BecausemakeAuthSessionis also called byrefreshAccessToken(line 518), stampingnowhere is correct ONLY becauserefreshAuthSessionoverwrites them with the preserved values in step 2. Add before the...(options?.mfaVerified ...)spread:
(NOTE: this usescreatedAt: Date.now(), lastActiveAt: Date.now(),Date.now()for an absolute instant / elapsed-ms comparison — the narrow exception in.claude/rules/date-handling.md; this is not a calendar date. The file already usesDate.now()— e.g.isExpiringSoon.) - Escape hatch: confirm the only
makeAuthSessioncaller that is a refresh (not a fresh login/re-auth) isrefreshAccessToken(auth.server.ts:503-519). The fresh-mint callers aresignInWithBypassEmail(472),signInWithEmail(496),signInWithPasskey(595), andcompleteMfaChallenge(177) — all of which SHOULD getcreatedAt = now. If you find another refresh-style caller that must preserve session age, STOP and report — do not improvise. - Preserve across refresh — in
refreshAuthSession(session.server.ts:319-370), extend the existing preserve block (after themfaVerifiedpreserve at line 335-337) with:// Preserve session age + last-activity across a silent token refresh — a // refresh is neither a re-auth nor user activity, so it must not reset the // absolute-cap clock or the idle clock. if (refreshedAuthSession && authSession?.createdAt) { refreshedAuthSession.createdAt = authSession.createdAt; } if (refreshedAuthSession && authSession?.lastActiveAt) { refreshedAuthSession.lastActiveAt = authSession.lastActiveAt; } - Pure predicates — add near
isExpiringSoon(session.server.ts:281-283), importing the two new constants from../config/env:
Add/** Absolute cap (3.1.11). Missing createdAt = never expired (back-compat; the * session gets stamped on next mint/refresh). */ export function isSessionExpiredAbsolute(session: AuthSession): boolean { if (!session.createdAt) return false; return Date.now() - session.createdAt > SESSION_ABSOLUTE_MAX_MS; } /** Idle lock (3.1.10). Missing lastActiveAt = not locked (back-compat). */ export function isSessionIdleLocked(session: AuthSession): boolean { if (!session.lastActiveAt) return false; return Date.now() - session.lastActiveAt > SESSION_IDLE_LOCK_MS; }SESSION_ABSOLUTE_MAX_MS,SESSION_IDLE_LOCK_MSto the existing import from../config/envatsession.server.ts:6-13. touchAuthSession— add an exported helper that re-commits the signed cookie with a freshlastActiveAt(used by the heartbeat and unlock). Model it onupdateSessionConsole(session.server.ts:372-387):/** Re-commit the session cookie with lastActiveAt = now. Used by the activity * heartbeat and on unlock. Returns the Set-Cookie string, or null if no session. */ export async function touchAuthSession(request: Request): Promise<string | null> { const session = await getSession(request); const authSession = await getAuthSession(request); if (!authSession) return null; session.set(SESSION_KEY, { ...authSession, lastActiveAt: Date.now() }); return sessionStorage.commitSession(session, { maxAge: SESSION_MAX_AGE }); }- Unit tests (
session-timeout.test.ts): coverisSessionExpiredAbsolute: false whencreatedAtmissing; false atnow - createdAt < 12h; true at> 12h.isSessionIdleLocked: false whenlastActiveAtmissing; false< 15min; true> 15min.- Preserve-across-refresh: simulate
refreshAuthSessionpreservingcreatedAt/lastActiveAt— assert a refreshed session keeps the ORIGINALcreatedAt(i.e. the absolute clock does not reset on refresh). Follow the mock style inmfa-session.test.ts(mockmakeAuthSession/refreshAccessToken). Usevi.useFakeTimers()/vi.setSystemTime(...)for the elapsed-time assertions.
Verify:
pnpm exec turbo run typecheck --filter=@carbon/auth
pnpm --filter @carbon/auth test
# Expected: typecheck passes; new session-timeout tests pass; existing auth tests still pass
Out of scope: Do not add the enforcement branch to requireAuthSession yet (Task 4). Do not touch completeMfaChallenge beyond what makeAuthSession already gives it (it re-stamps createdAt/lastActiveAt = now on unlock, which is the intended re-auth behavior).
Task 4: Enforce idle-lock + absolute-termination in requireAuthSession
Depends on: Task 3 Files:
- Modify:
packages/auth/src/services/session.server.ts— add the two enforcement checks insiderequireAuthSession(:285-317), gated onCONTROLLED_ENVIRONMENT, skipping console device sessions. - Copy from (precedent): the existing MFA re-check redirect in the same function (
session.server.ts:309-314) and thedestroyAuthSessiontermination pattern (:214-219).
Steps:
- Import
CONTROLLED_ENVIRONMENTfrom../config/env(add to the existing import block). - In
requireAuthSession, AFTER the refresh (:301-303) and BEFORE the MFA re-check (:309), insert:// NIST 800-171 3.1.10 / 3.1.11 — controlled environments only. Console DEVICE // sessions are exempt: their lock is the operator pin-in (see console.server), // and a shared kiosk must not be force-logged-out mid-shift (spec D8). if (CONTROLLED_ENVIRONMENT && !authSession.console) { if (isSessionExpiredAbsolute(authSession)) { // 3.1.11 termination — destroy the session, force full re-login. throw await destroyAuthSession(request); } if (isSessionIdleLocked(authSession)) { // 3.1.10 lock — session PRESERVED; re-auth at /unlock to resume. throw redirect(`${path.to.unlock}?${makeRedirectToFromHere(request)}`); } } - Add
path.to.unlockto the auth package path helper (packages/auth/src/utils/path.ts) — find wherepath.to.mfa/path.to.loginare defined and addunlock: "/unlock"in the same shape. Ifpath.to.mfais defined there, mirror it exactly. If the path helper does not havemfa, STOP and report (the redirect target must resolve). destroyAuthSessionalready returns aredirect(...)Response —throwit (matches howrefreshAuthSessionthrows its redirect).
Verify:
pnpm exec turbo run typecheck --filter=@carbon/auth
pnpm --filter @carbon/auth test
# Expected: passes. (Behavioral verification is Task 10 — CONTROLLED_ENVIRONMENT is unset locally.)
Out of scope: The API-key path (auth.server.ts:219-330) — it never calls requireAuthSession, so machine callers are exempt by construction; do not add a check there. Do not gate on anything other than CONTROLLED_ENVIRONMENT (no per-company toggle in v1).
Task 5: Heartbeat route (ERP + MES)
Depends on: Task 3 Files:
- Create:
apps/erp/app/routes/api+/session.heartbeat.ts - Create:
apps/mes/app/routes/api+/session.heartbeat.ts - Copy from (precedent):
apps/erp/app/routes/_public+/refresh-session.tsx(POST-only action that re-issues the session cookie and returns a small JSON body).
Steps:
- Each file: POST-only action. Require a valid session (call
requirePermissions(request, {})— an empty permission set just asserts an authenticated session), then calltouchAuthSession(request)and returndata({ ok: true }, { headers: { "Set-Cookie": cookie } })when a cookie came back, elsedata({ ok: false }).import { assertIsPost } from "@carbon/auth"; import { requirePermissions } from "@carbon/auth/auth.server"; import { touchAuthSession } from "@carbon/auth/session.server"; import { data, type ActionFunctionArgs } from "react-router"; export async function action({ request }: ActionFunctionArgs) { assertIsPost(request); await requirePermissions(request, {}); const cookie = await touchAuthSession(request); return data( { ok: Boolean(cookie) }, cookie ? { headers: { "Set-Cookie": cookie } } : undefined ); } - Confirm the flat-route filename maps to
/api/session/heartbeat(theapi+/+.segment convention, e.g. existingapi+/…files). If the resolved path differs, note the real path for Task 7. - NOTE:
requireAuthSessionruns insiderequirePermissions, so a heartbeat from an already-idle session would itself redirect to/unlockbefore touching. That is correct — once locked, the heartbeat stops resuming the session; only/unlockre-auth does. The heartbeat's job is to keep an ACTIVE session from locking, firing well within the 15-min window.
Verify:
pnpm exec turbo run typecheck --filter=erp
pnpm exec turbo run typecheck --filter=mes
# Expected: both pass
Out of scope: No rate-limit table needed; the endpoint only re-signs a cookie. Do not add idle logic here — enforcement lives in requireAuthSession.
Task 6: /unlock TOTP route (ERP + MES)
Depends on: Task 3 Files:
- Create:
apps/erp/app/routes/_public+/unlock.tsx - Create:
apps/mes/app/routes/_public+/unlock.tsx - Copy from (precedent):
apps/erp/app/routes/_public+/mfa.tsx(loader guards,completeMfaChallengeaction, Set-Cookie of the rotated session, OTP input via~/components/TotpEnrollment) andapps/mes/app/routes/_public+/mfa.tsxfor the MES variant.
Steps:
- Build
unlock.tsxas a near-copy ofmfa.tsxwith these differences:- Loader: redirect away (to
redirectToor authenticated root) if the session is NOT actually idle-locked — i.e. ifgetAuthSessionreturns a session and!isSessionIdleLocked(session)and!isSessionExpiredAbsolute(session). If the session is absolute-expired or missing, redirect to/login(termination wins). Only render the unlock form when the session exists and is idle-locked. - Action: identical to
mfa.tsx—completeMfaChallenge(request, code); on success Set-Cookie the rotated session (which now carries freshcreatedAt/lastActiveAtfrommakeAuthSession) and redirect toredirectTo. Rate-limit the same waymfa.tsxdoes. - Copy/label: "Session locked — enter your authentication code to resume" instead of the enrollment-challenge copy. Reuse the shared
OtpInput/useTotpEnrollmentfrom~/components/TotpEnrollmentandINVALID_CODE_MESSAGE.
- Loader: redirect away (to
- MES
unlock.tsx: mirror the MESmfa.tsx(its layout/console handling). Console-mode sessions never reach/unlock(Task 4 skipsauthSession.console); the MES/unlockserves non-console MES sessions. - If
mfa.tsxrelies on the pending-MFA session (getPendingMfaSession) in its loader, DROP that branch for/unlock— an unlock always operates on the existing full session, never a pending one.
Verify:
pnpm exec turbo run typecheck --filter=erp
pnpm exec turbo run typecheck --filter=mes
# Expected: both pass
Out of scope: Do not implement PIN unlock here — console PIN is Task 9. Do not modify completeMfaChallenge (Task 3 already made it re-stamp timestamps).
Task 7: useIdle client hook (activity + heartbeat + cross-tab)
Depends on: Task 5 Files:
- Create:
apps/erp/app/hooks/useIdle.tsx - Create:
apps/mes/app/hooks/useIdle.tsx(or a shared spot if both apps import from one — prefer per-app to match the existing per-app hooks dir; keep them identical). - Copy from (precedent):
packages/auth/src/lib/supabase/provider.tsx:63-105(the existingvisibilitychangelistener +useIntervalrefresh loop — reuse this activity/interval shape).
Steps:
useIdle({ idleMs, heartbeatMs, heartbeatUrl, enabled })returns{ isIdle, resume }:- When
enabledis false (non-controlled env), the hook is inert: never setsisIdle, never posts. - Track
lastActivityRef = Date.now()updated onmousemove,mousedown,keydown,touchstart,scroll,visibilitychange(visible). Throttle activity handling to avoid per-event work. - A
setInterval(~1s) setsisIdle = trueonceDate.now() - lastActivity > idleMs. - Heartbeat: while active (not idle) and at most once per
heartbeatMs,fetch(heartbeatUrl, { method: "POST" })(credentials same-origin). Do NOT heartbeat while idle. - Cross-tab via
BroadcastChannel("carbon-session-activity"): on local activity, post{ t: Date.now() }(throttled); on receiving a peer activity message, updatelastActivityand clearisIdle. On local lock, post{ locked: true }; peers setisIdle = true. Guardtypeof BroadcastChannel !== "undefined". Close the channel on unmount. resume()clearsisIdleand resetslastActivity(called after a successful unlock navigation).
- When
- Use plain
Date.now()here — client-side elapsed-ms, the allowed exception; this is not a calendar date. - Do NOT add
react-idle-timeror any dependency (spec D10).
Verify:
pnpm exec turbo run typecheck --filter=erp
pnpm exec turbo run typecheck --filter=mes
# Expected: both pass
Out of scope: No server calls other than the heartbeat POST. The hook renders nothing — the overlay is Task 8.
Task 8: SessionLockOverlay + wire into ERP/MES shells
Depends on: Tasks 6, 7 Files:
- Create:
apps/erp/app/components/SessionLockOverlay.tsx - Create:
apps/mes/app/components/SessionLockOverlay.tsx(identical shape, MES sizingsize="lg"per.claude/rulesMES convention). - Modify:
apps/erp/app/routes/x+/_layout.tsx— pass timeout config from loader; render the overlay driven byuseIdle. - Modify:
apps/mes/app/routes/x+/_layout.tsx— same. - Copy from (precedent):
apps/erp/app/components/MfaEnrollmentRequired.tsx(full-screen blocking-screen shape) and the shell's existingmfaScreenrender (apps/erp/app/routes/x+/_layout.tsx:397-411); the session prop is already passed toCarbonProvideratx+/_layout.tsx:413andsession.expiresAtat:259-264.
Steps:
- Shell loader: in each
x+/_layout.tsxloader, add to the returned data asessionTimeoutobject:
Import the three fromsessionTimeout: { enabled: CONTROLLED_ENVIRONMENT, idleMs: SESSION_IDLE_LOCK_MS, heartbeatMs: SESSION_HEARTBEAT_MS, }@carbon/auth(re-exported from@carbon/env). Console sessions: passenabled: falsewhenconsoleModeis true (console uses the pin-in path, Task 9) — read the existingconsoleMode/authSession.consolealready available in the loader. SessionLockOverlay: a full-viewport fixed overlay (mirrorMfaEnrollmentRequired's container) that renders ONLY when itsisIdleprop is true. It must conceal page content (opaque background, high z-index, covers the shell) — pattern-hiding (AC-11(1)). Content: a lock icon, "Session locked" heading, short copy, and a link/button that navigates to/unlock?redirectTo=<current path>(the actual TOTP form lives on/unlock, Task 6 — the overlay just conceals + funnels there). Optionally embed the OTP form inline later; for v1 the overlay conceals and routes to/unlock.- Wire in: in the shell component, call
useIdle({ enabled: sessionTimeout.enabled, idleMs, heartbeatMs, heartbeatUrl: "/api/session/heartbeat" })and render<SessionLockOverlay isIdle={isIdle} />alongside the existingmfaScreen/ITAR blocking screens. WhenisIdle, render the overlay INSTEAD OF / on top of theOutletso content is concealed even on a same-pathname navigation (the server enforcement in Task 4 is the boundary; this overlay is the immediate concealment). - Keep it inert when
!sessionTimeout.enabled— non-controlled deployments see nothing.
Verify:
pnpm exec turbo run typecheck --filter=erp
pnpm exec turbo run typecheck --filter=mes
pnpm run lint
# Expected: typecheck + biome pass
Out of scope: Do not change the MFA/ITAR blocking screens. Do not add the overlay to non-x+ routes (public routes have no session shell).
Task 9: MES console idle-lock (tighten pin-in window under CUI)
Depends on: none (independent console mechanism) Files:
- Modify:
apps/mes/app/services/console.server.ts— make the pin-in idle windowSESSION_IDLE_LOCK_MSunderCONTROLLED_ENVIRONMENT(currently fixed 1h,CONSOLE_PIN_MAX_AGE). - Modify:
packages/auth/src/services/auth.server.ts:187-194—getEffectiveUserreads the pin cookie with a hard-coded3600000(1h) expiry; apply the same tightening so the server drops an idle operator to "not pinned in". - Modify:
apps/mes/app/components/PinInOverlay.tsx— surface the pin-in overlay afterSESSION_IDLE_LOCK_MSof idle when controlled (reuse theuseIdlehook from Task 7 to trigger re-display). - Copy from (precedent): the existing
getConsolePinInexpiry check (console.server.ts:29-30) andgetEffectiveUser(auth.server.ts:190-194).
Steps:
- In
console.server.ts, replace the fixedCONSOLE_PIN_MAX_AGE_MSused ingetConsolePinIn's elapsed check withCONTROLLED_ENVIRONMENT ? SESSION_IDLE_LOCK_MS : CONSOLE_PIN_MAX_AGE_MS. Import both from@carbon/auth. Keep the cookiemaxAgeonsetConsolePinInas-is (the manual elapsed check is the tightening point; a shorter maxAge would also work but the elapsed check is the defense-in-depth already there). - In
getEffectiveUser(auth.server.ts:190-194), replace the literal3600000withCONTROLLED_ENVIRONMENT ? SESSION_IDLE_LOCK_MS : 3600000so the server-side effective-user resolution matches. ImportCONTROLLED_ENVIRONMENT+SESSION_IDLE_LOCK_MS. - In
PinInOverlay.tsx, useuseIdle(enabled only when controlled + console) so that after 15 min idle the overlay re-appears (operator must re-PIN). If the existing overlay is already shown whenever no operator is pinned in, the tightened server expiry (steps 1–2) may be sufficient on the next navigation; add the clientuseIdletrigger so concealment is immediate rather than waiting for a request. If the existing pin-in display logic already reacts to "no pinned-in user", wireisIdleto force that state. - Escape hatch: if
CONTROLLED_ENVIRONMENT/SESSION_IDLE_LOCK_MScannot be imported intoconsole.server.tswithout a circular import, STOP and report — fall back to readingSESSION_IDLE_LOCK_MSvia a small constant duplicated with a comment rather than breaking the build.
Verify:
pnpm exec turbo run typecheck --filter=mes
pnpm exec turbo run typecheck --filter=@carbon/auth
# Expected: both pass
Out of scope: Do not force the console DEVICE session to re-login (spec D8 — device exempt from the 12h cap; Task 4 already skips authSession.console). Do not change how PINs are stored/verified (console.pin-in.tsx).
Task 10: Browser verification via /test
Depends on: Tasks 1–9 Files: none (verification only)
Steps:
- This feature is gated on
CONTROLLED_ENVIRONMENT, which is NOT set in normal local dev. To verify, boot the stack withCONTROLLED_ENVIRONMENT=true(via the.env#forceescape hatch documented in.claude/rules/environment-configuration.md, socrbn upwon't overwrite it), then run/test. - Verify against the spec Acceptance Criteria, at minimum:
- Idle 15 min (temporarily lower
SESSION_IDLE_LOCK_MSto ~30s for the test run, or drive via the hook) → lock overlay conceals content. - Active mouse/keyboard → never locks; leaving the tab idle with only background traffic → DOES lock (proves request-time is not the activity signal).
- Unlock with a valid TOTP → resumes the same page; wrong code → stays locked.
curlwith an idle-expired cookie → redirected to/unlock, no protected data.- Absolute cap → terminates to
/loginregardless of activity. - Cross-tab lock propagation.
CONTROLLED_ENVIRONMENTunset → no lock, identical to today.- MES console → pin-in re-PIN after idle; device not force-logged-out.
- Capture agent-browser screenshots of the lock overlay + unlock for the PR (per the surface-designs-with-screenshots convention).
- Idle 15 min (temporarily lower
- If the stack cannot boot with the controlled flag, the loop is BLOCKED (not done) — report per the loop-proof philosophy.
Verify:
# Full typecheck of touched packages + lint before calling done:
pnpm exec turbo run typecheck --filter=@carbon/auth --filter=@carbon/env --filter=erp --filter=mes
pnpm run lint
pnpm --filter @carbon/auth test
# Expected: all pass; acceptance criteria demonstrated in the browser with screenshots.
Out of scope: Do not restore any temporarily-lowered constant without noting it; ship the real 15 min / 12 h values.