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,13 @@
|
|
|
1
|
+
import type { Instance, Reconciliation } from "./reconcile.js";
|
|
2
|
+
type Content = Omit<Reconciliation, "digest"> & {
|
|
3
|
+
readonly digest?: string;
|
|
4
|
+
};
|
|
5
|
+
export { canonicalJson, semanticJson } from "../ir-checks/index.js";
|
|
6
|
+
/** Invocation-local caches never outlive the immutable evaluation snapshot. */
|
|
7
|
+
export declare const makeResultDigester: () => {
|
|
8
|
+
canonical: (instance: Instance, result: Content) => string;
|
|
9
|
+
digest: (instance: Instance, result: Content) => string;
|
|
10
|
+
};
|
|
11
|
+
/** Source spans are annotations; data dates and all observations remain committed. */
|
|
12
|
+
export declare const canonicalResult: (instance: Instance, result: Content) => string;
|
|
13
|
+
export declare const resultDigest: (instance: Instance, result: Content) => string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DependencyMap, isLocalDependency } from "./dependencies.js";
|
|
2
|
+
import { sha256 } from "./sha256.js";
|
|
3
|
+
import { semanticJson } from "../ir-checks/index.js";
|
|
4
|
+
export { canonicalJson, semanticJson } from "../ir-checks/index.js";
|
|
5
|
+
const staticDigests = new WeakMap();
|
|
6
|
+
const observation = (dependency) => {
|
|
7
|
+
if (dependency.kind !== "program")
|
|
8
|
+
return dependency;
|
|
9
|
+
let value = staticDigests.get(dependency.value);
|
|
10
|
+
if (!value) {
|
|
11
|
+
value = `sha256:${sha256(semanticJson(dependency.value))}`;
|
|
12
|
+
staticDigests.set(dependency.value, value);
|
|
13
|
+
}
|
|
14
|
+
return { kind: dependency.kind, account: dependency.account, value };
|
|
15
|
+
};
|
|
16
|
+
const entries = (map) => [...map].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
17
|
+
/** Invocation-local caches never outlive the immutable evaluation snapshot. */
|
|
18
|
+
export const makeResultDigester = () => {
|
|
19
|
+
const observations = new WeakMap();
|
|
20
|
+
const sets = new WeakMap();
|
|
21
|
+
const commitment = (map) => {
|
|
22
|
+
const cached = sets.get(map);
|
|
23
|
+
if (cached)
|
|
24
|
+
return cached;
|
|
25
|
+
const hashes = entries(map).map(([key, value]) => {
|
|
26
|
+
const cached = observations.get(value);
|
|
27
|
+
if (cached?.key === key)
|
|
28
|
+
return cached.hash;
|
|
29
|
+
const hash = sha256(semanticJson([key, observation(value)]));
|
|
30
|
+
observations.set(value, { key, hash });
|
|
31
|
+
return hash;
|
|
32
|
+
});
|
|
33
|
+
const hash = `sha256:${sha256(JSON.stringify(hashes))}`;
|
|
34
|
+
sets.set(map, hash);
|
|
35
|
+
return hash;
|
|
36
|
+
};
|
|
37
|
+
const canonical = (instance, result) => {
|
|
38
|
+
const { digest: _digest, dependsOn, ...evaluation } = result;
|
|
39
|
+
const basis = dependsOn instanceof DependencyMap
|
|
40
|
+
? dependsOn.shared
|
|
41
|
+
: new Map([...dependsOn].filter(([, d]) => !isLocalDependency(d)));
|
|
42
|
+
const local = dependsOn instanceof DependencyMap
|
|
43
|
+
? dependsOn.local
|
|
44
|
+
: new Map([...dependsOn].filter(([, d]) => isLocalDependency(d)));
|
|
45
|
+
return semanticJson({
|
|
46
|
+
format: "worldvm/reconciliation@2",
|
|
47
|
+
instance: {
|
|
48
|
+
...instance,
|
|
49
|
+
inputs: entries(instance.inputs),
|
|
50
|
+
...(instance.params ? { params: entries(instance.params) } : {}),
|
|
51
|
+
parents: [...instance.parents].sort(),
|
|
52
|
+
},
|
|
53
|
+
result: {
|
|
54
|
+
...evaluation,
|
|
55
|
+
dependsOn: { basis: commitment(basis), local: commitment(local) },
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
canonical,
|
|
61
|
+
digest: (instance, result) => `sha256:${sha256(canonical(instance, result))}`,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/** Source spans are annotations; data dates and all observations remain committed. */
|
|
65
|
+
export const canonicalResult = (instance, result) => makeResultDigester().canonical(instance, result);
|
|
66
|
+
export const resultDigest = (instance, result) => makeResultDigester().digest(instance, result);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { reuseDecisionName } from "../ir-checks/index.js";
|
|
2
|
+
import type * as IR from "../world-ir/types.generated.js";
|
|
3
|
+
import type { EvidenceRecord } from "./basis.js";
|
|
4
|
+
import { Unknown, type Cx, type Value } from "./model.js";
|
|
5
|
+
export { reuseDecisionName };
|
|
6
|
+
export declare const withReuseDecisions: (ir: IR.WorldIR) => IR.WorldIR;
|
|
7
|
+
/** Scope values are captured at signature time, not reconstructed from mutable profile facts. */
|
|
8
|
+
export declare const reuseKey: (cx: Cx, r: IR.Requirement) => string | null;
|
|
9
|
+
export interface ReusableProof {
|
|
10
|
+
readonly record: EvidenceRecord;
|
|
11
|
+
readonly from: string;
|
|
12
|
+
readonly until: string;
|
|
13
|
+
}
|
|
14
|
+
/** Host-side indexed query only. A pinned confirmation cannot silently switch to newer proof. */
|
|
15
|
+
export declare const reusableProof: (cx: Cx, r: IR.Requirement, pinned?: string) => ReusableProof | Unknown | null;
|
|
16
|
+
export declare const readReuse: (cx: Cx, r: IR.Requirement) => Value;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { evidenceSuperseded } from "./evidence-history.js";
|
|
2
|
+
import { signatureValid } from "./signatures.js";
|
|
3
|
+
import { signedFilesAllowed } from "./files.js";
|
|
4
|
+
import { reuseDecisionName, reuseDecisions } from "../ir-checks/index.js";
|
|
5
|
+
import { evaluateIn, isUnknown, selectedDecision } from "./evaluation.js";
|
|
6
|
+
import { recordValidity } from "./evidence-validity.js";
|
|
7
|
+
import { shiftTime, isPastDeadline, nextTime, timeOrder } from "./instants.js";
|
|
8
|
+
import { Unknown } from "./model.js";
|
|
9
|
+
export { reuseDecisionName };
|
|
10
|
+
export const withReuseDecisions = (ir) => {
|
|
11
|
+
const added = ir.components
|
|
12
|
+
.flatMap((c) => c.requirements.flatMap((r) => reuseDecisions(c, r)))
|
|
13
|
+
.filter((d) => !ir.decisions?.some((old) => old.name === d.name && old.of === d.of));
|
|
14
|
+
return added.length ? { ...ir, decisions: [...(ir.decisions ?? []), ...added] } : ir;
|
|
15
|
+
};
|
|
16
|
+
/** Scope values are captured at signature time, not reconstructed from mutable profile facts. */
|
|
17
|
+
export const reuseKey = (cx, r) => {
|
|
18
|
+
if (!r.reuse || !cx.inst || r.satisfiedBy.k !== "call" || r.satisfiedBy.args[0]?.k !== "ref")
|
|
19
|
+
return null;
|
|
20
|
+
const values = r.reuse.scope.map((e) => evaluateIn(cx, e));
|
|
21
|
+
if (values.some((v) => isUnknown(v) || v === null || typeof v === "object"))
|
|
22
|
+
return null;
|
|
23
|
+
return JSON.stringify([
|
|
24
|
+
"worldvm/reuse@1",
|
|
25
|
+
cx.p.account.name,
|
|
26
|
+
cx.p.library.digest,
|
|
27
|
+
cx.inst.component,
|
|
28
|
+
r.name,
|
|
29
|
+
r.satisfiedBy.args[0].name,
|
|
30
|
+
r.reuse.scope.map((e, i) => [e.k === "var" ? e.name : "", values[i]]),
|
|
31
|
+
], (key, v) => (key === "at" ? undefined : v));
|
|
32
|
+
};
|
|
33
|
+
/** Host-side indexed query only. A pinned confirmation cannot silently switch to newer proof. */
|
|
34
|
+
export const reusableProof = (cx, r, pinned) => {
|
|
35
|
+
const key = reuseKey(cx, r);
|
|
36
|
+
if (!key)
|
|
37
|
+
return new Unknown("Evidence reuse scope is Unknown");
|
|
38
|
+
const proof = r.satisfiedBy;
|
|
39
|
+
if (proof.k !== "call" || proof.args[0]?.k !== "ref")
|
|
40
|
+
return null;
|
|
41
|
+
const type = proof.args[0].name, candidates = cx.b.evidenceIn?.(key) ?? [];
|
|
42
|
+
const seen = new Set();
|
|
43
|
+
// Append order selects each source's standing signature, matching direct attestation.
|
|
44
|
+
for (const record of [...candidates].reverse()) {
|
|
45
|
+
if (record.type !== type ||
|
|
46
|
+
!record.reuseScopes?.includes(key) ||
|
|
47
|
+
timeOrder(record.at, cx.b.now) > 0 ||
|
|
48
|
+
record.occurrence === cx.occurrence ||
|
|
49
|
+
record.status === "submitted")
|
|
50
|
+
continue;
|
|
51
|
+
if (seen.has(record.occurrence))
|
|
52
|
+
continue;
|
|
53
|
+
seen.add(record.occurrence);
|
|
54
|
+
if (record.status !== "attested" || (pinned && record.id !== pinned))
|
|
55
|
+
continue;
|
|
56
|
+
if (evidenceSuperseded(cx.b, record) ||
|
|
57
|
+
!signatureValid(record) ||
|
|
58
|
+
!signedFilesAllowed(cx, type, record.values))
|
|
59
|
+
continue;
|
|
60
|
+
let until;
|
|
61
|
+
try {
|
|
62
|
+
const window = r.reuse.within;
|
|
63
|
+
until = shiftTime(record.at.length === 10 && ["minutes", "hours"].includes(window.unit)
|
|
64
|
+
? `${record.at}T00:00:00.000Z`
|
|
65
|
+
: record.at, window.n, window.unit);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return new Unknown("Evidence reuse window exceeds the supported calendar");
|
|
69
|
+
}
|
|
70
|
+
const boundary = nextTime(until);
|
|
71
|
+
if (boundary)
|
|
72
|
+
cx.temporal?.add(boundary);
|
|
73
|
+
if (isPastDeadline(cx.b.now, until))
|
|
74
|
+
continue;
|
|
75
|
+
if (proof.fn === "valid") {
|
|
76
|
+
const validity = recordValidity({ ...cx, trace: { steps: [] } }, type, record);
|
|
77
|
+
if (isUnknown(validity.value))
|
|
78
|
+
return validity.value;
|
|
79
|
+
if (validity.value !== true)
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
return { record, from: record.occurrence.slice(0, record.occurrence.lastIndexOf("/")), until };
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
};
|
|
86
|
+
export const readReuse = (cx, r) => {
|
|
87
|
+
const selected = r.reuse?.confirm
|
|
88
|
+
? selectedDecision(cx, r.name, (date) => cx.temporal?.add(date))
|
|
89
|
+
: null;
|
|
90
|
+
const accepted = selected?.definition.name === reuseDecisionName(cx.inst.component, r.name, "accepted") &&
|
|
91
|
+
selected.record.effect === "accept";
|
|
92
|
+
const candidate = reusableProof(cx, r, accepted ? selected.record.evidence : undefined);
|
|
93
|
+
if (candidate instanceof Unknown) {
|
|
94
|
+
if (cx.trace)
|
|
95
|
+
cx.trace.witness = {
|
|
96
|
+
evidence: null,
|
|
97
|
+
via: "",
|
|
98
|
+
type: r.satisfiedBy.k === "call" && r.satisfiedBy.args[0]?.k === "ref"
|
|
99
|
+
? r.satisfiedBy.args[0].name
|
|
100
|
+
: "",
|
|
101
|
+
detail: candidate.why,
|
|
102
|
+
};
|
|
103
|
+
return candidate;
|
|
104
|
+
}
|
|
105
|
+
if (!candidate ||
|
|
106
|
+
(r.reuse.confirm &&
|
|
107
|
+
(!accepted ||
|
|
108
|
+
selected.record.from !== candidate.from ||
|
|
109
|
+
selected.record.evidence !== candidate.record.id)))
|
|
110
|
+
return false;
|
|
111
|
+
if (cx.trace)
|
|
112
|
+
cx.trace.witness = {
|
|
113
|
+
evidence: candidate.record,
|
|
114
|
+
via: "reuse",
|
|
115
|
+
type: candidate.record.type,
|
|
116
|
+
detail: `Reused ${candidate.record.id} from ${candidate.from}, signed by ${candidate.record.by} on ${candidate.record.at}${accepted ? `; confirmed by ${selected.record.by} (${selected.record.id})` : ""}; within ${candidate.until}`,
|
|
117
|
+
};
|
|
118
|
+
return true;
|
|
119
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type * as IR from "../world-ir/types.generated.js";
|
|
2
|
+
import { type World } from "./memory.js";
|
|
3
|
+
import { type WorldReconciliation } from "./reconcile.js";
|
|
4
|
+
export interface ScenarioFailure {
|
|
5
|
+
readonly code: "E_SCENARIO_ASSERT" | "E_SCENARIO_RUN";
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly at: IR.Span;
|
|
8
|
+
readonly expected?: unknown;
|
|
9
|
+
readonly actual?: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface ScenarioCommandOutcome {
|
|
12
|
+
readonly accepted: boolean;
|
|
13
|
+
readonly codes: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ScenarioResult {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly passed: boolean;
|
|
18
|
+
readonly assertions: number;
|
|
19
|
+
readonly failures: readonly ScenarioFailure[];
|
|
20
|
+
readonly steps: readonly {
|
|
21
|
+
readonly date: string;
|
|
22
|
+
readonly reconciliation: WorldReconciliation;
|
|
23
|
+
readonly commands: readonly ScenarioCommandOutcome[];
|
|
24
|
+
}[];
|
|
25
|
+
readonly world: World;
|
|
26
|
+
}
|
|
27
|
+
export type ScenarioRunner = (scenario: IR.Scenario) => ScenarioResult;
|
|
28
|
+
/** A session reuses immutable linked programs, never scenario facts or evaluation state. */
|
|
29
|
+
export declare const createScenarioRunner: (ir: IR.WorldIR) => ScenarioRunner;
|
|
30
|
+
/** Runs authored finite test data through pure reconciliation. */
|
|
31
|
+
export declare const runScenario: (ir: IR.WorldIR, scenario: IR.Scenario) => ScenarioResult;
|
|
32
|
+
export declare const runScenarios: (ir: IR.WorldIR) => readonly ScenarioResult[];
|