@trynullsec/s1-zk 1.0.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 (214) hide show
  1. package/LIMITATIONS.md +17 -0
  2. package/README.md +149 -0
  3. package/ROADMAP.md +21 -0
  4. package/RULES.md +229 -0
  5. package/benchmarks/historical/orchard-inspired/partial-ec-mul-halo2.rs +53 -0
  6. package/benchmarks/historical/orchard-inspired/safe-ec-mul-halo2.rs +69 -0
  7. package/dist/ai/prompt-builder.d.ts +2 -0
  8. package/dist/ai/prompt-builder.js +33 -0
  9. package/dist/ai/prompt-builder.js.map +1 -0
  10. package/dist/ai/reasoning-interface.d.ts +15 -0
  11. package/dist/ai/reasoning-interface.js +2 -0
  12. package/dist/ai/reasoning-interface.js.map +1 -0
  13. package/dist/cli.d.ts +2 -0
  14. package/dist/cli.js +71 -0
  15. package/dist/cli.js.map +1 -0
  16. package/dist/config.d.ts +4 -0
  17. package/dist/config.js +41 -0
  18. package/dist/config.js.map +1 -0
  19. package/dist/core/audit-engine.d.ts +3 -0
  20. package/dist/core/audit-engine.js +31 -0
  21. package/dist/core/audit-engine.js.map +1 -0
  22. package/dist/core/file-loader.d.ts +6 -0
  23. package/dist/core/file-loader.js +28 -0
  24. package/dist/core/file-loader.js.map +1 -0
  25. package/dist/core/issue-builder.d.ts +16 -0
  26. package/dist/core/issue-builder.js +27 -0
  27. package/dist/core/issue-builder.js.map +1 -0
  28. package/dist/core/range-check-classifier.d.ts +16 -0
  29. package/dist/core/range-check-classifier.js +194 -0
  30. package/dist/core/range-check-classifier.js.map +1 -0
  31. package/dist/core/rule-engine.d.ts +10 -0
  32. package/dist/core/rule-engine.js +41 -0
  33. package/dist/core/rule-engine.js.map +1 -0
  34. package/dist/core/severity.d.ts +6 -0
  35. package/dist/core/severity.js +21 -0
  36. package/dist/core/severity.js.map +1 -0
  37. package/dist/core/source-map.d.ts +3 -0
  38. package/dist/core/source-map.js +16 -0
  39. package/dist/core/source-map.js.map +1 -0
  40. package/dist/frontends/circom/circom-comments.d.ts +8 -0
  41. package/dist/frontends/circom/circom-comments.js +52 -0
  42. package/dist/frontends/circom/circom-comments.js.map +1 -0
  43. package/dist/frontends/circom/circom-ir-builder.d.ts +2 -0
  44. package/dist/frontends/circom/circom-ir-builder.js +12 -0
  45. package/dist/frontends/circom/circom-ir-builder.js.map +1 -0
  46. package/dist/frontends/circom/circom-parser.d.ts +2 -0
  47. package/dist/frontends/circom/circom-parser.js +218 -0
  48. package/dist/frontends/circom/circom-parser.js.map +1 -0
  49. package/dist/frontends/circom/circom-tokenizer.d.ts +7 -0
  50. package/dist/frontends/circom/circom-tokenizer.js +79 -0
  51. package/dist/frontends/circom/circom-tokenizer.js.map +1 -0
  52. package/dist/frontends/circom/circom-utils.d.ts +9 -0
  53. package/dist/frontends/circom/circom-utils.js +88 -0
  54. package/dist/frontends/circom/circom-utils.js.map +1 -0
  55. package/dist/frontends/gnark/gnark-adapter.d.ts +5 -0
  56. package/dist/frontends/gnark/gnark-adapter.js +7 -0
  57. package/dist/frontends/gnark/gnark-adapter.js.map +1 -0
  58. package/dist/frontends/halo2/halo2-adapter.d.ts +8 -0
  59. package/dist/frontends/halo2/halo2-adapter.js +12 -0
  60. package/dist/frontends/halo2/halo2-adapter.js.map +1 -0
  61. package/dist/frontends/halo2/halo2-constraint-extractor.d.ts +29 -0
  62. package/dist/frontends/halo2/halo2-constraint-extractor.js +38 -0
  63. package/dist/frontends/halo2/halo2-constraint-extractor.js.map +1 -0
  64. package/dist/frontends/halo2/halo2-constraint-graph.d.ts +16 -0
  65. package/dist/frontends/halo2/halo2-constraint-graph.js +96 -0
  66. package/dist/frontends/halo2/halo2-constraint-graph.js.map +1 -0
  67. package/dist/frontends/halo2/halo2-dataflow.d.ts +11 -0
  68. package/dist/frontends/halo2/halo2-dataflow.js +19 -0
  69. package/dist/frontends/halo2/halo2-dataflow.js.map +1 -0
  70. package/dist/frontends/halo2/halo2-expression-parser.d.ts +14 -0
  71. package/dist/frontends/halo2/halo2-expression-parser.js +62 -0
  72. package/dist/frontends/halo2/halo2-expression-parser.js.map +1 -0
  73. package/dist/frontends/halo2/halo2-ir-builder.d.ts +2 -0
  74. package/dist/frontends/halo2/halo2-ir-builder.js +17 -0
  75. package/dist/frontends/halo2/halo2-ir-builder.js.map +1 -0
  76. package/dist/frontends/halo2/halo2-parser.d.ts +2 -0
  77. package/dist/frontends/halo2/halo2-parser.js +316 -0
  78. package/dist/frontends/halo2/halo2-parser.js.map +1 -0
  79. package/dist/frontends/halo2/halo2-patterns.d.ts +6 -0
  80. package/dist/frontends/halo2/halo2-patterns.js +54 -0
  81. package/dist/frontends/halo2/halo2-patterns.js.map +1 -0
  82. package/dist/frontends/halo2/halo2-types.d.ts +100 -0
  83. package/dist/frontends/halo2/halo2-types.js +2 -0
  84. package/dist/frontends/halo2/halo2-types.js.map +1 -0
  85. package/dist/frontends/noir/noir-adapter.d.ts +5 -0
  86. package/dist/frontends/noir/noir-adapter.js +7 -0
  87. package/dist/frontends/noir/noir-adapter.js.map +1 -0
  88. package/dist/index.d.ts +4 -0
  89. package/dist/index.js +4 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/ir/circuit-ir.d.ts +1 -0
  92. package/dist/ir/circuit-ir.js +2 -0
  93. package/dist/ir/circuit-ir.js.map +1 -0
  94. package/dist/ir/component-table.d.ts +6 -0
  95. package/dist/ir/component-table.js +11 -0
  96. package/dist/ir/component-table.js.map +1 -0
  97. package/dist/ir/constraint-graph.d.ts +26 -0
  98. package/dist/ir/constraint-graph.js +130 -0
  99. package/dist/ir/constraint-graph.js.map +1 -0
  100. package/dist/ir/dataflow.d.ts +3 -0
  101. package/dist/ir/dataflow.js +10 -0
  102. package/dist/ir/dataflow.js.map +1 -0
  103. package/dist/ir/reference-index.d.ts +6 -0
  104. package/dist/ir/reference-index.js +18 -0
  105. package/dist/ir/reference-index.js.map +1 -0
  106. package/dist/ir/signal-table.d.ts +6 -0
  107. package/dist/ir/signal-table.js +16 -0
  108. package/dist/ir/signal-table.js.map +1 -0
  109. package/dist/report/json.d.ts +2 -0
  110. package/dist/report/json.js +4 -0
  111. package/dist/report/json.js.map +1 -0
  112. package/dist/report/markdown.d.ts +2 -0
  113. package/dist/report/markdown.js +45 -0
  114. package/dist/report/markdown.js.map +1 -0
  115. package/dist/report/sarif.d.ts +2 -0
  116. package/dist/report/sarif.js +52 -0
  117. package/dist/report/sarif.js.map +1 -0
  118. package/dist/report/summary.d.ts +2 -0
  119. package/dist/report/summary.js +7 -0
  120. package/dist/report/summary.js.map +1 -0
  121. package/dist/report/terminal.d.ts +2 -0
  122. package/dist/report/terminal.js +50 -0
  123. package/dist/report/terminal.js.map +1 -0
  124. package/dist/rules/NS-ZK-001-dangerous-hint-assignment.d.ts +2 -0
  125. package/dist/rules/NS-ZK-001-dangerous-hint-assignment.js +27 -0
  126. package/dist/rules/NS-ZK-001-dangerous-hint-assignment.js.map +1 -0
  127. package/dist/rules/NS-ZK-002-assigned-but-unconstrained.d.ts +2 -0
  128. package/dist/rules/NS-ZK-002-assigned-but-unconstrained.js +22 -0
  129. package/dist/rules/NS-ZK-002-assigned-but-unconstrained.js.map +1 -0
  130. package/dist/rules/NS-ZK-003-unbound-public-input.d.ts +2 -0
  131. package/dist/rules/NS-ZK-003-unbound-public-input.js +22 -0
  132. package/dist/rules/NS-ZK-003-unbound-public-input.js.map +1 -0
  133. package/dist/rules/NS-ZK-004-unconstrained-output.d.ts +2 -0
  134. package/dist/rules/NS-ZK-004-unconstrained-output.js +27 -0
  135. package/dist/rules/NS-ZK-004-unconstrained-output.js.map +1 -0
  136. package/dist/rules/NS-ZK-005-missing-booleanity.d.ts +2 -0
  137. package/dist/rules/NS-ZK-005-missing-booleanity.js +26 -0
  138. package/dist/rules/NS-ZK-005-missing-booleanity.js.map +1 -0
  139. package/dist/rules/NS-ZK-006-missing-range-check.d.ts +2 -0
  140. package/dist/rules/NS-ZK-006-missing-range-check.js +32 -0
  141. package/dist/rules/NS-ZK-006-missing-range-check.js.map +1 -0
  142. package/dist/rules/NS-ZK-007-unsafe-assertion.d.ts +2 -0
  143. package/dist/rules/NS-ZK-007-unsafe-assertion.js +24 -0
  144. package/dist/rules/NS-ZK-007-unsafe-assertion.js.map +1 -0
  145. package/dist/rules/NS-ZK-008-unsafe-division-or-inverse.d.ts +2 -0
  146. package/dist/rules/NS-ZK-008-unsafe-division-or-inverse.js +39 -0
  147. package/dist/rules/NS-ZK-008-unsafe-division-or-inverse.js.map +1 -0
  148. package/dist/rules/NS-ZK-009-unconstrained-component-output.d.ts +2 -0
  149. package/dist/rules/NS-ZK-009-unconstrained-component-output.js +25 -0
  150. package/dist/rules/NS-ZK-009-unconstrained-component-output.js.map +1 -0
  151. package/dist/rules/NS-ZK-010-alias-overflow-risk.d.ts +2 -0
  152. package/dist/rules/NS-ZK-010-alias-overflow-risk.js +48 -0
  153. package/dist/rules/NS-ZK-010-alias-overflow-risk.js.map +1 -0
  154. package/dist/rules/NS-ZK-011-unused-signal.d.ts +2 -0
  155. package/dist/rules/NS-ZK-011-unused-signal.js +26 -0
  156. package/dist/rules/NS-ZK-011-unused-signal.js.map +1 -0
  157. package/dist/rules/NS-ZK-012-suspicious-selector.d.ts +2 -0
  158. package/dist/rules/NS-ZK-012-suspicious-selector.js +33 -0
  159. package/dist/rules/NS-ZK-012-suspicious-selector.js.map +1 -0
  160. package/dist/rules/halo2/NS-H2-001-assigned-advice-not-constrained.d.ts +2 -0
  161. package/dist/rules/halo2/NS-H2-001-assigned-advice-not-constrained.js +40 -0
  162. package/dist/rules/halo2/NS-H2-001-assigned-advice-not-constrained.js.map +1 -0
  163. package/dist/rules/halo2/NS-H2-002-instance-not-bound.d.ts +2 -0
  164. package/dist/rules/halo2/NS-H2-002-instance-not-bound.js +32 -0
  165. package/dist/rules/halo2/NS-H2-002-instance-not-bound.js.map +1 -0
  166. package/dist/rules/halo2/NS-H2-003-selector-risk.d.ts +2 -0
  167. package/dist/rules/halo2/NS-H2-003-selector-risk.js +37 -0
  168. package/dist/rules/halo2/NS-H2-003-selector-risk.js.map +1 -0
  169. package/dist/rules/halo2/NS-H2-004-unsafe-inverse.d.ts +2 -0
  170. package/dist/rules/halo2/NS-H2-004-unsafe-inverse.js +43 -0
  171. package/dist/rules/halo2/NS-H2-004-unsafe-inverse.js.map +1 -0
  172. package/dist/rules/halo2/NS-H2-005-partial-ec-operation.d.ts +2 -0
  173. package/dist/rules/halo2/NS-H2-005-partial-ec-operation.js +43 -0
  174. package/dist/rules/halo2/NS-H2-005-partial-ec-operation.js.map +1 -0
  175. package/dist/rules/halo2/NS-H2-006-missing-enable-equality.d.ts +2 -0
  176. package/dist/rules/halo2/NS-H2-006-missing-enable-equality.js +31 -0
  177. package/dist/rules/halo2/NS-H2-006-missing-enable-equality.js.map +1 -0
  178. package/dist/rules/halo2/halo2-rule-utils.d.ts +8 -0
  179. package/dist/rules/halo2/halo2-rule-utils.js +24 -0
  180. package/dist/rules/halo2/halo2-rule-utils.js.map +1 -0
  181. package/dist/rules/index.d.ts +2 -0
  182. package/dist/rules/index.js +39 -0
  183. package/dist/rules/index.js.map +1 -0
  184. package/dist/scanner.d.ts +8 -0
  185. package/dist/scanner.js +52 -0
  186. package/dist/scanner.js.map +1 -0
  187. package/dist/types.d.ts +171 -0
  188. package/dist/types.js +2 -0
  189. package/dist/types.js.map +1 -0
  190. package/examples/halo2/safe/bound-instance.rs +23 -0
  191. package/examples/halo2/safe/constrained-advice.rs +27 -0
  192. package/examples/halo2/safe/safe-inverse.rs +30 -0
  193. package/examples/halo2/safe/safe-selector.rs +27 -0
  194. package/examples/halo2/vulnerable/missing-selector-booleanity.rs +20 -0
  195. package/examples/halo2/vulnerable/partial-ec-mul.rs +23 -0
  196. package/examples/halo2/vulnerable/unbound-instance.rs +20 -0
  197. package/examples/halo2/vulnerable/unconstrained-advice.rs +24 -0
  198. package/examples/halo2/vulnerable/unsafe-inverse.rs +20 -0
  199. package/examples/safe/safe-boolean.circom +15 -0
  200. package/examples/safe/safe-component-output.circom +18 -0
  201. package/examples/safe/safe-division.circom +14 -0
  202. package/examples/safe/safe-public-input.circom +15 -0
  203. package/examples/safe/safe-range-check.circom +16 -0
  204. package/examples/safe/safe-transfer.circom +19 -0
  205. package/examples/vulnerable/alias-overflow-risk.circom +12 -0
  206. package/examples/vulnerable/merkle-selector-bug.circom +12 -0
  207. package/examples/vulnerable/missing-boolean.circom +11 -0
  208. package/examples/vulnerable/missing-range-check.circom +11 -0
  209. package/examples/vulnerable/public-input-not-bound.circom +12 -0
  210. package/examples/vulnerable/unconstrained-component-output.circom +15 -0
  211. package/examples/vulnerable/unconstrained-transfer.circom +17 -0
  212. package/examples/vulnerable/unsafe-assertion.circom +12 -0
  213. package/examples/vulnerable/unsafe-division.circom +11 -0
  214. package/package.json +46 -0
