@code-sentinel-cli/code-sentinel-cli 4.0.7 → 4.0.9

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.
Files changed (35) hide show
  1. package/dist/bin.js +19517 -13879
  2. package/dist/builtin-rules/{ai → fortify/ai}/angular/cross-feature-route-permission-drift.rule.yaml +4 -0
  3. package/dist/builtin-rules/{ai → fortify/ai}/angular/route-permission-flow.rule.yaml +4 -0
  4. package/dist/builtin-rules/{ai → fortify/ai}/spring-boot/io-boundary-risk.rule.yaml +4 -0
  5. package/dist/builtin-rules/{ai → fortify/ai}/spring-boot/security-redirect-risk.rule.yaml +4 -0
  6. package/dist/builtin-rules/{ai → fortify/ai}/spring-boot/security-sensitive-data-risk.rule.yaml +4 -0
  7. package/dist/builtin-rules/{static → fortify/static}/angular/sensitive-input-masking.rule.js +5 -1
  8. package/dist/builtin-rules/{static → fortify/static}/general/java-weak-randomness.rule.js +5 -1
  9. package/dist/builtin-rules/{static → fortify/static}/general/no-client-identity-header.rule.js +5 -1
  10. package/dist/builtin-rules/{static → fortify/static}/general/no-guessable-websql-database-name.rule.js +5 -1
  11. package/dist/builtin-rules/{static → fortify/static}/general/no-reflective-access-override.rule.js +5 -1
  12. package/dist/builtin-rules/{static → fortify/static}/general/no-sensitive-string-materialization.rule.js +5 -1
  13. package/dist/builtin-rules/{static → fortify/static}/spring-boot/no-command-injection.rule.js +5 -1
  14. package/dist/builtin-rules/{static → fortify/static}/spring-boot/no-path-traversal.rule.js +5 -1
  15. package/dist/builtin-rules/{static → fortify/static}/spring-boot/no-servlet-xss.rule.js +5 -1
  16. package/dist/builtin-rules/{static → fortify/static}/spring-boot/no-spel-injection.rule.js +5 -1
  17. package/dist/builtin-rules/{static → fortify/static}/spring-boot/no-sql-string-concat.rule.js +5 -1
  18. package/dist/builtin-rules/{static → fortify/static}/spring-boot/no-ssrf.rule.js +5 -1
  19. package/dist/builtin-rules/{static → fortify/static}/spring-boot/no-weak-tls-protocol.rule.js +5 -1
  20. package/dist/builtin-rules/performance/static/spring-boot/http-client-without-timeout.rule.js +83 -0
  21. package/dist/builtin-rules/performance/static/spring-boot/open-in-view-enabled.rule.js +89 -0
  22. package/dist/builtin-rules/performance/static/spring-boot/transaction-holds-remote-call.rule.js +323 -0
  23. package/dist/builtin-rules/performance/static/spring-boot/unbounded-repository-fetch.rule.js +125 -0
  24. package/dist/builtin-rules/performance/static/spring-boot/xssf-workbook-for-export.rule.js +81 -0
  25. package/dist/builtin-rules/static/general/no-circular-import.rule.js +12 -2
  26. package/dist/builtin-rules/static/general/no-open-redirect.rule.js +7 -3
  27. package/dist/builtin-rules/static/general/no-unused-export.rule.js +26 -0
  28. package/dist/index.d.ts +273 -101
  29. package/dist/index.js +19519 -13881
  30. package/package.json +1 -1
  31. /package/dist/builtin-rules/{ai → fortify/ai}/angular/cross-feature-route-permission-drift.prompt.md +0 -0
  32. /package/dist/builtin-rules/{ai → fortify/ai}/angular/route-permission-flow.prompt.md +0 -0
  33. /package/dist/builtin-rules/{ai → fortify/ai}/spring-boot/io-boundary-risk.prompt.md +0 -0
  34. /package/dist/builtin-rules/{ai → fortify/ai}/spring-boot/security-redirect-risk.prompt.md +0 -0
  35. /package/dist/builtin-rules/{ai → fortify/ai}/spring-boot/security-sensitive-data-risk.prompt.md +0 -0
package/dist/index.d.ts CHANGED
@@ -729,24 +729,24 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
729
729
  * lines on a 650-finding run). Override to `markdown` for the full
730
730
  * format, or pass `--full` on the CLI for a one-off run.
731
731
  */
732
- format: z.ZodDefault<z.ZodEffects<z.ZodEnum<["markdown", "markdown-compact", "json", "sarif", "both"]>, "json" | "markdown" | "markdown-compact" | "sarif", "json" | "markdown" | "markdown-compact" | "sarif" | "both">>;
732
+ format: z.ZodDefault<z.ZodEffects<z.ZodEnum<["markdown", "markdown-compact", "json", "sarif", "both"]>, "markdown" | "markdown-compact" | "json" | "sarif", "markdown" | "markdown-compact" | "json" | "sarif" | "both">>;
733
733
  output: z.ZodDefault<z.ZodString>;
