@smthrs/plan 1.0.0-rc.7 → 1.0.0-rc.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 (68) hide show
  1. package/README.md +3 -1
  2. package/dist/cjs/Effects.d.ts +29 -11
  3. package/dist/cjs/Effects.d.ts.map +1 -1
  4. package/dist/cjs/Effects.js.map +2 -2
  5. package/dist/cjs/FileSet.d.ts +121 -51
  6. package/dist/cjs/FileSet.d.ts.map +1 -1
  7. package/dist/cjs/FileSet.js.map +2 -2
  8. package/dist/cjs/GraphBuildError.d.ts +2 -4
  9. package/dist/cjs/GraphBuildError.d.ts.map +1 -1
  10. package/dist/cjs/GraphBuildError.js.map +2 -2
  11. package/dist/cjs/KeyMaterial.d.ts +13 -8
  12. package/dist/cjs/KeyMaterial.d.ts.map +1 -1
  13. package/dist/cjs/KeyMaterial.js.map +2 -2
  14. package/dist/cjs/Plan.d.ts +72 -23
  15. package/dist/cjs/Plan.d.ts.map +1 -1
  16. package/dist/cjs/Plan.js +3 -0
  17. package/dist/cjs/Plan.js.map +2 -2
  18. package/dist/cjs/PlanDiff.d.ts +26 -7
  19. package/dist/cjs/PlanDiff.d.ts.map +1 -1
  20. package/dist/cjs/PlanDiff.js +29 -4
  21. package/dist/cjs/PlanDiff.js.map +2 -2
  22. package/dist/cjs/StepKey.d.ts +38 -17
  23. package/dist/cjs/StepKey.d.ts.map +1 -1
  24. package/dist/cjs/StepKey.js +24 -22
  25. package/dist/cjs/StepKey.js.map +2 -2
  26. package/dist/cjs/internal/node.d.ts.map +1 -1
  27. package/dist/esm/Effects.d.ts +29 -11
  28. package/dist/esm/Effects.d.ts.map +1 -1
  29. package/dist/esm/Effects.js +18 -7
  30. package/dist/esm/Effects.js.map +1 -1
  31. package/dist/esm/FileSet.d.ts +121 -51
  32. package/dist/esm/FileSet.d.ts.map +1 -1
  33. package/dist/esm/FileSet.js +97 -35
  34. package/dist/esm/FileSet.js.map +1 -1
  35. package/dist/esm/GraphBuildError.d.ts +2 -4
  36. package/dist/esm/GraphBuildError.d.ts.map +1 -1
  37. package/dist/esm/GraphBuildError.js +2 -3
  38. package/dist/esm/GraphBuildError.js.map +1 -1
  39. package/dist/esm/KeyMaterial.d.ts +13 -8
  40. package/dist/esm/KeyMaterial.d.ts.map +1 -1
  41. package/dist/esm/KeyMaterial.js +11 -4
  42. package/dist/esm/KeyMaterial.js.map +1 -1
  43. package/dist/esm/Plan.d.ts +72 -23
  44. package/dist/esm/Plan.d.ts.map +1 -1
  45. package/dist/esm/Plan.js +61 -16
  46. package/dist/esm/Plan.js.map +1 -1
  47. package/dist/esm/PlanDiff.d.ts +26 -7
  48. package/dist/esm/PlanDiff.d.ts.map +1 -1
  49. package/dist/esm/PlanDiff.js +55 -9
  50. package/dist/esm/PlanDiff.js.map +1 -1
  51. package/dist/esm/StepKey.d.ts +38 -17
  52. package/dist/esm/StepKey.d.ts.map +1 -1
  53. package/dist/esm/StepKey.js +41 -16
  54. package/dist/esm/StepKey.js.map +1 -1
  55. package/dist/esm/internal/node.d.ts.map +1 -1
  56. package/docs/README.md +3 -1
  57. package/docs/api.md +1 -1
  58. package/docs/guides/diff-two-plans.md +138 -74
  59. package/docs/installation.md +5 -1
  60. package/docs/quickstart.md +1 -1
  61. package/package.json +4 -4
  62. package/src/Effects.ts +29 -11
  63. package/src/FileSet.ts +121 -51
  64. package/src/GraphBuildError.ts +2 -4
  65. package/src/KeyMaterial.ts +13 -8
  66. package/src/Plan.ts +66 -23
  67. package/src/PlanDiff.ts +56 -11
  68. package/src/StepKey.ts +66 -40
