@neurcode-ai/cli 0.9.50 → 0.9.60
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/dist/commands/fix.d.ts.map +1 -1
- package/dist/commands/fix.js +307 -31
- package/dist/commands/fix.js.map +1 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +264 -13
- package/dist/commands/verify.js.map +1 -1
- package/dist/daemon/server.d.ts +23 -0
- package/dist/daemon/server.d.ts.map +1 -0
- package/dist/daemon/server.js +226 -0
- package/dist/daemon/server.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/intent-engine/coverage.d.ts +69 -0
- package/dist/intent-engine/coverage.d.ts.map +1 -0
- package/dist/intent-engine/coverage.js +140 -0
- package/dist/intent-engine/coverage.js.map +1 -0
- package/dist/intent-engine/flow-rules.d.ts +21 -0
- package/dist/intent-engine/flow-rules.d.ts.map +1 -0
- package/dist/intent-engine/flow-rules.js +83 -0
- package/dist/intent-engine/flow-rules.js.map +1 -0
- package/dist/intent-engine/flow-validator.d.ts +29 -0
- package/dist/intent-engine/flow-validator.d.ts.map +1 -0
- package/dist/intent-engine/flow-validator.js +202 -0
- package/dist/intent-engine/flow-validator.js.map +1 -0
- package/dist/intent-engine/graph.d.ts +33 -0
- package/dist/intent-engine/graph.d.ts.map +1 -0
- package/dist/intent-engine/graph.js +67 -0
- package/dist/intent-engine/graph.js.map +1 -0
- package/dist/intent-engine/index.d.ts +35 -0
- package/dist/intent-engine/index.d.ts.map +1 -0
- package/dist/intent-engine/index.js +94 -0
- package/dist/intent-engine/index.js.map +1 -0
- package/dist/intent-engine/indexer.d.ts +18 -0
- package/dist/intent-engine/indexer.d.ts.map +1 -0
- package/dist/intent-engine/indexer.js +100 -0
- package/dist/intent-engine/indexer.js.map +1 -0
- package/dist/intent-engine/matcher.d.ts +35 -0
- package/dist/intent-engine/matcher.d.ts.map +1 -0
- package/dist/intent-engine/matcher.js +522 -0
- package/dist/intent-engine/matcher.js.map +1 -0
- package/dist/intent-engine/parser.d.ts +12 -0
- package/dist/intent-engine/parser.d.ts.map +1 -0
- package/dist/intent-engine/parser.js +93 -0
- package/dist/intent-engine/parser.js.map +1 -0
- package/dist/intent-engine/regression.d.ts +32 -0
- package/dist/intent-engine/regression.d.ts.map +1 -0
- package/dist/intent-engine/regression.js +166 -0
- package/dist/intent-engine/regression.js.map +1 -0
- package/dist/intent-engine/requirements.d.ts +22 -0
- package/dist/intent-engine/requirements.d.ts.map +1 -0
- package/dist/intent-engine/requirements.js +147 -0
- package/dist/intent-engine/requirements.js.map +1 -0
- package/dist/intent-engine/state.d.ts +44 -0
- package/dist/intent-engine/state.d.ts.map +1 -0
- package/dist/intent-engine/state.js +83 -0
- package/dist/intent-engine/state.js.map +1 -0
- package/dist/utils/ai-debt-budget.d.ts +3 -2
- package/dist/utils/ai-debt-budget.d.ts.map +1 -1
- package/dist/utils/ai-debt-budget.js +83 -2
- package/dist/utils/ai-debt-budget.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Intent–Code Matcher — compares a ParsedIntent against a FileMeta index and
|
|
4
|
+
* returns:
|
|
5
|
+
*
|
|
6
|
+
* IntentIssue[] — missing / misplaced / partial issues
|
|
7
|
+
* componentMap — component → files where it was detected
|
|
8
|
+
* componentQuality — component → 'strong' | 'weak' quality signal
|
|
9
|
+
*
|
|
10
|
+
* No LLM calls. All checks are deterministic keyword/pattern matching.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.matchIntentToCode = matchIntentToCode;
|
|
14
|
+
const COMPONENT_SIGNALS = {
|
|
15
|
+
'input-validation': {
|
|
16
|
+
strong: [
|
|
17
|
+
/\b(zod|joi|yup|valibot|ajv|class-validator|express-validator)\b/i,
|
|
18
|
+
/\.safeParse\s*\(|\.parse\s*\(req|schema\.validate\s*\(/i,
|
|
19
|
+
/\bvalidateInput\s*\(/i,
|
|
20
|
+
],
|
|
21
|
+
weak: [
|
|
22
|
+
/\.validate\s*\(|\.sanitize\s*\(/i,
|
|
23
|
+
/\bschema\s*=\s*\{|const\s+\w+Schema\b/i,
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
'token-generation': {
|
|
27
|
+
strong: [
|
|
28
|
+
/\bjwt\.sign\s*\(/i,
|
|
29
|
+
/\bsignToken\b|\bsignJWT\b/i,
|
|
30
|
+
],
|
|
31
|
+
weak: [
|
|
32
|
+
/\bcreateToken\b|\bgenerateToken\b/i,
|
|
33
|
+
/\bnew\s+\w*[Tt]oken\b/,
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
'token-expiry': {
|
|
37
|
+
strong: [
|
|
38
|
+
/\bexpiresIn\s*:\s*['"\d]/i,
|
|
39
|
+
/\bexp\s*:\s*(Math\.floor|Date\.now|\d)/i,
|
|
40
|
+
],
|
|
41
|
+
weak: [
|
|
42
|
+
/\brefreshToken\b|\brotateToken\b/i,
|
|
43
|
+
/\bttl\s*:/i,
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
'role-check': {
|
|
47
|
+
strong: [
|
|
48
|
+
/\b(hasRole|checkRole|requireRole|isAdmin|canAccess)\s*\(/i,
|
|
49
|
+
/\brequirePermission\s*\(|rbac\b/i,
|
|
50
|
+
],
|
|
51
|
+
weak: [
|
|
52
|
+
/\brole\s*===\s*['"]|roles\.(includes|has)\s*\(/i,
|
|
53
|
+
/\bpermission\b/i,
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
'middleware-protection': {
|
|
57
|
+
strong: [
|
|
58
|
+
/\bauthMiddleware\b|\bprotectRoute\b|\brequireAuth\b/i,
|
|
59
|
+
/router\.(use|get|post|put|delete|patch)\s*\([^,)]+,\s*(auth|protect|verify|guard)/i,
|
|
60
|
+
],
|
|
61
|
+
weak: [
|
|
62
|
+
/\bPrivateRoute\b|\bRequireAuth\b|\bwithAuth\b/i,
|
|
63
|
+
/middleware.*auth|auth.*middleware/i,
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
'password-hashing': {
|
|
67
|
+
strong: [
|
|
68
|
+
/\bbcrypt\.(hash|compare|genSalt)\s*\(/i,
|
|
69
|
+
/\bargon2\.(hash|verify)\s*\(/i,
|
|
70
|
+
],
|
|
71
|
+
weak: [
|
|
72
|
+
/\bscrypt\b|\bpbkdf2\b/i,
|
|
73
|
+
/\bhashPassword\s*\(|\bverifyPassword\s*\(/i,
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
'error-handling': {
|
|
77
|
+
strong: [
|
|
78
|
+
/\btry\s*\{[\s\S]{0,400}\}\s*catch\s*\(/,
|
|
79
|
+
/next\s*\(\s*err|res\.(status|json)\s*\(\s*[45]\d\d/i,
|
|
80
|
+
],
|
|
81
|
+
weak: [
|
|
82
|
+
/\.catch\s*\(err|catch\s*\(\s*(e|error)\b/i,
|
|
83
|
+
/\bHttpException\b|\bApiError\b|\bAppError\b/i,
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
'service-layer-separation': {
|
|
87
|
+
strong: [
|
|
88
|
+
/\bimport\s+.*from\s+['"][^'"]*\/(service|repository|repo)[^'"]*['"]/i,
|
|
89
|
+
/\bnew\s+\w+(Service|Repository|Repo)\s*\(/i,
|
|
90
|
+
],
|
|
91
|
+
weak: [
|
|
92
|
+
/\b\w+(Service|Repository)\b/i,
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
'auth-middleware': {
|
|
96
|
+
strong: [
|
|
97
|
+
/app\.(use|get|post)\s*\([^,)]*,\s*(auth|verifyToken|protect)/i,
|
|
98
|
+
/\bauthMiddleware\b|\bverifyToken\b/i,
|
|
99
|
+
],
|
|
100
|
+
weak: [
|
|
101
|
+
/middleware.*auth|auth.*middleware/i,
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
'response-schema': {
|
|
105
|
+
strong: [
|
|
106
|
+
/\bResponseSchema\b|\bApiResponse<|\bResponseDto\b/i,
|
|
107
|
+
/z\.object\s*\(\s*\{.*\}\s*\)\.parse/i,
|
|
108
|
+
],
|
|
109
|
+
weak: [
|
|
110
|
+
/\bserialize\s*\(|\btoJSON\s*\(/i,
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
'idempotency': {
|
|
114
|
+
strong: [
|
|
115
|
+
/\bidempotencyKey\b|\bidempotency(-|_)key\b/i,
|
|
116
|
+
/\bfindOrCreate\b/i,
|
|
117
|
+
],
|
|
118
|
+
weak: [
|
|
119
|
+
/\bupsert\b/i,
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
'webhook-verification': {
|
|
123
|
+
strong: [
|
|
124
|
+
/stripe\.webhooks\.constructEvent\s*\(/i,
|
|
125
|
+
/\bverifyWebhookSignature\b/i,
|
|
126
|
+
/\bhmac\b.*\bdigest\b|\bcreateHmac\b/i,
|
|
127
|
+
],
|
|
128
|
+
weak: [
|
|
129
|
+
/\bsignature\b.*verify|verify.*\bsignature\b/i,
|
|
130
|
+
/\bwebhook.*secret\b/i,
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
'secure-data-handling': {
|
|
134
|
+
strong: [
|
|
135
|
+
/\bmask\s*\(|\bredact\s*\(/i,
|
|
136
|
+
/\bencrypt\s*\(/i,
|
|
137
|
+
],
|
|
138
|
+
weak: [
|
|
139
|
+
/\bPCI\b|\btokeniz/i,
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
'transaction-handling': {
|
|
143
|
+
strong: [
|
|
144
|
+
/\b\$transaction\s*\(|\bwithTransaction\s*\(/i,
|
|
145
|
+
/\bbeginTransaction\s*\(|\bcommit\s*\(\s*\)|\brollback\s*\(\s*\)/i,
|
|
146
|
+
],
|
|
147
|
+
weak: [
|
|
148
|
+
/\btransaction\b/i,
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
'migration-safety': {
|
|
152
|
+
strong: [
|
|
153
|
+
/\bdown\s*\(\s*(queryInterface|db|knex)\b/i,
|
|
154
|
+
/exports\.down\s*=/i,
|
|
155
|
+
],
|
|
156
|
+
weak: [
|
|
157
|
+
/\bmigration\b|\bmigrate\b/i,
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
'connection-pooling': {
|
|
161
|
+
strong: [
|
|
162
|
+
/\bmaxConnections\b|\bpoolSize\b|\bpool\.max\b/i,
|
|
163
|
+
/\bnew\s+Pool\s*\(/i,
|
|
164
|
+
],
|
|
165
|
+
weak: [
|
|
166
|
+
/\bpool\b/i,
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
'input-sanitization': {
|
|
170
|
+
strong: [
|
|
171
|
+
/\bDOMPurify\.sanitize\s*\(|\bsanitizeHtml\s*\(/i,
|
|
172
|
+
/\bescapeHtml\s*\(|\bxss\s*\(/i,
|
|
173
|
+
],
|
|
174
|
+
weak: [
|
|
175
|
+
/\bsanitize\b/i,
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
'output-encoding': {
|
|
179
|
+
strong: [
|
|
180
|
+
/\bencodeURIComponent\s*\(|\bhtmlEncode\s*\(/i,
|
|
181
|
+
/\bDOMPurify\.sanitize\s*\(/i,
|
|
182
|
+
],
|
|
183
|
+
weak: [
|
|
184
|
+
/\bescape\s*\(/i,
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
'secret-management': {
|
|
188
|
+
strong: [
|
|
189
|
+
/process\.env\.\w*(SECRET|KEY|TOKEN|PASSWORD)\b/i,
|
|
190
|
+
/\bvault\b|\baws-secrets\b/i,
|
|
191
|
+
],
|
|
192
|
+
weak: [
|
|
193
|
+
/\bdotenv\b|\bconfig\.\w*(secret|key)\b/i,
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
'cors-policy': {
|
|
197
|
+
strong: [
|
|
198
|
+
/\bcors\s*\(\s*\{/i,
|
|
199
|
+
/\bAccess-Control-Allow-Origin\b/,
|
|
200
|
+
],
|
|
201
|
+
weak: [
|
|
202
|
+
/\bcors\b/i,
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
'https-enforcement': {
|
|
206
|
+
strong: [
|
|
207
|
+
/\bforceHttps\b|\brequireHttps\b/i,
|
|
208
|
+
/\bsecure\s*:\s*true\b/i,
|
|
209
|
+
],
|
|
210
|
+
weak: [
|
|
211
|
+
/\bhttps\b/i,
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
'recipient-validation': {
|
|
215
|
+
strong: [
|
|
216
|
+
/\bvalidateEmail\s*\(|\bisEmail\s*\(/i,
|
|
217
|
+
],
|
|
218
|
+
weak: [
|
|
219
|
+
/email.*valid|valid.*email/i,
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
'retry-logic': {
|
|
223
|
+
strong: [
|
|
224
|
+
/\bretry\s*\(|\bmaxRetries\b|\bexponentialBackoff\b/i,
|
|
225
|
+
],
|
|
226
|
+
weak: [
|
|
227
|
+
/\bretries\b/i,
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
'template-validation': {
|
|
231
|
+
strong: [
|
|
232
|
+
/\bHandlebars\.compile\s*\(|\bejs\.render\s*\(/i,
|
|
233
|
+
],
|
|
234
|
+
weak: [
|
|
235
|
+
/\btemplate\b.*\bvalidat|\bvalidat.*\btemplate/i,
|
|
236
|
+
],
|
|
237
|
+
},
|
|
238
|
+
'rate-limiting': {
|
|
239
|
+
strong: [
|
|
240
|
+
/\brateLimit\s*\(|\brate-limiter\b/i,
|
|
241
|
+
/\bthrottler\b|\bthrottle\s*\(/i,
|
|
242
|
+
],
|
|
243
|
+
weak: [
|
|
244
|
+
/\brate.?limit\b/i,
|
|
245
|
+
],
|
|
246
|
+
},
|
|
247
|
+
'file-type-validation': {
|
|
248
|
+
strong: [
|
|
249
|
+
/\bmimetype\b.*\bvalidat|\bvalidat.*\bmimetype/i,
|
|
250
|
+
/\ballowedMimeTypes\b|\bfileFilter\s*\(/i,
|
|
251
|
+
],
|
|
252
|
+
weak: [
|
|
253
|
+
/\bmimetype\b|\bfileType\b/i,
|
|
254
|
+
],
|
|
255
|
+
},
|
|
256
|
+
'size-limit-enforcement': {
|
|
257
|
+
strong: [
|
|
258
|
+
/\bmaxSize\s*:\s*\d|\bfileSizeLimit\s*:\s*\d/i,
|
|
259
|
+
/fileSize\s*[><=]+\s*\d/i,
|
|
260
|
+
],
|
|
261
|
+
weak: [
|
|
262
|
+
/\bmaxSize\b|\bsizeLimit\b/i,
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
'filename-sanitization': {
|
|
266
|
+
strong: [
|
|
267
|
+
/\bpath\.basename\s*\(|\bpath\.extname\s*\(/i,
|
|
268
|
+
/sanitize.*filename|filename.*sanitize/i,
|
|
269
|
+
],
|
|
270
|
+
weak: [
|
|
271
|
+
/\bfilename\b.*\bclean|\bclean.*\bfilename/i,
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
'access-control': {
|
|
275
|
+
strong: [
|
|
276
|
+
/\bcheckPermission\s*\(|\brequirePermission\s*\(/i,
|
|
277
|
+
/\bforbidden\b|\bunauthorized\b/i,
|
|
278
|
+
],
|
|
279
|
+
weak: [
|
|
280
|
+
/\bauthorize\b|\bpermission\b/i,
|
|
281
|
+
],
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
// ── Domain-presence guard signals ─────────────────────────────────────────────
|
|
285
|
+
const DOMAIN_PRESENCE_SIGNALS = {
|
|
286
|
+
auth: [
|
|
287
|
+
/\b(verify|validate|check)\w*(Token|JWT|Session|Auth)\b/i,
|
|
288
|
+
/\bjwt\.(verify|sign|decode)\b/i,
|
|
289
|
+
/\bbearerToken\b|\bauthorization\b/i,
|
|
290
|
+
/\bpassport\./i,
|
|
291
|
+
/middleware.*auth|auth.*middleware/i,
|
|
292
|
+
],
|
|
293
|
+
};
|
|
294
|
+
// ── Layer rules (misplaced logic) ─────────────────────────────────────────────
|
|
295
|
+
const LAYER_RULES = [
|
|
296
|
+
{
|
|
297
|
+
offendingLayer: 'ui',
|
|
298
|
+
bannedDomains: ['database'],
|
|
299
|
+
signal: /\b(prisma|db|knex|sequelize|pool)\s*\.\s*(query|findMany|findOne|create|execute)\b/i,
|
|
300
|
+
message: (file) => `Database access found in UI component ${file} — DB calls belong in the service/repository layer`,
|
|
301
|
+
rule: 'intent:db-in-ui',
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
offendingLayer: 'ui',
|
|
305
|
+
bannedDomains: ['auth'],
|
|
306
|
+
signal: /\bjwt\.(sign|verify)\b|bcrypt\.(hash|compare)\b/i,
|
|
307
|
+
message: (file) => `Auth/crypto logic found in UI component ${file} — cryptographic operations belong in the API/service layer`,
|
|
308
|
+
rule: 'intent:auth-logic-in-ui',
|
|
309
|
+
},
|
|
310
|
+
];
|
|
311
|
+
const MISSING_CHECKS = [
|
|
312
|
+
{
|
|
313
|
+
domain: 'auth', componentKey: 'input-validation', presentIn: 'api',
|
|
314
|
+
message: 'Auth flow added but no input validation found in API handlers — all inputs must be validated at the boundary',
|
|
315
|
+
severity: 'high', rule: 'intent:missing-input-validation',
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
domain: 'auth', componentKey: 'role-check', presentIn: 'api',
|
|
319
|
+
message: 'JWT/token auth added but no role-based access checks found — RBAC enforcement appears missing',
|
|
320
|
+
severity: 'medium', rule: 'intent:missing-role-checks',
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
domain: 'auth', componentKey: 'token-expiry', presentIn: 'any',
|
|
324
|
+
message: 'Token issuance found but no expiry / refresh-token logic detected — tokens without expiry are a security risk',
|
|
325
|
+
severity: 'high', rule: 'intent:missing-token-expiry',
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
domain: 'api', componentKey: 'input-validation', presentIn: 'api',
|
|
329
|
+
message: 'API endpoints modified but no request validation library usage found — req.body must be validated',
|
|
330
|
+
severity: 'high', rule: 'intent:missing-api-validation',
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
domain: 'api', componentKey: 'error-handling', presentIn: 'api',
|
|
334
|
+
message: 'API handlers added without consistent error handling — unhandled rejections will expose stack traces',
|
|
335
|
+
severity: 'medium', rule: 'intent:missing-error-handling',
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
domain: 'payment', componentKey: 'idempotency', presentIn: 'any',
|
|
339
|
+
message: 'Payment logic added but no idempotency key handling found — duplicate charges possible without idempotency',
|
|
340
|
+
severity: 'high', rule: 'intent:missing-payment-idempotency',
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
domain: 'payment', componentKey: 'webhook-verification', presentIn: 'any',
|
|
344
|
+
message: 'Payment webhook handling added but signature verification not found — unverified webhooks allow spoofing',
|
|
345
|
+
severity: 'high', rule: 'intent:missing-webhook-verification',
|
|
346
|
+
},
|
|
347
|
+
];
|
|
348
|
+
// ── Domain component lists (mirrors requirements.ts without circular import) ──
|
|
349
|
+
const DOMAIN_COMPONENTS = {
|
|
350
|
+
auth: ['input-validation', 'token-generation', 'token-expiry', 'role-check', 'middleware-protection', 'password-hashing'],
|
|
351
|
+
api: ['input-validation', 'error-handling', 'service-layer-separation', 'auth-middleware', 'response-schema'],
|
|
352
|
+
payment: ['input-validation', 'idempotency', 'webhook-verification', 'error-handling', 'secure-data-handling'],
|
|
353
|
+
database: ['transaction-handling', 'migration-safety', 'connection-pooling', 'input-sanitization'],
|
|
354
|
+
security: ['input-sanitization', 'output-encoding', 'secret-management', 'cors-policy', 'https-enforcement'],
|
|
355
|
+
notification: ['recipient-validation', 'retry-logic', 'template-validation', 'rate-limiting'],
|
|
356
|
+
file: ['file-type-validation', 'size-limit-enforcement', 'filename-sanitization', 'access-control'],
|
|
357
|
+
};
|
|
358
|
+
// Components whose detection should be limited to api-layer file content
|
|
359
|
+
const API_SCOPED_COMPONENTS = new Set([
|
|
360
|
+
'error-handling', 'service-layer-separation', 'auth-middleware', 'response-schema',
|
|
361
|
+
]);
|
|
362
|
+
// ── Core helpers ──────────────────────────────────────────────────────────────
|
|
363
|
+
function filesOfLayer(index, layer) {
|
|
364
|
+
return [...index.values()].filter((m) => m.layer === layer);
|
|
365
|
+
}
|
|
366
|
+
function allAddedContent(files) {
|
|
367
|
+
return files.map((f) => f.addedContent).join('\n');
|
|
368
|
+
}
|
|
369
|
+
// ── Component detection (file-level) ─────────────────────────────────────────
|
|
370
|
+
/**
|
|
371
|
+
* For each component key: scan every file in the index and record which files
|
|
372
|
+
* contain a strong or weak signal. Returns the component→files map and a
|
|
373
|
+
* quality level per detected component.
|
|
374
|
+
*/
|
|
375
|
+
function detectComponents(domains, index, effectiveApiFiles) {
|
|
376
|
+
const componentMap = {};
|
|
377
|
+
const componentQuality = {};
|
|
378
|
+
const allFiles = [...index.values()];
|
|
379
|
+
for (const domain of domains) {
|
|
380
|
+
const keys = DOMAIN_COMPONENTS[domain] ?? [];
|
|
381
|
+
for (const key of keys) {
|
|
382
|
+
const signals = COMPONENT_SIGNALS[key];
|
|
383
|
+
if (!signals)
|
|
384
|
+
continue;
|
|
385
|
+
const searchFiles = API_SCOPED_COMPONENTS.has(key) ? effectiveApiFiles : allFiles;
|
|
386
|
+
const foundInFiles = [];
|
|
387
|
+
let quality = 'weak';
|
|
388
|
+
for (const file of searchFiles) {
|
|
389
|
+
const content = file.addedContent;
|
|
390
|
+
if (!content)
|
|
391
|
+
continue;
|
|
392
|
+
const hasStrong = signals.strong.some((re) => re.test(content));
|
|
393
|
+
const hasWeak = signals.weak.some((re) => re.test(content));
|
|
394
|
+
if (hasStrong) {
|
|
395
|
+
foundInFiles.push(file.path);
|
|
396
|
+
quality = 'strong';
|
|
397
|
+
}
|
|
398
|
+
else if (hasWeak && !foundInFiles.includes(file.path)) {
|
|
399
|
+
foundInFiles.push(file.path);
|
|
400
|
+
// quality stays 'weak' unless strong found elsewhere
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
if (foundInFiles.length > 0) {
|
|
404
|
+
componentMap[key] = foundInFiles;
|
|
405
|
+
componentQuality[key] = quality;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return { componentMap, componentQuality };
|
|
410
|
+
}
|
|
411
|
+
// ── Public API ────────────────────────────────────────────────────────────────
|
|
412
|
+
function matchIntentToCode(intent, index) {
|
|
413
|
+
if (intent.domains.length === 0 || index.size === 0) {
|
|
414
|
+
return { intentIssues: [], checkedDomains: [], componentMap: {}, componentQuality: {}, foundComponents: {} };
|
|
415
|
+
}
|
|
416
|
+
const issues = [];
|
|
417
|
+
const domainSet = new Set(intent.domains);
|
|
418
|
+
// ── 1. Misplaced logic ───────────────────────────────────────────────────
|
|
419
|
+
for (const rule of LAYER_RULES) {
|
|
420
|
+
if (!rule.bannedDomains.some((d) => domainSet.has(d)))
|
|
421
|
+
continue;
|
|
422
|
+
const uiFiles = filesOfLayer(index, 'ui');
|
|
423
|
+
const offenders = uiFiles.filter((f) => rule.signal.test(f.addedContent));
|
|
424
|
+
if (offenders.length > 0) {
|
|
425
|
+
issues.push({
|
|
426
|
+
type: 'misplaced',
|
|
427
|
+
message: rule.message(offenders.map((f) => f.path).join(', ')),
|
|
428
|
+
files: offenders.map((f) => f.path),
|
|
429
|
+
severity: 'high',
|
|
430
|
+
rule: rule.rule,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
// ── 2. Content views ─────────────────────────────────────────────────────
|
|
435
|
+
const apiFiles = filesOfLayer(index, 'api');
|
|
436
|
+
const effectiveApiFiles = apiFiles.length > 0
|
|
437
|
+
? apiFiles
|
|
438
|
+
: [...index.values()].filter((m) => /\bapi\b|\bauth\b|\broute\b|\bhandler\b|\bcontroller\b/i.test(m.path));
|
|
439
|
+
const apiContent = allAddedContent(effectiveApiFiles);
|
|
440
|
+
const allContent = allAddedContent([...index.values()]);
|
|
441
|
+
const allPaths = [...index.keys()].map((p) => p.toLowerCase()).join(' ');
|
|
442
|
+
const AUTH_PATH_SIGNAL = /\bauth\b|\blogin\b|\bsignup\b|\bregister\b|\btoken\b|\bjwt\b/i;
|
|
443
|
+
// ── 3. Missing expected behavior ─────────────────────────────────────────
|
|
444
|
+
for (const check of MISSING_CHECKS) {
|
|
445
|
+
if (!domainSet.has(check.domain))
|
|
446
|
+
continue;
|
|
447
|
+
const searchContent = check.presentIn === 'api' ? apiContent : allContent;
|
|
448
|
+
if (!searchContent.trim() && !allPaths)
|
|
449
|
+
continue;
|
|
450
|
+
const hasDomainCode = domainSet.has('auth')
|
|
451
|
+
? DOMAIN_PRESENCE_SIGNALS.auth.some((re) => re.test(allContent)) ||
|
|
452
|
+
AUTH_PATH_SIGNAL.test(allPaths) ||
|
|
453
|
+
AUTH_PATH_SIGNAL.test(allContent)
|
|
454
|
+
: true;
|
|
455
|
+
if (!hasDomainCode)
|
|
456
|
+
continue;
|
|
457
|
+
const componentSignals = COMPONENT_SIGNALS[check.componentKey];
|
|
458
|
+
const allSignals = componentSignals
|
|
459
|
+
? [...componentSignals.strong, ...componentSignals.weak]
|
|
460
|
+
: [];
|
|
461
|
+
const isPresent = allSignals.length > 0
|
|
462
|
+
? allSignals.some((re) => re.test(searchContent))
|
|
463
|
+
: false;
|
|
464
|
+
if (!isPresent) {
|
|
465
|
+
let issueFiles;
|
|
466
|
+
if (check.presentIn === 'api') {
|
|
467
|
+
issueFiles = effectiveApiFiles.map((f) => f.path);
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
const domainKeyRe = new RegExp(`\\b${check.domain}\\b`, 'i');
|
|
471
|
+
const domainFiles = [...index.values()].filter((m) => domainKeyRe.test(m.path)).map((m) => m.path);
|
|
472
|
+
issueFiles = domainFiles.length > 0 ? domainFiles : [...index.keys()];
|
|
473
|
+
}
|
|
474
|
+
issues.push({
|
|
475
|
+
type: 'missing',
|
|
476
|
+
message: check.message,
|
|
477
|
+
files: issueFiles && issueFiles.length > 0 ? issueFiles : undefined,
|
|
478
|
+
severity: check.severity,
|
|
479
|
+
rule: check.rule,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
// ── 4. Partial auth — login without token issuance ────────────────────────
|
|
484
|
+
if (domainSet.has('auth')) {
|
|
485
|
+
const hasLogin = /\b(login|signin|signIn|authenticate)\b/.test(allContent);
|
|
486
|
+
const hasTokenIssue = /\bjwt\.sign\b|\bcreateToken\b|\bgenerateToken\b/.test(allContent);
|
|
487
|
+
const hasPasswordCheck = /\bbcrypt\.compare\b|\bverifyPassword\b/.test(allContent);
|
|
488
|
+
if (hasLogin && hasPasswordCheck && !hasTokenIssue) {
|
|
489
|
+
issues.push({
|
|
490
|
+
type: 'partial',
|
|
491
|
+
message: 'Login flow with password verification found but no token issuance (jwt.sign / createToken) detected — authentication may be incomplete',
|
|
492
|
+
severity: 'medium',
|
|
493
|
+
rule: 'intent:partial-auth-no-token',
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
// ── 5. Component detection ────────────────────────────────────────────────
|
|
498
|
+
const { componentMap, componentQuality } = detectComponents(intent.domains, index, effectiveApiFiles);
|
|
499
|
+
// Build legacy foundComponents (domain → string[]) for backward compat
|
|
500
|
+
const foundComponents = {};
|
|
501
|
+
for (const domain of intent.domains) {
|
|
502
|
+
foundComponents[domain] = (DOMAIN_COMPONENTS[domain] ?? []).filter((k) => k in componentMap);
|
|
503
|
+
}
|
|
504
|
+
// Downgrade quality: components with only weak signals → add to issues only
|
|
505
|
+
// if quality is weak AND the component is present (don't double-flag as missing)
|
|
506
|
+
for (const [key, quality] of Object.entries(componentQuality)) {
|
|
507
|
+
if (quality === 'weak') {
|
|
508
|
+
// Weak signal — component considered "found" but mark in quality map
|
|
509
|
+
// (coverage.ts will reduce confidence for domains with many weak components)
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
// De-duplicate issues by rule
|
|
513
|
+
const seen = new Set();
|
|
514
|
+
const deduped = issues.filter((issue) => {
|
|
515
|
+
if (seen.has(issue.rule))
|
|
516
|
+
return false;
|
|
517
|
+
seen.add(issue.rule);
|
|
518
|
+
return true;
|
|
519
|
+
});
|
|
520
|
+
return { intentIssues: deduped, checkedDomains: intent.domains, componentMap, componentQuality, foundComponents };
|
|
521
|
+
}
|
|
522
|
+
//# sourceMappingURL=matcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matcher.js","sourceRoot":"","sources":["../../src/intent-engine/matcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAweH,8CA6HC;AAzjBD,MAAM,iBAAiB,GAAqC;IAC1D,kBAAkB,EAAE;QAClB,MAAM,EAAE;YACN,kEAAkE;YAClE,yDAAyD;YACzD,uBAAuB;SACxB;QACD,IAAI,EAAE;YACJ,kCAAkC;YAClC,wCAAwC;SACzC;KACF;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE;YACN,mBAAmB;YACnB,4BAA4B;SAC7B;QACD,IAAI,EAAE;YACJ,oCAAoC;YACpC,uBAAuB;SACxB;KACF;IACD,cAAc,EAAE;QACd,MAAM,EAAE;YACN,2BAA2B;YAC3B,yCAAyC;SAC1C;QACD,IAAI,EAAE;YACJ,mCAAmC;YACnC,YAAY;SACb;KACF;IACD,YAAY,EAAE;QACZ,MAAM,EAAE;YACN,2DAA2D;YAC3D,kCAAkC;SACnC;QACD,IAAI,EAAE;YACJ,iDAAiD;YACjD,iBAAiB;SAClB;KACF;IACD,uBAAuB,EAAE;QACvB,MAAM,EAAE;YACN,sDAAsD;YACtD,oFAAoF;SACrF;QACD,IAAI,EAAE;YACJ,gDAAgD;YAChD,oCAAoC;SACrC;KACF;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE;YACN,wCAAwC;YACxC,+BAA+B;SAChC;QACD,IAAI,EAAE;YACJ,wBAAwB;YACxB,4CAA4C;SAC7C;KACF;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE;YACN,wCAAwC;YACxC,qDAAqD;SACtD;QACD,IAAI,EAAE;YACJ,2CAA2C;YAC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AC,CAAC;IAC/F,CAAC;IAED,4EAA4E;IAC5E,iFAAiF;IACjF,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9D,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;YACvB,qEAAqE;YACrE,6EAA6E;QAC/E,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACtC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QACvC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC;AACpH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent Parser — keyword-heuristic only, no LLM calls.
|
|
3
|
+
* Converts a free-text intent string into structured domains, expected code
|
|
4
|
+
* patterns, and critical rules that the matcher uses to audit the diff.
|
|
5
|
+
*/
|
|
6
|
+
export interface ParsedIntent {
|
|
7
|
+
domains: string[];
|
|
8
|
+
expectedPatterns: string[];
|
|
9
|
+
criticalRules: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function parseIntent(intent: string): ParsedIntent;
|
|
12
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/intent-engine/parser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AA8DD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAmCxD"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Intent Parser — keyword-heuristic only, no LLM calls.
|
|
4
|
+
* Converts a free-text intent string into structured domains, expected code
|
|
5
|
+
* patterns, and critical rules that the matcher uses to audit the diff.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.parseIntent = parseIntent;
|
|
9
|
+
// ── Domain keyword map ────────────────────────────────────────────────────────
|
|
10
|
+
const DOMAIN_KEYWORDS = {
|
|
11
|
+
auth: ['auth', 'login', 'logout', 'jwt', 'token', 'session', 'password',
|
|
12
|
+
'credential', 'oauth', 'sso', 'rbac', 'role', 'permission', 'signup',
|
|
13
|
+
'register', 'authenticate', 'authorize', 'bearer'],
|
|
14
|
+
api: ['api', 'endpoint', 'route', 'handler', 'controller', 'rest',
|
|
15
|
+
'graphql', 'middleware', 'request', 'response', 'webhook', 'http'],
|
|
16
|
+
ui: ['ui', 'component', 'view', 'page', 'screen', 'form', 'button',
|
|
17
|
+
'modal', 'layout', 'frontend', 'react', 'vue', 'angular', 'tsx', 'jsx'],
|
|
18
|
+
database: ['database', 'db', 'sql', 'query', 'migration', 'schema', 'model',
|
|
19
|
+
'repository', 'prisma', 'orm', 'table', 'postgres', 'mysql', 'mongo'],
|
|
20
|
+
payment: ['payment', 'billing', 'stripe', 'invoice', 'charge',
|
|
21
|
+
'subscription', 'checkout', 'price', 'wallet', 'refund'],
|
|
22
|
+
security: ['security', 'encrypt', 'hash', 'salt', 'tls', 'ssl', 'xss',
|
|
23
|
+
'csrf', 'injection', 'sanitize', 'validate', 'vulnerability'],
|
|
24
|
+
notification: ['notification', 'email', 'sms', 'push', 'alert', 'message'],
|
|
25
|
+
file: ['file', 'upload', 'download', 'storage', 's3', 'blob', 'attachment', 'media'],
|
|
26
|
+
testing: ['test', 'spec', 'mock', 'unit', 'integration', 'e2e', 'coverage'],
|
|
27
|
+
};
|
|
28
|
+
// ── Domain → expected patterns ────────────────────────────────────────────────
|
|
29
|
+
const DOMAIN_PATTERNS = {
|
|
30
|
+
auth: ['token validation', 'role checks', 'middleware auth', 'session handling',
|
|
31
|
+
'password hashing', 'token expiry'],
|
|
32
|
+
api: ['input validation', 'error handling', 'auth middleware', 'rate limiting',
|
|
33
|
+
'response schema'],
|
|
34
|
+
database: ['migration safety', 'transaction handling', 'index coverage',
|
|
35
|
+
'connection pooling'],
|
|
36
|
+
payment: ['payment validation', 'idempotency', 'webhook verification',
|
|
37
|
+
'error recovery', 'PCI compliance'],
|
|
38
|
+
security: ['input sanitization', 'output encoding', 'secret management',
|
|
39
|
+
'CORS policy', 'CSP headers'],
|
|
40
|
+
ui: ['prop validation', 'error boundaries', 'loading states', 'accessibility'],
|
|
41
|
+
notification: ['retry logic', 'delivery confirmation', 'template validation'],
|
|
42
|
+
file: ['file type validation', 'size limits', 'virus scanning', 'access control'],
|
|
43
|
+
testing: ['coverage thresholds', 'mock boundaries', 'assertion completeness'],
|
|
44
|
+
};
|
|
45
|
+
// ── Domain → critical rules ───────────────────────────────────────────────────
|
|
46
|
+
const DOMAIN_RULES = {
|
|
47
|
+
auth: ['no-auth-bypass', 'validate-input', 'secure-token', 'role-enforcement',
|
|
48
|
+
'no-plaintext-password'],
|
|
49
|
+
api: ['validate-input', 'handle-errors', 'require-auth', 'no-uncaught-promise'],
|
|
50
|
+
database: ['no-destructive-migration', 'use-transactions', 'validate-schema',
|
|
51
|
+
'no-raw-sql-interpolation'],
|
|
52
|
+
payment: ['secure-payment-data', 'idempotent-operations', 'validate-webhooks',
|
|
53
|
+
'no-log-card-data'],
|
|
54
|
+
security: ['sanitize-inputs', 'no-secrets-in-code', 'enforce-tls',
|
|
55
|
+
'no-eval', 'no-innerHTML'],
|
|
56
|
+
ui: ['no-direct-db-in-ui', 'validate-props', 'handle-loading'],
|
|
57
|
+
notification: ['validate-recipients', 'rate-limit-sends'],
|
|
58
|
+
file: ['validate-file-type', 'enforce-size-limit', 'sanitize-filename'],
|
|
59
|
+
testing: ['no-test-skips', 'no-only-blocks'],
|
|
60
|
+
};
|
|
61
|
+
// ── Public API ────────────────────────────────────────────────────────────────
|
|
62
|
+
function parseIntent(intent) {
|
|
63
|
+
if (!intent || !intent.trim()) {
|
|
64
|
+
return { domains: [], expectedPatterns: [], criticalRules: [] };
|
|
65
|
+
}
|
|
66
|
+
const lower = intent.toLowerCase();
|
|
67
|
+
const words = lower.split(/\W+/).filter(Boolean);
|
|
68
|
+
const wordSet = new Set(words);
|
|
69
|
+
const matchedDomains = new Set();
|
|
70
|
+
for (const [domain, keywords] of Object.entries(DOMAIN_KEYWORDS)) {
|
|
71
|
+
for (const keyword of keywords) {
|
|
72
|
+
if (lower.includes(keyword) || wordSet.has(keyword)) {
|
|
73
|
+
matchedDomains.add(domain);
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const domains = [...matchedDomains];
|
|
79
|
+
const expectedPatterns = [];
|
|
80
|
+
const criticalRules = [];
|
|
81
|
+
for (const domain of domains) {
|
|
82
|
+
for (const pattern of (DOMAIN_PATTERNS[domain] ?? [])) {
|
|
83
|
+
if (!expectedPatterns.includes(pattern))
|
|
84
|
+
expectedPatterns.push(pattern);
|
|
85
|
+
}
|
|
86
|
+
for (const rule of (DOMAIN_RULES[domain] ?? [])) {
|
|
87
|
+
if (!criticalRules.includes(rule))
|
|
88
|
+
criticalRules.push(rule);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return { domains, expectedPatterns, criticalRules };
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @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