@intentius/chant-lexicon-cedar 0.44.8 → 0.44.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 (108) hide show
  1. package/README.md +58 -0
  2. package/dist/codegen/package.d.ts.map +1 -1
  3. package/dist/config.d.ts +25 -0
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/dogwood/cli.d.ts +206 -0
  6. package/dist/dogwood/cli.d.ts.map +1 -0
  7. package/dist/dogwood/event-schema.d.ts +161 -0
  8. package/dist/dogwood/event-schema.d.ts.map +1 -0
  9. package/dist/dogwood/index.d.ts +33 -0
  10. package/dist/dogwood/index.d.ts.map +1 -0
  11. package/dist/dogwood/macros.d.ts +96 -0
  12. package/dist/dogwood/macros.d.ts.map +1 -0
  13. package/dist/dogwood/policy.d.ts +120 -0
  14. package/dist/dogwood/policy.d.ts.map +1 -0
  15. package/dist/dogwood/scan.d.ts +109 -0
  16. package/dist/dogwood/scan.d.ts.map +1 -0
  17. package/dist/dogwood/serialize.d.ts +46 -0
  18. package/dist/dogwood/serialize.d.ts.map +1 -0
  19. package/dist/dogwood/temporal.d.ts +259 -0
  20. package/dist/dogwood/temporal.d.ts.map +1 -0
  21. package/dist/dogwood/upstream.d.ts +41 -0
  22. package/dist/dogwood/upstream.d.ts.map +1 -0
  23. package/dist/dogwood/window.d.ts +73 -0
  24. package/dist/dogwood/window.d.ts.map +1 -0
  25. package/dist/index.d.ts +4 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/integrity.json +13 -3
  28. package/dist/lint/audit-catalog.d.ts.map +1 -1
  29. package/dist/lint/post-synth/dogwood-helpers.d.ts +63 -0
  30. package/dist/lint/post-synth/dogwood-helpers.d.ts.map +1 -0
  31. package/dist/lint/post-synth/dwdc010.d.ts +25 -0
  32. package/dist/lint/post-synth/dwdc010.d.ts.map +1 -0
  33. package/dist/lint/post-synth/dwdc011.d.ts +19 -0
  34. package/dist/lint/post-synth/dwdc011.d.ts.map +1 -0
  35. package/dist/lint/post-synth/dwdc012.d.ts +21 -0
  36. package/dist/lint/post-synth/dwdc012.d.ts.map +1 -0
  37. package/dist/lint/post-synth/dwde010.d.ts +32 -0
  38. package/dist/lint/post-synth/dwde010.d.ts.map +1 -0
  39. package/dist/lint/post-synth/dwde011.d.ts +33 -0
  40. package/dist/lint/post-synth/dwde011.d.ts.map +1 -0
  41. package/dist/lint/post-synth/dwds010.d.ts +24 -0
  42. package/dist/lint/post-synth/dwds010.d.ts.map +1 -0
  43. package/dist/lint/post-synth/index.d.ts.map +1 -1
  44. package/dist/manifest.json +1 -1
  45. package/dist/okf/index.md +6 -0
  46. package/dist/okf/rules/DWDC010.md +11 -0
  47. package/dist/okf/rules/DWDC011.md +11 -0
  48. package/dist/okf/rules/DWDC012.md +11 -0
  49. package/dist/okf/rules/DWDE010.md +11 -0
  50. package/dist/okf/rules/DWDE011.md +11 -0
  51. package/dist/okf/rules/DWDS010.md +11 -0
  52. package/dist/policy-text.d.ts +53 -0
  53. package/dist/policy-text.d.ts.map +1 -0
  54. package/dist/rules/dogwood-helpers.ts +139 -0
  55. package/dist/rules/dwdc010.ts +62 -0
  56. package/dist/rules/dwdc011.ts +61 -0
  57. package/dist/rules/dwdc012.ts +46 -0
  58. package/dist/rules/dwde010.ts +130 -0
  59. package/dist/rules/dwde011.ts +108 -0
  60. package/dist/rules/dwds010.ts +46 -0
  61. package/dist/serializer.d.ts +10 -18
  62. package/dist/serializer.d.ts.map +1 -1
  63. package/dist/skills/chant-cedar-authoring.md +180 -0
  64. package/dist/skills/chant-cedar-avp-embedding.md +125 -0
  65. package/dist/skills/chant-cedar-meta-policy.md +119 -0
  66. package/package.json +2 -2
  67. package/src/codegen/package.ts +3 -2
  68. package/src/config.test.ts +12 -0
  69. package/src/config.ts +28 -0
  70. package/src/dogwood/cli.test.ts +392 -0
  71. package/src/dogwood/cli.ts +545 -0
  72. package/src/dogwood/event-schema.test.ts +218 -0
  73. package/src/dogwood/event-schema.ts +318 -0
  74. package/src/dogwood/index.ts +198 -0
  75. package/src/dogwood/macros.test.ts +104 -0
  76. package/src/dogwood/macros.ts +229 -0
  77. package/src/dogwood/policy.test.ts +94 -0
  78. package/src/dogwood/policy.ts +141 -0
  79. package/src/dogwood/scan.ts +287 -0
  80. package/src/dogwood/serialize.test.ts +331 -0
  81. package/src/dogwood/serialize.ts +209 -0
  82. package/src/dogwood/temporal.test.ts +272 -0
  83. package/src/dogwood/temporal.ts +592 -0
  84. package/src/dogwood/testdata/custom-kinds.dwschema +17 -0
  85. package/src/dogwood/testdata/default-macros.dw +23 -0
  86. package/src/dogwood/testdata/lowered-read-after-login.json +13 -0
  87. package/src/dogwood/testdata/max-window-raised.dwschema +25 -0
  88. package/src/dogwood/testdata/pinned.dwschema +31 -0
  89. package/src/dogwood/testdata/read-after-login.cedarschema +20 -0
  90. package/src/dogwood/testdata/read-after-login.dw +17 -0
  91. package/src/dogwood/testdata/temporal-policies.dw +53 -0
  92. package/src/dogwood/upstream.ts +41 -0
  93. package/src/dogwood/window.ts +124 -0
  94. package/src/index.ts +24 -0
  95. package/src/lint/audit-catalog.ts +56 -0
  96. package/src/lint/post-synth/dogwood-helpers.ts +139 -0
  97. package/src/lint/post-synth/dwd-post-synth.test.ts +256 -0
  98. package/src/lint/post-synth/dwdc010.ts +62 -0
  99. package/src/lint/post-synth/dwdc011.ts +61 -0
  100. package/src/lint/post-synth/dwdc012.ts +46 -0
  101. package/src/lint/post-synth/dwde-post-synth.test.ts +368 -0
  102. package/src/lint/post-synth/dwde010.ts +130 -0
  103. package/src/lint/post-synth/dwde011.ts +108 -0
  104. package/src/lint/post-synth/dwds010.ts +46 -0
  105. package/src/lint/post-synth/index.ts +12 -0
  106. package/src/lint/post-synth/post-synth.test.ts +7 -3
  107. package/src/policy-text.ts +128 -0
  108. package/src/serializer.ts +71 -109
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Temporal windows — the one thing dogwood's past-only operators cannot omit.
3
+ *
4
+ * `formerly`, `previous` and `since` all take a mandatory `within <n><unit>`
5
+ * clause; the unit is one of `s`, `m`, `h`, `d` and nothing else. Upstream's
6
+ * `temporal/grammar.pest` spells that out:
7
+ *
8
+ * ```
9
+ * within = { "within" ~ within_payload }
10
+ * within_payload = { param_ref | (integer ~ time_unit) }
11
+ * time_unit = { "s" | "m" | "h" | "d" }
12
+ * ```
13
+ *
14
+ * Typing the window as a value rather than as free text is what makes
15
+ * "a `formerly` without a window" unrepresentable in the builders (#1658's
16
+ * third lint wall) — you cannot call {@link formerly} without one.
17
+ *
18
+ * The `param_ref` arm (`within ?w`) is legal only inside a macro body; it is
19
+ * modelled by {@link MacroWindow} rather than by this type, so an ordinary
20
+ * policy cannot accidentally emit a sigil the expander would reject.
21
+ */
22
+ /** The four units upstream's grammar admits. Anything else does not parse. */
23
+ export type TimeUnit = "s" | "m" | "h" | "d";
24
+ /** A `within` payload: a positive integer and one of the four units. */
25
+ export interface TemporalWindow {
26
+ readonly value: number;
27
+ readonly unit: TimeUnit;
28
+ }
29
+ /**
30
+ * A window as written in a `.dw` file (`"1h"`, `"30m"`, `"7d"`).
31
+ *
32
+ * The template-literal arm means `formerly("1h", …)` type-checks and
33
+ * `formerly("1w", …)` does not, without anyone writing a runtime check first.
34
+ */
35
+ export type WindowLike = TemporalWindow | `${number}${TimeUnit}`;
36
+ /**
37
+ * `within ?w` — a window a macro takes as a parameter.
38
+ *
39
+ * The other arm of upstream's `within_payload`. Legal only inside a macro
40
+ * body; the expander resolves it against the call site's bare interval
41
+ * argument (`once(1h, …)`), which is why the call side has no `within`.
42
+ */
43
+ export interface WindowParam {
44
+ readonly param: string;
45
+ }
46
+ /** Either a concrete window or a macro parameter standing in for one. */
47
+ export type WindowValue = TemporalWindow | WindowParam;
48
+ /** True when the payload is `?w` rather than `1h`. */
49
+ export declare function isWindowParam(value: WindowValue): value is WindowParam;
50
+ /**
51
+ * `within ?w` inside a macro body.
52
+ *
53
+ * Exported from `./macros.ts` too, which is where the sigil rules are
54
+ * documented and where a reader looking for it will be.
55
+ */
56
+ export declare function windowParam(param: string): WindowParam;
57
+ /** Narrow a {@link WindowLike} to the structured form, validating as it goes. */
58
+ export declare function window(value: WindowLike): TemporalWindow;
59
+ /** `1h` — the surface form, in a `within` clause or as a macro-call argument. */
60
+ export declare function renderWindow(value: WindowLike): string;
61
+ /** A `within` payload: `1h`, or the `?w` a macro body defers to its call site. */
62
+ export declare function renderWindowValue(value: WindowValue): string;
63
+ /** Narrow a window argument, letting a `?w` parameter through unchanged. */
64
+ export declare function windowValue(value: WindowLike | WindowParam): WindowValue;
65
+ /** The window in seconds, so `90m` and `1h` are comparable to a `max_window`. */
66
+ export declare function windowSeconds(value: WindowLike): number;
67
+ /**
68
+ * Upstream's fallback cap. `ServiceSchema::defaults()` and an event schema
69
+ * with no `max_window` directive both look back at most 24 hours, per the
70
+ * comment atop `event_schema/grammar.pest` ("absent → a 24h default").
71
+ */
72
+ export declare const DEFAULT_MAX_WINDOW: TemporalWindow;
73
+ //# sourceMappingURL=window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/dogwood/window.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE7C,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,GAAG,MAAM,GAAG,QAAQ,EAAE,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,yEAAyE;AACzE,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,WAAW,CAAC;AAKvD,sDAAsD;AACtD,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,IAAI,WAAW,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAKtD;AAKD,iFAAiF;AACjF,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,CAgBxD;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGtD;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE5D;AAED,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,CAExE;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGvD;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,cAAyC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -18,6 +18,10 @@ export { CedarGenerator, loadActionConstants, sanitizeName, CEDAR_PACKAGE } from
18
18
  export type { CedarGenerateOptions, CedarGenerateResult } from "./import/generator.js";