@@ -1 +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,MAA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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"]}
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;;;;;;;;;;;;GAYG;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;;;;;;;;;GASG;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;;;;;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AAA;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 */\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/**\n * A non-empty workspace-relative path or pattern.\n *\n * Decoding fails with a `SchemaError` when {@link workspaceRelative} refuses\n * the string. A bare `Pattern` in a declaration names one literal path; only a\n * {@link Glob} gives `*` and `**` wildcard meaning.\n *\n * @category schemas\n * @since 0.1.0\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 * C0 controls and DEL are refused as well.\n *\n * @category predicates\n * @since 0.1.0\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/**\n * A Bazel-style file glob: the paths matching any `include` pattern and no\n * `exclude` pattern.\n *\n * In a pattern, `*` matches within one path segment and a `**` segment\n * matches zero or more whole segments. A trailing `**` needs its separator,\n * so `src/**` does not match `src` itself.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const Glob = Schema.TaggedStruct(\"Glob\", {\n include: Schema.NonEmptyArray(Pattern),\n exclude: Schema.optional(Schema.Array(Pattern))\n})\n\n/**\n * The value form of {@link Glob}.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Glob = typeof Glob.Type\n\n/**\n * A directory output captured and replayed as one tree artifact.\n *\n * It covers `path` and every path beneath it, compared in {@link folded}\n * form.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const TreeArtifact = Schema.TaggedStruct(\"TreeArtifact\", {\n path: Pattern\n})\n\n/**\n * The value form of {@link TreeArtifact}.\n *\n * @category models\n * @since 0.1.0\n */\nexport type TreeArtifact = typeof TreeArtifact.Type\n\n/**\n * One leaf declaration: a literal path, a {@link Glob}, or a\n * {@link TreeArtifact}. Write sets and filegroups hold entries.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const Entry = Schema.Union([Pattern, Glob, TreeArtifact])\n\n/**\n * The value form of {@link Entry}.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Entry = typeof Entry.Type\n\n/**\n * One leaf declaration valid in a read set: a literal path or a {@link Glob}.\n * A read set cannot name a {@link TreeArtifact}, which is an output form.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const ReadEntry = Schema.Union([Pattern, Glob])\n\n/**\n * The value form of {@link ReadEntry}.\n *\n * @category models\n * @since 0.1.0\n */\nexport type ReadEntry = typeof ReadEntry.Type\n\n/**\n * A named, reusable list of {@link Entry} declarations.\n *\n * {@link expand} replaces a filegroup with its entries in place before any\n * overlap check or measurement, so the name never reaches the boundary.\n * Filegroups do not nest.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const Filegroup = Schema.TaggedStruct(\"Filegroup\", {\n name: Schema.NonEmptyString,\n entries: Schema.Array(Entry)\n})\n\n/**\n * The value form of {@link Filegroup}.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Filegroup = typeof Filegroup.Type\n\n/**\n * A {@link Filegroup} restricted to {@link ReadEntry} declarations, for use\n * in a read set. It shares the `\"Filegroup\"` tag.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const ReadFilegroup = Schema.TaggedStruct(\"Filegroup\", {\n name: Schema.NonEmptyString,\n entries: Schema.Array(ReadEntry)\n})\n\n/**\n * The value form of {@link ReadFilegroup}.\n *\n * @category models\n * @since 0.1.0\n */\nexport type ReadFilegroup = typeof ReadFilegroup.Type\n\n/**\n * Any declaration accepted in a write set: an {@link Entry} or a\n * {@link Filegroup}.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const Declaration = Schema.Union([Entry, Filegroup])\n\n/**\n * The value form of {@link Declaration}.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Declaration = typeof Declaration.Type\n\n/**\n * Any declaration accepted in a read set: a {@link ReadEntry} or a\n * {@link ReadFilegroup}.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const ReadDeclaration = Schema.Union([ReadEntry, ReadFilegroup])\n\n/**\n * The value form of {@link ReadDeclaration}.\n *\n * @category models\n * @since 0.1.0\n */\nexport type ReadDeclaration = typeof ReadDeclaration.Type\n\n/**\n * Creates a {@link Filegroup}. It does not validate `name` or `entries`;\n * decode through {@link Filegroup} when the input is untrusted.\n *\n * @param name - The filegroup name.\n * @param entries - The entries the filegroup expands to, in order.\n * @returns The filegroup value.\n * @category constructors\n * @since 0.1.0\n */\nexport const makeFilegroup = (name: string, entries: ReadonlyArray<Entry>): Filegroup => ({\n _tag: \"Filegroup\",\n name,\n entries\n})\n\n/**\n * Replaces each {@link Filegroup} with its entries, in place, and keeps every\n * other declaration as it is. Order is preserved and duplicates are kept.\n *\n * @param declarations - Write-set declarations, possibly holding filegroups.\n * @returns The flat list of entries.\n * @category accessors\n * @since 0.1.0\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/**\n * {@link expand} for read sets: replaces each {@link ReadFilegroup} with its\n * entries, in place, preserving order and duplicates.\n *\n * @param declarations - Read-set declarations, possibly holding filegroups.\n * @returns The flat list of read entries.\n * @category accessors\n * @since 0.1.0\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/**\n * Whether a value carries the `\"Glob\"` tag. It checks only the tag, not the\n * patterns.\n *\n * @param value - Any value.\n * @returns `true` for an object whose `_tag` is `\"Glob\"`.\n * @category guards\n * @since 0.1.0\n */\nexport const isGlob = (value: unknown): value is Glob =>\n typeof value === \"object\" && value !== null && \"_tag\" in value && value._tag === \"Glob\"\n\n/**\n * Whether a value carries the `\"TreeArtifact\"` tag. It checks only the tag,\n * not the path.\n *\n * @param value - Any value.\n * @returns `true` for an object whose `_tag` is `\"TreeArtifact\"`.\n * @category guards\n * @since 0.1.0\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/**\n * Whether `path` matches `pattern` under {@link Glob} wildcard rules.\n *\n * The pattern is read in its {@link canonical} spelling; the path is matched\n * as given, case-sensitively, with `/` as its only separator.\n *\n * @param pattern - A Bazel-style pattern such as `src/*.ts` or `docs/**`.\n * @param path - A workspace-relative path.\n * @returns `true` when the path matches.\n * @category predicates\n * @since 0.1.0\n */\nexport const matchesPattern = (pattern: string, path: string): boolean => patternMatcher(pattern)(path)\n\n/**\n * Whether `path` matches some `include` pattern of `glob` and no `exclude`\n * pattern, each tested with {@link matchesPattern}. Case-sensitive.\n *\n * @param glob - The glob to test.\n * @param path - A workspace-relative path.\n * @returns `true` when the glob selects the path.\n * @category predicates\n * @since 0.1.0\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 */\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"]}
@@ -68,7 +68,6 @@ import * as Schema from "effect/Schema";
68
68
  *
