audit-tools 0.29.3 → 0.30.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.
Files changed (30) hide show
  1. package/dist/audit/extractors/analyzers/complexityDuplication.d.ts +27 -0
  2. package/dist/audit/extractors/analyzers/complexityDuplication.d.ts.map +1 -0
  3. package/dist/audit/extractors/analyzers/complexityDuplication.js +102 -0
  4. package/dist/audit/extractors/analyzers/complexityDuplication.js.map +1 -0
  5. package/dist/audit/extractors/designAssessment.d.ts.map +1 -1
  6. package/dist/audit/extractors/designAssessment.js +65 -0
  7. package/dist/audit/extractors/designAssessment.js.map +1 -1
  8. package/dist/audit/extractors/graph.d.ts.map +1 -1
  9. package/dist/audit/extractors/graph.js +12 -1
  10. package/dist/audit/extractors/graph.js.map +1 -1
  11. package/dist/audit/extractors/graphSignals.d.ts +43 -1
  12. package/dist/audit/extractors/graphSignals.d.ts.map +1 -1
  13. package/dist/audit/extractors/graphSignals.js +123 -0
  14. package/dist/audit/extractors/graphSignals.js.map +1 -1
  15. package/dist/audit/extractors/risk.d.ts.map +1 -1
  16. package/dist/audit/extractors/risk.js +39 -5
  17. package/dist/audit/extractors/risk.js.map +1 -1
  18. package/dist/remediate/steps/dispatch.d.ts +16 -0
  19. package/dist/remediate/steps/dispatch.d.ts.map +1 -1
  20. package/dist/remediate/steps/dispatch.js +19 -16
  21. package/dist/remediate/steps/dispatch.js.map +1 -1
  22. package/dist/shared/index.d.ts +2 -2
  23. package/dist/shared/index.d.ts.map +1 -1
  24. package/dist/shared/index.js +1 -1
  25. package/dist/shared/index.js.map +1 -1
  26. package/dist/shared/types/graph.d.ts +157 -0
  27. package/dist/shared/types/graph.d.ts.map +1 -1
  28. package/dist/shared/types/graph.js +32 -0
  29. package/dist/shared/types/graph.js.map +1 -1
  30. package/package.json +1 -1
@@ -36,6 +36,84 @@ export declare const RouteEdgeSchema: z.ZodObject<{
36
36
  method?: string | undefined;
37
37
  }>;
38
38
  export type RouteEdge = z.infer<typeof RouteEdgeSchema>;