734
734
  groupBy: z.ZodDefault<z.ZodEnum<["severity", "file", "rule", "category"]>>;
735
735
  includeSnippets: z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEnum<["true", "false", "1", "0"]>>, boolean, string>]> | z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEnum<["true", "false", "1", "0"]>>, boolean, string>]>>;
736
736
  }, "strip", z.ZodTypeAny, {
737
- format: "json" | "markdown" | "markdown-compact" | "sarif";
737
+ format: "markdown" | "markdown-compact" | "json" | "sarif";
738
738
  output: string;
739
739
  groupBy: "severity" | "file" | "rule" | "category";
740
740
  includeSnippets: boolean;
741
741
  }, {
742
- format?: "json" | "markdown" | "markdown-compact" | "sarif" | "both" | undefined;
742
+ format?: "markdown" | "markdown-compact" | "json" | "sarif" | "both" | undefined;
743
743
  output?: string | undefined;
744
744
  groupBy?: "severity" | "file" | "rule" | "category" | undefined;
745
745
  includeSnippets?: string | boolean | undefined;
746
746
  }>>;
747
747
  review: z.ZodDefault<z.ZodObject<{
748
748
  minSeverity: z.ZodDefault<z.ZodEnum<["info", "warning", "error", "blocker"]>>;
749
- baseline: z.ZodDefault<z.ZodEffects<z.ZodEnum<["apply", "ignore", "capture"]>, "ignore" | "apply", "ignore" | "apply" | "capture">>;
749
+ baseline: z.ZodDefault<z.ZodEffects<z.ZodEnum<["apply", "ignore", "capture"]>, "apply" | "ignore", "apply" | "ignore" | "capture">>;
750
750
  extraInstructions: z.ZodDefault<z.ZodString>;
751
751
  /**
752
752
  * Phase 07 profile contract. This is deliberately separate from machine
@@ -754,23 +754,23 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
754
754
  * concurrency of work that the profile already permits.
755
755
  */
756
756
  profile: z.ZodDefault<z.ZodEffects<z.ZodObject<{
757
- name: z.ZodDefault<z.ZodEffects<z.ZodEnum<["fast", "deep", "balanced"]>, "deep" | "fast", "deep" | "balanced" | "fast">>;
757
+ name: z.ZodDefault<z.ZodEffects<z.ZodEnum<["fast", "deep", "balanced"]>, "fast" | "deep", "balanced" | "fast" | "deep">>;
758
758
  ai: z.ZodDefault<z.ZodEnum<["disabled", "advisory", "blocking"]>>;
759
759
  maxBudgetMs: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>> | z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>>;
760
760
  }, "strip", z.ZodTypeAny, {
761
- name: "deep" | "fast";
761
+ name: "fast" | "deep";
762
762
  ai: "disabled" | "advisory" | "blocking";
763
763
  maxBudgetMs?: number | undefined;
764
764
  }, {
765
- name?: "deep" | "balanced" | "fast" | undefined;
765
+ name?: "balanced" | "fast" | "deep" | undefined;
766
766
  ai?: "disabled" | "advisory" | "blocking" | undefined;
767
767
  maxBudgetMs?: string | number | undefined;
768
768
  }>, {
769
- name: "deep" | "fast";
769
+ name: "fast" | "deep";
770
770
  ai: "disabled" | "advisory" | "blocking";
771
771
  maxBudgetMs?: number | undefined;
772
772
  }, {
773
- name?: "deep" | "balanced" | "fast" | undefined;
773
+ name?: "balanced" | "fast" | "deep" | undefined;
774
774
  ai?: "disabled" | "advisory" | "blocking" | undefined;
775
775
  maxBudgetMs?: string | number | undefined;
776
776
  }>>;
@@ -814,10 +814,10 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
814
814
  }>>;
815
815
  }, "strip", z.ZodTypeAny, {
816
816
  minSeverity: "info" | "warning" | "error" | "blocker";
817
- baseline: "ignore" | "apply";
817
+ baseline: "apply" | "ignore";
818
818
  extraInstructions: string;
819
819
  profile: {
820
- name: "deep" | "fast";
820
+ name: "fast" | "deep";
821
821
  ai: "disabled" | "advisory" | "blocking";
822
822
  maxBudgetMs?: number | undefined;
823
823
  };
@@ -828,10 +828,10 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
828
828
  };
