Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions gitgalaxy/standards/language_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
| Solidity | 100.0% | 94.3% | 100.0% | 100.0% |
| Swift | 100.0% | 99.2% | 100.0% | 100.0% |
| Tcl | 98.6% | 99.3% | N/A | N/A |
| Typescript | 99.5% | 99.6% | 100.0% | 100.0% |
| Typescript | 99.5% | 99.5% | 100.0% | 100.0% |
| Zig | 100.0% | 100.0% | 100.0% | 100.0% |
<!-- TREE_SITTER_ACCURACY_TABLE:END -->
"""
Expand Down Expand Up @@ -1286,7 +1286,23 @@ class PrismConfigSchema(TypedDict):
# isn't immediately adjacent to the name, so `\??` matches
# zero-width here and the mandatory `\(` lookahead then fails
# against the literal `?` still sitting in the way).
r"(?!(?:class|interface|enum|if|for|while|switch|catch|return|throw|new|typeof|jQuery|function|yield|await|void)\b|type\b(?![ \t\n]*\()|\$)(\[[^\]]+\]|[#]?[a-zA-Z_$][\w$]*)(?=\??[ \t\n]{0,50}(?:<(?:[^<>]|<[^<>]*>)*>)?[ \t\n]{0,50}\()"
# BUG FIX (issue #2276): `catch`/`return`/`throw` used to be
# unconditionally excluded here to stop `} catch (e) {`
# control-flow blocks (and ordinary `return`/`throw`
# statements) from being misidentified as method
# definitions -- but that also permanently hid a REAL method
# or property legitimately named `catch`/`return`/`throw`
# (a Promise-like thenable's `catch<T>()`, an AsyncIterator
# protocol's `return()`). Moved to a CONDITIONAL exclusion:
# only excluded when immediately followed by whitespace then
# `(`/`<` -- idiomatic control-flow/statement syntax always
# has that shape (`catch (e)`, `return <expr`), while a real
# method/property definition never does (`catch<T>(...)`,
# `catch(...)`, `return: () => {...}`). Confirmed via direct
# testing that `} catch (e) {` still correctly does NOT
# match, while `catch<TResult = never>(...)` and
# `return: () => {...}` now do.
r"(?!(?:class|interface|enum|if|for|while|switch|new|typeof|jQuery|function|yield|await|void)\b|type\b(?![ \t\n]*\()|\$|(?:catch|return|throw)\b[ \t\n]+(?:\(|<))(\[[^\]]+\]|[#]?[a-zA-Z_$][\w$]*)(?=\??[ \t\n]{0,50}(?:<(?:[^<>]|<[^<>]*>)*>)?[ \t\n]{0,50}\()"
r"|"
# BUG FIX (R3): The arrow-value (Branch 5 / standalone value) branch
# is known to fail on mid-statement function values (e.g. `const a = b || () => {}`)
Expand Down Expand Up @@ -1336,7 +1352,11 @@ class PrismConfigSchema(TypedDict):
# public/private/etc. modifier to route them through Branch A
# instead. Same zero-whitespace-before-`?` placement, same
# ternary-collision reasoning.
r"^[ \t]*(?!(?:class|interface|enum|if|for|while|switch|catch|return|throw|new|typeof|jQuery|function|yield|await|void)\b|type\b(?![ \t\n]*\()|\$)(\[[^\]]+\]|[#]?[a-zA-Z_$][\w$]*)(?=\??[ \t\n]{0,50}(?:<(?:[^<>]|<[^<>]*>)*>)?[ \t\n]{0,50}\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)[ \t\n]{0,50}(?:(?::[^{;]{0,200})?[ \t\n]{0,50}(?:=>[ \t\n]{0,50})?\{|:[^{;]{0,200}[ \t\n]{0,50};))"
# BUG FIX (issue #2276): same conditional-exclusion fix as
# Branch A above, mirrored here since this branch carries
# its own copy of the same reserved-keyword shield -- see
# that branch's comment for the full rationale.
r"^[ \t]*(?!(?:class|interface|enum|if|for|while|switch|new|typeof|jQuery|function|yield|await|void)\b|type\b(?![ \t\n]*\()|\$|(?:catch|return|throw)\b[ \t\n]+(?:\(|<))(\[[^\]]+\]|[#]?[a-zA-Z_$][\w$]*)(?=\??[ \t\n]{0,50}(?:<(?:[^<>]|<[^<>]*>)*>)?[ \t\n]{0,50}\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)[ \t\n]{0,50}(?:(?::[^{;]{0,200})?[ \t\n]{0,50}(?:=>[ \t\n]{0,50})?\{|:[^{;]{0,200}[ \t\n]{0,50};))"
r")",
re.M,
),
Expand Down
28 changes: 19 additions & 9 deletions tests/golden_master_audit.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"Target Root Name": "data",
"Absolute Project Path": "/home/joe/nyx_projects/language-crucible/data",
"Analysis ISO Timestamp": "2026-08-26T15:27:06.920235+00:00",
"Total Scan Duration": "33.55 seconds"
"Analysis ISO Timestamp": "2026-08-26T19:15:10.569129+00:00",
"Total Scan Duration": "34.9 seconds"
},
"Source Control Footprint (Immutable Anchor)": {
"Active Branch": "HEAD",
Expand Down Expand Up @@ -360,7 +360,7 @@
"typescript": {
"files": 24,
"loc": 36020,
"impact": 4277.700000000002
"impact": 4278.140000000001
},
"kotlin": {
"files": 5,
Expand Down Expand Up @@ -1781,7 +1781,7 @@
},
"typescript/vscode": {
"file_count": 11,
"total_mass": 1429.32,
"total_mass": 1429.76,
"avg_exposures": {
"cognitive_load": 35.35,
"safety_score": 59.85,
Expand Down Expand Up @@ -358546,7 +358546,7 @@
}
},
"typescript/vscode": {
"Directory Group Magnitude": 1429.32,
"Directory Group Magnitude": 1429.76,
"File Count": 11,
"Ecosystem Fingerprint (Archetypes)": {
"Unclassified": "81.8%",
Expand Down Expand Up @@ -359062,9 +359062,9 @@
"Identity Proof": "Single Indicator (Ext: .ts)"
},
"2. Topological Coordinates": {
"X": 3477.88,
"X": 3477.86,
"Y": 154.07,
"Z": 3300.26
"Z": 3300.27
},
"3. Architectural Profile": {
"Repository Archetype": "Unclassified",
Expand All @@ -359076,7 +359076,7 @@
"Total LOC": 2646,
"Coding LOC": 1803,
"Documentation LOC": 419,
"Structural Magnitude": 319.07,
"Structural Magnitude": 319.51,
"Control Flow Ratio": "33.0%",
"Popularity Rank": 0,
"Raw Churn Frequency": 0.0,
Expand Down Expand Up @@ -359720,6 +359720,16 @@
"Start Line": 2592,
"End Line": 2600
},
{
"Function Name": "catch",
"Structural Impact": 4.4,
"Lines of Code (LOC)": 3,
"Control Flow Branches": 2,
"Input Parameters": 1,
"Control Flow Ratio": "50.0%",
"Start Line": 74,
"End Line": 76
},
{
"Function Name": "loop",
"Structural Impact": 4.2,
Expand Down Expand Up @@ -361626,7 +361636,7 @@
"Control Flow Branches": 288,
"Sequential Logic Declarations": 586,
"Function Parameters": 412,
"Function/Method Declarations": 253,
"Function/Method Declarations": 254,
"Class/Entity Declarations": 47,
"Defensive Programming Constructs": 258,
"Type/Safety Bypasses": 36,
Expand Down
28 changes: 19 additions & 9 deletions tests/golden_master_zero_dep_audit.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"Target Root Name": "data",
"Absolute Project Path": "/home/joe/nyx_projects/language-crucible/data",
"Analysis ISO Timestamp": "2026-08-26T15:27:45.955779+00:00",
"Total Scan Duration": "31.79 seconds"
"Analysis ISO Timestamp": "2026-08-26T19:15:50.161013+00:00",
"Total Scan Duration": "32.4 seconds"
},
"Source Control Footprint (Immutable Anchor)": {
"Active Branch": "HEAD",
Expand Down Expand Up @@ -360,7 +360,7 @@
"typescript": {
"files": 24,
"loc": 36020,
"impact": 4277.700000000002
"impact": 4278.140000000001
},
"kotlin": {
"files": 5,
Expand Down Expand Up @@ -1781,7 +1781,7 @@
},
"typescript/vscode": {
"file_count": 11,
"total_mass": 1429.32,
"total_mass": 1429.76,
"avg_exposures": {
"cognitive_load": 35.35,
"safety_score": 59.85,
Expand Down Expand Up @@ -358546,7 +358546,7 @@
}
},
"typescript/vscode": {
"Directory Group Magnitude": 1429.32,
"Directory Group Magnitude": 1429.76,
"File Count": 11,
"Ecosystem Fingerprint (Archetypes)": {
"Unclassified": "81.8%",
Expand Down Expand Up @@ -359062,9 +359062,9 @@
"Identity Proof": "Single Indicator (Ext: .ts)"
},
"2. Topological Coordinates": {
"X": 3477.88,
"X": 3477.86,
"Y": 154.07,
"Z": 3300.26
"Z": 3300.27
},
"3. Architectural Profile": {
"Repository Archetype": "Unclassified",
Expand All @@ -359076,7 +359076,7 @@
"Total LOC": 2646,
"Coding LOC": 1803,
"Documentation LOC": 419,
"Structural Magnitude": 319.07,
"Structural Magnitude": 319.51,
"Control Flow Ratio": "33.0%",
"Popularity Rank": 0,
"Raw Churn Frequency": 0.0,
Expand Down Expand Up @@ -359720,6 +359720,16 @@
"Start Line": 2592,
"End Line": 2600
},
{
"Function Name": "catch",
"Structural Impact": 4.4,
"Lines of Code (LOC)": 3,
"Control Flow Branches": 2,
"Input Parameters": 1,
"Control Flow Ratio": "50.0%",
"Start Line": 74,
"End Line": 76
},
{
"Function Name": "loop",
"Structural Impact": 4.2,
Expand Down Expand Up @@ -361626,7 +361636,7 @@
"Control Flow Branches": 288,
"Sequential Logic Declarations": 586,
"Function Parameters": 412,
"Function/Method Declarations": 253,
"Function/Method Declarations": 254,
"Class/Entity Declarations": 47,
"Defensive Programming Constructs": 258,
"Type/Safety Bypasses": 36,
Expand Down
2 changes: 1 addition & 1 deletion tests/tree_sitter_accuracy_baseline_typescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"args_exact_match": 2741,
"corpus_path": "language-crucible/data/typescript",
"extra_classes": 0,
"extra_functions": 12,
"extra_functions": 13,
"files_scanned": 23,
"found_classes": 842,
"found_functions": 2773,
Expand Down
Loading