-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsynapses.example.json
More file actions
118 lines (105 loc) · 3.19 KB
/
synapses.example.json
File metadata and controls
118 lines (105 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
"version": "1",
"rules": [
{
"id": "no-sql-in-view",
"description": "Database queries must not appear in view/component files. Route all DB access through a repository layer.",
"forbidden_edge": {
"from_file_pattern": "*.tsx",
"edge_type": "CALLS",
"to_name_pattern": "SELECT"
},
"severity": "error"
},
{
"id": "no-direct-db-in-handler",
"description": "HTTP handlers must not call database methods directly. Use a service or repository layer.",
"forbidden_edge": {
"from_file_pattern": "*handler*.go",
"edge_type": "IMPORTS",
"to_file_pattern": "*repository*.go"
},
"severity": "warning"
},
{
"id": "no-cross-service-struct-import",
"description": "Service structs must not import other service structs directly.",
"forbidden_edge": {
"from_type": "struct",
"edge_type": "IMPORTS",
"to_type": "struct"
},
"severity": "warning"
}
],
"edge_weights": {
"CALLS": 1.0,
"IMPLEMENTS": 0.9,
"EMBEDS": 0.85,
"DEPENDS_ON": 0.8,
"IMPORTS": 0.7,
"DEFINES": 0.6,
"EXPORTS": 0.5
},
"context_carve": {
"default_depth": 2,
"decay_factor": 0.5,
"token_budget": 4000,
"direction_boost": 0.2,
"exclude_test_files": true
},
"api_entries": [
{
"_comment": "Custom patterns for frameworks not auto-detected by conventions.",
"_comment2": "Built-in conventions (no config needed): net/http, gin, echo, fiber, gRPC, proto RPC.",
"name_pattern": "Handler",
"file_pattern": "*/routes/*",
"node_type": "function"
},
{
"name_pattern": "Controller",
"file_pattern": "*.controller.ts"
},
{
"file_pattern": "*/api/*",
"node_type": "function"
}
],
"data_flow_sources": [
{
"_comment": "Custom source patterns — built-in heuristics cover net/http, gin, echo, fiber, env vars, and parsers automatically.",
"name_pattern": "FromRequest",
"role": "http_input",
"label": "custom_http_source"
}
],
"data_flow_sinks": [
{
"_comment": "Custom sink patterns — built-in heuristics cover sql.DB, exec.Command, and file writes automatically.",
"name_pattern": "RawExec",
"role": "sql_sink",
"label": "custom_sql_sink"
}
],
"data_flow_max_hops": 4,
"use_go_types": false,
"use_ts_types": false,
"metrics_days": 90,
"coverage_profile": "",
"pprof_profile": "",
"plugins": [
{
"_comment": "External parser plugins for file types not handled by built-in parsers.",
"_comment2": "Protocol: synapses writes '<abs_path>\\n<file_content>' to stdin. Plugin writes JSON to stdout: {\"nodes\":[...],\"edges\":[...]}",
"_comment3": "Node fields: name(req), type(req: function/method/struct/interface/package), line(req), exported, doc, signature",
"_comment4": "Edge fields: from(req), to(req), type(req: CALLS/IMPORTS/DEFINES/...)",
"extensions": [".prisma"],
"command": "./parsers/prisma-parser"
},
{
"extensions": [".graphql", ".gql"],
"command": "node parsers/graphql.js"
}
],
"linked": []
}