829
829
  }, {
830
830
  minSeverity?: "info" | "warning" | "error" | "blocker" | undefined;
831
- baseline?: "ignore" | "apply" | "capture" | undefined;
831
+ baseline?: "apply" | "ignore" | "capture" | undefined;
832
832
  extraInstructions?: string | undefined;
833
833
  profile?: {
834
- name?: "deep" | "balanced" | "fast" | undefined;
834
+ name?: "balanced" | "fast" | "deep" | undefined;
835
835
  ai?: "disabled" | "advisory" | "blocking" | undefined;
836
836
  maxBudgetMs?: string | number | undefined;
837
837
  } | undefined;
@@ -867,13 +867,13 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
867
867
  enabled: boolean;
868
868
  maxPrimaryFiles: number;
869
869
  minRiskScore: number;
870
- includeLayers: ("unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry")[];
870
+ includeLayers: ("unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry")[];
871
871
  excludePatterns: string[];
872
872
  }, {
873
873
  enabled?: string | boolean | undefined;
874
874
  maxPrimaryFiles?: string | number | undefined;
875
875
  minRiskScore?: string | number | undefined;
876
- includeLayers?: ("unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry")[] | undefined;
876
+ includeLayers?: ("unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry")[] | undefined;
877
877
  excludePatterns?: string[] | undefined;
878
878
  }>>;
879
879
  groupedRules: z.ZodDefault<z.ZodObject<{
@@ -933,7 +933,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
933
933
  hasDiffReviewFinding?: string | number | undefined;
934
934
  }>>;
