@githolon/dsl 0.113.4 → 0.115.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/compile_package.mjs +23 -3
- package/compile_proof.d.mts +7 -0
- package/compile_proof.mjs +38 -3
- package/dart/CHANGELOG.md +60 -0
- package/dart/lib/src/application_framework_calls.dart +16 -6
- package/dart/lib/src/console_enrolment.dart +7 -0
- package/dart/lib/src/console_http_io.dart +22 -15
- package/dart/lib/src/dev_cloud.dart +62 -0
- package/dart/lib/src/generated_call.dart +14 -3
- package/dart/lib/src/nms_generated_runtime.dart +7 -0
- package/dart/lib/src/node_runner_transport.dart +77 -8
- package/dart/lib/src/nomos_trace.dart +107 -0
- package/dart/lib/src/operation_receipts.dart +74 -7
- package/dart/lib/src/reception/dart_reception.dart +174 -17
- package/dart/lib/src/rows_watch.dart +390 -0
- package/dart/lib/src/runner/node-entry.mjs +7678 -2860
- package/dart/lib/src/runtime_v2_transport.dart +3 -0
- package/dart/lib/src/sync_status_projection.dart +94 -1
- package/dart/lib/src/sync_status_reducer.dart +5 -2
- package/dart/lib/src/test_harness.dart +107 -41
- package/dart/lib/src/testing/test_peer.dart +107 -99
- package/dart/lib/src/testing/test_peer_host.dart +305 -0
- package/dart/lib/src/typed_watch_registry.dart +26 -3
- package/dart/pubspec.lock +1 -1
- package/dart/pubspec.yaml +2 -2
- package/dart/test/background_model_adoption_test.dart +1 -0
- package/dart/test/console_enrolment_test.dart +47 -0
- package/dart/test/custodian_warming_test.dart +105 -0
- package/dart/test/fixtures/offer_watch_order_peer.dart +74 -0
- package/dart/test/kernel_author_after_read_test.dart +6 -3
- package/dart/test/kernel_fence_test.dart +4 -1
- package/dart/test/model_adoption_test.dart +66 -0
- package/dart/test/nomos_trace_test.dart +91 -0
- package/dart/test/own_offer_watch_order_test.dart +90 -0
- package/dart/test/receiving_group_open_test.dart +4 -8
- package/dart/test/replica_readiness_test.dart +14 -4
- package/dart/test/rows_watch_test.dart +331 -0
- package/dart/test/runtime_projections_test.dart +41 -0
- package/dart/test/test_peer_host_selection_test.dart +49 -0
- package/dart_types/CHANGELOG.md +39 -0
- package/dart_types/lib/src/approved_model.dart +100 -6
- package/dart_types/lib/src/proto/nomos/kernel/v1/kernel.pb.dart +1063 -3
- package/dart_types/lib/src/proto/nomos/kernel/v1/kernel.pbenum.dart +89 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/application_desk.pb.dart +14 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/correspondence_desk.pb.dart +2272 -130
- package/dart_types/lib/src/proto/nomos/runtime/v2/correspondence_desk.pbenum.dart +65 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/model_adoption_desk.pb.dart +118 -2
- package/dart_types/lib/src/proto/nomos/runtime/v2/observability_desk.pb.dart +278 -9
- package/dart_types/lib/src/proto/nomos/runtime/v2/receiving_group_desk.pb.dart +7 -85
- package/dart_types/lib/src/proto/nomos/runtime/v2/records_desk.pb.dart +16 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/residency_desk.pb.dart +35 -0
- package/dart_types/lib/src/proto/nomos/runtime/v2/runtime.pb.dart +43 -2
- package/dart_types/pubspec.yaml +1 -1
- package/package.json +6 -2
- package/src/aggregate.ts +93 -0
- package/src/anonymous_value_interning.ts +205 -0
- package/src/baseline.ts +27 -0
- package/src/baseline_export.ts +432 -0
- package/src/baseline_import.ts +312 -0
- package/src/baseline_usda.ts +186 -0
- package/src/birth_key_rule.ts +472 -0
- package/src/births.ts +207 -24
- package/src/build_provenance.ts +17 -2
- package/src/business_birth.ts +50 -4
- package/src/check_package_main.ts +50 -6
- package/src/codegen_call_proto.ts +5 -18
- package/src/codegen_dart.ts +95 -3
- package/src/codegen_dart_client.ts +73 -15
- package/src/codegen_dart_facade.ts +58 -35
- package/src/codegen_dart_framework_calls.ts +32 -10
- package/src/codegen_dart_scenario.ts +7 -0
- package/src/codegen_proof.ts +5 -2
- package/src/codegen_result_proto.ts +8 -6
- package/src/codegen_result_usda.ts +4 -0
- package/src/codegen_ts.ts +135 -34
- package/src/compatibility_graph.ts +41 -4
- package/src/compatibility_usda.ts +11 -1
- package/src/compile_package_main.ts +272 -105
- package/src/composed_wire_identity.ts +24 -0
- package/src/directive.ts +6 -0
- package/src/domain_requirements.ts +75 -0
- package/src/engine_entry.ts +4 -48
- package/src/engine_javascript.ts +12 -6
- package/src/fields.ts +109 -0
- package/src/identity_usda.ts +77 -51
- package/src/index.ts +25 -1
- package/src/intent.ts +5 -0
- package/src/law_graph.ts +142 -1
- package/src/law_graph_usda.ts +25 -141
- package/src/law_layer_prims.ts +199 -0
- package/src/law_unit_selection.ts +45 -0
- package/src/law_unit_set_identity.ts +44 -0
- package/src/law_version.ts +107 -0
- package/src/package_config.ts +44 -0
- package/src/package_dependencies.ts +8 -0
- package/src/query/compile.ts +0 -0
- package/src/release_inspection.ts +24 -0
- package/src/release_publication.ts +298 -0
- package/src/value_object.ts +6 -3
- package/src/wire.ts +2 -0
- package/src/wire_paths.ts +17 -0
- package/src/workspace_routing.ts +1 -1
|
@@ -12,23 +12,82 @@ import 'dart:typed_data';
|
|
|
12
12
|
|
|
13
13
|
final RegExp _lowerHex64 = RegExp(r'^[0-9a-f]{64}$');
|
|
14
14
|
|
|
15
|
+
/// ONE APPLICATION DOMAIN'S REQUIREMENT (CAP-666), as the compiler generated it
|
|
16
|
+
/// beside the unit set: the exact law unit the client was compiled against
|
|
17
|
+
/// (`domain:<key>` in `build/<name>.units`) and the identity of the generated
|
|
18
|
+
/// consumer requirement for that domain (the domain's slice of
|
|
19
|
+
/// `<name>.compatibility.usda`, which the kernel's Compatibility Desk judges).
|
|
20
|
+
///
|
|
21
|
+
/// A workspace serving exactly [unitSha256] for [domainKey] satisfies this
|
|
22
|
+
/// release for that domain even when its unit set carries other domains the
|
|
23
|
+
/// application never touches. Identities only; the bytes stay in the generated
|
|
24
|
+
/// client. Const-constructible so generated code can bake it; the approved
|
|
25
|
+
/// model validates it.
|
|
26
|
+
final class NomosDomainRequirement {
|
|
27
|
+
const NomosDomainRequirement({
|
|
28
|
+
required this.domainKey,
|
|
29
|
+
required this.unitSha256,
|
|
30
|
+
required this.requirementSha256,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/// The application domain key this requirement is about.
|
|
34
|
+
final String domainKey;
|
|
35
|
+
|
|
36
|
+
/// The hash of the domain's law unit (`domain:<key>`), 64 lowercase hex.
|
|
37
|
+
final String unitSha256;
|
|
38
|
+
|
|
39
|
+
/// The sha256 of the domain's generated compatibility requirement, 64
|
|
40
|
+
/// lowercase hex. Observation and qualification name the contract by it.
|
|
41
|
+
final String requirementSha256;
|
|
42
|
+
|
|
43
|
+
/// The wire shape the inventory carries (identities only).
|
|
44
|
+
Map<String, String> toJson() => {
|
|
45
|
+
'unit': unitSha256,
|
|
46
|
+
'requirement': requirementSha256,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
@override
|
|
50
|
+
bool operator ==(Object other) =>
|
|
51
|
+
other is NomosDomainRequirement &&
|
|
52
|
+
other.domainKey == domainKey &&
|
|
53
|
+
other.unitSha256 == unitSha256 &&
|
|
54
|
+
other.requirementSha256 == requirementSha256;
|
|
55
|
+
|
|
56
|
+
@override
|
|
57
|
+
int get hashCode => Object.hash(domainKey, unitSha256, requirementSha256);
|
|
58
|
+
|
|
59
|
+
@override
|
|
60
|
+
String toString() =>
|
|
61
|
+
'NomosDomainRequirement($domainKey: unit $unitSha256, requirement $requirementSha256)';
|
|
62
|
+
}
|
|
63
|
+
|
|
15
64
|
/// The law model an application release approves, supplied once at the
|
|
16
65
|
/// application's Reception. Every field is required: the office refuses to
|
|
17
|
-
/// adopt without the package identity, the domain keys
|
|
18
|
-
/// attributed reason the kernel's transition demands, or the
|
|
19
|
-
/// child must stage — none of them can be invented later.
|
|
66
|
+
/// adopt without the law (its unit set), the package identity, the domain keys
|
|
67
|
+
/// it observes, the attributed reason the kernel's transition demands, or the
|
|
68
|
+
/// package bytes a child must stage — none of them can be invented later.
|
|
20
69
|
final class NomosApprovedModel {
|
|
21
70
|
NomosApprovedModel({
|
|
71
|
+
required this.unitSet,
|
|
22
72
|
required this.lawSha256,
|
|
23
73
|
required this.reason,
|
|
24
74
|
required List<String> domainKeys,
|
|
25
75
|
required this.loadPackage,
|
|
26
|
-
|
|
76
|
+
Map<String, NomosDomainRequirement> domainRequirements = const {},
|
|
77
|
+
}) : domainKeys = List.unmodifiable(domainKeys),
|
|
78
|
+
domainRequirements = Map.unmodifiable(domainRequirements) {
|
|
79
|
+
if (!_lowerHex64.hasMatch(unitSet)) {
|
|
80
|
+
throw ArgumentError.value(
|
|
81
|
+
unitSet,
|
|
82
|
+
'unitSet',
|
|
83
|
+
'must be the unit set identity of the compiled build/<name>.units (64 lowercase hex)',
|
|
84
|
+
);
|
|
85
|
+
}
|
|
27
86
|
if (!_lowerHex64.hasMatch(lawSha256)) {
|
|
28
87
|
throw ArgumentError.value(
|
|
29
88
|
lawSha256,
|
|
30
89
|
'lawSha256',
|
|
31
|
-
'must be the
|
|
90
|
+
'must be the identity of the compiled package closure (64 lowercase hex)',
|
|
32
91
|
);
|
|
33
92
|
}
|
|
34
93
|
if (reason.trim().isEmpty) {
|
|
@@ -46,9 +105,36 @@ final class NomosApprovedModel {
|
|
|
46
105
|
'must name the application domain keys the office observes on each workspace',
|
|
47
106
|
);
|
|
48
107
|
}
|
|
108
|
+
for (final entry in this.domainRequirements.entries) {
|
|
109
|
+
final requirement = entry.value;
|
|
110
|
+
if (entry.key.trim().isEmpty || requirement.domainKey != entry.key) {
|
|
111
|
+
throw ArgumentError.value(
|
|
112
|
+
domainRequirements,
|
|
113
|
+
'domainRequirements',
|
|
114
|
+
'must be keyed by the domain key each requirement names',
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
if (!_lowerHex64.hasMatch(requirement.unitSha256) ||
|
|
118
|
+
!_lowerHex64.hasMatch(requirement.requirementSha256)) {
|
|
119
|
+
throw ArgumentError.value(
|
|
120
|
+
requirement,
|
|
121
|
+
'domainRequirements',
|
|
122
|
+
"'${entry.key}' must carry the generated domain unit hash and requirement identity (64 lowercase hex each)",
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
49
126
|
}
|
|
50
127
|
|
|
51
|
-
///
|
|
128
|
+
/// THE LAW this release approves (CAP-773): the unit set identity of the
|
|
129
|
+
/// compiled `build/<name>.units` (the generated `frameworkCalls.lawUnitSet`).
|
|
130
|
+
/// A workspace is on it when the closure it serves is composed from exactly
|
|
131
|
+
/// these units, whatever its kernel's composer.
|
|
132
|
+
final String unitSet;
|
|
133
|
+
|
|
134
|
+
/// The compiled package closure (`.law.usdz`, the generated
|
|
135
|
+
/// `frameworkCalls.lawPackageSha256`): the bytes [loadPackage] supplies when a
|
|
136
|
+
/// package-lane workspace must stage them. Package — not what a unit-lane
|
|
137
|
+
/// workspace serves.
|
|
52
138
|
final String lawSha256;
|
|
53
139
|
|
|
54
140
|
/// The attributed approval text. The kernel's transition demands it whenever
|
|
@@ -59,6 +145,14 @@ final class NomosApprovedModel {
|
|
|
59
145
|
/// alone; keys it does not serve are ignored.
|
|
60
146
|
final List<String> domainKeys;
|
|
61
147
|
|
|
148
|
+
/// THE PER-DOMAIN REQUIREMENTS this release was generated against (CAP-666):
|
|
149
|
+
/// the generated `frameworkCalls.domainRequirements`, by domain key. A served
|
|
150
|
+
/// key whose workspace serves exactly that domain unit is current for this
|
|
151
|
+
/// release whatever else its unit set carries; the office reports them and
|
|
152
|
+
/// the client inventory records them as this build's contract. Empty on a
|
|
153
|
+
/// client generated before they existed: [unitSet] alone then decides.
|
|
154
|
+
final Map<String, NomosDomainRequirement> domainRequirements;
|
|
155
|
+
|
|
62
156
|
/// The exact compiled package bytes, read only when a workspace must stage
|
|
63
157
|
/// them (a bundled asset, a file beside the generated facade).
|
|
64
158
|
final Future<Uint8List> Function() loadPackage;
|