@smthrs/plan 0.0.0-stage → 1.0.0-rc.4

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 (199) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/LICENSE +21 -0
  3. package/README.md +228 -2
  4. package/dist/cjs/CachePolicy.d.ts +131 -0
  5. package/dist/cjs/CachePolicy.d.ts.map +1 -0
  6. package/dist/cjs/CachePolicy.js +50 -0
  7. package/dist/cjs/CachePolicy.js.map +7 -0
  8. package/dist/cjs/Effects.d.ts +240 -0
  9. package/dist/cjs/Effects.d.ts.map +1 -0
  10. package/dist/cjs/Effects.js +76 -0
  11. package/dist/cjs/Effects.js.map +7 -0
  12. package/dist/cjs/FileSet.d.ts +288 -0
  13. package/dist/cjs/FileSet.d.ts.map +1 -0
  14. package/dist/cjs/FileSet.js +191 -0
  15. package/dist/cjs/FileSet.js.map +7 -0
  16. package/dist/cjs/GraphBuildError.d.ts +122 -0
  17. package/dist/cjs/GraphBuildError.d.ts.map +1 -0
  18. package/dist/cjs/GraphBuildError.js +71 -0
  19. package/dist/cjs/GraphBuildError.js.map +7 -0
  20. package/dist/cjs/KeyMaterial.d.ts +102 -0
  21. package/dist/cjs/KeyMaterial.d.ts.map +1 -0
  22. package/dist/cjs/KeyMaterial.js +64 -0
  23. package/dist/cjs/KeyMaterial.js.map +7 -0
  24. package/dist/cjs/Node.d.ts +606 -0
  25. package/dist/cjs/Node.d.ts.map +1 -0
  26. package/dist/cjs/Node.js +207 -0
  27. package/dist/cjs/Node.js.map +7 -0
  28. package/dist/cjs/Placement.d.ts +117 -0
  29. package/dist/cjs/Placement.d.ts.map +1 -0
  30. package/dist/cjs/Placement.js +46 -0
  31. package/dist/cjs/Placement.js.map +7 -0
  32. package/dist/cjs/Plan.d.ts +440 -0
  33. package/dist/cjs/Plan.d.ts.map +1 -0
  34. package/dist/cjs/Plan.js +508 -0
  35. package/dist/cjs/Plan.js.map +7 -0
  36. package/dist/cjs/PlanDiff.d.ts +58 -0
  37. package/dist/cjs/PlanDiff.d.ts.map +1 -0
  38. package/dist/cjs/PlanDiff.js +124 -0
  39. package/dist/cjs/PlanDiff.js.map +7 -0
  40. package/dist/cjs/Planned.d.ts +121 -0
  41. package/dist/cjs/Planned.d.ts.map +1 -0
  42. package/dist/cjs/Planned.js +72 -0
  43. package/dist/cjs/Planned.js.map +7 -0
  44. package/dist/cjs/Repetition.d.ts +31 -0
  45. package/dist/cjs/Repetition.d.ts.map +1 -0
  46. package/dist/cjs/Repetition.js +36 -0
  47. package/dist/cjs/Repetition.js.map +7 -0
  48. package/dist/cjs/Scheduling.d.ts +89 -0
  49. package/dist/cjs/Scheduling.d.ts.map +1 -0
  50. package/dist/cjs/Scheduling.js +76 -0
  51. package/dist/cjs/Scheduling.js.map +7 -0
  52. package/dist/cjs/StepKey.d.ts +333 -0
  53. package/dist/cjs/StepKey.d.ts.map +1 -0
  54. package/dist/cjs/StepKey.js +311 -0
  55. package/dist/cjs/StepKey.js.map +7 -0
  56. package/dist/cjs/index.d.ts +91 -0
  57. package/dist/cjs/index.d.ts.map +1 -0
  58. package/dist/cjs/index.js +59 -0
  59. package/dist/cjs/index.js.map +7 -0
  60. package/dist/cjs/internal/ConflictAnnotation.d.ts +59 -0
  61. package/dist/cjs/internal/ConflictAnnotation.d.ts.map +1 -0
  62. package/dist/cjs/internal/ConflictAnnotation.js +247 -0
  63. package/dist/cjs/internal/ConflictAnnotation.js.map +7 -0
  64. package/dist/cjs/internal/EffectCandidates.d.ts +19 -0
  65. package/dist/cjs/internal/EffectCandidates.d.ts.map +1 -0
  66. package/dist/cjs/internal/EffectCandidates.js +92 -0
  67. package/dist/cjs/internal/EffectCandidates.js.map +7 -0
  68. package/dist/cjs/internal/JsonMirror.d.ts +34 -0
  69. package/dist/cjs/internal/JsonMirror.d.ts.map +1 -0
  70. package/dist/cjs/internal/JsonMirror.js +195 -0
  71. package/dist/cjs/internal/JsonMirror.js.map +7 -0
  72. package/dist/cjs/internal/effects.d.ts +245 -0
  73. package/dist/cjs/internal/effects.d.ts.map +1 -0
  74. package/dist/cjs/internal/effects.js +290 -0
  75. package/dist/cjs/internal/effects.js.map +7 -0
  76. package/dist/cjs/internal/node.d.ts +526 -0
  77. package/dist/cjs/internal/node.d.ts.map +1 -0
  78. package/dist/cjs/internal/node.js +312 -0
  79. package/dist/cjs/internal/node.js.map +7 -0
  80. package/dist/cjs/package.json +1 -0
  81. package/dist/cjs/test/PlanFixtures.d.ts +127 -0
  82. package/dist/cjs/test/PlanFixtures.d.ts.map +1 -0
  83. package/dist/cjs/test/PlanFixtures.js +59 -0
  84. package/dist/cjs/test/PlanFixtures.js.map +7 -0
  85. package/dist/esm/CachePolicy.d.ts +131 -0
  86. package/dist/esm/CachePolicy.d.ts.map +1 -0
  87. package/dist/esm/CachePolicy.js +117 -0
  88. package/dist/esm/CachePolicy.js.map +1 -0
  89. package/dist/esm/Effects.d.ts +240 -0
  90. package/dist/esm/Effects.d.ts.map +1 -0
  91. package/dist/esm/Effects.js +167 -0
  92. package/dist/esm/Effects.js.map +1 -0
  93. package/dist/esm/FileSet.d.ts +288 -0
  94. package/dist/esm/FileSet.d.ts.map +1 -0
  95. package/dist/esm/FileSet.js +324 -0
  96. package/dist/esm/FileSet.js.map +1 -0
  97. package/dist/esm/GraphBuildError.d.ts +122 -0
  98. package/dist/esm/GraphBuildError.d.ts.map +1 -0
  99. package/dist/esm/GraphBuildError.js +146 -0
  100. package/dist/esm/GraphBuildError.js.map +1 -0
  101. package/dist/esm/KeyMaterial.d.ts +102 -0
  102. package/dist/esm/KeyMaterial.d.ts.map +1 -0
  103. package/dist/esm/KeyMaterial.js +85 -0
  104. package/dist/esm/KeyMaterial.js.map +1 -0
  105. package/dist/esm/Node.d.ts +606 -0
  106. package/dist/esm/Node.d.ts.map +1 -0
  107. package/dist/esm/Node.js +521 -0
  108. package/dist/esm/Node.js.map +1 -0
  109. package/dist/esm/Placement.d.ts +117 -0
  110. package/dist/esm/Placement.d.ts.map +1 -0
  111. package/dist/esm/Placement.js +65 -0
  112. package/dist/esm/Placement.js.map +1 -0
  113. package/dist/esm/Plan.d.ts +440 -0
  114. package/dist/esm/Plan.d.ts.map +1 -0
  115. package/dist/esm/Plan.js +673 -0
  116. package/dist/esm/Plan.js.map +1 -0
  117. package/dist/esm/PlanDiff.d.ts +58 -0
  118. package/dist/esm/PlanDiff.d.ts.map +1 -0
  119. package/dist/esm/PlanDiff.js +159 -0
  120. package/dist/esm/PlanDiff.js.map +1 -0
  121. package/dist/esm/Planned.d.ts +121 -0
  122. package/dist/esm/Planned.d.ts.map +1 -0
  123. package/dist/esm/Planned.js +147 -0
  124. package/dist/esm/Planned.js.map +1 -0
  125. package/dist/esm/Repetition.d.ts +31 -0
  126. package/dist/esm/Repetition.d.ts.map +1 -0
  127. package/dist/esm/Repetition.js +24 -0
  128. package/dist/esm/Repetition.js.map +1 -0
  129. package/dist/esm/Scheduling.d.ts +89 -0
  130. package/dist/esm/Scheduling.d.ts.map +1 -0
  131. package/dist/esm/Scheduling.js +82 -0
  132. package/dist/esm/Scheduling.js.map +1 -0
  133. package/dist/esm/StepKey.d.ts +333 -0
  134. package/dist/esm/StepKey.d.ts.map +1 -0
  135. package/dist/esm/StepKey.js +478 -0
  136. package/dist/esm/StepKey.js.map +1 -0
  137. package/dist/esm/index.d.ts +91 -0
  138. package/dist/esm/index.d.ts.map +1 -0
  139. package/dist/esm/index.js +91 -0
  140. package/dist/esm/index.js.map +1 -0
  141. package/dist/esm/internal/ConflictAnnotation.d.ts +59 -0
  142. package/dist/esm/internal/ConflictAnnotation.d.ts.map +1 -0
  143. package/dist/esm/internal/ConflictAnnotation.js +332 -0
  144. package/dist/esm/internal/ConflictAnnotation.js.map +1 -0
  145. package/dist/esm/internal/EffectCandidates.d.ts +19 -0
  146. package/dist/esm/internal/EffectCandidates.d.ts.map +1 -0
  147. package/dist/esm/internal/EffectCandidates.js +86 -0
  148. package/dist/esm/internal/EffectCandidates.js.map +1 -0
  149. package/dist/esm/internal/JsonMirror.d.ts +34 -0
  150. package/dist/esm/internal/JsonMirror.d.ts.map +1 -0
  151. package/dist/esm/internal/JsonMirror.js +204 -0
  152. package/dist/esm/internal/JsonMirror.js.map +1 -0
  153. package/dist/esm/internal/effects.d.ts +245 -0
  154. package/dist/esm/internal/effects.d.ts.map +1 -0
  155. package/dist/esm/internal/effects.js +459 -0
  156. package/dist/esm/internal/effects.js.map +1 -0
  157. package/dist/esm/internal/node.d.ts +526 -0
  158. package/dist/esm/internal/node.d.ts.map +1 -0
  159. package/dist/esm/internal/node.js +564 -0
  160. package/dist/esm/internal/node.js.map +1 -0
  161. package/dist/esm/test/PlanFixtures.d.ts +127 -0
  162. package/dist/esm/test/PlanFixtures.d.ts.map +1 -0
  163. package/dist/esm/test/PlanFixtures.js +60 -0
  164. package/dist/esm/test/PlanFixtures.js.map +1 -0
  165. package/docs/README.md +165 -0
  166. package/docs/api.md +1475 -0
  167. package/docs/concepts/authoring-ast.md +203 -0
  168. package/docs/concepts/effects-and-conflicts.md +135 -0
  169. package/docs/concepts/plan-value.md +168 -0
  170. package/docs/concepts/step-keys.md +179 -0
  171. package/docs/guides/author-a-node-graph.md +182 -0
  172. package/docs/guides/compile-a-plan.md +146 -0
  173. package/docs/guides/declare-file-effects.md +143 -0
  174. package/docs/guides/diff-two-plans.md +101 -0
  175. package/docs/installation.md +71 -0
  176. package/docs/quickstart.md +128 -0
  177. package/docs/testing.md +73 -0
  178. package/docs/troubleshooting.md +314 -0
  179. package/package.json +254 -3
  180. package/src/CachePolicy.ts +143 -0
  181. package/src/Effects.ts +284 -0
  182. package/src/FileSet.ts +411 -0
  183. package/src/GraphBuildError.ts +158 -0
  184. package/src/KeyMaterial.ts +106 -0
  185. package/src/Node.ts +871 -0
  186. package/src/Placement.ts +99 -0
  187. package/src/Plan.ts +868 -0
  188. package/src/PlanDiff.ts +199 -0
  189. package/src/Planned.ts +208 -0
  190. package/src/Repetition.ts +33 -0
  191. package/src/Scheduling.ts +154 -0
  192. package/src/StepKey.ts +710 -0
  193. package/src/index.ts +103 -0
  194. package/src/internal/ConflictAnnotation.ts +374 -0
  195. package/src/internal/EffectCandidates.ts +89 -0
  196. package/src/internal/JsonMirror.ts +255 -0
  197. package/src/internal/effects.ts +543 -0
  198. package/src/internal/node.ts +858 -0
  199. package/src/test/PlanFixtures.ts +76 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSet.js","sourceRoot":"","sources":["../../src/FileSet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;AAUjE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAE9F;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAE9F;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAChD,MAAM,CAAC,UAAU,CACf,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,qEAAqE,EAChH,EAAE,KAAK,EAAE,0BAA0B,EAAE,CACtC,CACF,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAW,EAAE;IAC5D,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,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C;QAAE,OAAO,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACpF,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACpF,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAC9C,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACvF,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,cAAc,CAAC,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACvF,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IACzE,CAAC;IACD,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IACtD,iFAAiF;IACjF,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACvE,0EAA0E;IAC1E,OAAO,IAAI,CAAA;AACb,CAAC,CAAA","sourcesContent":["/**\n * Static filesystem declaration vocabulary shared by planning and execution.\n *\n * Declared paths use `/` as their canonical separator and normalize Unicode\n * to NFC. Workspace-relative paths reject C0 controls (U+0000 through U+001F)\n * and DEL (U+007F), which name nothing a supported filesystem can open. C1\n * controls (U+0080 through U+009F) remain accepted because those bytes are\n * legal in a POSIX file name.\n *\n * @since 0.1.0\n */\n\nimport * as Schema from \"effect/Schema\"\n\n/**\n * How strictly a declared file set is enforced at the boundary.\n *\n * `hard` rejects undeclared access. `expected` records access for validation\n * after execution without requiring the sandbox to reject it immediately.\n *\n * This is the ONE spelling of the pair. `Plan.NodeEffects.boundaryMode` is this\n * schema and so is `@smthrs/flow`'s `Action.BoundaryMode`; the literal used to\n * be written out in all three places.\n *\n * @category schemas\n * @since 1.0.0-rc.0\n */\nexport const BoundaryMode = Schema.Literals([\"hard\", \"expected\"])\n\n/**\n * The value form of {@link BoundaryMode}.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport type BoundaryMode = typeof BoundaryMode.Type\n\n/**\n * The canonical spelling of a declared path or pattern: every separator is\n * `/`, and Unicode is normalized to NFC.\n *\n * {@link workspaceRelative} accepts a backslash as a separator, so\n * `dist\\same.js` and `dist/same.js` are two spellings of ONE workspace path.\n * Every exact-path comparison in this module goes through this form, because\n * comparing the raw spellings would let the separator alias defeat overlap\n * detection exactly as `.` segments and empty segments would.\n *\n * @category accessors\n * @since 0.1.0\n * @slop\n */\nexport const canonical = (path: string): string => path.replaceAll(\"\\\\\", \"/\").normalize(\"NFC\")\n\n/**\n * The {@link canonical} spelling with letter case folded away.\n *\n * A case-insensitive filesystem (default macOS APFS, Windows NTFS) opens\n * `src/A.ts` and `src/a.ts` as one file, so static overlap compares this form:\n * two declarations that differ only in case must serialize. Folding goes\n * through upper case because that mapping is context-free, so it folds each\n * character alone and commutes with splitting a path into segments.\n *\n * @category accessors\n * @since 1.0.0-rc.0\n */\nexport const folded = (path: string): string => canonical(path).toUpperCase().normalize(\"NFC\")\n\n/** Workspace-relative glob pattern.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const Pattern = Schema.NonEmptyString.check(\n Schema.makeFilter(\n (pattern) => workspaceRelative(pattern) || \"file patterns must be workspace-relative and cannot traverse upward\",\n { title: \"workspaceRelativePattern\" }\n )\n)\n\n/**\n * Whether a declared path or pattern stays inside the workspace and names it\n * one way only. Refuses absolute paths (POSIX and drive-letter), upward\n * traversal, and the aliasing forms — `.` segments, empty segments — that\n * would let two spellings of one file defeat exact-string overlap detection.\n *\n * @category predicates\n * @since 0.1.0\n * @slop\n */\nexport const workspaceRelative = (pattern: string): boolean => {\n for (let index = 0; index < pattern.length; index++) {\n const code = pattern.charCodeAt(index)\n if (code <= 0x1f || code === 0x7f) return false\n }\n if (pattern.startsWith(\"/\")) return false\n const segments = canonical(pattern).split(\"/\")\n // `C:foo` is drive-relative on Windows, so any drive-letter prefix escapes.\n if (/^[A-Za-z]:/.test(segments[0]!) || segments[0]!.endsWith(\":\")) return false\n return segments.every((segment) => segment !== \"..\" && segment !== \".\" && segment !== \"\")\n}\n\n/** Bazel-style file glob.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const Glob = Schema.TaggedStruct(\"Glob\", {\n include: Schema.NonEmptyArray(Pattern),\n exclude: Schema.optional(Schema.Array(Pattern))\n})\n\n/** Bazel-style file glob.\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type Glob = typeof Glob.Type\n\n/** A directory output captured and replayed as one tree artifact.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const TreeArtifact = Schema.TaggedStruct(\"TreeArtifact\", {\n path: Pattern\n})\n\n/** A directory output captured and replayed as one tree artifact.\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type TreeArtifact = typeof TreeArtifact.Type\n\n/** One leaf of a named filegroup.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const Entry = Schema.Union([Pattern, Glob, TreeArtifact])\n\n/** One leaf of a named filegroup.\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type Entry = typeof Entry.Type\n\n/** A declaration valid in a read set.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const ReadEntry = Schema.Union([Pattern, Glob])\n\n/** A declaration valid in a read set.\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type ReadEntry = typeof ReadEntry.Type\n\n/** A named reusable collection expanded before measurement.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const Filegroup = Schema.TaggedStruct(\"Filegroup\", {\n name: Schema.NonEmptyString,\n entries: Schema.Array(Entry)\n})\n\n/** A named reusable collection expanded before measurement.\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type Filegroup = typeof Filegroup.Type\n\n/** A named read-only collection.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const ReadFilegroup = Schema.TaggedStruct(\"Filegroup\", {\n name: Schema.NonEmptyString,\n entries: Schema.Array(ReadEntry)\n})\n\n/** A named read-only collection.\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type ReadFilegroup = typeof ReadFilegroup.Type\n\n/** Any declaration accepted by a plan effect set.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const Declaration = Schema.Union([Entry, Filegroup])\n\n/** Any declaration accepted by a plan effect set.\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type Declaration = typeof Declaration.Type\n\n/** Any declaration accepted by a plan read set.\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const ReadDeclaration = Schema.Union([ReadEntry, ReadFilegroup])\n\n/** Any declaration accepted by a plan read set.\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type ReadDeclaration = typeof ReadDeclaration.Type\n\n/** Creates a named filegroup.\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const makeFilegroup = (name: string, entries: ReadonlyArray<Entry>): Filegroup => ({\n _tag: \"Filegroup\",\n name,\n entries\n})\n\n/** Expands filegroups deterministically, preserving declaration order.\n * @category accessors\n * @since 0.1.0\n * @slop\n */\nexport const expand = (declarations: ReadonlyArray<Declaration>): ReadonlyArray<Entry> =>\n declarations.flatMap((declaration) =>\n typeof declaration !== \"string\" && declaration._tag === \"Filegroup\" ? declaration.entries : [declaration]\n )\n\n/** Expands read filegroups deterministically, preserving declaration order.\n * @category accessors\n * @since 0.1.0\n * @slop\n */\nexport const expandReads = (declarations: ReadonlyArray<ReadDeclaration>): ReadonlyArray<ReadEntry> =>\n declarations.flatMap((declaration) =>\n typeof declaration !== \"string\" && declaration._tag === \"Filegroup\" ? declaration.entries : [declaration]\n )\n\n/** Whether a value is a glob declaration.\n * @category guards\n * @since 0.1.0\n * @slop\n */\nexport const isGlob = (value: unknown): value is Glob =>\n typeof value === \"object\" && value !== null && \"_tag\" in value && value._tag === \"Glob\"\n\n/** Whether a value is a tree artifact declaration.\n * @category guards\n * @since 0.1.0\n * @slop\n */\nexport const isTreeArtifact = (value: unknown): value is TreeArtifact =>\n typeof value === \"object\" && value !== null && \"_tag\" in value && value._tag === \"TreeArtifact\"\n\n/** KMP searches a literal without rescanning a long near-matching prefix. */\nconst literalSearch = (literal: string) => {\n const fallback = new Uint32Array(literal.length)\n let matched = 0\n for (let index = 1; index < literal.length; index++) {\n while (matched > 0 && literal[index] !== literal[matched]) matched = fallback[matched - 1]!\n if (literal[index] === literal[matched]) matched++\n fallback[index] = matched\n }\n return (path: string, start: number, end: number): number => {\n let matched = 0\n for (let index = start; index < end; index++) {\n while (matched > 0 && path[index] !== literal[matched]) matched = fallback[matched - 1]!\n if (path[index] === literal[matched]) matched++\n if (matched === literal.length) return index + 1\n }\n return -1\n }\n}\n\n/** Anchored ends and disjoint literal searches make each segment match linear. */\nconst segmentMatcher = (segment: string): (path: string) => boolean => {\n const chunks = segment.split(/\\*+/)\n const prefix = chunks.shift()!\n if (chunks.length === 0) return (path) => path === prefix\n const suffix = chunks.pop()!\n const searches = chunks.map(literalSearch)\n return (path) => {\n const end = path.length - suffix.length\n if (prefix.length > end || !path.startsWith(prefix) || !path.endsWith(suffix)) return false\n let position = prefix.length\n for (const search of searches) {\n position = search(path, position, end)\n if (position === -1) return false\n }\n return true\n }\n}\n\nconst patternMatchers = new Map<string, (path: string) => boolean>()\n\n/** Compile once per canonical spelling; recursive segments use no backtracking. */\nconst patternMatcher = (pattern: string): (path: string) => boolean => {\n const key = canonical(pattern)\n const cached = patternMatchers.get(key)\n if (cached !== undefined) return cached\n const segments = key.split(\"/\").map((segment) => segment === \"**\" ? undefined : segmentMatcher(segment))\n const matcher = (path: string): boolean => {\n const parts = path.split(\"/\")\n // Suffix membership: next[j] says the remaining pattern matches parts[j..].\n // Each pattern/path segment pair is visited once, even with repeated **.\n let next = new Uint8Array(parts.length + 1)\n next[parts.length] = 1\n for (let index = segments.length - 1; index >= 0; index--) {\n const segment = segments[index]\n const current = new Uint8Array(parts.length + 1)\n for (let part = parts.length - 1; part >= 0; part--) {\n current[part] = segment === undefined\n // A trailing ** accepts every remaining code unit. It still needs\n // the separator preceding it: src/** does not match bare src.\n ? Number(\n index === segments.length - 1 || next[part] === 1 ||\n (parts[part] !== \"\" && current[part + 1] === 1)\n )\n : Number(next[part + 1] === 1 && segment(parts[part]!))\n }\n next = current\n }\n return next[0] === 1\n }\n patternMatchers.set(key, matcher)\n return matcher\n}\n\n/** Tests one workspace-relative path against one Bazel-style pattern.\n * @category predicates\n * @since 0.1.0\n * @slop\n */\nexport const matchesPattern = (pattern: string, path: string): boolean => patternMatcher(pattern)(path)\n\n/** Tests one file path against a glob, including exclusions.\n * @category predicates\n * @since 0.1.0\n * @slop\n */\nexport const matchesGlob = (glob: Glob, path: string): boolean =>\n glob.include.some((pattern) => matchesPattern(pattern, path)) &&\n !(glob.exclude ?? []).some((pattern) => matchesPattern(pattern, path))\n\nconst beneath = (tree: string, path: string): boolean => {\n const root = folded(tree)\n const inside = folded(path)\n return inside === root || inside.startsWith(`${root}/`)\n}\n\n/** {@link matchesGlob} over {@link folded} spellings of the glob and the path. */\nconst matchesGlobFolded = (glob: Glob, path: string): boolean => {\n const inside = folded(path)\n return glob.include.some((pattern) => matchesPattern(folded(pattern), inside)) &&\n !(glob.exclude ?? []).some((pattern) => matchesPattern(folded(pattern), inside))\n}\n\n/**\n * Conservative static overlap. `true` may over-serialize; `false` proves that\n * no path can belong to both declarations.\n *\n * A plain string is a literal path, even when it contains `*` or `**`, as it\n * is at execution (sandbox admission, capture, removal, and replay); wildcard\n * matching belongs to a Glob.\n *\n * Exact paths and tree roots compare in their\n * {@link folded} form, so separator aliases, canonically equivalent Unicode\n * spellings, and spellings that differ only in letter case overlap. A Glob\n * against an exact path matches both its `include` and `exclude` patterns in\n * folded form. {@link matchesGlob} itself stays case-sensitive and tests the path bytes it\n * is handed; its property suite pins a backslash inside a path segment as\n * literal text, so canonicalizing a measured path before matching is its\n * caller's decision, not this module's.\n *\n * @category predicates\n * @since 0.1.0\n * @slop\n */\nexport const overlaps = (left: Entry, right: Entry): boolean => {\n if (typeof left === \"string\" && typeof right === \"string\") return folded(left) === folded(right)\n if (typeof left === \"string\" && isGlob(right)) return matchesGlobFolded(right, left)\n if (isGlob(left) && typeof right === \"string\") return matchesGlobFolded(left, right)\n if (isGlob(left) && isGlob(right)) return true\n if (isTreeArtifact(left) && typeof right === \"string\") return beneath(left.path, right)\n if (typeof left === \"string\" && isTreeArtifact(right)) return beneath(right.path, left)\n if (isTreeArtifact(left) && isTreeArtifact(right)) {\n return beneath(left.path, right.path) || beneath(right.path, left.path)\n }\n if (isTreeArtifact(left) && isGlob(right)) return true\n /* v8 ignore else -- the closed Entry union leaves only Glob/TreeArtifact here */\n if (isGlob(left) && isTreeArtifact(right)) return overlaps(right, left)\n /* v8 ignore next -- Entry's closed union makes every pair return above */\n return true\n}\n"]}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * The refusals a plan-time build raises instead of producing a wrong plan.