935
935
  }, "strip", z.ZodTypeAny, {
936
- layer: Partial<Record<"unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry", number>>;
936
+ layer: Partial<Record<"unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry", number>>;
937
937
  signals: {
938
938
  hasTransactional: number;
939
939
  hasDbWrite: number;
@@ -946,7 +946,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
946
946
  hasDiffReviewFinding: number;
947
947
  };
948
948
  }, {
949
- layer?: Partial<Record<"unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry", string | number | undefined>> | undefined;
949
+ layer?: Partial<Record<"unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry", string | number | undefined>> | undefined;
950
950
  signals?: {
951
951
  hasTransactional?: string | number | undefined;
952
952
  hasDbWrite?: string | number | undefined;
@@ -994,7 +994,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
994
994
  enabled: boolean;
995
995
  maxPrimaryFiles: number;
996
996
  minRiskScore: number;
997
- includeLayers: ("unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry")[];
997
+ includeLayers: ("unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry")[];
998
998
  excludePatterns: string[];
999
999
  };
1000
1000
  groupedRules: {
@@ -1007,7 +1007,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1007
1007
  maxCalls: number;
1008
1008
  };
1009
1009
  riskScoring: {
1010
- layer: Partial<Record<"unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry", number>>;
1010
+ layer: Partial<Record<"unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry", number>>;
1011
1011
  signals: {
1012
1012
  hasTransactional: number;
1013
1013
  hasDbWrite: number;
@@ -1046,7 +1046,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1046
1046
  enabled?: string | boolean | undefined;
1047
1047
  maxPrimaryFiles?: string | number | undefined;
1048
1048
  minRiskScore?: string | number | undefined;
1049
- includeLayers?: ("unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry")[] | undefined;
1049
+ includeLayers?: ("unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry")[] | undefined;
1050
1050
  excludePatterns?: string[] | undefined;
1051
1051
  } | undefined;
1052
1052
  groupedRules?: {
@@ -1059,7 +1059,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1059
1059
  maxCalls?: string | number | undefined;
1060
1060
  } | undefined;
1061
1061
  riskScoring?: {
1062
- layer?: Partial<Record<"unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry", string | number | undefined>> | undefined;
1062
+ layer?: Partial<Record<"unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry", string | number | undefined>> | undefined;
1063
1063
  signals?: {
1064
1064
  hasTransactional?: string | number | undefined;
1065
1065
  hasDbWrite?: string | number | undefined;
@@ -1188,6 +1188,9 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1188
1188
  minCvssScore?: string | number | undefined;
1189
1189
  }>>;
1190
1190
  }, "strip", z.ZodTypeAny, {
1191
+ dependency?: {
1192
+ minCvssScore?: number | undefined;
1193
+ } | undefined;
1191
1194
  password?: {
1192
1195
  minLength?: number | undefined;
1193
1196
  maxAgeDays?: number | undefined;
@@ -1206,10 +1209,10 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1206
1209
  absoluteTimeoutHours?: number | undefined;
1207
1210
  tokenBits?: number | undefined;
1208
1211
  } | undefined;
1212
+ }, {
1209
1213
  dependency?: {
1210
- minCvssScore?: number | undefined;
1214
+ minCvssScore?: string | number | undefined;
1211
1215
  } | undefined;
1212
- }, {
1213
1216
  password?: {
1214
1217
  minLength?: string | number | undefined;
1215
1218
  maxAgeDays?: string | number | undefined;
@@ -1228,9 +1231,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1228
1231
  absoluteTimeoutHours?: string | number | undefined;
1229
1232
  tokenBits?: string | number | undefined;
1230
1233
  } | undefined;
1231
- dependency?: {
1232
- minCvssScore?: string | number | undefined;
1233
- } | undefined;
1234
1234
  }>>;
1235
1235
  /**
1236
1236
  * [ADR-0091] §10 — paths the AI checklist fold rules are NOT called on. Generated code is the
@@ -1249,6 +1249,9 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1249
1249
  }>>;
1250
1250
  }, "strip", z.ZodTypeAny, {
1251
1251
  policy: {
1252
+ dependency?: {
1253
+ minCvssScore?: number | undefined;
1254
+ } | undefined;
1252
1255
  password?: {
1253
1256
  minLength?: number | undefined;
1254
1257
  maxAgeDays?: number | undefined;
@@ -1267,15 +1270,15 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1267
1270
  absoluteTimeoutHours?: number | undefined;
1268
1271
  tokenBits?: number | undefined;
1269
1272
  } | undefined;
1270
- dependency?: {
1271
- minCvssScore?: number | undefined;
1272
- } | undefined;
1273
1273
  };
1274
1274
  aiScope: {
1275
1275
  exclude: string[];
1276
1276
  };
1277
1277
  }, {
1278
1278
  policy?: {
1279
+ dependency?: {
1280
+ minCvssScore?: string | number | undefined;
1281
+ } | undefined;
1279
1282
  password?: {
1280
1283
  minLength?: string | number | undefined;
1281
1284
  maxAgeDays?: string | number | undefined;
@@ -1294,15 +1297,138 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1294
1297
  absoluteTimeoutHours?: string | number | undefined;
1295
1298
  tokenBits?: string | number | undefined;
1296
1299
  } | undefined;
1297
- dependency?: {
1298
- minCvssScore?: string | number | undefined;
1299
- } | undefined;
1300
1300
  } | undefined;
1301
1301
  aiScope?: {
1302
1302
  exclude?: string[] | undefined;
1303
1303
  } | undefined;
1304
1304
  }>>;
1305
+ /**
1306
+ * [ADR-0087] §D6, §V6 — Performance audit flow configuration (`cs perf`).
1307
+ *
1308
+ * `grantedAt` coerces a YAML unquoted date (`2026-09-21`) — which the YAML
1309
+ * parser delivers as a Date object — back to its ISO string. A consent date
1310
+ * is a plain string field in the PerfDocument; without the coercion, writing
1311
+ * the natural unquoted form fails config validation with the confusing
1312
+ * "Expected string, received object" (found via the V6-b CLI test, 2026-09-21).
1313
+ */
1314
+ perf: z.ZodDefault<z.ZodObject<{
1315
+ ai: z.ZodDefault<z.ZodObject<{
1316
+ sourceConsent: z.ZodOptional<z.ZodObject<{
1317
+ grantedBy: z.ZodString;
1318
+ reference: z.ZodOptional<z.ZodString>;
1319
+ grantedAt: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
1320
+ scope: z.ZodOptional<z.ZodString>;
1321
+ targetHash: z.ZodOptional<z.ZodString>;
1322
+ }, "strip", z.ZodTypeAny, {
1323
+ grantedBy: string;
1324
+ reference?: string | undefined;
1325
+ grantedAt?: string | undefined;
1326
+ scope?: string | undefined;
1327
+ targetHash?: string | undefined;
1328
+ }, {
1329
+ grantedBy: string;
1330
+ reference?: string | undefined;
1331
+ grantedAt?: unknown;
1332
+ scope?: string | undefined;
1333
+ targetHash?: string | undefined;
1334
+ }>>;
1335
+ }, "strip", z.ZodTypeAny, {
1336
+ sourceConsent?: {
1337
+ grantedBy: string;
1338
+ reference?: string | undefined;
1339
+ grantedAt?: string | undefined;
1340
+ scope?: string | undefined;
1341
+ targetHash?: string | undefined;
1342
+ } | undefined;
1343
+ }, {
1344
+ sourceConsent?: {
1345
+ grantedBy: string;
1346
+ reference?: string | undefined;
1347
+ grantedAt?: unknown;
1348
+ scope?: string | undefined;
1349
+ targetHash?: string | undefined;
1350
+ } | undefined;
1351
+ }>>;
1352
+ policy: z.ZodDefault<z.ZodObject<{
1353
+ maxReadTimeoutMs: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>> | z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>>>;
1354
+ }, "strip", z.ZodTypeAny, {
1355
+ maxReadTimeoutMs?: number | undefined;
1356
+ }, {
1357
+ maxReadTimeoutMs?: string | number | undefined;
1358
+ }>>;
1359
+ /**
1360
+ * SLO tiers for load testing ([ADR-0088] Q1, user 2026-09-22). Both
1361
+ * percentiles are carried - a single-percentile SLO is not best
1362
+ * practice ("The Tail at Scale"). Values set here are labeled
1363
+ * `project-config` in reports; the tool defaults (300/1000/0.01) are
1364
+ * labeled `tool-default`.
1365
+ */
1366
+ slo: z.ZodDefault<z.ZodObject<{
1367
+ p95Ms: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>> | z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>>>;
1368
+ p99Ms: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>> | z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>>>;
1369
+ errorRate: z.ZodOptional<z.ZodNumber>;
1370
+ }, "strip", z.ZodTypeAny, {
1371
+ p95Ms?: number | undefined;
1372
+ p99Ms?: number | undefined;
1373
+ errorRate?: number | undefined;
1374
+ }, {
1375
+ p95Ms?: string | number | undefined;
1376
+ p99Ms?: string | number | undefined;
1377
+ errorRate?: number | undefined;
1378
+ }>>;
1379
+ }, "strip", z.ZodTypeAny, {
1380
+ ai: {
1381
+ sourceConsent?: {
1382
+ grantedBy: string;
1383
+ reference?: string | undefined;
1384
+ grantedAt?: string | undefined;
1385
+ scope?: string | undefined;
1386
+ targetHash?: string | undefined;
1387
+ } | undefined;
1388
+ };
1389
+ policy: {
1390
+ maxReadTimeoutMs?: number | undefined;
1391
+ };
1392
+ slo: {
1393
+ p95Ms?: number | undefined;
1394
+ p99Ms?: number | undefined;
1395
+ errorRate?: number | undefined;
1396
+ };
1397
+ }, {
1398
+ ai?: {
1399
+ sourceConsent?: {
1400
+ grantedBy: string;
1401
+ reference?: string | undefined;
1402
+ grantedAt?: unknown;
1403
+ scope?: string | undefined;
1404
+ targetHash?: string | undefined;
1405
+ } | undefined;
1406
+ } | undefined;
1407
+ policy?: {
1408
+ maxReadTimeoutMs?: string | number | undefined;
1409
+ } | undefined;
1410
+ slo?: {
1411
+ p95Ms?: string | number | undefined;
1412
+ p99Ms?: string | number | undefined;
1413
+ errorRate?: number | undefined;
1414
+ } | undefined;
1415
+ }>>;
1305
1416
  }, "strip", z.ZodTypeAny, {
1417
+ include: string[];
1418
+ exclude: string[];
1419
+ mode: "auto" | "economy" | "balanced" | "performance";
1420
+ packaging: {
1421
+ exclude: string[];
1422
+ targets: Record<string, {
1423
+ entry: string;
1424
+ buildTool: "auto" | "maven" | "gradle";
1425
+ include: string[];
1426
+ exclude: string[];
1427
+ }>;
1428
+ maxFileBytes: number;
1429
+ maxArchiveBytes: number;
1430
+ defaultTarget?: string | undefined;
1431
+ };
1306
1432
  rules: {
1307
1433
  enabled: string[];
1308
1434
  disabled: string[];
@@ -1324,21 +1450,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1324
1450
  }> | undefined;
1325
1451
  }[];
1326
1452
  };
