From fe061ab43f8f9abec76a0b6e0d92e4341df01f55 Mon Sep 17 00:00:00 2001 From: Ruiming Zhao Date: Sun, 16 Aug 2026 09:59:56 -0700 Subject: [PATCH 1/3] fix: scan #else branches of unknown #if/#ifdef blocks in the macro shield (#1720) The preprocessor shield in _build_brace_safe_stream assumed the first branch of every #if/#ifdef was the active one and blindly blanked the #else branch. Any real implementation living in #else was silently dropped from extraction, even though tree-sitter ground truth parses both branches. Replace the in_dead_branch flag with a per-open-#if policy stack: - #if 1 / #if true -> first branch alive, #else dead - #if 0 / #if false -> first branch dead, #else alive - anything else (macro name, defined(X), expression) -> scan BOTH branches Nested blocks honor the outer branch's liveness via any() over the stack. --- gitgalaxy/core/detector.py | 74 +++++++++++++++++++++++------ tests/core_engine/test_detector.py | 76 +++++++++++++++++++++++++++--- 2 files changed, 130 insertions(+), 20 deletions(-) diff --git a/gitgalaxy/core/detector.py b/gitgalaxy/core/detector.py index 4d0403fd4..2a9702001 100644 --- a/gitgalaxy/core/detector.py +++ b/gitgalaxy/core/detector.py @@ -2105,10 +2105,29 @@ def _find_slash_terminator(text: str, content_start: int) -> int: # Macro Shields (Strictly Gated to C-Family) if lang_id in ("c", "cpp", "objective-c", "cs", "swift"): lines = safe_code.splitlines(keepends=True) - in_dead_branch = False - dead_nesting_depth = 0 + # Per-open-#if branch policy. Each stack entry is a (policy, side) + # pair where policy is the #if condition's static truth value and + # side is which branch of that #if we are currently in: + # policy True (#if 1 / #if true) -> first branch alive, #else dead + # policy False (#if 0 / #if false) -> first branch dead, #else alive + # policy None (unknown, e.g. #if FOO / #ifdef FOO) + # -> scan BOTH branches. This is the + # #1720 fix: tree-sitter ground truth + # parses both, and implementations + # living in #else were being blanked. + # any() over the stack: an inner #if inside an outer dead region stays + # dead even if its own condition would flip it; #endif pops restore it. + branch_stack: list[tuple[Optional[bool], str]] = [] in_multiline_macro = False + def _branch_dead(entry: tuple[Optional[bool], str]) -> bool: + policy, side = entry + if policy is True: + return side == "else" + if policy is False: + return side == "first" + return False + for i in range(len(lines)): line = lines[i] stripped = line.lstrip() @@ -2120,17 +2139,18 @@ def _find_slash_terminator(text: str, content_start: int) -> int: continue if stripped.startswith("#"): - if stripped.startswith("#if"): - if in_dead_branch: - dead_nesting_depth += 1 - elif stripped.startswith(("#else", "#elif")): - if not in_dead_branch and dead_nesting_depth == 0: - in_dead_branch = True - elif stripped.startswith("#endif") and in_dead_branch: - if dead_nesting_depth > 0: - dead_nesting_depth -= 1 - else: - in_dead_branch = False + if stripped.startswith("#if "): + branch_stack.append((self._classify_preproc_condition(stripped[3:].strip()), "first")) + elif stripped.startswith("#ifdef ") or stripped.startswith("#ifndef "): + branch_stack.append((None, "first")) + elif stripped.startswith("#elif ") and branch_stack: + # an #elif starts a fresh condition on the else side + branch_stack[-1] = (self._classify_preproc_condition(stripped[5:].strip()), "first") + elif stripped.startswith("#else") and branch_stack: + policy, _ = branch_stack[-1] + branch_stack[-1] = (policy, "else") + elif stripped.startswith("#endif") and branch_stack: + branch_stack.pop() if stripped.startswith("#define") and stripped.rstrip(" \t\r\n").endswith("\\"): in_multiline_macro = True @@ -2138,13 +2158,39 @@ def _find_slash_terminator(text: str, content_start: int) -> int: lines[i] = " " * (len(line) - 1) + "\n" if line.endswith("\n") else " " * len(line) continue - if in_dead_branch: + if any(_branch_dead(e) for e in branch_stack): lines[i] = " " * (len(line) - 1) + "\n" if line.endswith("\n") else " " * len(line) safe_code = "".join(lines) return safe_code + @staticmethod + def _classify_preproc_condition(condition: str) -> Optional[bool]: + """ + Returns the static truth value of a C-family preprocessor #if condition, + or None when it cannot be evaluated without a macro table. + + Recognized constants (after stripping C comments and whitespace): + True -- "1", "true", "TRUE" + False -- "0", "false", "FALSE" + None -- everything else (macro names, defined(X), expressions) + + Used by _build_brace_safe_stream's macro shield so #else branches that + genuinely contain implementations are scanned instead of blindly blanked + (#1720): only a statically-true #if (#if 1) makes its #else branch dead, + and only a statically-false #if (#if 0) makes its first branch dead. + """ + if condition is None: + return None + # strip C-style comments and surrounding whitespace + cond = re.sub(r"/\*.*?\*/|//.*$", "", condition, flags=re.S).strip() + if cond in ("1", "true", "TRUE", "True"): + return True + if cond in ("0", "false", "FALSE", "False"): + return False + return None + def _slice_by_braces( self, code: str, diff --git a/tests/core_engine/test_detector.py b/tests/core_engine/test_detector.py index aab0614da..9bc755f92 100644 --- a/tests/core_engine/test_detector.py +++ b/tests/core_engine/test_detector.py @@ -409,6 +409,75 @@ def test_detector_c_macro_dead_branch_shield(): assert result["equations"]["high_risk_execution"] == 0, "Failed to scrub dead preprocessor branches!" +def test_detector_c_macro_else_branch_is_scanned_issue_1720(): + """ + Regression test for #1720: the preprocessor shield used to assume the + first branch of every #if/#ifdef is the active one and blindly blanked + the #else branch, so real implementations living in #else were silently + dropped from extraction. With an unknown condition (e.g. #if FEATURE_FLAG) + the shield now scans BOTH branches; only statically-decidable conditions + (#if 0 / #if 1) prune a branch. + """ + opt_detector = StructuralExtractor("c", MOCK_LANG_DEFS) + code = ( + "#if FEATURE_FLAG\n" + "int fastImplementation() {\n" + " return 1;\n" + "}\n" + "#else\n" + "int portableImplementation() {\n" + " return 2;\n" + "}\n" + "#endif\n" + ) + + result = opt_detector.splice(code, "") + + names = [f["name"] for f in result["functions"]] + assert "fastImplementation" in names, "First branch of an unknown #if must still be scanned!" + assert "portableImplementation" in names, ( + "#1720: implementation living in the #else branch was dropped from extraction!" + ) + + +def test_detector_c_macro_static_truth_prunes_branches(): + """ + Companion to the #1720 fix: statically-decidable #if conditions still + prune the dead branch. #if 0 => first branch dead, #else alive; + #if 1 => first branch alive, #else dead. Nested blocks must also honor + the outer branch's liveness (any() over the open-#if stack). + """ + opt_detector = StructuralExtractor("c", MOCK_LANG_DEFS) + + code_if_zero = "#if 0\nint deadFast() {\n return 1;\n}\n#else\nint aliveFallback() {\n return 2;\n}\n#endif\n" + names_zero = [f["name"] for f in opt_detector.splice(code_if_zero, "")["functions"]] + assert "deadFast" not in names_zero, "#if 0 first branch must be pruned!" + assert "aliveFallback" in names_zero, "#if 0 #else branch must survive!" + + code_if_one = "#if 1\nint aliveFast() {\n return 1;\n}\n#else\nint deadFallback() {\n return 2;\n}\n#endif\n" + names_one = [f["name"] for f in opt_detector.splice(code_if_one, "")["functions"]] + assert "aliveFast" in names_one, "#if 1 first branch must survive!" + assert "deadFallback" not in names_one, "#if 1 #else branch must be pruned!" + + code_nested = ( + "#if 0\n" + "int a() { return 1; }\n" + "#else\n" + "int b() { return 2; }\n" + "#if 1\n" + "int c() { return 3; }\n" + "#else\n" + "int d() { return 4; }\n" + "#endif\n" + "int e() { return 5; }\n" + "#endif\n" + ) + names_nested = [f["name"] for f in opt_detector.splice(code_nested, "")["functions"]] + assert set(names_nested) == {"b", "c", "e"}, ( + "Nested #if liveness was not honored: expected only b, c, e, got %r" % names_nested + ) + + def test_detector_nested_function_is_counted_as_own_node_braces(): """ #1041: the brace-slicing guard used to skip any match whose start fell @@ -2251,12 +2320,7 @@ def test_detector_ts_param_function_type_annotation_not_counted_as_function(): # The object-literal arrow property must still be counted: its line # is preceded by `{`/`,`, never `(`. - object_code = ( - "export const Either = {\n" - " URI,\n" - " ap: (fab, fa) => ({ fab, fa }),\n" - "}\n" - ) + object_code = "export const Either = {\n URI,\n ap: (fab, fa) => ({ fab, fa }),\n}\n" satellites2, _ = detector._slice_by_braces(object_code, lang, rules, 0, {}) names2 = [s["name"] for s in satellites2] assert "ap" in names2, f"[{lang}] object-literal arrow property dropped: {names2}" From 29d13a538ba92151b8325f07feca75d2e191823c Mon Sep 17 00:00:00 2001 From: Ruiming Zhao Date: Sun, 16 Aug 2026 10:00:01 -0700 Subject: [PATCH 2/3] tests: rebless golden masters for the #else-branch macro shield fix (#1720) Re-running the pinned language-crucible corpus in both dependency modes after the shield change shifts the c/cpp snapshots: implementations that were previously blanked out of #else branches are now extracted (godot main.cpp's Main::test_setup/test_cleanup, rendering_server_default.h's redraw_request, gdscript_vm.cpp's OPCODE/OPCODE_WHILE/OPCODE_SWITCH, cpython frameobject.c, and others). Both golden crucible modes pass against the updated fixtures. --- tests/golden_master_audit.json | 664 ++++++++++++++---------- tests/golden_master_zero_dep_audit.json | 664 ++++++++++++++---------- 2 files changed, 784 insertions(+), 544 deletions(-) diff --git a/tests/golden_master_audit.json b/tests/golden_master_audit.json index 67a3186c6..97588d2d7 100644 --- a/tests/golden_master_audit.json +++ b/tests/golden_master_audit.json @@ -11,14 +11,14 @@ "pyyaml": false }, "Target Root Name": "data", - "Absolute Project Path": "/home/joe/nyx_projects/language-crucible/data", - "Analysis ISO Timestamp": "2026-08-16T13:09:58.225907+00:00", - "Total Scan Duration": "35.32 seconds" + "Absolute Project Path": "H:\\deepseek work\\language-crucible\\data", + "Analysis ISO Timestamp": "2026-08-16T16:54:03.806174+00:00", + "Total Scan Duration": "30.67 seconds" }, "Source Control Footprint (Immutable Anchor)": { "Active Branch": "HEAD", "Commit Hash (SHA-1)": "12fc7affb76fbecfeaf93f38b7b5e7597d8f294b", - "Remote Origin URL": "https://github.com/squid-protocol/language-crucible", + "Remote Origin URL": "https://github.com/squid-protocol/language-crucible.git", "Last Code Integration Date": "2026-07-03T07:10:50-04:00" } }, @@ -196,9 +196,9 @@ } }, "health": { - "avg_cognitive_load": 24.698, + "avg_cognitive_load": 24.775, "avg_safety_score": 38.601, - "avg_tech_debt": 23.315, + "avg_tech_debt": 23.314, "avg_documentation": 21.504 }, "composition": { @@ -245,7 +245,7 @@ "c": { "files": 44, "loc": 74236, - "impact": 100817.62 + "impact": 103513.51999999999 }, "batch": { "files": 3, @@ -295,7 +295,7 @@ "cpp": { "files": 33, "loc": 44844, - "impact": 58710.87999999999 + "impact": 59647.78 }, "csharp": { "files": 8, @@ -641,9 +641,9 @@ }, "c/sqlite": { "file_count": 2, - "total_mass": 9960.96, + "total_mass": 9954.46, "avg_exposures": { - "cognitive_load": 45.81, + "cognitive_load": 45.8, "safety_score": 49.78, "tech_debt": 4.01, "verification": 40.0, @@ -698,13 +698,13 @@ }, "cpp/godot": { "file_count": 16, - "total_mass": 38646.68, + "total_mass": 39566.98, "avg_exposures": { "cognitive_load": 59.79, - "safety_score": 73.57, + "safety_score": 73.56, "tech_debt": 22.47, "verification": 55.29, - "api_exposure": 5.28, + "api_exposure": 5.29, "concurrency": 0.0, "state_flux": 81.22, "dead_code": 2.11, @@ -1021,11 +1021,11 @@ }, "c/cpython": { "file_count": 8, - "total_mass": 33171.04, + "total_mass": 35273.84, "avg_exposures": { - "cognitive_load": 66.29, + "cognitive_load": 72.91, "safety_score": 86.01, - "tech_debt": 35.03, + "tech_debt": 34.97, "verification": 70.29, "api_exposure": 13.77, "concurrency": 0.0, @@ -1078,7 +1078,7 @@ }, "assembly/cosmopolitan": { "file_count": 4, - "total_mass": 1965.06, + "total_mass": 1953.56, "avg_exposures": { "cognitive_load": 26.18, "safety_score": 38.28, @@ -1091,7 +1091,7 @@ "spec_match": 76.67, "stability": 50.0, "churn": 0.0, - "documentation": 35.97, + "documentation": 35.96, "secrets_risk": 0.0 } }, @@ -1116,7 +1116,7 @@ }, "c/micropython": { "file_count": 12, - "total_mass": 11109.94, + "total_mass": 11101.74, "avg_exposures": { "cognitive_load": 49.19, "safety_score": 53.58, @@ -1135,9 +1135,9 @@ }, "cobol/gnucobol_internals": { "file_count": 5, - "total_mass": 15231.85, + "total_mass": 15851.15, "avg_exposures": { - "cognitive_load": 44.54, + "cognitive_load": 48.26, "safety_score": 68.48, "tech_debt": 14.48, "verification": 48.92, @@ -1952,7 +1952,7 @@ }, "livecode/core": { "file_count": 11, - "total_mass": 26635.82, + "total_mass": 26652.42, "avg_exposures": { "cognitive_load": 33.19, "safety_score": 56.39, @@ -14697,7 +14697,7 @@ } }, "cpp/godot": { - "Directory Group Magnitude": 38646.68, + "Directory Group Magnitude": 39566.98, "File Count": 16, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "81.2%", @@ -14705,10 +14705,10 @@ }, "Average Risk Exposures": { "Cognitive Load Exposure": "59.79%", - "Error & Exception Exposure": "73.57%", + "Error & Exception Exposure": "73.56%", "Tech Debt Exposure": "22.47%", "Testing Exposure": "55.29%", - "API Exposure": "5.28%", + "API Exposure": "5.29%", "Concurrency Exposure": "0.0%", "State Flux Exposure": "81.22%", "Commented Logic Exposure": "2.11%", @@ -15678,7 +15678,7 @@ "Total LOC": 9612, "Coding LOC": 7678, "Documentation LOC": 441, - "Structural Magnitude": 9804.26, + "Structural Magnitude": 9805.86, "Control Flow Ratio": "79.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -15687,7 +15687,7 @@ "Raw Cognitive Density": 1.387 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "92.33%", + "Cognitive Load Exposure": "92.35%", "Error & Exception Exposure": "96.22%", "Tech Debt Exposure": "97.01%", "Testing Exposure": "80.0%", @@ -18362,6 +18362,16 @@ "Start Line": 7948, "End Line": 7950 }, + { + "Function Name": "get_game_view_plugin", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 3, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 8278, + "End Line": 8280 + }, { "Function Name": "EditorNode::open_setting_override", "Structural Impact": 1.6, @@ -19449,16 +19459,16 @@ "Total LOC": 4040, "Coding LOC": 3258, "Documentation LOC": 95, - "Structural Magnitude": 7029.66, + "Structural Magnitude": 7487.06, "Control Flow Ratio": "92.7%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.517 + "Raw Cognitive Density": 1.531 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "94.56%", + "Cognitive Load Exposure": "94.79%", "Error & Exception Exposure": "99.68%", "Tech Debt Exposure": "14.64%", "Testing Exposure": "80.0%", @@ -19503,6 +19513,16 @@ "Start Line": 760, "End Line": 2411 }, + { + "Function Name": "OPCODE_WHILE", + "Structural Impact": 457.4, + "Lines of Code (LOC)": 1653, + "Control Flow Branches": 264, + "Input Parameters": 1, + "Control Flow Ratio": "98.5%", + "Start Line": 757, + "End Line": 2409 + }, { "Function Name": "OPCODE", "Structural Impact": 64.2, @@ -20684,20 +20704,20 @@ "Total LOC": 5377, "Coding LOC": 4227, "Documentation LOC": 374, - "Structural Magnitude": 6806.44, + "Structural Magnitude": 7266.44, "Control Flow Ratio": "93.3%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.563 + "Raw Cognitive Density": 1.564 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "94.34%", + "Cognitive Load Exposure": "94.35%", "Error & Exception Exposure": "98.81%", "Tech Debt Exposure": "11.52%", "Testing Exposure": "80.0%", - "API Exposure": "7.09%", + "API Exposure": "7.3%", "Concurrency Exposure": "0.0%", "State Flux Exposure": "100.0%", "Commented Logic Exposure": "8.84%", @@ -20719,24 +20739,24 @@ "End Line": 2632 }, { - "Function Name": "Main::start", - "Structural Impact": 384.7, - "Lines of Code (LOC)": 878, - "Control Flow Branches": 240, + "Function Name": "Main::setup2", + "Structural Impact": 675.2, + "Lines of Code (LOC)": 1512, + "Control Flow Branches": 423, "Input Parameters": 1, - "Control Flow Ratio": "92.0%", - "Start Line": 3987, - "End Line": 4864 + "Control Flow Ratio": "94.4%", + "Start Line": 3007, + "End Line": 4518 }, { - "Function Name": "Main::setup2", - "Structural Impact": 375.3, - "Lines of Code (LOC)": 887, - "Control Flow Branches": 233, + "Function Name": "Main::start", + "Structural Impact": 506.5, + "Lines of Code (LOC)": 1390, + "Control Flow Branches": 308, "Input Parameters": 1, - "Control Flow Ratio": "98.3%", - "Start Line": 3007, - "End Line": 3893 + "Control Flow Ratio": "92.2%", + "Start Line": 3987, + "End Line": 5376 }, { "Function Name": "Main::print_help", @@ -20788,6 +20808,16 @@ "Start Line": 490, "End Line": 524 }, + { + "Function Name": "Main::test_cleanup", + "Structural Impact": 20.1, + "Lines of Code (LOC)": 91, + "Control Flow Branches": 10, + "Input Parameters": 1, + "Control Flow Ratio": "90.9%", + "Start Line": 881, + "End Line": 971 + }, { "Function Name": "Main::test_entrypoint", "Structural Impact": 19.4, @@ -20798,6 +20828,16 @@ "Start Line": 974, "End Line": 1000 }, + { + "Function Name": "Main::test_setup", + "Structural Impact": 18.2, + "Lines of Code (LOC)": 136, + "Control Flow Branches": 8, + "Input Parameters": 1, + "Control Flow Ratio": "88.9%", + "Start Line": 743, + "End Line": 878 + }, { "Function Name": "get_files_with_extension", "Structural Impact": 16.7, @@ -21010,8 +21050,8 @@ "Type/Safety Bypasses": 1, "High-Risk Execution Commands": 12, "I/O and Network Boundaries": 0, - "Exposed API / Public Exports": 20, - "State Mutations / Variable Reassignments": 4077, + "Exposed API / Public Exports": 22, + "State Mutations / Variable Reassignments": 4075, "Commented-out Code (Dead Logic)": 4, "Structured Documentation Blocks": 10, "Unit Test Assertions": 0, @@ -23901,9 +23941,9 @@ "Identity Proof": "Sibling Anchor (C++)" }, "2. Topological Coordinates": { - "X": -87.0, - "Y": 89.59, - "Z": 3636.74 + "X": -86.95, + "Y": 89.6, + "Z": 3636.76 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -23915,16 +23955,16 @@ "Total LOC": 945, "Coding LOC": 670, "Documentation LOC": 81, - "Structural Magnitude": 507.0, + "Structural Magnitude": 509.2, "Control Flow Ratio": "12.5%", "Popularity Rank": 1, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.467 + "Raw Cognitive Density": 1.47 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "72.26%", + "Cognitive Load Exposure": "72.31%", "Error & Exception Exposure": "88.16%", "Tech Debt Exposure": "0.0%", "Testing Exposure": "80.0%", @@ -24209,6 +24249,16 @@ "Start Line": 165, "End Line": 165 }, + { + "Function Name": "_emit_editor_state_changed", + "Structural Impact": 1.1, + "Lines of Code (LOC)": 1, + "Control Flow Branches": 0, + "Input Parameters": 0, + "Control Flow Ratio": "0.0%", + "Start Line": 371, + "End Line": 371 + }, { "Function Name": "_block", "Structural Impact": 1.1, @@ -24309,6 +24359,16 @@ "Start Line": 559, "End Line": 559 }, + { + "Function Name": "is_part_of_edited_scene", + "Structural Impact": 1.1, + "Lines of Code (LOC)": 1, + "Control Flow Branches": 0, + "Input Parameters": 0, + "Control Flow Ratio": "0.0%", + "Start Line": 639, + "End Line": 639 + }, { "Function Name": "is_group_processing", "Structural Impact": 1.1, @@ -26456,9 +26516,9 @@ "Identity Proof": "Sibling Anchor (C++)" }, "2. Topological Coordinates": { - "X": -361.44, + "X": -361.45, "Y": 52.28, - "Z": 2591.54 + "Z": 2591.57 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -26470,17 +26530,17 @@ "Total LOC": 1244, "Coding LOC": 873, "Documentation LOC": 82, - "Structural Magnitude": 408.46, + "Structural Magnitude": 407.56, "Control Flow Ratio": "34.1%", "Popularity Rank": 1, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.086 + "Raw Cognitive Density": 1.081 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "64.79%", - "Error & Exception Exposure": "78.37%", + "Cognitive Load Exposure": "64.54%", + "Error & Exception Exposure": "78.19%", "Tech Debt Exposure": "9.36%", "Testing Exposure": "80.0%", "API Exposure": "6.17%", @@ -26584,6 +26644,16 @@ "Start Line": 67, "End Line": 67 }, + { + "Function Name": "redraw_request", + "Structural Impact": 1.1, + "Lines of Code (LOC)": 3, + "Control Flow Branches": 0, + "Input Parameters": 0, + "Control Flow Ratio": "0.0%", + "Start Line": 111, + "End Line": 113 + }, { "Function Name": "is_on_render_thread", "Structural Impact": 1.1, @@ -26607,7 +26677,7 @@ "High-Risk Execution Commands": 1, "I/O and Network Boundaries": 0, "Exposed API / Public Exports": 8, - "State Mutations / Variable Reassignments": 326, + "State Mutations / Variable Reassignments": 324, "Commented-out Code (Dead Logic)": 2, "Structured Documentation Blocks": 4, "Unit Test Assertions": 0, @@ -29035,15 +29105,15 @@ } }, "c/cpython": { - "Directory Group Magnitude": 33171.04, + "Directory Group Magnitude": 35273.84, "File Count": 8, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" }, "Average Risk Exposures": { - "Cognitive Load Exposure": "66.29%", + "Cognitive Load Exposure": "72.91%", "Error & Exception Exposure": "86.01%", - "Tech Debt Exposure": "35.03%", + "Tech Debt Exposure": "34.97%", "Testing Exposure": "70.29%", "API Exposure": "13.77%", "Concurrency Exposure": "0.0%", @@ -29237,9 +29307,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": -1391.44, - "Y": 145.71, - "Z": -1755.68 + "X": -1390.94, + "Y": 145.69, + "Z": -1761.38 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -29251,16 +29321,16 @@ "Total LOC": 3840, "Coding LOC": 3294, "Documentation LOC": 244, - "Structural Magnitude": 4545.98, + "Structural Magnitude": 6161.48, "Control Flow Ratio": "68.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.083 + "Raw Cognitive Density": 1.526 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "78.08%", + "Cognitive Load Exposure": "94.47%", "Error & Exception Exposure": "90.27%", "Tech Debt Exposure": "9.09%", "Testing Exposure": "80.0%", @@ -29275,6 +29345,36 @@ "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ + { + "Function Name": "_Py_CheckRecursiveCall", + "Structural Impact": 620.8, + "Lines of Code (LOC)": 1677, + "Control Flow Branches": 309, + "Input Parameters": 2, + "Control Flow Ratio": "80.9%", + "Start Line": 282, + "End Line": 1958 + }, + { + "Function Name": "_Py_ReachedRecursionLimitWithMargin", + "Structural Impact": 561.2, + "Lines of Code (LOC)": 1732, + "Control Flow Branches": 273, + "Input Parameters": 2, + "Control Flow Ratio": "72.2%", + "Start Line": 28, + "End Line": 1759 + }, + { + "Function Name": "_Py_EnterRecursiveCallUnchecked", + "Structural Impact": 477.3, + "Lines of Code (LOC)": 1739, + "Control Flow Branches": 275, + "Input Parameters": 1, + "Control Flow Ratio": "72.9%", + "Start Line": 52, + "End Line": 1790 + }, { "Function Name": "initialize_locals", "Structural Impact": 226.7, @@ -29505,16 +29605,6 @@ "Start Line": 3409, "End Line": 3444 }, - { - "Function Name": "_Py_ReachedRecursionLimitWithMargin", - "Structural Impact": 18.5, - "Lines of Code (LOC)": 23, - "Control Flow Branches": 9, - "Input Parameters": 2, - "Control Flow Ratio": "75.0%", - "Start Line": 28, - "End Line": 50 - }, { "Function Name": "_PyEval_GetIter", "Structural Impact": 17.7, @@ -29525,16 +29615,6 @@ "Start Line": 1169, "End Line": 1202 }, - { - "Function Name": "_Py_CheckRecursiveCall", - "Structural Impact": 17.6, - "Lines of Code (LOC)": 40, - "Control Flow Branches": 8, - "Input Parameters": 2, - "Control Flow Ratio": "80.0%", - "Start Line": 282, - "End Line": 321 - }, { "Function Name": "_PyEval_LoadName", "Structural Impact": 17.6, @@ -29895,16 +29975,6 @@ "Start Line": 2773, "End Line": 2790 }, - { - "Function Name": "_Py_EnterRecursiveCallUnchecked", - "Structural Impact": 7.7, - "Lines of Code (LOC)": 13, - "Control Flow Branches": 4, - "Input Parameters": 1, - "Control Flow Ratio": "80.0%", - "Start Line": 52, - "End Line": 64 - }, { "Function Name": "_PyEval_GetFrameLocals", "Structural Impact": 7.7, @@ -31319,18 +31389,18 @@ "Total LOC": 8326, "Coding LOC": 6573, "Documentation LOC": 821, - "Structural Magnitude": 7722.56, + "Structural Magnitude": 8237.26, "Control Flow Ratio": "63.3%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.038 + "Raw Cognitive Density": 1.409 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "75.5%", - "Error & Exception Exposure": "87.32%", - "Tech Debt Exposure": "32.24%", + "Cognitive Load Exposure": "92.7%", + "Error & Exception Exposure": "87.3%", + "Tech Debt Exposure": "31.74%", "Testing Exposure": "80.0%", "API Exposure": "13.63%", "Concurrency Exposure": "0.0%", @@ -31339,10 +31409,20 @@ "Specification Exposure": "100.0%", "Instability Exposure": "50.0%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "99.7%", + "Documentation Exposure": "99.71%", "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ + { + "Function Name": "dictiter_iternextitem", + "Structural Impact": 486.1, + "Lines of Code (LOC)": 1888, + "Control Flow Branches": 276, + "Input Parameters": 1, + "Control Flow Ratio": "64.6%", + "Start Line": 5994, + "End Line": 7881 + }, { "Function Name": "_PyDict_FromKeys", "Structural Impact": 82.8, @@ -31533,6 +31613,16 @@ "Start Line": 1942, "End Line": 2009 }, + { + "Function Name": "dictiter_iternextkey_lock_held", + "Structural Impact": 34.5, + "Lines of Code (LOC)": 66, + "Control Flow Branches": 17, + "Input Parameters": 2, + "Control Flow Ratio": "85.0%", + "Start Line": 5524, + "End Line": 5589 + }, { "Function Name": "dictiter_iternextvalue_lock_held", "Structural Impact": 34.4, @@ -32083,16 +32173,6 @@ "Start Line": 3756, "End Line": 3792 }, - { - "Function Name": "dictiter_iternextitem", - "Structural Impact": 11.6, - "Lines of Code (LOC)": 35, - "Control Flow Branches": 6, - "Input Parameters": 1, - "Control Flow Ratio": "66.7%", - "Start Line": 5994, - "End Line": 6028 - }, { "Function Name": "frozendict_or", "Structural Impact": 11.4, @@ -32233,16 +32313,6 @@ "Start Line": 6700, "End Line": 6720 }, - { - "Function Name": "_PyObject_ManagedDictValidityCheck", - "Structural Impact": 9.7, - "Lines of Code (LOC)": 25, - "Control Flow Branches": 5, - "Input Parameters": 1, - "Control Flow Ratio": "83.3%", - "Start Line": 7399, - "End Line": 7423 - }, { "Function Name": "dictitems_contains", "Structural Impact": 9.6, @@ -32483,6 +32553,16 @@ "Start Line": 7329, "End Line": 7343 }, + { + "Function Name": "_Py_dict_lookup_threadsafe_stackref", + "Structural Impact": 7.4, + "Lines of Code (LOC)": 13, + "Control Flow Branches": 2, + "Input Parameters": 4, + "Control Flow Ratio": "66.7%", + "Start Line": 1704, + "End Line": 1716 + }, { "Function Name": "new_dict", "Structural Impact": 7.3, @@ -33313,6 +33393,16 @@ "Start Line": 938, "End Line": 944 }, + { + "Function Name": "_Py_dict_lookup_threadsafe", + "Structural Impact": 2.6, + "Lines of Code (LOC)": 7, + "Control Flow Branches": 0, + "Input Parameters": 4, + "Control Flow Ratio": "0.0%", + "Start Line": 1696, + "End Line": 1702 + }, { "Function Name": "unicodekeys_lookup_generic", "Structural Impact": 2.5, @@ -33633,6 +33723,26 @@ "Start Line": 209, "End Line": 214 }, + { + "Function Name": "set_keys", + "Structural Impact": 2.0, + "Lines of Code (LOC)": 5, + "Control Flow Branches": 0, + "Input Parameters": 2, + "Control Flow Ratio": "0.0%", + "Start Line": 269, + "End Line": 273 + }, + { + "Function Name": "set_values", + "Structural Impact": 2.0, + "Lines of Code (LOC)": 5, + "Control Flow Branches": 0, + "Input Parameters": 2, + "Control Flow Ratio": "0.0%", + "Start Line": 275, + "End Line": 279 + }, { "Function Name": "insertion_resize", "Structural Impact": 2.0, @@ -33823,6 +33933,26 @@ "Start Line": 195, "End Line": 200 }, + { + "Function Name": "split_keys_entry_added", + "Structural Impact": 1.7, + "Lines of Code (LOC)": 5, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 263, + "End Line": 267 + }, + { + "Function Name": "load_keys_nentries", + "Structural Impact": 1.7, + "Lines of Code (LOC)": 5, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 281, + "End Line": 285 + }, { "Function Name": "unicode_get_hash", "Structural Impact": 1.7, @@ -34016,7 +34146,7 @@ "High-Risk Execution Commands": 0, "I/O and Network Boundaries": 0, "Exposed API / Public Exports": 1319, - "State Mutations / Variable Reassignments": 3300, + "State Mutations / Variable Reassignments": 3298, "Commented-out Code (Dead Logic)": 5, "Structured Documentation Blocks": 5, "Unit Test Assertions": 291, @@ -34079,7 +34209,7 @@ "Design Short Vars": 185, "Design Long Vars": 0, "Duplicate Logic": 0, - "Orphaned Logic": 68, + "Orphaned Logic": 67, "Instructional Code Examples": 0, "Architectural Diagrams (Mermaid/PlantUML)": 0, "Structured Literature Headers": 0, @@ -34143,9 +34273,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": -1986.47, + "X": -1986.28, "Y": 137.89, - "Z": -1506.98 + "Z": -1506.95 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -34157,20 +34287,20 @@ "Total LOC": 2451, "Coding LOC": 1936, "Documentation LOC": 235, - "Structural Magnitude": 2540.12, + "Structural Magnitude": 2509.42, "Control Flow Ratio": "61.8%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 0.98 + "Raw Cognitive Density": 1.324 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "71.49%", + "Cognitive Load Exposure": "90.87%", "Error & Exception Exposure": "91.29%", "Tech Debt Exposure": "8.75%", "Testing Exposure": "80.0%", - "API Exposure": "13.67%", + "API Exposure": "13.66%", "Concurrency Exposure": "0.0%", "State Flux Exposure": "100.0%", "Commented Logic Exposure": "4.91%", @@ -34301,16 +34431,6 @@ "Start Line": 762, "End Line": 791 }, - { - "Function Name": "print_stack", - "Structural Impact": 13.7, - "Lines of Code (LOC)": 19, - "Control Flow Branches": 8, - "Input Parameters": 1, - "Control Flow Ratio": "80.0%", - "Start Line": 1284, - "End Line": 1302 - }, { "Function Name": "framelocalsproxy_new", "Structural Impact": 13.6, @@ -34331,16 +34451,6 @@ "Start Line": 734, "End Line": 760 }, - { - "Function Name": "tos_char", - "Structural Impact": 12.1, - "Lines of Code (LOC)": 16, - "Control Flow Branches": 7, - "Input Parameters": 1, - "Control Flow Ratio": "53.8%", - "Start Line": 1267, - "End Line": 1282 - }, { "Function Name": "framelocalsproxy_getitem", "Structural Impact": 11.9, @@ -34631,16 +34741,6 @@ "Start Line": 714, "End Line": 721 }, - { - "Function Name": "print_stacks", - "Structural Impact": 3.9, - "Lines of Code (LOC)": 8, - "Control Flow Branches": 1, - "Input Parameters": 2, - "Control Flow Ratio": "50.0%", - "Start Line": 1304, - "End Line": 1311 - }, { "Function Name": "frame_tp_clear", "Structural Impact": 3.9, @@ -34993,7 +35093,7 @@ "Type/Safety Bypasses": 25, "High-Risk Execution Commands": 0, "I/O and Network Boundaries": 7, - "Exposed API / Public Exports": 472, + "Exposed API / Public Exports": 471, "State Mutations / Variable Reassignments": 1144, "Commented-out Code (Dead Logic)": 1, "Structured Documentation Blocks": 0, @@ -38047,7 +38147,7 @@ "Total LOC": 12874, "Coding LOC": 9970, "Documentation LOC": 1437, - "Structural Magnitude": 11317.9, + "Structural Magnitude": 11321.2, "Control Flow Ratio": "61.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -41181,6 +41281,16 @@ "Start Line": 7337, "End Line": 7346 }, + { + "Function Name": "update_all_slots", + "Structural Impact": 3.3, + "Lines of Code (LOC)": 10, + "Control Flow Branches": 1, + "Input Parameters": 1, + "Control Flow Ratio": "50.0%", + "Start Line": 11977, + "End Line": 11986 + }, { "Function Name": "fixup_slot_dispatchers", "Structural Impact": 3.2, @@ -42182,7 +42292,7 @@ } }, "livecode/core": { - "Directory Group Magnitude": 26635.82, + "Directory Group Magnitude": 26652.42, "File Count": 11, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" @@ -44075,7 +44185,7 @@ "Total LOC": 7360, "Coding LOC": 5338, "Documentation LOC": 634, - "Structural Magnitude": 7073.66, + "Structural Magnitude": 7090.26, "Control Flow Ratio": "64.4%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -44085,7 +44195,7 @@ }, "4. Vulnerability & Risk Exposures": { "Cognitive Load Exposure": "35.42%", - "Error & Exception Exposure": "95.46%", + "Error & Exception Exposure": "95.44%", "Tech Debt Exposure": "81.19%", "Testing Exposure": "80.0%", "API Exposure": "0.0%", @@ -45239,6 +45349,16 @@ "Start Line": 3699, "End Line": 3714 }, + { + "Function Name": "MCStringConvertToSysString", + "Structural Impact": 8.1, + "Lines of Code (LOC)": 42, + "Control Flow Branches": 2, + "Input Parameters": 3, + "Control Flow Ratio": "40.0%", + "Start Line": 6669, + "End Line": 6710 + }, { "Function Name": "MCStringMutableCopy", "Structural Impact": 8.0, @@ -45269,6 +45389,16 @@ "Start Line": 4553, "End Line": 4574 }, + { + "Function Name": "MCStringCreateWithSysString", + "Structural Impact": 8.0, + "Lines of Code (LOC)": 21, + "Control Flow Branches": 3, + "Input Parameters": 2, + "Control Flow Ratio": "60.0%", + "Start Line": 6723, + "End Line": 6743 + }, { "Function Name": "__MCStringCountGraphemesInRange", "Structural Impact": 7.9, @@ -45659,6 +45789,16 @@ "Start Line": 5114, "End Line": 5124 }, + { + "Function Name": "MCStringConvertToSysString", + "Structural Impact": 4.5, + "Lines of Code (LOC)": 10, + "Control Flow Branches": 1, + "Input Parameters": 3, + "Control Flow Ratio": "33.3%", + "Start Line": 6712, + "End Line": 6721 + }, { "Function Name": "MCStringConvertToCString", "Structural Impact": 4.2, @@ -46342,7 +46482,7 @@ "High-Risk Execution Commands": 5, "I/O and Network Boundaries": 0, "Exposed API / Public Exports": 0, - "State Mutations / Variable Reassignments": 3725, + "State Mutations / Variable Reassignments": 3721, "Commented-out Code (Dead Logic)": 9, "Structured Documentation Blocks": 883, "Unit Test Assertions": 0, @@ -62709,13 +62849,13 @@ } }, "cobol/gnucobol_internals": { - "Directory Group Magnitude": 15231.85, + "Directory Group Magnitude": 15851.15, "File Count": 5, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" }, "Average Risk Exposures": { - "Cognitive Load Exposure": "44.54%", + "Cognitive Load Exposure": "48.26%", "Error & Exception Exposure": "68.48%", "Tech Debt Exposure": "14.48%", "Testing Exposure": "48.92%", @@ -62757,7 +62897,7 @@ "Total LOC": 7364, "Coding LOC": 6537, "Documentation LOC": 315, - "Structural Magnitude": 10873.84, + "Structural Magnitude": 10878.84, "Control Flow Ratio": "78.0%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -63951,6 +64091,16 @@ "Start Line": 5856, "End Line": 5868 }, + { + "Function Name": "lock_record", + "Structural Impact": 2.9, + "Lines of Code (LOC)": 13, + "Control Flow Branches": 0, + "Input Parameters": 4, + "Control Flow Ratio": "0.0%", + "Start Line": 1967, + "End Line": 1979 + }, { "Function Name": "cob_file_sort_init_key", "Structural Impact": 2.7, @@ -63961,6 +64111,16 @@ "Start Line": 7062, "End Line": 7070 }, + { + "Function Name": "unlock_record", + "Structural Impact": 2.1, + "Lines of Code (LOC)": 7, + "Control Flow Branches": 0, + "Input Parameters": 2, + "Control Flow Ratio": "0.0%", + "Start Line": 1981, + "End Line": 1987 + }, { "Function Name": "cob_file_set_lock", "Structural Impact": 2.1, @@ -64177,9 +64337,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": -5269.94, - "Y": -79.48, - "Z": -3494.59 + "X": -5272.26, + "Y": -80.13, + "Z": -3492.44 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -64191,16 +64351,16 @@ "Total LOC": 2689, "Coding LOC": 2299, "Documentation LOC": 138, - "Structural Magnitude": 2953.68, + "Structural Magnitude": 3567.98, "Control Flow Ratio": "71.6%", "Popularity Rank": 1, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.012 + "Raw Cognitive Density": 1.388 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "73.51%", + "Cognitive Load Exposure": "92.09%", "Error & Exception Exposure": "92.09%", "Tech Debt Exposure": "38.29%", "Testing Exposure": "80.0%", @@ -64215,6 +64375,16 @@ "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ + { + "Function Name": "cob_decimal_set_display", + "Structural Impact": 641.6, + "Lines of Code (LOC)": 1470, + "Control Flow Branches": 327, + "Input Parameters": 2, + "Control Flow Ratio": "68.4%", + "Start Line": 1219, + "End Line": 2688 + }, { "Function Name": "cob_decimal_get_binary", "Structural Impact": 87.1, @@ -64365,16 +64535,6 @@ "Start Line": 607, "End Line": 655 }, - { - "Function Name": "cob_decimal_set_display", - "Structural Impact": 27.3, - "Lines of Code (LOC)": 62, - "Control Flow Branches": 13, - "Input Parameters": 2, - "Control Flow Ratio": "81.2%", - "Start Line": 1219, - "End Line": 1280 - }, { "Function Name": "cob_set_packed_int", "Structural Impact": 26.4, @@ -114202,7 +114362,7 @@ } }, "c/micropython": { - "Directory Group Magnitude": 11109.94, + "Directory Group Magnitude": 11101.74, "File Count": 12, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" @@ -116886,9 +117046,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": 1135.44, + "X": 1135.39, "Y": -108.66, - "Z": -2592.0 + "Z": -2592.06 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -116900,7 +117060,7 @@ "Total LOC": 1408, "Coding LOC": 981, "Documentation LOC": 258, - "Structural Magnitude": 1447.62, + "Structural Magnitude": 1439.42, "Control Flow Ratio": "70.7%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -116954,16 +117114,6 @@ "Start Line": 1115, "End Line": 1263 }, - { - "Function Name": "gc_mark_subtree", - "Structural Impact": 40.0, - "Lines of Code (LOC)": 72, - "Control Flow Branches": 20, - "Input Parameters": 2, - "Control Flow Ratio": "76.9%", - "Start Line": 501, - "End Line": 572 - }, { "Function Name": "gc_info", "Structural Impact": 37.5, @@ -116974,6 +117124,16 @@ "Start Line": 755, "End Line": 826 }, + { + "Function Name": "gc_mark_subtree", + "Structural Impact": 31.8, + "Lines of Code (LOC)": 70, + "Control Flow Branches": 19, + "Input Parameters": 1, + "Control Flow Ratio": "79.2%", + "Start Line": 503, + "End Line": 572 + }, { "Function Name": "gc_setup_area", "Structural Impact": 30.3, @@ -119279,14 +119439,14 @@ } }, "c/sqlite": { - "Directory Group Magnitude": 9960.96, + "Directory Group Magnitude": 9954.46, "File Count": 2, "Ecosystem Fingerprint (Archetypes)": { "Static: Literature & Documentation": "50.0%", "Unclassified": "50.0%" }, "Average Risk Exposures": { - "Cognitive Load Exposure": "45.81%", + "Cognitive Load Exposure": "45.8%", "Error & Exception Exposure": "49.78%", "Tech Debt Exposure": "4.01%", "Testing Exposure": "40.0%", @@ -119485,7 +119645,7 @@ "Total LOC": 6076, "Coding LOC": 4862, "Documentation LOC": 876, - "Structural Magnitude": 9952.44, + "Structural Magnitude": 9945.94, "Control Flow Ratio": "68.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -119494,7 +119654,7 @@ "Raw Cognitive Density": 1.511 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "91.62%", + "Cognitive Load Exposure": "91.61%", "Error & Exception Exposure": "99.56%", "Tech Debt Exposure": "8.03%", "Testing Exposure": "80.0%", @@ -120419,16 +120579,6 @@ "Start Line": 3276, "End Line": 3285 }, - { - "Function Name": "SetPrint", - "Structural Impact": 3.9, - "Lines of Code (LOC)": 17, - "Control Flow Branches": 2, - "Input Parameters": 0, - "Control Flow Ratio": "50.0%", - "Start Line": 3445, - "End Line": 3461 - }, { "Function Name": "SetAdd", "Structural Impact": 3.9, @@ -120569,16 +120719,6 @@ "Start Line": 1578, "End Line": 1585 }, - { - "Function Name": "PlinkPrint", - "Structural Impact": 2.6, - "Lines of Code (LOC)": 12, - "Control Flow Branches": 1, - "Input Parameters": 0, - "Control Flow Ratio": "33.3%", - "Start Line": 3464, - "End Line": 3475 - }, { "Function Name": "lemon_free_all", "Structural Impact": 2.4, @@ -341534,7 +341674,7 @@ } }, "assembly/cosmopolitan": { - "Directory Group Magnitude": 1965.06, + "Directory Group Magnitude": 1953.56, "File Count": 4, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" @@ -341551,7 +341691,7 @@ "Specification Exposure": "76.67%", "Instability Exposure": "50.0%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "35.97%", + "Documentation Exposure": "35.96%", "Hardcoded Payload Artifacts": "0.0%" }, "Files": { @@ -341568,9 +341708,9 @@ "Identity Proof": "Single Indicator (Ext: .s)" }, "2. Topological Coordinates": { - "X": -4898.56, - "Y": 134.99, - "Z": 1491.95 + "X": -4898.37, + "Y": 135.0, + "Z": 1491.84 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -342338,9 +342478,9 @@ "Identity Proof": "Ecosystem Consensus Lock (70% Local Dominance)" }, "2. Topological Coordinates": { - "X": -4348.03, - "Y": 124.76, - "Z": 1788.82 + "X": -4347.99, + "Y": 124.77, + "Z": 1788.71 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -342495,9 +342635,9 @@ "Identity Proof": "Single Indicator (Ext: .s)" }, "2. Topological Coordinates": { - "X": -4638.36, - "Y": 160.66, - "Z": 900.64 + "X": -4638.27, + "Y": 160.65, + "Z": 900.71 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -342723,9 +342863,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": -4614.46, + "X": -4614.35, "Y": 101.25, - "Z": 1292.86 + "Z": 1292.83 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -342737,7 +342877,7 @@ "Total LOC": 1128, "Coding LOC": 911, "Documentation LOC": 134, - "Structural Magnitude": 1552.92, + "Structural Magnitude": 1541.42, "Control Flow Ratio": "74.8%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -342750,14 +342890,14 @@ "Error & Exception Exposure": "97.99%", "Tech Debt Exposure": "9.75%", "Testing Exposure": "80.0%", - "API Exposure": "12.18%", + "API Exposure": "12.15%", "Concurrency Exposure": "0.0%", "State Flux Exposure": "100.0%", "Commented Logic Exposure": "5.12%", "Specification Exposure": "100.0%", "Instability Exposure": "50.0%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "99.0%", + "Documentation Exposure": "98.96%", "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ @@ -342931,16 +343071,6 @@ "Start Line": 391, "End Line": 403 }, - { - "Function Name": "StrRChr", - "Structural Impact": 7.5, - "Lines of Code (LOC)": 11, - "Control Flow Branches": 3, - "Input Parameters": 2, - "Control Flow Ratio": "75.0%", - "Start Line": 248, - "End Line": 258 - }, { "Function Name": "AccessCommand", "Structural Impact": 7.4, @@ -343031,16 +343161,6 @@ "Start Line": 232, "End Line": 237 }, - { - "Function Name": "BaseName", - "Structural Impact": 3.0, - "Lines of Code (LOC)": 4, - "Control Flow Branches": 1, - "Input Parameters": 1, - "Control Flow Ratio": "50.0%", - "Start Line": 260, - "End Line": 263 - }, { "Function Name": "ShowUsage", "Structural Impact": 2.8, @@ -343073,7 +343193,7 @@ "Type/Safety Bypasses": 9, "High-Risk Execution Commands": 0, "I/O and Network Boundaries": 4, - "Exposed API / Public Exports": 148, + "Exposed API / Public Exports": 147, "State Mutations / Variable Reassignments": 773, "Commented-out Code (Dead Logic)": 1, "Structured Documentation Blocks": 1, @@ -419701,9 +419821,9 @@ "Identity Proof": "Single Indicator (Ext: .csv)" }, "2. Topological Coordinates": { - "X": -5362.5, + "X": -5362.24, "Y": 187.56, - "Z": 1320.58 + "Z": 1320.52 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -419858,9 +419978,9 @@ "Identity Proof": "Single Indicator (Ext: .tsv)" }, "2. Topological Coordinates": { - "X": -5602.66, + "X": -5602.4, "Y": 221.85, - "Z": 1440.19 + "Z": 1440.13 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -430213,9 +430333,9 @@ "Identity Proof": "Single Indicator (Ext: .html)" }, "2. Topological Coordinates": { - "X": -5187.29, + "X": -5187.06, "Y": 14.4, - "Z": 1847.04 + "Z": 1846.96 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", diff --git a/tests/golden_master_zero_dep_audit.json b/tests/golden_master_zero_dep_audit.json index e76be6311..2aadd848d 100644 --- a/tests/golden_master_zero_dep_audit.json +++ b/tests/golden_master_zero_dep_audit.json @@ -11,14 +11,14 @@ "pyyaml": false }, "Target Root Name": "data", - "Absolute Project Path": "/home/joe/nyx_projects/language-crucible/data", - "Analysis ISO Timestamp": "2026-08-16T13:10:43.269891+00:00", - "Total Scan Duration": "34.99 seconds" + "Absolute Project Path": "H:\\deepseek work\\language-crucible\\data", + "Analysis ISO Timestamp": "2026-08-16T16:54:29.631068+00:00", + "Total Scan Duration": "16.43 seconds" }, "Source Control Footprint (Immutable Anchor)": { "Active Branch": "HEAD", "Commit Hash (SHA-1)": "12fc7affb76fbecfeaf93f38b7b5e7597d8f294b", - "Remote Origin URL": "https://github.com/squid-protocol/language-crucible", + "Remote Origin URL": "https://github.com/squid-protocol/language-crucible.git", "Last Code Integration Date": "2026-07-03T07:10:50-04:00" } }, @@ -196,9 +196,9 @@ } }, "health": { - "avg_cognitive_load": 24.698, + "avg_cognitive_load": 24.775, "avg_safety_score": 38.601, - "avg_tech_debt": 23.315, + "avg_tech_debt": 23.314, "avg_documentation": 21.504 }, "composition": { @@ -245,7 +245,7 @@ "c": { "files": 44, "loc": 74236, - "impact": 100817.62 + "impact": 103513.51999999999 }, "batch": { "files": 3, @@ -295,7 +295,7 @@ "cpp": { "files": 33, "loc": 44844, - "impact": 58710.87999999999 + "impact": 59647.78 }, "csharp": { "files": 8, @@ -641,9 +641,9 @@ }, "c/sqlite": { "file_count": 2, - "total_mass": 9960.96, + "total_mass": 9954.46, "avg_exposures": { - "cognitive_load": 45.81, + "cognitive_load": 45.8, "safety_score": 49.78, "tech_debt": 4.01, "verification": 40.0, @@ -698,13 +698,13 @@ }, "cpp/godot": { "file_count": 16, - "total_mass": 38646.68, + "total_mass": 39566.98, "avg_exposures": { "cognitive_load": 59.79, - "safety_score": 73.57, + "safety_score": 73.56, "tech_debt": 22.47, "verification": 55.29, - "api_exposure": 5.28, + "api_exposure": 5.29, "concurrency": 0.0, "state_flux": 81.22, "dead_code": 2.11, @@ -1021,11 +1021,11 @@ }, "c/cpython": { "file_count": 8, - "total_mass": 33171.04, + "total_mass": 35273.84, "avg_exposures": { - "cognitive_load": 66.29, + "cognitive_load": 72.91, "safety_score": 86.01, - "tech_debt": 35.03, + "tech_debt": 34.97, "verification": 70.29, "api_exposure": 13.77, "concurrency": 0.0, @@ -1078,7 +1078,7 @@ }, "assembly/cosmopolitan": { "file_count": 4, - "total_mass": 1965.06, + "total_mass": 1953.56, "avg_exposures": { "cognitive_load": 26.18, "safety_score": 38.28, @@ -1091,7 +1091,7 @@ "spec_match": 76.67, "stability": 50.0, "churn": 0.0, - "documentation": 35.97, + "documentation": 35.96, "secrets_risk": 0.0 } }, @@ -1116,7 +1116,7 @@ }, "c/micropython": { "file_count": 12, - "total_mass": 11109.94, + "total_mass": 11101.74, "avg_exposures": { "cognitive_load": 49.19, "safety_score": 53.58, @@ -1135,9 +1135,9 @@ }, "cobol/gnucobol_internals": { "file_count": 5, - "total_mass": 15231.85, + "total_mass": 15851.15, "avg_exposures": { - "cognitive_load": 44.54, + "cognitive_load": 48.26, "safety_score": 68.48, "tech_debt": 14.48, "verification": 48.92, @@ -1952,7 +1952,7 @@ }, "livecode/core": { "file_count": 11, - "total_mass": 26635.82, + "total_mass": 26652.42, "avg_exposures": { "cognitive_load": 33.19, "safety_score": 56.39, @@ -14697,7 +14697,7 @@ } }, "cpp/godot": { - "Directory Group Magnitude": 38646.68, + "Directory Group Magnitude": 39566.98, "File Count": 16, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "81.2%", @@ -14705,10 +14705,10 @@ }, "Average Risk Exposures": { "Cognitive Load Exposure": "59.79%", - "Error & Exception Exposure": "73.57%", + "Error & Exception Exposure": "73.56%", "Tech Debt Exposure": "22.47%", "Testing Exposure": "55.29%", - "API Exposure": "5.28%", + "API Exposure": "5.29%", "Concurrency Exposure": "0.0%", "State Flux Exposure": "81.22%", "Commented Logic Exposure": "2.11%", @@ -15678,7 +15678,7 @@ "Total LOC": 9612, "Coding LOC": 7678, "Documentation LOC": 441, - "Structural Magnitude": 9804.26, + "Structural Magnitude": 9805.86, "Control Flow Ratio": "79.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -15687,7 +15687,7 @@ "Raw Cognitive Density": 1.387 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "92.33%", + "Cognitive Load Exposure": "92.35%", "Error & Exception Exposure": "96.22%", "Tech Debt Exposure": "97.01%", "Testing Exposure": "80.0%", @@ -18362,6 +18362,16 @@ "Start Line": 7948, "End Line": 7950 }, + { + "Function Name": "get_game_view_plugin", + "Structural Impact": 1.6, + "Lines of Code (LOC)": 3, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 8278, + "End Line": 8280 + }, { "Function Name": "EditorNode::open_setting_override", "Structural Impact": 1.6, @@ -19449,16 +19459,16 @@ "Total LOC": 4040, "Coding LOC": 3258, "Documentation LOC": 95, - "Structural Magnitude": 7029.66, + "Structural Magnitude": 7487.06, "Control Flow Ratio": "92.7%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.517 + "Raw Cognitive Density": 1.531 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "94.56%", + "Cognitive Load Exposure": "94.79%", "Error & Exception Exposure": "99.68%", "Tech Debt Exposure": "14.64%", "Testing Exposure": "80.0%", @@ -19503,6 +19513,16 @@ "Start Line": 760, "End Line": 2411 }, + { + "Function Name": "OPCODE_WHILE", + "Structural Impact": 457.4, + "Lines of Code (LOC)": 1653, + "Control Flow Branches": 264, + "Input Parameters": 1, + "Control Flow Ratio": "98.5%", + "Start Line": 757, + "End Line": 2409 + }, { "Function Name": "OPCODE", "Structural Impact": 64.2, @@ -20684,20 +20704,20 @@ "Total LOC": 5377, "Coding LOC": 4227, "Documentation LOC": 374, - "Structural Magnitude": 6806.44, + "Structural Magnitude": 7266.44, "Control Flow Ratio": "93.3%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.563 + "Raw Cognitive Density": 1.564 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "94.34%", + "Cognitive Load Exposure": "94.35%", "Error & Exception Exposure": "98.81%", "Tech Debt Exposure": "11.52%", "Testing Exposure": "80.0%", - "API Exposure": "7.09%", + "API Exposure": "7.3%", "Concurrency Exposure": "0.0%", "State Flux Exposure": "100.0%", "Commented Logic Exposure": "8.84%", @@ -20719,24 +20739,24 @@ "End Line": 2632 }, { - "Function Name": "Main::start", - "Structural Impact": 384.7, - "Lines of Code (LOC)": 878, - "Control Flow Branches": 240, + "Function Name": "Main::setup2", + "Structural Impact": 675.2, + "Lines of Code (LOC)": 1512, + "Control Flow Branches": 423, "Input Parameters": 1, - "Control Flow Ratio": "92.0%", - "Start Line": 3987, - "End Line": 4864 + "Control Flow Ratio": "94.4%", + "Start Line": 3007, + "End Line": 4518 }, { - "Function Name": "Main::setup2", - "Structural Impact": 375.3, - "Lines of Code (LOC)": 887, - "Control Flow Branches": 233, + "Function Name": "Main::start", + "Structural Impact": 506.5, + "Lines of Code (LOC)": 1390, + "Control Flow Branches": 308, "Input Parameters": 1, - "Control Flow Ratio": "98.3%", - "Start Line": 3007, - "End Line": 3893 + "Control Flow Ratio": "92.2%", + "Start Line": 3987, + "End Line": 5376 }, { "Function Name": "Main::print_help", @@ -20788,6 +20808,16 @@ "Start Line": 490, "End Line": 524 }, + { + "Function Name": "Main::test_cleanup", + "Structural Impact": 20.1, + "Lines of Code (LOC)": 91, + "Control Flow Branches": 10, + "Input Parameters": 1, + "Control Flow Ratio": "90.9%", + "Start Line": 881, + "End Line": 971 + }, { "Function Name": "Main::test_entrypoint", "Structural Impact": 19.4, @@ -20798,6 +20828,16 @@ "Start Line": 974, "End Line": 1000 }, + { + "Function Name": "Main::test_setup", + "Structural Impact": 18.2, + "Lines of Code (LOC)": 136, + "Control Flow Branches": 8, + "Input Parameters": 1, + "Control Flow Ratio": "88.9%", + "Start Line": 743, + "End Line": 878 + }, { "Function Name": "get_files_with_extension", "Structural Impact": 16.7, @@ -21010,8 +21050,8 @@ "Type/Safety Bypasses": 1, "High-Risk Execution Commands": 12, "I/O and Network Boundaries": 0, - "Exposed API / Public Exports": 20, - "State Mutations / Variable Reassignments": 4077, + "Exposed API / Public Exports": 22, + "State Mutations / Variable Reassignments": 4075, "Commented-out Code (Dead Logic)": 4, "Structured Documentation Blocks": 10, "Unit Test Assertions": 0, @@ -23901,9 +23941,9 @@ "Identity Proof": "Sibling Anchor (C++)" }, "2. Topological Coordinates": { - "X": -87.0, - "Y": 89.59, - "Z": 3636.74 + "X": -86.95, + "Y": 89.6, + "Z": 3636.76 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -23915,16 +23955,16 @@ "Total LOC": 945, "Coding LOC": 670, "Documentation LOC": 81, - "Structural Magnitude": 507.0, + "Structural Magnitude": 509.2, "Control Flow Ratio": "12.5%", "Popularity Rank": 1, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.467 + "Raw Cognitive Density": 1.47 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "72.26%", + "Cognitive Load Exposure": "72.31%", "Error & Exception Exposure": "88.16%", "Tech Debt Exposure": "0.0%", "Testing Exposure": "80.0%", @@ -24209,6 +24249,16 @@ "Start Line": 165, "End Line": 165 }, + { + "Function Name": "_emit_editor_state_changed", + "Structural Impact": 1.1, + "Lines of Code (LOC)": 1, + "Control Flow Branches": 0, + "Input Parameters": 0, + "Control Flow Ratio": "0.0%", + "Start Line": 371, + "End Line": 371 + }, { "Function Name": "_block", "Structural Impact": 1.1, @@ -24309,6 +24359,16 @@ "Start Line": 559, "End Line": 559 }, + { + "Function Name": "is_part_of_edited_scene", + "Structural Impact": 1.1, + "Lines of Code (LOC)": 1, + "Control Flow Branches": 0, + "Input Parameters": 0, + "Control Flow Ratio": "0.0%", + "Start Line": 639, + "End Line": 639 + }, { "Function Name": "is_group_processing", "Structural Impact": 1.1, @@ -26456,9 +26516,9 @@ "Identity Proof": "Sibling Anchor (C++)" }, "2. Topological Coordinates": { - "X": -361.44, + "X": -361.45, "Y": 52.28, - "Z": 2591.54 + "Z": 2591.57 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -26470,17 +26530,17 @@ "Total LOC": 1244, "Coding LOC": 873, "Documentation LOC": 82, - "Structural Magnitude": 408.46, + "Structural Magnitude": 407.56, "Control Flow Ratio": "34.1%", "Popularity Rank": 1, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.086 + "Raw Cognitive Density": 1.081 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "64.79%", - "Error & Exception Exposure": "78.37%", + "Cognitive Load Exposure": "64.54%", + "Error & Exception Exposure": "78.19%", "Tech Debt Exposure": "9.36%", "Testing Exposure": "80.0%", "API Exposure": "6.17%", @@ -26584,6 +26644,16 @@ "Start Line": 67, "End Line": 67 }, + { + "Function Name": "redraw_request", + "Structural Impact": 1.1, + "Lines of Code (LOC)": 3, + "Control Flow Branches": 0, + "Input Parameters": 0, + "Control Flow Ratio": "0.0%", + "Start Line": 111, + "End Line": 113 + }, { "Function Name": "is_on_render_thread", "Structural Impact": 1.1, @@ -26607,7 +26677,7 @@ "High-Risk Execution Commands": 1, "I/O and Network Boundaries": 0, "Exposed API / Public Exports": 8, - "State Mutations / Variable Reassignments": 326, + "State Mutations / Variable Reassignments": 324, "Commented-out Code (Dead Logic)": 2, "Structured Documentation Blocks": 4, "Unit Test Assertions": 0, @@ -29035,15 +29105,15 @@ } }, "c/cpython": { - "Directory Group Magnitude": 33171.04, + "Directory Group Magnitude": 35273.84, "File Count": 8, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" }, "Average Risk Exposures": { - "Cognitive Load Exposure": "66.29%", + "Cognitive Load Exposure": "72.91%", "Error & Exception Exposure": "86.01%", - "Tech Debt Exposure": "35.03%", + "Tech Debt Exposure": "34.97%", "Testing Exposure": "70.29%", "API Exposure": "13.77%", "Concurrency Exposure": "0.0%", @@ -29237,9 +29307,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": -1391.44, - "Y": 145.71, - "Z": -1755.68 + "X": -1390.94, + "Y": 145.69, + "Z": -1761.38 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -29251,16 +29321,16 @@ "Total LOC": 3840, "Coding LOC": 3294, "Documentation LOC": 244, - "Structural Magnitude": 4545.98, + "Structural Magnitude": 6161.48, "Control Flow Ratio": "68.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.083 + "Raw Cognitive Density": 1.526 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "78.08%", + "Cognitive Load Exposure": "94.47%", "Error & Exception Exposure": "90.27%", "Tech Debt Exposure": "9.09%", "Testing Exposure": "80.0%", @@ -29275,6 +29345,36 @@ "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ + { + "Function Name": "_Py_CheckRecursiveCall", + "Structural Impact": 620.8, + "Lines of Code (LOC)": 1677, + "Control Flow Branches": 309, + "Input Parameters": 2, + "Control Flow Ratio": "80.9%", + "Start Line": 282, + "End Line": 1958 + }, + { + "Function Name": "_Py_ReachedRecursionLimitWithMargin", + "Structural Impact": 561.2, + "Lines of Code (LOC)": 1732, + "Control Flow Branches": 273, + "Input Parameters": 2, + "Control Flow Ratio": "72.2%", + "Start Line": 28, + "End Line": 1759 + }, + { + "Function Name": "_Py_EnterRecursiveCallUnchecked", + "Structural Impact": 477.3, + "Lines of Code (LOC)": 1739, + "Control Flow Branches": 275, + "Input Parameters": 1, + "Control Flow Ratio": "72.9%", + "Start Line": 52, + "End Line": 1790 + }, { "Function Name": "initialize_locals", "Structural Impact": 226.7, @@ -29505,16 +29605,6 @@ "Start Line": 3409, "End Line": 3444 }, - { - "Function Name": "_Py_ReachedRecursionLimitWithMargin", - "Structural Impact": 18.5, - "Lines of Code (LOC)": 23, - "Control Flow Branches": 9, - "Input Parameters": 2, - "Control Flow Ratio": "75.0%", - "Start Line": 28, - "End Line": 50 - }, { "Function Name": "_PyEval_GetIter", "Structural Impact": 17.7, @@ -29525,16 +29615,6 @@ "Start Line": 1169, "End Line": 1202 }, - { - "Function Name": "_Py_CheckRecursiveCall", - "Structural Impact": 17.6, - "Lines of Code (LOC)": 40, - "Control Flow Branches": 8, - "Input Parameters": 2, - "Control Flow Ratio": "80.0%", - "Start Line": 282, - "End Line": 321 - }, { "Function Name": "_PyEval_LoadName", "Structural Impact": 17.6, @@ -29895,16 +29975,6 @@ "Start Line": 2773, "End Line": 2790 }, - { - "Function Name": "_Py_EnterRecursiveCallUnchecked", - "Structural Impact": 7.7, - "Lines of Code (LOC)": 13, - "Control Flow Branches": 4, - "Input Parameters": 1, - "Control Flow Ratio": "80.0%", - "Start Line": 52, - "End Line": 64 - }, { "Function Name": "_PyEval_GetFrameLocals", "Structural Impact": 7.7, @@ -31319,18 +31389,18 @@ "Total LOC": 8326, "Coding LOC": 6573, "Documentation LOC": 821, - "Structural Magnitude": 7722.56, + "Structural Magnitude": 8237.26, "Control Flow Ratio": "63.3%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.038 + "Raw Cognitive Density": 1.409 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "75.5%", - "Error & Exception Exposure": "87.32%", - "Tech Debt Exposure": "32.24%", + "Cognitive Load Exposure": "92.7%", + "Error & Exception Exposure": "87.3%", + "Tech Debt Exposure": "31.74%", "Testing Exposure": "80.0%", "API Exposure": "13.63%", "Concurrency Exposure": "0.0%", @@ -31339,10 +31409,20 @@ "Specification Exposure": "100.0%", "Instability Exposure": "50.0%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "99.7%", + "Documentation Exposure": "99.71%", "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ + { + "Function Name": "dictiter_iternextitem", + "Structural Impact": 486.1, + "Lines of Code (LOC)": 1888, + "Control Flow Branches": 276, + "Input Parameters": 1, + "Control Flow Ratio": "64.6%", + "Start Line": 5994, + "End Line": 7881 + }, { "Function Name": "_PyDict_FromKeys", "Structural Impact": 82.8, @@ -31533,6 +31613,16 @@ "Start Line": 1942, "End Line": 2009 }, + { + "Function Name": "dictiter_iternextkey_lock_held", + "Structural Impact": 34.5, + "Lines of Code (LOC)": 66, + "Control Flow Branches": 17, + "Input Parameters": 2, + "Control Flow Ratio": "85.0%", + "Start Line": 5524, + "End Line": 5589 + }, { "Function Name": "dictiter_iternextvalue_lock_held", "Structural Impact": 34.4, @@ -32083,16 +32173,6 @@ "Start Line": 3756, "End Line": 3792 }, - { - "Function Name": "dictiter_iternextitem", - "Structural Impact": 11.6, - "Lines of Code (LOC)": 35, - "Control Flow Branches": 6, - "Input Parameters": 1, - "Control Flow Ratio": "66.7%", - "Start Line": 5994, - "End Line": 6028 - }, { "Function Name": "frozendict_or", "Structural Impact": 11.4, @@ -32233,16 +32313,6 @@ "Start Line": 6700, "End Line": 6720 }, - { - "Function Name": "_PyObject_ManagedDictValidityCheck", - "Structural Impact": 9.7, - "Lines of Code (LOC)": 25, - "Control Flow Branches": 5, - "Input Parameters": 1, - "Control Flow Ratio": "83.3%", - "Start Line": 7399, - "End Line": 7423 - }, { "Function Name": "dictitems_contains", "Structural Impact": 9.6, @@ -32483,6 +32553,16 @@ "Start Line": 7329, "End Line": 7343 }, + { + "Function Name": "_Py_dict_lookup_threadsafe_stackref", + "Structural Impact": 7.4, + "Lines of Code (LOC)": 13, + "Control Flow Branches": 2, + "Input Parameters": 4, + "Control Flow Ratio": "66.7%", + "Start Line": 1704, + "End Line": 1716 + }, { "Function Name": "new_dict", "Structural Impact": 7.3, @@ -33313,6 +33393,16 @@ "Start Line": 938, "End Line": 944 }, + { + "Function Name": "_Py_dict_lookup_threadsafe", + "Structural Impact": 2.6, + "Lines of Code (LOC)": 7, + "Control Flow Branches": 0, + "Input Parameters": 4, + "Control Flow Ratio": "0.0%", + "Start Line": 1696, + "End Line": 1702 + }, { "Function Name": "unicodekeys_lookup_generic", "Structural Impact": 2.5, @@ -33633,6 +33723,26 @@ "Start Line": 209, "End Line": 214 }, + { + "Function Name": "set_keys", + "Structural Impact": 2.0, + "Lines of Code (LOC)": 5, + "Control Flow Branches": 0, + "Input Parameters": 2, + "Control Flow Ratio": "0.0%", + "Start Line": 269, + "End Line": 273 + }, + { + "Function Name": "set_values", + "Structural Impact": 2.0, + "Lines of Code (LOC)": 5, + "Control Flow Branches": 0, + "Input Parameters": 2, + "Control Flow Ratio": "0.0%", + "Start Line": 275, + "End Line": 279 + }, { "Function Name": "insertion_resize", "Structural Impact": 2.0, @@ -33823,6 +33933,26 @@ "Start Line": 195, "End Line": 200 }, + { + "Function Name": "split_keys_entry_added", + "Structural Impact": 1.7, + "Lines of Code (LOC)": 5, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 263, + "End Line": 267 + }, + { + "Function Name": "load_keys_nentries", + "Structural Impact": 1.7, + "Lines of Code (LOC)": 5, + "Control Flow Branches": 0, + "Input Parameters": 1, + "Control Flow Ratio": "0.0%", + "Start Line": 281, + "End Line": 285 + }, { "Function Name": "unicode_get_hash", "Structural Impact": 1.7, @@ -34016,7 +34146,7 @@ "High-Risk Execution Commands": 0, "I/O and Network Boundaries": 0, "Exposed API / Public Exports": 1319, - "State Mutations / Variable Reassignments": 3300, + "State Mutations / Variable Reassignments": 3298, "Commented-out Code (Dead Logic)": 5, "Structured Documentation Blocks": 5, "Unit Test Assertions": 291, @@ -34079,7 +34209,7 @@ "Design Short Vars": 185, "Design Long Vars": 0, "Duplicate Logic": 0, - "Orphaned Logic": 68, + "Orphaned Logic": 67, "Instructional Code Examples": 0, "Architectural Diagrams (Mermaid/PlantUML)": 0, "Structured Literature Headers": 0, @@ -34143,9 +34273,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": -1986.47, + "X": -1986.28, "Y": 137.89, - "Z": -1506.98 + "Z": -1506.95 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -34157,20 +34287,20 @@ "Total LOC": 2451, "Coding LOC": 1936, "Documentation LOC": 235, - "Structural Magnitude": 2540.12, + "Structural Magnitude": 2509.42, "Control Flow Ratio": "61.8%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 0.98 + "Raw Cognitive Density": 1.324 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "71.49%", + "Cognitive Load Exposure": "90.87%", "Error & Exception Exposure": "91.29%", "Tech Debt Exposure": "8.75%", "Testing Exposure": "80.0%", - "API Exposure": "13.67%", + "API Exposure": "13.66%", "Concurrency Exposure": "0.0%", "State Flux Exposure": "100.0%", "Commented Logic Exposure": "4.91%", @@ -34301,16 +34431,6 @@ "Start Line": 762, "End Line": 791 }, - { - "Function Name": "print_stack", - "Structural Impact": 13.7, - "Lines of Code (LOC)": 19, - "Control Flow Branches": 8, - "Input Parameters": 1, - "Control Flow Ratio": "80.0%", - "Start Line": 1284, - "End Line": 1302 - }, { "Function Name": "framelocalsproxy_new", "Structural Impact": 13.6, @@ -34331,16 +34451,6 @@ "Start Line": 734, "End Line": 760 }, - { - "Function Name": "tos_char", - "Structural Impact": 12.1, - "Lines of Code (LOC)": 16, - "Control Flow Branches": 7, - "Input Parameters": 1, - "Control Flow Ratio": "53.8%", - "Start Line": 1267, - "End Line": 1282 - }, { "Function Name": "framelocalsproxy_getitem", "Structural Impact": 11.9, @@ -34631,16 +34741,6 @@ "Start Line": 714, "End Line": 721 }, - { - "Function Name": "print_stacks", - "Structural Impact": 3.9, - "Lines of Code (LOC)": 8, - "Control Flow Branches": 1, - "Input Parameters": 2, - "Control Flow Ratio": "50.0%", - "Start Line": 1304, - "End Line": 1311 - }, { "Function Name": "frame_tp_clear", "Structural Impact": 3.9, @@ -34993,7 +35093,7 @@ "Type/Safety Bypasses": 25, "High-Risk Execution Commands": 0, "I/O and Network Boundaries": 7, - "Exposed API / Public Exports": 472, + "Exposed API / Public Exports": 471, "State Mutations / Variable Reassignments": 1144, "Commented-out Code (Dead Logic)": 1, "Structured Documentation Blocks": 0, @@ -38047,7 +38147,7 @@ "Total LOC": 12874, "Coding LOC": 9970, "Documentation LOC": 1437, - "Structural Magnitude": 11317.9, + "Structural Magnitude": 11321.2, "Control Flow Ratio": "61.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -41181,6 +41281,16 @@ "Start Line": 7337, "End Line": 7346 }, + { + "Function Name": "update_all_slots", + "Structural Impact": 3.3, + "Lines of Code (LOC)": 10, + "Control Flow Branches": 1, + "Input Parameters": 1, + "Control Flow Ratio": "50.0%", + "Start Line": 11977, + "End Line": 11986 + }, { "Function Name": "fixup_slot_dispatchers", "Structural Impact": 3.2, @@ -42182,7 +42292,7 @@ } }, "livecode/core": { - "Directory Group Magnitude": 26635.82, + "Directory Group Magnitude": 26652.42, "File Count": 11, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" @@ -44075,7 +44185,7 @@ "Total LOC": 7360, "Coding LOC": 5338, "Documentation LOC": 634, - "Structural Magnitude": 7073.66, + "Structural Magnitude": 7090.26, "Control Flow Ratio": "64.4%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -44085,7 +44195,7 @@ }, "4. Vulnerability & Risk Exposures": { "Cognitive Load Exposure": "35.42%", - "Error & Exception Exposure": "95.46%", + "Error & Exception Exposure": "95.44%", "Tech Debt Exposure": "81.19%", "Testing Exposure": "80.0%", "API Exposure": "0.0%", @@ -45239,6 +45349,16 @@ "Start Line": 3699, "End Line": 3714 }, + { + "Function Name": "MCStringConvertToSysString", + "Structural Impact": 8.1, + "Lines of Code (LOC)": 42, + "Control Flow Branches": 2, + "Input Parameters": 3, + "Control Flow Ratio": "40.0%", + "Start Line": 6669, + "End Line": 6710 + }, { "Function Name": "MCStringMutableCopy", "Structural Impact": 8.0, @@ -45269,6 +45389,16 @@ "Start Line": 4553, "End Line": 4574 }, + { + "Function Name": "MCStringCreateWithSysString", + "Structural Impact": 8.0, + "Lines of Code (LOC)": 21, + "Control Flow Branches": 3, + "Input Parameters": 2, + "Control Flow Ratio": "60.0%", + "Start Line": 6723, + "End Line": 6743 + }, { "Function Name": "__MCStringCountGraphemesInRange", "Structural Impact": 7.9, @@ -45659,6 +45789,16 @@ "Start Line": 5114, "End Line": 5124 }, + { + "Function Name": "MCStringConvertToSysString", + "Structural Impact": 4.5, + "Lines of Code (LOC)": 10, + "Control Flow Branches": 1, + "Input Parameters": 3, + "Control Flow Ratio": "33.3%", + "Start Line": 6712, + "End Line": 6721 + }, { "Function Name": "MCStringConvertToCString", "Structural Impact": 4.2, @@ -46342,7 +46482,7 @@ "High-Risk Execution Commands": 5, "I/O and Network Boundaries": 0, "Exposed API / Public Exports": 0, - "State Mutations / Variable Reassignments": 3725, + "State Mutations / Variable Reassignments": 3721, "Commented-out Code (Dead Logic)": 9, "Structured Documentation Blocks": 883, "Unit Test Assertions": 0, @@ -62709,13 +62849,13 @@ } }, "cobol/gnucobol_internals": { - "Directory Group Magnitude": 15231.85, + "Directory Group Magnitude": 15851.15, "File Count": 5, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" }, "Average Risk Exposures": { - "Cognitive Load Exposure": "44.54%", + "Cognitive Load Exposure": "48.26%", "Error & Exception Exposure": "68.48%", "Tech Debt Exposure": "14.48%", "Testing Exposure": "48.92%", @@ -62757,7 +62897,7 @@ "Total LOC": 7364, "Coding LOC": 6537, "Documentation LOC": 315, - "Structural Magnitude": 10873.84, + "Structural Magnitude": 10878.84, "Control Flow Ratio": "78.0%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -63951,6 +64091,16 @@ "Start Line": 5856, "End Line": 5868 }, + { + "Function Name": "lock_record", + "Structural Impact": 2.9, + "Lines of Code (LOC)": 13, + "Control Flow Branches": 0, + "Input Parameters": 4, + "Control Flow Ratio": "0.0%", + "Start Line": 1967, + "End Line": 1979 + }, { "Function Name": "cob_file_sort_init_key", "Structural Impact": 2.7, @@ -63961,6 +64111,16 @@ "Start Line": 7062, "End Line": 7070 }, + { + "Function Name": "unlock_record", + "Structural Impact": 2.1, + "Lines of Code (LOC)": 7, + "Control Flow Branches": 0, + "Input Parameters": 2, + "Control Flow Ratio": "0.0%", + "Start Line": 1981, + "End Line": 1987 + }, { "Function Name": "cob_file_set_lock", "Structural Impact": 2.1, @@ -64177,9 +64337,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": -5269.94, - "Y": -79.48, - "Z": -3494.59 + "X": -5272.26, + "Y": -80.13, + "Z": -3492.44 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -64191,16 +64351,16 @@ "Total LOC": 2689, "Coding LOC": 2299, "Documentation LOC": 138, - "Structural Magnitude": 2953.68, + "Structural Magnitude": 3567.98, "Control Flow Ratio": "71.6%", "Popularity Rank": 1, "Raw Churn Frequency": 0.0, "Authorship Centralization": 0.0, "Ownership Entropy": 0.0, - "Raw Cognitive Density": 1.012 + "Raw Cognitive Density": 1.388 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "73.51%", + "Cognitive Load Exposure": "92.09%", "Error & Exception Exposure": "92.09%", "Tech Debt Exposure": "38.29%", "Testing Exposure": "80.0%", @@ -64215,6 +64375,16 @@ "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ + { + "Function Name": "cob_decimal_set_display", + "Structural Impact": 641.6, + "Lines of Code (LOC)": 1470, + "Control Flow Branches": 327, + "Input Parameters": 2, + "Control Flow Ratio": "68.4%", + "Start Line": 1219, + "End Line": 2688 + }, { "Function Name": "cob_decimal_get_binary", "Structural Impact": 87.1, @@ -64365,16 +64535,6 @@ "Start Line": 607, "End Line": 655 }, - { - "Function Name": "cob_decimal_set_display", - "Structural Impact": 27.3, - "Lines of Code (LOC)": 62, - "Control Flow Branches": 13, - "Input Parameters": 2, - "Control Flow Ratio": "81.2%", - "Start Line": 1219, - "End Line": 1280 - }, { "Function Name": "cob_set_packed_int", "Structural Impact": 26.4, @@ -114202,7 +114362,7 @@ } }, "c/micropython": { - "Directory Group Magnitude": 11109.94, + "Directory Group Magnitude": 11101.74, "File Count": 12, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" @@ -116886,9 +117046,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": 1135.44, + "X": 1135.39, "Y": -108.66, - "Z": -2592.0 + "Z": -2592.06 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -116900,7 +117060,7 @@ "Total LOC": 1408, "Coding LOC": 981, "Documentation LOC": 258, - "Structural Magnitude": 1447.62, + "Structural Magnitude": 1439.42, "Control Flow Ratio": "70.7%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -116954,16 +117114,6 @@ "Start Line": 1115, "End Line": 1263 }, - { - "Function Name": "gc_mark_subtree", - "Structural Impact": 40.0, - "Lines of Code (LOC)": 72, - "Control Flow Branches": 20, - "Input Parameters": 2, - "Control Flow Ratio": "76.9%", - "Start Line": 501, - "End Line": 572 - }, { "Function Name": "gc_info", "Structural Impact": 37.5, @@ -116974,6 +117124,16 @@ "Start Line": 755, "End Line": 826 }, + { + "Function Name": "gc_mark_subtree", + "Structural Impact": 31.8, + "Lines of Code (LOC)": 70, + "Control Flow Branches": 19, + "Input Parameters": 1, + "Control Flow Ratio": "79.2%", + "Start Line": 503, + "End Line": 572 + }, { "Function Name": "gc_setup_area", "Structural Impact": 30.3, @@ -119279,14 +119439,14 @@ } }, "c/sqlite": { - "Directory Group Magnitude": 9960.96, + "Directory Group Magnitude": 9954.46, "File Count": 2, "Ecosystem Fingerprint (Archetypes)": { "Static: Literature & Documentation": "50.0%", "Unclassified": "50.0%" }, "Average Risk Exposures": { - "Cognitive Load Exposure": "45.81%", + "Cognitive Load Exposure": "45.8%", "Error & Exception Exposure": "49.78%", "Tech Debt Exposure": "4.01%", "Testing Exposure": "40.0%", @@ -119485,7 +119645,7 @@ "Total LOC": 6076, "Coding LOC": 4862, "Documentation LOC": 876, - "Structural Magnitude": 9952.44, + "Structural Magnitude": 9945.94, "Control Flow Ratio": "68.6%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -119494,7 +119654,7 @@ "Raw Cognitive Density": 1.511 }, "4. Vulnerability & Risk Exposures": { - "Cognitive Load Exposure": "91.62%", + "Cognitive Load Exposure": "91.61%", "Error & Exception Exposure": "99.56%", "Tech Debt Exposure": "8.03%", "Testing Exposure": "80.0%", @@ -120419,16 +120579,6 @@ "Start Line": 3276, "End Line": 3285 }, - { - "Function Name": "SetPrint", - "Structural Impact": 3.9, - "Lines of Code (LOC)": 17, - "Control Flow Branches": 2, - "Input Parameters": 0, - "Control Flow Ratio": "50.0%", - "Start Line": 3445, - "End Line": 3461 - }, { "Function Name": "SetAdd", "Structural Impact": 3.9, @@ -120569,16 +120719,6 @@ "Start Line": 1578, "End Line": 1585 }, - { - "Function Name": "PlinkPrint", - "Structural Impact": 2.6, - "Lines of Code (LOC)": 12, - "Control Flow Branches": 1, - "Input Parameters": 0, - "Control Flow Ratio": "33.3%", - "Start Line": 3464, - "End Line": 3475 - }, { "Function Name": "lemon_free_all", "Structural Impact": 2.4, @@ -341534,7 +341674,7 @@ } }, "assembly/cosmopolitan": { - "Directory Group Magnitude": 1965.06, + "Directory Group Magnitude": 1953.56, "File Count": 4, "Ecosystem Fingerprint (Archetypes)": { "Unclassified": "100.0%" @@ -341551,7 +341691,7 @@ "Specification Exposure": "76.67%", "Instability Exposure": "50.0%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "35.97%", + "Documentation Exposure": "35.96%", "Hardcoded Payload Artifacts": "0.0%" }, "Files": { @@ -341568,9 +341708,9 @@ "Identity Proof": "Single Indicator (Ext: .s)" }, "2. Topological Coordinates": { - "X": -4898.56, - "Y": 134.99, - "Z": 1491.95 + "X": -4898.37, + "Y": 135.0, + "Z": 1491.84 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -342338,9 +342478,9 @@ "Identity Proof": "Ecosystem Consensus Lock (70% Local Dominance)" }, "2. Topological Coordinates": { - "X": -4348.03, - "Y": 124.76, - "Z": 1788.82 + "X": -4347.99, + "Y": 124.77, + "Z": 1788.71 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -342495,9 +342635,9 @@ "Identity Proof": "Single Indicator (Ext: .s)" }, "2. Topological Coordinates": { - "X": -4638.36, - "Y": 160.66, - "Z": 900.64 + "X": -4638.27, + "Y": 160.65, + "Z": 900.71 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -342723,9 +342863,9 @@ "Identity Proof": "Ecosystem Consensus Lock (100% Local Dominance)" }, "2. Topological Coordinates": { - "X": -4614.46, + "X": -4614.35, "Y": 101.25, - "Z": 1292.86 + "Z": 1292.83 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -342737,7 +342877,7 @@ "Total LOC": 1128, "Coding LOC": 911, "Documentation LOC": 134, - "Structural Magnitude": 1552.92, + "Structural Magnitude": 1541.42, "Control Flow Ratio": "74.8%", "Popularity Rank": 0, "Raw Churn Frequency": 0.0, @@ -342750,14 +342890,14 @@ "Error & Exception Exposure": "97.99%", "Tech Debt Exposure": "9.75%", "Testing Exposure": "80.0%", - "API Exposure": "12.18%", + "API Exposure": "12.15%", "Concurrency Exposure": "0.0%", "State Flux Exposure": "100.0%", "Commented Logic Exposure": "5.12%", "Specification Exposure": "100.0%", "Instability Exposure": "50.0%", "Volatility Exposure": "0.0%", - "Documentation Exposure": "99.0%", + "Documentation Exposure": "98.96%", "Hardcoded Payload Artifacts": "0.0%" }, "5. Function Analysis": [ @@ -342931,16 +343071,6 @@ "Start Line": 391, "End Line": 403 }, - { - "Function Name": "StrRChr", - "Structural Impact": 7.5, - "Lines of Code (LOC)": 11, - "Control Flow Branches": 3, - "Input Parameters": 2, - "Control Flow Ratio": "75.0%", - "Start Line": 248, - "End Line": 258 - }, { "Function Name": "AccessCommand", "Structural Impact": 7.4, @@ -343031,16 +343161,6 @@ "Start Line": 232, "End Line": 237 }, - { - "Function Name": "BaseName", - "Structural Impact": 3.0, - "Lines of Code (LOC)": 4, - "Control Flow Branches": 1, - "Input Parameters": 1, - "Control Flow Ratio": "50.0%", - "Start Line": 260, - "End Line": 263 - }, { "Function Name": "ShowUsage", "Structural Impact": 2.8, @@ -343073,7 +343193,7 @@ "Type/Safety Bypasses": 9, "High-Risk Execution Commands": 0, "I/O and Network Boundaries": 4, - "Exposed API / Public Exports": 148, + "Exposed API / Public Exports": 147, "State Mutations / Variable Reassignments": 773, "Commented-out Code (Dead Logic)": 1, "Structured Documentation Blocks": 1, @@ -419701,9 +419821,9 @@ "Identity Proof": "Single Indicator (Ext: .csv)" }, "2. Topological Coordinates": { - "X": -5362.5, + "X": -5362.24, "Y": 187.56, - "Z": 1320.58 + "Z": 1320.52 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -419858,9 +419978,9 @@ "Identity Proof": "Single Indicator (Ext: .tsv)" }, "2. Topological Coordinates": { - "X": -5602.66, + "X": -5602.4, "Y": 221.85, - "Z": 1440.19 + "Z": 1440.13 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", @@ -430213,9 +430333,9 @@ "Identity Proof": "Single Indicator (Ext: .html)" }, "2. Topological Coordinates": { - "X": -5187.29, + "X": -5187.06, "Y": 14.4, - "Z": 1847.04 + "Z": 1846.96 }, "3. Architectural Profile": { "Repository Archetype": "Unclassified", From cdccd1721e73a8f0e1d3116b964b3cee2facfe48 Mon Sep 17 00:00:00 2001 From: Joe Esquibel Date: Sun, 16 Aug 2026 20:40:20 -0400 Subject: [PATCH 3/3] fix(detector): use word boundary matching for #if/#elif to prevent stack desync --- gitgalaxy/core/detector.py | 4 ++-- tests/core_engine/test_detector.py | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/gitgalaxy/core/detector.py b/gitgalaxy/core/detector.py index 2a9702001..8013651b3 100644 --- a/gitgalaxy/core/detector.py +++ b/gitgalaxy/core/detector.py @@ -2139,11 +2139,11 @@ def _branch_dead(entry: tuple[Optional[bool], str]) -> bool: continue if stripped.startswith("#"): - if stripped.startswith("#if "): + if re.match(r"#if\b", stripped): branch_stack.append((self._classify_preproc_condition(stripped[3:].strip()), "first")) elif stripped.startswith("#ifdef ") or stripped.startswith("#ifndef "): branch_stack.append((None, "first")) - elif stripped.startswith("#elif ") and branch_stack: + elif re.match(r"#elif\b", stripped) and branch_stack: # an #elif starts a fresh condition on the else side branch_stack[-1] = (self._classify_preproc_condition(stripped[5:].strip()), "first") elif stripped.startswith("#else") and branch_stack: diff --git a/tests/core_engine/test_detector.py b/tests/core_engine/test_detector.py index 9bc755f92..1fd17296c 100644 --- a/tests/core_engine/test_detector.py +++ b/tests/core_engine/test_detector.py @@ -459,6 +459,33 @@ def test_detector_c_macro_static_truth_prunes_branches(): assert "aliveFast" in names_one, "#if 1 first branch must survive!" assert "deadFallback" not in names_one, "#if 1 #else branch must be pruned!" + +def test_detector_c_macro_no_space_boundaries_issue_1764(): + """ + Regression test for a bug where `#if(1)` or `#elif(0)` (valid C preprocessor + syntax without a space) failed to push onto the branch stack because + `startswith("#if ")` was used. This led to premature `#endif` pops and + desynced branch nesting. + """ + opt_detector = StructuralExtractor("c", MOCK_LANG_DEFS) + code = ( + "#if 0\n" + "int deadOne() { return 1; }\n" + "#if(1)\n" + "int deadTwo() { return 2; }\n" + "#endif\n" + "int deadThree() { return 3; }\n" # should stay dead -- still inside outer #if 0, before #else + "#else\n" + "int aliveOne() { return 4; }\n" + "#endif\n" + ) + + result = opt_detector.splice(code, "") + names = [f["name"] for f in result["functions"]] + + assert "deadThree" not in names, "Premature pop caused dead code to be scanned as alive!" + assert "aliveOne" in names, "Valid #else branch was dropped due to stack desync!" + code_nested = ( "#if 0\n" "int a() { return 1; }\n"