From 073a7da9ec440842cfded70e81d2a5cb4db02c44 Mon Sep 17 00:00:00 2001 From: busya Date: Wed, 27 May 2026 10:09:12 +0300 Subject: [PATCH] fix: change reason() and reflect() from DEBUG to INFO level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per molecular CoT protocol: REASON and REFLECT are primary reasoning bonds and must be visible at INFO level in production. DEBUG is reserved for high-frequency loops. - reason(): self.debug() → self.info() - reflect(): self.debug() → self.info() - explore(): stays at warning() (WARNING level) - Also removed redundant logger.info() calls in lifespan (now reason() itself provides visible startup logging) --- backend/src/core/logger.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/backend/src/core/logger.py b/backend/src/core/logger.py index ff8e4b02..ed37d40e 100755 --- a/backend/src/core/logger.py +++ b/backend/src/core/logger.py @@ -280,8 +280,10 @@ def explore(self, msg, *args, **kwargs): # #endregion explore -# #region reason [C:2] [TYPE Function] [SEMANTICS log,reason,marker,debug] -# @BRIEF Logs a REASON marker (DEBUG level) with structured extra data for CotJsonFormatter. +# #region reason [C:2] [TYPE Function] [SEMANTICS log,reason,marker,info] +# @BRIEF Logs a REASON marker (INFO level) with structured extra data for CotJsonFormatter. +# @RATIONALE INFO level per molecular CoT protocol: REASON is the primary reasoning bond +# and must be visible in production. DEBUG is reserved for high-frequency loops. def reason(self, msg, *args, **kwargs): """Log a REASON marker — strict deduction, core logic. @@ -293,12 +295,14 @@ def reason(self, msg, *args, **kwargs): if error_val is not None: extra['error'] = error_val extra.update(user_extra) - self.debug(msg, *args, extra=extra, **kwargs) + self.info(msg, *args, extra=extra, **kwargs) # #endregion reason -# #region reflect [C:2] [TYPE Function] [SEMANTICS log,reflect,marker,debug] -# @BRIEF Logs a REFLECT marker (DEBUG level) with structured extra data for CotJsonFormatter. +# #region reflect [C:2] [TYPE Function] [SEMANTICS log,reflect,marker,info] +# @BRIEF Logs a REFLECT marker (INFO level) with structured extra data for CotJsonFormatter. +# @RATIONALE INFO level per molecular CoT protocol: REFLECT verifies outcomes and +# must be visible in production. DEBUG is reserved for high-frequency loops. def reflect(self, msg, *args, **kwargs): """Log a REFLECT marker — self-check, structural validation. @@ -310,7 +314,7 @@ def reflect(self, msg, *args, **kwargs): if error_val is not None: extra['error'] = error_val extra.update(user_extra) - self.debug(msg, *args, extra=extra, **kwargs) + self.info(msg, *args, extra=extra, **kwargs) # #endregion reflect logger.explore = types.MethodType(explore, logger)