/** * Local control for the dormant event-sync wiring, area storage, and the * parallel coordinator. * * U15 removes client-side positive selectors. Environment values, tenant IDs, * and cached identity cannot grant event-sync authority; the authenticated * server inventory is the sole positive authority. This module preserves only * the operator's local off-switch for event sync. * * HQ_SYNC_AREA_STORAGE and HQ_SYNC_PARALLEL_COORDINATOR are tri-state kill * switches, not opt-in canaries: * * - explicit truthy ("1", "true", "yes", "on") → force enable * - explicit falsy ("0", "false", "no", "off") → force disable * - unset, empty, "auto", or any other value → AUTO * * AUTO cannot be decided from the environment alone. Area storage is enabled * iff the durable layout phase for that journal is `area-authoritative` * (`resolveAreaLayoutAuthority` returns `"areas"`). The parallel coordinator * follows effective area storage (post-cutover). Feature-flag resolution is * often consulted where the journal slug or state dir is not in hand, so * {@link resolveParallelSyncRollout} stays env-pure: its booleans are force-on * only, and AUTO is applied by {@link resolveAreaStorageEnabled} / * {@link resolveParallelCoordinatorEnabled} / {@link resolveEffectiveParallelSyncRollout} * at call sites that already know the layout authority. */ /** A local-only kill switch. Any other value is deliberately non-authorizing. */ export declare const EVENT_SYNC_LOCAL_DISABLE_ENV_VAR = "HQ_SYNC_EVENT_SYNC"; /** * Tri-state control for coordinator-owned realtime/chore admission. * * Default AUTO enables the parallel coordinator iff area storage is * effectively enabled (post-cutover). Explicit falsy force-disables. */ export declare const PARALLEL_COORDINATOR_ENV_VAR = "HQ_SYNC_PARALLEL_COORDINATOR"; /** * Tri-state control for the area-backed journal layout. * * Default AUTO enables area storage iff the durable layout phase is * `area-authoritative`. Explicit falsy force-disables. */ export declare const AREA_STORAGE_ENV_VAR = "HQ_SYNC_AREA_STORAGE"; /** Env-only parse of the area-storage / parallel-coordinator kill switches. */ export type FeatureSwitch = "on" | "off" | "auto"; export type ParallelSyncRollout = { areaStorage: FeatureSwitch; parallelExecution: FeatureSwitch; /** * Force-on only. AUTO remains false so this helper can stay env-pure; * apply {@link resolveAreaStorageEnabled} where the journal authority is known. */ areaStorageEnabled: boolean; /** * Force-on only. AUTO remains false so this helper can stay env-pure; * apply {@link resolveParallelCoordinatorEnabled} after area storage is resolved. */ parallelExecutionEnabled: boolean; /** The binary/layout path selected when the execution kill switch is off. */ executionMode: "parallel" | "dual-layout-serialized-bridge"; }; /** * Parse a tri-state kill switch. Only the documented truthy/falsy tokens * force a side; everything else, including unset, is AUTO. */ export declare function parseFeatureSwitch(value: string | undefined): FeatureSwitch; /** True only for an explicit force-on value. AUTO is not enabled at this layer. */ export declare function isParallelCoordinatorEnabled(value: string | undefined): boolean; /** True only for an explicit force-on value. AUTO is not enabled at this layer. */ export declare function isAreaStorageEnabled(value: string | undefined): boolean; /** * Resolve area storage once the durable layout authority is known. * AUTO follows `"areas"`; `"on"` force-enables; `"off"` is the kill switch. */ export declare function resolveAreaStorageEnabled(areaStorage: FeatureSwitch, authority: "legacy" | "areas"): boolean; /** * Resolve the parallel coordinator once effective area storage is known. * AUTO follows area storage (post-cutover); `"on"` force-enables; `"off"` * is the kill switch. */ export declare function resolveParallelCoordinatorEnabled(parallelExecution: FeatureSwitch, areaStorageEnabled: boolean): boolean; /** * Resolve the two independently-operated rollout controls from the environment * only. AUTO is reported on the switch fields; the booleans stay force-on so * this helper remains pure where no journal state dir is in hand. */ export declare function resolveParallelSyncRollout(env?: Record): ParallelSyncRollout; /** * Apply AUTO using a known layout authority. Env parse stays identical to * {@link resolveParallelSyncRollout}; only the booleans and executionMode * change to the phase-dependent decision. */ export declare function resolveEffectiveParallelSyncRollout(authority: "legacy" | "areas", env?: Record): ParallelSyncRollout; /** * Compatibility seam consumed by the existing emitter. Production event-sync * supplies it only after authenticated server inventory has granted access. */ export interface EventDrivenPushFlagProvider { isEnabled(scopeId: string): boolean; } /** * Returns true only for an explicit local disable value. Values such as * `true`, `1`, a tenant list, or an unrecognized string never enable sync. */ export declare function isEventSyncLocallyDisabled(value: string | undefined): boolean; //# sourceMappingURL=feature-flags.d.ts.map