@@ -0,0 +1,54 @@
1
+ export const halo2DetectionPatterns = [
2
+ "halo2_proofs",
3
+ "ConstraintSystem",
4
+ "create_gate",
5
+ "query_advice",
6
+ "query_instance",
7
+ "assign_advice",
8
+ "constrain_equal",
9
+ "constrain_instance",
10
+ "enable_equality",
11
+ "Selector",
12
+ "Advice",
13
+ "Instance",
14
+ "Fixed"
15
+ ];
16
+ export const halo2DetectionRegex = new RegExp(halo2DetectionPatterns.join("|"));
17
+ export function isLikelyHalo2Source(source) {
18
+ return halo2DetectionRegex.test(source);
19
+ }
20
+ export function extractRustSymbols(expression) {
21
+ const reserved = new Set([
22
+ "self",
23
+ "meta",
24
+ "region",
25
+ "layouter",
26
+ "Value",
27
+ "Rotation",
28
+ "cur",
29
+ "prev",
30
+ "next",
31
+ "Ok",
32
+ "Err",
33
+ "Some",
34
+ "None",
35
+ "let",
36
+ "mut",
37
+ "move",
38
+ "return",
39
+ "assign_advice",
40
+ "assign_fixed",
41
+ "constrain_equal",
42
+ "constrain_instance",
43
+ "enable_selector"
44
+ ]);
45
+ const matches = expression.match(/\b[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*\b/g) ?? [];
46
+ return [...new Set(matches.filter((symbol) => !reserved.has(symbol.split(".")[0] ?? symbol) && !/^\d+$/.test(symbol)))];
47
+ }
48
+ export function isHashOrSafeInverseContext(snippet) {
49
+ return /is_zero|nonzero|not_zero|checked|safe|assert|constrain_equal|zero_check/i.test(snippet);
50
+ }
51
+ export function isEcLikeName(value) {
52
+ return /curve|point|scalar|base|fixed_base|variable_base|ecc|ec_|mul|window|endo/i.test(value);
53
+ }
54
+ //# sourceMappingURL=halo2-patterns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"halo2-patterns.js","sourceRoot":"","sources":["../../../src/frontends/halo2/halo2-patterns.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,cAAc;IACd,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,eAAe;IACf,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;IACjB,UAAU;IACV,QAAQ;IACR,UAAU;IACV,OAAO;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEhF,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,OAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;QACvB,MAAM;QACN,MAAM;QACN,QAAQ;QACR,UAAU;QACV,OAAO;QACP,UAAU;QACV,KAAK;QACL,MAAM;QACN,MAAM;QACN,IAAI;QACJ,KAAK;QACL,MAAM;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,MAAM;QACN,QAAQ;QACR,eAAe;QACf,cAAc;QACd,iBAAiB;QACjB,oBAAoB;QACpB,iBAAiB;KAClB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,0DAA0D,CAAC,IAAI,EAAE,CAAC;IACnG,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1H,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAe;IACxD,OAAO,0EAA0E,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,2EAA2E,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjG,CAAC"}
@@ -0,0 +1,100 @@
1
+ import type { ParserWarning, SourceLocation } from "../../types.js";
2
+ export interface Halo2Column extends SourceLocation {
3
+ name: string;
4
+ columnType: "advice" | "fixed" | "instance" | "unknown";
5
+ equalityEnabled: boolean;
6
+ }
7
+ export interface Halo2Selector extends SourceLocation {
8
+ name: string;
9
+ enabledLines: number[];
10
+ usedInGates: string[];
11
+ }
12
+ export interface Halo2Query extends SourceLocation {
13
+ queryType: "advice" | "fixed" | "instance" | "selector";
14
+ columnName: string;
15
+ rotation?: string;
16
+ gateName?: string;
17
+ }
18
+ export interface Halo2Gate extends SourceLocation {
19
+ name: string;
20
+ body: string;
21
+ queries: Halo2Query[];
22
+ selectors: string[];
23
+ expressions: string[];
24
+ returnedExpressions?: string[];
25
+ variableReferences?: string[];
26
+ selectorAliases?: Record<string, string>;
27
+ adviceAliases?: Record<string, string>;
28
+ instanceAliases?: Record<string, string>;
29
+ fixedAliases?: Record<string, string>;
30
+ }
31
+ export interface Halo2Assignment extends SourceLocation {
32
+ assignmentType: "advice" | "fixed";
33
+ target?: string;
34
+ columnName?: string;
35
+ label?: string;
36
+ rowOffset?: string;
37
+ assignedVariable?: string;
38
+ cellVariable?: string;
39
+ regionName?: string;
40
+ expression: string;
41
+ referencedSymbols: string[];
42
+ }
43
+ export interface Halo2EqualityConstraint extends SourceLocation {
44
+ lhs: string;
45
+ rhs: string;
46
+ referencedColumns: string[];
47
+ }
48
+ export interface Halo2InstanceConstraint extends SourceLocation {
49
+ cell: string;
50
+ instanceColumn: string;
51
+ row?: string;
52
+ }
53
+ export interface Halo2Lookup extends SourceLocation {
54
+ expression: string;
55
+ referencedSymbols: string[];
56
+ }
57
+ export interface Halo2Region extends SourceLocation {
58
+ name: string;
59
+ assignments: Halo2Assignment[];
60
+ selectorEnables: string[];
61
+ copyAdvice: Halo2CopyConstraint[];
62
+ equalityConstraints: Halo2EqualityConstraint[];
63
+ instanceConstraints: Halo2InstanceConstraint[];
64
+ }
65
+ export interface Halo2CopyConstraint extends SourceLocation {
66
+ source: string;
67
+ targetColumn?: string;
68
+ targetOffset?: string;
69
+ referencedSymbols: string[];
70
+ }
71
+ export interface Halo2CircuitFile {
72
+ filePath: string;
73
+ rawSource: string;
74
+ columns: Halo2Column[];
75
+ selectors: Halo2Selector[];
76
+ gates: Halo2Gate[];
77
+ queries: Halo2Query[];
78
+ assignments: Halo2Assignment[];
79
+ equalityConstraints: Halo2EqualityConstraint[];
80
+ instanceConstraints: Halo2InstanceConstraint[];
81
+ lookups: Halo2Lookup[];
82
+ regions: Halo2Region[];
83
+ copyConstraints: Halo2CopyConstraint[];
84
+ parserWarnings: ParserWarning[];
85
+ detectedPatterns: string[];
86
+ }
87
+ export interface Halo2IR {
88
+ files: Halo2CircuitFile[];
89
+ columns: Halo2Column[];
90
+ selectors: Halo2Selector[];
91
+ gates: Halo2Gate[];
92
+ queries: Halo2Query[];
93
+ assignments: Halo2Assignment[];
94
+ equalityConstraints: Halo2EqualityConstraint[];
95
+ instanceConstraints: Halo2InstanceConstraint[];
96
+ lookups: Halo2Lookup[];
97
+ regions: Halo2Region[];
98
+ copyConstraints: Halo2CopyConstraint[];
99
+ parserWarnings: ParserWarning[];
100
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=halo2-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"halo2-types.js","sourceRoot":"","sources":["../../../src/frontends/halo2/halo2-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface NoirAdapter {
2
+ readonly frontend: "Noir";
3
+ parse(): never;
4
+ }
5
+ export declare const noirAdapter: NoirAdapter;
@@ -0,0 +1,7 @@
1
+ export const noirAdapter = {
2
+ frontend: "Noir",
3
+ parse() {
4
+ throw new Error("Noir frontend is planned but not implemented in v1.");
5
+ }
6
+ };
7
+ //# sourceMappingURL=noir-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noir-adapter.js","sourceRoot":"","sources":["../../../src/frontends/noir/noir-adapter.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,QAAQ,EAAE,MAAM;IAChB,KAAK;QACH,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { scanTarget, renderReport } from "./scanner.js";
2
+ export { loadConfig, writeDefaultConfig } from "./config.js";
3
+ export { allRules } from "./rules/index.js";
4
+ export type * from "./types.js";
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { scanTarget, renderReport } from "./scanner.js";
2
+ export { loadConfig, writeDefaultConfig } from "./config.js";
3
+ export { allRules } from "./rules/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ export type { Assertion, Assignment, CircuitIR, ComponentDeclaration, Constraint, IncludeStatement, ParsedCircuitFile, ParserWarning, SignalDeclaration, TemplateDeclaration } from "../types.js";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=circuit-ir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circuit-ir.js","sourceRoot":"","sources":["../../src/ir/circuit-ir.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { ComponentDeclaration } from "../types.js";
2
+ export declare class ComponentTable {
3
+ private readonly byName;
4
+ constructor(components: ComponentDeclaration[]);
5
+ get(name: string): ComponentDeclaration | undefined;
6
+ }
@@ -0,0 +1,11 @@
1
+ export class ComponentTable {
2
+ byName = new Map();
3
+ constructor(components) {
4
+ for (const component of components)
5
+ this.byName.set(component.name, component);
6
+ }
7
+ get(name) {
8
+ return this.byName.get(name);
9
+ }
10
+ }
11
+ //# sourceMappingURL=component-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-table.js","sourceRoot":"","sources":["../../src/ir/component-table.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IACR,MAAM,GAAG,IAAI,GAAG,EAAgC,CAAC;IAElE,YAAY,UAAkC;QAC5C,KAAK,MAAM,SAAS,IAAI,UAAU;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACjF,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF"}
@@ -0,0 +1,26 @@
1
+ import type { Assignment, CircuitIR, Constraint, SignalDeclaration, SourceLocation } from "../types.js";
2
+ export declare class ConstraintGraph {
3
+ private readonly ir;
4
+ private constraintSignals;
5
+ private equalitySignals;
6
+ private assignmentMap;
7
+ constructor(ir: CircuitIR);
8
+ declaredSignals(): SignalDeclaration[];
9
+ inputSignals(): SignalDeclaration[];
10
+ publicInputSignals(): SignalDeclaration[];
11
+ outputSignals(): SignalDeclaration[];
12
+ assignedByHint(): Assignment[];
13
+ assignedByConstraint(): Assignment[];
14
+ constraintsForSignal(signalName: string): Constraint[];
15
+ assignmentsForSignal(signalName: string): Assignment[];
16
+ appearsInAnyConstraint(signalName: string): boolean;
17
+ appearsInEqualityConstraint(signalName: string): boolean;
18
+ onlyAssignedButNeverConstrained(): Assignment[];
19
+ unboundInputs(): SignalDeclaration[];
20
+ unconstrainedOutputs(): SignalDeclaration[];
21
+ hasBooleanityConstraint(signalName: string): boolean;
22
+ hasRangeCheck(signalName: string, templateName?: string): boolean;
23
+ isComponentOutputReference(reference: string): boolean;
24
+ isComponentOutputConstrained(reference: string): boolean;
25
+ signalReferences(signalName: string): SourceLocation[];
26
+ }
@@ -0,0 +1,130 @@
1
+ import { baseSignalName, extractSignalReferences, normalizeSignalReference } from "../frontends/circom/circom-utils.js";
2
+ function namesEquivalent(reference, signalName) {
3
+ const ref = normalizeSignalReference(reference);
4
+ const sig = normalizeSignalReference(signalName);
5
+ return ref === sig || baseSignalName(ref) === baseSignalName(sig);
6
+ }
7
+ function expressionMentionsSignal(expression, signalName) {
8
+ return extractSignalReferences(expression).some((ref) => namesEquivalent(ref, signalName));
9
+ }
10
+ export class ConstraintGraph {
11
+ ir;
12
+ constraintSignals = new Set();
13
+ equalitySignals = new Set();
14
+ assignmentMap = new Map();
15
+ constructor(ir) {
16
+ this.ir = ir;
17
+ for (const assignment of ir.assignments) {
18
+ const key = baseSignalName(assignment.lhs);
19
+ const existing = this.assignmentMap.get(key) ?? [];
20
+ existing.push(assignment);
21
+ this.assignmentMap.set(key, existing);
22
+ }
23
+ for (const constraint of ir.constraints) {
24
+ for (const ref of constraint.referencedSignals) {
25
+ this.constraintSignals.add(baseSignalName(ref));
26
+ if (constraint.operator === "===")
27
+ this.equalitySignals.add(baseSignalName(ref));
28
+ }
29
+ if (constraint.lhs)
30
+ this.constraintSignals.add(baseSignalName(constraint.lhs));
31
+ }
32
+ }
33
+ declaredSignals() {
34
+ return this.ir.signals;
35
+ }
36
+ inputSignals() {
37
+ return this.ir.signals.filter((signal) => signal.kind === "input");
38
+ }
39
+ publicInputSignals() {
40
+ return this.inputSignals();
41
+ }
42
+ outputSignals() {
43
+ return this.ir.signals.filter((signal) => signal.kind === "output");
44
+ }
45
+ assignedByHint() {
46
+ return this.ir.assignments.filter((assignment) => assignment.operator === "<--");
47
+ }
48
+ assignedByConstraint() {
49
+ return this.ir.assignments.filter((assignment) => assignment.operator === "<==");
50
+ }
51
+ constraintsForSignal(signalName) {
52
+ return this.ir.constraints.filter((constraint) => {
53
+ if (constraint.lhs && namesEquivalent(constraint.lhs, signalName))
54
+ return true;
55
+ return constraint.referencedSignals.some((ref) => namesEquivalent(ref, signalName));
56
+ });
57
+ }
58
+ assignmentsForSignal(signalName) {
59
+ return this.ir.assignments.filter((assignment) => namesEquivalent(assignment.lhs, signalName));
60
+ }
61
+ appearsInAnyConstraint(signalName) {
62
+ return this.constraintSignals.has(baseSignalName(signalName)) || this.constraintsForSignal(signalName).length > 0;
63
+ }
64
+ appearsInEqualityConstraint(signalName) {
65
+ return this.equalitySignals.has(baseSignalName(signalName)) || this.constraintsForSignal(signalName).some((constraint) => constraint.operator === "===");
66
+ }
67
+ onlyAssignedButNeverConstrained() {
68
+ return this.assignedByHint().filter((assignment) => !this.appearsInAnyConstraint(assignment.lhs));
69
+ }
70
+ unboundInputs() {
71
+ return this.inputSignals().filter((signal) => !this.appearsInAnyConstraint(signal.name));
72
+ }
73
+ unconstrainedOutputs() {
74
+ return this.outputSignals().filter((signal) => {
75
+ const assignments = this.assignmentsForSignal(signal.name);
76
+ return assignments.some((assignment) => assignment.operator === "<--") || !this.appearsInAnyConstraint(signal.name);
77
+ });
78
+ }
79
+ hasBooleanityConstraint(signalName) {
80
+ const escaped = signalName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\[\\\]/g, "(?:\\[[^\\]]+\\])?");
81
+ const compactPatterns = [
82
+ new RegExp(`${escaped}\\*\\(${escaped}-1\\)===0`),
83
+ new RegExp(`${escaped}\\*\\(1-${escaped}\\)===0`),
84
+ new RegExp(`\\(${escaped}-1\\)\\*${escaped}===0`)
85
+ ];
86
+ return this.ir.constraints.some((constraint) => {
87
+ const compact = constraint.expression.replace(/\s+/g, "");
88
+ if (compactPatterns.some((pattern) => pattern.test(compact)))
89
+ return true;
90
+ return /Num2Bits|Bits2Num/.test(constraint.expression) && expressionMentionsSignal(constraint.expression, signalName);
91
+ });
92
+ }
93
+ hasRangeCheck(signalName, templateName) {
94
+ const rangePattern = /Num2Bits|Bits2Num|LessThan|LessEqThan|GreaterThan|GreaterEqThan|RangeCheck|rangeCheck|Decompose|AliasCheck|bits?\[/;
95
+ const inScope = (node) => !templateName || !node.templateName || node.templateName === templateName;
96
+ const rangeComponents = this.ir.components.filter((component) => inScope(component) && rangePattern.test(`${component.templateType ?? ""}${component.name}`));
97
+ const rangeComponentNames = new Set(rangeComponents.map((component) => component.name));
98
+ return (rangeComponents.some((component) => component.inputs.some((input) => expressionMentionsSignal(input, signalName))) ||
99
+ this.ir.constraints.some((constraint) => inScope(constraint) &&
100
+ constraint.lhs !== undefined &&
101
+ rangeComponentNames.has(constraint.lhs.split(".")[0] ?? "") &&
102
+ constraint.referencedSignals.some((ref) => namesEquivalent(ref, signalName))) ||
103
+ this.ir.constraints.some((constraint) => inScope(constraint) && rangePattern.test(constraint.expression) && expressionMentionsSignal(constraint.expression, signalName)) ||
104
+ this.ir.assignments.some((assignment) => inScope(assignment) && rangePattern.test(`${assignment.rhs} ${assignment.lhs}`) && assignment.referencedSignals.some((ref) => namesEquivalent(ref, signalName))));
105
+ }
106
+ isComponentOutputReference(reference) {
107
+ const normalized = normalizeSignalReference(reference);
108
+ return this.ir.components.some((component) => normalized.startsWith(`${component.name}.`));
109
+ }
110
+ isComponentOutputConstrained(reference) {
111
+ return this.ir.constraints.some((constraint) => expressionMentionsSignal(constraint.expression, reference));
112
+ }
113
+ signalReferences(signalName) {
114
+ const refs = [];
115
+ for (const assignment of this.ir.assignments) {
116
+ if (assignment.referencedSignals.some((ref) => namesEquivalent(ref, signalName)) || namesEquivalent(assignment.lhs, signalName))
117
+ refs.push(assignment);
118
+ }
119
+ for (const constraint of this.ir.constraints) {
120
+ if (constraint.referencedSignals.some((ref) => namesEquivalent(ref, signalName)))
121
+ refs.push(constraint);
122
+ }
123
+ for (const assertion of this.ir.assertions) {
124
+ if (assertion.referencedSignals.some((ref) => namesEquivalent(ref, signalName)))
125
+ refs.push(assertion);
126
+ }
127
+ return refs;
128
+ }
129
+ }
130
+ //# sourceMappingURL=constraint-graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constraint-graph.js","sourceRoot":"","sources":["../../src/ir/constraint-graph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAExH,SAAS,eAAe,CAAC,SAAiB,EAAE,UAAkB;IAC5D,MAAM,GAAG,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACjD,OAAO,GAAG,KAAK,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,cAAc,CAAC,GAAG,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,wBAAwB,CAAC,UAAkB,EAAE,UAAkB;IACtE,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,MAAM,OAAO,eAAe;IAKG;IAJrB,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IACtC,eAAe,GAAG,IAAI,GAAG,EAAU,CA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,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import type { Assignment, CircuitIR } from "../types.js";
2
+ export declare function assignmentsInto(signalName: string, ir: CircuitIR): Assignment[];
3
+ export declare function downstreamAssignments(signalName: string, ir: CircuitIR): Assignment[];
@@ -0,0 +1,10 @@
1
+ import { baseSignalName } from "../frontends/circom/circom-utils.js";
2
+ export function assignmentsInto(signalName, ir) {
3
+ const target = baseSignalName(signalName);
4
+ return ir.assignments.filter((assignment) => baseSignalName(assignment.lhs) === target);
5
+ }
6
+ export function downstreamAssignments(signalName, ir) {
7
+ const target = baseSignalName(signalName);
8
+ return ir.assignments.filter((assignment) => assignment.referencedSignals.some((ref) => baseSignalName(ref) === target));
9
+ }
10
+ //# sourceMappingURL=dataflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataflow.js","sourceRoot":"","sources":["../../src/ir/dataflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,UAAU,eAAe,CAAC,UAAkB,EAAE,EAAa;IAC/D,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1C,OAAO,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC;AAC1F,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,UAAkB,EAAE,EAAa;IACrE,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1C,OAAO,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;AAC3H,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { CircuitIR, SourceLocation } from "../types.js";
2
+ export declare class ReferenceIndex {
3
+ private readonly locations;
4
+ constructor(ir: CircuitIR);
5
+ get(signalName: string): SourceLocation[];
6
+ }
@@ -0,0 +1,18 @@
1
+ import { baseSignalName } from "../frontends/circom/circom-utils.js";
2
+ export class ReferenceIndex {
3
+ locations = new Map();
4
+ constructor(ir) {
5
+ for (const node of [...ir.assignments, ...ir.constraints, ...ir.assertions]) {
6
+ for (const ref of node.referencedSignals) {
7
+ const key = baseSignalName(ref);
8
+ const existing = this.locations.get(key) ?? [];
9
+ existing.push(node);
10
+ this.locations.set(key, existing);
11
+ }
12
+ }
13
+ }
14
+ get(signalName) {
15
+ return this.locations.get(baseSignalName(signalName)) ?? [];
16
+ }
17
+ }
18
+ //# sourceMappingURL=reference-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference-index.js","sourceRoot":"","sources":["../../src/ir/reference-index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,OAAO,cAAc;IACR,SAAS,GAAG,IAAI,GAAG,EAA4B,CAAC;IAEjE,YAAY,EAAa;QACvB,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5E,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBACzC,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;gBAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;gBAC/C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACpB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;IACH,CAAC;IAED,GAAG,CAAC,UAAkB;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9D,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import type { SignalDeclaration } from "../types.js";
2
+ export declare class SignalTable {
3
+ private readonly byBaseName;
4
+ constructor(signals: SignalDeclaration[]);
5
+ get(name: string): SignalDeclaration[];
6
+ }
@@ -0,0 +1,16 @@
1
+ import { baseSignalName } from "../frontends/circom/circom-utils.js";
2
+ export class SignalTable {
3
+ byBaseName = new Map();
4
+ constructor(signals) {
5
+ for (const signal of signals) {
6
+ const key = baseSignalName(signal.name);
7
+ const existing = this.byBaseName.get(key) ?? [];
8
+ existing.push(signal);
9
+ this.byBaseName.set(key, existing);
10
+ }
11
+ }
12
+ get(name) {
13
+ return this.byBaseName.get(baseSignalName(name)) ?? [];
14
+ }
15
+ }
16
+ //# sourceMappingURL=signal-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal-table.js","sourceRoot":"","sources":["../../src/ir/signal-table.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,OAAO,WAAW;IACL,UAAU,GAAG,IAAI,GAAG,EAA+B,CAAC;IAErE,YAAY,OAA4B;QACtC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAChD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IACzD,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ import type { AuditResult } from "../types.js";
2
+ export declare function renderJsonReport(result: AuditResult): string;
@@ -0,0 +1,4 @@
1
+ export function renderJsonReport(result) {
2
+ return `${JSON.stringify(result, null, 2)}\n`;
3
+ }
4
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/report/json.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAClD,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AAChD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AuditResult } from "../types.js";
2
+ export declare function renderMarkdownReport(result: AuditResult): string;
@@ -0,0 +1,45 @@
1
+ function renderIssue(issue) {
2
+ return `## [${issue.severity}] ${issue.ruleId} ${issue.title}
3
+
4
+ **File:** \`${issue.file}:${issue.line}\`
5
+ **Template:** ${issue.templateName ? `\`${issue.templateName}\`` : "unknown"}
6
+ **Confidence:** ${issue.confidence}
7
+
8
+ \`\`\`circom
9
+ ${issue.snippet ?? ""}
10
+ \`\`\`
11
+
12
+ ### Why This Matters
13
+ ${issue.explanation}
14
+
15
+ ### Impact
16
+ ${issue.impact}
17
+
18
+ ### Suggested Fix
19
+ ${issue.suggestedFix}
20
+ `;
21
+ }
22
+ export function renderMarkdownReport(result) {
23
+ return `# Nullsec S1-ZK Report
24
+
25
+ AI-native auditing for zero-knowledge circuits. Find underconstraints before they mint infinite money.
26
+
27
+ **Target:** \`${result.target}\`
28
+ **Frontend:** ${result.frontend}
29
+ **Files scanned:** ${result.filesScanned}
30
+ **Rules executed:** ${result.rulesExecuted}
31
+ **Issues found:** ${result.issues.length}
32
+
33
+ ## Severity Summary
34
+
35
+ - CRITICAL: ${result.summary.CRITICAL}
36
+ - HIGH: ${result.summary.HIGH}
37
+ - MEDIUM: ${result.summary.MEDIUM}
38
+ - LOW: ${result.summary.LOW}
39
+ - INFO: ${result.summary.INFO}
40
+
41
+ ${result.issues.map(renderIssue).join("\n")}
42
+ ${result.parserWarnings.length > 0 ? `\n## Parser Warnings\n\n${result.parserWarnings.map((warning) => `- \`${warning.file}:${warning.line}\` ${warning.message}`).join("\n")}\n` : ""}
43
+ `;
44
+ }
45
+ //# sourceMappingURL=markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/report/markdown.ts"],"names":[],"mappings":"AAEA,SAAS,WAAW,CAAC,KAAY;IAC/B,OAAO,OAAO,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK;;cAEhD,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI;gBACtB,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,SAAS;kBAC1D,KAAK,CAAC,UAAU;;;EAGhC,KAAK,CAAC,OAAO,IAAI,EAAE;;;;EAInB,KAAK,CAAC,WAAW;;;EAGjB,KAAK,CAAC,MAAM;;;EAGZ,KAAK,CAAC,YAAY;CACnB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAmB;IACtD,OAAO;;;;gBAIO,MAAM,CAAC,MAAM;gBACb,MAAM,CAAC,QAAQ;qBACV,MAAM,CAAC,YAAY;sBAClB,MAAM,CAAC,aAAa;oBACtB,MAAM,CAAC,MAAM,CAAC,MAAM;;;;cAI1B,MAAM,CAAC,OAAO,CAAC,QAAQ;UAC3B,MAAM,CAAC,OAAO,CAAC,IAAI;YACjB,MAAM,CAAC,OAAO,CAAC,MAAM;SACxB,MAAM,CAAC,OAAO,CAAC,GAAG;UACjB,MAAM,CAAC,OAAO,CAAC,IAAI;;EAE3B,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;EACzC,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,2BAA2B,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;CACrL,CAAC;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AuditResult } from "../types.js";
2
+ export declare function renderSarifReport(result: AuditResult): string;
@@ -0,0 +1,52 @@
1
+ import { allRules } from "../rules/index.js";
2
+ export function renderSarifReport(result) {
3
+ const sarif = {
4
+ version: "2.1.0",
5
+ $schema: "https://json.schemastore.org/sarif-2.1.0.json",
6
+ runs: [
7
+ {
8
+ tool: {
9
+ driver: {
10
+ name: result.tool.name,
11
+ version: result.tool.version,
12
+ informationUri: "https://nullsec.dev/s1-zk",
13
+ rules: allRules.map((rule) => ({
14
+ id: rule.id,
15
+ name: rule.title,
16
+ shortDescription: { text: rule.title },
17
+ fullDescription: { text: rule.description },
18
+ defaultConfiguration: { level: rule.defaultSeverity === "CRITICAL" || rule.defaultSeverity === "HIGH" ? "error" : "warning" },
19
+ properties: { tags: rule.tags }
20
+ }))
21
+ }
22
+ },
23
+ results: result.issues.map((issue) => ({
24
+ ruleId: issue.ruleId,
25
+ level: issue.severity === "CRITICAL" || issue.severity === "HIGH" ? "error" : issue.severity === "INFO" ? "note" : "warning",
26
+ message: { text: `${issue.title}: ${issue.explanation}` },
27
+ locations: [
28
+ {
29
+ physicalLocation: {
30
+ artifactLocation: { uri: issue.file },
31
+ region: {
32
+ startLine: issue.line,
33
+ startColumn: issue.column ?? 1,
34
+ snippet: { text: issue.snippet ?? "" }
35
+ }
36
+ }
37
+ }
38
+ ],
39
+ properties: {
40
+ severity: issue.severity,
41
+ confidence: issue.confidence,
42
+ impact: issue.impact,
43
+ suggestedFix: issue.suggestedFix,
44
+ tags: issue.tags
45
+ }
46
+ }))
47
+ }
48
+ ]
49
+ };
50
+ return `${JSON.stringify(sarif, null, 2)}\n`;
51
+ }
52
+ //# sourceMappingURL=sarif.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sarif.js","sourceRoot":"","sources":["../../src/report/sarif.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,UAAU,iBAAiB,CAAC,MAAmB;IACnD,MAAM,KAAK,GAAG;QACZ,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,+CAA+C;QACxD,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE;oBACJ,MAAM,EAAE;wBACN,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;wBACtB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO;wBAC5B,cAAc,EAAE,2BAA2B;wBAC3C,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;4BAC7B,EAAE,EAAE,IAAI,CAAC,EAAE;4BACX,IAAI,EAAE,IAAI,CAAC,KAAK;4BAChB,gBAAgB,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE;4BACtC,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE;4BAC3C,oBAAoB,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,KAAK,UAAU,IAAI,IAAI,CAAC,eAAe,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE;4BAC7H,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;yBAChC,CAAC,CAAC;qBACJ;iBACF;gBACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;oBACrC,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,KAAK,EAAE,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;oBAC5H,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,WAAW,EAAE,EAAE;oBACzD,SAAS,EAAE;wBACT;4BACE,gBAAgB,EAAE;gCAChB,gBAAgB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE;gCACrC,MAAM,EAAE;oCACN,SAAS,EAAE,KAAK,CAAC,IAAI;oCACrB,WAAW,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC;oCAC9B,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE,EAAE;iCACvC;6BACF;yBACF;qBACF;oBACD,UAAU,EAAE;wBACV,QAAQ,EAAE,KAAK,CAAC,QAAQ;wBACxB,UAAU,EAAE,KAAK,CAAC,UAAU;wBAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;wBACpB,YAAY,EAAE,KAAK,CAAC,YAAY;wBAChC,IAAI,EAAE,KAAK,CAAC,IAAI;qBACjB;iBACF,CAAC,CAAC;aACJ;SACF;KACF,CAAC;IACF,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AuditSummary, Issue } from "../types.js";
2
+ export declare function summarizeIssues(issues: Issue[]): AuditSummary;
@@ -0,0 +1,7 @@
1
+ export function summarizeIssues(issues) {
2
+ return issues.reduce((summary, issue) => {
3
+ summary[issue.severity] += 1;
4
+ return summary;
5
+ }, { CRITICAL: 0, HIGH: 0, MEDIUM: 0, LOW: 0, INFO: 0 });
6
+ }
7
+ //# sourceMappingURL=summary.js.map