@orygn/opa-mcp 0.4.0 → 0.6.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 (236) hide show
  1. package/CHANGELOG.md +583 -4
  2. package/README.md +144 -98
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +9 -3
  5. package/dist/cli.js.map +1 -1
  6. package/dist/config.d.ts +14 -4
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +91 -19
  9. package/dist/config.js.map +1 -1
  10. package/dist/constants.d.ts +1 -6
  11. package/dist/constants.d.ts.map +1 -1
  12. package/dist/constants.js +17 -3
  13. package/dist/constants.js.map +1 -1
  14. package/dist/lib/bundle-signatures.d.ts +23 -0
  15. package/dist/lib/bundle-signatures.d.ts.map +1 -0
  16. package/dist/lib/bundle-signatures.js +152 -0
  17. package/dist/lib/bundle-signatures.js.map +1 -0
  18. package/dist/lib/child-env.d.ts +9 -2
  19. package/dist/lib/child-env.d.ts.map +1 -1
  20. package/dist/lib/child-env.js +38 -6
  21. package/dist/lib/child-env.js.map +1 -1
  22. package/dist/lib/conftest-cli.d.ts +25 -10
  23. package/dist/lib/conftest-cli.d.ts.map +1 -1
  24. package/dist/lib/conftest-cli.js +233 -50
  25. package/dist/lib/conftest-cli.js.map +1 -1
  26. package/dist/lib/errors.d.ts +4 -5
  27. package/dist/lib/errors.d.ts.map +1 -1
  28. package/dist/lib/errors.js +15 -3
  29. package/dist/lib/errors.js.map +1 -1
  30. package/dist/lib/inline-paths.d.ts +37 -0
  31. package/dist/lib/inline-paths.d.ts.map +1 -0
  32. package/dist/lib/inline-paths.js +162 -0
  33. package/dist/lib/inline-paths.js.map +1 -0
  34. package/dist/lib/install-id.d.ts.map +1 -1
  35. package/dist/lib/install-id.js +18 -3
  36. package/dist/lib/install-id.js.map +1 -1
  37. package/dist/lib/json-stream.d.ts +26 -0
  38. package/dist/lib/json-stream.d.ts.map +1 -0
  39. package/dist/lib/json-stream.js +69 -0
  40. package/dist/lib/json-stream.js.map +1 -0
  41. package/dist/lib/opa-cli.d.ts +74 -16
  42. package/dist/lib/opa-cli.d.ts.map +1 -1
  43. package/dist/lib/opa-cli.js +107 -30
  44. package/dist/lib/opa-cli.js.map +1 -1
  45. package/dist/lib/opa-client.d.ts +27 -1
  46. package/dist/lib/opa-client.d.ts.map +1 -1
  47. package/dist/lib/opa-client.js +98 -14
  48. package/dist/lib/opa-client.js.map +1 -1
  49. package/dist/lib/opa-paths.d.ts +34 -0
  50. package/dist/lib/opa-paths.d.ts.map +1 -0
  51. package/dist/lib/opa-paths.js +101 -0
  52. package/dist/lib/opa-paths.js.map +1 -0
  53. package/dist/lib/output.d.ts.map +1 -1
  54. package/dist/lib/output.js +83 -10
  55. package/dist/lib/output.js.map +1 -1
  56. package/dist/lib/regal-cli.d.ts +16 -1
  57. package/dist/lib/regal-cli.d.ts.map +1 -1
  58. package/dist/lib/regal-cli.js +40 -6
  59. package/dist/lib/regal-cli.js.map +1 -1
  60. package/dist/lib/rego-ast-walker.d.ts +0 -6
  61. package/dist/lib/rego-ast-walker.d.ts.map +1 -1
  62. package/dist/lib/rego-ast-walker.js +181 -55
  63. package/dist/lib/rego-ast-walker.js.map +1 -1
  64. package/dist/lib/rego-counterexample.d.ts +15 -2
  65. package/dist/lib/rego-counterexample.d.ts.map +1 -1
  66. package/dist/lib/rego-counterexample.js +63 -15
  67. package/dist/lib/rego-counterexample.js.map +1 -1
  68. package/dist/lib/rego-input-path.d.ts +20 -0
  69. package/dist/lib/rego-input-path.d.ts.map +1 -0
  70. package/dist/lib/rego-input-path.js +70 -0
  71. package/dist/lib/rego-input-path.js.map +1 -0
  72. package/dist/lib/rego-ir.d.ts +34 -3
  73. package/dist/lib/rego-ir.d.ts.map +1 -1
  74. package/dist/lib/rego-smt-encoder.d.ts +88 -5
  75. package/dist/lib/rego-smt-encoder.d.ts.map +1 -1
  76. package/dist/lib/rego-smt-encoder.js +270 -31
  77. package/dist/lib/rego-smt-encoder.js.map +1 -1
  78. package/dist/lib/rego-type-inferencer.d.ts +27 -2
  79. package/dist/lib/rego-type-inferencer.d.ts.map +1 -1
  80. package/dist/lib/rego-type-inferencer.js +71 -3
  81. package/dist/lib/rego-type-inferencer.js.map +1 -1
  82. package/dist/lib/rego-verify-engine.d.ts.map +1 -1
  83. package/dist/lib/rego-verify-engine.js +203 -90
  84. package/dist/lib/rego-verify-engine.js.map +1 -1
  85. package/dist/lib/rego-z3.d.ts +66 -0
  86. package/dist/lib/rego-z3.d.ts.map +1 -1
  87. package/dist/lib/rego-z3.js +312 -5
  88. package/dist/lib/rego-z3.js.map +1 -1
  89. package/dist/lib/security.d.ts +8 -0
  90. package/dist/lib/security.d.ts.map +1 -1
  91. package/dist/lib/security.js +130 -54
  92. package/dist/lib/security.js.map +1 -1
  93. package/dist/lib/subprocess.d.ts +13 -0
  94. package/dist/lib/subprocess.d.ts.map +1 -1
  95. package/dist/lib/subprocess.js +153 -18
  96. package/dist/lib/subprocess.js.map +1 -1
  97. package/dist/lib/tool-helpers.d.ts +12 -25
  98. package/dist/lib/tool-helpers.d.ts.map +1 -1
  99. package/dist/lib/tool-helpers.js +66 -40
  100. package/dist/lib/tool-helpers.js.map +1 -1
  101. package/dist/prompts/index.js +2 -2
  102. package/dist/resources/index.js +1 -1
  103. package/dist/resources/index.js.map +1 -1
  104. package/dist/resources/patterns.d.ts +1 -1
  105. package/dist/resources/patterns.d.ts.map +1 -1
  106. package/dist/resources/patterns.js +42 -15
  107. package/dist/resources/patterns.js.map +1 -1
  108. package/dist/server.d.ts +2 -2
  109. package/dist/server.d.ts.map +1 -1
  110. package/dist/server.js +50 -7
  111. package/dist/server.js.map +1 -1
  112. package/dist/tools/authoring/capabilities.d.ts +4 -0
  113. package/dist/tools/authoring/capabilities.d.ts.map +1 -1
  114. package/dist/tools/authoring/capabilities.js +41 -4
  115. package/dist/tools/authoring/capabilities.js.map +1 -1
  116. package/dist/tools/authoring/check-schema.d.ts +6 -0
  117. package/dist/tools/authoring/check-schema.d.ts.map +1 -1
  118. package/dist/tools/authoring/check-schema.js +56 -3
  119. package/dist/tools/authoring/check-schema.js.map +1 -1
  120. package/dist/tools/authoring/format.d.ts.map +1 -1
  121. package/dist/tools/authoring/format.js +2 -2
  122. package/dist/tools/authoring/format.js.map +1 -1
  123. package/dist/tools/authoring/lint.d.ts.map +1 -1
  124. package/dist/tools/authoring/lint.js +8 -6
  125. package/dist/tools/authoring/lint.js.map +1 -1
  126. package/dist/tools/authoring/migrate-v1.d.ts.map +1 -1
  127. package/dist/tools/authoring/migrate-v1.js +20 -4
  128. package/dist/tools/authoring/migrate-v1.js.map +1 -1
  129. package/dist/tools/authoring/parse.d.ts.map +1 -1
  130. package/dist/tools/authoring/parse.js +3 -3
  131. package/dist/tools/authoring/parse.js.map +1 -1
  132. package/dist/tools/bundles/build.d.ts.map +1 -1
  133. package/dist/tools/bundles/build.js +12 -4
  134. package/dist/tools/bundles/build.js.map +1 -1
  135. package/dist/tools/bundles/sign.d.ts +9 -2
  136. package/dist/tools/bundles/sign.d.ts.map +1 -1
  137. package/dist/tools/bundles/sign.js +125 -19
  138. package/dist/tools/bundles/sign.js.map +1 -1
  139. package/dist/tools/bundles/verify.d.ts +1 -1
  140. package/dist/tools/bundles/verify.d.ts.map +1 -1
  141. package/dist/tools/bundles/verify.js +58 -19
  142. package/dist/tools/bundles/verify.js.map +1 -1
  143. package/dist/tools/conftest/index.d.ts +5 -0
  144. package/dist/tools/conftest/index.d.ts.map +1 -1
  145. package/dist/tools/conftest/index.js.map +1 -1
  146. package/dist/tools/conftest/pull.d.ts.map +1 -1
  147. package/dist/tools/conftest/pull.js +24 -10
  148. package/dist/tools/conftest/pull.js.map +1 -1
  149. package/dist/tools/conftest/push.d.ts.map +1 -1
  150. package/dist/tools/conftest/push.js +17 -7
  151. package/dist/tools/conftest/push.js.map +1 -1
  152. package/dist/tools/conftest/test.d.ts +10 -6
  153. package/dist/tools/conftest/test.d.ts.map +1 -1
  154. package/dist/tools/conftest/test.js +61 -39
  155. package/dist/tools/conftest/test.js.map +1 -1
  156. package/dist/tools/conftest/verify.d.ts +10 -6
  157. package/dist/tools/conftest/verify.d.ts.map +1 -1
  158. package/dist/tools/conftest/verify.js +40 -32
  159. package/dist/tools/conftest/verify.js.map +1 -1
  160. package/dist/tools/evaluation/_shared.js +9 -12
  161. package/dist/tools/evaluation/_shared.js.map +1 -1
  162. package/dist/tools/evaluation/bench.d.ts +29 -2
  163. package/dist/tools/evaluation/bench.d.ts.map +1 -1
  164. package/dist/tools/evaluation/bench.js +53 -9
  165. package/dist/tools/evaluation/bench.js.map +1 -1
  166. package/dist/tools/evaluation/compile.js +4 -4
  167. package/dist/tools/evaluation/compile.js.map +1 -1
  168. package/dist/tools/evaluation/eval.d.ts.map +1 -1
  169. package/dist/tools/evaluation/eval.js +12 -16
  170. package/dist/tools/evaluation/eval.js.map +1 -1
  171. package/dist/tools/evaluation/exec.d.ts +16 -0
  172. package/dist/tools/evaluation/exec.d.ts.map +1 -1
  173. package/dist/tools/evaluation/exec.js +38 -6
  174. package/dist/tools/evaluation/exec.js.map +1 -1
  175. package/dist/tools/evaluation/test-multiroot.d.ts +6 -0
  176. package/dist/tools/evaluation/test-multiroot.d.ts.map +1 -1
  177. package/dist/tools/evaluation/test-multiroot.js +35 -8
  178. package/dist/tools/evaluation/test-multiroot.js.map +1 -1
  179. package/dist/tools/evaluation/test.d.ts +45 -0
  180. package/dist/tools/evaluation/test.d.ts.map +1 -1
  181. package/dist/tools/evaluation/test.js +153 -32
  182. package/dist/tools/evaluation/test.js.map +1 -1
  183. package/dist/tools/helpers/coverage-gaps.d.ts +11 -3
  184. package/dist/tools/helpers/coverage-gaps.d.ts.map +1 -1
  185. package/dist/tools/helpers/coverage-gaps.js +7 -7
  186. package/dist/tools/helpers/coverage-gaps.js.map +1 -1
  187. package/dist/tools/helpers/describe-policy.d.ts.map +1 -1
  188. package/dist/tools/helpers/describe-policy.js +2 -2
  189. package/dist/tools/helpers/describe-policy.js.map +1 -1
  190. package/dist/tools/helpers/explain-decision.d.ts.map +1 -1
  191. package/dist/tools/helpers/explain-decision.js +3 -4
  192. package/dist/tools/helpers/explain-decision.js.map +1 -1
  193. package/dist/tools/helpers/explain-undefined.d.ts +9 -3
  194. package/dist/tools/helpers/explain-undefined.d.ts.map +1 -1
  195. package/dist/tools/helpers/explain-undefined.js +214 -73
  196. package/dist/tools/helpers/explain-undefined.js.map +1 -1
  197. package/dist/tools/helpers/fix.d.ts +11 -5
  198. package/dist/tools/helpers/fix.d.ts.map +1 -1
  199. package/dist/tools/helpers/fix.js +88 -45
  200. package/dist/tools/helpers/fix.js.map +1 -1
  201. package/dist/tools/helpers/generate-test-skeleton.d.ts.map +1 -1
  202. package/dist/tools/helpers/generate-test-skeleton.js +105 -21
  203. package/dist/tools/helpers/generate-test-skeleton.js.map +1 -1
  204. package/dist/tools/helpers/playground-share.d.ts +4 -2
  205. package/dist/tools/helpers/playground-share.d.ts.map +1 -1
  206. package/dist/tools/helpers/playground-share.js +13 -3
  207. package/dist/tools/helpers/playground-share.js.map +1 -1
  208. package/dist/tools/helpers/policy-diff.d.ts.map +1 -1
  209. package/dist/tools/helpers/policy-diff.js +3 -4
  210. package/dist/tools/helpers/policy-diff.js.map +1 -1
  211. package/dist/tools/helpers/security-audit.d.ts.map +1 -1
  212. package/dist/tools/helpers/security-audit.js +19 -19
  213. package/dist/tools/helpers/security-audit.js.map +1 -1
  214. package/dist/tools/helpers/verify.d.ts.map +1 -1
  215. package/dist/tools/helpers/verify.js +5 -1
  216. package/dist/tools/helpers/verify.js.map +1 -1
  217. package/dist/tools/meta/index.d.ts +1 -1
  218. package/dist/tools/server-management/_shared.d.ts +15 -4
  219. package/dist/tools/server-management/_shared.d.ts.map +1 -1
  220. package/dist/tools/server-management/_shared.js +86 -13
  221. package/dist/tools/server-management/_shared.js.map +1 -1
  222. package/dist/tools/server-management/data.d.ts.map +1 -1
  223. package/dist/tools/server-management/data.js +88 -23
  224. package/dist/tools/server-management/data.js.map +1 -1
  225. package/dist/tools/server-management/decisions.d.ts.map +1 -1
  226. package/dist/tools/server-management/decisions.js +16 -3
  227. package/dist/tools/server-management/decisions.js.map +1 -1
  228. package/dist/tools/server-management/policies.d.ts.map +1 -1
  229. package/dist/tools/server-management/policies.js +44 -7
  230. package/dist/tools/server-management/policies.js.map +1 -1
  231. package/dist/tools/server-management/status.d.ts.map +1 -1
  232. package/dist/tools/server-management/status.js +80 -13
  233. package/dist/tools/server-management/status.js.map +1 -1
  234. package/dist/types.d.ts +10 -1
  235. package/dist/types.d.ts.map +1 -1
  236. package/package.json +2 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rego-input-path.d.ts","sourceRoot":"","sources":["../../src/lib/rego-input-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAMnE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAuCrD"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Rendering of an `input` path that is injective over its segments.
