@getcodesentinel/codesentinel 1.12.1 → 1.14.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 +24 -4
- package/dist/index.js +474 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ CodeSentinel combines three signals into a single, explainable risk profile:
|
|
|
94
94
|
|
|
95
95
|
The CLI output now includes a deterministic `risk` block composed from those dimensions:
|
|
96
96
|
|
|
97
|
-
- `
|
|
97
|
+
- `riskScore` and `normalizedScore`
|
|
98
98
|
- ranked `hotspots`
|
|
99
99
|
- `fragileClusters` (structural cycles + change coupling components)
|
|
100
100
|
- `dependencyAmplificationZones`
|
|
@@ -140,6 +140,7 @@ Then run:
|
|
|
140
140
|
|
|
141
141
|
```bash
|
|
142
142
|
codesentinel analyze [path]
|
|
143
|
+
codesentinel run [path]
|
|
143
144
|
codesentinel explain [path]
|
|
144
145
|
codesentinel report [path]
|
|
145
146
|
codesentinel check [path]
|
|
@@ -150,6 +151,8 @@ codesentinel dependency-risk <dependency[@version]>
|
|
|
150
151
|
Examples:
|
|
151
152
|
|
|
152
153
|
```bash
|
|
154
|
+
codesentinel run
|
|
155
|
+
codesentinel run . --detail full --format text
|
|
153
156
|
codesentinel analyze
|
|
154
157
|
codesentinel analyze .
|
|
155
158
|
codesentinel analyze ../project
|
|
@@ -178,6 +181,9 @@ codesentinel analyze . --author-identity likely_merge
|
|
|
178
181
|
# Deterministic: strict email identity, no heuristic merging
|
|
179
182
|
codesentinel analyze . --author-identity strict_email
|
|
180
183
|
|
|
184
|
+
# Personal-project profile (down-weights single-maintainer ownership penalties)
|
|
185
|
+
codesentinel analyze . --risk-profile personal
|
|
186
|
+
|
|
181
187
|
# Tune recency window (days) used for evolution volatility
|
|
182
188
|
codesentinel analyze . --recent-window-days 60
|
|
183
189
|
|
|
@@ -228,6 +234,10 @@ Notes:
|
|
|
228
234
|
- `--output summary` (default) prints a compact result for terminal use.
|
|
229
235
|
- `--output json` (or `--json`) prints the full analysis object.
|
|
230
236
|
- `--recent-window-days <days>` customizes the git recency window used to compute `recentVolatility` (default: `30`).
|
|
237
|
+
- `--risk-profile default|personal` selects scoring profile.
|
|
238
|
+
- `default`: balanced team-oriented defaults.
|
|
239
|
+
- `personal`: lowers ownership concentration and bus-factor penalties for solo-maintainer repos.
|
|
240
|
+
- `personal` does not remove structural, churn, volatility, external, or interaction risk; scores can still be elevated when those signals are high.
|
|
231
241
|
|
|
232
242
|
When running through pnpm, pass CLI arguments after `--`:
|
|
233
243
|
|
|
@@ -236,6 +246,7 @@ pnpm dev -- analyze
|
|
|
236
246
|
pnpm dev -- analyze .
|
|
237
247
|
pnpm dev -- analyze ../project
|
|
238
248
|
pnpm dev -- analyze . --author-identity strict_email
|
|
249
|
+
pnpm dev -- run . --format text
|
|
239
250
|
pnpm dev -- explain
|
|
240
251
|
pnpm dev -- explain . --top 5 --format text
|
|
241
252
|
pnpm dev -- explain . --file src/app/page.tsx
|
|
@@ -264,6 +275,15 @@ Diff mode compares snapshots and reports:
|
|
|
264
275
|
- new/resolved cycles
|
|
265
276
|
- dependency exposure list changes
|
|
266
277
|
|
|
278
|
+
## Run Output
|
|
279
|
+
|
|
280
|
+
`codesentinel run` is a convenience command that emits `analyze + explain + report` in one execution.
|
|
281
|
+
|
|
282
|
+
- formats: `text`, `md`, `json` (`text` default)
|
|
283
|
+
- detail levels: `--detail compact|standard|full` (`compact` default, `full` = full verbose sections)
|
|
284
|
+
- explain target selectors: `--file <path>`, `--module <name>`, `--top <n>`
|
|
285
|
+
- report diff/snapshot flags: `--compare <baseline.json>`, `--snapshot <path>`, `--no-trace`
|
|
286
|
+
|
|
267
287
|
## CI Mode
|
|
268
288
|
|
|
269
289
|
`codesentinel check` evaluates enforcement gates against current analysis (and optional baseline diff).
|
|
@@ -355,7 +375,7 @@ Minimal shape:
|
|
|
355
375
|
"evolution": { "...": "..." },
|
|
356
376
|
"external": { "...": "..." },
|
|
357
377
|
"risk": {
|
|
358
|
-
"
|
|
378
|
+
"riskScore": 0,
|
|
359
379
|
"normalizedScore": 0,
|
|
360
380
|
"hotspots": [],
|
|
361
381
|
"fragileClusters": [],
|
|
@@ -366,7 +386,7 @@ Minimal shape:
|
|
|
366
386
|
|
|
367
387
|
How to read `risk` first:
|
|
368
388
|
|
|
369
|
-
- `
|
|
389
|
+
- `riskScore`: overall repository fragility index (`0..100`).
|
|
370
390
|
- `hotspots`: ranked files to inspect first.
|
|
371
391
|
- `fragileClusters`: groups of files with structural-cycle or co-change fragility.
|
|
372
392
|
- `dependencyAmplificationZones`: files where external dependency pressure intersects with local fragility.
|
|
@@ -391,7 +411,7 @@ These ranges are heuristics for triage, not incident probability.
|
|
|
391
411
|
|
|
392
412
|
### What Moves Scores
|
|
393
413
|
|
|
394
|
-
`risk.
|
|
414
|
+
`risk.riskScore` and `risk.fileScores[*].score` increase when:
|
|
395
415
|
|
|
396
416
|
- structurally central files/modules change frequently,
|
|
397
417
|
- ownership is highly concentrated in volatile files,
|