1327
- include: string[];
1328
- exclude: string[];
1329
- mode: "auto" | "economy" | "balanced" | "performance";
1330
- packaging: {
1331
- exclude: string[];
1332
- targets: Record<string, {
1333
- entry: string;
1334
- buildTool: "auto" | "maven" | "gradle";
1335
- include: string[];
1336
- exclude: string[];
1337
- }>;
1338
- maxFileBytes: number;
1339
- maxArchiveBytes: number;
1340
- defaultTarget?: string | undefined;
1341
- };
1342
1453
  ai: {
1343
1454
  ollama: {
1344
1455
  model: string;
@@ -1393,17 +1504,17 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1393
1504
  };
1394
1505
  };
1395
1506
  report: {
1396
- format: "json" | "markdown" | "markdown-compact" | "sarif";
1507
+ format: "markdown" | "markdown-compact" | "json" | "sarif";
1397
1508
  output: string;
1398
1509
  groupBy: "severity" | "file" | "rule" | "category";
1399
1510
  includeSnippets: boolean;
1400
1511
  };
1401
1512
  review: {
1402
1513
  minSeverity: "info" | "warning" | "error" | "blocker";
1403
- baseline: "ignore" | "apply";
1514
+ baseline: "apply" | "ignore";
1404
1515
  extraInstructions: string;
1405
1516
  profile: {
1406
- name: "deep" | "fast";
1517
+ name: "fast" | "deep";
1407
1518
  ai: "disabled" | "advisory" | "blocking";
1408
1519
  maxBudgetMs?: number | undefined;
1409
1520
  };
@@ -1427,7 +1538,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1427
1538
  enabled: boolean;
1428
1539
  maxPrimaryFiles: number;
1429
1540
  minRiskScore: number;
1430
- includeLayers: ("unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry")[];
1541
+ includeLayers: ("unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry")[];
1431
1542
  excludePatterns: string[];
1432
1543
  };
