@getcodesentinel/codesentinel 1.15.0 → 1.16.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 +37 -8
- package/dist/index.js +1061 -135
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ CI example:
|
|
|
76
76
|
BASE_REF="${GITHUB_BASE_REF:-main}"
|
|
77
77
|
git fetch origin "+refs/heads/${BASE_REF}:refs/remotes/origin/${BASE_REF}"
|
|
78
78
|
- name: Run CodeSentinel
|
|
79
|
-
run: npx codesentinel ci --baseline-ref auto --max-
|
|
79
|
+
run: npx codesentinel ci --baseline-ref auto --max-risk-score 55 --max-risk-delta 0.03 --min-quality-score 65 --max-quality-delta 0.03 --no-new-cycles --no-new-high-risk-deps --max-new-hotspots 2 --fail-on error
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
`--baseline-ref auto` requires enough git history to resolve a baseline deterministically. In GitHub Actions, use `fetch-depth: 0` and ensure the CI base branch ref is fetched.
|
|
@@ -111,6 +111,7 @@ The goal is a practical, engineering-grade model that supports both strategic ar
|
|
|
111
111
|
- `packages/git-analyzer`: Git history and evolutionary signals.
|
|
112
112
|
- `packages/dependency-firewall`: external dependency and supply chain signals.
|
|
113
113
|
- `packages/risk-engine`: risk aggregation and scoring model.
|
|
114
|
+
- `packages/quality-signals`: local quality signal collection (lint, diagnostics, complexity, duplication, coverage).
|
|
114
115
|
- `packages/quality-engine`: quality posture aggregation and scoring model.
|
|
115
116
|
- `packages/reporter`: structured report output (console, JSON, CI).
|
|
116
117
|
- `packages/governance`: CI gate evaluation and enforcement policy checks.
|
|
@@ -167,9 +168,9 @@ codesentinel report
|
|
|
167
168
|
codesentinel report --format md --output report.md
|
|
168
169
|
codesentinel report --snapshot snapshot.json
|
|
169
170
|
codesentinel report --compare baseline.json --format text
|
|
170
|
-
codesentinel check --compare baseline.json --max-
|
|
171
|
+
codesentinel check --compare baseline.json --max-risk-delta 0.03 --no-new-cycles
|
|
171
172
|
codesentinel ci --baseline baseline.json --snapshot current.json --report report.md --fail-on error
|
|
172
|
-
codesentinel ci --baseline-ref origin/main --max-
|
|
173
|
+
codesentinel ci --baseline-ref origin/main --max-risk-delta 0.03 --no-new-cycles
|
|
173
174
|
codesentinel ci --baseline-ref auto --fail-on error
|
|
174
175
|
codesentinel dependency-risk react
|
|
175
176
|
codesentinel dependency-risk react@19.0.0
|
|
@@ -256,7 +257,7 @@ pnpm dev -- explain . --file src/app/page.tsx
|
|
|
256
257
|
pnpm dev -- report
|
|
257
258
|
pnpm dev -- report . --format md --output report.md
|
|
258
259
|
pnpm dev -- report . --compare baseline.json --format text
|
|
259
|
-
pnpm dev -- check . --compare baseline.json --max-
|
|
260
|
+
pnpm dev -- check . --compare baseline.json --max-risk-delta 0.03 --no-new-cycles
|
|
260
261
|
pnpm dev -- ci . --baseline baseline.json --snapshot current.json --report report.md --fail-on warn
|
|
261
262
|
```
|
|
262
263
|
|
|
@@ -282,7 +283,7 @@ Diff mode compares snapshots and reports:
|
|
|
282
283
|
|
|
283
284
|
`codesentinel run` is a convenience command that emits `analyze + explain + report` in one execution.
|
|
284
285
|
|
|
285
|
-
- formats: `text`, `md`, `json` (`
|
|
286
|
+
- formats: `text`, `md`, `json` (`md` default)
|
|
286
287
|
- detail levels: `--detail compact|standard|full` (`compact` default, `full` = full verbose sections)
|
|
287
288
|
- explain target selectors: `--file <path>`, `--module <name>`, `--top <n>`
|
|
288
289
|
- report diff/snapshot flags: `--compare <baseline.json>`, `--snapshot <path>`, `--no-trace`
|
|
@@ -293,11 +294,13 @@ Diff mode compares snapshots and reports:
|
|
|
293
294
|
|
|
294
295
|
Supported gates:
|
|
295
296
|
|
|
296
|
-
- `--max-
|
|
297
|
+
- `--max-risk-delta <value>`
|
|
298
|
+
- `--max-quality-delta <value>`
|
|
297
299
|
- `--no-new-cycles`
|
|
298
300
|
- `--no-new-high-risk-deps`
|
|
299
301
|
- `--max-new-hotspots <count>`
|
|
300
|
-
- `--max-
|
|
302
|
+
- `--max-risk-score <score>`
|
|
303
|
+
- `--min-quality-score <score>`
|
|
301
304
|
- `--new-hotspot-score-threshold <score>`
|
|
302
305
|
- `--fail-on error|warn`
|
|
303
306
|
|
|
@@ -391,9 +394,16 @@ Minimal shape:
|
|
|
391
394
|
"dimensions": {
|
|
392
395
|
"modularity": 0,
|
|
393
396
|
"changeHygiene": 0,
|
|
397
|
+
"staticAnalysis": 0,
|
|
398
|
+
"complexity": 0,
|
|
399
|
+
"duplication": 0,
|
|
394
400
|
"testHealth": 0
|
|
395
401
|
},
|
|
396
|
-
"topIssues": []
|
|
402
|
+
"topIssues": [],
|
|
403
|
+
"trace": {
|
|
404
|
+
"schemaVersion": "1",
|
|
405
|
+
"dimensions": []
|
|
406
|
+
}
|
|
397
407
|
}
|
|
398
408
|
}
|
|
399
409
|
```
|
|
@@ -409,6 +419,25 @@ Score direction:
|
|
|
409
419
|
|
|
410
420
|
- `risk.riskScore`: higher means higher risk (worse).
|
|
411
421
|
- `quality.qualityScore`: higher means better quality posture.
|
|
422
|
+
- `quality.trace`: per-dimension factor traces with normalized metrics and evidence.
|
|
423
|
+
|
|
424
|
+
Quality v2 dimensions and weights:
|
|
425
|
+
|
|
426
|
+
- `modularity` (`0.20`): cycles + fan-in/fan-out concentration.
|
|
427
|
+
- `changeHygiene` (`0.20`): churn/volatility/coupling concentration + TODO/FIXME comment load.
|
|
428
|
+
- `staticAnalysis` (`0.20`): ESLint issue rates + TypeScript diagnostics.
|
|
429
|
+
- `complexity` (`0.15`): cyclomatic complexity pressure.
|
|
430
|
+
- `duplication` (`0.10`): duplicated block/line ratio.
|
|
431
|
+
- `testHealth` (`0.15`): test file presence + optional coverage summary input.
|
|
432
|
+
|
|
433
|
+
Signal ingestion (deterministic, local):
|
|
434
|
+
|
|
435
|
+
- ESLint issues are collected via ESLint API when configuration is available.
|
|
436
|
+
- TypeScript diagnostics are collected from local `tsconfig.json` program diagnostics.
|
|
437
|
+
- Complexity and duplication are derived from local source files.
|
|
438
|
+
- Coverage input is optional:
|
|
439
|
+
- default path: `<target>/coverage/coverage-summary.json`
|
|
440
|
+
- override path: `CODESENTINEL_QUALITY_COVERAGE_SUMMARY`
|
|
412
441
|
|
|
413
442
|
Interpretation notes:
|
|
414
443
|
|