local-auth-feature-flag.mjs
sha256:c2dbf04d56308f3bbf2d06e6d2eb022b8948b1e827195fe525a44e5e18d5f9c0
feat(auth): Phase B Connect cloud agent (RFC 8628) + Hermes…
Human
minor
⚠ breaking
11 days ago
| 1 | /** |
| 2 | * Phase 8 P1b-b — compile-time feature flag for offline-locked auth code paths. |
| 3 | * Double-lock with KNOWTATION_OFFLINE_LOCKED_AUTH env gate (§11). |
| 4 | * Remains `false` until a separate Tier 3 authorization flips it after tests green. |
| 5 | */ |
| 6 | |
| 7 | /** @type {boolean} Flipped true in P1b-c after seven-tier tests green (Tier 3). */ |
| 8 | export const OFFLINE_LOCKED_AUTH_CODE_SHIPPED = true; |
| 9 | |
| 10 | /** |
| 11 | * Whether offline-locked auth is fully active (env gate + compile-time flag). |
| 12 | * Tests may set KNOWTATION_OFFLINE_LOCKED_AUTH_TEST_SHIPPED=1 to exercise gate-on paths |
| 13 | * without changing the shipped constant. |
| 14 | * @param {boolean} envGateEnabled - cached boot-time env gate boolean |
| 15 | * @returns {boolean} |
| 16 | */ |
| 17 | export function isOfflineLockedAuthActive(envGateEnabled) { |
| 18 | if (!envGateEnabled) return false; |
| 19 | if (OFFLINE_LOCKED_AUTH_CODE_SHIPPED) return true; |
| 20 | if ( |
| 21 | process.env.NODE_ENV === 'test' && |
| 22 | process.env.KNOWTATION_OFFLINE_LOCKED_AUTH_TEST_SHIPPED === '1' |
| 23 | ) { |
| 24 | return true; |
| 25 | } |
| 26 | return false; |
| 27 | } |
File History
1 commit
sha256:93bcf8f9bd56d8c5b9339f4ec73b9ebd66571398d56262d38eedc2cfa9db9882
fix(test): align Band B landing assertion with desktop MCP …
Human
11 days ago