1433
1544
  groupedRules: {
@@ -1440,7 +1551,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1440
1551
  maxCalls: number;
1441
1552
  };
1442
1553
  riskScoring: {
1443
- layer: Partial<Record<"unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry", number>>;
1554
+ layer: Partial<Record<"unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry", number>>;
1444
1555
  signals: {
1445
1556
  hasTransactional: number;
1446
1557
  hasDbWrite: number;
@@ -1477,6 +1588,9 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1477
1588
  };
1478
1589
  pentest: {
1479
1590
  policy: {
1591
+ dependency?: {
1592
+ minCvssScore?: number | undefined;
1593
+ } | undefined;
1480
1594
  password?: {
1481
1595
  minLength?: number | undefined;
1482
1596
  maxAgeDays?: number | undefined;
@@ -1495,15 +1609,46 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1495
1609
  absoluteTimeoutHours?: number | undefined;
1496
1610
  tokenBits?: number | undefined;
1497
1611
  } | undefined;
1498
- dependency?: {
1499
- minCvssScore?: number | undefined;
1500
- } | undefined;
1501
1612
  };
1502
1613
  aiScope: {
1503
1614
  exclude: string[];
1504
1615
  };
1505
1616
  };
1617
+ perf: {
1618
+ ai: {
1619
+ sourceConsent?: {
1620
+ grantedBy: string;
1621
+ reference?: string | undefined;
1622
+ grantedAt?: string | undefined;
1623
+ scope?: string | undefined;
1624
+ targetHash?: string | undefined;
1625
+ } | undefined;
1626
+ };
1627
+ policy: {
1628
+ maxReadTimeoutMs?: number | undefined;
1629
+ };
1630
+ slo: {
1631
+ p95Ms?: number | undefined;
1632
+ p99Ms?: number | undefined;
1633
+ errorRate?: number | undefined;
1634
+ };
1635
+ };
1506
1636
  }, {
1637
+ include?: string[] | undefined;
1638
+ exclude?: string[] | undefined;
1639
+ mode?: "auto" | "economy" | "balanced" | "performance" | undefined;
1640
+ packaging?: {
1641
+ exclude?: string[] | undefined;
1642
+ defaultTarget?: string | undefined;
1643
+ targets?: Record<string, {
1644
+ entry: string;
1645
+ buildTool?: "auto" | "maven" | "gradle" | undefined;
1646
+ include?: string[] | undefined;
1647
+ exclude?: string[] | undefined;
1648
+ }> | undefined;
1649
+ maxFileBytes?: string | number | undefined;
1650
+ maxArchiveBytes?: string | number | undefined;
1651
+ } | undefined;
1507
1652
  rules?: {
1508
1653
  enabled?: string[] | undefined;
1509
1654
  disabled?: string[] | undefined;
@@ -1525,21 +1670,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1525
1670
  }> | undefined;
1526
1671
  }[] | undefined;
1527
1672
  } | undefined;
1528
- include?: string[] | undefined;
1529
- exclude?: string[] | undefined;
1530
- mode?: "auto" | "economy" | "balanced" | "performance" | undefined;
1531
- packaging?: {
1532
- exclude?: string[] | undefined;
1533
- defaultTarget?: string | undefined;
1534
- targets?: Record<string, {
1535
- entry: string;
1536
- buildTool?: "auto" | "maven" | "gradle" | undefined;
1537
- include?: string[] | undefined;
1538
- exclude?: string[] | undefined;
1539
- }> | undefined;
1540
- maxFileBytes?: string | number | undefined;
1541
- maxArchiveBytes?: string | number | undefined;
1542
- } | undefined;
1543
1673
  ai?: {
1544
1674
  ollama?: {
1545
1675
  model?: string | undefined;
@@ -1594,17 +1724,17 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1594
1724
  } | undefined;
1595
1725
  } | undefined;