69
69
  * @since 0.1.0
70
70
  * @category schemas
71
- * @slop
72
71
  */
73
72
  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
73
  /**
@@ -76,7 +75,6 @@ export declare const GraphBuildErrorCode: Schema.Literals<readonly ["planned_val
76
75
  *
77
76
  * @since 0.1.0
78
77
  * @category models
79
- * @slop
80
78
  */
81
79
  export type GraphBuildErrorCode = typeof GraphBuildErrorCode.Type;
82
80
  declare const GraphBuildError_base: Schema.Class<GraphBuildError, Schema.TaggedStruct<"@smthrs/plan/GraphBuildError", {
@@ -102,7 +100,6 @@ declare const GraphBuildError_base: Schema.Class<GraphBuildError, Schema.TaggedS
102
100
  *
103
101
  * @since 0.1.0
104
102
  * @category errors
105
- * @slop
106
103
  */
107
104
  export declare class GraphBuildError extends GraphBuildError_base {
108
105
  }
@@ -113,9 +110,10 @@ export declare class GraphBuildError extends GraphBuildError_base {
113
110
  * written, so the drafts are withheld. An advisory one reports a narrowing the
114
111
  * author should see while the graph still compiles.
115
112
  *
113
+ * @param diagnostic - A recorded refusal.
114
+ * @returns `false` only for an advisory code (`capability_outside_grant`).
116
115
  * @since 0.1.0
117
116
  * @category predicates
118
- * @slop
119
117
  */
120
118
  export declare const isFatalDiagnostic: (diagnostic: GraphBuildError) => boolean;
121
119
  export {};
@@ -1 +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"}
1
+ {"version":3,"file":"GraphBuildError.d.ts","sourceRoot":"","sources":["../../src/GraphBuildError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,mBAAmB,ohBAwB9B,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAA;;;;;;;AAEjE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,eAAgB,SAAQ,oBAKnC;CAAG;AAaL;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAAI,YAAY,eAAe,KAAG,OAA8C,CAAA"}
@@ -68,7 +68,6 @@ import * as Schema from "effect/Schema";
68
68
  *
69
69
  * @since 0.1.0
70
70
  * @category schemas
71
- * @slop
72
71
  */
73
72
  export const GraphBuildErrorCode = Schema.Literals([
74
73
  "planned_value_computed",
@@ -112,7 +111,6 @@ export const GraphBuildErrorCode = Schema.Literals([
112
111
  *
113
112
  * @since 0.1.0
114
113
  * @category errors
115
- * @slop
116
114
  */
117
115
  export class GraphBuildError extends Schema.TaggedError()("@smthrs/plan/GraphBuildError", {
118
116
  code: GraphBuildErrorCode,
@@ -138,9 +136,10 @@ const advisoryCodes = new Set(["capability_outside_grant"]);
138
136
  * written, so the drafts are withheld. An advisory one reports a narrowing the
139
137
  * author should see while the graph still compiles.
140
138
  *
139
+ * @param diagnostic - A recorded refusal.
140
+ * @returns `false` only for an advisory code (`capability_outside_grant`).
141
141
  * @since 0.1.0
142
142
  * @category predicates
143
- * @slop
144
143
  */
145
144
  export const isFatalDiagnostic = (diagnostic) => !advisoryCodes.has(diagnostic.code);
146
145
  //# sourceMappingURL=GraphBuildError.js.map
@@ -1 +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"]}
1
+ {"version":3,"file":"GraphBuildError.js","sourceRoot":"","sources":["../../src/GraphBuildError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;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;AAUF;;;;;;;;;;;;;;;;;GAiBG;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;;;;;;;;;;;GAWG;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 */\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 */\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 */\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 * @param diagnostic - A recorded refusal.\n * @returns `false` only for an advisory code (`capability_outside_grant`).\n * @since 0.1.0\n * @category predicates\n */\nexport const isFatalDiagnostic = (diagnostic: GraphBuildError): boolean => !advisoryCodes.has(diagnostic.code)\n"]}
@@ -22,9 +22,12 @@ import * as Schema from "effect/Schema";
22
22
  * `Ref{from, path: []}` — which resolve to the same dependency digest — can
23
23
  * never collide.
24
24
  *
25
+ * - `Literal` hashes `value` inline.
26
+ * - `Ref` consumes the value at `path` inside node `from`'s result.
27
+ * - `Pending` consumes node `from`'s whole result.
28
+ *
25
29
  * @since 0.1.0
26
30
  * @category schemas
27
- * @slop
28
31
  */
29
32
  export declare const InputRef: Schema.Union<readonly [Schema.TaggedStruct<"Literal", {
30
33
  readonly value: Schema.Unknown;
@@ -35,11 +38,10 @@ export declare const InputRef: Schema.Union<readonly [Schema.TaggedStruct<"Liter
35
38
  readonly from: Schema.NonEmptyString;
36
39
  }>]>;
37
40
  /**
38
- * A reference to one declared input of a node.
41
+ * The value form of {@link InputRef}.
39
42
  *
40
43
  * @since 0.1.0
41
44
  * @category models
42
- * @slop
43
45
  */
44
46
  export type InputRef = typeof InputRef.Type;
45
47
  /**
@@ -48,7 +50,6 @@ export type InputRef = typeof InputRef.Type;
48
50
  *
49
51
  * @since 0.1.0
50
52
  * @category constants
51
- * @slop
52
53
  */
53
54
  export declare const version = "flows/key-material/v2";
54
55
  /**
@@ -58,9 +59,12 @@ export declare const version = "flows/key-material/v2";
58
59
  * interpreted, which is what keeps the compiler independent of whatever the
59
60
  * flow builder decides an effect declaration looks like.
60
61
  *
62
+ * `version` must equal {@link version}. `kind` is the effect tier. `inputs`
63
+ * are hashed in order; `layers` and `capabilities` name what the node runs
64
+ * with.
65
+ *
61
66
  * @since 0.1.0
62
67
  * @category schemas
63
- * @slop
64
68
  */
65
69
  export declare const KeyMaterial: Schema.Struct<{
66
70
  readonly version: Schema.Literal<"flows/key-material/v2">;
@@ -81,11 +85,10 @@ export declare const KeyMaterial: Schema.Struct<{
81
85
  readonly placement: Schema.optional<Schema.Unknown>;
82
86
  }>;
83
87
  /**
84
- * Everything that can change a node's result, handed to the digest.
88
+ * The value form of {@link KeyMaterial}.
85
89
  *
86
90
  * @since 0.1.0
87
91
  * @category models
88
- * @slop
89
92
  */
90
93
  export type KeyMaterial = typeof KeyMaterial.Type;
91
94
  /**
@@ -94,9 +97,11 @@ export type KeyMaterial = typeof KeyMaterial.Type;
94
97
  * {@link module:Plan} uses them as the edge set — one derivation, so an edge
95
98
  * and a hashed reference can never disagree.
96
99
  *
100
+ * @param material - The node's key material.
101
+ * @returns The `from` of every `Ref` and `Pending` input, first occurrence
102
+ * order, deduplicated.
97
103
  * @since 0.1.0
98
104
  * @category accessors
99
- * @slop
100
105
  */
101
106
  export declare const dependencies: (material: KeyMaterial) => ReadonlyArray<string>;
102
107
  //# sourceMappingURL=KeyMaterial.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"KeyMaterial.d.ts","sourceRoot":"","sources":["../../src/KeyMaterial.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ;;;;;;;IAInB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,0BAA0B,CAAA;AAE9C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;EAWtB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU,WAAW,KAAG,aAAa,CAAC,MAAM,CAMxE,CAAA"}
@@ -23,9 +23,12 @@ import * as Effects from "./Effects.js";
23
23
  * `Ref{from, path: []}` — which resolve to the same dependency digest — can
24
24
  * never collide.
25
25
  *
26
+ * - `Literal` hashes `value` inline.
27
+ * - `Ref` consumes the value at `path` inside node `from`'s result.
28
+ * - `Pending` consumes node `from`'s whole result.
29
+ *
26
30
  * @since 0.1.0
27
31
  * @category schemas
28
- * @slop
29
32
  */
30
33
  export const InputRef = Schema.Union([
31
34
  Schema.TaggedStruct("Literal", { value: Schema.Unknown }),
@@ -38,7 +41,6 @@ export const InputRef = Schema.Union([
38
41
  *
39
42
  * @since 0.1.0
40
43
  * @category constants
41
- * @slop
42
44
  */
43
45
  export const version = "flows/key-material/v2";
44
46
  /**
@@ -48,9 +50,12 @@ export const version = "flows/key-material/v2";
48
50
  * interpreted, which is what keeps the compiler independent of whatever the
49
51
  * flow builder decides an effect declaration looks like.
50
52
  *
53
+ * `version` must equal {@link version}. `kind` is the effect tier. `inputs`
54
+ * are hashed in order; `layers` and `capabilities` name what the node runs
55
+ * with.
56
+ *
51
57
  * @since 0.1.0
52
58
  * @category schemas
53
- * @slop
54
59
  */
55
60
  export const KeyMaterial = Schema.Struct({
56
61
  version: Schema.Literal(version),
@@ -70,9 +75,11 @@ export const KeyMaterial = Schema.Struct({
70
75
  * {@link module:Plan} uses them as the edge set — one derivation, so an edge
71
76
  * and a hashed reference can never disagree.
72
77
  *
78
+ * @param material - The node's key material.
79
+ * @returns The `from` of every `Ref` and `Pending` input, first occurrence
80
+ * order, deduplicated.
73
81
  * @since 0.1.0
74
82
  * @category accessors
75
- * @slop
76
83
  */
77
84
  export const dependencies = (material) => {
78
85
  const seen = new Set();
@@ -1 +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,SA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AE,CAAC;QACpC,IAAI,KAAK,CAAC,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://github.com/smithersai/smithers/blob/main/packages/smithers/flows/plan/docs/concepts/step-keys.md. 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"]}
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;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;IACnC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IACzD,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,cAAc,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,M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cesContent":["/**\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://github.com/smithersai/smithers/blob/main/packages/smithers/flows/plan/docs/concepts/step-keys.md. 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 * - `Literal` hashes `value` inline.\n * - `Ref` consumes the value at `path` inside node `from`'s result.\n * - `Pending` consumes node `from`'s whole result.\n *\n * @since 0.1.0\n * @category schemas\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 * The value form of {@link InputRef}.\n *\n * @since 0.1.0\n * @category models\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 */\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 * `version` must equal {@link version}. `kind` is the effect tier. `inputs`\n * are hashed in order; `layers` and `capabilities` name what the node runs\n * with.\n *\n * @since 0.1.0\n * @category schemas\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 * The value form of {@link KeyMaterial}.\n *\n * @since 0.1.0\n * @category models\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 * @param material - The node's key material.\n * @returns The `from` of every `Ref` and `Pending` input, first occurrence\n * order, deduplicated.\n * @since 0.1.0\n * @category accessors\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"]}