39
+ /**
40
+ * Per-node structural measure (one of complexity / duplication). `value` is the
41
+ * raw metric, `measure` names the concrete algorithm used (so consumers never
42
+ * guess units), and `reach` records the scope of source the measure actually
43
+ * covered — currently only `'js-ts-effective'` (computed over JS/TS source).
44
+ */
45
+ export declare const NodeMetricSchema: z.ZodObject<{
46
+ value: z.ZodNumber;
47
+ measure: z.ZodString;
48
+ reach: z.ZodLiteral<"js-ts-effective">;
49
+ }, "strict", z.ZodTypeAny, {
50
+ value: number;
51
+ measure: string;
52
+ reach: "js-ts-effective";
53
+ }, {
54
+ value: number;
55
+ measure: string;
56
+ reach: "js-ts-effective";
57
+ }>;
58
+ export type NodeMetric = z.infer<typeof NodeMetricSchema>;
59
+ /**
60
+ * Optional per-node (repo-path keyed) structural metrics computed at graph-build
61
+ * time, where the file source is available. Absent for non-js/ts files (never
62
+ * zero-filled). Each metric is independently optional. Declared as an explicit
63
+ * optional Zod field (not a catchall) so a `.strict()` bundle WITHOUT
64
+ * `node_metrics` still parses, while an unknown sibling key is rejected.
65
+ */
66
+ export declare const NodeMetricsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
67
+ complexity: z.ZodOptional<z.ZodObject<{
68
+ value: z.ZodNumber;
69
+ measure: z.ZodString;
70
+ reach: z.ZodLiteral<"js-ts-effective">;
71
+ }, "strict", z.ZodTypeAny, {
72
+ value: number;
73
+ measure: string;
74
+ reach: "js-ts-effective";
75
+ }, {
76
+ value: number;
77
+ measure: string;
78
+ reach: "js-ts-effective";
79
+ }>>;
80
+ duplication: z.ZodOptional<z.ZodObject<{
81
+ value: z.ZodNumber;
82
+ measure: z.ZodString;
83
+ reach: z.ZodLiteral<"js-ts-effective">;
84
+ }, "strict", z.ZodTypeAny, {
85
+ value: number;
86
+ measure: string;
87
+ reach: "js-ts-effective";
88
+ }, {
89
+ value: number;
90
+ measure: string;
91
+ reach: "js-ts-effective";
92
+ }>>;
93
+ }, "strict", z.ZodTypeAny, {
94
+ complexity?: {
95
+ value: number;
96
+ measure: string;
97
+ reach: "js-ts-effective";
98
+ } | undefined;
99
+ duplication?: {
100
+ value: number;
101
+ measure: string;
102
+ reach: "js-ts-effective";
103
+ } | undefined;
104
+ }, {
105
+ complexity?: {
106
+ value: number;
107
+ measure: string;
108
+ reach: "js-ts-effective";
109
+ } | undefined;
110
+ duplication?: {
111
+ value: number;
112
+ measure: string;
113
+ reach: "js-ts-effective";
114
+ } | undefined;
115
+ }>>;
116
+ export type NodeMetrics = z.infer<typeof NodeMetricsSchema>;
39
117
  export declare const GraphBundleSchema: z.ZodObject<{
40
118
  graphs: z.ZodObject<{
41
119
  imports: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -284,6 +362,61 @@ export declare const GraphBundleSchema: z.ZodObject<{
284
362
  * the deterministic regex floor was used). See Phase 5 analyzer seam.
285
363
  */
286
364
  analyzers_used: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
365
+ /**
366
+ * Optional per-node structural metrics (complexity / duplication) computed at
367
+ * graph-build time over js/ts source. Explicit optional field so legacy
368
+ * bundles without it still parse under `.strict()`.
369
+ */
370
+ node_metrics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
371
+ complexity: z.ZodOptional<z.ZodObject<{
372
+ value: z.ZodNumber;
373
+ measure: z.ZodString;
374
+ reach: z.ZodLiteral<"js-ts-effective">;
375
+ }, "strict", z.ZodTypeAny, {
376
+ value: number;
377
+ measure: string;
378
+ reach: "js-ts-effective";
379
+ }, {
380
+ value: number;
381
+ measure: string;
382
+ reach: "js-ts-effective";
383
+ }>>;
384
+ duplication: z.ZodOptional<z.ZodObject<{
385
+ value: z.ZodNumber;
386
+ measure: z.ZodString;
387
+ reach: z.ZodLiteral<"js-ts-effective">;
388
+ }, "strict", z.ZodTypeAny, {
389
+ value: number;
390
+ measure: string;
391
+ reach: "js-ts-effective";
392
+ }, {
393
+ value: number;
394
+ measure: string;
395
+ reach: "js-ts-effective";
396
+ }>>;
397
+ }, "strict", z.ZodTypeAny, {
398
+ complexity?: {
399
+ value: number;
400
+ measure: string;
401
+ reach: "js-ts-effective";
402
+ } | undefined;
403
+ duplication?: {
404
+ value: number;
405
+ measure: string;
406
+ reach: "js-ts-effective";
407
+ } | undefined;
408
+ }, {
409
+ complexity?: {
410
+ value: number;
411
+ measure: string;
412
+ reach: "js-ts-effective";
413
+ } | undefined;
414
+ duplication?: {
415
+ value: number;
416
+ measure: string;
417
+ reach: "js-ts-effective";
418
+ } | undefined;
419
+ }>>>;
287
420
  }, "strict", z.ZodTypeAny, {
288
421
  graphs: {
289
422
  imports?: {
@@ -319,6 +452,18 @@ export declare const GraphBundleSchema: z.ZodObject<{
319
452
  [k: string]: unknown;
320
453
  };
321
454
  analyzers_used?: string[] | undefined;
455
+ node_metrics?: Record<string, {
456
+ complexity?: {
457
+ value: number;
458
+ measure: string;
459
+ reach: "js-ts-effective";
460
+ } | undefined;
461
+ duplication?: {
462
+ value: number;
463
+ measure: string;
464
+ reach: "js-ts-effective";
465
+ } | undefined;
466
+ }> | undefined;
322
467
  }, {
323
468
  graphs: {
324
469
  imports?: {
@@ -354,6 +499,18 @@ export declare const GraphBundleSchema: z.ZodObject<{
354
499
  [k: string]: unknown;
355
500
  };
356
501
  analyzers_used?: string[] | undefined;
502
+ node_metrics?: Record<string, {
503
+ complexity?: {
504
+ value: number;
505
+ measure: string;
506
+ reach: "js-ts-effective";
507
+ } | undefined;
508
+ duplication?: {
509
+ value: number;
510
+ measure: string;
511
+ reach: "js-ts-effective";
512
+ } | undefined;
513
+ }> | undefined;
357
514
  }>;
358
515
  export type GraphBundle = z.infer<typeof GraphBundleSchema>;
359
516
  //# sourceMappingURL=graph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/shared/types/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;;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GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQ7B,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAW1B;;;;OAIG;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGI,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -16,6 +16,32 @@ export const RouteEdgeSchema = z
16
16
  method: z.string().optional(),
17
17
  })
18
18
  .strict();
19
+ /**
20
+ * Per-node structural measure (one of complexity / duplication). `value` is the
21
+ * raw metric, `measure` names the concrete algorithm used (so consumers never
22
+ * guess units), and `reach` records the scope of source the measure actually
23
+ * covered — currently only `'js-ts-effective'` (computed over JS/TS source).
24
+ */
25
+ export const NodeMetricSchema = z
26
+ .object({
27
+ value: z.number(),
28
+ measure: z.string(),
29
+ reach: z.literal("js-ts-effective"),
30
+ })
31
+ .strict();
32
+ /**
33
+ * Optional per-node (repo-path keyed) structural metrics computed at graph-build
34
+ * time, where the file source is available. Absent for non-js/ts files (never
35
+ * zero-filled). Each metric is independently optional. Declared as an explicit
36
+ * optional Zod field (not a catchall) so a `.strict()` bundle WITHOUT
37
+ * `node_metrics` still parses, while an unknown sibling key is rejected.
38
+ */
39
+ export const NodeMetricsSchema = z.record(z.string(), z
40
+ .object({
41
+ complexity: NodeMetricSchema.optional(),
42
+ duplication: NodeMetricSchema.optional(),
43
+ })
44
+ .strict());
19
45
  export const GraphBundleSchema = z
20
46
  .object({
21
47
  graphs: z
@@ -33,6 +59,12 @@ export const GraphBundleSchema = z
33
59
  * the deterministic regex floor was used). See Phase 5 analyzer seam.
34
60
  */
35
61
  analyzers_used: z.array(z.string()).optional(),
62
+ /**
63
+ * Optional per-node structural metrics (complexity / duplication) computed at
64
+ * graph-build time over js/ts source. Explicit optional field so legacy
65
+ * bundles without it still parse under `.strict()`.
66
+ */
67
+ node_metrics: NodeMetricsSchema.optional(),
36
68
  })
37
69
  .strict();
38
70
  //# sourceMappingURL=graph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/shared/types/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,MAAM,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AAO,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;QAC5C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;QAC1C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;QAC/C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;KAC5C,CAAC;QACF,oEAAoE;SACnE,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACxB;;;;OAIG;IACH,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC9C;;;;OAIG;IACH,YAAY,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CAC3C,CAAC;KACD,MAAM,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "audit-tools",
3
- "version": "0.29.3",
3
+ "version": "0.30.0",
4
4
  "private": false,
5
5
  "description": "Portable hybrid code auditing + remediation orchestrators for arbitrary repositories.",
6
6
  "type": "module",