19
19
  export { CedarTemplateParser, CedarTemplateGenerator } from "./import/adapter.js";
20
20
  export { detectTemplate } from "./detect.js";
21
+ export * as dogwood from "./dogwood/index.js";
22
+ export { DOGWOOD_EVENT_SCHEMA_FILENAME, DOGWOOD_EVENT_SCHEMA_TYPE, DOGWOOD_MACRO_FILENAME, DOGWOOD_MACRO_LIBRARY_TYPE, DOGWOOD_POLICY_FILENAME, DOGWOOD_POLICY_TYPE, TemporalEventSchema, TemporalMacroLibrary, TemporalPolicy, } from "./dogwood/policy.js";
23
+ export type { EventSchemaProps, MacroLibraryProps, TemporalPolicyProps } from "./dogwood/policy.js";
24
+ export { DOGWOOD_UPSTREAM } from "./dogwood/upstream.js";
21
25
  export { rules as cedarLintRules } from "./lint/rules/index.js";
22
26
  export { packageLexicon } from "./codegen/package.js";
23
27
  export type { PackageOptions, PackageResult } from "./codegen/package.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIjG,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,YAAY,EAAE,kBAAkB,EAAE,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AM,uBAAuB,CAAC;AACpF,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,cAAc,mBAAmB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "a3b6314f19c537ad8c8bcc2953e4a944540fb2cbf364b7bacb00e9725a2363f0",
