From 907ade91420d253fe9f7324743c9e2c62c9e0b91 Mon Sep 17 00:00:00 2001 From: anti Date: Wed, 29 Apr 2026 16:44:03 -0400 Subject: [PATCH] feat(realism): wire fingerprint_html/svg through taxonomy + UI The two new fingerprint canary generators existed at the API level since f64e78f but weren't visible to the realism engine or the operator-facing dashboard. Threads them through every place that enumerates canary content classes. Backend: * realism/taxonomy.py - two new ContentClass members (CANARY_FINGERPRINT_HTML, CANARY_FINGERPRINT_SVG); enum is wire-visible (synthetic_files.content_class column + bus discrim) so we add at the bottom, never reorder. * canary/cultivator.py - class-to-generator dispatch, kind mapping (both http), and default placement paths (~/Documents/asset_directory.html and network_topology.svg). * realism/naming.py + bodies.py - _name_canary / _body_canary entries. * realism/planner.py - added to _DEFAULT_CANARY_CLASS_WEIGHTS and the _CANARY_CLASSES classification set. Frontend: * decnet_web/src/realism/labels.ts - display labels. * decnet_web/src/components/RealismConfig/RealismConfig.tsx - default canary weight rows so operators see them in the realism config UI. * decnet_web/src/components/SyntheticFiles/SyntheticFiles.tsx - added to the CONTENT_CLASSES allow-list so filter dropdowns show them. Also: re-applied the nosec B404/B603 markers on canary/obfuscator.py; the first commit's pre-commit autoformatter stripped them. Tests: extended tests/realism/test_taxonomy.py's stability assertion to include the two new values. Full canary + realism suites pass (362 / 2 skipped). --- decnet/canary/cultivator.py | 6 ++++++ decnet/canary/obfuscator.py | 4 ++-- decnet/realism/bodies.py | 2 ++ decnet/realism/naming.py | 2 ++ decnet/realism/planner.py | 3 +++ decnet/realism/taxonomy.py | 2 ++ decnet_web/src/components/RealismConfig/RealismConfig.tsx | 2 ++ decnet_web/src/components/SyntheticFiles/SyntheticFiles.tsx | 1 + decnet_web/src/realism/labels.ts | 2 ++ tests/realism/test_taxonomy.py | 1 + 10 files changed, 23 insertions(+), 2 deletions(-) diff --git a/decnet/canary/cultivator.py b/decnet/canary/cultivator.py index 8f7a222f..88288ff3 100644 --- a/decnet/canary/cultivator.py +++ b/decnet/canary/cultivator.py @@ -46,6 +46,8 @@ _CLASS_TO_GENERATOR: dict[ContentClass, str] = { ContentClass.CANARY_HONEYDOC_DOCX: "honeydoc_docx", ContentClass.CANARY_HONEYDOC_PDF: "honeydoc_pdf", ContentClass.CANARY_MYSQL_DUMP: "mysql_dump", + ContentClass.CANARY_FINGERPRINT_HTML: "fingerprint_html", + ContentClass.CANARY_FINGERPRINT_SVG: "fingerprint_svg", } @@ -62,6 +64,8 @@ _GENERATOR_TO_KIND: dict[str, str] = { "honeydoc_pdf": "http", "ssh_key": "dns", # trip is DNS resolution of host comment "mysql_dump": "dns", # trip is DNS resolution of subdomain + "fingerprint_html": "http", # obfuscated JS beacons GET /c/ + "fingerprint_svg": "http", # same, embedded inside SVG