From 4617dbbab37d9a4f1d14bdba5ed3b0db6fe59902 Mon Sep 17 00:00:00 2001 From: PakitoSec Date: Fri, 6 Feb 2026 21:11:39 +0100 Subject: [PATCH] fix: update comment merging logic and bump wcwidth version to 0.6.0 --- src/cyvest/investigation.py | 9 +++------ uv.lock | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/cyvest/investigation.py b/src/cyvest/investigation.py index 57bfdbe..a6a3beb 100644 --- a/src/cyvest/investigation.py +++ b/src/cyvest/investigation.py @@ -494,7 +494,7 @@ def _merge_threat_intel(self, existing: ThreatIntel, incoming: ThreatIntel) -> T - Update score (take maximum) - Update level (take maximum) - Update extra (merge dicts) - - Concatenate comments + - Overwrite comment (if incoming is non-empty) - Merge taxonomies Args: @@ -519,12 +519,9 @@ def _merge_threat_intel(self, existing: ThreatIntel, incoming: ThreatIntel) -> T # Update extra (merge dictionaries) existing.extra.update(incoming.extra) - # Concatenate comments + # Overwrite comment if incoming is non-empty if incoming.comment: - if existing.comment: - existing.comment += "\n\n" + incoming.comment - else: - existing.comment = incoming.comment + existing.comment = incoming.comment # Merge taxonomies (ensure unique names) existing_by_name: dict[str, int] = {taxonomy.name: idx for idx, taxonomy in enumerate(existing.taxonomies)} diff --git a/uv.lock b/uv.lock index 60e590b..8179705 100644 --- a/uv.lock +++ b/uv.lock @@ -1610,11 +1610,11 @@ wheels = [ [[package]] name = "wcwidth" -version = "0.5.3" +version = "0.6.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c2/62/a7c072fbfefb2980a00f99ca994279cb9ecf310cb2e6b2a4d2a28fe192b3/wcwidth-0.5.3.tar.gz", hash = "sha256:53123b7af053c74e9fe2e92ac810301f6139e64379031f7124574212fb3b4091", size = 157587, upload-time = "2026-01-31T03:52:10.92Z" } +sdist = { url = "https://files.pythonhosted.org/packages/35/a2/8e3becb46433538a38726c948d3399905a4c7cabd0df578ede5dc51f0ec2/wcwidth-0.6.0.tar.gz", hash = "sha256:cdc4e4262d6ef9a1a57e018384cbeb1208d8abbc64176027e2c2455c81313159", size = 159684, upload-time = "2026-02-06T19:19:40.919Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/3c/c1/d73f12f8cdb1891334a2ccf7389eed244d3941e74d80dd220badb937f3fb/wcwidth-0.5.3-py3-none-any.whl", hash = "sha256:d584eff31cd4753e1e5ff6c12e1edfdb324c995713f75d26c29807bb84bf649e", size = 92981, upload-time = "2026-01-31T03:52:09.14Z" }, + { url = "https://files.pythonhosted.org/packages/68/5a/199c59e0a824a3db2b89c5d2dade7ab5f9624dbf6448dc291b46d5ec94d3/wcwidth-0.6.0-py3-none-any.whl", hash = "sha256:1a3a1e510b553315f8e146c54764f4fb6264ffad731b3d78088cdb1478ffbdad", size = 94189, upload-time = "2026-02-06T19:19:39.646Z" }, ] [[package]]