@getcodesentinel/codesentinel 1.13.0 → 1.15.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/README.md +33 -1
- package/dist/index.js +755 -123
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -100,6 +100,8 @@ The CLI output now includes a deterministic `risk` block composed from those dim
|
|
|
100
100
|
- `dependencyAmplificationZones`
|
|
101
101
|
- file/module/dependency score tables
|
|
102
102
|
|
|
103
|
+
It also includes a deterministic `quality` block (`qualityScore`, dimension scores, and actionable top issues) computed independently from risk.
|
|
104
|
+
|
|
103
105
|
The goal is a practical, engineering-grade model that supports both strategic architecture decisions and daily code review workflows.
|
|
104
106
|
|
|
105
107
|
## Monorepo Layout
|
|
@@ -109,6 +111,7 @@ The goal is a practical, engineering-grade model that supports both strategic ar
|
|
|
109
111
|
- `packages/git-analyzer`: Git history and evolutionary signals.
|
|
110
112
|
- `packages/dependency-firewall`: external dependency and supply chain signals.
|
|
111
113
|
- `packages/risk-engine`: risk aggregation and scoring model.
|
|
114
|
+
- `packages/quality-engine`: quality posture aggregation and scoring model.
|
|
112
115
|
- `packages/reporter`: structured report output (console, JSON, CI).
|
|
113
116
|
- `packages/governance`: CI gate evaluation and enforcement policy checks.
|
|
114
117
|
- `packages/cli`: user-facing CLI entrypoint.
|
|
@@ -140,6 +143,7 @@ Then run:
|
|
|
140
143
|
|
|
141
144
|
```bash
|
|
142
145
|
codesentinel analyze [path]
|
|
146
|
+
codesentinel run [path]
|
|
143
147
|
codesentinel explain [path]
|
|
144
148
|
codesentinel report [path]
|
|
145
149
|
codesentinel check [path]
|
|
@@ -150,6 +154,8 @@ codesentinel dependency-risk <dependency[@version]>
|
|
|
150
154
|
Examples:
|
|
151
155
|
|
|
152
156
|
```bash
|
|
157
|
+
codesentinel run
|
|
158
|
+
codesentinel run . --detail full --format text
|
|
153
159
|
codesentinel analyze
|
|
154
160
|
codesentinel analyze .
|
|
155
161
|
codesentinel analyze ../project
|
|
@@ -243,6 +249,7 @@ pnpm dev -- analyze
|
|
|
243
249
|
pnpm dev -- analyze .
|
|
244
250
|
pnpm dev -- analyze ../project
|
|
245
251
|
pnpm dev -- analyze . --author-identity strict_email
|
|
252
|
+
pnpm dev -- run . --format text
|
|
246
253
|
pnpm dev -- explain
|
|
247
254
|
pnpm dev -- explain . --top 5 --format text
|
|
248
255
|
pnpm dev -- explain . --file src/app/page.tsx
|
|
@@ -271,6 +278,15 @@ Diff mode compares snapshots and reports:
|
|
|
271
278
|
- new/resolved cycles
|
|
272
279
|
- dependency exposure list changes
|
|
273
280
|
|
|
281
|
+
## Run Output
|
|
282
|
+
|
|
283
|
+
`codesentinel run` is a convenience command that emits `analyze + explain + report` in one execution.
|
|
284
|
+
|
|
285
|
+
- formats: `text`, `md`, `json` (`text` default)
|
|
286
|
+
- detail levels: `--detail compact|standard|full` (`compact` default, `full` = full verbose sections)
|
|
287
|
+
- explain target selectors: `--file <path>`, `--module <name>`, `--top <n>`
|
|
288
|
+
- report diff/snapshot flags: `--compare <baseline.json>`, `--snapshot <path>`, `--no-trace`
|
|
289
|
+
|
|
274
290
|
## CI Mode
|
|
275
291
|
|
|
276
292
|
`codesentinel check` evaluates enforcement gates against current analysis (and optional baseline diff).
|
|
@@ -347,12 +363,13 @@ Filters:
|
|
|
347
363
|
|
|
348
364
|
## Understanding Analyze Output
|
|
349
365
|
|
|
350
|
-
`codesentinel analyze` returns one JSON document with
|
|
366
|
+
`codesentinel analyze` returns one JSON document with five top-level blocks:
|
|
351
367
|
|
|
352
368
|
- `structural`: file dependency graph shape and graph metrics.
|
|
353
369
|
- `evolution`: git-derived change behavior per file and coupling pairs.
|
|
354
370
|
- `external`: dependency exposure for direct packages plus propagated transitive signals.
|
|
355
371
|
- `risk`: deterministic composition of `structural + evolution + external`.
|
|
372
|
+
- `quality`: deterministic code health posture from local structural/evolution/test signals.
|
|
356
373
|
|
|
357
374
|
Minimal shape:
|
|
358
375
|
|
|
@@ -367,6 +384,16 @@ Minimal shape:
|
|
|
367
384
|
"hotspots": [],
|
|
368
385
|
"fragileClusters": [],
|
|
369
386
|
"dependencyAmplificationZones": []
|
|
387
|
+
},
|
|
388
|
+
"quality": {
|
|
389
|
+
"qualityScore": 0,
|
|
390
|
+
"normalizedScore": 0,
|
|
391
|
+
"dimensions": {
|
|
392
|
+
"modularity": 0,
|
|
393
|
+
"changeHygiene": 0,
|
|
394
|
+
"testHealth": 0
|
|
395
|
+
},
|
|
396
|
+
"topIssues": []
|
|
370
397
|
}
|
|
371
398
|
}
|
|
372
399
|
```
|
|
@@ -378,6 +405,11 @@ How to read `risk` first:
|
|
|
378
405
|
- `fragileClusters`: groups of files with structural-cycle or co-change fragility.
|
|
379
406
|
- `dependencyAmplificationZones`: files where external dependency pressure intersects with local fragility.
|
|
380
407
|
|
|
408
|
+
Score direction:
|
|
409
|
+
|
|
410
|
+
- `risk.riskScore`: higher means higher risk (worse).
|
|
411
|
+
- `quality.qualityScore`: higher means better quality posture.
|
|
412
|
+
|
|
381
413
|
Interpretation notes:
|
|
382
414
|
|
|
383
415
|
- Scores are deterministic for the same inputs and config.
|