@eduardbar/drift 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gga +50 -0
- package/.github/actions/drift-review/README.md +60 -0
- package/.github/actions/drift-review/action.yml +131 -0
- package/.github/actions/drift-scan/README.md +28 -32
- package/.github/actions/drift-scan/action.yml +78 -14
- package/.github/workflows/publish-vscode.yml +3 -3
- package/.github/workflows/publish.yml +3 -3
- package/.github/workflows/review-pr.yml +94 -9
- package/AGENTS.md +75 -245
- package/CHANGELOG.md +28 -0
- package/README.md +308 -51
- package/ROADMAP.md +6 -5
- package/dist/analyzer.d.ts +2 -2
- package/dist/analyzer.js +420 -159
- package/dist/benchmark.d.ts +2 -0
- package/dist/benchmark.js +204 -0
- package/dist/cli.js +693 -67
- package/dist/config.js +16 -2
- package/dist/diff.js +66 -10
- package/dist/doctor.d.ts +5 -0
- package/dist/doctor.js +133 -0
- package/dist/format.d.ts +17 -0
- package/dist/format.js +45 -0
- package/dist/git.js +12 -0
- package/dist/guard-types.d.ts +57 -0
- package/dist/guard-types.js +2 -0
- package/dist/guard.d.ts +14 -0
- package/dist/guard.js +239 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +6 -1
- package/dist/init.d.ts +15 -0
- package/dist/init.js +273 -0
- package/dist/map-cycles.d.ts +2 -0
- package/dist/map-cycles.js +34 -0
- package/dist/map-svg.d.ts +19 -0
- package/dist/map-svg.js +97 -0
- package/dist/map.js +78 -138
- package/dist/metrics.js +70 -55
- package/dist/output-metadata.d.ts +13 -0
- package/dist/output-metadata.js +17 -0
- package/dist/plugins-capabilities.d.ts +4 -0
- package/dist/plugins-capabilities.js +21 -0
- package/dist/plugins-messages.d.ts +10 -0
- package/dist/plugins-messages.js +16 -0
- package/dist/plugins-rules.d.ts +9 -0
- package/dist/plugins-rules.js +137 -0
- package/dist/plugins.d.ts +2 -1
- package/dist/plugins.js +80 -28
- package/dist/printer.js +4 -0
- package/dist/reporter-constants.d.ts +16 -0
- package/dist/reporter-constants.js +39 -0
- package/dist/reporter.d.ts +3 -3
- package/dist/reporter.js +35 -55
- package/dist/review.d.ts +2 -1
- package/dist/review.js +4 -3
- package/dist/rules/comments.js +2 -2
- package/dist/rules/complexity.js +2 -7
- package/dist/rules/nesting.js +3 -13
- package/dist/rules/phase0-basic.js +10 -10
- package/dist/rules/phase3-configurable.js +23 -15
- package/dist/rules/shared.d.ts +2 -0
- package/dist/rules/shared.js +27 -3
- package/dist/saas/constants.d.ts +15 -0
- package/dist/saas/constants.js +48 -0
- package/dist/saas/dashboard.d.ts +8 -0
- package/dist/saas/dashboard.js +132 -0
- package/dist/saas/errors.d.ts +19 -0
- package/dist/saas/errors.js +37 -0
- package/dist/saas/helpers.d.ts +21 -0
- package/dist/saas/helpers.js +110 -0
- package/dist/saas/ingest.d.ts +3 -0
- package/dist/saas/ingest.js +249 -0
- package/dist/saas/organization.d.ts +5 -0
- package/dist/saas/organization.js +82 -0
- package/dist/saas/plan-change.d.ts +10 -0
- package/dist/saas/plan-change.js +15 -0
- package/dist/saas/store.d.ts +21 -0
- package/dist/saas/store.js +159 -0
- package/dist/saas/types.d.ts +191 -0
- package/dist/saas/types.js +2 -0
- package/dist/saas.d.ts +8 -82
- package/dist/saas.js +7 -320
- package/dist/sarif.d.ts +74 -0
- package/dist/sarif.js +122 -0
- package/dist/trust-advanced.d.ts +14 -0
- package/dist/trust-advanced.js +65 -0
- package/dist/trust-kpi-fs.d.ts +3 -0
- package/dist/trust-kpi-fs.js +141 -0
- package/dist/trust-kpi-parse.d.ts +7 -0
- package/dist/trust-kpi-parse.js +186 -0
- package/dist/trust-kpi-types.d.ts +16 -0
- package/dist/trust-kpi-types.js +2 -0
- package/dist/trust-kpi.d.ts +7 -0
- package/dist/trust-kpi.js +185 -0
- package/dist/trust-policy.d.ts +32 -0
- package/dist/trust-policy.js +160 -0
- package/dist/trust-render.d.ts +9 -0
- package/dist/trust-render.js +54 -0
- package/dist/trust-scoring.d.ts +9 -0
- package/dist/trust-scoring.js +208 -0
- package/dist/trust.d.ts +37 -0
- package/dist/trust.js +168 -0
- package/dist/types/app.d.ts +30 -0
- package/dist/types/app.js +2 -0
- package/dist/types/config.d.ts +25 -0
- package/dist/types/config.js +2 -0
- package/dist/types/core.d.ts +100 -0
- package/dist/types/core.js +2 -0
- package/dist/types/diff.d.ts +55 -0
- package/dist/types/diff.js +2 -0
- package/dist/types/plugin.d.ts +41 -0
- package/dist/types/plugin.js +2 -0
- package/dist/types/trust.d.ts +120 -0
- package/dist/types/trust.js +2 -0
- package/dist/types.d.ts +8 -211
- package/docs/PRD.md +187 -109
- package/docs/plugin-contract.md +61 -0
- package/docs/release-notes-draft.md +40 -0
- package/docs/rules-catalog.md +49 -0
- package/docs/trust-core-release-checklist.md +87 -0
- package/package.json +6 -3
- package/packages/vscode-drift/src/code-actions.ts +1 -1
- package/schemas/drift-ai-output.v1.json +162 -0
- package/schemas/drift-report.v1.json +151 -0
- package/schemas/drift-trust.v1.json +131 -0
- package/scripts/smoke-repo.mjs +394 -0
- package/src/analyzer.ts +484 -155
- package/src/benchmark.ts +266 -0
- package/src/cli.ts +840 -85
- package/src/config.ts +19 -2
- package/src/diff.ts +84 -10
- package/src/doctor.ts +173 -0
- package/src/format.ts +81 -0
- package/src/git.ts +16 -0
- package/src/guard-types.ts +64 -0
- package/src/guard.ts +324 -0
- package/src/index.ts +83 -0
- package/src/init.ts +298 -0
- package/src/map-cycles.ts +38 -0
- package/src/map-svg.ts +124 -0
- package/src/map.ts +111 -142
- package/src/metrics.ts +78 -59
- package/src/output-metadata.ts +30 -0
- package/src/plugins-capabilities.ts +36 -0
- package/src/plugins-messages.ts +35 -0
- package/src/plugins-rules.ts +296 -0
- package/src/plugins.ts +148 -27
- package/src/printer.ts +4 -0
- package/src/reporter-constants.ts +46 -0
- package/src/reporter.ts +64 -65
- package/src/review.ts +6 -4
- package/src/rules/comments.ts +2 -2
- package/src/rules/complexity.ts +2 -7
- package/src/rules/nesting.ts +3 -13
- package/src/rules/phase0-basic.ts +11 -12
- package/src/rules/phase3-configurable.ts +39 -26
- package/src/rules/shared.ts +31 -3
- package/src/saas/constants.ts +56 -0
- package/src/saas/dashboard.ts +172 -0
- package/src/saas/errors.ts +45 -0
- package/src/saas/helpers.ts +140 -0
- package/src/saas/ingest.ts +278 -0
- package/src/saas/organization.ts +99 -0
- package/src/saas/plan-change.ts +19 -0
- package/src/saas/store.ts +172 -0
- package/src/saas/types.ts +216 -0
- package/src/saas.ts +49 -433
- package/src/sarif.ts +232 -0
- package/src/trust-advanced.ts +99 -0
- package/src/trust-kpi-fs.ts +169 -0
- package/src/trust-kpi-parse.ts +219 -0
- package/src/trust-kpi-types.ts +19 -0
- package/src/trust-kpi.ts +210 -0
- package/src/trust-policy.ts +246 -0
- package/src/trust-render.ts +61 -0
- package/src/trust-scoring.ts +231 -0
- package/src/trust.ts +260 -0
- package/src/types/app.ts +30 -0
- package/src/types/config.ts +27 -0
- package/src/types/core.ts +105 -0
- package/src/types/diff.ts +61 -0
- package/src/types/plugin.ts +46 -0
- package/src/types/trust.ts +134 -0
- package/src/types.ts +78 -238
- package/tests/cli-sarif.test.ts +92 -0
- package/tests/diff.test.ts +124 -0
- package/tests/format.test.ts +157 -0
- package/tests/new-features.test.ts +80 -1
- package/tests/phase1-init-doctor-guard.test.ts +199 -0
- package/tests/plugins.test.ts +219 -0
- package/tests/rules.test.ts +23 -1
- package/tests/saas-foundation.test.ts +358 -1
- package/tests/sarif.test.ts +160 -0
- package/tests/trust-kpi.test.ts +147 -0
- package/tests/trust.test.ts +602 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "schemas/drift-ai-output.v1.json",
|
|
4
|
+
"title": "drift ai output v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"$schema",
|
|
9
|
+
"toolVersion",
|
|
10
|
+
"summary",
|
|
11
|
+
"files_suspected",
|
|
12
|
+
"priority_order",
|
|
13
|
+
"maintenance_risk",
|
|
14
|
+
"quality",
|
|
15
|
+
"context_for_ai"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"$schema": {
|
|
19
|
+
"const": "schemas/drift-ai-output.v1.json"
|
|
20
|
+
},
|
|
21
|
+
"toolVersion": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"summary": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": [
|
|
28
|
+
"score",
|
|
29
|
+
"grade",
|
|
30
|
+
"total_issues",
|
|
31
|
+
"files_affected",
|
|
32
|
+
"files_clean",
|
|
33
|
+
"ai_likelihood",
|
|
34
|
+
"ai_code_smell_score"
|
|
35
|
+
],
|
|
36
|
+
"properties": {
|
|
37
|
+
"score": { "type": "number" },
|
|
38
|
+
"grade": { "type": "string" },
|
|
39
|
+
"total_issues": { "type": "number" },
|
|
40
|
+
"files_affected": { "type": "number" },
|
|
41
|
+
"files_clean": { "type": "number" },
|
|
42
|
+
"ai_likelihood": { "type": "number" },
|
|
43
|
+
"ai_code_smell_score": { "type": "number" }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files_suspected": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"required": ["path", "ai_likelihood", "triggers"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"path": { "type": "string" },
|
|
54
|
+
"ai_likelihood": { "type": "number" },
|
|
55
|
+
"triggers": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"items": { "type": "string" }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"priority_order": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": ["rank", "file", "line", "rule", "severity", "message", "snippet", "fix_suggestion", "effort"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"rank": { "type": "number" },
|
|
70
|
+
"file": { "type": "string" },
|
|
71
|
+
"line": { "type": "number" },
|
|
72
|
+
"rule": { "type": "string" },
|
|
73
|
+
"severity": { "type": "string" },
|
|
74
|
+
"message": { "type": "string" },
|
|
75
|
+
"snippet": { "type": "string" },
|
|
76
|
+
"fix_suggestion": { "type": "string" },
|
|
77
|
+
"effort": { "enum": ["low", "medium", "high"] }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"maintenance_risk": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"required": ["score", "level", "hotspots", "signals"],
|
|
85
|
+
"properties": {
|
|
86
|
+
"score": { "type": "number" },
|
|
87
|
+
"level": { "enum": ["low", "medium", "high", "critical"] },
|
|
88
|
+
"hotspots": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"items": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": false,
|
|
93
|
+
"required": [
|
|
94
|
+
"file",
|
|
95
|
+
"driftScore",
|
|
96
|
+
"complexityIssues",
|
|
97
|
+
"hasNearbyTests",
|
|
98
|
+
"changeFrequency",
|
|
99
|
+
"risk",
|
|
100
|
+
"reasons"
|
|
101
|
+
],
|
|
102
|
+
"properties": {
|
|
103
|
+
"file": { "type": "string" },
|
|
104
|
+
"driftScore": { "type": "number" },
|
|
105
|
+
"complexityIssues": { "type": "number" },
|
|
106
|
+
"hasNearbyTests": { "type": "boolean" },
|
|
107
|
+
"changeFrequency": { "type": "number" },
|
|
108
|
+
"risk": { "type": "number" },
|
|
109
|
+
"reasons": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": { "type": "string" }
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"signals": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"required": ["highComplexityFiles", "filesWithoutNearbyTests", "frequentChangeFiles"],
|
|
120
|
+
"properties": {
|
|
121
|
+
"highComplexityFiles": { "type": "number" },
|
|
122
|
+
"filesWithoutNearbyTests": { "type": "number" },
|
|
123
|
+
"frequentChangeFiles": { "type": "number" }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"quality": {
|
|
129
|
+
"type": "object",
|
|
130
|
+
"additionalProperties": false,
|
|
131
|
+
"required": ["overall", "dimensions"],
|
|
132
|
+
"properties": {
|
|
133
|
+
"overall": { "type": "number" },
|
|
134
|
+
"dimensions": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"additionalProperties": false,
|
|
137
|
+
"required": ["architecture", "complexity", "ai-patterns", "testing"],
|
|
138
|
+
"properties": {
|
|
139
|
+
"architecture": { "type": "number" },
|
|
140
|
+
"complexity": { "type": "number" },
|
|
141
|
+
"ai-patterns": { "type": "number" },
|
|
142
|
+
"testing": { "type": "number" }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"context_for_ai": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"additionalProperties": false,
|
|
150
|
+
"required": ["project_type", "scan_path", "rules_detected", "recommended_action"],
|
|
151
|
+
"properties": {
|
|
152
|
+
"project_type": { "type": "string" },
|
|
153
|
+
"scan_path": { "type": "string" },
|
|
154
|
+
"rules_detected": {
|
|
155
|
+
"type": "array",
|
|
156
|
+
"items": { "type": "string" }
|
|
157
|
+
},
|
|
158
|
+
"recommended_action": { "type": "string" }
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "schemas/drift-report.v1.json",
|
|
4
|
+
"title": "drift report v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"$schema",
|
|
9
|
+
"toolVersion",
|
|
10
|
+
"scannedAt",
|
|
11
|
+
"targetPath",
|
|
12
|
+
"files",
|
|
13
|
+
"totalIssues",
|
|
14
|
+
"totalScore",
|
|
15
|
+
"totalFiles",
|
|
16
|
+
"summary",
|
|
17
|
+
"quality",
|
|
18
|
+
"maintenanceRisk"
|
|
19
|
+
],
|
|
20
|
+
"properties": {
|
|
21
|
+
"$schema": {
|
|
22
|
+
"const": "schemas/drift-report.v1.json"
|
|
23
|
+
},
|
|
24
|
+
"toolVersion": {
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
"scannedAt": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"targetPath": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"files": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"items": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"additionalProperties": false,
|
|
38
|
+
"required": ["path", "issues", "score"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"path": { "type": "string" },
|
|
41
|
+
"score": { "type": "number" },
|
|
42
|
+
"issues": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["rule", "severity", "message", "line", "column", "snippet"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"rule": { "type": "string" },
|
|
50
|
+
"severity": { "enum": ["error", "warning", "info"] },
|
|
51
|
+
"message": { "type": "string" },
|
|
52
|
+
"line": { "type": "number" },
|
|
53
|
+
"column": { "type": "number" },
|
|
54
|
+
"snippet": { "type": "string" }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"totalIssues": {
|
|
62
|
+
"type": "number"
|
|
63
|
+
},
|
|
64
|
+
"totalScore": {
|
|
65
|
+
"type": "number"
|
|
66
|
+
},
|
|
67
|
+
"totalFiles": {
|
|
68
|
+
"type": "number"
|
|
69
|
+
},
|
|
70
|
+
"summary": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"required": ["errors", "warnings", "infos", "byRule"],
|
|
74
|
+
"properties": {
|
|
75
|
+
"errors": { "type": "number" },
|
|
76
|
+
"warnings": { "type": "number" },
|
|
77
|
+
"infos": { "type": "number" },
|
|
78
|
+
"byRule": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"additionalProperties": { "type": "number" }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"quality": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"required": ["overall", "dimensions"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"overall": { "type": "number" },
|
|
90
|
+
"dimensions": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": false,
|
|
93
|
+
"required": ["architecture", "complexity", "ai-patterns", "testing"],
|
|
94
|
+
"properties": {
|
|
95
|
+
"architecture": { "type": "number" },
|
|
96
|
+
"complexity": { "type": "number" },
|
|
97
|
+
"ai-patterns": { "type": "number" },
|
|
98
|
+
"testing": { "type": "number" }
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"maintenanceRisk": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": ["score", "level", "hotspots", "signals"],
|
|
107
|
+
"properties": {
|
|
108
|
+
"score": { "type": "number" },
|
|
109
|
+
"level": { "enum": ["low", "medium", "high", "critical"] },
|
|
110
|
+
"hotspots": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"items": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"additionalProperties": false,
|
|
115
|
+
"required": [
|
|
116
|
+
"file",
|
|
117
|
+
"driftScore",
|
|
118
|
+
"complexityIssues",
|
|
119
|
+
"hasNearbyTests",
|
|
120
|
+
"changeFrequency",
|
|
121
|
+
"risk",
|
|
122
|
+
"reasons"
|
|
123
|
+
],
|
|
124
|
+
"properties": {
|
|
125
|
+
"file": { "type": "string" },
|
|
126
|
+
"driftScore": { "type": "number" },
|
|
127
|
+
"complexityIssues": { "type": "number" },
|
|
128
|
+
"hasNearbyTests": { "type": "boolean" },
|
|
129
|
+
"changeFrequency": { "type": "number" },
|
|
130
|
+
"risk": { "type": "number" },
|
|
131
|
+
"reasons": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"items": { "type": "string" }
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"signals": {
|
|
139
|
+
"type": "object",
|
|
140
|
+
"additionalProperties": false,
|
|
141
|
+
"required": ["highComplexityFiles", "filesWithoutNearbyTests", "frequentChangeFiles"],
|
|
142
|
+
"properties": {
|
|
143
|
+
"highComplexityFiles": { "type": "number" },
|
|
144
|
+
"filesWithoutNearbyTests": { "type": "number" },
|
|
145
|
+
"frequentChangeFiles": { "type": "number" }
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "schemas/drift-trust.v1.json",
|
|
4
|
+
"title": "drift trust v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"$schema",
|
|
9
|
+
"toolVersion",
|
|
10
|
+
"scannedAt",
|
|
11
|
+
"targetPath",
|
|
12
|
+
"trust_score",
|
|
13
|
+
"merge_risk",
|
|
14
|
+
"top_reasons",
|
|
15
|
+
"fix_priorities"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"$schema": {
|
|
19
|
+
"const": "schemas/drift-trust.v1.json"
|
|
20
|
+
},
|
|
21
|
+
"toolVersion": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"scannedAt": {
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
"targetPath": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"trust_score": {
|
|
31
|
+
"type": "number"
|
|
32
|
+
},
|
|
33
|
+
"merge_risk": {
|
|
34
|
+
"enum": ["LOW", "MEDIUM", "HIGH", "CRITICAL"]
|
|
35
|
+
},
|
|
36
|
+
"top_reasons": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["label", "detail", "impact"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"label": { "type": "string" },
|
|
44
|
+
"detail": { "type": "string" },
|
|
45
|
+
"impact": { "type": "number" }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"fix_priorities": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"required": [
|
|
55
|
+
"rank",
|
|
56
|
+
"rule",
|
|
57
|
+
"severity",
|
|
58
|
+
"occurrences",
|
|
59
|
+
"estimated_trust_gain",
|
|
60
|
+
"effort",
|
|
61
|
+
"suggestion"
|
|
62
|
+
],
|
|
63
|
+
"properties": {
|
|
64
|
+
"rank": { "type": "number" },
|
|
65
|
+
"rule": { "type": "string" },
|
|
66
|
+
"severity": { "enum": ["error", "warning", "info"] },
|
|
67
|
+
"occurrences": { "type": "number" },
|
|
68
|
+
"estimated_trust_gain": { "type": "number" },
|
|
69
|
+
"effort": { "enum": ["low", "medium", "high"] },
|
|
70
|
+
"suggestion": { "type": "string" },
|
|
71
|
+
"confidence": { "enum": ["low", "medium", "high"] },
|
|
72
|
+
"explanation": { "type": "string" },
|
|
73
|
+
"systemic": { "type": "boolean" }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"diff_context": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"required": [
|
|
81
|
+
"baseRef",
|
|
82
|
+
"status",
|
|
83
|
+
"scoreDelta",
|
|
84
|
+
"newIssues",
|
|
85
|
+
"resolvedIssues",
|
|
86
|
+
"filesChanged",
|
|
87
|
+
"penalty",
|
|
88
|
+
"bonus",
|
|
89
|
+
"netImpact"
|
|
90
|
+
],
|
|
91
|
+
"properties": {
|
|
92
|
+
"baseRef": { "type": "string" },
|
|
93
|
+
"status": { "enum": ["improved", "regressed", "neutral"] },
|
|
94
|
+
"scoreDelta": { "type": "number" },
|
|
95
|
+
"newIssues": { "type": "number" },
|
|
96
|
+
"resolvedIssues": { "type": "number" },
|
|
97
|
+
"filesChanged": { "type": "number" },
|
|
98
|
+
"penalty": { "type": "number" },
|
|
99
|
+
"bonus": { "type": "number" },
|
|
100
|
+
"netImpact": { "type": "number" }
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"advanced_context": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": ["team_guidance"],
|
|
107
|
+
"properties": {
|
|
108
|
+
"comparison": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"additionalProperties": false,
|
|
111
|
+
"required": ["source", "trend", "summary"],
|
|
112
|
+
"properties": {
|
|
113
|
+
"source": { "enum": ["previous-trust-json", "snapshot-history"] },
|
|
114
|
+
"trend": { "enum": ["improving", "regressing", "stable"] },
|
|
115
|
+
"summary": { "type": "string" },
|
|
116
|
+
"trust_delta": { "type": "number" },
|
|
117
|
+
"previous_trust_score": { "type": "number" },
|
|
118
|
+
"previous_merge_risk": { "enum": ["LOW", "MEDIUM", "HIGH", "CRITICAL"] },
|
|
119
|
+
"snapshot_score_delta": { "type": "number" },
|
|
120
|
+
"snapshot_label": { "type": "string" },
|
|
121
|
+
"snapshot_timestamp": { "type": "string" }
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"team_guidance": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": { "type": "string" }
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|