@smthrs/plan 0.0.0-stage → 1.0.0-rc.12
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.
- package/CHANGELOG.md +185 -0
- package/LICENSE +21 -0
- package/README.md +230 -2
- package/THIRD_PARTY_NOTICES.md +48 -0
- package/dist/cjs/CachePolicy.d.ts +131 -0
- package/dist/cjs/CachePolicy.d.ts.map +1 -0
- package/dist/cjs/CachePolicy.js +50 -0
- package/dist/cjs/CachePolicy.js.map +7 -0
- package/dist/cjs/Effects.d.ts +258 -0
- package/dist/cjs/Effects.d.ts.map +1 -0
- package/dist/cjs/Effects.js +76 -0
- package/dist/cjs/Effects.js.map +7 -0
- package/dist/cjs/FileSet.d.ts +366 -0
- package/dist/cjs/FileSet.d.ts.map +1 -0
- package/dist/cjs/FileSet.js +196 -0
- package/dist/cjs/FileSet.js.map +7 -0
- package/dist/cjs/GraphBuildError.d.ts +120 -0
- package/dist/cjs/GraphBuildError.d.ts.map +1 -0
- package/dist/cjs/GraphBuildError.js +71 -0
- package/dist/cjs/GraphBuildError.js.map +7 -0
- package/dist/cjs/KeyMaterial.d.ts +107 -0
- package/dist/cjs/KeyMaterial.d.ts.map +1 -0
- package/dist/cjs/KeyMaterial.js +64 -0
- package/dist/cjs/KeyMaterial.js.map +7 -0
- package/dist/cjs/Node.d.ts +677 -0
- package/dist/cjs/Node.d.ts.map +1 -0
- package/dist/cjs/Node.js +229 -0
- package/dist/cjs/Node.js.map +7 -0
- package/dist/cjs/Placement.d.ts +117 -0
- package/dist/cjs/Placement.d.ts.map +1 -0
- package/dist/cjs/Placement.js +46 -0
- package/dist/cjs/Placement.js.map +7 -0
- package/dist/cjs/Plan.d.ts +489 -0
- package/dist/cjs/Plan.d.ts.map +1 -0
- package/dist/cjs/Plan.js +511 -0
- package/dist/cjs/Plan.js.map +7 -0
- package/dist/cjs/PlanDiff.d.ts +77 -0
- package/dist/cjs/PlanDiff.d.ts.map +1 -0
- package/dist/cjs/PlanDiff.js +149 -0
- package/dist/cjs/PlanDiff.js.map +7 -0
- package/dist/cjs/Planned.d.ts +121 -0
- package/dist/cjs/Planned.d.ts.map +1 -0
- package/dist/cjs/Planned.js +72 -0
- package/dist/cjs/Planned.js.map +7 -0
- package/dist/cjs/Repetition.d.ts +31 -0
- package/dist/cjs/Repetition.d.ts.map +1 -0
- package/dist/cjs/Repetition.js +36 -0
- package/dist/cjs/Repetition.js.map +7 -0
- package/dist/cjs/Scheduling.d.ts +89 -0
- package/dist/cjs/Scheduling.d.ts.map +1 -0
- package/dist/cjs/Scheduling.js +76 -0
- package/dist/cjs/Scheduling.js.map +7 -0
- package/dist/cjs/StepKey.d.ts +354 -0
- package/dist/cjs/StepKey.d.ts.map +1 -0
- package/dist/cjs/StepKey.js +313 -0
- package/dist/cjs/StepKey.js.map +7 -0
- package/dist/cjs/index.d.ts +91 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +59 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/ConflictAnnotation.d.ts +59 -0
- package/dist/cjs/internal/ConflictAnnotation.d.ts.map +1 -0
- package/dist/cjs/internal/ConflictAnnotation.js +247 -0
- package/dist/cjs/internal/ConflictAnnotation.js.map +7 -0
- package/dist/cjs/internal/EffectCandidates.d.ts +19 -0
- package/dist/cjs/internal/EffectCandidates.d.ts.map +1 -0
- package/dist/cjs/internal/EffectCandidates.js +92 -0
- package/dist/cjs/internal/EffectCandidates.js.map +7 -0
- package/dist/cjs/internal/JsonMirror.d.ts +34 -0
- package/dist/cjs/internal/JsonMirror.d.ts.map +1 -0
- package/dist/cjs/internal/JsonMirror.js +195 -0
- package/dist/cjs/internal/JsonMirror.js.map +7 -0
- package/dist/cjs/internal/SchemaIdentity.d.ts +140 -0
- package/dist/cjs/internal/SchemaIdentity.d.ts.map +1 -0
- package/dist/cjs/internal/SchemaIdentity.js +718 -0
- package/dist/cjs/internal/SchemaIdentity.js.map +7 -0
- package/dist/cjs/internal/effects.d.ts +245 -0
- package/dist/cjs/internal/effects.d.ts.map +1 -0
- package/dist/cjs/internal/effects.js +290 -0
- package/dist/cjs/internal/effects.js.map +7 -0
- package/dist/cjs/internal/node.d.ts +526 -0
- package/dist/cjs/internal/node.d.ts.map +1 -0
- package/dist/cjs/internal/node.js +313 -0
- package/dist/cjs/internal/node.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/test/PlanFixtures.d.ts +127 -0
- package/dist/cjs/test/PlanFixtures.d.ts.map +1 -0
- package/dist/cjs/test/PlanFixtures.js +59 -0
- package/dist/cjs/test/PlanFixtures.js.map +7 -0
- package/dist/esm/CachePolicy.d.ts +131 -0
- package/dist/esm/CachePolicy.d.ts.map +1 -0
- package/dist/esm/CachePolicy.js +117 -0
- package/dist/esm/CachePolicy.js.map +1 -0
- package/dist/esm/Effects.d.ts +258 -0
- package/dist/esm/Effects.d.ts.map +1 -0
- package/dist/esm/Effects.js +178 -0
- package/dist/esm/Effects.js.map +1 -0
- package/dist/esm/FileSet.d.ts +366 -0
- package/dist/esm/FileSet.d.ts.map +1 -0
- package/dist/esm/FileSet.js +398 -0
- package/dist/esm/FileSet.js.map +1 -0
- package/dist/esm/GraphBuildError.d.ts +120 -0
- package/dist/esm/GraphBuildError.d.ts.map +1 -0
- package/dist/esm/GraphBuildError.js +145 -0
- package/dist/esm/GraphBuildError.js.map +1 -0
- package/dist/esm/KeyMaterial.d.ts +107 -0
- package/dist/esm/KeyMaterial.d.ts.map +1 -0
- package/dist/esm/KeyMaterial.js +92 -0
- package/dist/esm/KeyMaterial.js.map +1 -0
- package/dist/esm/Node.d.ts +677 -0
- package/dist/esm/Node.d.ts.map +1 -0
- package/dist/esm/Node.js +586 -0
- package/dist/esm/Node.js.map +1 -0
- package/dist/esm/Placement.d.ts +117 -0
- package/dist/esm/Placement.d.ts.map +1 -0
- package/dist/esm/Placement.js +65 -0
- package/dist/esm/Placement.js.map +1 -0
- package/dist/esm/Plan.d.ts +489 -0
- package/dist/esm/Plan.d.ts.map +1 -0
- package/dist/esm/Plan.js +718 -0
- package/dist/esm/Plan.js.map +1 -0
- package/dist/esm/PlanDiff.d.ts +77 -0
- package/dist/esm/PlanDiff.d.ts.map +1 -0
- package/dist/esm/PlanDiff.js +205 -0
- package/dist/esm/PlanDiff.js.map +1 -0
- package/dist/esm/Planned.d.ts +121 -0
- package/dist/esm/Planned.d.ts.map +1 -0
- package/dist/esm/Planned.js +147 -0
- package/dist/esm/Planned.js.map +1 -0
- package/dist/esm/Repetition.d.ts +31 -0
- package/dist/esm/Repetition.d.ts.map +1 -0
- package/dist/esm/Repetition.js +24 -0
- package/dist/esm/Repetition.js.map +1 -0
- package/dist/esm/Scheduling.d.ts +89 -0
- package/dist/esm/Scheduling.d.ts.map +1 -0
- package/dist/esm/Scheduling.js +82 -0
- package/dist/esm/Scheduling.js.map +1 -0
- package/dist/esm/StepKey.d.ts +354 -0
- package/dist/esm/StepKey.d.ts.map +1 -0
- package/dist/esm/StepKey.js +503 -0
- package/dist/esm/StepKey.js.map +1 -0
- package/dist/esm/index.d.ts +91 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +91 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/ConflictAnnotation.d.ts +59 -0
- package/dist/esm/internal/ConflictAnnotation.d.ts.map +1 -0
- package/dist/esm/internal/ConflictAnnotation.js +332 -0
- package/dist/esm/internal/ConflictAnnotation.js.map +1 -0
- package/dist/esm/internal/EffectCandidates.d.ts +19 -0
- package/dist/esm/internal/EffectCandidates.d.ts.map +1 -0
- package/dist/esm/internal/EffectCandidates.js +86 -0
- package/dist/esm/internal/EffectCandidates.js.map +1 -0
- package/dist/esm/internal/JsonMirror.d.ts +34 -0
- package/dist/esm/internal/JsonMirror.d.ts.map +1 -0
- package/dist/esm/internal/JsonMirror.js +204 -0
- package/dist/esm/internal/JsonMirror.js.map +1 -0
- package/dist/esm/internal/SchemaIdentity.d.ts +140 -0
- package/dist/esm/internal/SchemaIdentity.d.ts.map +1 -0
- package/dist/esm/internal/SchemaIdentity.js +1002 -0
- package/dist/esm/internal/SchemaIdentity.js.map +1 -0
- package/dist/esm/internal/effects.d.ts +245 -0
- package/dist/esm/internal/effects.d.ts.map +1 -0
- package/dist/esm/internal/effects.js +459 -0
- package/dist/esm/internal/effects.js.map +1 -0
- package/dist/esm/internal/node.d.ts +526 -0
- package/dist/esm/internal/node.d.ts.map +1 -0
- package/dist/esm/internal/node.js +565 -0
- package/dist/esm/internal/node.js.map +1 -0
- package/dist/esm/test/PlanFixtures.d.ts +127 -0
- package/dist/esm/test/PlanFixtures.d.ts.map +1 -0
- package/dist/esm/test/PlanFixtures.js +60 -0
- package/dist/esm/test/PlanFixtures.js.map +1 -0
- package/docs/README.md +167 -0
- package/docs/api.md +1485 -0
- package/docs/concepts/authoring-ast.md +204 -0
- package/docs/concepts/effects-and-conflicts.md +135 -0
- package/docs/concepts/plan-value.md +168 -0
- package/docs/concepts/step-keys.md +179 -0
- package/docs/guides/author-a-node-graph.md +182 -0
- package/docs/guides/compile-a-plan.md +146 -0
- package/docs/guides/declare-file-effects.md +143 -0
- package/docs/guides/diff-two-plans.md +310 -0
- package/docs/installation.md +75 -0
- package/docs/quickstart.md +128 -0
- package/docs/testing.md +73 -0
- package/docs/troubleshooting.md +314 -0
- package/package.json +255 -3
- package/src/CachePolicy.ts +143 -0
- package/src/Effects.ts +302 -0
- package/src/FileSet.ts +493 -0
- package/src/GraphBuildError.ts +156 -0
- package/src/KeyMaterial.ts +111 -0
- package/src/Node.ts +969 -0
- package/src/Placement.ts +99 -0
- package/src/Plan.ts +911 -0
- package/src/PlanDiff.ts +244 -0
- package/src/Planned.ts +208 -0
- package/src/Repetition.ts +33 -0
- package/src/Scheduling.ts +154 -0
- package/src/StepKey.ts +736 -0
- package/src/index.ts +103 -0
- package/src/internal/ConflictAnnotation.ts +374 -0
- package/src/internal/EffectCandidates.ts +89 -0
- package/src/internal/JsonMirror.ts +255 -0
- package/src/internal/SchemaIdentity.ts +1096 -0
- package/src/internal/effects.ts +543 -0
- package/src/internal/node.ts +859 -0
- package/src/test/PlanFixtures.ts +76 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plan.js","sourceRoot":"","sources":["../../src/Plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEpD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,SAAS,MAAM,kCAAkC,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC;IAC5C,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;IACzC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,4DAA4D;IAC5D,YAAY,EAAE,OAAO,CAAC,YAAY;CACnC,CAAC,CAAA;AAUF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,O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C,MAAM,CAAC,IAAI,CACvB,OAAO,CAAC,gFAAgF,CAAC,CAC1F,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;AAC1C,CAAC,CAAC,CAAA;AAEJ;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAU,EAA2B,EAAE,CACrE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,CAAA;AAElE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAc,EAAiB,EAAE,CAC1D,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,WAAW,CAAC,GAAG,CAAC,KAAa,CAAC,CAAA;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,IAAU,EACoF,EAAE,CAChG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA","sourcesContent":["/**\n * The plan: a node graph with every step key computed, inert until run.\n *\n * The way a plan is produced is a law: **planning performs no I/O**.\n * Everything in this module is therefore a pure function of declarations plus\n * the injected `Crypto` service: no filesystem, no clock, no network. A node's\n * key is a function of what it consumes, so an edited declaration re-keys that\n * node and everything downstream of it, and nothing else. That is the entire\n * invalidation mechanism. Invalidation is re-keying, which **rejects**\n * Skyframe's reverse-dependency index and invalidating node visitor outright\n * because content addressing subsumes them. Key invalidation never retains a\n * reverse-dependency index; annotation uses only a temporary reachability cache.\n *\n * Growth is append-only: {@link append} adds a pre-keyed subgraph to the same\n * plan and never rewrites a node already in it.\n *\n * @since 0.1.0\n */\n\nimport { DerivedKey, StoredKey } from \"@smthrs/keys\"\nimport type * as Crypto from \"effect/Crypto\"\nimport * as Effect from \"effect/Effect\"\nimport * as Inspectable from \"effect/Inspectable\"\nimport * as Schema from \"effect/Schema\"\nimport * as Effects from \"./Effects.ts\"\nimport * as FileSet from \"./FileSet.ts\"\nimport { GraphBuildError } from \"./GraphBuildError.ts\"\nimport * as Conflicts from \"./internal/ConflictAnnotation.ts\"\nimport { jsonMirror } from \"./internal/JsonMirror.ts\"\nimport * as KeyMaterial from \"./KeyMaterial.ts\"\nimport * as StepKey from \"./StepKey.ts\"\n\n/**\n * What a node does to the world, declared. Paths only — measuring them is\n * run-time work, so a digest here would break the no-I/O law.\n *\n * Decoding fails with a `SchemaError` when a path is not workspace-relative.\n * {@link compile} also refuses a node whose `removes` overlaps its `writes`\n * with an `invalid_effects` {@link PlanError}.\n *\n * @since 0.1.0\n * @category schemas\n */\nexport const NodeEffects = Schema.Struct({\n /** Paths the node reads. A read orders the node after every writer of an overlapping path. */\n reads: Schema.Array(FileSet.ReadDeclaration),\n /** Paths the node writes. Two writers of an overlapping path form a conflict. */\n writes: Schema.Array(FileSet.Declaration),\n /**\n * Paths the node declares it will DELETE. A removal mutates the world exactly\n * as a write does, so {@link produces} folds the two together and both the\n * conflict pass and the reader-after-writer pass see them as one set.\n */\n removes: Schema.optional(Schema.Array(FileSet.Pattern)),\n /** How strictly the sandbox enforces these declarations. */\n boundaryMode: FileSet.BoundaryMode\n})\n\n/**\n * The value form of {@link NodeEffects}.\n *\n * @since 0.1.0\n * @category models\n */\nexport type NodeEffects = typeof NodeEffects.Type\n\n/**\n * The plan-time verdict for two writers of an overlapping path:\n * `serialize` gives the later writer an ordering edge, `lane` records a lane\n * annotation on both writers and adds no edge, and `fail` refuses the plan\n * with `overlap_forbidden`. For a pair, `fail` dominates `lane`, which\n * dominates `serialize`. The same schema as `Effects.ConflictStrategy`.\n *\n * @since 0.1.0\n * @category schemas\n */\nexport const PairStrategy = Effects.ConflictStrategy\n\n/**\n * The value form of {@link PairStrategy}.\n *\n * @since 0.1.0\n * @category models\n */\nexport type PairStrategy = typeof PairStrategy.Type\n\n/**\n * The runtime half of a conflict annotation: what the scheduler\n * does when the overlap the plan predicted actually bites, or when a\n * scheduled node's inputs are invalidated under it. For a pair,\n * `stop-merge` dominates `delay-rebase`.\n *\n * @since 0.1.0\n * @category schemas\n */\nexport const RuntimeStrategy = Schema.Literals([\"delay-rebase\", \"stop-merge\"])\n\n/**\n * The value form of {@link RuntimeStrategy}.\n *\n * @since 0.1.0\n * @category models\n */\nexport type RuntimeStrategy = typeof RuntimeStrategy.Type\n\n/** @private */\nconst NodeKind = Schema.Literals([\"step\", \"agent\", \"merge\"])\n\n/**\n * One resolved overlap between two writers that no dependency path already\n * orders. Conflict is a property of the PAIR, not of one declaration.\n *\n * `with` names the other node, `paths` lists the overlapping declarations,\n * and `strategy` and `runtime` are the verdicts resolved for the pair.\n *\n * @since 0.1.0\n * @category schemas\n */\nexport const ConflictAnnotation = Schema.Struct({\n with: Schema.NonEmptyString,\n paths: Schema.Array(Schema.String),\n strategy: PairStrategy,\n runtime: RuntimeStrategy\n})\n\n/**\n * The value form of {@link ConflictAnnotation}.\n *\n * @since 0.1.0\n * @category models\n */\nexport type ConflictAnnotation = typeof ConflictAnnotation.Type\n\n/**\n * A keyed node of the plan.\n *\n * `dependsOn` is the *edge* set: material references, any ordering edge a\n * `serialize` verdict added, and the reader-after-writer edges that put a\n * node behind whoever produces the paths it reads. Ordering edges are\n * deliberately NOT part of the key — a node ordered behind another still\n * computes the same result, so re-keying it would throw away a legitimate\n * cache hit.\n *\n * `strategy` and `runtime` are this declaration's own preferences, recorded so\n * a later elaboration can resolve a pair against them without re-reading the\n * flow source.\n *\n * `generation` is 0 for nodes from {@link compile} and grows by one with each\n * {@link append}.\n *\n * @since 0.1.0\n * @category schemas\n */\nexport const PlanNode = Schema.Struct({\n id: Schema.NonEmptyString,\n kind: NodeKind,\n key: StoredKey,\n material: KeyMaterial.KeyMaterial,\n effects: NodeEffects,\n dependsOn: Schema.Array(Schema.NonEmptyString),\n conflicts: Schema.Array(ConflictAnnotation),\n strategy: PairStrategy,\n runtime: RuntimeStrategy,\n priority: Schema.Int,\n generation: Schema.Int\n})\n\n/**\n * The value form of {@link PlanNode}.\n *\n * @since 0.1.0\n * @category models\n */\nexport type PlanNode = typeof PlanNode.Type\n\n/**\n * A plan: the whole keyed graph plus the digest an approval binds to.\n *\n * `nodes` follows material-dependency order within each generation. Inferred\n * edges can point to later entries; schedule from the complete `dependsOn`\n * graph, never by iterating the array alone.\n *\n * `baseDigest` is the digest at generation 0: what a human approved and what\n * a `RUNNING` run pins. `digest` advances with every appended elaboration.\n *\n * Decoding checks only the shape. Use {@link verify} to check that keys,\n * edges, and digests match the declarations.\n *\n * @since 0.1.0\n * @category schemas\n */\nexport const Plan = Schema.Struct({\n planId: Schema.NonEmptyString,\n flow: Schema.NonEmptyString,\n generation: Schema.Int,\n baseDigest: StoredKey,\n digest: StoredKey,\n nodes: Schema.Array(PlanNode)\n})\n\n/**\n * The value form of {@link Plan}.\n *\n * @since 0.1.0\n * @category models\n */\nexport type Plan = typeof Plan.Type\n\n/**\n * What a planner hands {@link compile}: a node without its key.\n *\n * @since 0.1.0\n * @category models\n */\nexport interface NodeDraft {\n /** A non-empty id, unique within the plan. */\n readonly id: string\n /** The key inputs. Its `Ref` inputs name the node's material dependencies. */\n readonly material: KeyMaterial.KeyMaterial\n /** The declared reads, writes, and removals. They replace `material.effects`. */\n readonly effects: NodeEffects\n /** `step`, `agent`, or `merge`. Defaults to `step`. */\n readonly kind?: PlanNode[\"kind\"] | undefined\n /** A safe integer scheduling priority. Defaults to 0. */\n readonly priority?: number | undefined\n /** This declaration's preferred plan-time verdict for a detected overlap. */\n readonly conflictStrategy?: PairStrategy | undefined\n /** This declaration's preferred runtime response. */\n readonly runtimeStrategy?: RuntimeStrategy | undefined\n}\n\n/**\n * A graph the compiler refuses. `code` names the rule:\n *\n * - `cycle`: material or inferred edges form a cycle.\n * - `unknown_dependency`: a `Ref` names a node that is not in the plan.\n * - `duplicate_node`: two nodes share an id.\n * - `overlap_forbidden`: two unordered writers overlap and the pair's\n * strategy is `fail`.\n * - `invalid_effects`: a node both writes and removes one path.\n * - `invalid_node`: a draft field, the plan id, or the flow name is malformed.\n * - `invalid_plan`: {@link verify} found a plan that does not match its\n * declarations.\n * - `graph_too_large`: the plan exceeds {@link maximumPlanNodes} or the\n * effect-analysis work budget.\n *\n * @since 0.1.0\n * @category errors\n */\nexport class PlanError extends Schema.TaggedError<PlanError>()(\"@smthrs/plan/PlanError\", {\n code: Schema.Literals([\n \"cycle\",\n \"unknown_dependency\",\n \"duplicate_node\",\n \"overlap_forbidden\",\n \"invalid_effects\",\n \"invalid_node\",\n \"invalid_plan\",\n \"graph_too_large\"\n ]),\n message: Schema.String\n}) {}\n\n/**\n * Maximum number of nodes retained by one compiled plan.\n *\n * Effect analysis also has a yielding work budget, since a node ceiling alone\n * does not bound dense conflicts to practical work.\n *\n * @since 1.0.0\n * @category limits\n */\nexport const maximumPlanNodes = 10_000\n\n/** @private */\nconst graphSizeError = (size: number): PlanError =>\n new PlanError({\n code: \"graph_too_large\",\n message: `A plan may contain at most ${maximumPlanNodes} nodes, received ${size}`\n })\n\n/** @private */\ntype Ordered =\n | { readonly ok: true; readonly drafts: ReadonlyArray<NodeDraft> }\n | { readonly ok: false; readonly error: PlanError }\n\n/**\n * Topologically orders drafts by their MATERIAL dependencies — the only edges\n * that exist before keys do.\n *\n * @private\n */\nconst topological = (drafts: ReadonlyArray<NodeDraft>, known: ReadonlySet<string>): Ordered => {\n const byId = new Map(drafts.map((draft) => [draft.id, draft]))\n const ordered: Array<NodeDraft> = []\n const state = new Map<string, \"visiting\" | \"done\">()\n interface Frame {\n readonly draft: NodeDraft\n readonly dependencies: ReadonlyArray<string>\n next: number\n }\n for (const draft of drafts) {\n if (state.get(draft.id) === \"done\") continue\n state.set(draft.id, \"visiting\")\n const stack: Array<Frame> = [{ draft, dependencies: KeyMaterial.dependencies(draft.material), next: 0 }]\n while (stack.length > 0) {\n const frame = stack[stack.length - 1]!\n if (frame.next === frame.dependencies.length) {\n state.set(frame.draft.id, \"done\")\n ordered.push(frame.draft)\n stack.pop()\n continue\n }\n const dependency = frame.dependencies[frame.next++]!\n if (known.has(dependency)) continue\n const next = byId.get(dependency)\n if (next === undefined) {\n return {\n ok: false,\n error: new PlanError({\n code: \"unknown_dependency\",\n message: `Node ${frame.draft.id} depends on unknown node ${dependency}`\n })\n }\n }\n const mark = state.get(next.id)\n if (mark === \"done\") continue\n if (mark === \"visiting\") {\n return {\n ok: false,\n error: new PlanError({ code: \"cycle\", message: `Plan cycle through node ${next.id}` })\n }\n }\n state.set(next.id, \"visiting\")\n stack.push({ draft: next, dependencies: KeyMaterial.dependencies(next.material), next: 0 })\n }\n }\n return { ok: true, drafts: ordered }\n}\n\n/**\n * Runs the conflict and reader-after-writer passes and records what they found\n * on every node outside `frozen`, whose rows an append never rewrites. A\n * refused graph fails as a `PlanError` carrying the pass's code and message.\n *\n * @private\n */\nconst annotate = (\n nodes: ReadonlyArray<PlanNode>,\n frozen: ReadonlySet<string>,\n replayGenerations = false\n): Effect.Effect<ReadonlyArray<PlanNode>, PlanError> =>\n Conflicts.annotate(nodes, frozen.size, replayGenerations).pipe(\n Effect.mapError((refusal) => new PlanError(refusal)),\n Effect.map(({ conflicts, ordering }) =>\n nodes.map((node) => {\n if (frozen.has(node.id)) return node\n const added = ordering.get(node.id) ?? []\n return freezeNode({\n ...node,\n conflicts: conflicts.get(node.id) ?? [],\n dependsOn: added.length === 0 ? node.dependsOn : [...node.dependsOn, ...added]\n })\n })\n )\n )\n\n/**\n * The single approval projection. Its node list is the complete reviewable and\n * behavior-bearing contract: id, kind, key, edges, conflict annotations,\n * declared effects, conflict strategy, runtime strategy, and priority.\n *\n * @private\n */\nconst approvalPayload = (\n planId: string,\n flow: string,\n nodes: ReadonlyArray<PlanNode>\n) => ({\n body: { kind: \"plan\", planId, flow },\n inputs: {\n nodes: nodes.map((node) => ({\n id: node.id,\n kind: node.kind,\n key: node.key,\n dependsOn: node.dependsOn,\n conflicts: node.conflicts,\n effects: node.effects,\n strategy: node.strategy,\n runtime: node.runtime,\n priority: node.priority\n }))\n },\n layers: [],\n capabilities: {}\n})\n\n/**\n * The plan's digest: what an approval binds to. Deriving it only from\n * {@link approvalPayload} keeps the approved field list in one place.\n *\n * @private\n */\nconst digestOf = (\n planId: string,\n flow: string,\n nodes: ReadonlyArray<PlanNode>\n): Effect.Effect<StepKey.StepKey, StepKey.KeyMaterialError | Schema.SchemaError, Crypto.Crypto> =>\n StepKey.content(approvalPayload(planId, flow, nodes))\n\n/** @private */\nconst maximumDescriptionLength = 256\n\n/** @private */\nconst describeValue = (value: unknown): string => {\n const rendered = typeof value === \"string\" ? JSON.stringify(value) : Inspectable.toStringUnknown(value, 0)\n return rendered.length > maximumDescriptionLength\n ? `${rendered.slice(0, maximumDescriptionLength - 3)}...`\n : rendered\n}\n\n/** @private */\nconst describeNodeId = (id: string): string => id.length > maximumDescriptionLength ? describeValue(id) : id\n\n/** @private */\nconst validateIdentity = (planId: unknown, flow: unknown): PlanError | undefined => {\n if (typeof planId !== \"string\" || planId.length === 0) {\n return new PlanError({\n code: \"invalid_node\",\n message: `Plan option planId must be a non-empty string, received ${describeValue(planId)}`\n })\n }\n if (typeof flow !== \"string\" || flow.length === 0) {\n return new PlanError({\n code: \"invalid_node\",\n message: `Plan option flow must be a non-empty string, received ${describeValue(flow)}`\n })\n }\n return undefined\n}\n\n/** Whether `value` is a container this module may safely copy. */\nconst isSnapshotContainer = (value: unknown): value is object => {\n if (typeof value !== \"object\" || value === null) return false\n if (Array.isArray(value)) return true\n const prototype = Object.getPrototypeOf(value)\n return prototype === Object.prototype || prototype === null\n}\n\n/** Creates an empty container with the source container's supported prototype. */\nconst emptySnapshot = (source: object): object =>\n Array.isArray(source) ? [] : Object.create(Object.getPrototypeOf(source)) as object\n\n/**\n * Copies and freezes plain structural containers without interpreting them as\n * JSON. Shared references and cycles point at one cloned container through\n * `memo`; every other value passes through by reference and remains unfrozen.\n * In particular, this does not probe a `Planned` proxy. `validateDrafts`\n * creates the inert material mirror inside the Effect while retaining that\n * proxy, so the canonical serializer still reaches and refuses it.\n */\nconst snapshot = <A extends object>(value: A): A => {\n const root = emptySnapshot(value)\n const memo = new WeakMap<object, object>([[value, root]])\n const pending: Array<{ readonly source: object; readonly target: object }> = [{ source: value, target: root }]\n const created = [root]\n\n while (pending.length > 0) {\n const { source, target } = pending.pop()!\n for (const key of Reflect.ownKeys(source)) {\n const descriptor = Object.getOwnPropertyDescriptor(source, key)!\n if (\"value\" in descriptor && isSnapshotContainer(descriptor.value)) {\n let child = memo.get(descriptor.value)\n if (child === undefined) {\n child = emptySnapshot(descriptor.value)\n memo.set(descriptor.value, child)\n pending.push({ source: descriptor.value, target: child })\n created.push(child)\n }\n descriptor.value = child\n }\n Object.defineProperty(target, key, descriptor)\n }\n }\n\n for (const container of created) Object.freeze(container)\n return root as A\n}\n\n/** Freezes one node built by this module while retaining its material snapshot. */\nconst freezeNode = (node: PlanNode): PlanNode =>\n Object.freeze({\n ...node,\n dependsOn: Object.freeze([...node.dependsOn]),\n conflicts: Object.freeze(\n node.conflicts.map((conflict) => Object.freeze({ ...conflict, paths: Object.freeze([...conflict.paths]) }))\n )\n })\n\n/** Plans whose complete immutable snapshot was created by this module. */\nconst frozenPlans = new WeakSet<Plan>()\n\n/** Freezes the plan envelope and its newly built node list. */\nconst freezePlan = (plan: Plan): Plan => {\n const frozen = Object.freeze({ ...plan, nodes: Object.freeze([...plan.nodes]) })\n frozenPlans.add(frozen)\n return frozen\n}\n\n/**\n * Validates the runtime-only parts of `NodeDraft` without replacing effect\n * admission. Effect 4 Struct decoding strips excess properties and copies its\n * schema arrays. The decoded effect declaration replaces any caller-supplied\n * `material.effects`, and every accepted draft receives one deeply frozen JSON\n * mirror for both storage and hashing.\n *\n * @private\n */\nconst validateDrafts = (\n drafts: ReadonlyArray<NodeDraft>\n): Effect.Effect<ReadonlyArray<NodeDraft>, PlanError> =>\n Effect.forEach(drafts, (draft) =>\n Effect.gen(function*() {\n if (typeof draft.id !== \"string\" || draft.id.length === 0) {\n return yield* Effect.fail(\n new PlanError({\n code: \"invalid_node\",\n message: `Node id must be a non-empty string, received ${describeValue(draft.id)}`\n })\n )\n }\n const nodeId = describeNodeId(draft.id)\n if (draft.priority !== undefined && !Number.isSafeInteger(draft.priority)) {\n return yield* Effect.fail(\n new PlanError({\n code: \"invalid_node\",\n message: `Node ${nodeId} priority must be a safe integer, received ${describeValue(draft.priority)}`\n })\n )\n }\n if (draft.kind !== undefined && !Schema.is(NodeKind)(draft.kind)) {\n return yield* Effect.fail(\n new PlanError({\n code: \"invalid_node\",\n message: `Node ${nodeId} kind must be step, agent, or merge, received ${describeValue(draft.kind)}`\n })\n )\n }\n if (draft.conflictStrategy !== undefined && !Schema.is(PairStrategy)(draft.conflictStrategy)) {\n return yield* Effect.fail(\n new PlanError({\n code: \"invalid_node\",\n message: `Node ${nodeId} conflictStrategy must be serialize, lane, or fail, received ${\n describeValue(draft.conflictStrategy)\n }`\n })\n )\n }\n if (draft.runtimeStrategy !== undefined && !Schema.is(RuntimeStrategy)(draft.runtimeStrategy)) {\n return yield* Effect.fail(\n new PlanError({\n code: \"invalid_node\",\n message: `Node ${nodeId} runtimeStrategy must be delay-rebase or stop-merge, received ${\n describeValue(draft.runtimeStrategy)\n }`\n })\n )\n }\n const decodedMaterial = yield* Schema.decodeUnknownEffect(KeyMaterial.KeyMaterial)(draft.material).pipe(\n Effect.mapError((cause) =>\n new PlanError({\n code: \"invalid_node\",\n message: `Node ${nodeId} has invalid material: ${cause.message}`\n })\n )\n )\n const decodedEffects = yield* Schema.decodeUnknownEffect(NodeEffects)(draft.effects).pipe(\n Effect.mapError((cause) =>\n new PlanError({\n code: \"invalid_node\",\n message: `Node ${nodeId} has invalid effects: ${cause.message}`\n })\n )\n )\n let material: KeyMaterial.KeyMaterial\n try {\n material = snapshot(\n jsonMirror({ ...decodedMaterial, effects: decodedEffects }, (planned) => planned) as KeyMaterial.KeyMaterial\n )\n } catch (cause) {\n const path = cause instanceof GraphBuildError ? cause.path : []\n return yield* Effect.fail(\n new PlanError({\n code: \"invalid_node\",\n message: `Node ${nodeId} has invalid material payload at ${[\"$\", ...path].join(\".\")}`\n })\n )\n }\n return Object.freeze({\n ...draft,\n material,\n effects: material.effects as NodeEffects\n })\n }))\n\n/**\n * The effects schema admits each individual declaration in `validateDrafts`.\n * This pass enforces the cross-field invariant that one path cannot be both a\n * write and a removal.\n *\n * @private\n */\nconst validateEffects = (id: string, effects: NodeEffects): PlanError | undefined => {\n const removes = effects.removes ?? []\n const writes = FileSet.expand(effects.writes)\n for (const removal of removes) {\n if (writes.some((entry) => FileSet.overlaps(entry, removal))) {\n return new PlanError({\n code: \"invalid_effects\",\n message: `Node ${id} declares ${removal} as both a write and a removal`\n })\n }\n }\n return undefined\n}\n\n/** @private */\nconst keyNodes = (\n drafts: ReadonlyArray<NodeDraft>,\n existing: ReadonlyArray<PlanNode>,\n generation: number\n): Effect.Effect<\n ReadonlyArray<PlanNode>,\n PlanError | StepKey.KeyMaterialError | Schema.SchemaError,\n Crypto.Crypto\n> =>\n Effect.gen(function*() {\n const digests: Record<string, string> = Object.create(null) as Record<string, string>\n const known = new Set<string>()\n for (const node of existing) {\n Object.defineProperty(digests, node.id, {\n configurable: true,\n enumerable: true,\n value: node.key,\n writable: true\n })\n known.add(node.id)\n }\n for (const draft of drafts) {\n if (known.has(draft.id)) {\n return yield* Effect.fail(\n new PlanError({ code: \"duplicate_node\", message: `Node ${draft.id} is already in the plan` })\n )\n }\n known.add(draft.id)\n }\n const sorted = topological(drafts, new Set(existing.map((node) => node.id)))\n if (!sorted.ok) return yield* Effect.fail(sorted.error)\n const keyed: Array<PlanNode> = []\n for (const draft of sorted.drafts) {\n const invalid = validateEffects(draft.id, draft.effects)\n if (invalid !== undefined) return yield* Effect.fail(invalid)\n const key = yield* StepKey.planIdentity(draft.material, digests)\n Object.defineProperty(digests, draft.id, {\n configurable: true,\n enumerable: true,\n value: key,\n writable: true\n })\n keyed.push(freezeNode({\n id: draft.id,\n kind: draft.kind ?? \"step\",\n key,\n material: draft.material,\n effects: draft.effects,\n dependsOn: KeyMaterial.dependencies(draft.material),\n conflicts: [],\n strategy: draft.conflictStrategy ?? \"serialize\",\n runtime: draft.runtimeStrategy ?? \"delay-rebase\",\n priority: draft.priority ?? 0,\n generation\n }))\n }\n return keyed\n })\n\n/**\n * Compiles drafts into a plan: material-dependency order, dependency-digest\n * substitution, overlap annotation, and the plan digest. No I/O.\n * Inferred edges extend `dependsOn` without reordering the node array.\n *\n * Traversal uses explicit stacks. Because the conflict and reader/writer\n * passes consider a quadratic number of node pairs, plans are bounded by\n * {@link maximumPlanNodes} and fail with `graph_too_large` above that limit\n * or the effect-analysis work budget. Analysis yields periodically.\n *\n * The options and drafts are copied when `compile` is called, so later\n * caller mutation does not reach the plan. The result is deeply frozen.\n *\n * @param options - `planId` and `flow` name the plan; `nodes` are the drafts.\n * @returns The generation-0 plan, whose `baseDigest` equals its `digest`.\n * Fails with {@link PlanError} for a refused graph, `KeyMaterialError` or\n * `SchemaError` when a key cannot be derived.\n * @since 0.1.0\n * @category constructors\n */\nexport const compile = (options: {\n readonly planId: string\n readonly flow: string\n readonly nodes: ReadonlyArray<NodeDraft>\n}): Effect.Effect<Plan, PlanError | StepKey.KeyMaterialError | Schema.SchemaError, Crypto.Crypto> => {\n const captured = snapshot(options)\n return Effect.gen(function*() {\n const invalidIdentity = validateIdentity(captured.planId, captured.flow)\n if (invalidIdentity !== undefined) return yield* Effect.fail(invalidIdentity)\n if (captured.nodes.length > maximumPlanNodes) return yield* Effect.fail(graphSizeError(captured.nodes.length))\n const drafts = yield* validateDrafts(captured.nodes)\n const keyed = yield* keyNodes(drafts, [], 0)\n const nodes = yield* annotate(keyed, new Set())\n const digest = yield* digestOf(captured.planId, captured.flow, nodes)\n return freezePlan({\n planId: captured.planId,\n flow: captured.flow,\n generation: 0,\n baseDigest: digest,\n digest,\n nodes\n })\n })\n}\n\n/**\n * Appends an elaborated subgraph to an existing plan.\n *\n * The plan GROWS; it is never invalidated. Nodes already in it keep their id,\n * key, edges, and generation byte for byte, and the new nodes arrive pre-keyed\n * against them, so a `hit` shows instantly. New nodes retain their material\n * dependency order; scheduling must honor their complete `dependsOn` graph.\n * Re-ordering after a reconciliation happens by re-keying *future* steps,\n * never by rewriting history.\n *\n * A plan not produced by this module is checked with {@link verify} first.\n *\n * @param plan - The plan to grow.\n * @param drafts - At least one new node. Ids must not repeat existing ones;\n * `Ref` inputs may name existing nodes.\n * @returns The plan with one more generation and a new `digest`. Fails with\n * {@link PlanError} (`invalid_node` for an empty `drafts`, `invalid_plan` for a\n * plan that fails verification), `KeyMaterialError`, or `SchemaError`.\n * @since 0.1.0\n * @category constructors\n */\nexport const append = (\n plan: Plan,\n drafts: ReadonlyArray<NodeDraft>\n): Effect.Effect<Plan, PlanError | StepKey.KeyMaterialError | Schema.SchemaError, Crypto.Crypto> => {\n const candidate = frozenPlans.has(plan) ? plan : snapshot(plan)\n const capturedDrafts = snapshot(drafts)\n return Effect.gen(function*() {\n const invalidIdentity = validateIdentity(candidate.planId, candidate.flow)\n if (invalidIdentity !== undefined) return yield* Effect.fail(invalidIdentity)\n const capturedPlan = yield* verify(candidate)\n const nextSize = capturedPlan.nodes.length + capturedDrafts.length\n if (nextSize > maximumPlanNodes) return yield* Effect.fail(graphSizeError(nextSize))\n const validated = yield* validateDrafts(capturedDrafts)\n if (validated.length === 0) {\n return yield* Effect.fail(\n new PlanError({\n code: \"invalid_node\",\n message: `Plan ${capturedPlan.planId} append requires at least one draft`\n })\n )\n }\n const generation = capturedPlan.generation + 1\n const keyed = yield* keyNodes(validated, capturedPlan.nodes, generation)\n const nodes = yield* annotate(\n [...capturedPlan.nodes, ...keyed],\n new Set(capturedPlan.nodes.map((node) => node.id))\n )\n const digest = yield* digestOf(capturedPlan.planId, capturedPlan.flow, nodes)\n return freezePlan({ ...capturedPlan, generation, digest, nodes })\n })\n}\n\n/**\n * Verifies an imported plan against the same key and topology rules as the\n * compiler. Valid compiler-owned immutable values need no second compilation.\n *\n * Generation boundaries are replayed when reconstructing conflict annotations:\n * an append may annotate new nodes, but cannot rewrite an earlier generation.\n * Recorded material-dependency order is verified without sorting inferred edges.\n * Keys and approval digests retain their existing format. The returned snapshot\n * is immutable; later caller mutation cannot change the verified value.\n *\n * @since 1.0.0\n * @category validation\n */\nexport const verify = (\n input: unknown\n): Effect.Effect<Plan, PlanError | StepKey.KeyMaterialError | Schema.SchemaError, Crypto.Crypto> =>\n Effect.gen(function*() {\n if (typeof input === \"object\" && input !== null && frozenPlans.has(input as Plan)) return input as Plan\n // Check the array ceiling before schema decoding copies its members.\n if (typeof input === \"object\" && input !== null && \"nodes\" in input && Array.isArray(input.nodes)) {\n if (input.nodes.length > maximumPlanNodes) return yield* Effect.fail(graphSizeError(input.nodes.length))\n }\n const decoded = yield* Schema.decodeUnknownEffect(Plan)(input)\n const invalid = (message: string) => new PlanError({ code: \"invalid_plan\", message })\n if (\n !Number.isSafeInteger(decoded.generation) || decoded.generation < 0 || decoded.generation > decoded.nodes.length\n ) {\n return yield* Effect.fail(\n invalid(\"Plan generation must be a non-negative safe integer with a nonempty appended generation\")\n )\n }\n const generations = new Map<string, number>()\n let previous = 0\n for (const node of decoded.nodes) {\n if (!Number.isSafeInteger(node.generation) || node.generation < previous || node.generation > previous + 1) {\n return yield* Effect.fail(invalid(`Node ${node.id} has an invalid or out-of-order generation`))\n }\n generations.set(node.id, node.generation)\n previous = node.generation\n }\n if (previous !== decoded.generation) {\n return yield* Effect.fail(invalid(\"Plan generation does not match its newest nodes\"))\n }\n for (const node of decoded.nodes) {\n for (const dependency of KeyMaterial.dependencies(node.material)) {\n const generation = generations.get(dependency)\n if (generation !== undefined && generation > node.generation) {\n return yield* Effect.fail(invalid(`Node ${node.id} refers to a future generation`))\n }\n }\n }\n const drafts = yield* validateDrafts(decoded.nodes.map((node) => ({\n id: node.id,\n kind: node.kind,\n material: node.material,\n effects: node.effects,\n conflictStrategy: node.strategy,\n runtimeStrategy: node.runtime,\n priority: node.priority\n })))\n const keyed = (yield* keyNodes(drafts, [], 0)).map((node) =>\n freezeNode({ ...node, generation: generations.get(node.id)! })\n )\n // Replay boundaries within one annotation pass, retaining its expansion\n // map, candidate trie, inferred graph and reachability cache throughout.\n const nodes = yield* annotate(keyed, new Set(), true)\n const baseDigest = yield* digestOf(decoded.planId, decoded.flow, nodes.filter((node) => node.generation === 0))\n const digest = decoded.generation === 0 ? baseDigest : yield* digestOf(decoded.planId, decoded.flow, nodes)\n if (decoded.baseDigest !== baseDigest || decoded.digest !== digest) {\n return yield* Effect.fail(invalid(\"Plan approval digest does not match its compiled content\"))\n }\n // Compare the complete node contract, including material and generation,\n // rather than trusting the claimed keys or the approval projection alone.\n const hash = Schema.decodeUnknownEffect(DerivedKey)\n if ((yield* hash(decoded.nodes)) !== (yield* hash(nodes))) {\n return yield* Effect.fail(\n invalid(\"Plan nodes do not match their compiled keys, effects, ordering, or generations\")\n )\n }\n return freezePlan({ ...decoded, nodes })\n })\n\n/**\n * The nodes added by the newest generation: what {@link module:PlanStore}\n * appends and what the `subgraph-appended` journal record names.\n *\n * @param plan - A plan.\n * @returns The nodes whose generation equals `plan.generation`, in order.\n * @since 0.1.0\n * @category accessors\n */\nexport const generationNodes = (plan: Plan): ReadonlyArray<PlanNode> =>\n plan.nodes.filter((node) => node.generation === plan.generation)\n\n/**\n * Whether `input` is a compiler-owned immutable snapshot that already passed\n * {@link verify}: such values take verify's trusted fast path and need no\n * second schema validation.\n *\n * @param input - Any value.\n * @returns `true` only for a plan returned by {@link compile},\n * {@link append}, or {@link verify}; a structurally equal copy returns `false`.\n * @since 1.0.0\n * @category guards\n */\nexport const isVerified = (input: unknown): input is Plan =>\n typeof input === \"object\" && input !== null && frozenPlans.has(input as Plan)\n\n/**\n * The approval digest of every generation before the newest: the digest this\n * plan carried before its last append. {@link module:PlanStore}'s append\n * matches it against the stored envelope, so an append proves the recorded\n * plan's integrity from the already-verified prefix instead of decoding and\n * re-verifying every stored row.\n *\n * For a generation-0 plan no generation precedes the newest, so this is the\n * digest of an empty node list.\n *\n * @param plan - A plan.\n * @returns The approval digest of the nodes older than `plan.generation`.\n * @since 1.0.0\n * @category accessors\n */\nexport const prefixDigest = (\n plan: Plan\n): Effect.Effect<StepKey.StepKey, StepKey.KeyMaterialError | Schema.SchemaError, Crypto.Crypto> =>\n digestOf(plan.planId, plan.flow, plan.nodes.filter((node) => node.generation < plan.generation))\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plan comparison, as a value.
|
|
3
|
+
*
|
|
4
|
+
* A plan diff answers "which steps changed key (and _which input_
|
|
5
|
+
* changed them), what entered the envelope, what joined the release set —
|
|
6
|
+
* 'what is different about this run' is a set comparison, not archaeology."
|
|
7
|
+
* This module is the set comparison.
|
|
8
|
+
*
|
|
9
|
+
* The **verdict** is the key: two nodes with the same key are the same step,
|
|
10
|
+
* under the same id or a moved one, and nothing else needs saying. The
|
|
11
|
+
* **attribution** — `changed: ["input[1]"]` — is a report for a human, derived
|
|
12
|
+
* by comparing the declarations field by field. It is deliberately not part of any digest.
|
|
13
|
+
*
|
|
14
|
+
* @since 0.1.0
|
|
15
|
+
*/
|
|
16
|
+
import type * as Plan from "./Plan.ts";
|
|
17
|
+
/**
|
|
18
|
+
* A node whose key moved, with the fields that moved it.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.1.0
|
|
21
|
+
* @category models
|
|
22
|
+
*/
|
|
23
|
+
export interface Rekeyed {
|
|
24
|
+
/** The node's id in the newer plan. */
|
|
25
|
+
readonly id: string;
|
|
26
|
+
/** The step key the paired node carried in the older plan. */
|
|
27
|
+
readonly from: string;
|
|
28
|
+
/** The step key the node carries in the newer plan. */
|
|
29
|
+
readonly to: string;
|
|
30
|
+
/**
|
|
31
|
+
* Field labels such as `"kind"`, `"body"`, `"layers"`, `"capabilities"`,
|
|
32
|
+
* `"effects"`, and `"input[0]"` whose declaration differs. `"kind"` is the
|
|
33
|
+
* effect tier (`sealed`, `compensable`, or `irreversible`). A
|
|
34
|
+
* `Pending`-referenced upstream re-key is attributed to that input position
|
|
35
|
+
* too. `changed` is empty only when none of the compared fields moved.
|
|
36
|
+
*/
|
|
37
|
+
readonly changed: ReadonlyArray<string>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* What changed between two plans of the same flow.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
* @category models
|
|
44
|
+
*/
|
|
45
|
+
export interface PlanDiff {
|
|
46
|
+
/** Ids, in the newer plan, of nodes with no counterpart in the older plan. */
|
|
47
|
+
readonly added: ReadonlyArray<string>;
|
|
48
|
+
/** Ids, in the older plan, of nodes with no counterpart in the newer plan. */
|
|
49
|
+
readonly removed: ReadonlyArray<string>;
|
|
50
|
+
/** Nodes paired by id whose step key changed, with the fields that changed it. */
|
|
51
|
+
readonly rekeyed: ReadonlyArray<Rekeyed>;
|
|
52
|
+
/** Ids, in the newer plan, of nodes whose step key is unchanged, including nodes whose id moved. */
|
|
53
|
+
readonly unchanged: ReadonlyArray<string>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Compares a plan against the last plan for the same flow.
|
|
57
|
+
*
|
|
58
|
+
* Nodes pair in three passes, each over the nodes no earlier pass paired:
|
|
59
|
+
* the same id with the same key, then the same key under any id, then the
|
|
60
|
+
* same id with a different key. The second pass exists because flow node ids
|
|
61
|
+
* can be positional: inserting a step shifts the ids after it while their
|
|
62
|
+
* keys stay equal, and that is one added step, not a re-key of every later
|
|
63
|
+
* one (#3905).
|
|
64
|
+
*
|
|
65
|
+
* `added`, `rekeyed`, and `unchanged` name nodes by their id in `next`;
|
|
66
|
+
* `removed` names nodes by their id in `previous`. A moved id can therefore
|
|
67
|
+
* appear once in `removed` or `added` and once in `unchanged`.
|
|
68
|
+
*
|
|
69
|
+
* @param previous - The last plan recorded for the flow.
|
|
70
|
+
* @param next - The plan to compare against it.
|
|
71
|
+
* @returns The added, removed, re-keyed, and unchanged node ids, each in its
|
|
72
|
+
* plan's node order.
|
|
73
|
+
* @since 0.1.0
|
|
74
|
+
* @category constructors
|
|
75
|
+
*/
|
|
76
|
+
export declare const diff: (previous: Plan.Plan, next: Plan.Plan) => PlanDiff;
|
|
77
|
+
//# sourceMappingURL=PlanDiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanDiff.d.ts","sourceRoot":"","sources":["../../src/PlanDiff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AAGtC;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACrC,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACvC,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IACxC,oGAAoG;IACpG,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAC1C;AAuGD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,GAAI,UAAU,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,KAAG,QA6D3D,CAAA"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plan comparison, as a value.
|
|
3
|
+
*
|
|
4
|
+
* A plan diff answers "which steps changed key (and _which input_
|
|
5
|
+
* changed them), what entered the envelope, what joined the release set —
|
|
6
|
+
* 'what is different about this run' is a set comparison, not archaeology."
|
|
7
|
+
* This module is the set comparison.
|
|
8
|
+
*
|
|
9
|
+
* The **verdict** is the key: two nodes with the same key are the same step,
|
|
10
|
+
* under the same id or a moved one, and nothing else needs saying. The
|
|
11
|
+
* **attribution** — `changed: ["input[1]"]` — is a report for a human, derived
|
|
12
|
+
* by comparing the declarations field by field. It is deliberately not part of any digest.
|
|
13
|
+
*
|
|
14
|
+
* @since 0.1.0
|
|
15
|
+
*/
|
|
16
|
+
import { jsonMirror } from "./internal/JsonMirror.js";
|
|
17
|
+
/**
|
|
18
|
+
* Order-insensitive structural comparison for the attribution report only.
|
|
19
|
+
* Digests go through RFC 8785 canonical JSON; this does not have to, and
|
|
20
|
+
* saying so keeps the two from being confused.
|
|
21
|
+
*
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
const stable = (value) => {
|
|
25
|
+
if (typeof value === "bigint")
|
|
26
|
+
return `${value}n`;
|
|
27
|
+
if (value === null || typeof value !== "object")
|
|
28
|
+
return JSON.stringify(value) ?? "undefined";
|
|
29
|
+
if (Array.isArray(value))
|
|
30
|
+
return `[${value.map(stable).join(",")}]`;
|
|
31
|
+
const entries = Object.entries(value).sort(([left], [right]) => left < right ? -1 : 1);
|
|
32
|
+
return `{${entries.map(([name, entry]) => `${JSON.stringify(name)}:${stable(entry)}`).join(",")}}`;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A planned value compares as the reference an AST stores for it, so the same
|
|
36
|
+
* reference at the same place is unchanged.
|
|
37
|
+
*
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
const plannedReference = (_value, reference) => ({
|
|
41
|
+
_tag: "PlannedReference",
|
|
42
|
+
node: reference.node,
|
|
43
|
+
path: reference.path
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Projects compared fields through the key's JSON semantics. A refused value
|
|
47
|
+
* receives an identity token scoped to its node and field, so the same value
|
|
48
|
+
* remains equal to itself without equating two distinct refused values.
|
|
49
|
+
*
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
const fieldComparison = () => {
|
|
53
|
+
const refused = new Map();
|
|
54
|
+
const token = (input, nodeId, field) => {
|
|
55
|
+
try {
|
|
56
|
+
return stable(jsonMirror(input, plannedReference));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
const address = JSON.stringify([nodeId, field]);
|
|
60
|
+
let fields = refused.get(input);
|
|
61
|
+
if (fields === undefined) {
|
|
62
|
+
fields = new Map();
|
|
63
|
+
refused.set(input, fields);
|
|
64
|
+
}
|
|
65
|
+
let sentinel = fields.get(address);
|
|
66
|
+
if (sentinel === undefined) {
|
|
67
|
+
sentinel = Symbol(address);
|
|
68
|
+
fields.set(address, sentinel);
|
|
69
|
+
}
|
|
70
|
+
return sentinel;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
return (previous, next, nodeId, field) => token(previous, nodeId, field) === token(next, nodeId, field);
|
|
74
|
+
};
|
|
75
|
+
/** @private */
|
|
76
|
+
const changedFields = (previous, next, rekeyedDependencies, sameField) => {
|
|
77
|
+
const changed = [];
|
|
78
|
+
// StepKey.materialBody is the identity list this attribution must mirror.
|
|
79
|
+
// Inputs, layers, and capabilities complete fromKeyMaterial's hashed value,
|
|
80
|
+
// and material.kind selects the key namespace (content versus tier-bearing
|
|
81
|
+
// plan declaration), so a tier-only move still re-keys and is blamed here.
|
|
82
|
+
if (!sameField(previous.material.version, next.material.version, next.id, "version"))
|
|
83
|
+
changed.push("version");
|
|
84
|
+
if (previous.material.kind !== next.material.kind)
|
|
85
|
+
changed.push("kind");
|
|
86
|
+
if (!sameField(previous.material.body, next.material.body, next.id, "body"))
|
|
87
|
+
changed.push("body");
|
|
88
|
+
if (!sameField(previous.material.nondeterministic, next.material.nondeterministic, next.id, "nondeterministic")) {
|
|
89
|
+
changed.push("nondeterministic");
|
|
90
|
+
}
|
|
91
|
+
if (!sameField(previous.material.effects, next.material.effects, next.id, "effects"))
|
|
92
|
+
changed.push("effects");
|
|
93
|
+
if (!sameField(previous.material.placement, next.material.placement, next.id, "placement")) {
|
|
94
|
+
changed.push("placement");
|
|
95
|
+
}
|
|
96
|
+
const width = Math.max(previous.material.inputs.length, next.material.inputs.length);
|
|
97
|
+
for (let index = 0; index < width; index++) {
|
|
98
|
+
const before = previous.material.inputs[index];
|
|
99
|
+
const after = next.material.inputs[index];
|
|
100
|
+
const field = `input[${index}]`;
|
|
101
|
+
if (before === undefined || after === undefined || !sameField(before, after, next.id, field)) {
|
|
102
|
+
changed.push(field);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (after._tag !== "Literal" && rekeyedDependencies.has(after.from))
|
|
106
|
+
changed.push(field);
|
|
107
|
+
}
|
|
108
|
+
if (!sameField(previous.material.layers, next.material.layers, next.id, "layers"))
|
|
109
|
+
changed.push("layers");
|
|
110
|
+
if (!sameField(previous.material.capabilities, next.material.capabilities, next.id, "capabilities")) {
|
|
111
|
+
changed.push("capabilities");
|
|
112
|
+
}
|
|
113
|
+
return changed;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Compares a plan against the last plan for the same flow.
|
|
117
|
+
*
|
|
118
|
+
* Nodes pair in three passes, each over the nodes no earlier pass paired:
|
|
119
|
+
* the same id with the same key, then the same key under any id, then the
|
|
120
|
+
* same id with a different key. The second pass exists because flow node ids
|
|
121
|
+
* can be positional: inserting a step shifts the ids after it while their
|
|
122
|
+
* keys stay equal, and that is one added step, not a re-key of every later
|
|
123
|
+
* one (#3905).
|
|
124
|
+
*
|
|
125
|
+
* `added`, `rekeyed`, and `unchanged` name nodes by their id in `next`;
|
|
126
|
+
* `removed` names nodes by their id in `previous`. A moved id can therefore
|
|
127
|
+
* appear once in `removed` or `added` and once in `unchanged`.
|
|
128
|
+
*
|
|
129
|
+
* @param previous - The last plan recorded for the flow.
|
|
130
|
+
* @param next - The plan to compare against it.
|
|
131
|
+
* @returns The added, removed, re-keyed, and unchanged node ids, each in its
|
|
132
|
+
* plan's node order.
|
|
133
|
+
* @since 0.1.0
|
|
134
|
+
* @category constructors
|
|
135
|
+
*/
|
|
136
|
+
export const diff = (previous, next) => {
|
|
137
|
+
// pairs maps a next node to the previous node it is the same step as.
|
|
138
|
+
const pairs = new Map();
|
|
139
|
+
const paired = new Set();
|
|
140
|
+
const pair = (node, original) => {
|
|
141
|
+
pairs.set(node, original);
|
|
142
|
+
paired.add(original);
|
|
143
|
+
};
|
|
144
|
+
const before = new Map(previous.nodes.map((node) => [node.id, node]));
|
|
145
|
+
for (const node of next.nodes) {
|
|
146
|
+
const original = before.get(node.id);
|
|
147
|
+
if (original !== undefined && original.key === node.key)
|
|
148
|
+
pair(node, original);
|
|
149
|
+
}
|
|
150
|
+
const byKey = new Map();
|
|
151
|
+
for (const node of previous.nodes) {
|
|
152
|
+
if (paired.has(node))
|
|
153
|
+
continue;
|
|
154
|
+
const same = byKey.get(node.key);
|
|
155
|
+
if (same === undefined)
|
|
156
|
+
byKey.set(node.key, [node]);
|
|
157
|
+
else
|
|
158
|
+
same.push(node);
|
|
159
|
+
}
|
|
160
|
+
for (const node of next.nodes) {
|
|
161
|
+
if (pairs.has(node))
|
|
162
|
+
continue;
|
|
163
|
+
const original = byKey.get(node.key)?.shift();
|
|
164
|
+
if (original !== undefined)
|
|
165
|
+
pair(node, original);
|
|
166
|
+
}
|
|
167
|
+
const rekeyedIds = new Set();
|
|
168
|
+
for (const node of next.nodes) {
|
|
169
|
+
if (pairs.has(node))
|
|
170
|
+
continue;
|
|
171
|
+
const original = before.get(node.id);
|
|
172
|
+
if (original !== undefined && !paired.has(original)) {
|
|
173
|
+
pair(node, original);
|
|
174
|
+
rekeyedIds.add(node.id);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const added = [];
|
|
178
|
+
const rekeyed = [];
|
|
179
|
+
const unchanged = [];
|
|
180
|
+
const sameField = fieldComparison();
|
|
181
|
+
for (const node of next.nodes) {
|
|
182
|
+
const original = pairs.get(node);
|
|
183
|
+
if (original === undefined) {
|
|
184
|
+
added.push(node.id);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (original.key === node.key) {
|
|
188
|
+
unchanged.push(node.id);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
rekeyed.push({
|
|
192
|
+
id: node.id,
|
|
193
|
+
from: original.key,
|
|
194
|
+
to: node.key,
|
|
195
|
+
changed: changedFields(original, node, rekeyedIds, sameField)
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
added,
|
|
200
|
+
removed: previous.nodes.filter((node) => !paired.has(node)).map((node) => node.id),
|
|
201
|
+
rekeyed,
|
|
202
|
+
unchanged
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
//# sourceMappingURL=PlanDiff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanDiff.js","sourceRoot":"","sources":["../../src/PlanDiff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AA4CrD;;;;;;GAMG;AACH,MAAM,MAAM,GAAG,CAAC,KAAc,EAAU,EAAE;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,GAAG,KAAK,GAAG,CAAA;IACjD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,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,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC;SAC9D,CAAC,CAAA;IACJ,CAAC;IACD,OAAO;QACL,KAAK;QACL,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAClF,OAAO;QACP,SAAS;KACV,CAAA;AACH,CAAC,CAAA","sourcesContent":["/**\n * A plan comparison, as a value.\n *\n * A plan diff answers \"which steps changed key (and _which input_\n * changed them), what entered the envelope, what joined the release set —\n * 'what is different about this run' is a set comparison, not archaeology.\"\n * This module is the set comparison.\n *\n * The **verdict** is the key: two nodes with the same key are the same step,\n * under the same id or a moved one, and nothing else needs saying. The\n * **attribution** — `changed: [\"input[1]\"]` — is a report for a human, derived\n * by comparing the declarations field by field. It is deliberately not part of any digest.\n *\n * @since 0.1.0\n */\n\nimport { jsonMirror } from \"./internal/JsonMirror.ts\"\nimport type * as Plan from \"./Plan.ts\"\nimport type * as Planned from \"./Planned.ts\"\n\n/**\n * A node whose key moved, with the fields that moved it.\n *\n * @since 0.1.0\n * @category models\n */\nexport interface Rekeyed {\n /** The node's id in the newer plan. */\n readonly id: string\n /** The step key the paired node carried in the older plan. */\n readonly from: string\n /** The step key the node carries in the newer plan. */\n readonly to: string\n /**\n * Field labels such as `\"kind\"`, `\"body\"`, `\"layers\"`, `\"capabilities\"`,\n * `\"effects\"`, and `\"input[0]\"` whose declaration differs. `\"kind\"` is the\n * effect tier (`sealed`, `compensable`, or `irreversible`). A\n * `Pending`-referenced upstream re-key is attributed to that input position\n * too. `changed` is empty only when none of the compared fields moved.\n */\n readonly changed: ReadonlyArray<string>\n}\n\n/**\n * What changed between two plans of the same flow.\n *\n * @since 0.1.0\n * @category models\n */\nexport interface PlanDiff {\n /** Ids, in the newer plan, of nodes with no counterpart in the older plan. */\n readonly added: ReadonlyArray<string>\n /** Ids, in the older plan, of nodes with no counterpart in the newer plan. */\n readonly removed: ReadonlyArray<string>\n /** Nodes paired by id whose step key changed, with the fields that changed it. */\n readonly rekeyed: ReadonlyArray<Rekeyed>\n /** Ids, in the newer plan, of nodes whose step key is unchanged, including nodes whose id moved. */\n readonly unchanged: ReadonlyArray<string>\n}\n\n/**\n * Order-insensitive structural comparison for the attribution report only.\n * Digests go through RFC 8785 canonical JSON; this does not have to, and\n * saying so keeps the two from being confused.\n *\n * @private\n */\nconst stable = (value: unknown): string => {\n if (typeof value === \"bigint\") return `${value}n`\n if (value === null || typeof value !== \"object\") return JSON.stringify(value) ?? \"undefined\"\n if (Array.isArray(value)) return `[${value.map(stable).join(\",\")}]`\n const entries = Object.entries(value as Record<string, unknown>).sort(([left], [right]) => left < right ? -1 : 1)\n return `{${entries.map(([name, entry]) => `${JSON.stringify(name)}:${stable(entry)}`).join(\",\")}}`\n}\n\n/**\n * A planned value compares as the reference an AST stores for it, so the same\n * reference at the same place is unchanged.\n *\n * @private\n */\nconst plannedReference = (_value: unknown, reference: Planned.Reference) => ({\n _tag: \"PlannedReference\",\n node: reference.node,\n path: reference.path\n})\n\n/** @private */\ntype ComparisonToken = string | symbol\n\n/**\n * Projects compared fields through the key's JSON semantics. A refused value\n * receives an identity token scoped to its node and field, so the same value\n * remains equal to itself without equating two distinct refused values.\n *\n * @private\n */\nconst fieldComparison = () => {\n const refused = new Map<unknown, Map<string, symbol>>()\n const token = (input: unknown, nodeId: string, field: string): ComparisonToken => {\n try {\n return stable(jsonMirror(input, plannedReference))\n } catch {\n const address = JSON.stringify([nodeId, field])\n let fields = refused.get(input)\n if (fields === undefined) {\n fields = new Map()\n refused.set(input, fields)\n }\n let sentinel = fields.get(address)\n if (sentinel === undefined) {\n sentinel = Symbol(address)\n fields.set(address, sentinel)\n }\n return sentinel\n }\n }\n return (previous: unknown, next: unknown, nodeId: string, field: string): boolean =>\n token(previous, nodeId, field) === token(next, nodeId, field)\n}\n\n/** @private */\nconst changedFields = (\n previous: Plan.PlanNode,\n next: Plan.PlanNode,\n rekeyedDependencies: ReadonlySet<string>,\n sameField: ReturnType<typeof fieldComparison>\n): ReadonlyArray<string> => {\n const changed: Array<string> = []\n // StepKey.materialBody is the identity list this attribution must mirror.\n // Inputs, layers, and capabilities complete fromKeyMaterial's hashed value,\n // and material.kind selects the key namespace (content versus tier-bearing\n // plan declaration), so a tier-only move still re-keys and is blamed here.\n if (!sameField(previous.material.version, next.material.version, next.id, \"version\")) changed.push(\"version\")\n if (previous.material.kind !== next.material.kind) changed.push(\"kind\")\n if (!sameField(previous.material.body, next.material.body, next.id, \"body\")) changed.push(\"body\")\n if (!sameField(previous.material.nondeterministic, next.material.nondeterministic, next.id, \"nondeterministic\")) {\n changed.push(\"nondeterministic\")\n }\n if (!sameField(previous.material.effects, next.material.effects, next.id, \"effects\")) changed.push(\"effects\")\n if (!sameField(previous.material.placement, next.material.placement, next.id, \"placement\")) {\n changed.push(\"placement\")\n }\n const width = Math.max(previous.material.inputs.length, next.material.inputs.length)\n for (let index = 0; index < width; index++) {\n const before = previous.material.inputs[index]\n const after = next.material.inputs[index]\n const field = `input[${index}]`\n if (before === undefined || after === undefined || !sameField(before, after, next.id, field)) {\n changed.push(field)\n continue\n }\n if (after._tag !== \"Literal\" && rekeyedDependencies.has(after.from)) changed.push(field)\n }\n if (!sameField(previous.material.layers, next.material.layers, next.id, \"layers\")) changed.push(\"layers\")\n if (!sameField(previous.material.capabilities, next.material.capabilities, next.id, \"capabilities\")) {\n changed.push(\"capabilities\")\n }\n return changed\n}\n\n/**\n * Compares a plan against the last plan for the same flow.\n *\n * Nodes pair in three passes, each over the nodes no earlier pass paired:\n * the same id with the same key, then the same key under any id, then the\n * same id with a different key. The second pass exists because flow node ids\n * can be positional: inserting a step shifts the ids after it while their\n * keys stay equal, and that is one added step, not a re-key of every later\n * one (#3905).\n *\n * `added`, `rekeyed`, and `unchanged` name nodes by their id in `next`;\n * `removed` names nodes by their id in `previous`. A moved id can therefore\n * appear once in `removed` or `added` and once in `unchanged`.\n *\n * @param previous - The last plan recorded for the flow.\n * @param next - The plan to compare against it.\n * @returns The added, removed, re-keyed, and unchanged node ids, each in its\n * plan's node order.\n * @since 0.1.0\n * @category constructors\n */\nexport const diff = (previous: Plan.Plan, next: Plan.Plan): PlanDiff => {\n // pairs maps a next node to the previous node it is the same step as.\n const pairs = new Map<Plan.PlanNode, Plan.PlanNode>()\n const paired = new Set<Plan.PlanNode>()\n const pair = (node: Plan.PlanNode, original: Plan.PlanNode) => {\n pairs.set(node, original)\n paired.add(original)\n }\n const before = new Map(previous.nodes.map((node) => [node.id, node]))\n for (const node of next.nodes) {\n const original = before.get(node.id)\n if (original !== undefined && original.key === node.key) pair(node, original)\n }\n const byKey = new Map<string, Array<Plan.PlanNode>>()\n for (const node of previous.nodes) {\n if (paired.has(node)) continue\n const same = byKey.get(node.key)\n if (same === undefined) byKey.set(node.key, [node])\n else same.push(node)\n }\n for (const node of next.nodes) {\n if (pairs.has(node)) continue\n const original = byKey.get(node.key)?.shift()\n if (original !== undefined) pair(node, original)\n }\n const rekeyedIds = new Set<string>()\n for (const node of next.nodes) {\n if (pairs.has(node)) continue\n const original = before.get(node.id)\n if (original !== undefined && !paired.has(original)) {\n pair(node, original)\n rekeyedIds.add(node.id)\n }\n }\n const added: Array<string> = []\n const rekeyed: Array<Rekeyed> = []\n const unchanged: Array<string> = []\n const sameField = fieldComparison()\n for (const node of next.nodes) {\n const original = pairs.get(node)\n if (original === undefined) {\n added.push(node.id)\n continue\n }\n if (original.key === node.key) {\n unchanged.push(node.id)\n continue\n }\n rekeyed.push({\n id: node.id,\n from: original.key,\n to: node.key,\n changed: changedFields(original, node, rekeyedIds, sameField)\n })\n }\n return {\n added,\n removed: previous.nodes.filter((node) => !paired.has(node)).map((node) => node.id),\n rekeyed,\n unchanged\n }\n}\n"]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The placeholder a body sees where a step result will be.
|
|
3
|
+
*
|
|
4
|
+
* A flow body runs at PLAN time, so its
|
|
5
|
+
* own payload is real data while every step result is a value that does not
|
|
6
|
+
* exist yet. That value has a name and one rule: a planned value may be **passed** — into a payload field,
|
|
7
|
+
* into a branch, into a map — and field access is allowed, because it records a
|
|
8
|
+
* reference path. It may never be **computed on**.
|
|
9
|
+
*
|
|
10
|
+
* {@link Planned} is branded, so arithmetic is a compile error.
|
|
11
|
+
* {@link make} returns a strict proxy
|
|
12
|
+
* whose `Symbol.toPrimitive`, `valueOf`, `toString`, `toJSON`, and call traps
|
|
13
|
+
* throw {@link module:GraphBuildError.GraphBuildError} rather than let a plan be
|
|
14
|
+
* built around `NaN` or `"[object Object]"`. The lenient proxy this adapts
|
|
15
|
+
* (`@smthrs/core`'s `Graph.plannedValue`) answered `toPrimitive` with a
|
|
16
|
+
* readable string, which is exactly the silent-wrong-plan path this module
|
|
17
|
+
* exists to close.
|
|
18
|
+
*
|
|
19
|
+
* JavaScript does not expose traps for `Boolean(value)` or strict identity
|
|
20
|
+
* (`value === other`), so those operations cannot be refused at run time.
|
|
21
|
+
* They reveal only proxy truthiness or identity and never the planned result;
|
|
22
|
+
* authors must use {@link module:Node.branch} for decisions on real values.
|
|
23
|
+
* Type-aware ESLint `@typescript-eslint/strict-boolean-expressions` rejects
|
|
24
|
+
* planned conditions, but does not reject explicit Boolean coercion or all
|
|
25
|
+
* reference comparisons. Those still require review.
|
|
26
|
+
*
|
|
27
|
+
* @since 0.1.0
|
|
28
|
+
*/
|
|
29
|
+
import type * as Types from "effect/Types";
|
|
30
|
+
/**
|
|
31
|
+
* The brand carried by every planned value, and the key its reference is read
|
|
32
|
+
* from. Interned with `Symbol.for` so a value that crossed a module boundary is
|
|
33
|
+
* still recognised. The interned symbol is a recognition aid, not a
|
|
34
|
+
* capability, so {@link reference} validates the value stored under it.
|
|
35
|
+
*
|
|
36
|
+
* @since 0.1.0
|
|
37
|
+
* @category symbols
|
|
38
|
+
* @slop
|
|
39
|
+
*/
|
|
40
|
+
export declare const TypeId: unique symbol;
|
|
41
|
+
/**
|
|
42
|
+
* The type-level form of {@link TypeId}.
|
|
43
|
+
*
|
|
44
|
+
* @since 0.1.0
|
|
45
|
+
* @category symbols
|
|
46
|
+
* @slop
|
|
47
|
+
*/
|
|
48
|
+
export type TypeId = typeof TypeId;
|
|
49
|
+
/**
|
|
50
|
+
* What a planned value points at: the node that will produce the result, and
|
|
51
|
+
* the property path read from it. `path` is empty for the result itself.
|
|
52
|
+
*
|
|
53
|
+
* @since 0.1.0
|
|
54
|
+
* @category models
|
|
55
|
+
* @slop
|
|
56
|
+
*/
|
|
57
|
+
export interface Reference {
|
|
58
|
+
readonly node: string;
|
|
59
|
+
readonly path: ReadonlyArray<string>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A {@link Reference} plus the phantom type of the value it stands for, so
|
|
63
|
+
* `Planned<string>` and `Planned<number>` are not interchangeable.
|
|
64
|
+
*
|
|
65
|
+
* @since 0.1.0
|
|
66
|
+
* @category models
|
|
67
|
+
* @slop
|
|
68
|
+
*/
|
|
69
|
+
export interface Identity<out T> extends Reference {
|
|
70
|
+
readonly _T: Types.Covariant<T>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A step result that has not been produced yet.
|
|
74
|
+
*
|
|
75
|
+
* The brand rejects arithmetic and ordinary value arguments. The mapped half keeps field
|
|
76
|
+
* access typed — `result.files` is a `Planned` of the field, which is what
|
|
77
|
+
* makes "pass it on, never compute on it" expressible rather than merely
|
|
78
|
+
* documented.
|
|
79
|
+
*
|
|
80
|
+
* @since 0.1.0
|
|
81
|
+
* @category models
|
|
82
|
+
* @slop
|
|
83
|
+
*/
|
|
84
|
+
export type Planned<T> = {
|
|
85
|
+
readonly [TypeId]: Identity<T>;
|
|
86
|
+
} & ([T] extends [object] ? {
|
|
87
|
+
readonly [K in keyof T]: Planned<T[K]>;
|
|
88
|
+
} : unknown);
|
|
89
|
+
/**
|
|
90
|
+
* Creates the strict placeholder standing for a node's result.
|
|
91
|
+
*
|
|
92
|
+
* Planning hands one of these to every builder that consumes an upstream
|
|
93
|
+
* value — a branch arm, a continuation — and reads the {@link Reference} back
|
|
94
|
+
* off whatever the builder passed it into.
|
|
95
|
+
*
|
|
96
|
+
* @since 0.1.0
|
|
97
|
+
* @category constructors
|
|
98
|
+
* @slop
|
|
99
|
+
*/
|
|
100
|
+
export declare const make: <T>(node: string) => Planned<T>;
|
|
101
|
+
/**
|
|
102
|
+
* Reads the reference a planned value records, or `undefined` for anything
|
|
103
|
+
* else. An interned symbol is a recognition aid rather than a capability, so a
|
|
104
|
+
* forged carrier is accepted only when its node and path have the complete
|
|
105
|
+
* reference shape. This is how a payload is scanned for the upstream results
|
|
106
|
+
* it consumes.
|
|
107
|
+
*
|
|
108
|
+
* @since 0.1.0
|
|
109
|
+
* @category accessors
|
|
110
|
+
* @slop
|
|
111
|
+
*/
|
|
112
|
+
export declare const reference: (value: unknown) => Reference | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Checks whether a value is a planned placeholder.
|
|
115
|
+
*
|
|
116
|
+
* @since 0.1.0
|
|
117
|
+
* @category guards
|
|
118
|
+
* @slop
|
|
119
|
+
*/
|
|
120
|
+
export declare const isPlanned: (value: unknown) => value is Planned<unknown>;
|
|
121
|
+
//# sourceMappingURL=Planned.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Planned.d.ts","sourceRoot":"","sources":["../../src/Planned.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAG1C;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,OAAO,MAA2C,CAAA;AAEvE;;;;;;GAMG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAA;AAElC;;;;;;;GAOG;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