4
+ "manifest.json": "a31995290dbdfa02707ab4fb8aa614bc83ec443cbf7860221138f2335192f9bd",
5
5
  "meta.json": "b218779260169a193882aeee76e5ac559588f1682657a001fb0982cffb5843fc",
6
6
  "types/index.d.ts": "9e53a1cb3c9ee38f9de2f3c0db9cc28a0b67c3649be410c341e2451b9b0076cd",
7
7
  "rules/policy-shape.ts": "1654730d188b7163dbad3051c75a562198a96eda6d36ce35701f2b729bf45194",
@@ -16,7 +16,17 @@
16
16
  "rules/ceds010.ts": "215e14de2b84d935ad9551d37c3c06374e5452a5b3f1d7408dc59cd8c2ef1b33",
17
17
  "rules/ceds011.ts": "07984e364b431203a34b42de481fad4fc16d2b838f3fa358726759f4a3ebbfe5",
18
18
  "rules/ceds012.ts": "a447c6114d36abf2eca6f90143b06c4b20ede111c777cb04c70024fc4ad93172",
19
- "rules/wasm-helpers.ts": "c4c3def1669a1818d19ff1864e78bdcbf956da31ca1a6adde7751830765dad6a"
19
+ "rules/dogwood-helpers.ts": "7f24a385396255ccfdf85b3e493a48b4d7d3d191a28e0ff0341a5dd47b8cff2c",
20
+ "rules/dwdc010.ts": "0c619de07981b4b11bfa425bf4032142af1f90f255d3058a71551956124123f2",
21
+ "rules/dwdc011.ts": "88919f0d7460993b58e1883d0bfd48f6a8c8f4bc2d22c71902f9b0ee7b9edd07",
22
+ "rules/dwdc012.ts": "15434083488c5e617835e0ac3027cf92657c734076463abd526332f460cc7e8d",
23
+ "rules/dwde010.ts": "b39ecb0427fc19d9548a26dcd2b9e99d4eab289f57196da24374743c85553fb1",
24
+ "rules/dwde011.ts": "5e7f7dbcd9c581bba614fd5c17dcf1282a0b59caef931997c954cea46522251c",
25
+ "rules/dwds010.ts": "4939f7eb012998d7e27238db777ed7fec2721c2e25df0daec457ff2c62bfa648",
26
+ "rules/wasm-helpers.ts": "c4c3def1669a1818d19ff1864e78bdcbf956da31ca1a6adde7751830765dad6a",
27
+ "skills/chant-cedar-authoring.md": "1b036a72ef13342d402d0de1a68bec0a6f32365ab8485b95f63a971277fd249f",
28
+ "skills/chant-cedar-avp-embedding.md": "1096cc318374dc0683fae289040b089ffc0c7fa029c6b07d4acc19ebcd118b54",
29
+ "skills/chant-cedar-meta-policy.md": "050b310a87196a48c827f1129698e4c6bbcd96dc963782e22bf1a640bbc20a1a"
20
30
  },
