From 4d00e8f9ce425cb29a0ebdb477f7c22491435da9 Mon Sep 17 00:00:00 2001 From: Renato Alcara Date: Mon, 27 Apr 2026 01:03:27 -0300 Subject: [PATCH] docs(audit): clean 2 more stale circuit-breaker mentions found in /audit - structured-logger.ts header bullet "External system integration via hooks with circuit breaker" -> updated to describe current fire-and-forget hook semantics + hookFailures metric counter. - retry-utils.ts retryConfigs.rsocket comment referenced the prometheus-metrics -> circuit-breaker.ts circular import chain. circuit-breaker.ts is gone; trimmed the parenthetical to keep just the core reasoning (avoid ESM init-order issues via prometheus-metrics). No code change. Build clean, 35/35 suites, 809/809 tests pass. --- src/Utils/retry-utils.ts | 5 ++--- src/Utils/structured-logger.ts | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Utils/retry-utils.ts b/src/Utils/retry-utils.ts index 2907ea19..2b85549e 100644 --- a/src/Utils/retry-utils.ts +++ b/src/Utils/retry-utils.ts @@ -526,9 +526,8 @@ export const retryConfigs = { * Uses fixed delay array: 1s, 2s, 5s, 10s, 20s (with ±15% jitter) * * NOTE: Values are hardcoded instead of referencing RETRY_BACKOFF_DELAYS/RETRY_JITTER_FACTOR - * to prevent "Cannot access before initialization" errors in ESM environments. - * This occurs when modules are loaded in specific orders due to indirect circular imports - * (e.g., via prometheus-metrics.ts -> circuit-breaker.ts chain). + * to prevent "Cannot access before initialization" errors in ESM environments + * caused by indirect circular imports through prometheus-metrics.ts. * Keep these values in sync with the constants above (lines 25, 31). */ rsocket: { diff --git a/src/Utils/structured-logger.ts b/src/Utils/structured-logger.ts index c69a2596..371ddc32 100644 --- a/src/Utils/structured-logger.ts +++ b/src/Utils/structured-logger.ts @@ -6,7 +6,9 @@ * - Configurable log levels (trace, debug, info, warn, error, fatal) * - JSON formatting for log analysis * - Hierarchical context with child loggers - * - External system integration via hooks with circuit breaker + * - External system integration via fire-and-forget hooks (failures + * counted in hookFailures metric; no per-hook circuit breaker — chronic + * breakage is visible to operators via the metric) * - Logging metrics with Prometheus integration * - Sensitive data sanitization * - Log buffering for batch writes