@sunshaobei/dsh-workflow 0.0.0-stage → 2.1.2
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/README.md +43 -2
- package/cordis.patch.yml +17 -0
- package/lib/client.js +14708 -0
- package/lib/core.js +137 -0
- package/lib/engine-adapter.js +1387 -0
- package/lib/host-driver.js +298 -0
- package/lib/index.js +536 -0
- package/lib/projection.js +159 -0
- package/lib/registry.js +218 -0
- package/lib/session-records.js +54 -0
- package/lib/submission-commit.js +34 -0
- package/lib/world-driver.js +275 -0
- package/package.json +67 -4
- package/vendor/PROVENANCE.md +9 -0
- package/vendor/dynamic-workflow/analysis/actor-graph.d.ts +47 -0
- package/vendor/dynamic-workflow/analysis/actor-graph.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/actor-graph.js +95 -0
- package/vendor/dynamic-workflow/analysis/actor-models.d.ts +60 -0
- package/vendor/dynamic-workflow/analysis/actor-models.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/actor-models.js +208 -0
- package/vendor/dynamic-workflow/analysis/actor-names.d.ts +56 -0
- package/vendor/dynamic-workflow/analysis/actor-names.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/actor-names.js +155 -0
- package/vendor/dynamic-workflow/analysis/analyze.d.ts +63 -0
- package/vendor/dynamic-workflow/analysis/analyze.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/analyze.js +92 -0
- package/vendor/dynamic-workflow/analysis/array-methods.d.ts +21 -0
- package/vendor/dynamic-workflow/analysis/array-methods.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/array-methods.js +132 -0
- package/vendor/dynamic-workflow/analysis/artifact-types.d.ts +39 -0
- package/vendor/dynamic-workflow/analysis/artifact-types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/artifact-types.js +114 -0
- package/vendor/dynamic-workflow/analysis/artifacts.d.ts +67 -0
- package/vendor/dynamic-workflow/analysis/artifacts.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/artifacts.js +263 -0
- package/vendor/dynamic-workflow/analysis/assign.d.ts +42 -0
- package/vendor/dynamic-workflow/analysis/assign.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/assign.js +287 -0
- package/vendor/dynamic-workflow/analysis/callbacks.d.ts +71 -0
- package/vendor/dynamic-workflow/analysis/callbacks.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/callbacks.js +133 -0
- package/vendor/dynamic-workflow/analysis/calls.d.ts +40 -0
- package/vendor/dynamic-workflow/analysis/calls.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/calls.js +495 -0
- package/vendor/dynamic-workflow/analysis/causality-graph-lanes.d.ts +25 -0
- package/vendor/dynamic-workflow/analysis/causality-graph-lanes.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-graph-lanes.js +161 -0
- package/vendor/dynamic-workflow/analysis/causality-graph-types.d.ts +163 -0
- package/vendor/dynamic-workflow/analysis/causality-graph-types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-graph-types.js +8 -0
- package/vendor/dynamic-workflow/analysis/causality-graph.d.ts +39 -0
- package/vendor/dynamic-workflow/analysis/causality-graph.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-graph.js +530 -0
- package/vendor/dynamic-workflow/analysis/causality-order-calls.d.ts +29 -0
- package/vendor/dynamic-workflow/analysis/causality-order-calls.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-calls.js +266 -0
- package/vendor/dynamic-workflow/analysis/causality-order-functions.d.ts +26 -0
- package/vendor/dynamic-workflow/analysis/causality-order-functions.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-functions.js +116 -0
- package/vendor/dynamic-workflow/analysis/causality-order-loops.d.ts +5 -0
- package/vendor/dynamic-workflow/analysis/causality-order-loops.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-loops.js +148 -0
- package/vendor/dynamic-workflow/analysis/causality-order-settle.d.ts +39 -0
- package/vendor/dynamic-workflow/analysis/causality-order-settle.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-settle.js +263 -0
- package/vendor/dynamic-workflow/analysis/causality-order-state.d.ts +110 -0
- package/vendor/dynamic-workflow/analysis/causality-order-state.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-state.js +162 -0
- package/vendor/dynamic-workflow/analysis/causality-order-strands.d.ts +79 -0
- package/vendor/dynamic-workflow/analysis/causality-order-strands.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-strands.js +154 -0
- package/vendor/dynamic-workflow/analysis/causality-order-types.d.ts +174 -0
- package/vendor/dynamic-workflow/analysis/causality-order-types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-types.js +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-walk.d.ts +17 -0
- package/vendor/dynamic-workflow/analysis/causality-order-walk.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order-walk.js +282 -0
- package/vendor/dynamic-workflow/analysis/causality-order.d.ts +60 -0
- package/vendor/dynamic-workflow/analysis/causality-order.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-order.js +110 -0
- package/vendor/dynamic-workflow/analysis/causality-reduce.d.ts +60 -0
- package/vendor/dynamic-workflow/analysis/causality-reduce.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/causality-reduce.js +198 -0
- package/vendor/dynamic-workflow/analysis/classes.d.ts +47 -0
- package/vendor/dynamic-workflow/analysis/classes.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/classes.js +264 -0
- package/vendor/dynamic-workflow/analysis/constants.d.ts +35 -0
- package/vendor/dynamic-workflow/analysis/constants.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/constants.js +23 -0
- package/vendor/dynamic-workflow/analysis/control-flow.d.ts +26 -0
- package/vendor/dynamic-workflow/analysis/control-flow.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/control-flow.js +132 -0
- package/vendor/dynamic-workflow/analysis/core-json.d.ts +45 -0
- package/vendor/dynamic-workflow/analysis/core-json.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/core-json.js +49 -0
- package/vendor/dynamic-workflow/analysis/core.d.ts +194 -0
- package/vendor/dynamic-workflow/analysis/core.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/core.js +204 -0
- package/vendor/dynamic-workflow/analysis/domain.d.ts +269 -0
- package/vendor/dynamic-workflow/analysis/domain.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/domain.js +523 -0
- package/vendor/dynamic-workflow/analysis/facade-misuse.d.ts +56 -0
- package/vendor/dynamic-workflow/analysis/facade-misuse.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/facade-misuse.js +350 -0
- package/vendor/dynamic-workflow/analysis/fanout-cardinality.d.ts +11 -0
- package/vendor/dynamic-workflow/analysis/fanout-cardinality.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/fanout-cardinality.js +121 -0
- package/vendor/dynamic-workflow/analysis/flow-graph.d.ts +113 -0
- package/vendor/dynamic-workflow/analysis/flow-graph.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/flow-graph.js +411 -0
- package/vendor/dynamic-workflow/analysis/flow-phase.d.ts +28 -0
- package/vendor/dynamic-workflow/analysis/flow-phase.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/flow-phase.js +104 -0
- package/vendor/dynamic-workflow/analysis/flow-strands.d.ts +39 -0
- package/vendor/dynamic-workflow/analysis/flow-strands.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/flow-strands.js +47 -0
- package/vendor/dynamic-workflow/analysis/flow-tree.d.ts +35 -0
- package/vendor/dynamic-workflow/analysis/flow-tree.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/flow-tree.js +33 -0
- package/vendor/dynamic-workflow/analysis/graph.d.ts +5 -0
- package/vendor/dynamic-workflow/analysis/graph.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/graph.js +199 -0
- package/vendor/dynamic-workflow/analysis/handoff-graph.d.ts +48 -0
- package/vendor/dynamic-workflow/analysis/handoff-graph.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/handoff-graph.js +0 -0
- package/vendor/dynamic-workflow/analysis/heap-ops.d.ts +14 -0
- package/vendor/dynamic-workflow/analysis/heap-ops.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/heap-ops.js +70 -0
- package/vendor/dynamic-workflow/analysis/hole-id.d.ts +28 -0
- package/vendor/dynamic-workflow/analysis/hole-id.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/hole-id.js +41 -0
- package/vendor/dynamic-workflow/analysis/hole-sites.d.ts +32 -0
- package/vendor/dynamic-workflow/analysis/hole-sites.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/hole-sites.js +215 -0
- package/vendor/dynamic-workflow/analysis/hole-splice.d.ts +45 -0
- package/vendor/dynamic-workflow/analysis/hole-splice.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/hole-splice.js +100 -0
- package/vendor/dynamic-workflow/analysis/interpret.d.ts +26 -0
- package/vendor/dynamic-workflow/analysis/interpret.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/interpret.js +200 -0
- package/vendor/dynamic-workflow/analysis/literals.d.ts +18 -0
- package/vendor/dynamic-workflow/analysis/literals.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/literals.js +125 -0
- package/vendor/dynamic-workflow/analysis/mermaid.d.ts +60 -0
- package/vendor/dynamic-workflow/analysis/mermaid.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/mermaid.js +477 -0
- package/vendor/dynamic-workflow/analysis/patterns.d.ts +31 -0
- package/vendor/dynamic-workflow/analysis/patterns.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/patterns.js +94 -0
- package/vendor/dynamic-workflow/analysis/phase-graph.d.ts +47 -0
- package/vendor/dynamic-workflow/analysis/phase-graph.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/phase-graph.js +334 -0
- package/vendor/dynamic-workflow/analysis/phases.d.ts +24 -0
- package/vendor/dynamic-workflow/analysis/phases.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/phases.js +54 -0
- package/vendor/dynamic-workflow/analysis/promise-ops.d.ts +52 -0
- package/vendor/dynamic-workflow/analysis/promise-ops.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/promise-ops.js +123 -0
- package/vendor/dynamic-workflow/analysis/relays.d.ts +12 -0
- package/vendor/dynamic-workflow/analysis/relays.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/relays.js +78 -0
- package/vendor/dynamic-workflow/analysis/serialize.d.ts +125 -0
- package/vendor/dynamic-workflow/analysis/serialize.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/serialize.js +321 -0
- package/vendor/dynamic-workflow/analysis/site-phases.d.ts +32 -0
- package/vendor/dynamic-workflow/analysis/site-phases.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/site-phases.js +69 -0
- package/vendor/dynamic-workflow/analysis/sites-labels.d.ts +71 -0
- package/vendor/dynamic-workflow/analysis/sites-labels.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/sites-labels.js +189 -0
- package/vendor/dynamic-workflow/analysis/sites.d.ts +267 -0
- package/vendor/dynamic-workflow/analysis/sites.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/sites.js +225 -0
- package/vendor/dynamic-workflow/analysis/state.d.ts +254 -0
- package/vendor/dynamic-workflow/analysis/state.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/state.js +569 -0
- package/vendor/dynamic-workflow/analysis/taint.d.ts +97 -0
- package/vendor/dynamic-workflow/analysis/taint.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/taint.js +649 -0
- package/vendor/dynamic-workflow/analysis/types.d.ts +100 -0
- package/vendor/dynamic-workflow/analysis/types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/types.js +1 -0
- package/vendor/dynamic-workflow/analysis/world-run.d.ts +27 -0
- package/vendor/dynamic-workflow/analysis/world-run.d.ts.map +1 -0
- package/vendor/dynamic-workflow/analysis/world-run.js +44 -0
- package/vendor/dynamic-workflow/compiler/compile.d.ts +59 -0
- package/vendor/dynamic-workflow/compiler/compile.d.ts.map +1 -0
- package/vendor/dynamic-workflow/compiler/compile.js +159 -0
- package/vendor/dynamic-workflow/compiler/libs.generated.d.ts +3 -0
- package/vendor/dynamic-workflow/compiler/libs.generated.d.ts.map +1 -0
- package/vendor/dynamic-workflow/compiler/libs.generated.js +64 -0
- package/vendor/dynamic-workflow/engine/artifact-spec.d.ts +26 -0
- package/vendor/dynamic-workflow/engine/artifact-spec.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/artifact-spec.js +173 -0
- package/vendor/dynamic-workflow/engine/ask-observation-types.d.ts +54 -0
- package/vendor/dynamic-workflow/engine/ask-observation-types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/ask-observation-types.js +19 -0
- package/vendor/dynamic-workflow/engine/cached-ask-facts.d.ts +28 -0
- package/vendor/dynamic-workflow/engine/cached-ask-facts.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/cached-ask-facts.js +35 -0
- package/vendor/dynamic-workflow/engine/concurrency.d.ts +151 -0
- package/vendor/dynamic-workflow/engine/concurrency.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/concurrency.js +282 -0
- package/vendor/dynamic-workflow/engine/engine-artifacts-primary.d.ts +17 -0
- package/vendor/dynamic-workflow/engine/engine-artifacts-primary.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-artifacts-primary.js +29 -0
- package/vendor/dynamic-workflow/engine/engine-artifacts.d.ts +55 -0
- package/vendor/dynamic-workflow/engine/engine-artifacts.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-artifacts.js +367 -0
- package/vendor/dynamic-workflow/engine/engine-config.d.ts +90 -0
- package/vendor/dynamic-workflow/engine/engine-config.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-config.js +6 -0
- package/vendor/dynamic-workflow/engine/engine-holes.d.ts +116 -0
- package/vendor/dynamic-workflow/engine/engine-holes.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-holes.js +142 -0
- package/vendor/dynamic-workflow/engine/engine-launch.d.ts +34 -0
- package/vendor/dynamic-workflow/engine/engine-launch.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-launch.js +26 -0
- package/vendor/dynamic-workflow/engine/engine-phase-stamp.d.ts +35 -0
- package/vendor/dynamic-workflow/engine/engine-phase-stamp.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-phase-stamp.js +74 -0
- package/vendor/dynamic-workflow/engine/engine-report.d.ts +27 -0
- package/vendor/dynamic-workflow/engine/engine-report.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-report.js +151 -0
- package/vendor/dynamic-workflow/engine/engine-resume.d.ts +18 -0
- package/vendor/dynamic-workflow/engine/engine-resume.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-resume.js +38 -0
- package/vendor/dynamic-workflow/engine/engine-settlement.d.ts +30 -0
- package/vendor/dynamic-workflow/engine/engine-settlement.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-settlement.js +79 -0
- package/vendor/dynamic-workflow/engine/engine-state.d.ts +99 -0
- package/vendor/dynamic-workflow/engine/engine-state.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-state.js +13 -0
- package/vendor/dynamic-workflow/engine/engine-world.d.ts +36 -0
- package/vendor/dynamic-workflow/engine/engine-world.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine-world.js +189 -0
- package/vendor/dynamic-workflow/engine/engine.d.ts +263 -0
- package/vendor/dynamic-workflow/engine/engine.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/engine.js +602 -0
- package/vendor/dynamic-workflow/engine/errors.d.ts +87 -0
- package/vendor/dynamic-workflow/engine/errors.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/errors.js +56 -0
- package/vendor/dynamic-workflow/engine/hash-mismatch.d.ts +10 -0
- package/vendor/dynamic-workflow/engine/hash-mismatch.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/hash-mismatch.js +15 -0
- package/vendor/dynamic-workflow/engine/hash.d.ts +16 -0
- package/vendor/dynamic-workflow/engine/hash.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/hash.js +48 -0
- package/vendor/dynamic-workflow/engine/imported-cache-types.d.ts +96 -0
- package/vendor/dynamic-workflow/engine/imported-cache-types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/imported-cache-types.js +6 -0
- package/vendor/dynamic-workflow/engine/imported-cache.d.ts +127 -0
- package/vendor/dynamic-workflow/engine/imported-cache.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/imported-cache.js +244 -0
- package/vendor/dynamic-workflow/engine/index.d.ts +11 -0
- package/vendor/dynamic-workflow/engine/index.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/index.js +10 -0
- package/vendor/dynamic-workflow/engine/journal-memory.d.ts +32 -0
- package/vendor/dynamic-workflow/engine/journal-memory.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/journal-memory.js +243 -0
- package/vendor/dynamic-workflow/engine/journal-read-types.d.ts +72 -0
- package/vendor/dynamic-workflow/engine/journal-read-types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/journal-read-types.js +28 -0
- package/vendor/dynamic-workflow/engine/persona.d.ts +20 -0
- package/vendor/dynamic-workflow/engine/persona.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/persona.js +43 -0
- package/vendor/dynamic-workflow/engine/replay-order.d.ts +96 -0
- package/vendor/dynamic-workflow/engine/replay-order.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/replay-order.js +229 -0
- package/vendor/dynamic-workflow/engine/run-terminal.d.ts +35 -0
- package/vendor/dynamic-workflow/engine/run-terminal.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/run-terminal.js +7 -0
- package/vendor/dynamic-workflow/engine/scheduler-submit.d.ts +22 -0
- package/vendor/dynamic-workflow/engine/scheduler-submit.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/scheduler-submit.js +84 -0
- package/vendor/dynamic-workflow/engine/scheduler-types.d.ts +105 -0
- package/vendor/dynamic-workflow/engine/scheduler-types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/scheduler-types.js +17 -0
- package/vendor/dynamic-workflow/engine/scheduler.d.ts +113 -0
- package/vendor/dynamic-workflow/engine/scheduler.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/scheduler.js +484 -0
- package/vendor/dynamic-workflow/engine/types.d.ts +979 -0
- package/vendor/dynamic-workflow/engine/types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/types.js +26 -0
- package/vendor/dynamic-workflow/engine/world-read-input.d.ts +10 -0
- package/vendor/dynamic-workflow/engine/world-read-input.d.ts.map +1 -0
- package/vendor/dynamic-workflow/engine/world-read-input.js +55 -0
- package/vendor/dynamic-workflow/facade/artifact-caps.d.ts +48 -0
- package/vendor/dynamic-workflow/facade/artifact-caps.d.ts.map +1 -0
- package/vendor/dynamic-workflow/facade/artifact-caps.js +47 -0
- package/vendor/dynamic-workflow/facade/dts-hole.d.ts +16 -0
- package/vendor/dynamic-workflow/facade/dts-hole.d.ts.map +1 -0
- package/vendor/dynamic-workflow/facade/dts-hole.js +26 -0
- package/vendor/dynamic-workflow/facade/dts-model.d.ts +11 -0
- package/vendor/dynamic-workflow/facade/dts-model.d.ts.map +1 -0
- package/vendor/dynamic-workflow/facade/dts-model.js +18 -0
- package/vendor/dynamic-workflow/facade/dts-stream.d.ts +15 -0
- package/vendor/dynamic-workflow/facade/dts-stream.d.ts.map +1 -0
- package/vendor/dynamic-workflow/facade/dts-stream.js +41 -0
- package/vendor/dynamic-workflow/facade/dts.d.ts +29 -0
- package/vendor/dynamic-workflow/facade/dts.d.ts.map +1 -0
- package/vendor/dynamic-workflow/facade/dts.js +324 -0
- package/vendor/dynamic-workflow/facade/registry.d.ts +218 -0
- package/vendor/dynamic-workflow/facade/registry.d.ts.map +1 -0
- package/vendor/dynamic-workflow/facade/registry.js +203 -0
- package/vendor/dynamic-workflow/facade/report-caps.d.ts +40 -0
- package/vendor/dynamic-workflow/facade/report-caps.d.ts.map +1 -0
- package/vendor/dynamic-workflow/facade/report-caps.js +39 -0
- package/vendor/dynamic-workflow/facade/world-read-caps.d.ts +37 -0
- package/vendor/dynamic-workflow/facade/world-read-caps.d.ts.map +1 -0
- package/vendor/dynamic-workflow/facade/world-read-caps.js +36 -0
- package/vendor/dynamic-workflow/index.d.ts +41 -0
- package/vendor/dynamic-workflow/index.d.ts.map +1 -0
- package/vendor/dynamic-workflow/index.js +51 -0
- package/vendor/dynamic-workflow/lowering/index.d.ts +2 -0
- package/vendor/dynamic-workflow/lowering/index.d.ts.map +1 -0
- package/vendor/dynamic-workflow/lowering/index.js +1 -0
- package/vendor/dynamic-workflow/lowering/lower-hole.d.ts +16 -0
- package/vendor/dynamic-workflow/lowering/lower-hole.d.ts.map +1 -0
- package/vendor/dynamic-workflow/lowering/lower-hole.js +63 -0
- package/vendor/dynamic-workflow/lowering/lower.d.ts +82 -0
- package/vendor/dynamic-workflow/lowering/lower.d.ts.map +1 -0
- package/vendor/dynamic-workflow/lowering/lower.js +333 -0
- package/vendor/dynamic-workflow/projections.d.ts +26 -0
- package/vendor/dynamic-workflow/projections.d.ts.map +1 -0
- package/vendor/dynamic-workflow/projections.js +23 -0
- package/vendor/dynamic-workflow/schema/actor-submit-profiles.d.ts +49 -0
- package/vendor/dynamic-workflow/schema/actor-submit-profiles.d.ts.map +1 -0
- package/vendor/dynamic-workflow/schema/actor-submit-profiles.js +69 -0
- package/vendor/dynamic-workflow/schema/emit.d.ts +55 -0
- package/vendor/dynamic-workflow/schema/emit.d.ts.map +1 -0
- package/vendor/dynamic-workflow/schema/emit.js +325 -0
- package/vendor/dynamic-workflow/schema/jsdoc.d.ts +10 -0
- package/vendor/dynamic-workflow/schema/jsdoc.d.ts.map +1 -0
- package/vendor/dynamic-workflow/schema/jsdoc.js +83 -0
- package/vendor/dynamic-workflow/schema/serialize.d.ts +8 -0
- package/vendor/dynamic-workflow/schema/serialize.d.ts.map +1 -0
- package/vendor/dynamic-workflow/schema/serialize.js +20 -0
- package/vendor/dynamic-workflow/schema/synthesize.d.ts +48 -0
- package/vendor/dynamic-workflow/schema/synthesize.d.ts.map +1 -0
- package/vendor/dynamic-workflow/schema/synthesize.js +138 -0
- package/vendor/dynamic-workflow/schema/types.d.ts +67 -0
- package/vendor/dynamic-workflow/schema/types.d.ts.map +1 -0
- package/vendor/dynamic-workflow/schema/types.js +18 -0
- package/vendor/dynamic-workflow/schema/validate.d.ts +15 -0
- package/vendor/dynamic-workflow/schema/validate.d.ts.map +1 -0
- package/vendor/dynamic-workflow/schema/validate.js +213 -0
- package/vendor/dynamic-workflow/testing/index.d.ts +6 -0
- package/vendor/dynamic-workflow/testing/index.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/index.js +5 -0
- package/vendor/dynamic-workflow/testing/journal-contract-artifacts.d.ts +9 -0
- package/vendor/dynamic-workflow/testing/journal-contract-artifacts.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract-artifacts.js +195 -0
- package/vendor/dynamic-workflow/testing/journal-contract-events.d.ts +9 -0
- package/vendor/dynamic-workflow/testing/journal-contract-events.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract-events.js +163 -0
- package/vendor/dynamic-workflow/testing/journal-contract-helpers.d.ts +9 -0
- package/vendor/dynamic-workflow/testing/journal-contract-helpers.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract-helpers.js +12 -0
- package/vendor/dynamic-workflow/testing/journal-contract-isolation.d.ts +9 -0
- package/vendor/dynamic-workflow/testing/journal-contract-isolation.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract-isolation.js +46 -0
- package/vendor/dynamic-workflow/testing/journal-contract-nodes.d.ts +9 -0
- package/vendor/dynamic-workflow/testing/journal-contract-nodes.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract-nodes.js +234 -0
- package/vendor/dynamic-workflow/testing/journal-contract-reads.d.ts +11 -0
- package/vendor/dynamic-workflow/testing/journal-contract-reads.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract-reads.js +281 -0
- package/vendor/dynamic-workflow/testing/journal-contract-runs.d.ts +9 -0
- package/vendor/dynamic-workflow/testing/journal-contract-runs.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract-runs.js +396 -0
- package/vendor/dynamic-workflow/testing/journal-contract-script.d.ts +12 -0
- package/vendor/dynamic-workflow/testing/journal-contract-script.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract-script.js +82 -0
- package/vendor/dynamic-workflow/testing/journal-contract.d.ts +15 -0
- package/vendor/dynamic-workflow/testing/journal-contract.d.ts.map +1 -0
- package/vendor/dynamic-workflow/testing/journal-contract.js +31 -0
- package/vendor/dynamic-workflow-runtime/child-cell-streams.js +128 -0
- package/vendor/dynamic-workflow-runtime/child-entry-file.js +43 -0
- package/vendor/dynamic-workflow-runtime/child-source.js +299 -0
- package/vendor/dynamic-workflow-runtime/harness.js +302 -0
- package/vendor/dynamic-workflow-runtime/index.js +4 -0
- package/vendor/dynamic-workflow-runtime/protocol.js +2 -0
- package/vendor/mcode-host/dynamic-workflow-import.js +269 -0
- package/vendor/mcode-host/workflow-git-world-read.js +183 -0
- package/vendor/mcode-host/workflow-world-read.js +282 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { WORKFLOW_FUNCTION_NAME } from "../compiler/compile.js";
|
|
3
|
+
export function emptyValue() {
|
|
4
|
+
return { fields: new Map(), fns: new Set(), occs: new Map(), phs: new Map() };
|
|
5
|
+
}
|
|
6
|
+
function occKey(site, port) {
|
|
7
|
+
return `${site}|${port ?? ""}`;
|
|
8
|
+
}
|
|
9
|
+
export function phKey(ph) {
|
|
10
|
+
return `${ph.fnId}:${ph.param}`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Add an occurrence, maintaining the port-subsumption invariant of every taint set:
|
|
14
|
+
* occurrences are keyed by (site, port) and distinct ports of a site coexist, BUT a
|
|
15
|
+
* portless occurrence of a site subsumes every ported occurrence of the same site
|
|
16
|
+
* (merging their exactness). A whole-node read is portless, so it collapses element
|
|
17
|
+
* precision; a selected element keeps its port until a whole-node read joins it.
|
|
18
|
+
*/
|
|
19
|
+
export function addOcc(target, occ) {
|
|
20
|
+
if (occ.port === undefined)
|
|
21
|
+
return addPortless(target, occ);
|
|
22
|
+
// Ported: if a portless occurrence of the site already exists, it subsumes this one.
|
|
23
|
+
const portless = target.occs.get(occKey(occ.site, undefined));
|
|
24
|
+
if (portless !== undefined) {
|
|
25
|
+
if (occ.exact && !portless.exact) {
|
|
26
|
+
portless.exact = true;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return addExact(target, occ);
|
|
32
|
+
}
|
|
33
|
+
function addPortless(target, occ) {
|
|
34
|
+
// Drop any ported occurrences of the same site, folding their exactness in.
|
|
35
|
+
let exact = occ.exact;
|
|
36
|
+
let changed = false;
|
|
37
|
+
const drop = [];
|
|
38
|
+
for (const [key, existing] of target.occs) {
|
|
39
|
+
if (existing.site === occ.site && existing.port !== undefined) {
|
|
40
|
+
exact = exact || existing.exact;
|
|
41
|
+
drop.push(key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
for (const key of drop) {
|
|
45
|
+
target.occs.delete(key);
|
|
46
|
+
changed = true;
|
|
47
|
+
}
|
|
48
|
+
return addExact(target, { exact, site: occ.site }) || changed;
|
|
49
|
+
}
|
|
50
|
+
function addExact(target, occ) {
|
|
51
|
+
const key = occKey(occ.site, occ.port);
|
|
52
|
+
const existing = target.occs.get(key);
|
|
53
|
+
if (existing === undefined) {
|
|
54
|
+
target.occs.set(key, { exact: occ.exact, port: occ.port, site: occ.site });
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
if (occ.exact && !existing.exact) {
|
|
58
|
+
existing.exact = true;
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
export function addPlaceholder(target, ph) {
|
|
64
|
+
const key = phKey(ph);
|
|
65
|
+
const existing = target.phs.get(key);
|
|
66
|
+
if (existing !== undefined) {
|
|
67
|
+
// A rest bit must not be lost when the same placeholder is merged from a
|
|
68
|
+
// non-rest witness (e.g. the keystone rule) — otherwise resolution would
|
|
69
|
+
// stop gathering the tail actuals.
|
|
70
|
+
if (ph.rest === true && existing.rest !== true) {
|
|
71
|
+
existing.rest = true;
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
target.phs.set(key, { fnId: ph.fnId, param: ph.param, ...(ph.rest === true ? { rest: true } : {}) });
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Fixed cap on field nesting. Beyond it, structure collapses into the occurrence set,
|
|
81
|
+
* keeping the lattice finite in the presence of cyclic (`a.self = a`) and
|
|
82
|
+
* recursively-grown heap — the premise the monotone fixpoint needs to converge. With
|
|
83
|
+
* place-aliasing an abstract value can be genuinely cyclic (a field pointing back at
|
|
84
|
+
* its container is a single shared node), so every recursive walk below is also
|
|
85
|
+
* cycle-safe (identity guards / visited sets); the two together make divergence and
|
|
86
|
+
* the `ITERATION_CAP` throw unreachable.
|
|
87
|
+
*/
|
|
88
|
+
export const VALUE_DEPTH_CAP = 8;
|
|
89
|
+
/** Deep weak-merge `source` into `target`; returns true iff `target` grew. */
|
|
90
|
+
export function mergeInto(target, source, depth = 0) {
|
|
91
|
+
if (target === source)
|
|
92
|
+
return false; // identity guard: mergeInto(x, x) is a no-op (cycle-safe)
|
|
93
|
+
let changed = false;
|
|
94
|
+
for (const occ of source.occs.values())
|
|
95
|
+
changed = addOcc(target, occ) || changed;
|
|
96
|
+
for (const ph of source.phs.values())
|
|
97
|
+
changed = addPlaceholder(target, ph) || changed;
|
|
98
|
+
for (const fn of source.fns) {
|
|
99
|
+
if (!target.fns.has(fn)) {
|
|
100
|
+
target.fns.add(fn);
|
|
101
|
+
changed = true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (source.bound !== undefined)
|
|
105
|
+
changed = mergeBound(target, source.bound, depth) || changed;
|
|
106
|
+
if (source.mayAlias !== undefined) {
|
|
107
|
+
// Union may-alias back-references, deduped by slot IDENTITY (Set): a conditional
|
|
108
|
+
// binding merged across fixpoint passes must reach a fixed point, not append duplicates.
|
|
109
|
+
const targets = (target.mayAlias ??= new Set());
|
|
110
|
+
for (const m of source.mayAlias) {
|
|
111
|
+
if (!targets.has(m)) {
|
|
112
|
+
targets.add(m);
|
|
113
|
+
changed = true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (depth >= VALUE_DEPTH_CAP) {
|
|
118
|
+
// Depth cap reached: do not descend (a cycle would recurse forever, and unbounded
|
|
119
|
+
// nesting would break the finite-lattice premise). Fold the remaining structure
|
|
120
|
+
// into this node's occurrence set instead. collapseInto is cycle-safe and reports
|
|
121
|
+
// growth, so the fixpoint's `changed` signal stays sound.
|
|
122
|
+
for (const field of source.fields.values())
|
|
123
|
+
changed = collapseInto(target, field) || changed;
|
|
124
|
+
return changed;
|
|
125
|
+
}
|
|
126
|
+
for (const [key, field] of source.fields) {
|
|
127
|
+
let slot = target.fields.get(key);
|
|
128
|
+
if (slot === undefined) {
|
|
129
|
+
slot = emptyValue();
|
|
130
|
+
target.fields.set(key, slot);
|
|
131
|
+
}
|
|
132
|
+
changed = mergeInto(slot, field, depth + 1) || changed;
|
|
133
|
+
}
|
|
134
|
+
return changed;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Union a bind prefix into `target` element-wise (position i of one bind maps to position
|
|
138
|
+
* i of another). Beyond the depth cap the prefix folds into `target`'s occurrences (an
|
|
139
|
+
* inexact smear that keeps every bound label alive — never a drop), keeping deeply-nested
|
|
140
|
+
* bind-of-bind structure finite.
|
|
141
|
+
*
|
|
142
|
+
* The prefix's LENGTH is capped the same way, at {@link VALUE_DEPTH_CAP} positions — a
|
|
143
|
+
* partial application longer than that is degenerate, and the cap is what keeps the lattice
|
|
144
|
+
* finite along the OTHER axis. A self-rebind (`let h = f; h = h.bind(null, "x")`)
|
|
145
|
+
* grows the prefix by one element per fixpoint pass — the value gets LONGER, never deeper,
|
|
146
|
+
* so the depth cap never fires; without the length cap this loop would extend
|
|
147
|
+
* `target.bound` by index and report `changed` forever, until the analysis hits
|
|
148
|
+
* `ITERATION_CAP`. Over-cap elements collapse into
|
|
149
|
+
* `target`'s occurrences, the identical degrade the depth cap uses. Honesty note: that keeps
|
|
150
|
+
* every label alive ON THE VALUE, but a tracked dispatch does not fold callee-value
|
|
151
|
+
* occurrences into parameters or results, so a prefix with more than CAP *distinct* bound
|
|
152
|
+
* values loses routing for the tail — reachable only by a hand-written >8-argument partial
|
|
153
|
+
* application (the loop-grown repro merely duplicates labels already present in-cap, so it
|
|
154
|
+
* loses nothing). Accepted trade against the ITERATION_CAP crash. Prefixes are only ever
|
|
155
|
+
* BUILT over-length by a per-pass temporary (calls.ts handleInvocationForwarding composes
|
|
156
|
+
* `[...receiver.bound, ...prefixArgs]`); every path into persistent storage runs through
|
|
157
|
+
* here, so persistent `bound` arrays never exceed the cap — which is also what bounds
|
|
158
|
+
* `substitute`, whose output prefix is a 1:1 map of an already-capped summary prefix.
|
|
159
|
+
*/
|
|
160
|
+
export function mergeBound(target, sourceBound, depth) {
|
|
161
|
+
let changed = false;
|
|
162
|
+
if (depth >= VALUE_DEPTH_CAP) {
|
|
163
|
+
for (const el of sourceBound)
|
|
164
|
+
changed = collapseInto(target, el) || changed;
|
|
165
|
+
return changed;
|
|
166
|
+
}
|
|
167
|
+
if (target.bound === undefined)
|
|
168
|
+
target.bound = [];
|
|
169
|
+
const tb = target.bound;
|
|
170
|
+
for (let i = 0; i < sourceBound.length; i += 1) {
|
|
171
|
+
const el = sourceBound[i];
|
|
172
|
+
if (i >= VALUE_DEPTH_CAP) {
|
|
173
|
+
changed = collapseInto(target, el) || changed; // degrade: smear into occs (never drop)
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
let slot = tb[i];
|
|
177
|
+
if (slot === undefined) {
|
|
178
|
+
slot = emptyValue();
|
|
179
|
+
tb[i] = slot;
|
|
180
|
+
changed = true;
|
|
181
|
+
}
|
|
182
|
+
changed = mergeInto(slot, el, depth + 1) || changed;
|
|
183
|
+
}
|
|
184
|
+
return changed;
|
|
185
|
+
}
|
|
186
|
+
export function cloneValue(v) {
|
|
187
|
+
const out = emptyValue();
|
|
188
|
+
mergeInto(out, v);
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
/** Union of several values into a fresh owned value. */
|
|
192
|
+
export function unionValues(...values) {
|
|
193
|
+
const out = emptyValue();
|
|
194
|
+
for (const v of values)
|
|
195
|
+
mergeInto(out, v);
|
|
196
|
+
return out;
|
|
197
|
+
}
|
|
198
|
+
export function singleOcc(site, exact, port) {
|
|
199
|
+
const out = emptyValue();
|
|
200
|
+
addOcc(out, { exact, port, site });
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Fold a value to its taint occurrences (occs + placeholders), dropping FIELD STRUCTURE
|
|
205
|
+
* but keeping the tracked function values found anywhere in it. Ports are preserved per
|
|
206
|
+
* occurrence; the port-subsumption invariant (a portless occurrence shadows ported ones
|
|
207
|
+
* of the same site) is maintained by {@link addOcc}, so a whole-node read that mixes the
|
|
208
|
+
* node's own portless label with per-element ported labels folds to the single portless
|
|
209
|
+
* label.
|
|
210
|
+
*
|
|
211
|
+
* Widening folds LABELS, never the call graph: a collapsed /
|
|
212
|
+
* computed-access read carries every function value nested in the
|
|
213
|
+
* structure, so a callee selected by `fns[i]` or reached through an iterated element
|
|
214
|
+
* still dispatches to its summary (widened, inexact) rather than becoming an unknown
|
|
215
|
+
* call. Fns sets are finite (bounded by the script's function nodes), so carrying them
|
|
216
|
+
* through collapse stays monotone and cannot diverge the fixpoint.
|
|
217
|
+
*/
|
|
218
|
+
export function collapse(v) {
|
|
219
|
+
const out = emptyValue();
|
|
220
|
+
collapseInto(out, v);
|
|
221
|
+
return out;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Fold `v`'s taint (occs + placeholders + fns, recursively through fields) into `out`;
|
|
225
|
+
* returns true iff `out` grew. Cycle-safe via `seen`: a shared/cyclic field object is
|
|
226
|
+
* folded once (its occs already contributed on first visit), so `a.self = a` folds in
|
|
227
|
+
* finite time. Returning growth keeps the depth-cap fold in {@link mergeInto} sound.
|
|
228
|
+
*/
|
|
229
|
+
export function collapseInto(out, v, seen = new Set()) {
|
|
230
|
+
if (seen.has(v))
|
|
231
|
+
return false;
|
|
232
|
+
seen.add(v);
|
|
233
|
+
let changed = false;
|
|
234
|
+
for (const occ of v.occs.values())
|
|
235
|
+
changed = addOcc(out, occ) || changed;
|
|
236
|
+
for (const ph of v.phs.values())
|
|
237
|
+
changed = addPlaceholder(out, ph) || changed;
|
|
238
|
+
// Carry nested function values so widening never drops a callee (see collapse's doc).
|
|
239
|
+
for (const fn of v.fns) {
|
|
240
|
+
if (!out.fns.has(fn)) {
|
|
241
|
+
out.fns.add(fn);
|
|
242
|
+
changed = true;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
for (const field of v.fields.values())
|
|
246
|
+
changed = collapseInto(out, field, seen) || changed;
|
|
247
|
+
// Bound-prefix args carry taint (occs/placeholders/fns) that must survive folding —
|
|
248
|
+
// otherwise a bound function collapsed at a summary/emission boundary silently drops its
|
|
249
|
+
// captured labels.
|
|
250
|
+
for (const el of v.bound ?? [])
|
|
251
|
+
changed = collapseInto(out, el, seen) || changed;
|
|
252
|
+
return changed;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Read a statically-known field using smear-on-read: the field's own value
|
|
256
|
+
* unioned with the CONTAINER's own container-level occurrences (occs + placeholders,
|
|
257
|
+
* not its other fields). A write smeared into the container through an untracked path
|
|
258
|
+
* (root-identifier fold, computed index, `push`) lands in the container's occs, and a
|
|
259
|
+
* precise field read must never hide it. Absent field → whole-value read (collapse,
|
|
260
|
+
* exactness preserved — not a widening).
|
|
261
|
+
*
|
|
262
|
+
* The smear is strictly ADDITIVE: a portless container occurrence is NOT merged when the
|
|
263
|
+
* field already carries a ported occurrence of that same site, because addOcc's
|
|
264
|
+
* port-subsumption would otherwise collapse the port. That preserves join-port precision
|
|
265
|
+
* — reading element `k` of a join result keeps `join#K|port=k` rather than folding it to
|
|
266
|
+
* the join's whole-node portless label — while still surfacing genuine untracked writes
|
|
267
|
+
* (which never have a matching ported field occ).
|
|
268
|
+
*/
|
|
269
|
+
export function readField(container, key) {
|
|
270
|
+
const field = container.fields.get(key);
|
|
271
|
+
if (field === undefined)
|
|
272
|
+
return collapse(container);
|
|
273
|
+
const out = cloneValue(field);
|
|
274
|
+
for (const occ of container.occs.values()) {
|
|
275
|
+
if (occ.port === undefined && hasPortedOcc(out, occ.site))
|
|
276
|
+
continue;
|
|
277
|
+
addOcc(out, occ);
|
|
278
|
+
}
|
|
279
|
+
for (const ph of container.phs.values())
|
|
280
|
+
addPlaceholder(out, ph);
|
|
281
|
+
return out;
|
|
282
|
+
}
|
|
283
|
+
function hasPortedOcc(v, site) {
|
|
284
|
+
for (const occ of v.occs.values()) {
|
|
285
|
+
if (occ.site === site && occ.port !== undefined)
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
/** Copy of `v` with every occurrence's exactness bit cleared (recursively). */
|
|
291
|
+
export function clearExact(v) {
|
|
292
|
+
const out = cloneValue(v);
|
|
293
|
+
clearExactInPlace(out);
|
|
294
|
+
return out;
|
|
295
|
+
}
|
|
296
|
+
function clearExactInPlace(v, seen = new Set()) {
|
|
297
|
+
if (seen.has(v))
|
|
298
|
+
return; // cycle-safe: a shared/cyclic field is cleared once
|
|
299
|
+
seen.add(v);
|
|
300
|
+
for (const occ of v.occs.values())
|
|
301
|
+
occ.exact = false;
|
|
302
|
+
for (const field of v.fields.values())
|
|
303
|
+
clearExactInPlace(field, seen);
|
|
304
|
+
for (const el of v.bound ?? [])
|
|
305
|
+
clearExactInPlace(el, seen);
|
|
306
|
+
}
|
|
307
|
+
/** True for actor labels; everything else (ask/world-read/join/fan-out) is an artifact. */
|
|
308
|
+
export { isActorSite } from "./core.js";
|
|
309
|
+
/** Provisional fan-out id used inside occurrences before ordinals are assigned. */
|
|
310
|
+
export function provisionalFanoutId(order) {
|
|
311
|
+
return `fan-out@${order}`;
|
|
312
|
+
}
|
|
313
|
+
// --- small AST helpers shared by the analysis ------------------------------
|
|
314
|
+
/**
|
|
315
|
+
* Method names that mutate their receiver in place: array (`push`/`unshift`/`splice`)
|
|
316
|
+
* and collection (`Map.set`, `Set.add`) writes. The transfer weak-merges each
|
|
317
|
+
* argument's taint into the receiver's live value; an unresolvable receiver falls back
|
|
318
|
+
* to the root-identifier smear (never a silent drop — see handleHeapMutator). `set`/`add`
|
|
319
|
+
* are common names, but a false match cannot lose flow: mutator handling only ADDS taint
|
|
320
|
+
* (a sound over-approximation, never a kill), and a member that actually HOLDS a tracked
|
|
321
|
+
* script-local function dispatches as an ordinary call (see evalCall's mutator branch).
|
|
322
|
+
*/
|
|
323
|
+
// `send` 是 facade `Channel<T>` 的入队(docs/dynamic-workflow/authoring.md「Streams」):一次向容器
|
|
324
|
+
// 写入,与 push / Map.set 同规——`ch.send(x)` 把 x 的 taint 并进 channel 的 place,`for await` 再从
|
|
325
|
+
// place 读出,于是每个生产者到每个消费者各画一条数据边。按名字匹配(与其余 mutator 一致),
|
|
326
|
+
// 脚本自己声明的 `send` 方法照旧走 calls.ts 里「成员持有脚本函数则按调用分派」的守卫。
|
|
327
|
+
export const HEAP_MUTATORS = new Set(["push", "unshift", "splice", "set", "add", "send"]);
|
|
328
|
+
/**
|
|
329
|
+
* Every compound-assignment token (`+=`, `-=`, … and the logical `||=`/`&&=`/`??=`).
|
|
330
|
+
* These read-modify-write the target: gen-only has no kills, so the transfer just
|
|
331
|
+
* weak-merges the RHS into the target (the old value stays) and yields their union.
|
|
332
|
+
*/
|
|
333
|
+
export const COMPOUND_ASSIGNMENT_OPS = new Set([
|
|
334
|
+
ts.SyntaxKind.PlusEqualsToken,
|
|
335
|
+
ts.SyntaxKind.MinusEqualsToken,
|
|
336
|
+
ts.SyntaxKind.AsteriskEqualsToken,
|
|
337
|
+
ts.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
338
|
+
ts.SyntaxKind.SlashEqualsToken,
|
|
339
|
+
ts.SyntaxKind.PercentEqualsToken,
|
|
340
|
+
ts.SyntaxKind.LessThanLessThanEqualsToken,
|
|
341
|
+
ts.SyntaxKind.GreaterThanGreaterThanEqualsToken,
|
|
342
|
+
ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken,
|
|
343
|
+
ts.SyntaxKind.AmpersandEqualsToken,
|
|
344
|
+
ts.SyntaxKind.BarEqualsToken,
|
|
345
|
+
ts.SyntaxKind.CaretEqualsToken,
|
|
346
|
+
ts.SyntaxKind.BarBarEqualsToken,
|
|
347
|
+
ts.SyntaxKind.AmpersandAmpersandEqualsToken,
|
|
348
|
+
ts.SyntaxKind.QuestionQuestionEqualsToken,
|
|
349
|
+
]);
|
|
350
|
+
export function findWorkflowBody(scriptFile) {
|
|
351
|
+
for (const statement of scriptFile.statements) {
|
|
352
|
+
if (ts.isFunctionDeclaration(statement) &&
|
|
353
|
+
statement.name?.text === WORKFLOW_FUNCTION_NAME &&
|
|
354
|
+
statement.body !== undefined) {
|
|
355
|
+
return statement.body;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
throw new Error(`workflow wrapper function ${WORKFLOW_FUNCTION_NAME} not found`);
|
|
359
|
+
}
|
|
360
|
+
export function isFunctionLike(node) {
|
|
361
|
+
return (ts.isFunctionDeclaration(node) ||
|
|
362
|
+
ts.isFunctionExpression(node) ||
|
|
363
|
+
ts.isArrowFunction(node) ||
|
|
364
|
+
ts.isMethodDeclaration(node) ||
|
|
365
|
+
ts.isGetAccessorDeclaration(node) ||
|
|
366
|
+
ts.isSetAccessorDeclaration(node) ||
|
|
367
|
+
ts.isConstructorDeclaration(node));
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* A function-like node that owns its own `arguments` object — every kind except an arrow
|
|
371
|
+
* (arrows see the lexically-enclosing function's `arguments`). Used to resolve `arguments`
|
|
372
|
+
* to the right function's actuals.
|
|
373
|
+
*/
|
|
374
|
+
export function isNonArrowFunctionLike(node) {
|
|
375
|
+
return isFunctionLike(node) && !ts.isArrowFunction(node);
|
|
376
|
+
}
|
|
377
|
+
/** A directly-referenced callee (an identifier or a function literal) preserves exactness. */
|
|
378
|
+
export function isDirectCallee(callee) {
|
|
379
|
+
const expr = ts.isParenthesizedExpression(callee) ? callee.expression : callee;
|
|
380
|
+
return (ts.isIdentifier(expr) ||
|
|
381
|
+
ts.isPropertyAccessExpression(expr) ||
|
|
382
|
+
ts.isFunctionExpression(expr) ||
|
|
383
|
+
ts.isArrowFunction(expr));
|
|
384
|
+
}
|
|
385
|
+
export function isJsonStringify(access) {
|
|
386
|
+
return (ts.isIdentifier(access.expression) && access.expression.text === "JSON" && access.name.text === "stringify");
|
|
387
|
+
}
|
|
388
|
+
/** The static field key for `x[k]` when `k` is a string/number literal, else undefined. */
|
|
389
|
+
export function staticIndexKey(arg) {
|
|
390
|
+
if (ts.isNumericLiteral(arg))
|
|
391
|
+
return arg.text;
|
|
392
|
+
if (ts.isStringLiteralLike(arg))
|
|
393
|
+
return arg.text;
|
|
394
|
+
return undefined;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Peel value-preserving wrappers that can sit on a place expression. Besides the pure
|
|
398
|
+
* type-level / grouping wrappers (parens, `as`/`satisfies`, non-null, type assertion),
|
|
399
|
+
* the comma operator `(a, box)` evaluates to its LAST operand, so it IS that place
|
|
400
|
+
* (`control-flow-comma-alias-write`); the discarded operands carry no place and are
|
|
401
|
+
* evaluated for effect separately by callers on the aliasing path. `await` is NOT peeled
|
|
402
|
+
* here — it is a place only when the awaited value is a genuine promise (not a custom
|
|
403
|
+
* thenable, whose `then` transforms the result), a distinction resolvePlace makes on the
|
|
404
|
+
* evaluated value.
|
|
405
|
+
*/
|
|
406
|
+
export function peelPlace(expr) {
|
|
407
|
+
let cur = expr;
|
|
408
|
+
while (true) {
|
|
409
|
+
if (ts.isParenthesizedExpression(cur))
|
|
410
|
+
cur = cur.expression;
|
|
411
|
+
else if (ts.isNonNullExpression(cur))
|
|
412
|
+
cur = cur.expression;
|
|
413
|
+
else if (ts.isAsExpression(cur) || ts.isSatisfiesExpression(cur))
|
|
414
|
+
cur = cur.expression;
|
|
415
|
+
else if (ts.isTypeAssertionExpression(cur))
|
|
416
|
+
cur = cur.expression;
|
|
417
|
+
else if (ts.isBinaryExpression(cur) && cur.operatorToken.kind === ts.SyntaxKind.CommaToken)
|
|
418
|
+
cur = cur.right;
|
|
419
|
+
else if (ts.isCommaListExpression(cur) && cur.elements.length > 0) {
|
|
420
|
+
cur = cur.elements[cur.elements.length - 1];
|
|
421
|
+
}
|
|
422
|
+
else
|
|
423
|
+
return cur;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/** The live field object at `key`, created empty on demand (shared reference). */
|
|
427
|
+
export function liveField(container, key) {
|
|
428
|
+
let field = container.fields.get(key);
|
|
429
|
+
if (field === undefined) {
|
|
430
|
+
field = emptyValue();
|
|
431
|
+
container.fields.set(key, field);
|
|
432
|
+
}
|
|
433
|
+
return field;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Replay a field write into `container`'s may-alias targets: `container.f = value` must
|
|
437
|
+
* also reach `target.f` for every place `container` may-alias (a conditional binding's arms,
|
|
438
|
+
* a join result element's input). INEXACT: a may-alias write happens on one arm only, so it
|
|
439
|
+
* clears exactness and never strong-updates a target (the direct write into the container's
|
|
440
|
+
* own slot stays exact — this only affects the replay). Recurses into each target's OWN
|
|
441
|
+
* mayAlias (chained aliases: `d = f2 ? a : e` where `a = f ? b : c`), cycle-safe via an
|
|
442
|
+
* identity seen-set and depth-capped (beyond the cap the collapsed write smears into the
|
|
443
|
+
* target's occs — a widening, never a drop). Returns true iff any target grew.
|
|
444
|
+
*/
|
|
445
|
+
export function replayMayAliasWrite(container, key, value) {
|
|
446
|
+
if (container.mayAlias === undefined)
|
|
447
|
+
return false;
|
|
448
|
+
return replayFieldInto(container.mayAlias, key, clearExact(value), new Set(), 0);
|
|
449
|
+
}
|
|
450
|
+
function replayFieldInto(targets, key, write, seen, depth) {
|
|
451
|
+
let changed = false;
|
|
452
|
+
for (const target of targets) {
|
|
453
|
+
if (seen.has(target))
|
|
454
|
+
continue;
|
|
455
|
+
seen.add(target);
|
|
456
|
+
if (depth >= VALUE_DEPTH_CAP) {
|
|
457
|
+
changed = collapseInto(target, write) || changed; // degrade: smear into occs (never drop)
|
|
458
|
+
continue;
|
|
459
|
+
}
|
|
460
|
+
changed = mergeInto(liveField(target, key), write) || changed;
|
|
461
|
+
if (target.mayAlias !== undefined)
|
|
462
|
+
changed = replayFieldInto(target.mayAlias, key, write, seen, depth + 1) || changed;
|
|
463
|
+
}
|
|
464
|
+
return changed;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Replay an in-place mutation (`push`/`Map.set`/…) into a container's may-alias targets:
|
|
468
|
+
* the collapsed value smears (INEXACT) into each target's occs, recursing into chained
|
|
469
|
+
* aliases. Same soundness contract as {@link replayMayAliasWrite}. Returns true iff any
|
|
470
|
+
* target grew.
|
|
471
|
+
*/
|
|
472
|
+
export function replayMayAliasMerge(container, value) {
|
|
473
|
+
if (container.mayAlias === undefined)
|
|
474
|
+
return false;
|
|
475
|
+
return replayMergeInto(container.mayAlias, clearExact(collapse(value)), new Set());
|
|
476
|
+
}
|
|
477
|
+
function replayMergeInto(targets, write, seen) {
|
|
478
|
+
let changed = false;
|
|
479
|
+
for (const target of targets) {
|
|
480
|
+
if (seen.has(target))
|
|
481
|
+
continue;
|
|
482
|
+
seen.add(target);
|
|
483
|
+
changed = mergeInto(target, write) || changed;
|
|
484
|
+
if (target.mayAlias !== undefined)
|
|
485
|
+
changed = replayMergeInto(target.mayAlias, write, seen) || changed;
|
|
486
|
+
}
|
|
487
|
+
return changed;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Shallow-copy field sharing: `target` adopts each of `source`'s statically-known field
|
|
491
|
+
* value objects BY REFERENCE, so a later write through `target.f`'s sub-object stays
|
|
492
|
+
* visible through `source.f` and vice versa. Models `Object.assign(target, source)` and
|
|
493
|
+
* spread (`{ ...source }`, `[...source]`), which shallow-copy at runtime — an
|
|
494
|
+
* object-valued property is copied as a shared reference. A colliding target field is weak-merged INTO the
|
|
495
|
+
* source's field first (runtime overwrites; gen-only keeps the union) before both names
|
|
496
|
+
* adopt that one shared object. Returns true iff `target` grew. Only top-level fields are
|
|
497
|
+
* shared (a genuine shallow copy), so no recursion / cycle risk.
|
|
498
|
+
*/
|
|
499
|
+
export function adoptFields(target, source) {
|
|
500
|
+
let changed = false;
|
|
501
|
+
for (const [key, srcField] of source.fields) {
|
|
502
|
+
const existing = target.fields.get(key);
|
|
503
|
+
if (existing === srcField)
|
|
504
|
+
continue;
|
|
505
|
+
if (existing !== undefined)
|
|
506
|
+
mergeInto(srcField, existing);
|
|
507
|
+
target.fields.set(key, srcField);
|
|
508
|
+
changed = true;
|
|
509
|
+
}
|
|
510
|
+
return changed;
|
|
511
|
+
}
|
|
512
|
+
/** The statically-known member name a binding element reads, if any. */
|
|
513
|
+
export function bindingPropertyKey(element) {
|
|
514
|
+
if (element.propertyName !== undefined) {
|
|
515
|
+
if (ts.isIdentifier(element.propertyName) ||
|
|
516
|
+
ts.isStringLiteralLike(element.propertyName) ||
|
|
517
|
+
ts.isNumericLiteral(element.propertyName)) {
|
|
518
|
+
return element.propertyName.text;
|
|
519
|
+
}
|
|
520
|
+
return undefined;
|
|
521
|
+
}
|
|
522
|
+
return ts.isIdentifier(element.name) ? element.name.text : undefined;
|
|
523
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { CompileDiagnostic, WorkflowProgram } from "../compiler/compile.js";
|
|
2
|
+
import { type SiteTable } from "./sites.js";
|
|
3
|
+
/**
|
|
4
|
+
* The facade-siting diagnostic. Kept in its own module,
|
|
5
|
+
* a sibling of the site-table substrate: this is an
|
|
6
|
+
* analysis diagnostic, not part of the shared table, and it walks the body in a
|
|
7
|
+
* different shape (every reference / conversion, not just call sites).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Package-local diagnostic code for the facade-siting rule. Not a TS diagnostic code
|
|
11
|
+
* (those come from the checker); this marks an analysis diagnostic produced by
|
|
12
|
+
* {@link collectFacadeMisuse}. Kept out of the TS code space to stay unambiguous.
|
|
13
|
+
*/
|
|
14
|
+
export declare const FACADE_SITING_CODE = 9001;
|
|
15
|
+
/**
|
|
16
|
+
* The facade-siting diagnostic: facade callables are second-class — `agent`, `Agent.ask`,
|
|
17
|
+
* `files.glob`/`files.read`, `artifact.file`/`artifact.chart`, and `log` may appear only as the
|
|
18
|
+
* callee of a direct call. Any other reference (aliasing `const spawn = agent`, method
|
|
19
|
+
* extraction `const f = planner.ask`, `.bind`/`.call`/`.apply` receivers, passing a
|
|
20
|
+
* facade function as an argument) destroys site identity: journal keys, replay, and
|
|
21
|
+
* the GUI all key off static site ids, and a facade call reachable only through an
|
|
22
|
+
* escaped function value has no site. Widening cannot represent it and silently
|
|
23
|
+
* dropping it would be unsound, so it is rejected at compile time.
|
|
24
|
+
*
|
|
25
|
+
* Three passes over the workflow body:
|
|
26
|
+
*
|
|
27
|
+
* 1. Reference scan — every identifier / property-access whose checker-resolved
|
|
28
|
+
* symbol is a facade callable, in any position other than the callee of a direct
|
|
29
|
+
* call; PLUS every destructuring binding/assignment that extracts a facade
|
|
30
|
+
* callable off its containing object (see {@link flagExtractedMember}).
|
|
31
|
+
* 2. Defense in depth — any direct CallExpression whose callee resolves to a
|
|
32
|
+
* site-producing facade callable but that never registered as a site (catches
|
|
33
|
+
* escape forms the reference scan misses).
|
|
34
|
+
* 3. Retyping boundary — any conversion of a value that carries a site-producing
|
|
35
|
+
* facade member (`Agent.ask`, `files.glob`/`read`) to a type that does NOT (a
|
|
36
|
+
* structurally-compatible local interface, `any`, `unknown`). TypeScript resolves
|
|
37
|
+
* members by *declared type*, so `const d = planner as Askable; d.ask(...)` or
|
|
38
|
+
* `function run(a: Askable) { a.ask(...) }; run(planner)` makes `.ask` resolve to
|
|
39
|
+
* the local declaration — pass 1 sees a non-facade symbol, pass 2's resolved
|
|
40
|
+
* signature points at the local interface: no site, no diagnostic, and the real
|
|
41
|
+
* facade call runs unsited. Enforced at the conversion boundary
|
|
42
|
+
* (`as`/`satisfies`, argument→parameter, return, annotated binding) rather than by
|
|
43
|
+
* tracking value provenance through the cast (see {@link facadeSiteMember}).
|
|
44
|
+
*
|
|
45
|
+
* Destructuring extraction: `const { ask } = planner`, `const { read }
|
|
46
|
+
* = files`, renamed `{ ask: f }`, nested `{ p: { ask } }`, parameter `function f({ ask }:
|
|
47
|
+
* Agent)`, and assignment `({ ask } = planner)` are all method extraction — the destructured
|
|
48
|
+
* twin of the already-rejected `const f = planner.ask`. A shorthand binding identifier
|
|
49
|
+
* resolves to the freshly-declared LOCAL (not the facade method), so the identifier scan is
|
|
50
|
+
* blind; and routing the value through a script-locally-typed helper hides the eventual call
|
|
51
|
+
* from Pass 2's signature check too. Both holes close by flagging at the EXTRACTION site
|
|
52
|
+
* (see {@link scanRefs}): resolve the source property on the destructured value's type and
|
|
53
|
+
* reject a facade callable.
|
|
54
|
+
*/
|
|
55
|
+
export declare function collectFacadeMisuse(workflow: WorkflowProgram, table: SiteTable): CompileDiagnostic[];
|
|
56
|
+
//# sourceMappingURL=facade-misuse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facade-misuse.d.ts","sourceRoot":"","sources":["../../src/analysis/facade-misuse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEjF,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAkBvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,SAAS,GACf,iBAAiB,EAAE,CA6JrB"}
|