3
+ *
4
+ * Every one of these fails LOUDLY at build time: a planned value that was computed on must not
5
+ * bake `NaN` into a plan, an arm that returned something other than a node must
6
+ * not silently vanish from the topology, and a recursive `.call()` must direct
7
+ * the author to `.to()` or `.child()` rather than expanding forever. Each
8
+ * failure therefore names the site (`node` plus the recorded property `path`)
9
+ * and states the fix in `message`, because the author reading it is mid-body
10
+ * and needs the correction, not a classification.
11
+ *
12
+ * The codes are a closed schema literal so a caller can switch on them, and so
13
+ * a new refusal is a deliberate addition rather than a new free-form string.
14
+ *
15
+ * @since 0.1.0
16
+ */
17
+ import * as Schema from "effect/Schema";
18
+ /**
19
+ * The stable code of a build refusal.
20
+ *
21
+ * `planned_value_computed` is a body computing on a step result;
22
+ * `invalid_all_member` is a non-node handed to {@link module:Node.all};
23
+ * `invalid_join` is a race, any, or quorum with a non-node member, no members,
24
+ * or a quorum count its members cannot reach;
25
+ * `invalid_continuation` is a branch arm or continuation that did not return a
26
+ * node; `recursion_requires_boundary` is a flow calling itself inline, which
27
+ * has to become a trampoline handoff or an explicit child boundary;
28
+ * `placement_requires_boundary` is an inline call whose callee declares a
29
+ * placement the enclosing flow cannot satisfy, which has to become that same
30
+ * explicit child boundary; `cyclic_payload` is a payload that contains itself,
31
+ * which no plan could serialize or hash; `payload_too_deep` is a payload
32
+ * nested past the build bound, which has to be flattened into shallower data;
33
+ * `graph_too_deep` is authored topology nested past the build bound, which
34
+ * has to be split with `.child()` boundaries or trampoline handoffs;
35
+ * `duplicate_node` is two structural graph addresses resolving to one durable
36
+ * node id;
37
+ * `invalid_priority` is a scheduling priority that is not a safe integer,
38
+ * which no ordering could compare; `invalid_payload` is a payload member that
39
+ * cannot be captured as inert JSON without executing author code or losing
40
+ * identity; `unstable_callback` is a function with process-local identity in a
41
+ * graph that requires stable callbacks. Declare its complete inert captures
42
+ * with `Node.capture`, including semantic implementation versions. The two
43
+ * depth refusals exist because graph building walks with an explicit stack
44
+ * and refuses at a bound, rather than recursing until the native stack
45
+ * overflows without a typed error.
46
+ *
47
+ * The four effect-authority refusals are raised when a declaration claims more
48
+ * than the declaration enclosing it granted:
49
+ * `effect_outside_envelope` is a read or write path the envelope does not
50
+ * cover, and it names those paths in `path`; `effect_mode_widening` is an
51
+ * `expected` declaration inside a `hermetic` envelope; `effect_tier_widening`
52
+ * is a tier less reversible than the envelope's; and
53
+ * `capability_outside_grant` is a called flow or action requiring a capability
54
+ * the caller does not hold, which names the dropped capabilities in `path`. The
55
+ * first three are fatal by {@link isFatalDiagnostic}; the fourth is advisory,
56
+ * because dropping a capability narrows authority rather than widening it.
57
+ *
58
+ * The last six are raised by `@smthrs/core`'s graph builder, which uses this
59
+ * one error rather than a second class of its own. `write_conflict` is two work
60
+ * nodes overlapping under `onConflict: "fail"`, and `node` names the first of
61
+ * the pair while `Graph.conflicts` carries both; `missing_key_material` is a
62
+ * node that reached key compilation without any; `dependency_cycle` is a
63
+ * dependency set that cannot be ordered, and `node` names a node in the cycle;
64
+ * `plan_too_large` is a node, edge, conflict, or effect-path limit crossed, and
65
+ * `node` names the node whose admission crossed it; `payload_too_large` is a
66
+ * plan value with more members than the bound, and `path` names the offending
67
+ * value path; `invalid_node` is a malformed node AST. All six are fatal.
68
+ *
69
+ * @since 0.1.0
70
+ * @category schemas
71
+ * @slop
72
+ */
73
+ export declare const GraphBuildErrorCode: Schema.Literals<readonly ["planned_value_computed", "invalid_all_member", "invalid_join", "invalid_continuation", "recursion_requires_boundary", "placement_requires_boundary", "cyclic_payload", "payload_too_deep", "graph_too_deep", "duplicate_node", "invalid_priority", "invalid_payload", "unstable_callback", "effect_outside_envelope", "effect_mode_widening", "effect_tier_widening", "capability_outside_grant", "write_conflict", "missing_key_material", "dependency_cycle", "plan_too_large", "payload_too_large", "invalid_node"]>;
74
+ /**
75
+ * The value form of {@link GraphBuildErrorCode}.
76
+ *
77
+ * @since 0.1.0
78
+ * @category models
79
+ * @slop
80
+ */
81
+ export type GraphBuildErrorCode = typeof GraphBuildErrorCode.Type;
82
+ declare const GraphBuildError_base: Schema.Class<GraphBuildError, Schema.TaggedStruct<"@smthrs/plan/GraphBuildError", {
83
+ readonly code: Schema.Literals<readonly ["planned_value_computed", "invalid_all_member", "invalid_join", "invalid_continuation", "recursion_requires_boundary", "placement_requires_boundary", "cyclic_payload", "payload_too_deep", "graph_too_deep", "duplicate_node", "invalid_priority", "invalid_payload", "unstable_callback", "effect_outside_envelope", "effect_mode_widening", "effect_tier_widening", "capability_outside_grant", "write_conflict", "missing_key_material", "dependency_cycle", "plan_too_large", "payload_too_large", "invalid_node"]>;
84
+ readonly node: Schema.String;
85
+ readonly path: Schema.$Array<Schema.String>;
86
+ readonly message: Schema.String;
87
+ }>, import("effect/Cause").YieldableError>;
88
+ /**
89
+ * A build the planner refuses, naming the site and the fix.
90
+ *
91
+ * `node` is the node reference the failure belongs to — a planned value's
92
+ * origin node, an `all` member name, a branch arm, or the node whose admission
93
+ * crossed a bound. `path` is the property path recorded on a planned value
94
+ * before it was misused, the effect paths an over-claiming declaration named,
95
+ * the capabilities a call lost, or the value path of an oversized payload; it
96
+ * is empty for every other code.
97
+ *
98
+ * This is the ONE build refusal. `@smthrs/core`'s graph builder raised a second
99
+ * `GraphBuildError` of its own, with `paths`, `nodeId` and `nodes` in place of
100
+ * these fields, and the two code sets diverged instead of merging. A conflict's
101
+ * second node is read from `Graph.conflicts`, which carries the pair.
102
+ *
103
+ * @since 0.1.0
104
+ * @category errors
105
+ * @slop
106
+ */
107
+ export declare class GraphBuildError extends GraphBuildError_base {
108
+ }
109
+ /**
110
+ * Whether a recorded refusal blocks the drafts a plan is compiled from.
111
+ *
112
+ * A fatal refusal means the graph describes something no plan could execute as
113
+ * written, so the drafts are withheld. An advisory one reports a narrowing the
114
+ * author should see while the graph still compiles.
115
+ *
116
+ * @since 0.1.0
117
+ * @category predicates
118
+ * @slop
119
+ */
120
+ export declare const isFatalDiagnostic: (diagnostic: GraphBuildError) => boolean;
121
+ export {};
122
+ //# sourceMappingURL=GraphBuildError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphBuildError.d.ts","sourceRoot":"","sources":["../../src/GraphBuildError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,eAAO,MAAM,mBAAmB,ohBAwB9B,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAA;;;;;;;AAEjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,eAAgB,SAAQ,oBAKnC;CAAG;AAaL;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAAI,YAAY,eAAe,KAAG,OAA8C,CAAA"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * The refusals a plan-time build raises instead of producing a wrong plan.
3
+ *
4
+ * Every one of these fails LOUDLY at build time: a planned value that was computed on must not
5
+ * bake `NaN` into a plan, an arm that returned something other than a node must
6
+ * not silently vanish from the topology, and a recursive `.call()` must direct
7
+ * the author to `.to()` or `.child()` rather than expanding forever. Each
8
+ * failure therefore names the site (`node` plus the recorded property `path`)
9
+ * and states the fix in `message`, because the author reading it is mid-body
10
+ * and needs the correction, not a classification.
11
+ *
12
+ * The codes are a closed schema literal so a caller can switch on them, and so
13
+ * a new refusal is a deliberate addition rather than a new free-form string.
14
+ *
15
+ * @since 0.1.0
16
+ */
17
+ import * as Schema from "effect/Schema";
18
+ /**
19
+ * The stable code of a build refusal.
20
+ *
21
+ * `planned_value_computed` is a body computing on a step result;
22
+ * `invalid_all_member` is a non-node handed to {@link module:Node.all};
23
+ * `invalid_join` is a race, any, or quorum with a non-node member, no members,
24
+ * or a quorum count its members cannot reach;
25
+ * `invalid_continuation` is a branch arm or continuation that did not return a
26
+ * node; `recursion_requires_boundary` is a flow calling itself inline, which
27
+ * has to become a trampoline handoff or an explicit child boundary;
28
+ * `placement_requires_boundary` is an inline call whose callee declares a
29
+ * placement the enclosing flow cannot satisfy, which has to become that same
30
+ * explicit child boundary; `cyclic_payload` is a payload that contains itself,
31
+ * which no plan could serialize or hash; `payload_too_deep` is a payload
32
+ * nested past the build bound, which has to be flattened into shallower data;
33
+ * `graph_too_deep` is authored topology nested past the build bound, which
34
+ * has to be split with `.child()` boundaries or trampoline handoffs;
35
+ * `duplicate_node` is two structural graph addresses resolving to one durable
36
+ * node id;
37
+ * `invalid_priority` is a scheduling priority that is not a safe integer,
38
+ * which no ordering could compare; `invalid_payload` is a payload member that
39
+ * cannot be captured as inert JSON without executing author code or losing
40
+ * identity; `unstable_callback` is a function with process-local identity in a
41
+ * graph that requires stable callbacks. Declare its complete inert captures
42
+ * with `Node.capture`, including semantic implementation versions. The two
43
+ * depth refusals exist because graph building walks with an explicit stack
44
+ * and refuses at a bound, rather than recursing until the native stack
45
+ * overflows without a typed error.
46
+ *
47
+ * The four effect-authority refusals are raised when a declaration claims more
48
+ * than the declaration enclosing it granted:
49
+ * `effect_outside_envelope` is a read or write path the envelope does not
50
+ * cover, and it names those paths in `path`; `effect_mode_widening` is an
51
+ * `expected` declaration inside a `hermetic` envelope; `effect_tier_widening`
52
+ * is a tier less reversible than the envelope's; and
53
+ * `capability_outside_grant` is a called flow or action requiring a capability
54
+ * the caller does not hold, which names the dropped capabilities in `path`. The
55
+ * first three are fatal by {@link isFatalDiagnostic}; the fourth is advisory,
56
+ * because dropping a capability narrows authority rather than widening it.
57
+ *
58
+ * The last six are raised by `@smthrs/core`'s graph builder, which uses this
59
+ * one error rather than a second class of its own. `write_conflict` is two work
60
+ * nodes overlapping under `onConflict: "fail"`, and `node` names the first of
61
+ * the pair while `Graph.conflicts` carries both; `missing_key_material` is a
62
+ * node that reached key compilation without any; `dependency_cycle` is a
63
+ * dependency set that cannot be ordered, and `node` names a node in the cycle;
64
+ * `plan_too_large` is a node, edge, conflict, or effect-path limit crossed, and
65
+ * `node` names the node whose admission crossed it; `payload_too_large` is a
66
+ * plan value with more members than the bound, and `path` names the offending
67
+ * value path; `invalid_node` is a malformed node AST. All six are fatal.
68
+ *
69
+ * @since 0.1.0
70
+ * @category schemas
71
+ * @slop
72
+ */
73
+ export const GraphBuildErrorCode = Schema.Literals([
74
+ "planned_value_computed",
75
+ "invalid_all_member",
76
+ "invalid_join",
77
+ "invalid_continuation",
78
+ "recursion_requires_boundary",
79
+ "placement_requires_boundary",
80
+ "cyclic_payload",
81
+ "payload_too_deep",
82
+ "graph_too_deep",
83
+ "duplicate_node",
84
+ "invalid_priority",
85
+ "invalid_payload",
86
+ "unstable_callback",
87
+ "effect_outside_envelope",
88
+ "effect_mode_widening",
89
+ "effect_tier_widening",
90
+ "capability_outside_grant",
91
+ "write_conflict",
92
+ "missing_key_material",
93
+ "dependency_cycle",
94
+ "plan_too_large",
95
+ "payload_too_large",
96
+ "invalid_node"
97
+ ]);
98
+ /**
99
+ * A build the planner refuses, naming the site and the fix.
100
+ *
101
+ * `node` is the node reference the failure belongs to — a planned value's
102
+ * origin node, an `all` member name, a branch arm, or the node whose admission
103
+ * crossed a bound. `path` is the property path recorded on a planned value
104
+ * before it was misused, the effect paths an over-claiming declaration named,
105
+ * the capabilities a call lost, or the value path of an oversized payload; it
106
+ * is empty for every other code.
107
+ *
108
+ * This is the ONE build refusal. `@smthrs/core`'s graph builder raised a second
109
+ * `GraphBuildError` of its own, with `paths`, `nodeId` and `nodes` in place of
110
+ * these fields, and the two code sets diverged instead of merging. A conflict's
111
+ * second node is read from `Graph.conflicts`, which carries the pair.
112
+ *
113
+ * @since 0.1.0
114
+ * @category errors
115
+ * @slop
116
+ */
117
+ export class GraphBuildError extends Schema.TaggedError()("@smthrs/plan/GraphBuildError", {
118
+ code: GraphBuildErrorCode,
119
+ node: Schema.String,
120
+ path: Schema.Array(Schema.String),
121
+ message: Schema.String
122
+ }) {
123
+ }
124
+ /**
125
+ * The one advisory code. Everything else a build records blocks the drafts.
126
+ *
127
+ * A capability the caller does not grant is DROPPED, not granted: the callee
128
+ * runs with less authority than it asked for, which is the safe direction. The
129
+ * author still needs to know, because a flow that silently loses a capability
130
+ * fails later at the action that needed it, so the build records the refusal
131
+ * and lets the graph compile.
132
+ */
133
+ const advisoryCodes = new Set(["capability_outside_grant"]);
134
+ /**
135
+ * Whether a recorded refusal blocks the drafts a plan is compiled from.
136
+ *
137
+ * A fatal refusal means the graph describes something no plan could execute as
138
+ * written, so the drafts are withheld. An advisory one reports a narrowing the
139
+ * author should see while the graph still compiles.
140
+ *
141
+ * @since 0.1.0
142
+ * @category predicates
143
+ * @slop
144
+ */
145
+ export const isFatalDiagnostic = (diagnostic) => !advisoryCodes.has(diagnostic.code);
146
+ //# sourceMappingURL=GraphBuildError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphBuildError.js","sourceRoot":"","sources":["../../src/GraphBuildError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjD,wBAAwB;IACxB,oBAAoB;IACpB,cAAc;IACd,sBAAsB;IACtB,6BAA6B;IAC7B,6BAA6B;IAC7B,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,mBAAmB;IACnB,yBAAyB;IACzB,sBAAsB;IACtB,sBAAsB;IACtB,0BAA0B;IAC1B,gBAAgB;IAChB,sBAAsB;IACtB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,cAAc;CACf,CAAC,CAAA;AAWF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,WAAW,EAAmB,CAAC,8BAA8B,EAAE;IACzG,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC;CAAG;AAEL;;;;;;;;GAQG;AACH,MAAM,aAAa,GAAqC,IAAI,GAAG,CAAsB,CAAC,0BAA0B,CAAC,CAAC,CAAA;AAElH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,UAA2B,EAAW,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA","sourcesContent":["/**\n * The refusals a plan-time build raises instead of producing a wrong plan.\n *\n * Every one of these fails LOUDLY at build time: a planned value that was computed on must not\n * bake `NaN` into a plan, an arm that returned something other than a node must\n * not silently vanish from the topology, and a recursive `.call()` must direct\n * the author to `.to()` or `.child()` rather than expanding forever. Each\n * failure therefore names the site (`node` plus the recorded property `path`)\n * and states the fix in `message`, because the author reading it is mid-body\n * and needs the correction, not a classification.\n *\n * The codes are a closed schema literal so a caller can switch on them, and so\n * a new refusal is a deliberate addition rather than a new free-form string.\n *\n * @since 0.1.0\n */\n\nimport * as Schema from \"effect/Schema\"\n\n/**\n * The stable code of a build refusal.\n *\n * `planned_value_computed` is a body computing on a step result;\n * `invalid_all_member` is a non-node handed to {@link module:Node.all};\n * `invalid_join` is a race, any, or quorum with a non-node member, no members,\n * or a quorum count its members cannot reach;\n * `invalid_continuation` is a branch arm or continuation that did not return a\n * node; `recursion_requires_boundary` is a flow calling itself inline, which\n * has to become a trampoline handoff or an explicit child boundary;\n * `placement_requires_boundary` is an inline call whose callee declares a\n * placement the enclosing flow cannot satisfy, which has to become that same\n * explicit child boundary; `cyclic_payload` is a payload that contains itself,\n * which no plan could serialize or hash; `payload_too_deep` is a payload\n * nested past the build bound, which has to be flattened into shallower data;\n * `graph_too_deep` is authored topology nested past the build bound, which\n * has to be split with `.child()` boundaries or trampoline handoffs;\n * `duplicate_node` is two structural graph addresses resolving to one durable\n * node id;\n * `invalid_priority` is a scheduling priority that is not a safe integer,\n * which no ordering could compare; `invalid_payload` is a payload member that\n * cannot be captured as inert JSON without executing author code or losing\n * identity; `unstable_callback` is a function with process-local identity in a\n * graph that requires stable callbacks. Declare its complete inert captures\n * with `Node.capture`, including semantic implementation versions. The two\n * depth refusals exist because graph building walks with an explicit stack\n * and refuses at a bound, rather than recursing until the native stack\n * overflows without a typed error.\n *\n * The four effect-authority refusals are raised when a declaration claims more\n * than the declaration enclosing it granted:\n * `effect_outside_envelope` is a read or write path the envelope does not\n * cover, and it names those paths in `path`; `effect_mode_widening` is an\n * `expected` declaration inside a `hermetic` envelope; `effect_tier_widening`\n * is a tier less reversible than the envelope's; and\n * `capability_outside_grant` is a called flow or action requiring a capability\n * the caller does not hold, which names the dropped capabilities in `path`. The\n * first three are fatal by {@link isFatalDiagnostic}; the fourth is advisory,\n * because dropping a capability narrows authority rather than widening it.\n *\n * The last six are raised by `@smthrs/core`'s graph builder, which uses this\n * one error rather than a second class of its own. `write_conflict` is two work\n * nodes overlapping under `onConflict: \"fail\"`, and `node` names the first of\n * the pair while `Graph.conflicts` carries both; `missing_key_material` is a\n * node that reached key compilation without any; `dependency_cycle` is a\n * dependency set that cannot be ordered, and `node` names a node in the cycle;\n * `plan_too_large` is a node, edge, conflict, or effect-path limit crossed, and\n * `node` names the node whose admission crossed it; `payload_too_large` is a\n * plan value with more members than the bound, and `path` names the offending\n * value path; `invalid_node` is a malformed node AST. All six are fatal.\n *\n * @since 0.1.0\n * @category schemas\n * @slop\n */\nexport const GraphBuildErrorCode = Schema.Literals([\n \"planned_value_computed\",\n \"invalid_all_member\",\n \"invalid_join\",\n \"invalid_continuation\",\n \"recursion_requires_boundary\",\n \"placement_requires_boundary\",\n \"cyclic_payload\",\n \"payload_too_deep\",\n \"graph_too_deep\",\n \"duplicate_node\",\n \"invalid_priority\",\n \"invalid_payload\",\n \"unstable_callback\",\n \"effect_outside_envelope\",\n \"effect_mode_widening\",\n \"effect_tier_widening\",\n \"capability_outside_grant\",\n \"write_conflict\",\n \"missing_key_material\",\n \"dependency_cycle\",\n \"plan_too_large\",\n \"payload_too_large\",\n \"invalid_node\"\n])\n\n/**\n * The value form of {@link GraphBuildErrorCode}.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type GraphBuildErrorCode = typeof GraphBuildErrorCode.Type\n\n/**\n * A build the planner refuses, naming the site and the fix.\n *\n * `node` is the node reference the failure belongs to — a planned value's\n * origin node, an `all` member name, a branch arm, or the node whose admission\n * crossed a bound. `path` is the property path recorded on a planned value\n * before it was misused, the effect paths an over-claiming declaration named,\n * the capabilities a call lost, or the value path of an oversized payload; it\n * is empty for every other code.\n *\n * This is the ONE build refusal. `@smthrs/core`'s graph builder raised a second\n * `GraphBuildError` of its own, with `paths`, `nodeId` and `nodes` in place of\n * these fields, and the two code sets diverged instead of merging. A conflict's\n * second node is read from `Graph.conflicts`, which carries the pair.\n *\n * @since 0.1.0\n * @category errors\n * @slop\n */\nexport class GraphBuildError extends Schema.TaggedError<GraphBuildError>()(\"@smthrs/plan/GraphBuildError\", {\n code: GraphBuildErrorCode,\n node: Schema.String,\n path: Schema.Array(Schema.String),\n message: Schema.String\n}) {}\n\n/**\n * The one advisory code. Everything else a build records blocks the drafts.\n *\n * A capability the caller does not grant is DROPPED, not granted: the callee\n * runs with less authority than it asked for, which is the safe direction. The\n * author still needs to know, because a flow that silently loses a capability\n * fails later at the action that needed it, so the build records the refusal\n * and lets the graph compile.\n */\nconst advisoryCodes: ReadonlySet<GraphBuildErrorCode> = new Set<GraphBuildErrorCode>([\"capability_outside_grant\"])\n\n/**\n * Whether a recorded refusal blocks the drafts a plan is compiled from.\n *\n * A fatal refusal means the graph describes something no plan could execute as\n * written, so the drafts are withheld. An advisory one reports a narrowing the\n * author should see while the graph still compiles.\n *\n * @since 0.1.0\n * @category predicates\n * @slop\n */\nexport const isFatalDiagnostic = (diagnostic: GraphBuildError): boolean => !advisoryCodes.has(diagnostic.code)\n"]}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * The key-material contract: what a planner hands the step-key compiler.
3
+ *
4
+ * Revived from the deleted `packages/smithers/flows/keys/src/KeyMaterial.ts`.
5
+ * It does NOT return to `@smthrs/keys`: that package owns generic derivation
6
+ * and stored-key validation, while material is a *plan-shaped* concept. It
7
+ * lives here, above `@smthrs/keys`, so the key package stays a leaf.
8
+ *
9
+ * Governing contract: the step-key rules at
10
+ * https://smithers.sh/docs/concepts/content-addressing. Material is computed with no I/O,
11
+ * and two hardening rules shape it: the nominal, never shape-sniffed
12
+ * `InputRef` and the hashed `version`.
13
+ *
14
+ * @since 0.1.0
15
+ */
16
+ import * as Schema from "effect/Schema";
17
+ /**
18
+ * A reference to one declared input of a node: a value hashed inline, or the
19
+ * key of an upstream node whose result this node consumes.
20
+ *
21
+ * The three variants are tagged, and the tag is hashed, so `Pending{from}` and
22
+ * `Ref{from, path: []}` — which resolve to the same dependency digest — can
23
+ * never collide.
24
+ *
25
+ * @since 0.1.0
26
+ * @category schemas
27
+ * @slop
28
+ */
29
+ export declare const InputRef: Schema.Union<readonly [Schema.TaggedStruct<"Literal", {
30
+ readonly value: Schema.Unknown;
31
+ }>, Schema.TaggedStruct<"Ref", {
32
+ readonly from: Schema.NonEmptyString;
33
+ readonly path: Schema.$Array<Schema.String>;
34
+ }>, Schema.TaggedStruct<"Pending", {
35
+ readonly from: Schema.NonEmptyString;
36
+ }>]>;
37
+ /**
38
+ * A reference to one declared input of a node.
39
+ *
40
+ * @since 0.1.0
41
+ * @category models
42
+ * @slop
43
+ */
44
+ export type InputRef = typeof InputRef.Type;
45
+ /**
46
+ * The material version. Folded into every hashed body so a bump re-keys every
47
+ * node derived from it — the original's second collision fix, kept.
48
+ *
49
+ * @since 0.1.0
50
+ * @category constants
51
+ * @slop
52
+ */
53
+ export declare const version = "flows/key-material/v2";
54
+ /**
55
+ * Everything that can change a node's result, handed to the digest.
56
+ *
57
+ * `effects` and `placement` are opaque: canonically serialized, never
58
+ * interpreted, which is what keeps the compiler independent of whatever the
59
+ * flow builder decides an effect declaration looks like.
60
+ *
61
+ * @since 0.1.0
62
+ * @category schemas
63
+ * @slop
64
+ */
65
+ export declare const KeyMaterial: Schema.Struct<{
66
+ readonly version: Schema.Literal<"flows/key-material/v2">;
67
+ readonly kind: Schema.Literals<readonly ["sealed", "compensable", "irreversible"]>;
68
+ readonly nondeterministic: Schema.optional<Schema.Literal<true>>;
69
+ readonly body: Schema.Unknown;
70
+ readonly inputs: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"Literal", {
71
+ readonly value: Schema.Unknown;
72
+ }>, Schema.TaggedStruct<"Ref", {
73
+ readonly from: Schema.NonEmptyString;
74
+ readonly path: Schema.$Array<Schema.String>;
75
+ }>, Schema.TaggedStruct<"Pending", {
76
+ readonly from: Schema.NonEmptyString;
77
+ }>]>>;
78
+ readonly layers: Schema.$Array<Schema.String>;
79
+ readonly capabilities: Schema.$Array<Schema.String>;
80
+ readonly effects: Schema.optional<Schema.Unknown>;
81
+ readonly placement: Schema.optional<Schema.Unknown>;
82
+ }>;
83
+ /**
84
+ * Everything that can change a node's result, handed to the digest.
85
+ *
86
+ * @since 0.1.0
87
+ * @category models
88
+ * @slop
89
+ */
90
+ export type KeyMaterial = typeof KeyMaterial.Type;
91
+ /**
92
+ * The graph-local dependencies a material names, in declaration order and
93
+ * without duplicates. The compiler resolves exactly these before hashing, and
94
+ * {@link module:Plan} uses them as the edge set — one derivation, so an edge
95
+ * and a hashed reference can never disagree.
96
+ *
97
+ * @since 0.1.0
98
+ * @category accessors
99
+ * @slop
100
+ */
101
+ export declare const dependencies: (material: KeyMaterial) => ReadonlyArray<string>;
102
+ //# sourceMappingURL=KeyMaterial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyMaterial.d.ts","sourceRoot":"","sources":["../../src/KeyMaterial.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;;;;;;;IAInB,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,0BAA0B,CAAA;AAE9C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;EAWtB,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU,WAAW,KAAG,aAAa,CAAC,MAAM,CAMxE,CAAA"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The key-material contract: what a planner hands the step-key compiler.
3
+ *
4
+ * Revived from the deleted `packages/smithers/flows/keys/src/KeyMaterial.ts`.
5
+ * It does NOT return to `@smthrs/keys`: that package owns generic derivation
6
+ * and stored-key validation, while material is a *plan-shaped* concept. It
7
+ * lives here, above `@smthrs/keys`, so the key package stays a leaf.
8
+ *
9
+ * Governing contract: the step-key rules at
10
+ * https://smithers.sh/docs/concepts/content-addressing. Material is computed with no I/O,
11
+ * and two hardening rules shape it: the nominal, never shape-sniffed
12
+ * `InputRef` and the hashed `version`.
13
+ *
14
+ * @since 0.1.0
15
+ */
16
+ import * as Schema from "effect/Schema";
17
+ import * as Effects from "./Effects.js";
18
+ /**
19
+ * A reference to one declared input of a node: a value hashed inline, or the
20
+ * key of an upstream node whose result this node consumes.
21
+ *
22
+ * The three variants are tagged, and the tag is hashed, so `Pending{from}` and
23
+ * `Ref{from, path: []}` — which resolve to the same dependency digest — can
24
+ * never collide.
25
+ *
26
+ * @since 0.1.0
27
+ * @category schemas
28
+ * @slop
29
+ */
30
+ export const InputRef = Schema.Union([
31
+ Schema.TaggedStruct("Literal", { value: Schema.Unknown }),
32
+ Schema.TaggedStruct("Ref", { from: Schema.NonEmptyString, path: Schema.Array(Schema.String) }),
33
+ Schema.TaggedStruct("Pending", { from: Schema.NonEmptyString })
34
+ ]);
35
+ /**
36
+ * The material version. Folded into every hashed body so a bump re-keys every
37
+ * node derived from it — the original's second collision fix, kept.
38
+ *
39
+ * @since 0.1.0
40
+ * @category constants
41
+ * @slop
42
+ */
43
+ export const version = "flows/key-material/v2";
44
+ /**
45
+ * Everything that can change a node's result, handed to the digest.
46
+ *
47
+ * `effects` and `placement` are opaque: canonically serialized, never
48
+ * interpreted, which is what keeps the compiler independent of whatever the
49
+ * flow builder decides an effect declaration looks like.
50
+ *
51
+ * @since 0.1.0
52
+ * @category schemas
53
+ * @slop
54
+ */
55
+ export const KeyMaterial = Schema.Struct({
56
+ version: Schema.Literal(version),
57
+ kind: Effects.Tier,
58
+ // Absence claims determinism; only the explicit declaration changes identity.
59
+ nondeterministic: Schema.optional(Schema.Literal(true)),
60
+ body: Schema.Unknown,
61
+ inputs: Schema.Array(InputRef),
62
+ layers: Schema.Array(Schema.String),
63
+ capabilities: Schema.Array(Schema.String),
64
+ effects: Schema.optional(Schema.Unknown),
65
+ placement: Schema.optional(Schema.Unknown)
66
+ });
67
+ /**
68
+ * The graph-local dependencies a material names, in declaration order and
69
+ * without duplicates. The compiler resolves exactly these before hashing, and
70
+ * {@link module:Plan} uses them as the edge set — one derivation, so an edge
71
+ * and a hashed reference can never disagree.
72
+ *
73
+ * @since 0.1.0
74
+ * @category accessors
75
+ * @slop
76
+ */
77
+ export const dependencies = (material) => {
78
+ const seen = new Set();
79
+ for (const input of material.inputs) {
80
+ if (input._tag !== "Literal")
81
+ seen.add(input.from);
82
+ }
83
+ return [...seen];
84
+ };
85
+ //# sourceMappingURL=KeyMaterial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyMaterial.js","sourceRoot":"","sources":["../../src/KeyMaterial.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;IACnC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM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,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACpD,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;AAClB,CAAC,CAAA","sourcesContent":["/**\n * The key-material contract: what a planner hands the step-key compiler.\n *\n * Revived from the deleted `packages/smithers/flows/keys/src/KeyMaterial.ts`.\n * It does NOT return to `@smthrs/keys`: that package owns generic derivation\n * and stored-key validation, while material is a *plan-shaped* concept. It\n * lives here, above `@smthrs/keys`, so the key package stays a leaf.\n *\n * Governing contract: the step-key rules at\n * https://smithers.sh/docs/concepts/content-addressing. Material is computed with no I/O,\n * and two hardening rules shape it: the nominal, never shape-sniffed\n * `InputRef` and the hashed `version`.\n *\n * @since 0.1.0\n */\n\nimport * as Schema from \"effect/Schema\"\nimport * as Effects from \"./Effects.ts\"\n\n/**\n * A reference to one declared input of a node: a value hashed inline, or the\n * key of an upstream node whose result this node consumes.\n *\n * The three variants are tagged, and the tag is hashed, so `Pending{from}` and\n * `Ref{from, path: []}` — which resolve to the same dependency digest — can\n * never collide.\n *\n * @since 0.1.0\n * @category schemas\n * @slop\n */\nexport const InputRef = Schema.Union([\n Schema.TaggedStruct(\"Literal\", { value: Schema.Unknown }),\n Schema.TaggedStruct(\"Ref\", { from: Schema.NonEmptyString, path: Schema.Array(Schema.String) }),\n Schema.TaggedStruct(\"Pending\", { from: Schema.NonEmptyString })\n])\n\n/**\n * A reference to one declared input of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type InputRef = typeof InputRef.Type\n\n/**\n * The material version. Folded into every hashed body so a bump re-keys every\n * node derived from it — the original's second collision fix, kept.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const version = \"flows/key-material/v2\"\n\n/**\n * Everything that can change a node's result, handed to the digest.\n *\n * `effects` and `placement` are opaque: canonically serialized, never\n * interpreted, which is what keeps the compiler independent of whatever the\n * flow builder decides an effect declaration looks like.\n *\n * @since 0.1.0\n * @category schemas\n * @slop\n */\nexport const KeyMaterial = Schema.Struct({\n version: Schema.Literal(version),\n kind: Effects.Tier,\n // Absence claims determinism; only the explicit declaration changes identity.\n nondeterministic: Schema.optional(Schema.Literal(true)),\n body: Schema.Unknown,\n inputs: Schema.Array(InputRef),\n layers: Schema.Array(Schema.String),\n capabilities: Schema.Array(Schema.String),\n effects: Schema.optional(Schema.Unknown),\n placement: Schema.optional(Schema.Unknown)\n})\n\n/**\n * Everything that can change a node's result, handed to the digest.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type KeyMaterial = typeof KeyMaterial.Type\n\n/**\n * The graph-local dependencies a material names, in declaration order and\n * without duplicates. The compiler resolves exactly these before hashing, and\n * {@link module:Plan} uses them as the edge set — one derivation, so an edge\n * and a hashed reference can never disagree.\n *\n * @since 0.1.0\n * @category accessors\n * @slop\n */\nexport const dependencies = (material: KeyMaterial): ReadonlyArray<string> => {\n const seen = new Set<string>()\n for (const input of material.inputs) {\n if (input._tag !== \"Literal\") seen.add(input.from)\n }\n return [...seen]\n}\n"]}