21
- "composite": "050414f43e9bfd30e46d4249e5493401c0dcbb7de270eb28980dbf7ec83ea9b7"
31
+ "composite": "82bb53355858c8565563d0daf80a5357904c0d4d0152ea0b64c3310805cee16a"
22
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAoGtD,CAAC"}
1
+ {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA4JtD,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Turning a build's emitted files into `dogwood` CLI invocations (#1659).
3
+ *
4
+ * The DWDE checks both need the same thing: which of the emitted `.dw` files
5
+ * is a policy set, which is a macro library, which `.cedarschema` backs
6
+ * `--policy-schema`, and which `.dwschema` backs `--event-schema`. Planning
7
+ * that once here keeps the two checks from disagreeing about what they ran —
8
+ * DWDE010 validates a bundle and DWDE011 lowers the *same* bundle, and a
9
+ * finding from one that names different inputs than the other would be a
10
+ * puzzle rather than a report.
11
+ *
12
+ * Excluded from check auto-discovery by the "helper" filename filter.
13
+ */
14
+ import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
15
+ import type { DogwoodBundle } from "../../dogwood/cli.js";
16
+ /** One planned invocation: the files, and the names to blame in a finding. */
17
+ export interface PreparedBundle {
18
+ lexicon: string;
19
+ /** The `.dw` policy set filename. */
20
+ source: string;
21
+ /** The `.cedarschema` filename passed as `--policy-schema`. */
22
+ policySchemaSource: string;
23
+ /** The `.dwschema` filename passed as `--event-schema`, when one was emitted. */
24
+ eventSchemaSource?: string;
25
+ bundle: DogwoodBundle;
26
+ }
27
+ /** What the CLI-gated checks should do with this build. */
28
+ export interface DogwoodRunPlan {
29
+ /** True when the build emitted a `.dw` policy set at all. */
30
+ hasPolicies: boolean;
31
+ /** Every invocation to make. Empty when {@link blocked} is set. */
32
+ bundles: PreparedBundle[];
33
+ /** Why nothing can be run, when policies exist but a required input does not. */
34
+ blocked?: string;
35
+ /** The lexicon the `.dw` output came from, for a finding that names no file. */
36
+ lexicon?: string;
37
+ }
38
+ /**
39
+ * A `.dw` file holding only `def` declarations is a macro library, not a
40
+ * policy set.
41
+ *
42
+ * By structure rather than by filename: the serializer's default is
43
+ * `macros.dw`, but `MacroLibraryProps.filename` overrides it, and `chant
44
+ * audit` runs over trees chant never wrote. A policy set is a file with a
45
+ * `permit` or `forbid` head in it — upstream's policy grammar has no third
46
+ * effect — and a set with inlined macros still has one.
47
+ */
48
+ export declare function looksLikeMacroLibrary(text: string): boolean;
49
+ /**
50
+ * Plan every `dogwood` invocation this build calls for.
51
+ *
52
+ * One bundle per policy set per emitted event schema. A build with several
53
+ * `.dwschema` files means several services, and `--event-schema` takes exactly
54
+ * one file, so the set is run against each and every finding names the schema
55
+ * it was found under — the alternative is picking one silently and reporting
56
+ * against a schema the reader did not choose. Macro libraries do combine: a
57
+ * library is a sequence of `def`s, so several concatenate into the one file
58
+ * `--macros` accepts.
59
+ */
60
+ export declare function planDogwoodRuns(ctx: PostSynthContext): DogwoodRunPlan;
61
+ /** How a finding names the inputs a run was made with. */
62
+ export declare function describeBundle(prepared: PreparedBundle): string;
63
+ //# sourceMappingURL=dogwood-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dogwood-helpers.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/dogwood-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,2DAA2D;AAC3D,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,WAAW,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AA0BD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,GAAG,cAAc,CAyCrE;AAED,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAI/D"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * DWDC010: a temporal predicate must name an event kind the schema declares
3
+ *
4
+ * Upstream rejects this outright — a predicate naming an undeclared kind fails
5
+ * `dogwood validate` with code `extension`: "predicate
6
+ * `Drupe::Action::\"Read\"::nosuchkind` does not name a declared event (no
7
+ * event kind `nosuchkind` derived for action `Read`)". Catching it in
8
+ * TypeScript is the point of the split epic #1646 drew: everything answerable
9
+ * without the binary runs always and gates, and this one is answerable.
10
+ *
11
+ * The check is on the event *kind*, not the action, and that is not a
12
+ * shortcut. Upstream's `.dwschema` grammar declares events against a symbolic
13
+ * action binder — `decision event <A>::request { … }` — so the file names no
14
+ * actions at all and cannot be asked whether one exists. The action half of
15
+ * that upstream error comes from the Cedar action schema
16
+ * (`--policy-schema`), which is #1659's CLI-gated leg.
17
+ *
18
+ * Silent when no `.dwschema` was emitted: with none supplied,
19
+ * `ServiceSchema::defaults()` decides the kinds at the far end, and guessing
20
+ * that a project's out-of-band schema matches upstream's default would fail
21
+ * builds for a policy set that is fine.
22
+ */
23
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
24
+ export declare const dwdc010: PostSynthCheck;
25
+ //# sourceMappingURL=dwdc010.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dwdc010.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/dwdc010.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAoCrB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * DWDC011: a temporal window must fit inside the schema's `max_window`
3
+ *
4
+ * `formerly within 48h` under a 24h cap is an upstream validation error —
5
+ * "temporal window `48h` exceeds the maximum allowed window `24h` set by the
6
+ * event schema's `max_window`" — and it is arithmetic, so it needs no binary.
7
+ *
8
+ * Unlike DWDC010 this fires with no `.dwschema` emitted, because the cap
9
+ * applies either way: `ServiceSchema::defaults()` caps look-back at 24h, and
10
+ * so does an emitted schema that omits the directive. Where several schemas
11
+ * are emitted the tightest cap wins — a window one consumer accepts and
12
+ * another rejects is still a window that will be rejected.
13
+ *
14
+ * Macro-call intervals count. `once(48h, …)` expands to `formerly within 48h`
15
+ * through the default library's `within ?w`, so it looks back exactly as far.
16
+ */
17
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
18
+ export declare const dwdc011: PostSynthCheck;
19
+ //# sourceMappingURL=dwdc011.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dwdc011.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/dwdc011.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAS9G,eAAO,MAAM,OAAO,EAAE,cAmCrB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * DWDC012: `formerly`, `previous` and `since` carry a mandatory window
3
+ *
4
+ * Upstream's grammar makes `within` non-optional on all three:
5
+ *
6
+ * ```
7
+ * once_op = { "formerly" ~ within ~ atom }
8
+ * previous_op = { "previous" ~ within ~ atom }
9
+ * conjunct_or_since = { neg_conjunct ~ ("since" ~ within ~ atom)? }
10
+ * ```
11
+ *
12
+ * The typed builders make this unrepresentable — `formerly(window, body)` has
13
+ * nowhere to put a missing window — which is most of the fix. This check is
14
+ * the other part: `raw()` exists as an escape hatch, a hand-written `.dw` can
15
+ * be built by any other tool, and `chant audit` runs over files chant never
16
+ * emitted. A wall that only holds for the path that cannot breach it is not
17
+ * a wall.
18
+ */
19
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
20
+ export declare const dwdc012: PostSynthCheck;
21
+ //# sourceMappingURL=dwdc012.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dwdc012.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/dwdc012.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAwBrB,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * DWDE010: the emitted `.dw` set validates clean under `dogwood validate`
3
+ *
4
+ * The CLI-gated half of the epic's validation split. Everything the DWDC walls
5
+ * ask is answerable in TypeScript and gates unconditionally; everything else —
6
+ * macro expansion, the temporal type checker, the Cedar body checked against
7
+ * the action schema *through upstream's own frontend* — needs upstream's Rust
8
+ * frontend, which ships as a binary and nothing else. No npm package, no wasm
9
+ * build, no bindings.
10
+ *
11
+ * So this check has two modes and says which one it is in:
12
+ *
13
+ * - **Binary present.** Runs `dogwood validate --format json` over each
14
+ * emitted policy set and reports every finding as an error. Byte-offset
15
+ * labels come through as byte offsets — see `../../dogwood/cli.ts` for why
16
+ * they are not converted to line/column.
17
+ * - **Binary absent.** Exactly one `info` finding naming the binary, where
18
+ * chant looked, and this issue. The epic's words are "an explicit,
19
+ * issue-linked exception, not a silent one" — a check that quietly passes
20
+ * when it could not run is claiming a guarantee it did not make, which is
21
+ * the same failure CEDE010's no-schema advisory exists to avoid.
22
+ *
23
+ * A run that could not be made at all — a spawn failure, an unknown flag, JSON
24
+ * in a shape this adapter does not know — is `warning`, not `error`. Upstream
25
+ * is a read-only squash-sync mirror with no tags and no changelog, and a flag
26
+ * rename in a sync would otherwise fail every build that has the binary
27
+ * installed. The adapter never reads exit 2 as "rejected" on its own for the
28
+ * same reason: clap spends that code on usage errors too.
29
+ */
30
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
31
+ export declare const dwde010: PostSynthCheck;
32
+ //# sourceMappingURL=dwde010.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dwde010.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/dwde010.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAU9G,eAAO,MAAM,OAAO,EAAE,cA0FrB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * DWDE011: the lowered Cedar body validates clean under Cedar's own validator
3
+ *
4
+ * The epic's stated design for the non-temporal half: chant does not
5
+ * re-implement lowering — `dogwood lower` produces the analyzable plain-Cedar
6
+ * form, and a reimplementation would drift — but once that form exists, Cedar's
7
+ * own validator is the thing that judges it. The #1657 verification put all 86
8
+ * upstream example bundles through this exact path and every one parsed and
9
+ * validated clean in strict mode, which is what makes a finding here mean
10
+ * something: the lowered output is genuinely plain Cedar, so a validation error
11
+ * is the policy's, not the pipeline's.
12
+ *
13
+ * What this catches that DWDE010 does not is narrow but real. `dogwood
14
+ * validate` type-checks through upstream's vendored Cedar; this runs the
15
+ * *published* `@cedar-policy/cedar-wasm` over the same artifacts. A body that
16
+ * upstream's pinned Cedar accepts and the Cedar the rest of chant validates
17
+ * against rejects is exactly the drift the pin exists to make visible — and the
18
+ * augmented schema, with its hoisted `context.*` temporal slots, is the form a
19
+ * downstream Cedar policy store will actually receive.
20
+ *
21
+ * The cedar-wasm traps from #1648 all apply and are handled in
22
+ * `./wasm-helpers.ts`: `type: "success"` means validation *ran*, not that it
23
+ * passed; `validationErrors` comes back in a different order almost every call
24
+ * and is sorted before anything reads it; a malformed call throws rather than
25
+ * returning a failure answer.
26
+ *
27
+ * Silent when `lower` did not run — the binary is absent, or no action schema
28
+ * was emitted. Both cases are DWDE010's advisory to report, once, rather than
29
+ * twice in different words.
30
+ */
31
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
32
+ export declare const dwde011: PostSynthCheck;
33
+ //# sourceMappingURL=dwde011.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dwde011.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/dwde011.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAK9G,eAAO,MAAM,OAAO,EAAE,cAwErB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * DWDS010: an emitted event schema with no pinned field widens every predicate
3
+ *
4
+ * The #1657 verification is specific about this one. `ServiceSchema::defaults()`
5
+ * — what runs when nobody passes `--event-schema` — uses
6
+ * `configuration/event-schemas/pinned.dwschema`, which carries
7
+ * `pin callerPrincipal: principalType(A) = principal` on every kind. Every
8
+ * temporal predicate is therefore correlated to the deciding request's
9
+ * principal, and events from other principals are invisible.
10
+ *
11
+ * Supplying any event schema opts out of that default wholesale. So a schema
12
+ * emitted without a pin does not merely "not add" a correlation: it removes
13
+ * one the policy author very likely assumed, and every `formerly` in the set
14
+ * starts matching other principals' events. That is a legitimate design —
15
+ * cross-principal correlation is the reason to write your own schema — but it
16
+ * is a decision, and a decision nobody can see in a diff is one nobody made.
17
+ *
18
+ * Report-only: chant does not know which the author wanted, only that it
19
+ * should be said out loud. `defaultEventSchema({ pinCallerPrincipal: false })`
20
+ * also stamps the reasoning into the emitted file.
21
+ */
22
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
23
+ export declare const dwds010: PostSynthCheck;
24
+ //# sourceMappingURL=dwds010.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dwds010.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/dwds010.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,OAAO,EAAE,cAqBrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAYvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAW3C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAkBvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAiB3C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cedar",
3
- "version": "0.44.8",
3
+ "version": "0.44.9",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Cedar",
6
6
  "intrinsics": [],
package/dist/okf/index.md CHANGED
@@ -35,3 +35,9 @@ okf_version: '0.2'
35
35
  * [CEDS010](/rules/CEDS010.md) - A bare permit(principal, action, resource) with no scope constraints and no conditions grants everything
36
36
  * [CEDS011](/rules/CEDS011.md) - A policy set built entirely from permits carries no forbid to bound them
37
37
  * [CEDS012](/rules/CEDS012.md) - A permit that leaves the action scope unconstrained grants every action, including future ones
38
+ * [DWDC010](/rules/DWDC010.md) - A dogwood temporal predicate names an event kind the emitted .dwschema declares
39
+ * [DWDC011](/rules/DWDC011.md) - A dogwood temporal window stays inside the event schema's max_window cap
40
+ * [DWDC012](/rules/DWDC012.md) - A dogwood formerly/previous/since operator carries its mandatory within window
41
+ * [DWDE010](/rules/DWDE010.md) - Emitted dogwood policy sets validate clean under `dogwood validate`, when the binary is available
42
+ * [DWDE011](/rules/DWDE011.md) - The Cedar `dogwood lower` produces validates clean against the augmented schema (cedar-wasm validate)
43
+ * [DWDS010](/rules/DWDS010.md) - An emitted dogwood event schema pins its temporal predicates to a request-side value
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: DWDC010
4
+ description: A dogwood temporal predicate names an event kind the emitted .dwschema declares
5
+ id: DWDC010
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: cedar
9
+ docs: https://intentius.io/chant/lexicons/cedar/rules/
10
+ ---
11
+ A dogwood temporal predicate names an event kind the emitted .dwschema declares
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: DWDC011
4
+ description: A dogwood temporal window stays inside the event schema's max_window cap
5
+ id: DWDC011
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: cedar
9
+ docs: https://intentius.io/chant/lexicons/cedar/rules/
10
+ ---
11
+ A dogwood temporal window stays inside the event schema's max_window cap
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: DWDC012
4
+ description: A dogwood formerly/previous/since operator carries its mandatory within window
5
+ id: DWDC012
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: cedar
9
+ docs: https://intentius.io/chant/lexicons/cedar/rules/
10
+ ---
11
+ A dogwood formerly/previous/since operator carries its mandatory within window
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: DWDE010
4
+ description: Emitted dogwood policy sets validate clean under `dogwood validate`, when the binary is available
5
+ id: DWDE010
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: cedar
9
+ docs: https://intentius.io/chant/lexicons/cedar/rules/
10
+ ---
11
+ Emitted dogwood policy sets validate clean under `dogwood validate`, when the binary is available
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: DWDE011
4
+ description: The Cedar `dogwood lower` produces validates clean against the augmented schema (cedar-wasm validate)
5
+ id: DWDE011
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: cedar
9
+ docs: https://intentius.io/chant/lexicons/cedar/rules/
10
+ ---
11
+ The Cedar `dogwood lower` produces validates clean against the augmented schema (cedar-wasm validate)
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: DWDS010
4
+ description: An emitted dogwood event schema pins its temporal predicates to a request-side value
5
+ id: DWDS010
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: cedar
9
+ docs: https://intentius.io/chant/lexicons/cedar/rules/
10
+ ---
11
+ An emitted dogwood event schema pins its temporal predicates to a request-side value
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Cedar policy-text rendering, shared by the `.cedar` serializer, the AVP
3
+ * statement renderer, and the dogwood dialect's `.dw` leg.
4
+ *
5
+ * Upstream's dogwood policy grammar is Cedar's shape — `annotation* effect
6
+ * "(" scope ")" cond* ";"` — and only the `cond` rule differs, gaining
7
+ * `guardrails { … }` and `temporal { … }` forms. So everything above the first
8
+ * clause is common, and it lives here rather than being copied into
9
+ * `./dogwood/serialize.ts`, where a change to how a scope constraint is
10
+ * written would have had to be made twice.
11
+ *
12
+ * `resolvePolicyId` is here for the same reason it was extracted from
13
+ * `serialize()` by #1652: it is the only rule linking a chant entity to a
14
+ * policy id, the AVP observation matches against it, and the `.dw` leg has to
15
+ * derive ids the same way the `.cedar` leg does. One copy, three callers.
16
+ *
17
+ * This module is a leaf on purpose: `./serializer.ts` and `./dogwood/*` both
18
+ * import it, and neither imports the other's rendering.
19
+ */
20
+ import type { Declarable } from "@intentius/chant/declarable";
21
+ /** A plain object — not null, not an array. */
22
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
23
+ /** The `props` of a resource-kind Declarable, or `{}` for anything else. */
24
+ export declare function getProps(entity: Declarable): Record<string, unknown>;
25
+ /** Escape a string for a double-quoted Cedar literal. */
26
+ export declare function escapeCedarString(value: string): string;
27
+ /**
28
+ * Derive a policy id from a logical name: `allowAdminRead` → `allow-admin-read`.
29
+ * Cedar ids are free-form strings; kebab-case keeps them readable in the
30
+ * `@id` annotation and stable across a rename-free refactor.
31
+ */
32
+ export declare function policyIdFromLogicalName(name: string): string;
33
+ /**
34
+ * The Cedar id for a policy: an explicit `annotations.id` when the author gave
35
+ * one, else derived from the logical name.
36
+ *
37
+ * This is the only rule that links a chant entity to a policy in a live AVP
38
+ * store (#1652) — the observation resolves the same id from the same props and
39
+ * matches it against the `@id` annotation the statement carries — and it is
40
+ * also what gives a `.dw` policy the id its `.cedar` sibling would have had.
41
+ * Two copies of this rule would be a mapping that drifts silently.
42
+ */
43
+ export declare function resolvePolicyId(logicalName: string, props: Record<string, unknown>): string;
44
+ /** `principal`, `principal == User::"alice"`, `action in [ … ]`, `resource is Photo`. */
45
+ export declare function renderScope(variable: string, scope: unknown): string;
46
+ /** A `when`/`unless` prop as a list of clause bodies — one string, or several. */
47
+ export declare function conditionStrings(value: unknown): string[];
48
+ /**
49
+ * Everything above the first clause: the annotations, the effect, and the
50
+ * three scope positions.
51
+ */
52
+ export declare function renderPolicyHead(id: string, props: Record<string, unknown>): string[];
53
+ //# sourceMappingURL=policy-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy-text.d.ts","sourceRoot":"","sources":["../src/policy-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG9D,+CAA+C;AAC/C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKpE;AAED,yDAAyD;AACzD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAK3F;AAMD,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAcpE;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAIzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAmBrF"}