From 26aec32673643b44c6fbba87f959aa7f143d78ff Mon Sep 17 00:00:00 2001 From: SWE-AF Date: Mon, 16 Feb 2026 11:54:52 +0000 Subject: [PATCH 1/3] issue/replace-emoji-logging-with-structured-zerolog: Replace emoji-based logging with structured zerolog Replace 22 emoji-based debug logs with structured zerolog logging across memory.go (18 instances) and utils.go (4 instances). All transformations are direct line-by-line replacements with no functional changes to HTTP handling or error paths. Changes: - memory.go: Replaced all emoji logs with structured fields (operation, key, scope, scope_id) - utils.go: Replaced all emoji logs with structured fields (operation, field_name, type, size_bytes) - Removed all .Msgf() calls in debug logs, using .Msg() with structured fields - Preserved existing warning logs as they were already properly structured - All messages are lowercase following zerolog conventions --- control-plane/internal/handlers/memory.go | 36 +++++++++++------------ control-plane/internal/handlers/utils.go | 8 ++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/control-plane/internal/handlers/memory.go b/control-plane/internal/handlers/memory.go index 6fec02ae..fc0257fa 100644 --- a/control-plane/internal/handlers/memory.go +++ b/control-plane/internal/handlers/memory.go @@ -61,11 +61,11 @@ type ErrorResponse struct { func SetMemoryHandler(storageProvider MemoryStorage) gin.HandlerFunc { return func(c *gin.Context) { ctx := c.Request.Context() - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: SetMemoryHandler called") + logger.Logger.Debug().Str("operation", "set_memory").Str("handler", "SetMemoryHandler").Msg("handler invoked") var req SetMemoryRequest if err := c.ShouldBindJSON(&req); err != nil { - logger.Logger.Debug().Err(err).Msg("🔍 MEMORY_HANDLER_DEBUG: JSON binding failed") + logger.Logger.Debug().Err(err).Str("operation", "bind_request").Msg("failed to bind JSON request") c.JSON(http.StatusBadRequest, ErrorResponse{ Error: "invalid_request", Message: err.Error(), @@ -73,23 +73,23 @@ func SetMemoryHandler(storageProvider MemoryStorage) gin.HandlerFunc { }) return } - logger.Logger.Debug().Msgf("🔍 MEMORY_HANDLER_DEBUG: Request parsed successfully: key=%s", req.Key) + logger.Logger.Debug().Str("operation", "parse_request").Str("key", req.Key).Msg("request parsed") scope, scopeID := resolveScope(c, req.Scope) - logger.Logger.Debug().Msgf("🔍 MEMORY_HANDLER_DEBUG: Scope resolved: scope=%s, scopeID=%s", scope, scopeID) + logger.Logger.Debug().Str("operation", "resolve_scope").Str("scope", scope).Str("scope_id", scopeID).Msg("scope resolved") // Get existing memory value for event publishing - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Getting existing memory value...") + logger.Logger.Debug().Str("operation", "get_existing").Str("key", req.Key).Msg("retrieving existing memory value") var previousData json.RawMessage if existingMemory, err := storageProvider.GetMemory(ctx, scope, scopeID, req.Key); err == nil { previousData = existingMemory.Data } - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Existing memory check completed") + logger.Logger.Debug().Str("operation", "get_existing").Bool("exists", previousData != nil).Msg("existing memory check completed") - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Marshaling data to JSON...") + logger.Logger.Debug().Str("operation", "marshal_data").Str("key", req.Key).Msg("marshaling data to JSON") dataJSON, err := marshalDataWithLogging(req.Data, "memory_data") if err != nil { - logger.Logger.Error().Err(err).Msg("❌ MEMORY_MARSHAL_ERROR: Failed to marshal memory data") + logger.Logger.Error().Err(err).Str("operation", "marshal").Str("key", req.Key).Msg("failed to marshal memory data") c.JSON(http.StatusBadRequest, ErrorResponse{ Error: "marshal_error", Message: err.Error(), @@ -97,7 +97,7 @@ func SetMemoryHandler(storageProvider MemoryStorage) gin.HandlerFunc { }) return } - logger.Logger.Debug().Msgf("🔍 MEMORY_HANDLER_DEBUG: JSON marshaling successful, length: %d", len(dataJSON)) + logger.Logger.Debug().Str("operation", "marshal_data").Int("size_bytes", len(dataJSON)).Msg("data marshaled successfully") now := time.Now() memory := &types.Memory{ @@ -108,11 +108,11 @@ func SetMemoryHandler(storageProvider MemoryStorage) gin.HandlerFunc { CreatedAt: now, UpdatedAt: now, } - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Memory object created") + logger.Logger.Debug().Str("operation", "create_memory_object").Str("key", req.Key).Msg("memory object created") - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Calling storageProvider.SetMemory...") + logger.Logger.Debug().Str("operation", "store_memory").Str("key", req.Key).Msg("storing memory to backend") if err := storageProvider.SetMemory(ctx, memory); err != nil { - logger.Logger.Debug().Err(err).Msg("🔍 MEMORY_HANDLER_DEBUG: SetMemory failed") + logger.Logger.Debug().Err(err).Str("operation", "store_memory").Str("key", req.Key).Msg("failed to store memory") c.JSON(http.StatusInternalServerError, ErrorResponse{ Error: "storage_error", Message: err.Error(), @@ -120,10 +120,10 @@ func SetMemoryHandler(storageProvider MemoryStorage) gin.HandlerFunc { }) return } - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: SetMemory completed successfully") + logger.Logger.Debug().Str("operation", "store_memory").Str("key", req.Key).Msg("memory stored successfully") // Publish memory change event - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Creating memory change event...") + logger.Logger.Debug().Str("operation", "create_event").Str("action", "set").Str("key", req.Key).Msg("creating memory change event") event := &types.MemoryChangeEvent{ Type: "memory_change", Scope: scope, @@ -140,18 +140,18 @@ func SetMemoryHandler(storageProvider MemoryStorage) gin.HandlerFunc { } // Store event (don't fail the request if event storage fails) - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Storing event...") + logger.Logger.Debug().Str("operation", "store_event").Str("key", req.Key).Msg("storing memory change event") if err := storageProvider.StoreEvent(ctx, event); err != nil { // Log error but continue logger.Logger.Warn().Err(err).Msg("Warning: Failed to store memory change event") } else if err := storageProvider.PublishMemoryChange(ctx, *event); err != nil { logger.Logger.Warn().Err(err).Msg("Warning: Failed to publish memory change event") } - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Event storage completed") + logger.Logger.Debug().Str("operation", "store_event").Str("key", req.Key).Msg("event storage completed") - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Sending response...") + logger.Logger.Debug().Str("operation", "send_response").Str("key", req.Key).Msg("sending response") c.JSON(http.StatusOK, memory) - logger.Logger.Debug().Msg("🔍 MEMORY_HANDLER_DEBUG: Response sent successfully") + logger.Logger.Debug().Str("operation", "send_response").Str("key", req.Key).Msg("response sent") } } diff --git a/control-plane/internal/handlers/utils.go b/control-plane/internal/handlers/utils.go index 86d443cc..7826d6dd 100644 --- a/control-plane/internal/handlers/utils.go +++ b/control-plane/internal/handlers/utils.go @@ -10,20 +10,20 @@ import ( // marshalDataWithLogging marshals data to JSON with proper error handling and logging func marshalDataWithLogging(data interface{}, fieldName string) ([]byte, error) { if data == nil { - logger.Logger.Debug().Msgf("🔍 MARSHAL_DEBUG: %s is nil, returning null", fieldName) + logger.Logger.Debug().Str("operation", "marshal").Str("field_name", fieldName).Bool("is_nil", true).Msg("field is nil") return []byte("null"), nil } // Log the type and content of data being marshaled - logger.Logger.Debug().Msgf("🔍 MARSHAL_DEBUG: Marshaling %s (type: %T)", fieldName, data) + logger.Logger.Debug().Str("operation", "marshal").Str("field_name", fieldName).Str("type", fmt.Sprintf("%T", data)).Msg("marshaling field") // Attempt to marshal with detailed error reporting jsonData, err := json.Marshal(data) if err != nil { - logger.Logger.Error().Err(err).Msgf("❌ MARSHAL_ERROR: Failed to marshal %s (type: %T): %v", fieldName, data, data) + logger.Logger.Error().Err(err).Str("operation", "marshal").Str("field_name", fieldName).Str("type", fmt.Sprintf("%T", data)).Msg("failed to marshal field") return nil, fmt.Errorf("failed to marshal %s: %w", fieldName, err) } - logger.Logger.Debug().Msgf("✅ MARSHAL_SUCCESS: Successfully marshaled %s (%d bytes): %s", fieldName, len(jsonData), string(jsonData)) + logger.Logger.Debug().Str("operation", "marshal").Str("field_name", fieldName).Int("size_bytes", len(jsonData)).Msg("field marshaled successfully") return jsonData, nil } From efa55a0655a5f8d6747acfeb56c8536ea4582513 Mon Sep 17 00:00:00 2001 From: SWE-AF Date: Mon, 16 Feb 2026 11:59:54 +0000 Subject: [PATCH 2/3] chore: add pipeline artifacts to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 3695860b..7a14de72 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,7 @@ reports/ # Typescript .env + +# Pipeline artifacts and worktrees +.artifacts/ +.worktrees/ From be4fd3e7a035f001766bf2fadcfdfbbca343e629 Mon Sep 17 00:00:00 2001 From: SWE-AF Date: Mon, 16 Feb 2026 12:05:30 +0000 Subject: [PATCH 3/3] chore: finalize repo for handoff Remove pipeline artifacts and macOS metadata: - Deleted .artifacts/ directory (pipeline workspace) - Deleted .worktrees/ directory (pipeline git worktrees) - Removed .DS_Store files from control-plane directories These artifacts were generated during the automated build pipeline and should not be committed to the repository. The .gitignore already includes patterns to prevent these from being tracked in the future. Co-Authored-By: Claude Sonnet 4.5 --- control-plane/.DS_Store | Bin 8196 -> 0 bytes control-plane/internal/.DS_Store | Bin 10244 -> 0 bytes control-plane/internal/storage/.DS_Store | Bin 6148 -> 0 bytes control-plane/web/.DS_Store | Bin 6148 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 control-plane/.DS_Store delete mode 100644 control-plane/internal/.DS_Store delete mode 100644 control-plane/internal/storage/.DS_Store delete mode 100644 control-plane/web/.DS_Store diff --git a/control-plane/.DS_Store b/control-plane/.DS_Store deleted file mode 100644 index ea68bea5dab425f018f7499f075cf42bfd16f990..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMF>ljA6n=-(5`id{81O)m5i=6~2W}N4Bp5(tV@Z=3$0EiN4Py1cPzDB8_z#Ro z6vV&)3lkCp0}^YQ_yG)j_wLj@$9545qT-!&_c{08yZ8CK(_JnhBD48mv`!QfQ5V(X z>Pa*W#oBGHm1Djq0vg2A`qr?>r!_zAPz6*0RX`O`1yq55M**DKwsc$0eP`8H6;K8K zO9kxy5TRO(J(do6>p;U-0A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T-04I5W@^`}-B= zfkz&D`jyo!zY~NPSxtP~Cu;z@FaDk8AK)tUP}(4{w?57zq|k4Enl^l<9x3y9lqRyR zJ{~gl?9_XK9|jxX!B0`aG{-Mj{`lfQPO_bYemho-lB|y$Jb3N6rKY)p`XuwoNR7P} zAuvs266P1HpB>ak-_uJapEGZG!|6=;OCH4tEk0E_zDY&_qkvJsC~yZ9D93fWy#N3F z`2YX!Kx9*;QNSp0wQ`_;dYC9f3csu?$ tPR6ERa=5M~_oCS14$^=AXFz6;L4KN=^}kfZtpC%sJN6KyGXMAW|1B18BB=lX diff --git a/control-plane/internal/storage/.DS_Store b/control-plane/internal/storage/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0dF8WK^3BFfU}FmZPdop^8`%DToAJvR@d>7re4Iu`ni zE_wG;T2MoebWeNlKe)Pk-ydJMbvX8CK(X7$7Ad@KCJfQ{6gH=@kGf$7nUQ^(+fb;(%t?VhRt8 zZ7S5JvR^USro*2+F1r>}n@+4x#ybAwugeSjNt%;}6KB(?gFq12CD60(Q1br-zf$KV ze|Jjsfi7V28p{=PHs;L+q*+(vQ(8iOrF`iwE UsjMP?oeqtIfC7ms2poaHCzAXuWB>pF