From 6fd7a0ee41793c7a5db4e55e445866842b58ca72 Mon Sep 17 00:00:00 2001 From: Ruiming Zhao Date: Sun, 16 Aug 2026 08:34:30 -0700 Subject: [PATCH 1/5] fix(prism): stop treating C++ digit separators as char-literal openers C++14+ allows a single quote inside numeric literals (512'000, 1'000'000'000, 0xDE'AD'BE'EF). The generic literal shield's single-quote branch is unbounded, so a separator quote was read as the start of a char literal and paired with the next stray quote anywhere later in the file -- swallowing every real // and /* */ comment in between as one giant "literal". Comments leaked into the code stream, coding_loc was inflated, and the detector saw comment text. Give C++ its own bounded shield (same 10-char bound #1302 already applies to the recursive_block family) and consume digit-separator quotes as their own alternative so they can never open a span. JS/PHP single-quoted strings keep the unbounded shared pattern -- they legitimately span many chars. Regenerated both golden master fixtures: cpp/godot/editor_node.cpp now strips its "512'000; // 500 KB" comment, so Coding LOC drops and Documentation LOC rises there. Verified with the golden crucible in full-precision and zero-dependency modes, plus 6 new regression tests. --- gitgalaxy/core/prism.py | 41 +- tests/core_engine/test_prism_issue_1718.py | 164 +++++++ tests/golden_master_audit.json | 316 ++----------- tests/golden_master_zero_dep_audit.json | 526 ++++++--------------- 4 files changed, 364 insertions(+), 683 deletions(-) create mode 100644 tests/core_engine/test_prism_issue_1718.py diff --git a/gitgalaxy/core/prism.py b/gitgalaxy/core/prism.py index 1a2e16a1c..70e1f1a54 100644 --- a/gitgalaxy/core/prism.py +++ b/gitgalaxy/core/prism.py @@ -99,6 +99,26 @@ def __init__( # Defends against catastrophic backtracking and logic erosion inside strings self.LITERAL_MASK_PATTERN = PRISM_CONFIG.get("SHIELD_PATTERN", "") + # #1718: C++ (C++14+) uses a single quote as a digit separator inside + # numeric literals (512'000, 1'000'000'000, 0xDE'AD). The shared + # SHIELD_PATTERN's single-quote branch is unbounded, so a separator + # `'` is mistaken for the opening quote of a char literal and pairs + # with the NEXT unrelated `'` anywhere later in the file (re.S lets + # [^'\\] span newlines), swallowing every real // and /* */ comment + # in between as one giant "literal" -- the code stream then carries + # comment text into the detector and coding_loc is inflated. + # C++ char literals are always short ('a', '\n', '\x41', '\''), so + # bounding the branch to 10 chars -- the same bound #1302 already + # applies to the recursive_block shield -- closes the cascade without + # dropping any real literal. Kept per-language because the shared + # pattern must stay unbounded for JS/PHP single-quoted strings. + self.CPP_LITERAL_MASK_PATTERN = ( + r'((? tuple # 3. GENERIC STRIPPER pattern = self.REGEX_MATRIX.get(family) + if lang_id == "cpp" and family == "standard_block": + # #1718: C++ digit separators (512'000) use `'` as a digit + # separator, which the unbounded shared single-quote branch + # misreads as a char literal opener that pairs with the next + # unrelated `'` anywhere later in the file -- swallowing every + # real comment in between. Route C++ through the bounded + # CPP_REGEX_MATRIX so separators can't cascade into a false + # literal (JS/PHP keep the unbounded shared pattern). + pattern = self.CPP_REGEX_MATRIX.get(family) or pattern if not pattern: return text, "\n".join(lits) @@ -339,7 +375,7 @@ def strip_callback(m: re.Match) -> str: code = pattern.sub(strip_callback, text) return code, "\n".join(lits) - def _compile_regex_matrix(self) -> dict[str, re.Pattern]: + def _compile_regex_matrix(self, literal_pattern: Optional[str] = None) -> dict[str, re.Pattern]: """Safely pre-compiles the standard regex matrix based on dynamic config lengths.""" matrix = {} @@ -438,7 +474,8 @@ def _compile_regex_matrix(self) -> dict[str, re.Pattern]: try: # ---> THE FIX: Strip any rogue inline flags injected by the config <--- p = p.replace("(?i)", "").replace("(?m)", "").replace("(?s)", "") - full_pattern = f"{self.LITERAL_MASK_PATTERN}|{p}" + literal_mask = literal_pattern or self.LITERAL_MASK_PATTERN + full_pattern = f"{literal_mask}|{p}" flags = re.S | re.M if fam_key == "line_exclusive": diff --git a/tests/core_engine/test_prism_issue_1718.py b/tests/core_engine/test_prism_issue_1718.py new file mode 100644 index 000000000..14f3bebd0 --- /dev/null +++ b/tests/core_engine/test_prism_issue_1718.py @@ -0,0 +1,164 @@ +from gitgalaxy.core.prism import Prism + +LANG_DEFS = { + "cpp": {"lexical_family": "standard_block"}, + "c": {"lexical_family": "standard_block"}, + "javascript": {"lexical_family": "standard_block"}, + "php": {"lexical_family": "standard_block"}, +} + +CONFIG = { + "lexical_families": { + "standard_block": {"delimiters": ["//", "/*", "*/"]}, + } +} + + +def test_issue_1718_digit_separator_does_not_pair_with_far_away_quote(): + """ + Regression test for #1718: C++ digit separators (512'000, 1'000'000'000) + use a single quote that the unbounded shared literal shield misread as a + char-literal opener, pairing it with the next unrelated `'` anywhere later + in the file -- so every real // and /* */ comment in between was swallowed + as one giant "literal" and never stripped. + """ + prism = Prism(CONFIG, LANG_DEFS) + + code = """ +constexpr long long KB = 512'000; + +// this comment should be stripped +int firstFunction(int x) { + return x + 1; +} + +/* this block comment should be stripped too */ +int secondFunction(int y) { + return y * 2; +} + +char trigger = 'q'; +""" + + result = prism.split_streams(code, "cpp") + + assert "// this comment should be stripped" not in result["code_stream"] # noqa: S101 + assert "/* this block comment should be stripped too */" not in result["code_stream"] # noqa: S101 + assert "firstFunction" in result["code_stream"] # noqa: S101 + assert "secondFunction" in result["code_stream"] # noqa: S101 + assert "512'000" in result["code_stream"] # noqa: S101 + + +def test_issue_1718_hex_and_multiple_digit_separators_kept(): + """Hex (0xDE'AD'BE'EF) and multi-group (1'000'000'000) separators stay intact.""" + prism = Prism(CONFIG, LANG_DEFS) + + code = """ +constexpr unsigned long long V = 0xDE'AD'BE'EF; +constexpr long long LARGE = 1'000'000'000; + +// separator line comment +int first(int a) { return a; } +""" + + result = prism.split_streams(code, "cpp") + + assert "0xDE'AD'BE'EF" in result["code_stream"] # noqa: S101 + assert "1'000'000'000" in result["code_stream"] # noqa: S101 + assert "// separator line comment" not in result["code_stream"] # noqa: S101 + + +def test_issue_1718_comment_apostrophe_within_bound_still_stripped(): + """ + A comment apostrophe close to a digit separator ("it's") must not be + re-paired: the separator is consumed as its own alternative first, so + the comment line is still stripped. + """ + prism = Prism(CONFIG, LANG_DEFS) + + code = """ +int f() { + long long x = 512'000; // it's a lot + return (int)x; +} +""" + + result = prism.split_streams(code, "cpp") + + assert "// it's a lot" not in result["code_stream"] # noqa: S101 + assert "512'000" in result["code_stream"] # noqa: S101 + + +def test_issue_1718_real_char_literals_still_shielded(): + """The bound must not break genuine short char literals -- they stay intact.""" + prism = Prism(CONFIG, LANG_DEFS) + + code = """ +int f() { + char a = 'x'; + char nl = '\n'; + char q = '\''; + return a; +} +""" + + result = prism.split_streams(code, "cpp") + + assert "'x'" in result["code_stream"] # noqa: S101 + assert "'\n'" in result["code_stream"] # noqa: S101 + assert "'''" in result["code_stream"] # noqa: S101 + + +def test_issue_1718_prefixed_u8_char_literal_still_shielded(): + """u8-prefixed char literals must still shield like ordinary ones.""" + prism = Prism(CONFIG, LANG_DEFS) + + code = """ +int f() { + char8_t c = u8'x'; // still a comment + return c == u8'x' ? 1 : 0; +} +""" + + result = prism.split_streams(code, "cpp") + + assert "u8'x'" in result["code_stream"] # noqa: S101 + assert "// still a comment" not in result["code_stream"] # noqa: S101 + + +def test_issue_1718_other_languages_keep_unbounded_single_quotes(): + """ + The fix is scoped to C++ only: JS/PHP (and C) single-quoted strings may be + arbitrarily long and must keep the unbounded shared shield. A long string + containing comment markers must survive whole. + """ + prism = Prism(CONFIG, LANG_DEFS) + + js_code = """ +const s = 'this is a long single-quoted string with // not a comment and /* also not */ inside'; +function foo() { return s; } +""" + + js_result = prism.split_streams(js_code, "javascript") + assert ( + "'this is a long single-quoted string with // not a comment and /* also not */ inside'" + in js_result["code_stream"] + ) # noqa: S101 + + php_code = """ + Date: Sun, 16 Aug 2026 09:04:09 -0700 Subject: [PATCH 2/5] fix(detector): shield C++ digit separators in the detector's own literal pass prism.py gained the C++ digit-separator shield in the previous commit, but the detector's own single-quote literal shielding still treated a separator quote as a char-literal opener and paired it with the next stray quote anywhere later in the file -- blanking real function bodies in between. Without this the tree-sitter accuracy audit regressed on the C++ corpus (found_functions 1376 -> 1350, args_exact_match 1202 -> 1186) and godot/variant.h lost its template-specialization classes. Apply the same bounded pattern (digit separator consumed as its own alternative, char-literal branch bounded to 10 chars) to the detector shield, matching prism.py's CPP_LITERAL_MASK_PATTERN. Regression test covers a separator followed by functions, a comment apostrophe, and a real char literal. --- gitgalaxy/core/detector.py | 10 +++- tests/core_engine/test_detector_issue_1718.py | 46 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 tests/core_engine/test_detector_issue_1718.py diff --git a/gitgalaxy/core/detector.py b/gitgalaxy/core/detector.py index 4d0403fd4..3932402de 100644 --- a/gitgalaxy/core/detector.py +++ b/gitgalaxy/core/detector.py @@ -1888,7 +1888,15 @@ def fast_shield(m): # Rust uses single quotes for lifetimes (e.g. 'a), so a greedy string match corrupts ASTs. single_quote = r"'(?:\\.|[^'\\])*'" - if lang_id in ("rust", "zig"): + if lang_id in ("cpp", "c"): + # #1718: C++14+ digit separators (512'000, 1'000'000, 0xDE'AD) use ' inside + # numeric literals. The unbounded branch read a separator as a char-literal opener + # and paired it with the next unrelated ' anywhere later in the file, blanking every + # real function body in between from the brace scan. Consume separators as their own + # alternative (same shape as prism.py's CPP_LITERAL_MASK_PATTERN) and bound the branch + # to 10 chars, matching #1302/#1426. + single_quote = r"[0-9a-fA-F]'[0-9a-fA-F]|(? Date: Sun, 16 Aug 2026 09:05:43 -0700 Subject: [PATCH 3/5] test: rebless golden masters for the C++ digit-separator shielding The prism + detector digit-separator shields stop separator quotes from pairing with a later apostrophe, so cpp output shifts: godot/editor_node.cpp's '512'000; // 500 KB' comment is no longer swallowed into a fake literal (Coding LOC drops, Documentation LOC rises) and cpp health/impact metrics move accordingly. Regenerated both fixtures via update_golden_master.py; the golden crucible test passes against them. --- tests/golden_master_audit.json | 338 ++++++++++++++- tests/golden_master_zero_dep_audit.json | 548 ++++++++++++++++++------ 2 files changed, 743 insertions(+), 143 deletions(-) diff --git a/tests/golden_master_audit.json b/tests/golden_master_audit.json index 8819175c9..008a18c09 100644 --- a/tests/golden_master_audit.json +++ b/tests/golden_master_audit.json @@ -12,8 +12,8 @@ }, "Target Root Name": "data", "Absolute Project Path": "H:\\deepseek work\\language-crucible\\data", - "Analysis ISO Timestamp": "2026-08-16T15:23:09.631253+00:00", - "Total Scan Duration": "56.09 seconds" + "Analysis ISO Timestamp": "2026-08-16T16:02:35.782159+00:00", + "Total Scan Duration": "34.42 seconds" }, "Source Control Footprint (Immutable Anchor)": { "Active Branch": "HEAD", @@ -198,8 +198,8 @@ "health": { "avg_cognitive_load": 24.698, "avg_safety_score": 38.602, - "avg_tech_debt": 23.313, - "avg_documentation": 21.503 + "avg_tech_debt": 23.315, + "avg_documentation": 21.504 }, "composition": { "xml": { @@ -295,7 +295,7 @@ "cpp": { "files": 33, "loc": 44831, - "impact": 58265.619999999995 + "impact": 58783.01999999999 }, "csharp": { "files": 8, @@ -698,11 +698,11 @@ }, "cpp/godot": { "file_count": 16, - "total_mass": 38201.42, + "total_mass": 38718.82, "avg_exposures": { "cognitive_load": 59.79, "safety_score": 73.57, - "tech_debt": 22.36, + "tech_debt": 22.49, "verification": 55.29, "api_exposure": 5.28, "concurrency": 0.0, @@ -711,7 +711,7 @@ "spec_match": 81.25, "stability": 40.62, "churn": 0.0, - "documentation": 22.72, + "documentation": 22.77, "secrets_risk": 0.0 } }, @@ -14697,7 +14697,7 @@ } }, "cpp/godot": { - "Directory Group Magnitude": 38201.42, + "Directory Group Magnitude": 38718.82, "File Count": 16, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "81.2%", @@ -14706,7 +14706,7 @@ "Average Risk Exposures": { "Cognitive Load Exposure": "59.79%", "Error & Exception Exposure": "73.57%", - "Tech Debt Exposure": "22.36%", + "Tech Debt Exposure": "22.49%", "Testing Exposure": "55.29%", "API Exposure": "5.28%", "Concurrency Exposure": "0.0%", @@ -14715,7 +14715,7 @@ "Specification Exposure": "81.25%", "Instability Exposure": "40.62%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "22.72%", + "Documentation Exposure": "22.77%", "Hardcoded Payload Artifacts": "0.0%" }, "Files": { @@ -15678,18 +15678,18 @@ "Total LOC": 9612, "Coding LOC": 7665, "Documentation LOC": 454, - "Structural Magnitude": 9359.0, + "Structural Magnitude": 9876.4, "Control Flow Ratio": "79.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.388 + "Raw Cognitive Density": 1.386 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "92.37%", - "Error & Exception Exposure": "96.26%", - "Tech Debt Exposure": "95.16%", + "Cognitive Load Exposure": "92.31%", + "Error & Exception Exposure": "96.25%", + "Tech Debt Exposure": "97.25%", "Testing Exposure": "80.0%", "API Exposure": "0.0%", "Concurrency Exposure": "0.0%", @@ -15698,7 +15698,7 @@ "Specification Exposure": "100.0%", "Instability Exposure": "50.0%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "12.76%", + "Documentation Exposure": "13.6%", "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ @@ -15712,6 +15712,16 @@ "Start Line": 3368, "End Line": 3947 }, + { + "Function Name": "EditorNode::_notification", + "Structural Impact": 130.7, + "Lines of Code (LOC)": 322, + "Control Flow Branches": 80, + "Input Parameters": 1, + "Control Flow Ratio": "98.8%", + "Start Line": 855, + "End Line": 1176 + }, { "Function Name": "EditorNode::_edit_current", "Structural Impact": 128.1, @@ -15802,6 +15812,16 @@ "Start Line": 5540, "End Line": 5605 }, + { + "Function Name": "EditorNode::_fs_changed", + "Structural Impact": 60.2, + "Lines of Code (LOC)": 101, + "Control Flow Branches": 38, + "Input Parameters": 1, + "Control Flow Ratio": "82.6%", + "Start Line": 1319, + "End Line": 1419 + }, { "Function Name": "EditorNode::replace_resources_in_object", "Structural Impact": 60.0, @@ -15822,6 +15842,16 @@ "Start Line": 5195, "End Line": 5296 }, + { + "Function Name": "EditorNode::shortcut_input", + "Structural Impact": 55.2, + "Lines of Code (LOC)": 57, + "Control Flow Branches": 36, + "Input Parameters": 1, + "Control Flow Ratio": "97.3%", + "Start Line": 406, + "End Line": 462 + }, { "Function Name": "EditorNode::save_resource_as", "Structural Impact": 49.0, @@ -15862,6 +15892,16 @@ "Start Line": 5055, "End Line": 5139 }, + { + "Function Name": "EditorNode::disambiguate_filenames", + "Structural Impact": 43.5, + "Lines of Code (LOC)": 108, + "Control Flow Branches": 21, + "Input Parameters": 2, + "Control Flow Ratio": "91.3%", + "Start Line": 245, + "End Line": 352 + }, { "Function Name": "EditorNode::set_addon_plugin_enabled", "Structural Impact": 40.8, @@ -15902,6 +15942,16 @@ "Start Line": 2256, "End Line": 2339 }, + { + "Function Name": "EditorNode::_update_from_settings", + "Structural Impact": 31.6, + "Lines of Code (LOC)": 152, + "Control Flow Branches": 16, + "Input Parameters": 1, + "Control Flow Ratio": "88.9%", + "Start Line": 469, + "End Line": 620 + }, { "Function Name": "EditorNode::_dialog_display_load_error", "Structural Impact": 30.6, @@ -16042,6 +16092,16 @@ "Start Line": 2444, "End Line": 2465 }, + { + "Function Name": "EditorNode::_resources_changed", + "Structural Impact": 22.9, + "Lines of Code (LOC)": 34, + "Control Flow Branches": 14, + "Input Parameters": 1, + "Control Flow Ratio": "93.3%", + "Start Line": 1284, + "End Line": 1317 + }, { "Function Name": "EditorNode::get_modified_properties_for_node", "Structural Impact": 22.4, @@ -16062,6 +16122,16 @@ "Start Line": 5351, "End Line": 5382 }, + { + "Function Name": "EditorNode::_update_theme", + "Structural Impact": 22.1, + "Lines of Code (LOC)": 75, + "Control Flow Branches": 12, + "Input Parameters": 1, + "Control Flow Ratio": "92.3%", + "Start Line": 689, + "End Line": 763 + }, { "Function Name": "EditorNode::_next_unsaved_scene", "Structural Impact": 20.3, @@ -16182,6 +16252,16 @@ "Start Line": 6391, "End Line": 6427 }, + { + "Function Name": "EditorNode::update_preview_themes", + "Structural Impact": 17.0, + "Lines of Code (LOC)": 29, + "Control Flow Branches": 10, + "Input Parameters": 1, + "Control Flow Ratio": "83.3%", + "Start Line": 788, + "End Line": 816 + }, { "Function Name": "EditorNode::preload_reimporting_with_path_in_edited_scenes", "Structural Impact": 16.9, @@ -16322,6 +16402,26 @@ "Start Line": 6547, "End Line": 6572 }, + { + "Function Name": "EditorNode::_update_update_spinner", + "Structural Impact": 14.6, + "Lines of Code (LOC)": 38, + "Control Flow Branches": 8, + "Input Parameters": 1, + "Control Flow Ratio": "80.0%", + "Start Line": 1178, + "End Line": 1215 + }, + { + "Function Name": "EditorNode::_is_project_data_missing", + "Structural Impact": 14.5, + "Lines of Code (LOC)": 36, + "Control Flow Branches": 8, + "Input Parameters": 1, + "Control Flow Ratio": "72.7%", + "Start Line": 818, + "End Line": 853 + }, { "Function Name": "EditorNode::get_object_custom_type_base", "Structural Impact": 14.5, @@ -16412,6 +16512,16 @@ "Start Line": 1541, "End Line": 1582 }, + { + "Function Name": "EditorNode::get_editor_theme_native_menu_icon", + "Structural Impact": 13.1, + "Lines of Code (LOC)": 22, + "Control Flow Branches": 5, + "Input Parameters": 3, + "Control Flow Ratio": "62.5%", + "Start Line": 765, + "End Line": 786 + }, { "Function Name": "EditorNode::_feature_profile_changed", "Structural Impact": 13.1, @@ -16572,6 +16682,16 @@ "Start Line": 7691, "End Line": 7706 }, + { + "Function Name": "EditorProgress::EditorProgress", + "Structural Impact": 10.2, + "Lines of Code (LOC)": 9, + "Control Flow Branches": 3, + "Input Parameters": 5, + "Control Flow Ratio": "100.0%", + "Start Line": 227, + "End Line": 235 + }, { "Function Name": "EditorNode::_resources_reimporting", "Structural Impact": 9.9, @@ -16662,6 +16782,16 @@ "Start Line": 5392, "End Line": 5404 }, + { + "Function Name": "EditorNode::_version_control_menu_option", + "Structural Impact": 9.0, + "Lines of Code (LOC)": 10, + "Control Flow Branches": 5, + "Input Parameters": 1, + "Control Flow Ratio": "83.3%", + "Start Line": 354, + "End Line": 363 + }, { "Function Name": "EditorNode::_update_recent_scenes", "Structural Impact": 9.0, @@ -16702,6 +16832,16 @@ "Start Line": 2228, "End Line": 2238 }, + { + "Function Name": "EditorProgress::step", + "Structural Impact": 8.4, + "Lines of Code (LOC)": 8, + "Control Flow Branches": 3, + "Input Parameters": 3, + "Control Flow Ratio": "60.0%", + "Start Line": 218, + "End Line": 225 + }, { "Function Name": "EditorNode::load_scene_or_resource", "Structural Impact": 8.4, @@ -16722,6 +16862,16 @@ "Start Line": 6652, "End Line": 6677 }, + { + "Function Name": "EditorNode::_update_translations", + "Structural Impact": 8.1, + "Lines of Code (LOC)": 21, + "Control Flow Branches": 4, + "Input Parameters": 1, + "Control Flow Ratio": "80.0%", + "Start Line": 634, + "End Line": 654 + }, { "Function Name": "EditorNode::_is_class_editor_disabled_by_feature_profile", "Structural Impact": 8.1, @@ -16902,6 +17052,16 @@ "Start Line": 4804, "End Line": 4822 }, + { + "Function Name": "EditorNode::_update_title", + "Structural Impact": 6.8, + "Lines of Code (LOC)": 17, + "Control Flow Branches": 5, + "Input Parameters": 0, + "Control Flow Ratio": "83.3%", + "Start Line": 365, + "End Line": 381 + }, { "Function Name": "EditorNode::_mark_unsaved_scenes", "Structural Impact": 6.8, @@ -16942,6 +17102,16 @@ "Start Line": 5180, "End Line": 5193 }, + { + "Function Name": "EditorNode::_translation_resources_changed", + "Structural Impact": 6.6, + "Lines of Code (LOC)": 19, + "Control Flow Branches": 3, + "Input Parameters": 1, + "Control Flow Ratio": "75.0%", + "Start Line": 656, + "End Line": 674 + }, { "Function Name": "EditorNode::_load_editor_plugin_states_from_config", "Structural Impact": 6.6, @@ -17002,6 +17172,16 @@ "Start Line": 7755, "End Line": 7766 }, + { + "Function Name": "EditorNode::_remove_plugin_from_enabled", + "Structural Impact": 6.2, + "Lines of Code (LOC)": 11, + "Control Flow Branches": 3, + "Input Parameters": 1, + "Control Flow Ratio": "75.0%", + "Start Line": 1256, + "End Line": 1266 + }, { "Function Name": "EditorNode::_build_icon_type_cache", "Structural Impact": 6.2, @@ -17042,6 +17222,16 @@ "Start Line": 4561, "End Line": 4574 }, + { + "Function Name": "EditorNode::_on_plugin_ready", + "Structural Impact": 5.8, + "Lines of Code (LOC)": 12, + "Control Flow Branches": 2, + "Input Parameters": 2, + "Control Flow Ratio": "50.0%", + "Start Line": 1243, + "End Line": 1254 + }, { "Function Name": "EditorNode::_toggle_distraction_free_mode", "Structural Impact": 5.8, @@ -17072,6 +17262,16 @@ "Start Line": 9580, "End Line": 9611 }, + { + "Function Name": "EditorNode::_plugin_over_edit", + "Structural Impact": 5.7, + "Lines of Code (LOC)": 11, + "Control Flow Branches": 2, + "Input Parameters": 2, + "Control Flow Ratio": "66.7%", + "Start Line": 1268, + "End Line": 1278 + }, { "Function Name": "EditorNode::add_editor_plugin", "Structural Impact": 5.7, @@ -17112,6 +17312,16 @@ "Start Line": 5435, "End Line": 5447 }, + { + "Function Name": "EditorNode::init_plugins", + "Structural Impact": 4.8, + "Lines of Code (LOC)": 16, + "Control Flow Branches": 3, + "Input Parameters": 0, + "Control Flow Ratio": "75.0%", + "Start Line": 1226, + "End Line": 1241 + }, { "Function Name": "EditorNode::_resave_externally_modified_scenes", "Structural Impact": 4.8, @@ -17152,6 +17362,16 @@ "Start Line": 6151, "End Line": 6156 }, + { + "Function Name": "EditorNode::_update_unsaved_cache", + "Structural Impact": 4.7, + "Lines of Code (LOC)": 9, + "Control Flow Branches": 2, + "Input Parameters": 1, + "Control Flow Ratio": "66.7%", + "Start Line": 383, + "End Line": 391 + }, { "Function Name": "EditorNode::clear_node_reference", "Structural Impact": 4.7, @@ -17242,6 +17462,16 @@ "Start Line": 1887, "End Line": 1890 }, + { + "Function Name": "EditorProgress::~EditorProgress", + "Structural Impact": 4.3, + "Lines of Code (LOC)": 7, + "Control Flow Branches": 3, + "Input Parameters": 0, + "Control Flow Ratio": "100.0%", + "Start Line": 237, + "End Line": 243 + }, { "Function Name": "EditorNode::show_accept", "Structural Impact": 4.0, @@ -17342,6 +17572,16 @@ "Start Line": 3037, "End Line": 3045 }, + { + "Function Name": "EditorNode::input", + "Structural Impact": 3.4, + "Lines of Code (LOC)": 12, + "Control Flow Branches": 1, + "Input Parameters": 1, + "Control Flow Ratio": "50.0%", + "Start Line": 393, + "End Line": 404 + }, { "Function Name": "EditorNode::_progress_dialog_visibility_changed", "Structural Impact": 3.4, @@ -17392,6 +17632,16 @@ "Start Line": 7885, "End Line": 7894 }, + { + "Function Name": "EditorNode::_execute_upgrades", + "Structural Impact": 3.2, + "Lines of Code (LOC)": 8, + "Control Flow Branches": 1, + "Input Parameters": 1, + "Control Flow Ratio": "50.0%", + "Start Line": 1217, + "End Line": 1224 + }, { "Function Name": "EditorNode::_screenshot", "Structural Impact": 3.2, @@ -17512,6 +17762,16 @@ "Start Line": 7655, "End Line": 7658 }, + { + "Function Name": "EditorNode::_queue_translation_notification", + "Structural Impact": 2.4, + "Lines of Code (LOC)": 7, + "Control Flow Branches": 1, + "Input Parameters": 0, + "Control Flow Ratio": "33.3%", + "Start Line": 676, + "End Line": 682 + }, { "Function Name": "EditorNode::_palette_quick_open_dialog", "Structural Impact": 2.4, @@ -17832,6 +18092,46 @@ "Start Line": 7613, "End Line": 7617 }, + { + "Function Name": "EditorNode::_update_vsync_mode", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 4, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 464, + "End Line": 467 + }, + { + "Function Name": "EditorNode::_gdextensions_reloaded", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 11, + "Control Flow Branches": 0, + "Input Parameters": 0, + "Control Flow Ratio": "0.0%", + "Start Line": 622, + "End Line": 632 + }, + { + "Function Name": "EditorNode::_propagate_translation_notification", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 4, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 684, + "End Line": 687 + }, + { + "Function Name": "EditorNode::_plugin_over_self_own", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 3, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 1280, + "End Line": 1282 + }, { "Function Name": "EditorNode::_reload_project_settings", "Structural Impact": 1.6, @@ -18405,7 +18705,7 @@ "High-Risk Execution Commands": 2, "I/O and Network Boundaries": 0, "Exposed API / Public Exports": 0, - "State Mutations / Variable Reassignments": 5525, + "State Mutations / Variable Reassignments": 5521, "Commented-out Code (Dead Logic)": 4, "Structured Documentation Blocks": 4, "Unit Test Assertions": 0, @@ -18468,7 +18768,7 @@ "Design Short Vars": 117, "Design Long Vars": 60, "Duplicate Logic": 0, - "Orphaned Logic": 265, + "Orphaned Logic": 295, "Instructional Code Examples": 0, "Architectural Diagrams (Mermaid/PlantUML)": 0, "Structured Literature Headers": 0, diff --git a/tests/golden_master_zero_dep_audit.json b/tests/golden_master_zero_dep_audit.json index 865ccfad1..1b43f6a76 100644 --- a/tests/golden_master_zero_dep_audit.json +++ b/tests/golden_master_zero_dep_audit.json @@ -3,17 +3,17 @@ "1. Forensic Trail (Traceability)": { "Analysis Context": { "Engine Identity": "GitGalaxy Scope vlatest (Delta Mode)", - "Zero-Dependency Mode Active": false, + "Zero-Dependency Mode Active": true, "Missing Dependencies": { - "networkx": false, - "tiktoken": false, - "xgboost": false, + "networkx": true, + "tiktoken": true, + "xgboost": true, "pyyaml": false }, "Target Root Name": "data", "Absolute Project Path": "H:\\deepseek work\\language-crucible\\data", - "Analysis ISO Timestamp": "2026-08-16T15:24:34.466911+00:00", - "Total Scan Duration": "46.75 seconds" + "Analysis ISO Timestamp": "2026-08-16T16:03:18.291030+00:00", + "Total Scan Duration": "17.09 seconds" }, "Source Control Footprint (Immutable Anchor)": { "Active Branch": "HEAD", @@ -198,8 +198,8 @@ "health": { "avg_cognitive_load": 24.698, "avg_safety_score": 38.602, - "avg_tech_debt": 23.313, - "avg_documentation": 21.503 + "avg_tech_debt": 23.315, + "avg_documentation": 21.504 }, "composition": { "xml": { @@ -295,7 +295,7 @@ "cpp": { "files": 33, "loc": 44831, - "impact": 58265.619999999995 + "impact": 58783.01999999999 }, "csharp": { "files": 8, @@ -698,11 +698,11 @@ }, "cpp/godot": { "file_count": 16, - "total_mass": 38201.42, + "total_mass": 38718.82, "avg_exposures": { "cognitive_load": 59.79, "safety_score": 73.57, - "tech_debt": 22.36, + "tech_debt": 22.49, "verification": 55.29, "api_exposure": 5.28, "concurrency": 0.0, @@ -711,7 +711,7 @@ "spec_match": 81.25, "stability": 40.62, "churn": 0.0, - "documentation": 22.72, + "documentation": 22.77, "secrets_risk": 0.0 } }, @@ -3206,11 +3206,11 @@ } }, "network_macro": { - "modularity": 0.7049, - "assortativity": -0.3494, - "cyclic_density": 0.0128, - "avg_path_length": 3.9488, - "articulation_points": 66 + "modularity": null, + "assortativity": null, + "cyclic_density": null, + "avg_path_length": null, + "articulation_points": null }, "ecosystem_audits": { "api_mapper": { @@ -3838,98 +3838,98 @@ "systemic_bottlenecks": { "cascading_state_mutation": [ { - "path": "python/twisted/http.py", - "score": 0.004, + "path": "abap/abapGit/zabapgit.prog.abap", + "score": 0.0, "btw": 0.0, - "state_mutation": 99.8371 + "state_mutation": 0.0 }, { - "path": "python/twisted/defer.py", - "score": 0.002, + "path": "abap/abapGit/zcl_abapgit_ajson.clas.abap", + "score": 0.0, "btw": 0.0, - "state_mutation": 94.2343 + "state_mutation": 35.245 }, { - "path": "dockerfile/moby/builder/remotecontext/internal/tarsum/tarsum.go", - "score": 0.001, + "path": "abap/abapGit/zcl_abapgit_git_porcelain.clas.abap", + "score": 0.0, "btw": 0.0, - "state_mutation": 100.0 + "state_mutation": 68.9236 }, { - "path": "abap/abapGit/zabapgit.prog.abap", + "path": "abap/abapGit/zcl_abapgit_http_client.clas.abap", "score": 0.0, "btw": 0.0, "state_mutation": 0.0 }, { - "path": "abap/abapGit/zcl_abapgit_ajson.clas.abap", + "path": "abap/abapGit/zcl_abapgit_objects.clas.abap", "score": 0.0, "btw": 0.0, - "state_mutation": 35.245 + "state_mutation": 32.8197 } ], "fragile_dependency_chain": [ { - "path": "python/fastapi/fastapi/exceptions.py", - "score": 3.348, - "close": 0.0428, - "err": 78.2164 + "path": "abap/abapGit/zabapgit.prog.abap", + "score": 0.0, + "close": 0.0, + "err": 0.0 }, { - "path": "python/fastapi/fastapi/types.py", - "score": 2.38, - "close": 0.0298, - "err": 80.0 + "path": "abap/abapGit/zcl_abapgit_ajson.clas.abap", + "score": 0.0, + "close": 0.0, + "err": 50.2419 }, { - "path": "assembly/bootos/os.asm", - "score": 2.328, - "close": 0.0376, - "err": 61.8392 + "path": "abap/abapGit/zcl_abapgit_git_porcelain.clas.abap", + "score": 0.0, + "close": 0.0, + "err": 57.4809 }, { - "path": "scheme/racket/io.ss", - "score": 1.388, - "close": 0.0251, - "err": 55.1839 + "path": "abap/abapGit/zcl_abapgit_http_client.clas.abap", + "score": 0.0, + "close": 0.0, + "err": 0.0 }, { - "path": "python/fastapi/fastapi/responses.py", - "score": 1.226, - "close": 0.028, - "err": 43.6979 + "path": "abap/abapGit/zcl_abapgit_objects.clas.abap", + "score": 0.0, + "close": 0.0, + "err": 47.9452 } ], "undocumented_critical_path": [ { - "path": "zig/zig/Type.zig", - "score": 744.507, - "pr": 8.613, - "doc": 86.4399 + "path": "abap/abapGit/zabapgit.prog.abap", + "score": 0.0, + "pr": 0.0, + "doc": 19.2933 }, { - "path": "zig/tigerbeetle/constants.zig", - "score": 722.607, - "pr": 7.733, - "doc": 93.4446 + "path": "abap/abapGit/zcl_abapgit_ajson.clas.abap", + "score": 0.0, + "pr": 0.0, + "doc": 13.0752 }, { - "path": "zig/zig/Zcu.zig", - "score": 553.569, - "pr": 14.354, - "doc": 38.5655 + "path": "abap/abapGit/zcl_abapgit_git_porcelain.clas.abap", + "score": 0.0, + "pr": 0.0, + "doc": 11.9203 }, { - "path": "python/fastapi/fastapi/responses.py", - "score": 487.911, - "pr": 12.481, - "doc": 39.0923 + "path": "abap/abapGit/zcl_abapgit_http_client.clas.abap", + "score": 0.0, + "pr": 0.0, + "doc": 20.4026 }, { - "path": "zig/zig/InternPool.zig", - "score": 442.247, - "pr": 9.811, - "doc": 45.0766 + "path": "abap/abapGit/zcl_abapgit_objects.clas.abap", + "score": 0.0, + "pr": 0.0, + "doc": 11.9203 } ] }, @@ -14697,7 +14697,7 @@ } }, "cpp/godot": { - "Directory Group Magnitude": 38201.42, + "Directory Group Magnitude": 38718.82, "File Count": 16, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "81.2%", @@ -14706,7 +14706,7 @@ "Average Risk Exposures": { "Cognitive Load Exposure": "59.79%", "Error & Exception Exposure": "73.57%", - "Tech Debt Exposure": "22.36%", + "Tech Debt Exposure": "22.49%", "Testing Exposure": "55.29%", "API Exposure": "5.28%", "Concurrency Exposure": "0.0%", @@ -14715,7 +14715,7 @@ "Specification Exposure": "81.25%", "Instability Exposure": "40.62%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "22.72%", + "Documentation Exposure": "22.77%", "Hardcoded Payload Artifacts": "0.0%" }, "Files": { @@ -15678,18 +15678,18 @@ "Total LOC": 9612, "Coding LOC": 7665, "Documentation LOC": 454, - "Structural Magnitude": 9359.0, + "Structural Magnitude": 9876.4, "Control Flow Ratio": "79.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.388 + "Raw Cognitive Density": 1.386 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "92.37%", - "Error & Exception Exposure": "96.26%", - "Tech Debt Exposure": "95.16%", + "Cognitive Load Exposure": "92.31%", + "Error & Exception Exposure": "96.25%", + "Tech Debt Exposure": "97.25%", "Testing Exposure": "80.0%", "API Exposure": "0.0%", "Concurrency Exposure": "0.0%", @@ -15698,7 +15698,7 @@ "Specification Exposure": "100.0%", "Instability Exposure": "50.0%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "12.76%", + "Documentation Exposure": "13.6%", "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ @@ -15712,6 +15712,16 @@ "Start Line": 3368, "End Line": 3947 }, + { + "Function Name": "EditorNode::_notification", + "Structural Impact": 130.7, + "Lines of Code (LOC)": 322, + "Control Flow Branches": 80, + "Input Parameters": 1, + "Control Flow Ratio": "98.8%", + "Start Line": 855, + "End Line": 1176 + }, { "Function Name": "EditorNode::_edit_current", "Structural Impact": 128.1, @@ -15802,6 +15812,16 @@ "Start Line": 5540, "End Line": 5605 }, + { + "Function Name": "EditorNode::_fs_changed", + "Structural Impact": 60.2, + "Lines of Code (LOC)": 101, + "Control Flow Branches": 38, + "Input Parameters": 1, + "Control Flow Ratio": "82.6%", + "Start Line": 1319, + "End Line": 1419 + }, { "Function Name": "EditorNode::replace_resources_in_object", "Structural Impact": 60.0, @@ -15822,6 +15842,16 @@ "Start Line": 5195, "End Line": 5296 }, + { + "Function Name": "EditorNode::shortcut_input", + "Structural Impact": 55.2, + "Lines of Code (LOC)": 57, + "Control Flow Branches": 36, + "Input Parameters": 1, + "Control Flow Ratio": "97.3%", + "Start Line": 406, + "End Line": 462 + }, { "Function Name": "EditorNode::save_resource_as", "Structural Impact": 49.0, @@ -15862,6 +15892,16 @@ "Start Line": 5055, "End Line": 5139 }, + { + "Function Name": "EditorNode::disambiguate_filenames", + "Structural Impact": 43.5, + "Lines of Code (LOC)": 108, + "Control Flow Branches": 21, + "Input Parameters": 2, + "Control Flow Ratio": "91.3%", + "Start Line": 245, + "End Line": 352 + }, { "Function Name": "EditorNode::set_addon_plugin_enabled", "Structural Impact": 40.8, @@ -15902,6 +15942,16 @@ "Start Line": 2256, "End Line": 2339 }, + { + "Function Name": "EditorNode::_update_from_settings", + "Structural Impact": 31.6, + "Lines of Code (LOC)": 152, + "Control Flow Branches": 16, + "Input Parameters": 1, + "Control Flow Ratio": "88.9%", + "Start Line": 469, + "End Line": 620 + }, { "Function Name": "EditorNode::_dialog_display_load_error", "Structural Impact": 30.6, @@ -16042,6 +16092,16 @@ "Start Line": 2444, "End Line": 2465 }, + { + "Function Name": "EditorNode::_resources_changed", + "Structural Impact": 22.9, + "Lines of Code (LOC)": 34, + "Control Flow Branches": 14, + "Input Parameters": 1, + "Control Flow Ratio": "93.3%", + "Start Line": 1284, + "End Line": 1317 + }, { "Function Name": "EditorNode::get_modified_properties_for_node", "Structural Impact": 22.4, @@ -16062,6 +16122,16 @@ "Start Line": 5351, "End Line": 5382 }, + { + "Function Name": "EditorNode::_update_theme", + "Structural Impact": 22.1, + "Lines of Code (LOC)": 75, + "Control Flow Branches": 12, + "Input Parameters": 1, + "Control Flow Ratio": "92.3%", + "Start Line": 689, + "End Line": 763 + }, { "Function Name": "EditorNode::_next_unsaved_scene", "Structural Impact": 20.3, @@ -16182,6 +16252,16 @@ "Start Line": 6391, "End Line": 6427 }, + { + "Function Name": "EditorNode::update_preview_themes", + "Structural Impact": 17.0, + "Lines of Code (LOC)": 29, + "Control Flow Branches": 10, + "Input Parameters": 1, + "Control Flow Ratio": "83.3%", + "Start Line": 788, + "End Line": 816 + }, { "Function Name": "EditorNode::preload_reimporting_with_path_in_edited_scenes", "Structural Impact": 16.9, @@ -16322,6 +16402,26 @@ "Start Line": 6547, "End Line": 6572 }, + { + "Function Name": "EditorNode::_update_update_spinner", + "Structural Impact": 14.6, + "Lines of Code (LOC)": 38, + "Control Flow Branches": 8, + "Input Parameters": 1, + "Control Flow Ratio": "80.0%", + "Start Line": 1178, + "End Line": 1215 + }, + { + "Function Name": "EditorNode::_is_project_data_missing", + "Structural Impact": 14.5, + "Lines of Code (LOC)": 36, + "Control Flow Branches": 8, + "Input Parameters": 1, + "Control Flow Ratio": "72.7%", + "Start Line": 818, + "End Line": 853 + }, { "Function Name": "EditorNode::get_object_custom_type_base", "Structural Impact": 14.5, @@ -16412,6 +16512,16 @@ "Start Line": 1541, "End Line": 1582 }, + { + "Function Name": "EditorNode::get_editor_theme_native_menu_icon", + "Structural Impact": 13.1, + "Lines of Code (LOC)": 22, + "Control Flow Branches": 5, + "Input Parameters": 3, + "Control Flow Ratio": "62.5%", + "Start Line": 765, + "End Line": 786 + }, { "Function Name": "EditorNode::_feature_profile_changed", "Structural Impact": 13.1, @@ -16572,6 +16682,16 @@ "Start Line": 7691, "End Line": 7706 }, + { + "Function Name": "EditorProgress::EditorProgress", + "Structural Impact": 10.2, + "Lines of Code (LOC)": 9, + "Control Flow Branches": 3, + "Input Parameters": 5, + "Control Flow Ratio": "100.0%", + "Start Line": 227, + "End Line": 235 + }, { "Function Name": "EditorNode::_resources_reimporting", "Structural Impact": 9.9, @@ -16662,6 +16782,16 @@ "Start Line": 5392, "End Line": 5404 }, + { + "Function Name": "EditorNode::_version_control_menu_option", + "Structural Impact": 9.0, + "Lines of Code (LOC)": 10, + "Control Flow Branches": 5, + "Input Parameters": 1, + "Control Flow Ratio": "83.3%", + "Start Line": 354, + "End Line": 363 + }, { "Function Name": "EditorNode::_update_recent_scenes", "Structural Impact": 9.0, @@ -16702,6 +16832,16 @@ "Start Line": 2228, "End Line": 2238 }, + { + "Function Name": "EditorProgress::step", + "Structural Impact": 8.4, + "Lines of Code (LOC)": 8, + "Control Flow Branches": 3, + "Input Parameters": 3, + "Control Flow Ratio": "60.0%", + "Start Line": 218, + "End Line": 225 + }, { "Function Name": "EditorNode::load_scene_or_resource", "Structural Impact": 8.4, @@ -16722,6 +16862,16 @@ "Start Line": 6652, "End Line": 6677 }, + { + "Function Name": "EditorNode::_update_translations", + "Structural Impact": 8.1, + "Lines of Code (LOC)": 21, + "Control Flow Branches": 4, + "Input Parameters": 1, + "Control Flow Ratio": "80.0%", + "Start Line": 634, + "End Line": 654 + }, { "Function Name": "EditorNode::_is_class_editor_disabled_by_feature_profile", "Structural Impact": 8.1, @@ -16902,6 +17052,16 @@ "Start Line": 4804, "End Line": 4822 }, + { + "Function Name": "EditorNode::_update_title", + "Structural Impact": 6.8, + "Lines of Code (LOC)": 17, + "Control Flow Branches": 5, + "Input Parameters": 0, + "Control Flow Ratio": "83.3%", + "Start Line": 365, + "End Line": 381 + }, { "Function Name": "EditorNode::_mark_unsaved_scenes", "Structural Impact": 6.8, @@ -16942,6 +17102,16 @@ "Start Line": 5180, "End Line": 5193 }, + { + "Function Name": "EditorNode::_translation_resources_changed", + "Structural Impact": 6.6, + "Lines of Code (LOC)": 19, + "Control Flow Branches": 3, + "Input Parameters": 1, + "Control Flow Ratio": "75.0%", + "Start Line": 656, + "End Line": 674 + }, { "Function Name": "EditorNode::_load_editor_plugin_states_from_config", "Structural Impact": 6.6, @@ -17002,6 +17172,16 @@ "Start Line": 7755, "End Line": 7766 }, + { + "Function Name": "EditorNode::_remove_plugin_from_enabled", + "Structural Impact": 6.2, + "Lines of Code (LOC)": 11, + "Control Flow Branches": 3, + "Input Parameters": 1, + "Control Flow Ratio": "75.0%", + "Start Line": 1256, + "End Line": 1266 + }, { "Function Name": "EditorNode::_build_icon_type_cache", "Structural Impact": 6.2, @@ -17042,6 +17222,16 @@ "Start Line": 4561, "End Line": 4574 }, + { + "Function Name": "EditorNode::_on_plugin_ready", + "Structural Impact": 5.8, + "Lines of Code (LOC)": 12, + "Control Flow Branches": 2, + "Input Parameters": 2, + "Control Flow Ratio": "50.0%", + "Start Line": 1243, + "End Line": 1254 + }, { "Function Name": "EditorNode::_toggle_distraction_free_mode", "Structural Impact": 5.8, @@ -17072,6 +17262,16 @@ "Start Line": 9580, "End Line": 9611 }, + { + "Function Name": "EditorNode::_plugin_over_edit", + "Structural Impact": 5.7, + "Lines of Code (LOC)": 11, + "Control Flow Branches": 2, + "Input Parameters": 2, + "Control Flow Ratio": "66.7%", + "Start Line": 1268, + "End Line": 1278 + }, { "Function Name": "EditorNode::add_editor_plugin", "Structural Impact": 5.7, @@ -17112,6 +17312,16 @@ "Start Line": 5435, "End Line": 5447 }, + { + "Function Name": "EditorNode::init_plugins", + "Structural Impact": 4.8, + "Lines of Code (LOC)": 16, + "Control Flow Branches": 3, + "Input Parameters": 0, + "Control Flow Ratio": "75.0%", + "Start Line": 1226, + "End Line": 1241 + }, { "Function Name": "EditorNode::_resave_externally_modified_scenes", "Structural Impact": 4.8, @@ -17152,6 +17362,16 @@ "Start Line": 6151, "End Line": 6156 }, + { + "Function Name": "EditorNode::_update_unsaved_cache", + "Structural Impact": 4.7, + "Lines of Code (LOC)": 9, + "Control Flow Branches": 2, + "Input Parameters": 1, + "Control Flow Ratio": "66.7%", + "Start Line": 383, + "End Line": 391 + }, { "Function Name": "EditorNode::clear_node_reference", "Structural Impact": 4.7, @@ -17242,6 +17462,16 @@ "Start Line": 1887, "End Line": 1890 }, + { + "Function Name": "EditorProgress::~EditorProgress", + "Structural Impact": 4.3, + "Lines of Code (LOC)": 7, + "Control Flow Branches": 3, + "Input Parameters": 0, + "Control Flow Ratio": "100.0%", + "Start Line": 237, + "End Line": 243 + }, { "Function Name": "EditorNode::show_accept", "Structural Impact": 4.0, @@ -17342,6 +17572,16 @@ "Start Line": 3037, "End Line": 3045 }, + { + "Function Name": "EditorNode::input", + "Structural Impact": 3.4, + "Lines of Code (LOC)": 12, + "Control Flow Branches": 1, + "Input Parameters": 1, + "Control Flow Ratio": "50.0%", + "Start Line": 393, + "End Line": 404 + }, { "Function Name": "EditorNode::_progress_dialog_visibility_changed", "Structural Impact": 3.4, @@ -17392,6 +17632,16 @@ "Start Line": 7885, "End Line": 7894 }, + { + "Function Name": "EditorNode::_execute_upgrades", + "Structural Impact": 3.2, + "Lines of Code (LOC)": 8, + "Control Flow Branches": 1, + "Input Parameters": 1, + "Control Flow Ratio": "50.0%", + "Start Line": 1217, + "End Line": 1224 + }, { "Function Name": "EditorNode::_screenshot", "Structural Impact": 3.2, @@ -17512,6 +17762,16 @@ "Start Line": 7655, "End Line": 7658 }, + { + "Function Name": "EditorNode::_queue_translation_notification", + "Structural Impact": 2.4, + "Lines of Code (LOC)": 7, + "Control Flow Branches": 1, + "Input Parameters": 0, + "Control Flow Ratio": "33.3%", + "Start Line": 676, + "End Line": 682 + }, { "Function Name": "EditorNode::_palette_quick_open_dialog", "Structural Impact": 2.4, @@ -17832,6 +18092,46 @@ "Start Line": 7613, "End Line": 7617 }, + { + "Function Name": "EditorNode::_update_vsync_mode", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 4, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 464, + "End Line": 467 + }, + { + "Function Name": "EditorNode::_gdextensions_reloaded", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 11, + "Control Flow Branches": 0, + "Input Parameters": 0, + "Control Flow Ratio": "0.0%", + "Start Line": 622, + "End Line": 632 + }, + { + "Function Name": "EditorNode::_propagate_translation_notification", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 4, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 684, + "End Line": 687 + }, + { + "Function Name": "EditorNode::_plugin_over_self_own", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 3, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 1280, + "End Line": 1282 + }, { "Function Name": "EditorNode::_reload_project_settings", "Structural Impact": 1.6, @@ -18405,7 +18705,7 @@ "High-Risk Execution Commands": 2, "I/O and Network Boundaries": 0, "Exposed API / Public Exports": 0, - "State Mutations / Variable Reassignments": 5525, + "State Mutations / Variable Reassignments": 5521, "Commented-out Code (Dead Logic)": 4, "Structured Documentation Blocks": 4, "Unit Test Assertions": 0, @@ -18468,7 +18768,7 @@ "Design Short Vars": 117, "Design Long Vars": 60, "Duplicate Logic": 0, - "Orphaned Logic": 265, + "Orphaned Logic": 295, "Instructional Code Examples": 0, "Architectural Diagrams (Mermaid/PlantUML)": 0, "Structured Literature Headers": 0, @@ -50083,8 +50383,8 @@ "8. Dependency Network": { "Direct Upstream (Fragility)": 29, "Direct Downstream (Dependency Blast Radius)": 2, - "Total Upstream (Absolute Fragility)": 4, - "Total Downstream (Absolute Dependency Blast Radius)": 7 + "Total Upstream (Absolute Fragility)": 5, + "Total Downstream (Absolute Dependency Blast Radius)": 8 }, "9. Extracted Dependencies": [ "Air.zig", @@ -54631,8 +54931,8 @@ "8. Dependency Network": { "Direct Upstream (Fragility)": 3, "Direct Downstream (Dependency Blast Radius)": 3, - "Total Upstream (Absolute Fragility)": 4, - "Total Downstream (Absolute Dependency Blast Radius)": 7 + "Total Upstream (Absolute Fragility)": 5, + "Total Downstream (Absolute Dependency Blast Radius)": 8 }, "9. Extracted Dependencies": [ "Zcu.zig", @@ -56683,8 +56983,8 @@ "8. Dependency Network": { "Direct Upstream (Fragility)": 7, "Direct Downstream (Dependency Blast Radius)": 6, - "Total Upstream (Absolute Fragility)": 4, - "Total Downstream (Absolute Dependency Blast Radius)": 7 + "Total Upstream (Absolute Fragility)": 5, + "Total Downstream (Absolute Dependency Blast Radius)": 8 }, "9. Extracted Dependencies": [ "InternPool.zig", @@ -58129,8 +58429,8 @@ "8. Dependency Network": { "Direct Upstream (Fragility)": 17, "Direct Downstream (Dependency Blast Radius)": 4, - "Total Upstream (Absolute Fragility)": 4, - "Total Downstream (Absolute Dependency Blast Radius)": 7 + "Total Upstream (Absolute Fragility)": 5, + "Total Downstream (Absolute Dependency Blast Radius)": 8 }, "9. Extracted Dependencies": [ "Air.zig", @@ -80301,7 +80601,7 @@ "Documentation LOC": 3657, "Structural Magnitude": 1948.2, "Control Flow Ratio": "68.8%", - "Popularity Rank": 3, + "Popularity Rank": 4, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -83544,7 +83844,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 10, - "Direct Downstream (Dependency Blast Radius)": 3, + "Direct Downstream (Dependency Blast Radius)": 4, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 2 }, @@ -122054,8 +122354,8 @@ "8. Dependency Network": { "Direct Upstream (Fragility)": 13, "Direct Downstream (Dependency Blast Radius)": 2, - "Total Upstream (Absolute Fragility)": 3, - "Total Downstream (Absolute Dependency Blast Radius)": 3 + "Total Upstream (Absolute Fragility)": 4, + "Total Downstream (Absolute Dependency Blast Radius)": 4 }, "9. Extracted Dependencies": [ "BuildAssociatedConfig.zig", @@ -125092,8 +125392,8 @@ "8. Dependency Network": { "Direct Upstream (Fragility)": 12, "Direct Downstream (Dependency Blast Radius)": 2, - "Total Upstream (Absolute Fragility)": 3, - "Total Downstream (Absolute Dependency Blast Radius)": 3 + "Total Upstream (Absolute Fragility)": 4, + "Total Downstream (Absolute Dependency Blast Radius)": 4 }, "9. Extracted Dependencies": [ "DocumentScope.zig", @@ -240679,7 +240979,7 @@ "Documentation LOC": 813, "Structural Magnitude": 1175.18, "Control Flow Ratio": "31.4%", - "Popularity Rank": 8, + "Popularity Rank": 9, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -241952,7 +242252,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 13, - "Direct Downstream (Dependency Blast Radius)": 8, + "Direct Downstream (Dependency Blast Radius)": 9, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -273313,8 +273613,8 @@ "8. Dependency Network": { "Direct Upstream (Fragility)": 7, "Direct Downstream (Dependency Blast Radius)": 1, - "Total Upstream (Absolute Fragility)": 1, - "Total Downstream (Absolute Dependency Blast Radius)": 6 + "Total Upstream (Absolute Fragility)": 2, + "Total Downstream (Absolute Dependency Blast Radius)": 7 }, "9. Extracted Dependencies": [ "builtin", @@ -273489,8 +273789,8 @@ "8. Dependency Network": { "Direct Upstream (Fragility)": 4, "Direct Downstream (Dependency Blast Radius)": 3, - "Total Upstream (Absolute Fragility)": 1, - "Total Downstream (Absolute Dependency Blast Radius)": 6 + "Total Upstream (Absolute Fragility)": 2, + "Total Downstream (Absolute Dependency Blast Radius)": 7 }, "9. Extracted Dependencies": [ "config.zig", @@ -282927,7 +283227,7 @@ "Documentation LOC": 2, "Structural Magnitude": 20.72, "Control Flow Ratio": "40.0%", - "Popularity Rank": 6, + "Popularity Rank": 7, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -283060,7 +283360,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 1, - "Direct Downstream (Dependency Blast Radius)": 6, + "Direct Downstream (Dependency Blast Radius)": 7, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -296205,7 +296505,7 @@ "Documentation LOC": 60, "Structural Magnitude": 50.88, "Control Flow Ratio": "3.1%", - "Popularity Rank": 8, + "Popularity Rank": 10, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -296438,7 +296738,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 7, - "Direct Downstream (Dependency Blast Radius)": 8, + "Direct Downstream (Dependency Blast Radius)": 10, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -296899,7 +297199,7 @@ "Documentation LOC": 92, "Structural Magnitude": 69.82, "Control Flow Ratio": "18.0%", - "Popularity Rank": 33, + "Popularity Rank": 39, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -297112,7 +297412,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 6, - "Direct Downstream (Dependency Blast Radius)": 33, + "Direct Downstream (Dependency Blast Radius)": 39, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -298005,7 +298305,7 @@ "Documentation LOC": 22, "Structural Magnitude": 8.84, "Control Flow Ratio": "17.9%", - "Popularity Rank": 26, + "Popularity Rank": 27, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -298148,7 +298448,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 7, - "Direct Downstream (Dependency Blast Radius)": 26, + "Direct Downstream (Dependency Blast Radius)": 27, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -299707,7 +300007,7 @@ "Documentation LOC": 0, "Structural Magnitude": 15.2, "Control Flow Ratio": "0.0%", - "Popularity Rank": 25, + "Popularity Rank": 34, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -299829,7 +300129,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 6, - "Direct Downstream (Dependency Blast Radius)": 25, + "Direct Downstream (Dependency Blast Radius)": 34, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 9 }, @@ -313922,7 +314222,7 @@ "Documentation LOC": 162, "Structural Magnitude": 318.68, "Control Flow Ratio": "27.2%", - "Popularity Rank": 1, + "Popularity Rank": 2, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -314385,7 +314685,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 40, - "Direct Downstream (Dependency Blast Radius)": 1, + "Direct Downstream (Dependency Blast Radius)": 2, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -321116,7 +321416,7 @@ "Documentation LOC": 18, "Structural Magnitude": 723.18, "Control Flow Ratio": "34.4%", - "Popularity Rank": 6, + "Popularity Rank": 7, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -321609,7 +321909,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 8, - "Direct Downstream (Dependency Blast Radius)": 6, + "Direct Downstream (Dependency Blast Radius)": 7, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -329050,7 +329350,7 @@ "Documentation LOC": 69, "Structural Magnitude": 264.76, "Control Flow Ratio": "62.7%", - "Popularity Rank": 5, + "Popularity Rank": 8, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -329263,7 +329563,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 16, - "Direct Downstream (Dependency Blast Radius)": 5, + "Direct Downstream (Dependency Blast Radius)": 8, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -331543,7 +331843,7 @@ "Documentation LOC": 181, "Structural Magnitude": 155.86, "Control Flow Ratio": "51.4%", - "Popularity Rank": 3, + "Popularity Rank": 4, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -331816,7 +332116,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 1, - "Direct Downstream (Dependency Blast Radius)": 3, + "Direct Downstream (Dependency Blast Radius)": 4, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -371364,7 +371664,7 @@ "Documentation LOC": 125, "Structural Magnitude": 183.5, "Control Flow Ratio": "36.9%", - "Popularity Rank": 10, + "Popularity Rank": 11, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -371757,7 +372057,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 7, - "Direct Downstream (Dependency Blast Radius)": 10, + "Direct Downstream (Dependency Blast Radius)": 11, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 6 }, @@ -379381,7 +379681,7 @@ "Documentation LOC": 172, "Structural Magnitude": 431.32, "Control Flow Ratio": "61.2%", - "Popularity Rank": 2, + "Popularity Rank": 3, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -380514,7 +380814,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 29, - "Direct Downstream (Dependency Blast Radius)": 2, + "Direct Downstream (Dependency Blast Radius)": 3, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, @@ -406647,7 +406947,7 @@ "Documentation LOC": 1110, "Structural Magnitude": 33.97, "Control Flow Ratio": "11.6%", - "Popularity Rank": 2, + "Popularity Rank": 3, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, @@ -407220,7 +407520,7 @@ }, "8. Dependency Network": { "Direct Upstream (Fragility)": 38, - "Direct Downstream (Dependency Blast Radius)": 2, + "Direct Downstream (Dependency Blast Radius)": 3, "Total Upstream (Absolute Fragility)": 0, "Total Downstream (Absolute Dependency Blast Radius)": 0 }, From 1c173f291364cd48528d8d87fd4b8212087a38b7 Mon Sep 17 00:00:00 2001 From: Ruiming Zhao Date: Sun, 16 Aug 2026 09:28:07 -0700 Subject: [PATCH 4/5] fix(prism,detector): widen C++ char-literal bound to cover named escapes The digit-separator shielding in prism.py and detector.py bounded the C++ char-literal branch to 10 chars (mirroring #1302's recursive_block bound). That's wide enough for classic escapes ('\u0041', '\U0001F600') but not for C++23 named character escapes (\N{LATIN CAPITAL LETTER A}), which can run far longer and contain braces. A real (if rare) literal would be clipped, leaving the shield desynced the same way the original unbounded version did, just in the other direction. Widen the C++-only bound to 64 chars -- comfortably covers every named escape, still far too short for any cross-file cascade. The recursive_block shield keeps its own 10-char bound, and JS/PHP single-quoted strings keep the unbounded shared pattern. --- gitgalaxy/core/detector.py | 2 +- gitgalaxy/core/prism.py | 12 ++++++------ tests/core_engine/test_prism_issue_1718.py | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/gitgalaxy/core/detector.py b/gitgalaxy/core/detector.py index 3932402de..2e1d6b5fa 100644 --- a/gitgalaxy/core/detector.py +++ b/gitgalaxy/core/detector.py @@ -1895,7 +1895,7 @@ def fast_shield(m): # real function body in between from the brace scan. Consume separators as their own # alternative (same shape as prism.py's CPP_LITERAL_MASK_PATTERN) and bound the branch # to 10 chars, matching #1302/#1426. - single_quote = r"[0-9a-fA-F]'[0-9a-fA-F]|(? Date: Sun, 16 Aug 2026 20:13:39 -0400 Subject: [PATCH 5/5] Address review comments: correct 64 char bounds and test coverage --- gitgalaxy/core/detector.py | 4 +-- tests/core_engine/test_detector_issue_1718.py | 30 +++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/gitgalaxy/core/detector.py b/gitgalaxy/core/detector.py index 2e1d6b5fa..fa89d7523 100644 --- a/gitgalaxy/core/detector.py +++ b/gitgalaxy/core/detector.py @@ -1888,13 +1888,13 @@ def fast_shield(m): # Rust uses single quotes for lifetimes (e.g. 'a), so a greedy string match corrupts ASTs. single_quote = r"'(?:\\.|[^'\\])*'" - if lang_id in ("cpp", "c"): + if lang_id == "cpp": # #1718: C++14+ digit separators (512'000, 1'000'000, 0xDE'AD) use ' inside # numeric literals. The unbounded branch read a separator as a char-literal opener # and paired it with the next unrelated ' anywhere later in the file, blanking every # real function body in between from the brace scan. Consume separators as their own # alternative (same shape as prism.py's CPP_LITERAL_MASK_PATTERN) and bound the branch - # to 10 chars, matching #1302/#1426. + # to 64 chars, matching #1302/#1426. single_quote = r"[0-9a-fA-F]'[0-9a-fA-F]|(?