1596
1726
  report?: {
1597
- format?: "json" | "markdown" | "markdown-compact" | "sarif" | "both" | undefined;
1727
+ format?: "markdown" | "markdown-compact" | "json" | "sarif" | "both" | undefined;
1598
1728
  output?: string | undefined;
1599
1729
  groupBy?: "severity" | "file" | "rule" | "category" | undefined;
1600
1730
  includeSnippets?: string | boolean | undefined;
1601
1731
  } | undefined;
1602
1732
  review?: {
1603
1733
  minSeverity?: "info" | "warning" | "error" | "blocker" | undefined;
1604
- baseline?: "ignore" | "apply" | "capture" | undefined;
1734
+ baseline?: "apply" | "ignore" | "capture" | undefined;
1605
1735
  extraInstructions?: string | undefined;
1606
1736
  profile?: {
1607
- name?: "deep" | "balanced" | "fast" | undefined;
1737
+ name?: "balanced" | "fast" | "deep" | undefined;
1608
1738
  ai?: "disabled" | "advisory" | "blocking" | undefined;
1609
1739
  maxBudgetMs?: string | number | undefined;
1610
1740
  } | undefined;
@@ -1628,7 +1758,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1628
1758
  enabled?: string | boolean | undefined;
1629
1759
  maxPrimaryFiles?: string | number | undefined;
1630
1760
  minRiskScore?: string | number | undefined;
1631
- includeLayers?: ("unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry")[] | undefined;
1761
+ includeLayers?: ("unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry")[] | undefined;
1632
1762
  excludePatterns?: string[] | undefined;
1633
1763
  } | undefined;
1634
1764
  groupedRules?: {
@@ -1641,7 +1771,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1641
1771
  maxCalls?: string | number | undefined;
1642
1772
  } | undefined;
1643
1773
  riskScoring?: {
1644
- layer?: Partial<Record<"unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry", string | number | undefined>> | undefined;
1774
+ layer?: Partial<Record<"unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry", string | number | undefined>> | undefined;
1645
1775
  signals?: {
1646
1776
  hasTransactional?: string | number | undefined;
1647
1777
  hasDbWrite?: string | number | undefined;
@@ -1678,6 +1808,9 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1678
1808
  } | undefined;
1679
1809
  pentest?: {
1680
1810
  policy?: {
1811
+ dependency?: {
1812
+ minCvssScore?: string | number | undefined;
1813
+ } | undefined;
1681
1814
  password?: {
1682
1815
  minLength?: string | number | undefined;
1683
1816
  maxAgeDays?: string | number | undefined;
@@ -1696,15 +1829,46 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1696
1829
  absoluteTimeoutHours?: string | number | undefined;
1697
1830
  tokenBits?: string | number | undefined;
1698
1831
  } | undefined;
1699
- dependency?: {
1700
- minCvssScore?: string | number | undefined;
1701
- } | undefined;
1702
1832
  } | undefined;
1703
1833
  aiScope?: {
1704
1834
  exclude?: string[] | undefined;
1705
1835
  } | undefined;
1706
1836
  } | undefined;
1837
+ perf?: {
1838
+ ai?: {
1839
+ sourceConsent?: {
1840
+ grantedBy: string;
1841
+ reference?: string | undefined;
1842
+ grantedAt?: unknown;
1843
+ scope?: string | undefined;
1844
+ targetHash?: string | undefined;
1845
+ } | undefined;
1846
+ } | undefined;
1847
+ policy?: {
1848
+ maxReadTimeoutMs?: string | number | undefined;
1849
+ } | undefined;
1850
+ slo?: {
1851
+ p95Ms?: string | number | undefined;
1852
+ p99Ms?: string | number | undefined;
1853
+ errorRate?: number | undefined;
1854
+ } | undefined;
1855
+ } | undefined;
1707
1856
  }>, {
1857
+ include: string[];
1858
+ exclude: string[];
1859
+ mode: "auto" | "economy" | "balanced" | "performance";
1860
+ packaging: {
1861
+ exclude: string[];
1862
+ targets: Record<string, {
1863
+ entry: string;
1864
+ buildTool: "auto" | "maven" | "gradle";
1865
+ include: string[];
1866
+ exclude: string[];
1867
+ }>;
1868
+ maxFileBytes: number;
1869
+ maxArchiveBytes: number;
1870
+ defaultTarget?: string | undefined;
1871
+ };
1708
1872
  rules: {
1709
1873
  enabled: string[];
1710
1874
  disabled: string[];
@@ -1726,21 +1890,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1726
1890
  }> | undefined;
1727
1891
  }[];
1728
1892
  };
