slopbrick 0.18.3 → 0.18.4
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/index.cjs +139 -0
- package/dist/index.js +139 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -58267,6 +58267,139 @@ async function applyFixes(report, config, scannedFiles) {
|
|
|
58267
58267
|
// src/cli/program.ts
|
|
58268
58268
|
init_cache();
|
|
58269
58269
|
init_types();
|
|
58270
|
+
|
|
58271
|
+
// src/cli/help.ts
|
|
58272
|
+
var CATEGORY_LABELS3 = {
|
|
58273
|
+
file: "File selection",
|
|
58274
|
+
filter: "Filter",
|
|
58275
|
+
output: "Output & display",
|
|
58276
|
+
perf: "Performance",
|
|
58277
|
+
fix: "Auto-fix",
|
|
58278
|
+
ci: "CI / threshold",
|
|
58279
|
+
watch: "Watch & diagnose",
|
|
58280
|
+
tokens: "Tokens",
|
|
58281
|
+
telemetry: "Telemetry",
|
|
58282
|
+
other: "Other"
|
|
58283
|
+
};
|
|
58284
|
+
var OPTION_CATEGORY = {
|
|
58285
|
+
// File selection
|
|
58286
|
+
"--include": "file",
|
|
58287
|
+
"--exclude": "file",
|
|
58288
|
+
"--since": "file",
|
|
58289
|
+
"--diff": "file",
|
|
58290
|
+
"--staged": "file",
|
|
58291
|
+
"--changed": "file",
|
|
58292
|
+
"--workspace": "file",
|
|
58293
|
+
// Filter
|
|
58294
|
+
"--ai-only": "filter",
|
|
58295
|
+
"--human-only": "filter",
|
|
58296
|
+
"--security-only": "filter",
|
|
58297
|
+
"--ignore-wcag22": "filter",
|
|
58298
|
+
"--framework": "filter",
|
|
58299
|
+
// Output & display
|
|
58300
|
+
"--format": "output",
|
|
58301
|
+
"--brief": "output",
|
|
58302
|
+
"--full": "output",
|
|
58303
|
+
"--json": "output",
|
|
58304
|
+
"--html": "output",
|
|
58305
|
+
"--no-color": "output",
|
|
58306
|
+
"--quiet": "output",
|
|
58307
|
+
"--verbose": "output",
|
|
58308
|
+
"--heatmap": "output",
|
|
58309
|
+
"--trend": "output",
|
|
58310
|
+
"--why-failing": "output",
|
|
58311
|
+
// Performance
|
|
58312
|
+
"--threads": "perf",
|
|
58313
|
+
"--incremental": "perf",
|
|
58314
|
+
"--cache": "perf",
|
|
58315
|
+
"--cache-path": "perf",
|
|
58316
|
+
// Auto-fix
|
|
58317
|
+
"--fix": "fix",
|
|
58318
|
+
"--dry-run": "fix",
|
|
58319
|
+
"--show-fixes-diff": "fix",
|
|
58320
|
+
// CI / threshold
|
|
58321
|
+
"--strict": "ci",
|
|
58322
|
+
"--no-increase": "ci",
|
|
58323
|
+
"--baseline": "ci",
|
|
58324
|
+
"--threshold": "ci",
|
|
58325
|
+
// Watch & diagnose
|
|
58326
|
+
"--watch": "watch",
|
|
58327
|
+
"--doctor": "watch",
|
|
58328
|
+
"--suggest": "watch",
|
|
58329
|
+
"--tighten": "watch",
|
|
58330
|
+
// Tokens
|
|
58331
|
+
"--tokens": "tokens",
|
|
58332
|
+
// Telemetry
|
|
58333
|
+
"--no-telemetry": "telemetry"
|
|
58334
|
+
};
|
|
58335
|
+
var CATEGORY_ORDER2 = [
|
|
58336
|
+
"file",
|
|
58337
|
+
"filter",
|
|
58338
|
+
"output",
|
|
58339
|
+
"perf",
|
|
58340
|
+
"fix",
|
|
58341
|
+
"ci",
|
|
58342
|
+
"watch",
|
|
58343
|
+
"tokens",
|
|
58344
|
+
"telemetry",
|
|
58345
|
+
"other"
|
|
58346
|
+
];
|
|
58347
|
+
function groupOptions(cmd) {
|
|
58348
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
58349
|
+
for (const category of CATEGORY_ORDER2) {
|
|
58350
|
+
grouped.set(category, []);
|
|
58351
|
+
}
|
|
58352
|
+
for (const opt of cmd.options) {
|
|
58353
|
+
if (opt.hidden) continue;
|
|
58354
|
+
const longFlag = opt.long ?? opt.short ?? "";
|
|
58355
|
+
const category = longFlag ? OPTION_CATEGORY[longFlag] ?? "other" : "other";
|
|
58356
|
+
grouped.get(category).push({
|
|
58357
|
+
category,
|
|
58358
|
+
flags: opt.flags,
|
|
58359
|
+
description: opt.description ?? ""
|
|
58360
|
+
});
|
|
58361
|
+
}
|
|
58362
|
+
return grouped;
|
|
58363
|
+
}
|
|
58364
|
+
function renderOption(opt, flagWidth) {
|
|
58365
|
+
const padded = opt.flags.padEnd(flagWidth, " ");
|
|
58366
|
+
return ` ${padded} ${opt.description}`;
|
|
58367
|
+
}
|
|
58368
|
+
function formatGroupedHelp(cmd) {
|
|
58369
|
+
const lines = [];
|
|
58370
|
+
const usage = cmd.usage ? cmd.usage() : `Usage: ${cmd.name()} [options]`;
|
|
58371
|
+
lines.push(usage);
|
|
58372
|
+
lines.push("");
|
|
58373
|
+
if (cmd.description()) {
|
|
58374
|
+
lines.push(cmd.description());
|
|
58375
|
+
lines.push("");
|
|
58376
|
+
}
|
|
58377
|
+
const grouped = groupOptions(cmd);
|
|
58378
|
+
let flagWidth = 0;
|
|
58379
|
+
for (const options of grouped.values()) {
|
|
58380
|
+
for (const opt of options) {
|
|
58381
|
+
if (opt.flags.length > flagWidth) flagWidth = opt.flags.length;
|
|
58382
|
+
}
|
|
58383
|
+
}
|
|
58384
|
+
let firstCategory = true;
|
|
58385
|
+
for (const category of CATEGORY_ORDER2) {
|
|
58386
|
+
const options = grouped.get(category);
|
|
58387
|
+
if (options.length === 0) continue;
|
|
58388
|
+
if (!firstCategory) lines.push("");
|
|
58389
|
+
firstCategory = false;
|
|
58390
|
+
lines.push(` ${CATEGORY_LABELS3[category]}:`);
|
|
58391
|
+
for (const opt of options) {
|
|
58392
|
+
lines.push(renderOption(opt, flagWidth));
|
|
58393
|
+
}
|
|
58394
|
+
}
|
|
58395
|
+
lines.push("");
|
|
58396
|
+
lines.push(
|
|
58397
|
+
"Use `--help-flat` for the standard un-grouped list. See `https://usebrick.dev/docs/scan-options` for full docs."
|
|
58398
|
+
);
|
|
58399
|
+
return lines.join("\n");
|
|
58400
|
+
}
|
|
58401
|
+
|
|
58402
|
+
// src/cli/program.ts
|
|
58270
58403
|
init_scan();
|
|
58271
58404
|
process.on("uncaughtException", (err) => {
|
|
58272
58405
|
logger.error(`Unexpected error: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -58275,6 +58408,7 @@ process.on("uncaughtException", (err) => {
|
|
|
58275
58408
|
async function runCli({ start }) {
|
|
58276
58409
|
try {
|
|
58277
58410
|
const program = new import_commander2.Command().name("slopbrick").description("Repository Coherence Scanner \u2014 surface AI-induced pattern drift, secret leaks, and design-token violations").version(VERSION).option("--framework <name>", "framework multiplier to apply").option("--include <glob>", "include pattern (repeatable)", collectGlob, []).option("--exclude <glob>", "exclude pattern (repeatable)", collectGlob, []).option("--ai-only", "only report AI-specific issues").option("--human-only", "only report human-facing issues").option("--ignore-wcag22", "ignore WCAG 2.2 related issues").option("--format <pretty|json|sarif|html>", "output format", "pretty").option("--threads <n>", "number of worker threads", parseThreads).option("--since <ref>", "only scan files changed since git ref").option("--diff <ref>", "alias for --since <ref>; also adds PR Slop Score to the report").option("--workspace <path>", "workspace/project path", process.cwd()).option("--tighten", "tighten baseline allowances").option("--fix", "apply auto-fixes").option("--dry-run", "with --fix: print what would change without writing").option("--show-fixes-diff", "print unified diff of proposed auto-fixes").option("--doctor", "run diagnostics").option("--watch", "watch files and re-run").option("--suggest", "print remediation advice").option("--why-failing", "print the top 5 rules dragging the score down").option("--brief", "terse output (verdict + headline + threshold + delta only)").option("--heatmap", "print migration ROI heatmap").option("--quiet", "suppress non-error output").option("--verbose", "enable debug logging (file paths, timings, rule-fire counts)").option("--strict", "exit 2 if any high-severity issue remains").option("--no-increase", "exit 2 if slop index increased since last run").option("--baseline", "save a baseline after this scan").option("--trend [n]", "print a sparkline of the last n runs", parseTrend).option("--json [path]", "write JSON report to path or stdout").option("--html [path]", "write HTML report to path or stdout").option("--staged", "scan only changed files (staged and unstaged)").option("--changed", "scan working-tree changes (staged + unstaged + untracked)").option("--incremental", "skip unchanged files using the persisted hash cache").option("--cache-path <path>", "path to the incremental-scan cache (default: .slopbrick-cache.json)").option("--tokens <path>", "merge tokens.json layout values into the arbitrary-value allowlist").option("--cache", "cache parsed AST results locally").option("--no-color", "suppress ANSI color codes in output").option("--security-only", "run only the security/* rules").option("--full", "show the complete report (all issues, all categories)");
|
|
58411
|
+
program.helpInformation = () => formatGroupedHelp(program);
|
|
58278
58412
|
registerInit(program);
|
|
58279
58413
|
registerInstall(program);
|
|
58280
58414
|
registerUninstall(program);
|
|
@@ -58438,6 +58572,11 @@ async function runCli({ start }) {
|
|
|
58438
58572
|
registerTokens(program);
|
|
58439
58573
|
registerReport(program);
|
|
58440
58574
|
registerScan(program, scanAction);
|
|
58575
|
+
if (process.argv.includes("--help-flat")) {
|
|
58576
|
+
delete program.helpInformation;
|
|
58577
|
+
program.outputHelp();
|
|
58578
|
+
process.exit(0);
|
|
58579
|
+
}
|
|
58441
58580
|
await program.parseAsync(process.argv);
|
|
58442
58581
|
} catch (err) {
|
|
58443
58582
|
if (err instanceof ConfigValidationError) {
|
package/dist/index.js
CHANGED
|
@@ -58176,6 +58176,139 @@ async function applyFixes(report, config, scannedFiles) {
|
|
|
58176
58176
|
// src/cli/program.ts
|
|
58177
58177
|
init_cache();
|
|
58178
58178
|
init_types();
|
|
58179
|
+
|
|
58180
|
+
// src/cli/help.ts
|
|
58181
|
+
var CATEGORY_LABELS3 = {
|
|
58182
|
+
file: "File selection",
|
|
58183
|
+
filter: "Filter",
|
|
58184
|
+
output: "Output & display",
|
|
58185
|
+
perf: "Performance",
|
|
58186
|
+
fix: "Auto-fix",
|
|
58187
|
+
ci: "CI / threshold",
|
|
58188
|
+
watch: "Watch & diagnose",
|
|
58189
|
+
tokens: "Tokens",
|
|
58190
|
+
telemetry: "Telemetry",
|
|
58191
|
+
other: "Other"
|
|
58192
|
+
};
|
|
58193
|
+
var OPTION_CATEGORY = {
|
|
58194
|
+
// File selection
|
|
58195
|
+
"--include": "file",
|
|
58196
|
+
"--exclude": "file",
|
|
58197
|
+
"--since": "file",
|
|
58198
|
+
"--diff": "file",
|
|
58199
|
+
"--staged": "file",
|
|
58200
|
+
"--changed": "file",
|
|
58201
|
+
"--workspace": "file",
|
|
58202
|
+
// Filter
|
|
58203
|
+
"--ai-only": "filter",
|
|
58204
|
+
"--human-only": "filter",
|
|
58205
|
+
"--security-only": "filter",
|
|
58206
|
+
"--ignore-wcag22": "filter",
|
|
58207
|
+
"--framework": "filter",
|
|
58208
|
+
// Output & display
|
|
58209
|
+
"--format": "output",
|
|
58210
|
+
"--brief": "output",
|
|
58211
|
+
"--full": "output",
|
|
58212
|
+
"--json": "output",
|
|
58213
|
+
"--html": "output",
|
|
58214
|
+
"--no-color": "output",
|
|
58215
|
+
"--quiet": "output",
|
|
58216
|
+
"--verbose": "output",
|
|
58217
|
+
"--heatmap": "output",
|
|
58218
|
+
"--trend": "output",
|
|
58219
|
+
"--why-failing": "output",
|
|
58220
|
+
// Performance
|
|
58221
|
+
"--threads": "perf",
|
|
58222
|
+
"--incremental": "perf",
|
|
58223
|
+
"--cache": "perf",
|
|
58224
|
+
"--cache-path": "perf",
|
|
58225
|
+
// Auto-fix
|
|
58226
|
+
"--fix": "fix",
|
|
58227
|
+
"--dry-run": "fix",
|
|
58228
|
+
"--show-fixes-diff": "fix",
|
|
58229
|
+
// CI / threshold
|
|
58230
|
+
"--strict": "ci",
|
|
58231
|
+
"--no-increase": "ci",
|
|
58232
|
+
"--baseline": "ci",
|
|
58233
|
+
"--threshold": "ci",
|
|
58234
|
+
// Watch & diagnose
|
|
58235
|
+
"--watch": "watch",
|
|
58236
|
+
"--doctor": "watch",
|
|
58237
|
+
"--suggest": "watch",
|
|
58238
|
+
"--tighten": "watch",
|
|
58239
|
+
// Tokens
|
|
58240
|
+
"--tokens": "tokens",
|
|
58241
|
+
// Telemetry
|
|
58242
|
+
"--no-telemetry": "telemetry"
|
|
58243
|
+
};
|
|
58244
|
+
var CATEGORY_ORDER2 = [
|
|
58245
|
+
"file",
|
|
58246
|
+
"filter",
|
|
58247
|
+
"output",
|
|
58248
|
+
"perf",
|
|
58249
|
+
"fix",
|
|
58250
|
+
"ci",
|
|
58251
|
+
"watch",
|
|
58252
|
+
"tokens",
|
|
58253
|
+
"telemetry",
|
|
58254
|
+
"other"
|
|
58255
|
+
];
|
|
58256
|
+
function groupOptions(cmd) {
|
|
58257
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
58258
|
+
for (const category of CATEGORY_ORDER2) {
|
|
58259
|
+
grouped.set(category, []);
|
|
58260
|
+
}
|
|
58261
|
+
for (const opt of cmd.options) {
|
|
58262
|
+
if (opt.hidden) continue;
|
|
58263
|
+
const longFlag = opt.long ?? opt.short ?? "";
|
|
58264
|
+
const category = longFlag ? OPTION_CATEGORY[longFlag] ?? "other" : "other";
|
|
58265
|
+
grouped.get(category).push({
|
|
58266
|
+
category,
|
|
58267
|
+
flags: opt.flags,
|
|
58268
|
+
description: opt.description ?? ""
|
|
58269
|
+
});
|
|
58270
|
+
}
|
|
58271
|
+
return grouped;
|
|
58272
|
+
}
|
|
58273
|
+
function renderOption(opt, flagWidth) {
|
|
58274
|
+
const padded = opt.flags.padEnd(flagWidth, " ");
|
|
58275
|
+
return ` ${padded} ${opt.description}`;
|
|
58276
|
+
}
|
|
58277
|
+
function formatGroupedHelp(cmd) {
|
|
58278
|
+
const lines = [];
|
|
58279
|
+
const usage = cmd.usage ? cmd.usage() : `Usage: ${cmd.name()} [options]`;
|
|
58280
|
+
lines.push(usage);
|
|
58281
|
+
lines.push("");
|
|
58282
|
+
if (cmd.description()) {
|
|
58283
|
+
lines.push(cmd.description());
|
|
58284
|
+
lines.push("");
|
|
58285
|
+
}
|
|
58286
|
+
const grouped = groupOptions(cmd);
|
|
58287
|
+
let flagWidth = 0;
|
|
58288
|
+
for (const options of grouped.values()) {
|
|
58289
|
+
for (const opt of options) {
|
|
58290
|
+
if (opt.flags.length > flagWidth) flagWidth = opt.flags.length;
|
|
58291
|
+
}
|
|
58292
|
+
}
|
|
58293
|
+
let firstCategory = true;
|
|
58294
|
+
for (const category of CATEGORY_ORDER2) {
|
|
58295
|
+
const options = grouped.get(category);
|
|
58296
|
+
if (options.length === 0) continue;
|
|
58297
|
+
if (!firstCategory) lines.push("");
|
|
58298
|
+
firstCategory = false;
|
|
58299
|
+
lines.push(` ${CATEGORY_LABELS3[category]}:`);
|
|
58300
|
+
for (const opt of options) {
|
|
58301
|
+
lines.push(renderOption(opt, flagWidth));
|
|
58302
|
+
}
|
|
58303
|
+
}
|
|
58304
|
+
lines.push("");
|
|
58305
|
+
lines.push(
|
|
58306
|
+
"Use `--help-flat` for the standard un-grouped list. See `https://usebrick.dev/docs/scan-options` for full docs."
|
|
58307
|
+
);
|
|
58308
|
+
return lines.join("\n");
|
|
58309
|
+
}
|
|
58310
|
+
|
|
58311
|
+
// src/cli/program.ts
|
|
58179
58312
|
init_scan();
|
|
58180
58313
|
process.on("uncaughtException", (err) => {
|
|
58181
58314
|
logger.error(`Unexpected error: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -58184,6 +58317,7 @@ process.on("uncaughtException", (err) => {
|
|
|
58184
58317
|
async function runCli({ start }) {
|
|
58185
58318
|
try {
|
|
58186
58319
|
const program = new Command().name("slopbrick").description("Repository Coherence Scanner \u2014 surface AI-induced pattern drift, secret leaks, and design-token violations").version(VERSION).option("--framework <name>", "framework multiplier to apply").option("--include <glob>", "include pattern (repeatable)", collectGlob, []).option("--exclude <glob>", "exclude pattern (repeatable)", collectGlob, []).option("--ai-only", "only report AI-specific issues").option("--human-only", "only report human-facing issues").option("--ignore-wcag22", "ignore WCAG 2.2 related issues").option("--format <pretty|json|sarif|html>", "output format", "pretty").option("--threads <n>", "number of worker threads", parseThreads).option("--since <ref>", "only scan files changed since git ref").option("--diff <ref>", "alias for --since <ref>; also adds PR Slop Score to the report").option("--workspace <path>", "workspace/project path", process.cwd()).option("--tighten", "tighten baseline allowances").option("--fix", "apply auto-fixes").option("--dry-run", "with --fix: print what would change without writing").option("--show-fixes-diff", "print unified diff of proposed auto-fixes").option("--doctor", "run diagnostics").option("--watch", "watch files and re-run").option("--suggest", "print remediation advice").option("--why-failing", "print the top 5 rules dragging the score down").option("--brief", "terse output (verdict + headline + threshold + delta only)").option("--heatmap", "print migration ROI heatmap").option("--quiet", "suppress non-error output").option("--verbose", "enable debug logging (file paths, timings, rule-fire counts)").option("--strict", "exit 2 if any high-severity issue remains").option("--no-increase", "exit 2 if slop index increased since last run").option("--baseline", "save a baseline after this scan").option("--trend [n]", "print a sparkline of the last n runs", parseTrend).option("--json [path]", "write JSON report to path or stdout").option("--html [path]", "write HTML report to path or stdout").option("--staged", "scan only changed files (staged and unstaged)").option("--changed", "scan working-tree changes (staged + unstaged + untracked)").option("--incremental", "skip unchanged files using the persisted hash cache").option("--cache-path <path>", "path to the incremental-scan cache (default: .slopbrick-cache.json)").option("--tokens <path>", "merge tokens.json layout values into the arbitrary-value allowlist").option("--cache", "cache parsed AST results locally").option("--no-color", "suppress ANSI color codes in output").option("--security-only", "run only the security/* rules").option("--full", "show the complete report (all issues, all categories)");
|
|
58320
|
+
program.helpInformation = () => formatGroupedHelp(program);
|
|
58187
58321
|
registerInit(program);
|
|
58188
58322
|
registerInstall(program);
|
|
58189
58323
|
registerUninstall(program);
|
|
@@ -58347,6 +58481,11 @@ async function runCli({ start }) {
|
|
|
58347
58481
|
registerTokens(program);
|
|
58348
58482
|
registerReport(program);
|
|
58349
58483
|
registerScan(program, scanAction);
|
|
58484
|
+
if (process.argv.includes("--help-flat")) {
|
|
58485
|
+
delete program.helpInformation;
|
|
58486
|
+
program.outputHelp();
|
|
58487
|
+
process.exit(0);
|
|
58488
|
+
}
|
|
58350
58489
|
await program.parseAsync(process.argv);
|
|
58351
58490
|
} catch (err) {
|
|
58352
58491
|
if (err instanceof ConfigValidationError) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slopbrick",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "Discovered, modeled, and governed repository structure. SlopBrick scans source code, classifies it against 95 rules in 15 categories, computes 4 scores (aiQuality, engineeringHygiene, security, repositoryHealth), and persists the structure for AI agents and CI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|