worldvm 0.0.0-stage → 0.1.0
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/AUTHORING.md +833 -0
- package/README.md +154 -2
- package/bin/worldvm.mjs +3 -0
- package/dist/_internal/forma/index.d.ts +1 -0
- package/dist/_internal/forma/index.js +1 -0
- package/dist/_internal/forma/world/authoring-help.d.ts +25 -0
- package/dist/_internal/forma/world/authoring-help.js +130 -0
- package/dist/_internal/forma/world/citations.d.ts +3 -0
- package/dist/_internal/forma/world/citations.js +26 -0
- package/dist/_internal/forma/world/clock-bindings.d.ts +4 -0
- package/dist/_internal/forma/world/clock-bindings.js +45 -0
- package/dist/_internal/forma/world/compile.d.ts +13 -0
- package/dist/_internal/forma/world/compile.js +190 -0
- package/dist/_internal/forma/world/coverage.d.ts +10 -0
- package/dist/_internal/forma/world/coverage.js +242 -0
- package/dist/_internal/forma/world/digest.d.ts +1 -0
- package/dist/_internal/forma/world/digest.js +1 -0
- package/dist/_internal/forma/world/documentation.d.ts +3 -0
- package/dist/_internal/forma/world/documentation.js +38 -0
- package/dist/_internal/forma/world/homes.d.ts +4 -0
- package/dist/_internal/forma/world/homes.js +202 -0
- package/dist/_internal/forma/world/index.d.ts +6 -0
- package/dist/_internal/forma/world/index.js +5 -0
- package/dist/_internal/forma/world/lowering/accounts.d.ts +4 -0
- package/dist/_internal/forma/world/lowering/accounts.js +36 -0
- package/dist/_internal/forma/world/lowering/action-policy.d.ts +5 -0
- package/dist/_internal/forma/world/lowering/action-policy.js +16 -0
- package/dist/_internal/forma/world/lowering/agents.d.ts +6 -0
- package/dist/_internal/forma/world/lowering/agents.js +116 -0
- package/dist/_internal/forma/world/lowering/bundles.d.ts +3 -0
- package/dist/_internal/forma/world/lowering/bundles.js +13 -0
- package/dist/_internal/forma/world/lowering/child-parameters.d.ts +14 -0
- package/dist/_internal/forma/world/lowering/child-parameters.js +36 -0
- package/dist/_internal/forma/world/lowering/collects.d.ts +3 -0
- package/dist/_internal/forma/world/lowering/collects.js +51 -0
- package/dist/_internal/forma/world/lowering/component-operations.d.ts +6 -0
- package/dist/_internal/forma/world/lowering/component-operations.js +26 -0
- package/dist/_internal/forma/world/lowering/components.d.ts +7 -0
- package/dist/_internal/forma/world/lowering/components.js +236 -0
- package/dist/_internal/forma/world/lowering/connectors.d.ts +4 -0
- package/dist/_internal/forma/world/lowering/connectors.js +31 -0
- package/dist/_internal/forma/world/lowering/context.d.ts +80 -0
- package/dist/_internal/forma/world/lowering/context.js +316 -0
- package/dist/_internal/forma/world/lowering/contracts.d.ts +7 -0
- package/dist/_internal/forma/world/lowering/contracts.js +73 -0
- package/dist/_internal/forma/world/lowering/decisions.d.ts +3 -0
- package/dist/_internal/forma/world/lowering/decisions.js +164 -0
- package/dist/_internal/forma/world/lowering/derives.d.ts +3 -0
- package/dist/_internal/forma/world/lowering/derives.js +22 -0
- package/dist/_internal/forma/world/lowering/discretionary.d.ts +7 -0
- package/dist/_internal/forma/world/lowering/discretionary.js +15 -0
- package/dist/_internal/forma/world/lowering/documents.d.ts +3 -0
- package/dist/_internal/forma/world/lowering/documents.js +68 -0
- package/dist/_internal/forma/world/lowering/effective.d.ts +5 -0
- package/dist/_internal/forma/world/lowering/effective.js +26 -0
- package/dist/_internal/forma/world/lowering/entities.d.ts +3 -0
- package/dist/_internal/forma/world/lowering/entities.js +43 -0
- package/dist/_internal/forma/world/lowering/escalations.d.ts +6 -0
- package/dist/_internal/forma/world/lowering/escalations.js +31 -0
- package/dist/_internal/forma/world/lowering/evidence.d.ts +3 -0
- package/dist/_internal/forma/world/lowering/evidence.js +75 -0
- package/dist/_internal/forma/world/lowering/files.d.ts +4 -0
- package/dist/_internal/forma/world/lowering/files.js +56 -0
- package/dist/_internal/forma/world/lowering/holds.d.ts +6 -0
- package/dist/_internal/forma/world/lowering/holds.js +35 -0
- package/dist/_internal/forma/world/lowering/index.d.ts +89 -0
- package/dist/_internal/forma/world/lowering/index.js +115 -0
- package/dist/_internal/forma/world/lowering/interactions.d.ts +7 -0
- package/dist/_internal/forma/world/lowering/interactions.js +190 -0
- package/dist/_internal/forma/world/lowering/library.d.ts +5 -0
- package/dist/_internal/forma/world/lowering/library.js +41 -0
- package/dist/_internal/forma/world/lowering/milestones.d.ts +6 -0
- package/dist/_internal/forma/world/lowering/milestones.js +17 -0
- package/dist/_internal/forma/world/lowering/notices.d.ts +3 -0
- package/dist/_internal/forma/world/lowering/notices.js +33 -0
- package/dist/_internal/forma/world/lowering/param-bounds.d.ts +15 -0
- package/dist/_internal/forma/world/lowering/param-bounds.js +71 -0
- package/dist/_internal/forma/world/lowering/policies.d.ts +6 -0
- package/dist/_internal/forma/world/lowering/policies.js +95 -0
- package/dist/_internal/forma/world/lowering/principals.d.ts +62 -0
- package/dist/_internal/forma/world/lowering/principals.js +32 -0
- package/dist/_internal/forma/world/lowering/recurrences.d.ts +9 -0
- package/dist/_internal/forma/world/lowering/recurrences.js +56 -0
- package/dist/_internal/forma/world/lowering/renewal.d.ts +5 -0
- package/dist/_internal/forma/world/lowering/renewal.js +21 -0
- package/dist/_internal/forma/world/lowering/resources.d.ts +6 -0
- package/dist/_internal/forma/world/lowering/resources.js +19 -0
- package/dist/_internal/forma/world/lowering/reuse.d.ts +5 -0
- package/dist/_internal/forma/world/lowering/reuse.js +75 -0
- package/dist/_internal/forma/world/lowering/sources.d.ts +10 -0
- package/dist/_internal/forma/world/lowering/sources.js +47 -0
- package/dist/_internal/forma/world/lowering/syntax.d.ts +84 -0
- package/dist/_internal/forma/world/lowering/syntax.js +94 -0
- package/dist/_internal/forma/world/lowering/vaults.d.ts +11 -0
- package/dist/_internal/forma/world/lowering/vaults.js +148 -0
- package/dist/_internal/forma/world/prelude.generated.d.ts +1 -0
- package/dist/_internal/forma/world/prelude.generated.js +2 -0
- package/dist/_internal/forma/world/properties.d.ts +9 -0
- package/dist/_internal/forma/world/properties.js +387 -0
- package/dist/_internal/forma/world/scenarios.d.ts +10 -0
- package/dist/_internal/forma/world/scenarios.js +757 -0
- package/dist/_internal/forma/world/sensitivity.d.ts +3 -0
- package/dist/_internal/forma/world/sensitivity.js +118 -0
- package/dist/_internal/forma/world/source-syntax.d.ts +6 -0
- package/dist/_internal/forma/world/source-syntax.js +27 -0
- package/dist/_internal/forma/world/status-handling.d.ts +3 -0
- package/dist/_internal/forma/world/status-handling.js +143 -0
- package/dist/_internal/forma/world/surface.d.ts +30 -0
- package/dist/_internal/forma/world/surface.js +213 -0
- package/dist/_internal/forma/world/table-expressions.d.ts +3 -0
- package/dist/_internal/forma/world/table-expressions.js +41 -0
- package/dist/_internal/forma-tools/index.d.ts +17 -0
- package/dist/_internal/forma-tools/index.js +124 -0
- package/dist/_internal/ir-checks/advances.d.ts +7 -0
- package/dist/_internal/ir-checks/advances.js +6 -0
- package/dist/_internal/ir-checks/agent-reads.d.ts +14 -0
- package/dist/_internal/ir-checks/agent-reads.js +118 -0
- package/dist/_internal/ir-checks/amendments.d.ts +3 -0
- package/dist/_internal/ir-checks/amendments.js +21 -0
- package/dist/_internal/ir-checks/canonical-json.d.ts +3 -0
- package/dist/_internal/ir-checks/canonical-json.js +85 -0
- package/dist/_internal/ir-checks/child-parameters.d.ts +2 -0
- package/dist/_internal/ir-checks/child-parameters.js +43 -0
- package/dist/_internal/ir-checks/clock-bindings.d.ts +3 -0
- package/dist/_internal/ir-checks/clock-bindings.js +43 -0
- package/dist/_internal/ir-checks/collect-types.d.ts +14 -0
- package/dist/_internal/ir-checks/collect-types.js +34 -0
- package/dist/_internal/ir-checks/component-operations.d.ts +4 -0
- package/dist/_internal/ir-checks/component-operations.js +23 -0
- package/dist/_internal/ir-checks/content-digest.d.ts +4 -0
- package/dist/_internal/ir-checks/content-digest.js +78 -0
- package/dist/_internal/ir-checks/contract-validation.d.ts +3 -0
- package/dist/_internal/ir-checks/contract-validation.js +307 -0
- package/dist/_internal/ir-checks/contracts.d.ts +25 -0
- package/dist/_internal/ir-checks/contracts.js +80 -0
- package/dist/_internal/ir-checks/dates.d.ts +2 -0
- package/dist/_internal/ir-checks/dates.js +7 -0
- package/dist/_internal/ir-checks/documents.d.ts +3 -0
- package/dist/_internal/ir-checks/documents.js +45 -0
- package/dist/_internal/ir-checks/evidence.d.ts +20 -0
- package/dist/_internal/ir-checks/evidence.js +56 -0
- package/dist/_internal/ir-checks/files.d.ts +7 -0
- package/dist/_internal/ir-checks/files.js +47 -0
- package/dist/_internal/ir-checks/index.d.ts +59 -0
- package/dist/_internal/ir-checks/index.js +166 -0
- package/dist/_internal/ir-checks/instants.d.ts +7 -0
- package/dist/_internal/ir-checks/instants.js +61 -0
- package/dist/_internal/ir-checks/notices.d.ts +4 -0
- package/dist/_internal/ir-checks/notices.js +58 -0
- package/dist/_internal/ir-checks/policy-bounds.d.ts +5 -0
- package/dist/_internal/ir-checks/policy-bounds.js +28 -0
- package/dist/_internal/ir-checks/principals.d.ts +26 -0
- package/dist/_internal/ir-checks/principals.js +162 -0
- package/dist/_internal/ir-checks/prior-cycle.d.ts +41 -0
- package/dist/_internal/ir-checks/prior-cycle.js +21 -0
- package/dist/_internal/ir-checks/read-classification.d.ts +12 -0
- package/dist/_internal/ir-checks/read-classification.js +67 -0
- package/dist/_internal/ir-checks/read-types.d.ts +2 -0
- package/dist/_internal/ir-checks/read-types.js +40 -0
- package/dist/_internal/ir-checks/resource-proofs.d.ts +4 -0
- package/dist/_internal/ir-checks/resource-proofs.js +98 -0
- package/dist/_internal/ir-checks/resources.d.ts +3 -0
- package/dist/_internal/ir-checks/resources.js +30 -0
- package/dist/_internal/ir-checks/reuse.d.ts +10 -0
- package/dist/_internal/ir-checks/reuse.js +99 -0
- package/dist/_internal/ir-checks/sealing.d.ts +14 -0
- package/dist/_internal/ir-checks/sealing.js +123 -0
- package/dist/_internal/ir-checks/sensitive-flow.d.ts +4 -0
- package/dist/_internal/ir-checks/sensitive-flow.js +240 -0
- package/dist/_internal/ir-checks/sensitivity.d.ts +19 -0
- package/dist/_internal/ir-checks/sensitivity.js +133 -0
- package/dist/_internal/ir-checks/signatures.d.ts +4 -0
- package/dist/_internal/ir-checks/signatures.js +22 -0
- package/dist/_internal/ir-checks/vaults.d.ts +10 -0
- package/dist/_internal/ir-checks/vaults.js +140 -0
- package/dist/_internal/protocol/index.d.ts +1234 -0
- package/dist/_internal/protocol/index.js +215 -0
- package/dist/_internal/reconciler/action-intents.d.ts +17 -0
- package/dist/_internal/reconciler/action-intents.js +161 -0
- package/dist/_internal/reconciler/actions.d.ts +7 -0
- package/dist/_internal/reconciler/actions.js +134 -0
- package/dist/_internal/reconciler/amendments.d.ts +12 -0
- package/dist/_internal/reconciler/amendments.js +52 -0
- package/dist/_internal/reconciler/basis.d.ts +253 -0
- package/dist/_internal/reconciler/basis.js +16 -0
- package/dist/_internal/reconciler/bundles.d.ts +22 -0
- package/dist/_internal/reconciler/bundles.js +110 -0
- package/dist/_internal/reconciler/change-detection.d.ts +5 -0
- package/dist/_internal/reconciler/change-detection.js +82 -0
- package/dist/_internal/reconciler/collection-rules.d.ts +7 -0
- package/dist/_internal/reconciler/collection-rules.js +46 -0
- package/dist/_internal/reconciler/collection-state.d.ts +11 -0
- package/dist/_internal/reconciler/collection-state.js +62 -0
- package/dist/_internal/reconciler/collection-values.d.ts +5 -0
- package/dist/_internal/reconciler/collection-values.js +60 -0
- package/dist/_internal/reconciler/collections.d.ts +35 -0
- package/dist/_internal/reconciler/collections.js +141 -0
- package/dist/_internal/reconciler/commands.d.ts +60 -0
- package/dist/_internal/reconciler/commands.js +468 -0
- package/dist/_internal/reconciler/component-operations.d.ts +48 -0
- package/dist/_internal/reconciler/component-operations.js +256 -0
- package/dist/_internal/reconciler/context.d.ts +38 -0
- package/dist/_internal/reconciler/context.js +44 -0
- package/dist/_internal/reconciler/coverage.d.ts +31 -0
- package/dist/_internal/reconciler/coverage.js +124 -0
- package/dist/_internal/reconciler/dates.d.ts +38 -0
- package/dist/_internal/reconciler/dates.js +121 -0
- package/dist/_internal/reconciler/decide.d.ts +25 -0
- package/dist/_internal/reconciler/decide.js +263 -0
- package/dist/_internal/reconciler/decision-evaluation.d.ts +9 -0
- package/dist/_internal/reconciler/decision-evaluation.js +67 -0
- package/dist/_internal/reconciler/decision-records.d.ts +14 -0
- package/dist/_internal/reconciler/decision-records.js +77 -0
- package/dist/_internal/reconciler/decision-release.d.ts +3 -0
- package/dist/_internal/reconciler/decision-release.js +12 -0
- package/dist/_internal/reconciler/dependencies.d.ts +179 -0
- package/dist/_internal/reconciler/dependencies.js +372 -0
- package/dist/_internal/reconciler/discovery.d.ts +9 -0
- package/dist/_internal/reconciler/discovery.js +65 -0
- package/dist/_internal/reconciler/document-corrections.d.ts +18 -0
- package/dist/_internal/reconciler/document-corrections.js +59 -0
- package/dist/_internal/reconciler/documents.d.ts +26 -0
- package/dist/_internal/reconciler/documents.js +88 -0
- package/dist/_internal/reconciler/effective.d.ts +6 -0
- package/dist/_internal/reconciler/effective.js +17 -0
- package/dist/_internal/reconciler/escalations.d.ts +4 -0
- package/dist/_internal/reconciler/escalations.js +76 -0
- package/dist/_internal/reconciler/evaluation.d.ts +56 -0
- package/dist/_internal/reconciler/evaluation.js +704 -0
- package/dist/_internal/reconciler/evidence-authority.d.ts +6 -0
- package/dist/_internal/reconciler/evidence-authority.js +70 -0
- package/dist/_internal/reconciler/evidence-history.d.ts +5 -0
- package/dist/_internal/reconciler/evidence-history.js +22 -0
- package/dist/_internal/reconciler/evidence-validity.d.ts +17 -0
- package/dist/_internal/reconciler/evidence-validity.js +135 -0
- package/dist/_internal/reconciler/fact-validation.d.ts +5 -0
- package/dist/_internal/reconciler/fact-validation.js +49 -0
- package/dist/_internal/reconciler/files.d.ts +9 -0
- package/dist/_internal/reconciler/files.js +56 -0
- package/dist/_internal/reconciler/graph.d.ts +40 -0
- package/dist/_internal/reconciler/graph.js +298 -0
- package/dist/_internal/reconciler/holds.d.ts +6 -0
- package/dist/_internal/reconciler/holds.js +18 -0
- package/dist/_internal/reconciler/home-definitions.d.ts +11 -0
- package/dist/_internal/reconciler/home-definitions.js +25 -0
- package/dist/_internal/reconciler/homes.d.ts +6 -0
- package/dist/_internal/reconciler/homes.js +32 -0
- package/dist/_internal/reconciler/index.d.ts +42 -0
- package/dist/_internal/reconciler/index.js +58 -0
- package/dist/_internal/reconciler/instants.d.ts +17 -0
- package/dist/_internal/reconciler/instants.js +56 -0
- package/dist/_internal/reconciler/interaction-fields.d.ts +10 -0
- package/dist/_internal/reconciler/interaction-fields.js +30 -0
- package/dist/_internal/reconciler/invariants.d.ts +8 -0
- package/dist/_internal/reconciler/invariants.js +34 -0
- package/dist/_internal/reconciler/journal.d.ts +3 -0
- package/dist/_internal/reconciler/journal.js +4 -0
- package/dist/_internal/reconciler/linking.d.ts +10 -0
- package/dist/_internal/reconciler/linking.js +259 -0
- package/dist/_internal/reconciler/memory.d.ts +32 -0
- package/dist/_internal/reconciler/memory.js +190 -0
- package/dist/_internal/reconciler/milestones.d.ts +7 -0
- package/dist/_internal/reconciler/milestones.js +58 -0
- package/dist/_internal/reconciler/missing.d.ts +18 -0
- package/dist/_internal/reconciler/missing.js +79 -0
- package/dist/_internal/reconciler/model.d.ts +350 -0
- package/dist/_internal/reconciler/model.js +9 -0
- package/dist/_internal/reconciler/notices.d.ts +14 -0
- package/dist/_internal/reconciler/notices.js +80 -0
- package/dist/_internal/reconciler/occurrences.d.ts +3 -0
- package/dist/_internal/reconciler/occurrences.js +30 -0
- package/dist/_internal/reconciler/outputs.d.ts +12 -0
- package/dist/_internal/reconciler/outputs.js +132 -0
- package/dist/_internal/reconciler/parameters.d.ts +4 -0
- package/dist/_internal/reconciler/parameters.js +27 -0
- package/dist/_internal/reconciler/policies.d.ts +22 -0
- package/dist/_internal/reconciler/policies.js +94 -0
- package/dist/_internal/reconciler/policy-edits.d.ts +11 -0
- package/dist/_internal/reconciler/policy-edits.js +42 -0
- package/dist/_internal/reconciler/policy-linking.d.ts +4 -0
- package/dist/_internal/reconciler/policy-linking.js +104 -0
- package/dist/_internal/reconciler/principal-types.d.ts +2 -0
- package/dist/_internal/reconciler/principal-types.js +38 -0
- package/dist/_internal/reconciler/prior-decisions.d.ts +3 -0
- package/dist/_internal/reconciler/prior-decisions.js +34 -0
- package/dist/_internal/reconciler/projections.d.ts +4 -0
- package/dist/_internal/reconciler/projections.js +85 -0
- package/dist/_internal/reconciler/proofs.d.ts +9 -0
- package/dist/_internal/reconciler/proofs.js +24 -0
- package/dist/_internal/reconciler/properties.d.ts +25 -0
- package/dist/_internal/reconciler/properties.js +67 -0
- package/dist/_internal/reconciler/property-eval.d.ts +5 -0
- package/dist/_internal/reconciler/property-eval.js +101 -0
- package/dist/_internal/reconciler/property-generator.d.ts +9 -0
- package/dist/_internal/reconciler/property-generator.js +288 -0
- package/dist/_internal/reconciler/property-shrink.d.ts +14 -0
- package/dist/_internal/reconciler/property-shrink.js +183 -0
- package/dist/_internal/reconciler/provenance.d.ts +8 -0
- package/dist/_internal/reconciler/provenance.js +61 -0
- package/dist/_internal/reconciler/reconcile.d.ts +32 -0
- package/dist/_internal/reconciler/reconcile.js +164 -0
- package/dist/_internal/reconciler/recurrence.d.ts +9 -0
- package/dist/_internal/reconciler/recurrence.js +44 -0
- package/dist/_internal/reconciler/requirements.d.ts +5 -0
- package/dist/_internal/reconciler/requirements.js +331 -0
- package/dist/_internal/reconciler/resource-generation.d.ts +9 -0
- package/dist/_internal/reconciler/resource-generation.js +17 -0
- package/dist/_internal/reconciler/resource-scenarios.d.ts +26 -0
- package/dist/_internal/reconciler/resource-scenarios.js +78 -0
- package/dist/_internal/reconciler/resources.d.ts +24 -0
- package/dist/_internal/reconciler/resources.js +178 -0
- package/dist/_internal/reconciler/result-digest.d.ts +13 -0
- package/dist/_internal/reconciler/result-digest.js +66 -0
- package/dist/_internal/reconciler/reuse.d.ts +16 -0
- package/dist/_internal/reconciler/reuse.js +119 -0
- package/dist/_internal/reconciler/scenarios.d.ts +32 -0
- package/dist/_internal/reconciler/scenarios.js +442 -0
- package/dist/_internal/reconciler/scheduling.d.ts +9 -0
- package/dist/_internal/reconciler/scheduling.js +203 -0
- package/dist/_internal/reconciler/sha256.d.ts +1 -0
- package/dist/_internal/reconciler/sha256.js +1 -0
- package/dist/_internal/reconciler/signatures.d.ts +13 -0
- package/dist/_internal/reconciler/signatures.js +37 -0
- package/dist/_internal/reconciler/temporal.d.ts +10 -0
- package/dist/_internal/reconciler/temporal.js +46 -0
- package/dist/_internal/reconciler/upgrades.d.ts +6 -0
- package/dist/_internal/reconciler/upgrades.js +65 -0
- package/dist/_internal/reconciler/wire.d.ts +2 -0
- package/dist/_internal/reconciler/wire.js +5 -0
- package/dist/_internal/reconciler/work.d.ts +32 -0
- package/dist/_internal/reconciler/work.js +101 -0
- package/dist/_internal/world-ir/schema.generated.d.ts +180 -0
- package/dist/_internal/world-ir/schema.generated.js +1127 -0
- package/dist/_internal/world-ir/types.generated.d.ts +1011 -0
- package/dist/_internal/world-ir/types.generated.js +1 -0
- package/dist/authoring.d.ts +9 -0
- package/dist/authoring.js +10 -0
- package/dist/catalogue.d.ts +20 -0
- package/dist/catalogue.js +531 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +553 -0
- package/dist/codegen.d.ts +6 -0
- package/dist/codegen.js +89 -0
- package/dist/coverage.d.ts +60 -0
- package/dist/coverage.js +128 -0
- package/dist/deploy.d.ts +21 -0
- package/dist/deploy.js +72 -0
- package/dist/diagnostics.d.ts +9 -0
- package/dist/diagnostics.js +37 -0
- package/dist/diff.d.ts +17 -0
- package/dist/diff.js +19 -0
- package/dist/durable-object.d.ts +14 -0
- package/dist/durable-object.js +30 -0
- package/dist/explain.d.ts +113 -0
- package/dist/explain.js +225 -0
- package/dist/fixes.d.ts +4 -0
- package/dist/fixes.js +70 -0
- package/dist/fmt.d.ts +12 -0
- package/dist/fmt.js +39 -0
- package/dist/handle/open.d.ts +18 -0
- package/dist/handle/open.js +28 -0
- package/dist/handle/protocol.d.ts +12 -0
- package/dist/handle/protocol.js +96 -0
- package/dist/handle/store.d.ts +31 -0
- package/dist/handle/store.js +11 -0
- package/dist/handle/types.d.ts +37 -0
- package/dist/handle/types.js +1 -0
- package/dist/handle/world.d.ts +190 -0
- package/dist/handle/world.js +533 -0
- package/dist/http.d.ts +3 -0
- package/dist/http.js +72 -0
- package/dist/impact.d.ts +21 -0
- package/dist/impact.js +57 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +43 -0
- package/dist/init.d.ts +13 -0
- package/dist/init.js +99 -0
- package/dist/ir-schema.json +4213 -0
- package/dist/lints.d.ts +8 -0
- package/dist/lints.js +154 -0
- package/dist/lsp.d.ts +14 -0
- package/dist/lsp.js +380 -0
- package/dist/manual/catalog.d.ts +12 -0
- package/dist/manual/catalog.js +23 -0
- package/dist/manual/examples.d.ts +15 -0
- package/dist/manual/examples.js +39 -0
- package/dist/manual/projections.d.ts +77 -0
- package/dist/manual/projections.js +344 -0
- package/dist/manual/prose.d.ts +19 -0
- package/dist/manual/prose.js +215 -0
- package/dist/manual/render.d.ts +76 -0
- package/dist/manual/render.js +250 -0
- package/dist/manual/text.d.ts +7 -0
- package/dist/manual/text.js +15 -0
- package/dist/mcp.d.ts +32 -0
- package/dist/mcp.js +269 -0
- package/dist/mutate.d.ts +36 -0
- package/dist/mutate.js +123 -0
- package/dist/project.d.ts +26 -0
- package/dist/project.js +80 -0
- package/dist/refine.d.ts +18 -0
- package/dist/refine.js +197 -0
- package/dist/release/diff.d.ts +45 -0
- package/dist/release/diff.js +103 -0
- package/dist/release/impact.d.ts +83 -0
- package/dist/release/impact.js +214 -0
- package/dist/release/nodes.d.ts +20 -0
- package/dist/release/nodes.js +118 -0
- package/dist/render.d.ts +19 -0
- package/dist/render.js +43 -0
- package/dist/serve.d.ts +18 -0
- package/dist/serve.js +140 -0
- package/dist/snapshot.d.ts +19 -0
- package/dist/snapshot.js +45 -0
- package/dist/sqlite.d.ts +16 -0
- package/dist/sqlite.js +151 -0
- package/dist/test.d.ts +54 -0
- package/dist/test.js +131 -0
- package/dist/world.d.ts +7 -0
- package/dist/world.js +5 -0
- package/docs/authoring/vendor-risk/example.forma +11 -0
- package/docs/authoring/vendor-risk/library/vendor.forma +76 -0
- package/docs/authoring/vendor-risk/scenarios/reviews.forma +107 -0
- package/docs/protocol.md +195 -0
- package/docs/reference.md +258 -0
- package/package.json +81 -3
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { fileDigest } from "./files.js";
|
|
2
|
+
import { isLocalDate, normalizeInstant, collectionType, } from "../ir-checks/index.js";
|
|
3
|
+
/** Collection writes are scalar facts, validated against the owning entity's type. */
|
|
4
|
+
export const collectionValue = (p, type, value) => {
|
|
5
|
+
const parse = (descriptor) => {
|
|
6
|
+
if (!descriptor)
|
|
7
|
+
return undefined;
|
|
8
|
+
if (descriptor.kind === "literal")
|
|
9
|
+
return typeof value === "string" && value.replace(/^:/, "") === descriptor.value
|
|
10
|
+
? descriptor.value
|
|
11
|
+
: undefined;
|
|
12
|
+
if (descriptor.kind === "union") {
|
|
13
|
+
for (const member of descriptor.members) {
|
|
14
|
+
const result = parse(member);
|
|
15
|
+
if (result !== undefined)
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
switch (descriptor.kind) {
|
|
21
|
+
case "File":
|
|
22
|
+
return fileDigest(value) ? value : undefined;
|
|
23
|
+
case "String":
|
|
24
|
+
return typeof value === "string" && value.trim() !== "" ? value : undefined;
|
|
25
|
+
case "Keyword":
|
|
26
|
+
return typeof value === "string" && value.trim() !== ""
|
|
27
|
+
? value.replace(/^:/, "")
|
|
28
|
+
: undefined;
|
|
29
|
+
case "Bool":
|
|
30
|
+
return typeof value === "boolean"
|
|
31
|
+
? value
|
|
32
|
+
: value === "true"
|
|
33
|
+
? true
|
|
34
|
+
: value === "false"
|
|
35
|
+
? false
|
|
36
|
+
: undefined;
|
|
37
|
+
case "Int": {
|
|
38
|
+
const n = typeof value === "number"
|
|
39
|
+
? value
|
|
40
|
+
: typeof value === "string" && /^-?\d+$/.test(value)
|
|
41
|
+
? Number(value)
|
|
42
|
+
: NaN;
|
|
43
|
+
return Number.isSafeInteger(n) ? n : undefined;
|
|
44
|
+
}
|
|
45
|
+
case "Float": {
|
|
46
|
+
const n = typeof value === "number"
|
|
47
|
+
? value
|
|
48
|
+
: typeof value === "string" && /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(value)
|
|
49
|
+
? Number(value)
|
|
50
|
+
: NaN;
|
|
51
|
+
return Number.isFinite(n) ? n : undefined;
|
|
52
|
+
}
|
|
53
|
+
case "Date":
|
|
54
|
+
return typeof value === "string" && isLocalDate(value) ? value : undefined;
|
|
55
|
+
case "Instant":
|
|
56
|
+
return typeof value === "string" ? (normalizeInstant(value) ?? undefined) : undefined;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return parse(collectionType(type, p.ir.types));
|
|
60
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type * as IR from "../world-ir/types.generated.js";
|
|
2
|
+
import type { Basis, Scalar } from "./basis.js";
|
|
3
|
+
import { type World } from "./memory.js";
|
|
4
|
+
import type { TimePoint } from "./instants.js";
|
|
5
|
+
import type { WorldReconciliation } from "./model.js";
|
|
6
|
+
export interface CollectionField {
|
|
7
|
+
readonly key: string;
|
|
8
|
+
readonly entity: string;
|
|
9
|
+
readonly attribute: string;
|
|
10
|
+
readonly field: string;
|
|
11
|
+
readonly collection: string | null;
|
|
12
|
+
readonly type: IR.TypeRef;
|
|
13
|
+
readonly value: Scalar | null;
|
|
14
|
+
readonly mode: "ask" | "confirm";
|
|
15
|
+
readonly consumers: readonly {
|
|
16
|
+
instance: string;
|
|
17
|
+
action: string;
|
|
18
|
+
field: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export interface CollectionTask {
|
|
22
|
+
readonly key: string;
|
|
23
|
+
readonly assignee: string;
|
|
24
|
+
readonly fields: readonly CollectionField[];
|
|
25
|
+
}
|
|
26
|
+
/** Only the supplied eligible work is traversed; this never discovers source subjects. */
|
|
27
|
+
export declare const collectionTasks: (recon: WorldReconciliation, snapshot: Basis) => readonly CollectionTask[];
|
|
28
|
+
export declare const collectFacts: (recon: WorldReconciliation, world: World, at: TimePoint, request: {
|
|
29
|
+
readonly assignee: string;
|
|
30
|
+
readonly by: string;
|
|
31
|
+
readonly values: Readonly<Record<string, Scalar>>;
|
|
32
|
+
readonly actor?: {
|
|
33
|
+
readonly kind: "human" | "agent";
|
|
34
|
+
};
|
|
35
|
+
}) => World;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { factFileAllowed, fileAllowed } from "./files.js";
|
|
2
|
+
import { occurrenceHome } from "./homes.js";
|
|
3
|
+
import { collectionType } from "../ir-checks/index.js";
|
|
4
|
+
import { command } from "./commands.js";
|
|
5
|
+
import { confirmFacts } from "./collection-state.js";
|
|
6
|
+
import { factKey, collectionRule } from "./collection-rules.js";
|
|
7
|
+
import { collectionValue } from "./collection-values.js";
|
|
8
|
+
import { evaluateFor } from "./evaluation.js";
|
|
9
|
+
import { bindingReadOnly } from "./interaction-fields.js";
|
|
10
|
+
import { log } from "./journal.js";
|
|
11
|
+
import { basis } from "./memory.js";
|
|
12
|
+
import { programFor, admit } from "./reconcile.js";
|
|
13
|
+
/** Only the supplied eligible work is traversed; this never discovers source subjects. */
|
|
14
|
+
export const collectionTasks = (recon, snapshot) => {
|
|
15
|
+
const groups = new Map();
|
|
16
|
+
for (const [instance, result] of recon.results) {
|
|
17
|
+
const p = programFor(recon, instance);
|
|
18
|
+
for (const action of result.actions) {
|
|
19
|
+
if ((action.state !== "eligible" && action.state !== "dispatched") ||
|
|
20
|
+
action.missing.length ||
|
|
21
|
+
action.assigneeKind !== "entity" ||
|
|
22
|
+
!action.assigneeId ||
|
|
23
|
+
!action.interaction ||
|
|
24
|
+
action.authorityConstraints?.some((c) => c.kind !== "entity" || c.id !== action.assigneeId))
|
|
25
|
+
continue;
|
|
26
|
+
const interaction = p.interactions.get(action.interaction);
|
|
27
|
+
for (const field of action.fields ?? []) {
|
|
28
|
+
const binding = interaction.binds.find((b) => b.field === field.field), expr = binding?.from ?? binding?.target;
|
|
29
|
+
if (expr?.k !== "attr")
|
|
30
|
+
continue;
|
|
31
|
+
const rule = collectionRule(p, expr.attr);
|
|
32
|
+
if (!rule && (field.mode !== "ask" || !binding?.target || bindingReadOnly(p, binding)))
|
|
33
|
+
continue;
|
|
34
|
+
if (rule && !field.collection?.required)
|
|
35
|
+
continue;
|
|
36
|
+
const entity = evaluateFor(recon, snapshot, snapshot.now, instance, expr.of);
|
|
37
|
+
if (typeof entity !== "string")
|
|
38
|
+
continue;
|
|
39
|
+
const key = factKey(entity, expr.attr), value = snapshot.fact(entity, expr.attr)?.v ?? null;
|
|
40
|
+
const consumer = { instance, action: action.action, field: field.field };
|
|
41
|
+
const type = p.entities
|
|
42
|
+
.get(expr.attr.slice(0, expr.attr.indexOf("/")))
|
|
43
|
+
?.fields.find((f) => f.attr === expr.attr)?.type ??
|
|
44
|
+
p.evidence.get(interaction.produces).fields.find((f) => f.name === field.field).type;
|
|
45
|
+
if (!collectionType(type, p.ir.types))
|
|
46
|
+
continue;
|
|
47
|
+
let fields = groups.get(action.assigneeId);
|
|
48
|
+
if (!fields)
|
|
49
|
+
groups.set(action.assigneeId, (fields = new Map()));
|
|
50
|
+
const old = fields.get(key);
|
|
51
|
+
fields.set(key, old
|
|
52
|
+
? { ...old, consumers: [...old.consumers, consumer] }
|
|
53
|
+
: {
|
|
54
|
+
key,
|
|
55
|
+
entity,
|
|
56
|
+
attribute: expr.attr,
|
|
57
|
+
field: field.field,
|
|
58
|
+
collection: rule?.name ?? null,
|
|
59
|
+
type,
|
|
60
|
+
value,
|
|
61
|
+
mode: value === null ? "ask" : "confirm",
|
|
62
|
+
consumers: [consumer],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return [...groups]
|
|
68
|
+
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
|
|
69
|
+
.map(([assignee, fields]) => ({
|
|
70
|
+
key: JSON.stringify(["worldvm/collect@1", assignee]),
|
|
71
|
+
assignee,
|
|
72
|
+
fields: [...fields.values()]
|
|
73
|
+
.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0))
|
|
74
|
+
.map((field) => ({
|
|
75
|
+
...field,
|
|
76
|
+
consumers: [...field.consumers].sort((a, b) => {
|
|
77
|
+
const x = JSON.stringify(a), y = JSON.stringify(b);
|
|
78
|
+
return x < y ? -1 : x > y ? 1 : 0;
|
|
79
|
+
}),
|
|
80
|
+
})),
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
export const collectFacts = (recon, world, at, request) => {
|
|
84
|
+
if (request.by !== request.assignee || request.actor?.kind === "agent")
|
|
85
|
+
return world;
|
|
86
|
+
const snapshot = basis(world, at), task = collectionTasks(recon, snapshot).find((t) => t.assignee === request.assignee);
|
|
87
|
+
if (!task || !Object.keys(request.values).length)
|
|
88
|
+
return world;
|
|
89
|
+
const parsed = [];
|
|
90
|
+
for (const [key, value] of Object.entries(request.values)) {
|
|
91
|
+
const field = task.fields.find((f) => f.key === key);
|
|
92
|
+
if (!field)
|
|
93
|
+
return world;
|
|
94
|
+
const p = programFor(recon, field.consumers[0].instance), typed = collectionValue(p, field.type, value);
|
|
95
|
+
if (typed === undefined || !factFileAllowed(p, snapshot, field.entity, field.attribute, typed))
|
|
96
|
+
return world;
|
|
97
|
+
for (const consumer of field.consumers) {
|
|
98
|
+
const cp = programFor(recon, consumer.instance), inst = recon.instances.get(consumer.instance), action = recon.results.get(inst.id).actions.find((a) => a.action === consumer.action), interaction = cp.interactions.get(action.interaction), contract = cp.evidence
|
|
99
|
+
.get(interaction.produces)
|
|
100
|
+
.fields.find((f) => f.name === consumer.field);
|
|
101
|
+
const home = occurrenceHome(cp, inst, recon.instances)?.id;
|
|
102
|
+
if (!home || !fileAllowed(cp, snapshot, home, contract, typed))
|
|
103
|
+
return world;
|
|
104
|
+
}
|
|
105
|
+
parsed.push({ entity: field.entity, attribute: field.attribute, value: typed });
|
|
106
|
+
}
|
|
107
|
+
const subjects = new Set([request.assignee, ...parsed.map((f) => f.entity)]);
|
|
108
|
+
const violations = [...subjects].flatMap((subject) => admit(recon, snapshot, at, { kind: "collect", subject }));
|
|
109
|
+
if (violations.length)
|
|
110
|
+
return log(world, {
|
|
111
|
+
at,
|
|
112
|
+
actor: request.by,
|
|
113
|
+
title: "Rejected: collect shared facts",
|
|
114
|
+
context: violations.map((v) => v.reason).join("; "),
|
|
115
|
+
changes: [],
|
|
116
|
+
});
|
|
117
|
+
const writes = parsed
|
|
118
|
+
.filter((f) => snapshot.fact(f.entity, f.attribute)?.v !== f.value)
|
|
119
|
+
.map((f) => ({ e: f.entity, a: f.attribute, v: f.value }));
|
|
120
|
+
const applied = writes.length
|
|
121
|
+
? command(recon, world, at, {
|
|
122
|
+
kind: "collect",
|
|
123
|
+
subject: request.assignee,
|
|
124
|
+
title: "Collected shared facts",
|
|
125
|
+
by: request.by,
|
|
126
|
+
facts: writes,
|
|
127
|
+
})
|
|
128
|
+
: { world, violations: [] };
|
|
129
|
+
if (applied.violations.length)
|
|
130
|
+
return applied.world;
|
|
131
|
+
const confirmed = confirmFacts(applied.world, at, request.by, parsed);
|
|
132
|
+
return confirmed === applied.world
|
|
133
|
+
? confirmed
|
|
134
|
+
: log(confirmed, {
|
|
135
|
+
at,
|
|
136
|
+
actor: request.by,
|
|
137
|
+
title: "Confirmed shared facts",
|
|
138
|
+
context: task.key,
|
|
139
|
+
changes: [],
|
|
140
|
+
});
|
|
141
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type DecisionRequest } from "./decide.js";
|
|
2
|
+
export { log } from "./journal.js";
|
|
3
|
+
import type { LocalDate } from "./dates.js";
|
|
4
|
+
import { type Program, type Violation, type WorldReconciliation } from "./reconcile.js";
|
|
5
|
+
import { type World } from "./memory.js";
|
|
6
|
+
import type { Scalar } from "./basis.js";
|
|
7
|
+
import type * as IR from "../world-ir/types.generated.js";
|
|
8
|
+
/** Shared field and rule checks for signed submissions. */
|
|
9
|
+
export declare const validEvidence: (p: Program, type: string, values: Readonly<Record<string, Scalar>>, now: LocalDate) => boolean;
|
|
10
|
+
export type WorkActor = DecisionRequest["actor"] | {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly kind: "service" | "connector";
|
|
13
|
+
readonly groups: readonly string[];
|
|
14
|
+
};
|
|
15
|
+
export interface Perform {
|
|
16
|
+
readonly signature?: IR.SignatureInput;
|
|
17
|
+
readonly instance: string;
|
|
18
|
+
readonly action: string;
|
|
19
|
+
readonly by: string;
|
|
20
|
+
/** A submission without its attestation: recorded, but not proof. */
|
|
21
|
+
readonly unsigned?: boolean;
|
|
22
|
+
readonly decision?: "accepted" | "declined";
|
|
23
|
+
/** Trusted host identity/memberships. Without actor, by is a trusted human ID, not a label. */
|
|
24
|
+
readonly actor?: WorkActor;
|
|
25
|
+
/** Public commands defer acknowledgement until their workflow result arrives. */
|
|
26
|
+
readonly connectorAcknowledgement?: "simulated" | "deferred";
|
|
27
|
+
readonly id?: string;
|
|
28
|
+
readonly reason?: Scalar | null;
|
|
29
|
+
readonly revoke?: string;
|
|
30
|
+
readonly values?: Readonly<Record<string, Scalar>>;
|
|
31
|
+
}
|
|
32
|
+
/** Perform an eligible action. Ineligible or repeated work leaves the world unchanged. */
|
|
33
|
+
export declare const perform: (recon: WorldReconciliation, world: World, at: LocalDate, request: Perform) => World;
|
|
34
|
+
/** An inbound signal moves a machine only along a declared transition. */
|
|
35
|
+
export declare const signal: (recon: WorldReconciliation, world: World, at: LocalDate, request: {
|
|
36
|
+
instance: string;
|
|
37
|
+
machine: string;
|
|
38
|
+
state: string;
|
|
39
|
+
by: string;
|
|
40
|
+
}) => World;
|
|
41
|
+
export interface Command {
|
|
42
|
+
readonly kind: string;
|
|
43
|
+
readonly subject: string;
|
|
44
|
+
readonly title: string;
|
|
45
|
+
readonly by: string;
|
|
46
|
+
readonly facts: ReadonlyArray<{
|
|
47
|
+
readonly e: string;
|
|
48
|
+
readonly a: string;
|
|
49
|
+
readonly v: Scalar | null;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
/** A command is admitted only if no declared invariant forbids it now. */
|
|
53
|
+
export declare const command: (recon: WorldReconciliation, world: World, at: LocalDate, request: Command) => {
|
|
54
|
+
world: World;
|
|
55
|
+
violations: readonly Violation[];
|
|
56
|
+
};
|
|
57
|
+
/** Only this checked path can pass correction metadata into the shared writer. */
|
|
58
|
+
export declare const amendEvidence: (recon: WorldReconciliation, world: World, at: LocalDate, request: Perform & {
|
|
59
|
+
readonly amend: IR.AmendmentInput;
|
|
60
|
+
}) => World;
|