1729
- include: string[];
1730
- exclude: string[];
1731
- mode: "auto" | "economy" | "balanced" | "performance";
1732
- packaging: {
1733
- exclude: string[];
1734
- targets: Record<string, {
1735
- entry: string;
1736
- buildTool: "auto" | "maven" | "gradle";
1737
- include: string[];
1738
- exclude: string[];
1739
- }>;
1740
- maxFileBytes: number;
1741
- maxArchiveBytes: number;
1742
- defaultTarget?: string | undefined;
1743
- };
1744
1893
  ai: {
1745
1894
  ollama: {
1746
1895
  model: string;
@@ -1795,17 +1944,17 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1795
1944
  };
1796
1945
  };
1797
1946
  report: {
1798
- format: "json" | "markdown" | "markdown-compact" | "sarif";
1947
+ format: "markdown" | "markdown-compact" | "json" | "sarif";
1799
1948
  output: string;
1800
1949
  groupBy: "severity" | "file" | "rule" | "category";
1801
1950
  includeSnippets: boolean;
1802
1951
  };
1803
1952
  review: {
1804
1953
  minSeverity: "info" | "warning" | "error" | "blocker";
1805
- baseline: "ignore" | "apply";
1954
+ baseline: "apply" | "ignore";
1806
1955
  extraInstructions: string;
1807
1956
  profile: {
1808
- name: "deep" | "fast";
1957
+ name: "fast" | "deep";
1809
1958
  ai: "disabled" | "advisory" | "blocking";
1810
1959
  maxBudgetMs?: number | undefined;
1811
1960
  };
@@ -1829,7 +1978,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1829
1978
  enabled: boolean;
1830
1979
  maxPrimaryFiles: number;
1831
1980
  minRiskScore: number;
1832
- includeLayers: ("unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry")[];
1981
+ includeLayers: ("unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry")[];
1833
1982
  excludePatterns: string[];
1834
1983
  };
1835
1984
  groupedRules: {
@@ -1842,7 +1991,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1842
1991
  maxCalls: number;
1843
1992
  };
1844
1993
  riskScoring: {
1845
- layer: Partial<Record<"unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry", number>>;
1994
+ layer: Partial<Record<"unknown" | "controller" | "service" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "pipe" | "model" | "test" | "config" | "generated" | "entry", number>>;
1846
1995
  signals: {
1847
1996
  hasTransactional: number;
1848
1997
  hasDbWrite: number;
@@ -1879,6 +2028,9 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1879
2028
  };
1880
2029
  pentest: {
1881
2030
  policy: {
2031
+ dependency?: {
2032
+ minCvssScore?: number | undefined;
2033
+ } | undefined;
1882
2034
  password?: {
1883
2035
  minLength?: number | undefined;
1884
2036
  maxAgeDays?: number | undefined;
@@ -1897,14 +2049,30 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1897
2049
  absoluteTimeoutHours?: number | undefined;
1898
2050
  tokenBits?: number | undefined;
1899
2051
  } | undefined;
1900
- dependency?: {
1901
- minCvssScore?: number | undefined;
1902
- } | undefined;
1903
2052
  };
1904
2053
  aiScope: {
1905
2054
  exclude: string[];
1906
2055
  };
1907
2056
  };
2057
+ perf: {
2058
+ ai: {
2059
+ sourceConsent?: {
2060
+ grantedBy: string;
2061
+ reference?: string | undefined;
2062
+ grantedAt?: string | undefined;
2063
+ scope?: string | undefined;
2064
+ targetHash?: string | undefined;
2065
+ } | undefined;
2066
+ };
2067
+ policy: {
2068
+ maxReadTimeoutMs?: number | undefined;
2069
+ };
2070
+ slo: {
2071
+ p95Ms?: number | undefined;
2072
+ p99Ms?: number | undefined;
2073
+ errorRate?: number | undefined;
2074
+ };
2075
+ };
1908
2076
  }, unknown>;
1909
2077
  type CodeReviewConfig = z.infer<typeof codeReviewConfigSchema>;
1910
2078
 
@@ -2779,6 +2947,10 @@ interface FindFilesOptions {
2779
2947
  readonly exclude: readonly string[];
2780
2948
  /** Cap on file size (bytes). Default 1 MB. Larger files are skipped + logged. */
2781
2949
  readonly maxFileBytes?: number;
2950
+ /** Stop before reading source when this many supported files would be retained. */
2951
+ readonly maxFiles?: number;
2952
+ /** Stop before reading source when retained files would exceed this many bytes. */
2953
+ readonly maxTotalBytes?: number;
2782
2954
  readonly logger?: Logger;
2783
2955
  }
2784
2956
  declare const findFiles: (options: FindFilesOptions) => Promise<Result<SourceFile[], IOError>>;