@githolon/dsl 0.108.6 → 0.110.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/assets/operation-contract.wasm +0 -0
- package/check_package.mjs +12 -15
- package/compile_package.mjs +17 -18
- package/compile_proof.mjs +16 -1
- package/dart/CHANGELOG.md +76 -1
- package/dart/README.md +25 -2
- package/dart/lib/src/admission_decision.dart +41 -0
- package/dart/lib/src/application_framework_calls.dart +52 -2
- package/dart/lib/src/application_model_adoption.dart +187 -0
- package/dart/lib/src/application_status.dart +73 -0
- package/dart/lib/src/console_enrolment.dart +271 -0
- package/dart/lib/src/console_http_io.dart +26 -0
- package/dart/lib/src/console_http_stub.dart +7 -0
- package/dart/lib/src/dev_cloud.dart +69 -22
- package/dart/lib/src/generated_call.dart +83 -23
- package/dart/lib/src/kernel_primitives.dart +119 -0
- package/dart/lib/src/nms_conformance_runtime.dart +1 -1
- package/dart/lib/src/nms_generated_runtime.dart +32 -10
- package/dart/lib/src/nms_test_environment.dart +1 -1
- package/dart/lib/src/node_runner_transport.dart +41 -46
- package/dart/lib/src/observed_session_directory.dart +70 -0
- package/dart/lib/src/operation_receipts.dart +112 -0
- package/dart/lib/src/peer_application_streams.dart +103 -0
- package/dart/lib/src/reception/dart_reception.dart +4280 -0
- package/dart/lib/src/reception/event_desk.dart +211 -0
- package/dart/lib/src/reception/extremum_read.dart +46 -0
- package/dart/lib/src/reception/local_copies.dart +371 -0
- package/dart/lib/src/reception/peer_office_connection.dart +11 -0
- package/dart/lib/src/reception/progress_desk.dart +267 -0
- package/dart/lib/src/reception/reception_contract.dart +11 -0
- package/dart/lib/src/reception/reception_session.dart +284 -0
- package/dart/lib/src/reception/sync_diagnostics.dart +26 -0
- package/dart/lib/src/reception/workspace_preparation_report.dart +126 -0
- package/dart/lib/src/replica_readiness.dart +123 -0
- package/dart/lib/src/runner/node-entry.mjs +23905 -15774
- package/dart/lib/src/runtime_v2_gateway.dart +56 -3
- package/dart/lib/src/runtime_v2_transport.dart +544 -3
- package/dart/lib/src/session_bound.dart +200 -311
- package/dart/lib/src/signing_identity_kernel.dart +84 -0
- package/dart/lib/src/sync_status_projection.dart +548 -0
- package/dart/lib/src/sync_status_reducer.dart +170 -0
- package/dart/lib/src/test_harness.dart +809 -1153
- package/dart/lib/src/testing/test_custody.dart +66 -0
- package/dart/lib/src/testing/test_peer.dart +328 -0
- package/dart/lib/src/typed_watch_registry.dart +169 -0
- package/dart/lib/src/workspace_open_progress.dart +27 -0
- package/dart/pubspec.lock +24 -1
- package/dart/pubspec.yaml +7 -2
- package/dart/pubspec_overrides.yaml +2 -0
- package/dart/test/admission_decision_test.dart +48 -0
- package/dart/test/background_model_adoption_test.dart +228 -0
- package/dart/test/bundle_version_pairing_test.dart +4 -4
- package/dart/test/child_authentication_repair_test.dart +359 -0
- package/dart/test/cloud_bound_local_shell_test.dart +119 -0
- package/dart/test/console_enrolment_refusal_test.dart +52 -0
- package/dart/test/console_enrolment_test.dart +227 -0
- package/dart/test/errors_test.dart +5 -5
- package/dart/test/event_plane_seam_test.dart +50 -164
- package/dart/test/extremum_read_test.dart +58 -0
- package/dart/test/fixtures/wedge/wedge-entry.mjs +3 -21
- package/dart/test/generated_query_test.dart +32 -0
- package/dart/test/harness_phase_timeout_test.dart +18 -23
- package/dart/test/kernel_author_after_read_test.dart +242 -0
- package/dart/test/kernel_fence_test.dart +137 -0
- package/dart/test/local_copies_test.dart +222 -0
- package/dart/test/model_adoption_test.dart +198 -0
- package/dart/test/node_peer_local_custody_test.dart +153 -0
- package/dart/test/offer_authentication_proof_test.dart +352 -52
- package/dart/test/operation_compatibility_test.dart +151 -0
- package/dart/test/platform_credential_effect_test.dart +386 -0
- package/dart/test/receiving_group_open_test.dart +213 -0
- package/dart/test/reception/workspace_preparation_report_test.dart +103 -0
- package/dart/test/reception_span_trace_test.dart +23 -0
- package/dart/test/replica_readiness_test.dart +156 -0
- package/dart/test/runtime_projections_test.dart +92 -0
- package/dart/test/runtime_v2_gateway_test.dart +131 -0
- package/dart/test/signing_identity_kernel_test.dart +75 -0
- package/dart/test/sync_status_preparation_report_test.dart +29 -0
- package/dart/test/sync_status_reducer_test.dart +419 -0
- package/dart/test/test_harness_test.dart +71 -95
- package/dart/test/typed_query_watch_test.dart +170 -0
- package/dart/test/typed_watch_registry_test.dart +249 -0
- package/dart_lints/README.md +18 -0
- package/dart_lints/lib/nomos_lints.dart +70 -0
- package/dart_lints/pubspec.lock +580 -0
- package/dart_lints/pubspec.yaml +12 -0
- package/dart_lints/test/reference_identity_test.dart +75 -0
- package/dart_types/CHANGELOG.md +18 -0
- package/dart_types/lib/nomos_kernel_protocol.dart +21 -1
- package/dart_types/lib/nomos_types.dart +9 -1
- package/dart_types/lib/src/admission_decision.dart +37 -0
- package/dart_types/lib/src/aggregate_meta.dart +1 -1
- package/dart_types/lib/src/approved_model.dart +65 -0
- package/dart_types/lib/src/custody.dart +10 -18
- package/dart_types/lib/src/error_info.dart +4 -4
- package/dart_types/lib/src/errors.dart +29 -29
- package/dart_types/lib/src/foreign_ref.dart +62 -33
- package/dart_types/lib/src/local_work_rejected.dart +3 -3
- package/dart_types/lib/src/nomos_ref.dart +3 -1
- package/dart_types/lib/src/principal.dart +2 -2
- package/dart_types/lib/src/proto/google/protobuf/any.pb.dart +163 -0
- package/dart_types/lib/src/proto/google/protobuf/any.pbenum.dart +11 -0
- package/dart_types/lib/src/proto/nomos/discovery/v1/workspace_placement.pb.dart +137 -0
- package/dart_types/lib/src/proto/nomos/discovery/v1/workspace_placement.pbenum.dart +11 -0
- package/dart_types/lib/src/proto/nomos/kernel/v1/kernel.pb.dart +20721 -10433
- package/dart_types/lib/src/proto/nomos/kernel/v1/kernel.pbenum.dart +555 -27
- package/dart_types/lib/src/proto/nomos/runtime/v2/application_desk.pb.dart +387 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/application_desk.pbenum.dart +46 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/application_readiness_desk.pb.dart +295 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/application_readiness_desk.pbenum.dart +139 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/authentication_desk.pb.dart +269 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/authentication_desk.pbenum.dart +103 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/compatibility_desk.pb.dart +417 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/compatibility_desk.pbenum.dart +62 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/correspondence_desk.pb.dart +9968 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/correspondence_desk.pbenum.dart +133 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/credentials_desk.pb.dart +204 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/credentials_desk.pbenum.dart +54 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/custody_desk.pb.dart +1550 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/custody_desk.pbenum.dart +11 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/framework.pb.dart +710 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/framework.pbenum.dart +11 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/identity_desk.pb.dart +845 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/identity_desk.pbenum.dart +11 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/interaction_desk.pb.dart +198 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/interaction_desk.pbenum.dart +11 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/law_desk.pb.dart +369 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/law_desk.pbenum.dart +11 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/maintenance_desk.pb.dart +609 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/maintenance_desk.pbenum.dart +65 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/model_adoption_desk.pb.dart +358 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/model_adoption_desk.pbenum.dart +100 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/observability_desk.pb.dart +2231 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/observability_desk.pbenum.dart +271 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/placement_desk.pb.dart +1286 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/placement_desk.pbenum.dart +11 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/receiving_group_desk.pb.dart +636 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/receiving_group_desk.pbenum.dart +116 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/records_desk.pb.dart +1637 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/records_desk.pbenum.dart +175 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/recovery_desk.pb.dart +1269 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/recovery_desk.pbenum.dart +129 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/residency_desk.pb.dart +2782 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/residency_desk.pbenum.dart +97 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/runtime.pb.dart +2232 -8627
- package/dart_types/lib/src/proto/nomos/runtime/v2/runtime.pbenum.dart +0 -358
- package/dart_types/lib/src/proto/nomos/runtime/v2/sealing_desk.pb.dart +1639 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/sealing_desk.pbenum.dart +46 -0
- package/dart_types/lib/src/runtime_outcome.dart +133 -0
- package/dart_types/lib/src/subscriptions.dart +116 -23
- package/dart_types/pubspec.yaml +1 -1
- package/dart_types/test/extremum_subscriptions_test.dart +40 -0
- package/dart_types/test/foreign_ref_resolution_test.dart +75 -0
- package/dart_types/test/nomos_ref_address_test.dart +25 -0
- package/dart_types/test/ordered_subscriptions_test.dart +34 -0
- package/operation_contract_check.mjs +24 -0
- package/package.json +11 -6
- package/src/aggregate.ts +70 -10
- package/src/application_topology.ts +18 -11
- package/src/attested.ts +3 -0
- package/src/attested_core.ts +46 -3
- package/src/birth_meter_ensure.ts +19 -7
- package/src/births.ts +29 -4
- package/src/build_package.ts +140 -13
- package/src/business_birth.ts +181 -4
- package/src/codegen_call_proto.ts +1274 -0
- package/src/codegen_call_usda.ts +49 -6
- package/src/codegen_dart.ts +79 -44
- package/src/codegen_dart_client.ts +458 -800
- package/src/{codegen_dart_application.ts → codegen_dart_facade.ts} +331 -582
- package/src/codegen_dart_framework_calls.ts +320 -37
- package/src/codegen_dart_indexed_variant.ts +159 -0
- package/src/codegen_dart_scenario.ts +42 -13
- package/src/codegen_proof.ts +3 -3
- package/src/codegen_provider_dart.ts +5 -0
- package/src/codegen_query_proto.ts +158 -0
- package/src/codegen_refusal.ts +189 -0
- package/src/codegen_result_proto.ts +931 -0
- package/src/codegen_result_usda.ts +4 -0
- package/src/codegen_ts.ts +464 -616
- package/src/codegen_workspace_access.ts +105 -0
- package/src/compatibility_graph.ts +759 -0
- package/src/compatibility_usda.ts +264 -0
- package/src/compile_package_main.ts +2083 -1248
- package/src/custody_placement.ts +156 -0
- package/src/custody_placement_usda.ts +91 -0
- package/src/decl_shapes.ts +21 -2
- package/src/describe_model.ts +1 -0
- package/src/directive.ts +59 -2
- package/src/drivers.ts +51 -0
- package/src/engine_entry.ts +52 -8
- package/src/evolve_preview.ts +11 -4
- package/src/exists.ts +2 -0
- package/src/fields.ts +75 -11
- package/src/flow_gate.ts +2 -1
- package/src/framework/application_home.ts +170 -18
- package/src/framework/attested_receipts.ts +8 -3
- package/src/framework/auth_provider_law.ts +169 -9
- package/src/framework/birth_certificate_law.ts +4 -0
- package/src/framework/capability.ts +34 -3
- package/src/framework/child_authentication.ts +346 -0
- package/src/framework/console_governance.ts +295 -0
- package/src/framework/delegated_roles.ts +301 -0
- package/src/framework/domain_lifecycle.ts +26 -13
- package/src/framework/founding_genesis.ts +193 -0
- package/src/framework/framework_aggregates.ts +1 -1
- package/src/framework/genesis.ts +6 -1
- package/src/framework/governance_relations.ts +19 -0
- package/src/framework/home.ts +5 -734
- package/src/framework/legacy/child_auth_provider_epoch.ts +73 -0
- package/src/framework/model_authority_repair.ts +116 -0
- package/src/framework/model_authority_seed.ts +185 -0
- package/src/framework/model_transition.ts +211 -0
- package/src/framework/owned_custody.ts +1 -1
- package/src/framework/principal_enrollment.ts +302 -0
- package/src/framework/receiving_group.ts +857 -0
- package/src/framework/receiving_group_recovery.ts +314 -0
- package/src/framework/relations.ts +4 -8
- package/src/framework/signing_identity.ts +242 -95
- package/src/framework/source_roster.ts +11 -5
- package/src/framework/workspace_access.ts +149 -0
- package/src/framework/workspace_invariant.ts +73 -52
- package/src/framework/workspaces.ts +407 -40
- package/src/framework_call_definitions.ts +32 -3
- package/src/generated_client_bundle_boundary.ts +97 -0
- package/src/generated_client_names.ts +1 -0
- package/src/identity_usda.ts +27 -0
- package/src/index.ts +183 -12
- package/src/indexed_variant.ts +83 -0
- package/src/intent.ts +173 -45
- package/src/law_check.ts +8 -5
- package/src/law_dependency_index.ts +231 -0
- package/src/law_graph.ts +508 -71
- package/src/law_graph_usda.ts +170 -24
- package/src/law_identity.ts +119 -81
- package/src/law_source_map.ts +4 -1
- package/src/law_units.ts +498 -0
- package/src/law_value_type.ts +7 -3
- package/src/member_authentication.ts +302 -0
- package/src/null_meta.ts +1 -1
- package/src/openusd_compiled_layer.ts +132 -0
- package/src/operation_contract_check.ts +31 -0
- package/src/ordered_read.ts +2 -1
- package/src/package_config.ts +33 -12
- package/src/package_dependencies.ts +1 -0
- package/src/plan_source_slice.ts +30 -1
- package/src/protobuf_field_number.ts +36 -0
- package/src/provenance_wire.ts +6 -0
- package/src/query.ts +2 -1
- package/src/read.ts +50 -0
- package/src/relation.ts +4 -1
- package/src/relation_schema.ts +15 -2
- package/src/report.ts +2 -2
- package/src/sqlite_computation_bundle.ts +78 -0
- package/src/sqlite_computed.ts +102 -0
- package/src/sqlite_counts.ts +154 -0
- package/src/sqlite_layout.ts +823 -0
- package/src/sqlite_reads.ts +275 -0
- package/src/sqlite_samples.ts +185 -0
- package/src/stable_id_identity_bridge.ts +1 -1
- package/src/stable_ids_for_module.ts +16 -4
- package/src/test_call_usda.ts +6 -6
- package/src/usda_relationship_integrity.ts +20 -3
- package/src/usda_text.ts +21 -1
- package/src/value_object.ts +81 -11
- package/src/wire.ts +22 -0
- package/src/wire_encode.ts +227 -20
- package/src/workspace_sharding.ts +15 -6
- package/src/workspace_sharing.ts +51 -49
- package/src/zod_introspection.ts +2 -0
- package/compat_package.mjs +0 -46
- package/dart/lib/src/home.dart +0 -15
- package/dart/lib/src/runner/offline-install.mjs +0 -15367
- package/dart/lib/src/source_trust.dart +0 -51
- package/dart/lib/src/webview_bridge.dart +0 -6540
- package/dart/lib/src/workspace_name.dart +0 -30
- package/dart/test/acquire_session_credentials_test.dart +0 -150
- package/dart/test/acquire_session_test.dart +0 -534
- package/dart/test/adv_realm_interference_test.dart +0 -600
- package/dart/test/cloud_bound_topology_test.dart +0 -168
- package/dart/test/cluster_births_test.dart +0 -202
- package/dart/test/cluster_device_keyed_acceptance_test.dart +0 -105
- package/dart/test/cluster_local_autosync_test.dart +0 -123
- package/dart/test/cluster_scale_test.dart +0 -122
- package/dart/test/compat_test.dart +0 -61
- package/dart/test/dlq_session_surface_test.dart +0 -222
- package/dart/test/first_app_gauntlet_test.dart +0 -386
- package/dart/test/fixtures/wedge/fake-install.mjs +0 -11
- package/dart/test/four_layer_nested_topology_test.dart +0 -290
- package/dart/test/home_parity_test.dart +0 -13
- package/dart/test/local_sync_inert_test.dart +0 -107
- package/dart/test/node_runner_transport_test.dart +0 -78
- package/dart/test/parent_signer_recovery_test.dart +0 -155
- package/dart/test/residency_refusal_test.dart +0 -49
- package/dart/test/sealing_client_test.dart +0 -181
- package/dart/test/session_bound_test.dart +0 -285
- package/dart/test/stale_bundle_test.dart +0 -80
- package/dart/test/vo_read_typing_test.dart +0 -131
- package/dart/test/watch_after_offer_stall_test.dart +0 -100
- package/dart/test/webview_bridge_test.dart +0 -1930
- package/dart/test/workspace_name_test.dart +0 -24
- package/runtime/generated-application-host.js +0 -22860
- package/src/codegen_query_usda.ts +0 -214
- package/src/compat_manifest.ts +0 -26
- package/src/compat_package_main.ts +0 -224
- package/src/shape_compat.ts +0 -352
- package/src/usd_state.ts +0 -505
|
@@ -7,23 +7,38 @@
|
|
|
7
7
|
|
|
8
8
|
import type { Directive } from "./directive.js";
|
|
9
9
|
import { APPLICATION_HOME_DOMAIN } from "./framework/application_home_domain.js";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
adoptIdentityProviderWitness,
|
|
12
|
+
seedAuthProvider,
|
|
13
|
+
setAuthProvider,
|
|
14
|
+
} from "./framework/auth_provider_law.js";
|
|
11
15
|
import { seedBirthPolicy } from "./framework/birth_meter.js";
|
|
12
16
|
import { installDomain, promoteDomain, rollbackDomain, stageDomain } from "./framework/domain_lifecycle.js";
|
|
13
17
|
import { seedGenesis } from "./framework/genesis.js";
|
|
18
|
+
import { seedFoundingPrincipal } from "./framework/founding_genesis.js";
|
|
14
19
|
import {
|
|
15
20
|
birthReceivingGroupForDomain,
|
|
16
21
|
seedBirthAttestation,
|
|
17
22
|
seedReceivingGroup,
|
|
18
23
|
seedReceivingGroupPolicy,
|
|
19
|
-
} from "./framework/
|
|
24
|
+
} from "./framework/receiving_group.js";
|
|
20
25
|
import {
|
|
21
26
|
enrollAdmissionCheckpointSigner,
|
|
22
27
|
enrollDelegation,
|
|
23
28
|
enrollFirstDevice,
|
|
24
29
|
enrollSigner,
|
|
30
|
+
revokeSigner,
|
|
25
31
|
} from "./framework/signing_identity.js";
|
|
26
|
-
import {
|
|
32
|
+
import { enrollDevice, revokeDevice } from "./framework/principal_enrollment.js";
|
|
33
|
+
import {
|
|
34
|
+
birthChild,
|
|
35
|
+
grantAdmin,
|
|
36
|
+
grantEnroller,
|
|
37
|
+
grantLawOperator,
|
|
38
|
+
revokeEnroller,
|
|
39
|
+
revokeLawOperator,
|
|
40
|
+
setCloudPolicy,
|
|
41
|
+
} from "./framework/workspaces.js";
|
|
27
42
|
|
|
28
43
|
export interface FixedFrameworkCallDefinition {
|
|
29
44
|
readonly group: "identity" | "governance" | "lifecycle" | "birth";
|
|
@@ -48,8 +63,20 @@ export const fixedFrameworkCallDefinitions: readonly FixedFrameworkCallDefinitio
|
|
|
48
63
|
{ group: "identity", kind: "enrollSigner", directive: enrollSigner, dartBirth: true, requiredApplicationHome: true },
|
|
49
64
|
{ group: "identity", kind: "enrollAdmissionCheckpointSigner", directive: enrollAdmissionCheckpointSigner, routeId: "enrollAdmissionCheckpointSigner", requiredApplicationHome: true },
|
|
50
65
|
{ group: "identity", kind: "setAuthProvider", directive: setAuthProvider, requiredApplicationHome: true },
|
|
66
|
+
{ group: "identity", kind: "adoptIdentityProviderWitness", directive: adoptIdentityProviderWitness, requiredApplicationHome: true },
|
|
51
67
|
{ group: "identity", kind: "birthReceivingGroup", directive: receivingGroupBirth, dartBirth: true, requiredApplicationHome: true },
|
|
68
|
+
// D22: first keys by an enroller, and a principal revoking its own key.
|
|
69
|
+
{ group: "identity", kind: "enrollDevice", directive: enrollDevice },
|
|
70
|
+
{ group: "identity", kind: "revokeDevice", directive: revokeDevice },
|
|
71
|
+
{ group: "identity", kind: "revokeSigner", directive: revokeSigner },
|
|
52
72
|
{ group: "governance", kind: "grantAdmin", directive: grantAdmin },
|
|
73
|
+
// D15/D22: who installs law and who enrols a scope's first keys.
|
|
74
|
+
{ group: "governance", kind: "grantLawOperator", directive: grantLawOperator },
|
|
75
|
+
{ group: "governance", kind: "revokeLawOperator", directive: revokeLawOperator },
|
|
76
|
+
{ group: "governance", kind: "grantEnroller", directive: grantEnroller },
|
|
77
|
+
{ group: "governance", kind: "revokeEnroller", directive: revokeEnroller },
|
|
78
|
+
{ group: "governance", kind: "birthChild", directive: birthChild },
|
|
79
|
+
{ group: "governance", kind: "setCloudPolicy", directive: setCloudPolicy },
|
|
53
80
|
{ group: "lifecycle", kind: "installDomain", directive: installDomain },
|
|
54
81
|
{ group: "lifecycle", kind: "stageDomain", directive: stageDomain },
|
|
55
82
|
{ group: "lifecycle", kind: "promoteDomain", directive: promoteDomain },
|
|
@@ -59,6 +86,8 @@ export const fixedFrameworkCallDefinitions: readonly FixedFrameworkCallDefinitio
|
|
|
59
86
|
{ group: "birth", kind: "enrollDelegation", directive: enrollDelegation, dartBirth: true },
|
|
60
87
|
{ group: "birth", kind: "seedBirthAttestation", directive: seedBirthAttestation, dartBirth: true },
|
|
61
88
|
{ group: "birth", kind: "seedGenesis", directive: seedGenesis, dartBirth: true },
|
|
89
|
+
// D22 token-free genesis: a root's founding step (a child's is authored by its parent's birth recipe).
|
|
90
|
+
{ group: "birth", kind: "seedFoundingPrincipal", directive: seedFoundingPrincipal },
|
|
62
91
|
{ group: "birth", kind: "seedReceivingGroupPolicy", directive: seedReceivingGroupPolicy, dartBirth: true },
|
|
63
92
|
{ group: "birth", kind: "seedReceivingGroup", directive: seedReceivingGroup, dartBirth: true },
|
|
64
93
|
];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
2
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
|
+
import type { Metafile } from "esbuild";
|
|
4
|
+
|
|
5
|
+
/** The only executable dependency generated applications may link at runtime. */
|
|
6
|
+
export const APPLICATION_CONTRACT_MODULE = "@githolon/runtime/application";
|
|
7
|
+
|
|
8
|
+
/** Protobuf does not export package.json; locate it from its resolved entry. */
|
|
9
|
+
export function protobufPackageRoot(entry: string): string {
|
|
10
|
+
let directory = dirname(realpathSync(entry));
|
|
11
|
+
while (true) {
|
|
12
|
+
const manifest = join(directory, "package.json");
|
|
13
|
+
if (existsSync(manifest) && JSON.parse(readFileSync(manifest, "utf8")).name === "@bufbuild/protobuf") return directory;
|
|
14
|
+
const parent = dirname(directory);
|
|
15
|
+
if (parent === directory) throw new Error(`Cannot locate Protobuf package owning ${entry}`);
|
|
16
|
+
directory = parent;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Check the actual bundler dependency graph, including transitive imports.
|
|
22
|
+
* A source-name blacklist cannot detect a renamed or copied runtime helper.
|
|
23
|
+
* The compiler owns the entry and operation codecs; Protobuf owns wire codecs;
|
|
24
|
+
* the platform links the shared application contract as an external module.
|
|
25
|
+
* No directory of tenant or compiler helpers is implicitly trusted.
|
|
26
|
+
*/
|
|
27
|
+
export function assertGeneratedClientBundleBoundary(
|
|
28
|
+
metafile: Metafile,
|
|
29
|
+
options: {
|
|
30
|
+
readonly workingDirectory: string;
|
|
31
|
+
readonly generatedEntry: string;
|
|
32
|
+
readonly operationCodec: string;
|
|
33
|
+
readonly protobufPackageRoot: string;
|
|
34
|
+
},
|
|
35
|
+
): void {
|
|
36
|
+
const absolute = (path: string): string =>
|
|
37
|
+
isAbsolute(path) ? path : resolve(options.workingDirectory, path);
|
|
38
|
+
const codec = realpathSync(absolute(options.operationCodec));
|
|
39
|
+
const protobufRoot = realpathSync(absolute(options.protobufPackageRoot));
|
|
40
|
+
const insideProtobuf = (path: string): boolean => {
|
|
41
|
+
const child = relative(protobufRoot, path);
|
|
42
|
+
return child !== ".." && !child.startsWith(`..${sep}`) && !isAbsolute(child);
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* An import esbuild reports as external either survives into the output — where the
|
|
46
|
+
* output check below refuses it — or was never linked at all. TypeScript elides an
|
|
47
|
+
* import whose bindings the module never uses, and esbuild reports an elided import
|
|
48
|
+
* as external because it never resolved it. Law that declares no directives uses
|
|
49
|
+
* neither wire codec, so its generated application elides both; refusing that is
|
|
50
|
+
* refusing a capability nothing links. The two codecs are already permitted as
|
|
51
|
+
* bundled inputs above, so permit their unlinked names here for the same reason.
|
|
52
|
+
*/
|
|
53
|
+
const permittedExternal = (input: string, specifier: string): boolean => {
|
|
54
|
+
if (specifier === APPLICATION_CONTRACT_MODULE) return true;
|
|
55
|
+
if (/^@bufbuild\/protobuf(?:\/.+)?$/.test(specifier)) return true;
|
|
56
|
+
if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
57
|
+
const candidate = resolve(dirname(absolute(input)), specifier.replace(/\.js$/, ".ts"));
|
|
58
|
+
if (existsSync(candidate) && realpathSync(candidate) === codec) return true;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
};
|
|
62
|
+
const violations: string[] = [];
|
|
63
|
+
let entryFound = false;
|
|
64
|
+
for (const [input, metadata] of Object.entries(metafile.inputs)) {
|
|
65
|
+
if (absolute(input) === absolute(options.generatedEntry)) {
|
|
66
|
+
entryFound = true;
|
|
67
|
+
} else {
|
|
68
|
+
// Resolve symlinks as well: putting a runtime link next to generated
|
|
69
|
+
// Protobuf must not turn it into a permitted compiler artifact.
|
|
70
|
+
const path = realpathSync(absolute(input));
|
|
71
|
+
if (path !== codec && !insideProtobuf(path)) {
|
|
72
|
+
violations.push(`bundled implementation: ${input}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
for (const imported of metadata.imports) {
|
|
76
|
+
if (imported.external && !permittedExternal(input, imported.path)) {
|
|
77
|
+
violations.push(`external capability: ${input} -> ${imported.path}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!entryFound) violations.push(`missing generated entry: ${options.generatedEntry}`);
|
|
82
|
+
// Check output imports too: plugins may introduce externals after resolving
|
|
83
|
+
// the input graph. Only the same narrow public contract may survive linking.
|
|
84
|
+
for (const output of Object.values(metafile.outputs)) {
|
|
85
|
+
for (const imported of output.imports) {
|
|
86
|
+
if (imported.external && imported.path !== APPLICATION_CONTRACT_MODULE) {
|
|
87
|
+
violations.push(`output capability: ${imported.path}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (violations.length > 0) {
|
|
92
|
+
throw new Error(
|
|
93
|
+
`Generated application crossed the shared-runtime boundary:\n${violations.join("\n")}\n` +
|
|
94
|
+
"Move lifecycle implementation to Peer Office; generated artifacts may contain only their vocabulary and wire codecs.",
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
package/src/identity_usda.ts
CHANGED
|
@@ -348,6 +348,17 @@ function emitEntity(
|
|
|
348
348
|
? []
|
|
349
349
|
: [`${inner}string[] nomos:was = ${stringList(entity.priorLabels)}`]),
|
|
350
350
|
...(entity.generation === 0 ? [] : [`${inner}int nomos:generation = ${entity.generation}`]),
|
|
351
|
+
...(entity.operationFieldWire === undefined
|
|
352
|
+
? []
|
|
353
|
+
: [
|
|
354
|
+
`${inner}string nomos:protobufCanonicalWireKey = ${quote(entity.operationFieldWire.protobuf.canonical)}`,
|
|
355
|
+
...(entity.operationFieldWire.protobuf.aliases === undefined ||
|
|
356
|
+
entity.operationFieldWire.protobuf.aliases.length === 0
|
|
357
|
+
? []
|
|
358
|
+
: [
|
|
359
|
+
`${inner}string[] nomos:protobufWireAliases = ${stringList(entity.operationFieldWire.protobuf.aliases)}`,
|
|
360
|
+
]),
|
|
361
|
+
]),
|
|
351
362
|
// STATUS IS THE POINT OF THIS LAYER — a retired entity is retained forever so its sid can
|
|
352
363
|
// never be handed to a later declaration wearing the same label. "active" is the fallback.
|
|
353
364
|
...(entity.status === "active" ? [] : [`${inner}token nomos:status = ${quote(entity.status)}`]),
|
|
@@ -367,6 +378,8 @@ const NOMOS_ENTITY_SCHEMA = [
|
|
|
367
378
|
" string[] nomos:was = []",
|
|
368
379
|
" int nomos:generation = 0",
|
|
369
380
|
' token nomos:status = "active"',
|
|
381
|
+
' string nomos:protobufCanonicalWireKey = ""',
|
|
382
|
+
" string[] nomos:protobufWireAliases = []",
|
|
370
383
|
"}",
|
|
371
384
|
].join("\n");
|
|
372
385
|
|
|
@@ -393,6 +406,8 @@ function readEntityForest(
|
|
|
393
406
|
const { kind, sid } = lawEntityKeyParts(prim.name);
|
|
394
407
|
const declaredParent = prim.attrs.parent as string | undefined;
|
|
395
408
|
const was = prim.attrs.was;
|
|
409
|
+
const protobufCanonicalWireKey = prim.attrs.protobufCanonicalWireKey as string | undefined;
|
|
410
|
+
const protobufWireAliases = prim.attrs.protobufWireAliases;
|
|
396
411
|
out[prim.name] = {
|
|
397
412
|
kind,
|
|
398
413
|
sid,
|
|
@@ -405,6 +420,18 @@ function readEntityForest(
|
|
|
405
420
|
...(Array.isArray(was) && was.length > 0 ? { priorLabels: was as string[] } : {}),
|
|
406
421
|
generation: Number(prim.attrs.generation ?? 0),
|
|
407
422
|
status: (prim.attrs.status ?? "active") as LawIdentityStatus,
|
|
423
|
+
...(protobufCanonicalWireKey === undefined || protobufCanonicalWireKey === ""
|
|
424
|
+
? {}
|
|
425
|
+
: {
|
|
426
|
+
operationFieldWire: {
|
|
427
|
+
protobuf: {
|
|
428
|
+
canonical: protobufCanonicalWireKey,
|
|
429
|
+
...(Array.isArray(protobufWireAliases) && protobufWireAliases.length > 0
|
|
430
|
+
? { aliases: protobufWireAliases as string[] }
|
|
431
|
+
: {}),
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
}),
|
|
408
435
|
};
|
|
409
436
|
readEntityForest(prim.children, prim.name, out);
|
|
410
437
|
}
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,19 @@
|
|
|
9
9
|
// ONE import for a domain file: `z` (payload schemas) rides along with the DSL, so
|
|
10
10
|
// authors never juggle a separate zod dependency (or risk a second zod instance).
|
|
11
11
|
export { z } from "zod";
|
|
12
|
+
export {
|
|
13
|
+
custodyPlacement,
|
|
14
|
+
custodyPlacementRule,
|
|
15
|
+
custodyRemote,
|
|
16
|
+
isCustodyPlacementDeclaration,
|
|
17
|
+
peerClass,
|
|
18
|
+
type CustodyPlacementDeclaration,
|
|
19
|
+
type CustodyPlacementRule,
|
|
20
|
+
type CustodyRemote,
|
|
21
|
+
type CustodyRetention,
|
|
22
|
+
type KernelResidency,
|
|
23
|
+
type PeerClass,
|
|
24
|
+
} from "./custody_placement.js";
|
|
12
25
|
export {
|
|
13
26
|
defineDomain,
|
|
14
27
|
defineFeature,
|
|
@@ -89,6 +102,7 @@ export {
|
|
|
89
102
|
// the generated Dart class, and the `nomosValueObjects` IR descriptor. A VO lowers to a
|
|
90
103
|
// single Lww-class json-object leaf (wholesale-replace merge — no per-subfield merge).
|
|
91
104
|
// `geo.*` are the RFC 7946 geometry VOs (pair `geo.point()` with `spatial(...)`).
|
|
105
|
+
export { indexedVariant, type IndexedVariant } from "./indexed_variant.js";
|
|
92
106
|
export {
|
|
93
107
|
valueObject,
|
|
94
108
|
variant,
|
|
@@ -138,6 +152,7 @@ export {
|
|
|
138
152
|
} from "./principal_evidence.js";
|
|
139
153
|
export {
|
|
140
154
|
FirstWriterWins,
|
|
155
|
+
FirstWriterCandidates,
|
|
141
156
|
Lww,
|
|
142
157
|
LwwCausal,
|
|
143
158
|
LwwBy,
|
|
@@ -170,6 +185,27 @@ export {
|
|
|
170
185
|
type FormerField,
|
|
171
186
|
type Retirement,
|
|
172
187
|
} from "./evolution.js";
|
|
188
|
+
export {
|
|
189
|
+
authenticationProvider,
|
|
190
|
+
authenticatesWith,
|
|
191
|
+
principalsOf,
|
|
192
|
+
principalScopeOf,
|
|
193
|
+
sovereignPrincipal,
|
|
194
|
+
consolePrincipals,
|
|
195
|
+
CONSOLE_PRINCIPAL_SCOPE,
|
|
196
|
+
custodianPrincipals,
|
|
197
|
+
CUSTODIAN_PRINCIPAL_SCOPE,
|
|
198
|
+
userPrincipals,
|
|
199
|
+
USER_PRINCIPAL_SCOPE,
|
|
200
|
+
RESERVED_PROVIDER_SCOPES,
|
|
201
|
+
MemberAuthenticationKind,
|
|
202
|
+
type AuthenticationProviderKind,
|
|
203
|
+
type AuthenticationProviderRef,
|
|
204
|
+
type EnrolledProviderRef,
|
|
205
|
+
type SovereignProviderRef,
|
|
206
|
+
type MemberAuthentication,
|
|
207
|
+
type AuthenticatedMember,
|
|
208
|
+
} from "./member_authentication.js";
|
|
173
209
|
export {
|
|
174
210
|
intent,
|
|
175
211
|
language,
|
|
@@ -177,6 +213,7 @@ export {
|
|
|
177
213
|
isApplicationLanguage,
|
|
178
214
|
authenticatesWithEnrolledDevice,
|
|
179
215
|
repairsChildAuthenticationFor,
|
|
216
|
+
assertRepairsChildAuthentication,
|
|
180
217
|
childAuthenticationRecoveryAggregateId,
|
|
181
218
|
applicationLanguageOf,
|
|
182
219
|
executableDirectivesForLanguage,
|
|
@@ -192,8 +229,21 @@ export {
|
|
|
192
229
|
workspaceSharing,
|
|
193
230
|
type WorkspaceSharingOptions,
|
|
194
231
|
type WorkspaceSharingPolicy,
|
|
195
|
-
|
|
232
|
+
workspaceSharingRedemptionFacts,
|
|
196
233
|
} from "./workspace_sharing.js";
|
|
234
|
+
export {
|
|
235
|
+
publishesWorkspaceAccess,
|
|
236
|
+
recordReceivedWorkspaceAccess,
|
|
237
|
+
receivedWorkspaceAccess,
|
|
238
|
+
WorkspaceAccessPublication,
|
|
239
|
+
WorkspaceAccessReceipt,
|
|
240
|
+
workspaceAccessPublication,
|
|
241
|
+
workspaceAccessReceipt,
|
|
242
|
+
receivedAccessObject,
|
|
243
|
+
RECEIVED_ACCESS_RELATION,
|
|
244
|
+
type WorkspaceAccessChange,
|
|
245
|
+
} from "./framework/workspace_access.js";
|
|
246
|
+
export { receivedWorkspaceAccessIsForOwner } from "./framework/receiving_group.js";
|
|
197
247
|
export {
|
|
198
248
|
recipient,
|
|
199
249
|
recipientMetaOf,
|
|
@@ -257,7 +307,11 @@ export { repair, repairsOf, isRepairDecl, type RepairDecl, type RepairMatcher, t
|
|
|
257
307
|
// NOT YET DEPLOYABLE (#57): the sealed wasm engine does not provide `nomos.read` yet, so
|
|
258
308
|
// `nomos-compile` REFUSES law that references read() (a named compile error, never a runtime halt).
|
|
259
309
|
// The captured-reads wave (task #58) wires the capability in and lifts the refusal.
|
|
260
|
-
export {
|
|
310
|
+
export {
|
|
311
|
+
read,
|
|
312
|
+
readFrameworkDeclaredRows,
|
|
313
|
+
readFrameworkAttestedRows,
|
|
314
|
+
} from "./read.js";
|
|
261
315
|
// RELEASE COHERENCE — standard OSGi Contract Namespace requirements derived from law shape.
|
|
262
316
|
export {
|
|
263
317
|
requiredKernelContracts,
|
|
@@ -275,8 +329,10 @@ export {
|
|
|
275
329
|
export {
|
|
276
330
|
trustSource,
|
|
277
331
|
trustParent,
|
|
332
|
+
trustAuthorizedSource,
|
|
278
333
|
PARENT_TRUST_SENTINEL,
|
|
279
334
|
foreignQuery,
|
|
335
|
+
attestedReadSubject,
|
|
280
336
|
trustPolicy,
|
|
281
337
|
fromPayload,
|
|
282
338
|
NomosSourceFrontier,
|
|
@@ -290,6 +346,7 @@ export {
|
|
|
290
346
|
type FromPayloadRef,
|
|
291
347
|
type ForeignReadEdge,
|
|
292
348
|
type ForeignQueryRef,
|
|
349
|
+
type AttestedReadSubjectRef,
|
|
293
350
|
} from "./attested.js";
|
|
294
351
|
// ATTESTATION RECEIPTS + EQUIVOCATION ACCOUNTABILITY (slice B stage 3 — §5): the source-side
|
|
295
352
|
// sealed receipt batch + the reader-side proven-dishonor fact, both ordinary law the kernel's
|
|
@@ -512,7 +569,14 @@ export {
|
|
|
512
569
|
signerObject,
|
|
513
570
|
SIGNER_RELATION,
|
|
514
571
|
ADMISSION_CHECKPOINT_PRINCIPAL,
|
|
572
|
+
admissionCheckpointSigner,
|
|
573
|
+
readAdmissionCheckpointSigners,
|
|
574
|
+
writeAdmissionCheckpointSigners,
|
|
575
|
+
type AdmissionCheckpointSigner,
|
|
515
576
|
enrollAdmissionCheckpointSigner,
|
|
577
|
+
revokeAdmissionCheckpointSigner,
|
|
578
|
+
lastAdmissionCheckpointSignerRemains,
|
|
579
|
+
enrollAdmissionCheckpointSignerDirect,
|
|
516
580
|
enrollSigner,
|
|
517
581
|
// VA-core — SignerEpoch + self-bind enroll/revoke + the strict-increment & verified-enroll gates.
|
|
518
582
|
SignerEpoch,
|
|
@@ -533,6 +597,10 @@ export {
|
|
|
533
597
|
signerDelegationRecoveryEvidence,
|
|
534
598
|
SIGNER_DELEGATION_PREFIX,
|
|
535
599
|
signerDelegationInstanceId,
|
|
600
|
+
signerDelegationCertificateId,
|
|
601
|
+
signerDelegationEvidenceIsRetained,
|
|
602
|
+
enrollDelegationRetainsEvidence,
|
|
603
|
+
enrollFirstDeviceRetainsEvidence,
|
|
536
604
|
enrollDelegation,
|
|
537
605
|
signerDelegationByUser,
|
|
538
606
|
readSignerDelegationRecoveryEvidence,
|
|
@@ -542,13 +610,36 @@ export {
|
|
|
542
610
|
type SignerEpochHandle,
|
|
543
611
|
type SignerAuthority,
|
|
544
612
|
} from "./framework/signing_identity.js";
|
|
545
|
-
//
|
|
546
|
-
//
|
|
547
|
-
|
|
613
|
+
// D22 — the kernel is the authentication: the enroller relation, the enrolled scope's first-key
|
|
614
|
+
// lane and the sovereign scope's self-certification (framework/principal_enrollment.ts).
|
|
615
|
+
export {
|
|
616
|
+
principalScopeRelations,
|
|
617
|
+
principalScopeObject,
|
|
618
|
+
PRINCIPAL_SCOPE_OBJECT_TYPE,
|
|
619
|
+
enrollDevice,
|
|
620
|
+
revokeDevice,
|
|
621
|
+
sovereignSelfCertification,
|
|
622
|
+
} from "./framework/principal_enrollment.js";
|
|
623
|
+
export { PRINCIPAL_SCOPE_ENROLLER_RELATION, WORKSPACE_OPERATOR_RELATION } from "./framework/governance_relations.js";
|
|
624
|
+
// D22 — roles a parent delegates into the children its principals found, and the tenant-declared
|
|
625
|
+
// post-birth lane an enroller uses to carry later changes into existing children.
|
|
626
|
+
export {
|
|
627
|
+
delegatedRoles,
|
|
628
|
+
grantDelegatedRole,
|
|
629
|
+
revokeDelegatedRole,
|
|
630
|
+
ADOPT_DELEGATED_ROLES_DIRECTIVE,
|
|
631
|
+
SEED_DELEGATED_ROLES_DIRECTIVE,
|
|
632
|
+
type DelegatedRolesLaw,
|
|
633
|
+
} from "./framework/delegated_roles.js";
|
|
634
|
+
export { workspaceOperatorRelations } from "./framework/workspaces.js";
|
|
635
|
+
// THE WORKSPACE VERIFIER is framework-owned law-state. Birth copies the current verifier once;
|
|
636
|
+
// later epochs arrive through ordinary authority-gated adoption offers.
|
|
548
637
|
export {
|
|
549
638
|
AUTH_PROVIDER_ID,
|
|
550
639
|
AUTH_PROVIDER_KEY_ID_PREFIX,
|
|
551
640
|
AUTH_PROVIDER_CERTIFICATE_ID_PREFIX,
|
|
641
|
+
AUTH_PROVIDER_AUTHORITY,
|
|
642
|
+
AUTH_PROVIDER_EPOCH_CONSUMER,
|
|
552
643
|
AuthProvider,
|
|
553
644
|
AuthProviderKey,
|
|
554
645
|
AuthProviderCertificate,
|
|
@@ -564,11 +655,89 @@ export {
|
|
|
564
655
|
seedAuthProvider,
|
|
565
656
|
authProviderSeedBeforeWarrant,
|
|
566
657
|
setAuthProvider,
|
|
658
|
+
adoptIdentityProviderWitness,
|
|
659
|
+
identityProviderSourceTrust,
|
|
660
|
+
authProviderSourceRelations,
|
|
661
|
+
authProviderEpochConsumerRelations,
|
|
567
662
|
authProvider,
|
|
568
663
|
authProviderKeys,
|
|
569
664
|
authProviderCertificates,
|
|
570
665
|
} from "./framework/auth_provider_law.js";
|
|
571
|
-
//
|
|
666
|
+
// CHILD AUTHENTICATION — the framework's verifier-epoch serve/accept pair and the workspace-parameterised
|
|
667
|
+
// child repair, auto-composed into every business-birth domain (`framework/child_authentication.ts`). The
|
|
668
|
+
// ids and evidence shapes are exported for tests, tooling and the Peer Office desk; nothing here is a
|
|
669
|
+
// tenant-authored verb.
|
|
670
|
+
export {
|
|
671
|
+
ACCEPT_PARENT_AUTH_PROVIDER_EPOCH_ID,
|
|
672
|
+
ACCEPT_CHILD_AUTHENTICATION_RECOVERY_ID,
|
|
673
|
+
ACCEPT_CHILD_AUTHENTICATION_RECOVERY_EFFECT_ID,
|
|
674
|
+
SERVE_AUTH_PROVIDER_EPOCH_ID,
|
|
675
|
+
PULL_PARENT_AUTH_PROVIDER_EPOCH_ID,
|
|
676
|
+
REPAIR_CHILD_AUTHENTICATION_ID,
|
|
677
|
+
childAuthenticationRecoveryEvidence,
|
|
678
|
+
childAuthenticationRepairInput,
|
|
679
|
+
acceptParentAuthProviderEpoch,
|
|
680
|
+
acceptChildAuthenticationRecovery,
|
|
681
|
+
serveAuthProviderEpoch,
|
|
682
|
+
pullParentAuthProviderEpoch,
|
|
683
|
+
repairChildAuthentication,
|
|
684
|
+
repairChildAuthenticationBindsPrincipal,
|
|
685
|
+
type ChildAuthenticationRecoveryEvidence,
|
|
686
|
+
type ChildAuthenticationRepairInput,
|
|
687
|
+
} from "./framework/child_authentication.js";
|
|
688
|
+
// THE PARENT-DIRECTED MODEL TRANSITION (`architecture/parent_directed_model_transition.md`) — a tenant
|
|
689
|
+
// platform holds full model authority over its subtree, so its direction and the child's attested-parent
|
|
690
|
+
// acceptor are framework law. The ids and shapes are exported for the SAME reason as child authentication:
|
|
691
|
+
// the operator CLI addresses the direction by its real id and classifies a child by looking the acceptor
|
|
692
|
+
// up in that child's own framework route surface. One fact, one representation — nothing here is a
|
|
693
|
+
// tenant-authored verb, and a copied string literal in the CLI would be the drift this prevents.
|
|
694
|
+
export {
|
|
695
|
+
ACCEPT_PARENT_MODEL_TRANSITION_ID,
|
|
696
|
+
DIRECT_CHILD_MODEL_TRANSITION_ID,
|
|
697
|
+
RECORD_PARENT_MODEL_TRANSITION_ID,
|
|
698
|
+
SEAT_PARENT_MODEL_AUTHORITY_ID,
|
|
699
|
+
PARENT_MODEL_TRANSITION_AGGREGATE,
|
|
700
|
+
ParentModelTransition,
|
|
701
|
+
acceptParentModelTransition,
|
|
702
|
+
directChildModelTransition,
|
|
703
|
+
directChildModelTransitionInput,
|
|
704
|
+
modelTransitionDirection,
|
|
705
|
+
parentModelTransitionAggregateId,
|
|
706
|
+
parentModelTransitionEvidence,
|
|
707
|
+
type DirectChildModelTransitionInput,
|
|
708
|
+
type ModelTransitionDirection,
|
|
709
|
+
type ParentModelTransitionEvidence,
|
|
710
|
+
} from "./framework/model_transition.js";
|
|
711
|
+
// THE MODEL-AUTHORITY SELF-SEAT (same design, §9) — this workspace's own model-lifecycle holder names
|
|
712
|
+
// who else may install law here. The ids and the record's constant identity are exported for the same
|
|
713
|
+
// reason as child authentication's: the Dart codegen binds the directive by its real id and the
|
|
714
|
+
// Reception reads the seat record by the constant id below. One fact, one representation; a string
|
|
715
|
+
// literal downstream would be the drift this prevents.
|
|
716
|
+
export {
|
|
717
|
+
SEAT_MODEL_AUTHORITY_ID,
|
|
718
|
+
SEAT_DECLARED_MODEL_AUTHORITY_ID,
|
|
719
|
+
RECORD_MODEL_AUTHORITY_SEAT_ID,
|
|
720
|
+
PARENT_MODEL_AUTHORITY_SEAT_AGGREGATE,
|
|
721
|
+
PARENT_MODEL_AUTHORITY_SEAT_ID,
|
|
722
|
+
ParentModelAuthoritySeat,
|
|
723
|
+
seatModelAuthority,
|
|
724
|
+
} from "./framework/model_authority_repair.js";
|
|
725
|
+
// THE RECEIVING GROUP'S DEVICE-RECOVERY DOOR. Exported for the same reason as the seat ids above:
|
|
726
|
+
// the operator CLI resolves this directive in a workspace's own installed law by its REAL id, and a
|
|
727
|
+
// string literal in a second package is exactly the drift one representation prevents.
|
|
728
|
+
export { RECOVER_RECEIVING_GROUP_DEVICE_ID } from "./framework/receiving_group_recovery.js";
|
|
729
|
+
export {
|
|
730
|
+
SEAT_INHERITED_MODEL_AUTHORITY_ID,
|
|
731
|
+
inheritedModelAuthorityEvidence,
|
|
732
|
+
seatInheritedModelAuthority,
|
|
733
|
+
type InheritedModelAuthorityEvidence,
|
|
734
|
+
type InheritedModelAuthorityHolder,
|
|
735
|
+
} from "./framework/model_authority_seed.js";
|
|
736
|
+
/** The compiler-owned domain every framework birth installs into every born workspace — the one
|
|
737
|
+
* domain that carries the direction, the acceptor and the genesis seat. */
|
|
738
|
+
export { APPLICATION_HOME_DOMAIN } from "./framework/application_home_domain.js";
|
|
739
|
+
// THE RECEIVING-GROUP HOLON — the framework-private shared signer roster + access manifest
|
|
740
|
+
// (`framework/receiving_group.ts`; `birthHome` is the deprecated alias of `birthReceivingGroup`).
|
|
572
741
|
export {
|
|
573
742
|
SharedWithMe,
|
|
574
743
|
recordShare,
|
|
@@ -595,6 +764,7 @@ export {
|
|
|
595
764
|
receivingGroupRevocationFollowsPolicy,
|
|
596
765
|
receivingGroupNameOf,
|
|
597
766
|
birthReceivingGroup,
|
|
767
|
+
birthHome,
|
|
598
768
|
// THE PEER-SOVEREIGN ROOT-OF-TRUST (the BirthAttestation cert chain).
|
|
599
769
|
BirthAttestation,
|
|
600
770
|
BirthAttestationLink,
|
|
@@ -603,7 +773,7 @@ export {
|
|
|
603
773
|
seedBirthAttestation,
|
|
604
774
|
birthAttestation,
|
|
605
775
|
parentAttestedBirth,
|
|
606
|
-
} from "./framework/
|
|
776
|
+
} from "./framework/receiving_group.js";
|
|
607
777
|
// METERED BIRTH (slice A — architecture/metered_birth_and_attested_reads.md): the structural birth
|
|
608
778
|
// record + the parent-local birth quota + the allowance governance surface. The record/quota STRUCTURE
|
|
609
779
|
// is auto-ensured on every `.births()` law (zero tenant code); these exports are the GOVERNANCE half a
|
|
@@ -693,6 +863,7 @@ export {
|
|
|
693
863
|
capabilityPascal,
|
|
694
864
|
CAPABILITY_NAME_RE,
|
|
695
865
|
type CapabilityDecl,
|
|
866
|
+
type CapabilityExecutionPolicy,
|
|
696
867
|
} from "./framework/capability.js";
|
|
697
868
|
export {
|
|
698
869
|
DOMAIN_INSTALLATION_PHASES,
|
|
@@ -731,6 +902,8 @@ export {
|
|
|
731
902
|
} from "./framework/repair.js";
|
|
732
903
|
export {
|
|
733
904
|
workspaceInvariant,
|
|
905
|
+
accept,
|
|
906
|
+
reject,
|
|
734
907
|
readRef,
|
|
735
908
|
readSet,
|
|
736
909
|
idItem,
|
|
@@ -853,16 +1026,14 @@ export {
|
|
|
853
1026
|
// authoring tools, but never pull generator implementations into the runtime namespace evaluated by
|
|
854
1027
|
// every kernel sandbox.
|
|
855
1028
|
export type { DomainModule } from "./codegen_dart.js";
|
|
856
|
-
//
|
|
857
|
-
// by
|
|
1029
|
+
// Compiler-side compatibility graph extraction. The generated USDA requirement is judged
|
|
1030
|
+
// authoritatively by the kernel Compatibility Desk; JavaScript does not mirror that judge.
|
|
858
1031
|
export {
|
|
859
1032
|
domainInterface,
|
|
860
|
-
compatible,
|
|
861
1033
|
type DomainInterface,
|
|
862
|
-
type CompatVerdict,
|
|
863
1034
|
type DirectivePayloadShape,
|
|
864
1035
|
type AggregateReadShape,
|
|
865
|
-
} from "./
|
|
1036
|
+
} from "./compatibility_graph.js";
|
|
866
1037
|
// The OPTIONAL Graphviz `.dot` ER-diagram emitter (off-by-default presentation projection,
|
|
867
1038
|
// turned on by the `--emit-dot` compiler flag). Pure `DomainModule -> string`, deterministic;
|
|
868
1039
|
// NOT part of the domain identity. Barrel-safe (no node:* imports), so the engine bundle can
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { EnumType } from "./enum_type.js";
|
|
2
|
+
import type { ValueObject } from "./value_object.js";
|
|
3
|
+
|
|
4
|
+
/** An explicit relationship between a runtime discriminator and a nominal value sum.
|
|
5
|
+
* This declaration has no I/O or lifecycle. It supplies the same compatibility
|
|
6
|
+
* predicate to authored law and the generated client binding constructors.
|
|
7
|
+
*/
|
|
8
|
+
export interface IndexedVariant {
|
|
9
|
+
readonly __isIndexedVariant: true;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly discriminator: EnumType<readonly [string, ...string[]]>;
|
|
12
|
+
readonly value: ValueObject<{ type: string }>;
|
|
13
|
+
readonly cases: Readonly<Record<string, string>>;
|
|
14
|
+
accepts(kind: string, value: unknown): boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function indexedVariant<
|
|
18
|
+
const E extends readonly [string, ...string[]],
|
|
19
|
+
V extends { type: string },
|
|
20
|
+
>(
|
|
21
|
+
name: string,
|
|
22
|
+
spec: {
|
|
23
|
+
discriminator: EnumType<E>;
|
|
24
|
+
value: ValueObject<V>;
|
|
25
|
+
cases: { readonly [K in E[number]]: V["type"] };
|
|
26
|
+
},
|
|
27
|
+
): IndexedVariant {
|
|
28
|
+
if (!/^[A-Z][A-Za-z0-9]*$/u.test(name)) {
|
|
29
|
+
throw new Error(`indexedVariant: '${name}' must be an UpperCamelCase identifier`);
|
|
30
|
+
}
|
|
31
|
+
const arms = spec.value.descriptor.union;
|
|
32
|
+
if (arms === undefined) throw new Error(`indexedVariant '${name}' requires a variant value`);
|
|
33
|
+
const cases: Record<string, string> = {};
|
|
34
|
+
for (const kind of spec.discriminator.values) {
|
|
35
|
+
if (!/^[a-z][A-Za-z0-9]*$/u.test(kind) ||
|
|
36
|
+
["binding", "editable", "edit", "rejection", "unsupported", "shapeMismatch", "definitionChanged", "invalidInput"].includes(kind)) {
|
|
37
|
+
throw new Error(`indexedVariant '${name}': '${kind}' must be a non-reserved lowerCamelCase identifier`);
|
|
38
|
+
}
|
|
39
|
+
const arm = (spec.cases as Record<string, string>)[kind];
|
|
40
|
+
if (arm === undefined || !Object.hasOwn(arms, arm)) {
|
|
41
|
+
throw new Error(`indexedVariant '${name}': '${kind}' must explicitly name an arm of ${spec.value.name}`);
|
|
42
|
+
}
|
|
43
|
+
cases[kind] = arm;
|
|
44
|
+
}
|
|
45
|
+
for (const kind of Object.keys(spec.cases)) {
|
|
46
|
+
if (!Object.hasOwn(cases, kind)) {
|
|
47
|
+
throw new Error(`indexedVariant '${name}': unknown discriminator '${kind}'`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
Object.freeze(cases);
|
|
51
|
+
return Object.freeze({
|
|
52
|
+
__isIndexedVariant: true as const,
|
|
53
|
+
name,
|
|
54
|
+
discriminator: spec.discriminator,
|
|
55
|
+
value: spec.value,
|
|
56
|
+
cases,
|
|
57
|
+
accepts(kind: string, value: unknown): boolean {
|
|
58
|
+
const arm = cases[kind];
|
|
59
|
+
if (!Object.hasOwn(cases, kind)) return false;
|
|
60
|
+
if (value === null) return true;
|
|
61
|
+
return typeof value === "object" && value !== null &&
|
|
62
|
+
(value as { type?: unknown }).type === arm && spec.value.zod.safeParse(value).success;
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Discover across original modules, before spread-merge can hide a conflicting declaration. */
|
|
68
|
+
export function indexedVariantsOf(modules: readonly Record<string, unknown>[]): IndexedVariant[] {
|
|
69
|
+
const byName = new Map<string, IndexedVariant>();
|
|
70
|
+
for (const module of modules) {
|
|
71
|
+
for (const value of Object.values(module)) {
|
|
72
|
+
if (value === null || typeof value !== "object" ||
|
|
73
|
+
(value as { __isIndexedVariant?: unknown }).__isIndexedVariant !== true) continue;
|
|
74
|
+
const declaration = value as IndexedVariant;
|
|
75
|
+
const prior = byName.get(declaration.name);
|
|
76
|
+
if (prior !== undefined && prior !== declaration) {
|
|
77
|
+
throw new Error(`indexedVariant '${declaration.name}' has multiple declarations`);
|
|
78
|
+
}
|
|
79
|
+
byName.set(declaration.name, declaration);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return [...byName.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
83
|
+
}
|