3
+ *
4
+ * Joining segments with dots made `input["a.b"]` and `input.a.b` the same
5
+ * string, so the two fields shared one Z3 constant and the witness for one
6
+ * was rebuilt as the other. A segment that is a plain identifier is written
7
+ * `.seg`; any other is written `["..."]` with JSON quoting, which is how Rego
8
+ * itself spells it, and the two forms cannot collide.
9
+ */
10
+ const IDENT = /^[A-Za-z_][A-Za-z0-9_]*$/;
11
+ /** Render `["user", "a.b"]` as `input.user["a.b"]`. */
12
+ export function renderInputPath(segments) {
13
+ let out = 'input';
14
+ for (const seg of segments) {
15
+ out += IDENT.test(seg) ? `.${seg}` : `[${JSON.stringify(seg)}]`;
16
+ }
17
+ return out;
18
+ }
19
+ /**
20
+ * Parse a rendered path back into its segments. The inverse of
21
+ * renderInputPath; anything it did not produce is read as best it can, one
22
+ * dot-separated segment at a time, so a plain `input.a.b` still works, and a
23
+ * bracket without a well-formed string inside is taken as literal text
24
+ * rather than thrown on.
25
+ */
26
+ export function parseInputPath(path) {
27
+ let rest = /^input(?=[.[]|$)/.test(path) ? path.slice('input'.length) : path;
28
+ const segments = [];
29
+ while (rest.length > 0) {
30
+ if (rest.startsWith('.')) {
31
+ const m = /^\.([^.[]+)/.exec(rest);
32
+ if (!m) {
33
+ // A dot with no name after it is not a rendering of ours either.
34
+ segments.push(rest);
35
+ break;
36
+ }
37
+ segments.push(m[1]);
38
+ rest = rest.slice(m[0].length);
39
+ }
40
+ else if (rest.startsWith('["')) {
41
+ // A JSON string literal: find its closing quote, honouring escapes.
42
+ let i = 2;
43
+ while (i < rest.length && rest[i] !== '"')
44
+ i += rest[i] === '\\' ? 2 : 1;
45
+ const closed = i < rest.length && rest[i + 1] === ']';
46
+ let literal;
47
+ if (closed) {
48
+ try {
49
+ literal = JSON.parse(rest.slice(1, i + 1));
50
+ }
51
+ catch {
52
+ literal = undefined;
53
+ }
54
+ }
55
+ if (typeof literal !== 'string') {
56
+ segments.push(rest);
57
+ break;
58
+ }
59
+ segments.push(literal);
60
+ rest = rest.slice(i + 2);
61
+ }
62
+ else {
63
+ // Not a rendering of ours; take the remainder as one segment.
64
+ segments.push(rest);
65
+ break;
66
+ }
67
+ }
68
+ return segments;
69
+ }
70
+ //# sourceMappingURL=rego-input-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rego-input-path.js","sourceRoot":"","sources":["../../src/lib/rego-input-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,KAAK,GAAG,0BAA0B,CAAC;AAEzC,uDAAuD;AACvD,MAAM,UAAU,eAAe,CAAC,QAA2B;IACzD,IAAI,GAAG,GAAG,OAAO,CAAC;IAClB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAA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IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;YACtD,IAAI,OAAgB,CAAC;YACrB,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,CAAC;oBACH,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC7C,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,GAAG,SAAS,CAAC;gBACtB,CAAC;YACH,CAAC;YACD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;gBAChC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACpB,MAAM;YACR,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,8DAA8D;YAC9D,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpB,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -7,7 +7,8 @@
7
7
  * A value that appears as an operand in a VerifyExpr.
8
8
  *
9
9
  * input_ref - a path like input.user.role (path = "input.user.role",
10
- * segments = ["user","role"])
10
+ * segments = ["user","role"]); a segment that is not a plain
11
+ * identifier is rendered `["..."]`, so paths never collide
11
12
  * local_var - a local variable bound by :=/= in the same clause
12
13
  * literal_* - a constant from the policy source
13
14
  */
@@ -36,6 +37,11 @@ export type VerifyValue = {
36
37
  * All supported operator semantics map cleanly to Z3. The 'unsupported'
37
38
  * variant is included so the walker can pass through the reason; the
38
39
  * engine treats any clause containing it as inconclusive.
40
+ *
41
+ * 'contradiction' is the encodable counterpart: a body term that makes the
42
+ * clause unsatisfiable no matter the input, such as a literal `false`. It is
43
+ * distinct from 'unsupported' because the engine CAN reason about it, and
44
+ * dropping it instead would make the clause look satisfiable when it is not.
39
45
  */
40
46
  export type VerifyExpr = {
41
47
  kind: 'eq';
@@ -84,15 +90,38 @@ export type VerifyExpr = {
84
90
  kind: 'assign';
85
91
  local: string;
86
92
  value: VerifyValue;
93
+ } | {
94
+ kind: 'contradiction';
95
+ reason: string;
96
+ } | {
97
+ kind: 'negation';
98
+ inner: VerifyExpr[];
87
99
  } | {
88
100
  kind: 'unsupported';
89
101
  constructType: string;
90
102
  reason: string;
91
103
  };
104
+ /**
105
+ * The shape of a rule head, which decides whether "is this rule true" is even
106
+ * a meaningful question.
107
+ *
108
+ * complete - `allow if { ... }` or `allow := <value> if { ... }`. Its
109
+ * value is a single term, so it can be compared to `true`.
110
+ * partial_set - `deny contains msg if { ... }`. Its value is a SET, so it
111
+ * is never equal to `true` and asking always_true/never_true
112
+ * about it answers a question the caller did not intend.
113
+ * partial_object - `perms[k] := v if { ... }`. Value is an object, same problem.
114
+ * function - `f(x) if { ... }`. Needs arguments the caller never supplies.
115
+ * else_chain - `... else := ...`. Ordered fallthrough the encoder does not model.
116
+ */
117
+ export type RuleShape = 'complete' | 'partial_set' | 'partial_object' | 'function' | 'else_chain';
92
118
  /**
93
119
  * One clause of a rule -- corresponds to one `rule { body... }` block.
94
- * Multiple clauses for the same rule name are OR'd together.
95
- * Expressions within one clause are AND'd together.
120
+ *
121
+ * A clause contributes to "the rule is true" only when its head value is
122
+ * literally `true`. It contributes to "the rule is defined" whenever its body
123
+ * is satisfied, whatever the head value is. Keeping those separate is what
124
+ * makes `default` and non-boolean heads encodable rather than silently wrong.
96
125
  */
97
126
  export interface VerifyRuleClause {
98
127
  clauseIndex: number;
@@ -111,6 +140,8 @@ export interface UnsupportedConstruct {
111
140
  export interface VerifyWalkResult {
112
141
  rules: Map<string, VerifyRuleClause[]>;
113
142
  defaults: Map<string, boolean | number | string | null>;
143
+ /** Head shape per rule name. Absent means no clause was ever walked for it. */
144
+ shapes: Map<string, RuleShape>;
114
145
  inputPaths: Map<string, string[]>;
115
146
  unsupported: UnsupportedConstruct[];
116
147
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rego-ir.d.ts","sourceRoot":"","sources":["../../src/lib/rego-ir.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,KAAK,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AC;AAElG;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACvC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;IACxD,+EAA+E;IAC/E,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACrC"}
@@ -7,20 +7,43 @@
7
7
  * Design:
8
8
  * - One Z3 constant per input path, typed by the type inferencer.
9
9
  * - One Z3 constant per local variable, scoped per clause.
10
- * - Each clause body becomes an AND of its expression formulas.
11
- * - The full rule formula is an OR of all its clause formulas.
10
+ * - Each clause body becomes an AND of its expression formulas, plus a
11
+ * presence guard for every input path the clause reads.
12
+ * - "the rule is TRUE" is the OR of the bodies of clauses whose head value is
13
+ * literally true, OR'd with the default when no clause body holds. Encoding
14
+ * the OR of all clause bodies instead conflated "the rule is defined" with
15
+ * "the rule is true", which made `default allow := true` and non-boolean
16
+ * heads silently wrong.
12
17
  * - Uninterpreted sorts get a dedicated Z3 uninterpreted sort and
13
18
  * can only participate in equality/inequality constraints.
14
19
  */
15
20
  import type { init as Z3Init } from 'z3-solver';
16
21
  import type { Z3Sort } from './rego-type-inferencer.js';
17
22
  import type { VerifyRuleClause } from './rego-ir.js';
23
+ /**
24
+ * A string literal for Z3. Its parser reads `\u{HH}` inside a literal as an
25
+ * escape, so a policy literal that happens to spell one, or that holds any
26
+ * backslash, would be stored as something else. Every backslash is written
27
+ * as `\u{5c}`, which Z3 stores as the character and renders back as an
28
+ * escape the counterexample decoder undoes.
29
+ */
30
+ export declare function z3String(Z3: Z3Context, value: string): ReturnType<Z3Context['String']['val']>;
18
31
  type Z3Context = ReturnType<Awaited<ReturnType<typeof Z3Init>>['Context']>;
19
32
  type Z3Bool = ReturnType<Z3Context['Bool']['const']>;
20
33
  type Z3AnyExpr = Z3Bool | ReturnType<Z3Context['Int']['const']> | ReturnType<Z3Context['String']['const']>;
21
34
  export interface EncoderContext {
22
35
  Z3: Z3Context;
23
36
  inputVars: Map<string, Z3AnyExpr>;
37
+ /**
38
+ * One Bool per input path, true when that field is present in the input.
39
+ *
40
+ * Rego evaluates a body to undefined when it reads a missing field, and an
41
+ * undefined body does not make the rule true. Modelling every path as a
42
+ * total, always-present constant made vacuous predicates look like
43
+ * tautologies, so always_true could be PROVEN for a rule that is merely
44
+ * undefined when a field is absent.
45
+ */
46
+ presenceVars: Map<string, Z3Bool>;
24
47
  sorts: Map<string, Z3Sort>;
25
48
  /** Per-call unique prefix for all Z3 constant names. Prevents sort conflicts
26
49
  * when the same input path is inferred as different sorts across calls in the
@@ -31,19 +54,79 @@ export interface EncoderContext {
31
54
  export interface EncodedRule {
32
55
  formula: Z3Bool;
33
56
  warnings: string[];
57
+ /**
58
+ * True when at least one clause could not be encoded.
59
+ *
60
+ * The caller MUST treat the formula as meaningless in that case. Skipping the
61
+ * clause and solving the rest is what turned an unencodable operand into a
62
+ * confident PROVEN: dropping a clause makes the rule strictly easier to
63
+ * satisfy in one direction and strictly harder in the other, and both
64
+ * directions produce a wrong verdict.
65
+ */
66
+ unencodable: boolean;
34
67
  }
35
68
  /**
36
69
  * Create Z3 constants for all input paths based on inferred sorts.
37
70
  * Each constant name is prefixed with callId to ensure uniqueness across
38
71
  * verification calls in the same Z3 singleton context.
39
72
  */
40
- export declare function createInputVars(Z3: Z3Context, inputPaths: Map<string, string[]>, sorts: Map<string, Z3Sort>, callId: string): Map<string, Z3AnyExpr>;
73
+ export declare function createInputVars(Z3: Z3Context, inputPaths: Map<string, string[]>, sorts: Map<string, Z3Sort>, callId: string): {
74
+ vars: Map<string, Z3AnyExpr>;
75
+ presence: Map<string, Z3Bool>;
76
+ };
77
+ /**
78
+ * Facts about the shape of any input, added to the solver alongside the
79
+ * property. A path the rule compared equal to a scalar literal, or fed to a
80
+ * string built-in, is present only as a scalar wherever that read holds, so
81
+ * it cannot also be the object holding a path beneath it: the two are never
82
+ * present together. Without this, `input.a == "x"` and `input.a.b == "y"`
83
+ * got two independent constants and a rule no input can satisfy was proved
84
+ * satisfiable, with a witness OPA rejects.
85
+ *
86
+ * Only those reads qualify. `input.a != "x"`, `input.a > 1` and a bare
87
+ * `input.a` all hold for an object, and a path with no evidence at all is
88
+ * given the string sort by default; treating any of them as scalar proved
89
+ * satisfiable rules never true.
90
+ */
91
+ export declare function structuralAxioms(Z3: Z3Context, inputPaths: Map<string, string[]>, scalarPaths: ReadonlySet<string>, presence: Map<string, Z3Bool>): Z3Bool[];
92
+ /**
93
+ * Every input path `clauses` reference, a negated body included.
94
+ *
95
+ * The presence guard below deliberately skips a negated body, since a
96
+ * missing field satisfies it; a witness must still be able to name that
97
+ * field. It must also never name a field the rule does not read: variables
98
+ * are created for every path in the module, so a path belonging to another
99
+ * rule is unconstrained here, and model completion would hand it an
100
+ * arbitrary value. Where that path is the parent of one this rule reads,
101
+ * the two collide and the witness stops satisfying the rule.
102
+ */
103
+ export declare function clauseInputPaths(clauses: VerifyRuleClause[]): Set<string>;
41
104
  /**
42
105
  * Encode a complete rule as a Z3 Bool formula.
43
106
  * rule_formula = clause_0 OR clause_1 OR ... OR clause_n
44
107
  */
45
- export declare function encodeRule(clauses: VerifyRuleClause[], ctx: EncoderContext): EncodedRule;
46
- /** Convert an input path like "input.user.role" to a valid Z3 var name. */
108
+ /**
109
+ * Encode "the rule evaluates to true".
110
+ *
111
+ * Rego semantics, and why the previous OR-of-all-clauses was wrong:
112
+ * - a clause whose body holds gives the rule that clause's HEAD value
113
+ * - the rule is DEFINED when any clause body holds
114
+ * - when no body holds the rule takes its `default`, or stays undefined
115
+ *
116
+ * So `rule == true` is the OR of the bodies of clauses whose head is literally
117
+ * true, plus the default case when nothing else fired. Treating every satisfied
118
+ * body as "true" made `allow := false if {...}` prove always-true, and ignoring
119
+ * the default made `default allow := true` prove never-true.
120
+ */
121
+ export declare function encodeRule(clauses: VerifyRuleClause[], ctx: EncoderContext, defaultValue?: boolean | number | string | null): EncodedRule;
122
+ /**
123
+ * Convert an input path like "input.user.role" to a valid Z3 constant name.
124
+ *
125
+ * Must be INJECTIVE. Replacing "." with "__" was not: a quoted key holding a
126
+ * dot or an underscore pair, ordinary in Kubernetes and cloud policies such as
127
+ * `input.labels["app.kubernetes.io/name"]`, collided with a different path and
128
+ * two distinct fields became a single SMT variable.
129
+ */
47
130
  export declare function pathToVarName(path: string): string;
48
131
  /** Reconstruct a nested JSON object from flat Z3 var name → value pairs. */
49
132
  export declare function varNameToPath(varName: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"rego-smt-encoder.d.ts","sourceRoot":"","sources":["../../src/lib/rego-smt-encoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAc,gBAAgB,EAAe,MAAM,cAAc,CAAC;AAE9E,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,O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