@githolon/dsl 0.100.4 → 0.100.6
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/dart/CHANGELOG.md +6 -0
- package/dart/lib/src/test_harness.dart +146 -59
- package/dart/pubspec.yaml +1 -1
- package/dart/test/acquire_session_credentials_test.dart +1 -1
- package/dart/test/adv_realm_interference_test.dart +1 -1
- package/dart/test/cluster_attested_test.dart +1 -1
- package/dart/test/cluster_births_test.dart +1 -1
- package/dart/test/cluster_device_keyed_acceptance_test.dart +1 -1
- package/dart/test/cluster_local_autosync_test.dart +1 -1
- package/dart/test/cluster_scale_test.dart +1 -1
- package/dart/test/dlq_session_surface_test.dart +1 -1
- package/dart/test/first_app_gauntlet_test.dart +106 -87
- package/dart/test/local_sync_inert_test.dart +10 -5
- package/dart/test/parent_signer_recovery_test.dart +1 -1
- package/dart/test/sealing_client_test.dart +1 -1
- package/dart/test/session_bound_test.dart +1 -1
- package/dart/test/test_harness_test.dart +2 -2
- package/dart/test/vo_read_typing_test.dart +1 -1
- package/dart/test/watch_after_offer_stall_test.dart +1 -1
- package/package.json +1 -1
- package/src/birth_meter_ensure.ts +162 -18
- package/src/build_package.ts +52 -7
- package/src/business_birth.ts +31 -9
- package/src/codegen_dart_client.ts +11 -7
- package/src/compile_package_main.ts +17 -8
- package/src/framework/birth_meter.ts +82 -0
- package/src/index.ts +5 -0
- package/src/shape_compat.ts +14 -3
package/src/shape_compat.ts
CHANGED
|
@@ -123,6 +123,10 @@ function aggFieldReadKind(f: Field): string {
|
|
|
123
123
|
* stable-id surface. Without stable ids (pre-#58) aggregate fields key by NAME and the
|
|
124
124
|
* kind comes from the field declaration — a graceful, rename-unaware fallback. */
|
|
125
125
|
export function domainInterface(mod: DomainModule, stableIds?: StableIds): DomainInterface {
|
|
126
|
+
const isInternal = (value: unknown): boolean =>
|
|
127
|
+
!!value &&
|
|
128
|
+
typeof value === "object" &&
|
|
129
|
+
(value as { businessBirthInternal?: unknown }).businessBirthInternal === true;
|
|
126
130
|
const enumTypes = new Map<string, string>();
|
|
127
131
|
// DETERMINISTIC KEY ORDER — directive ids, aggregate sids, and field keys are SORTED, so the
|
|
128
132
|
// emitted interface is byte-stable and the layered-USD fold (which merges + sorts) reproduces it
|
|
@@ -134,21 +138,27 @@ export function domainInterface(mod: DomainModule, stableIds?: StableIds): Domai
|
|
|
134
138
|
};
|
|
135
139
|
const directives: Record<string, DirectivePayloadShape> = {};
|
|
136
140
|
const dirEntries: Array<[string, DirectivePayloadShape]> = [];
|
|
137
|
-
for (const d of (mod.directives ?? []) as Array<{
|
|
141
|
+
for (const d of (mod.directives ?? []) as Array<{
|
|
142
|
+
id?: unknown;
|
|
143
|
+
payloadSchema?: unknown;
|
|
144
|
+
businessBirth?: { publicPayloadSchema?: unknown };
|
|
145
|
+
}>) {
|
|
138
146
|
if (!d || typeof d.id !== "string") continue;
|
|
147
|
+
if (isInternal(d)) continue;
|
|
139
148
|
const fieldEntries: Array<[string, PayloadFieldShape]> = [];
|
|
140
|
-
const schema = d.payloadSchema;
|
|
149
|
+
const schema = d.businessBirth?.publicPayloadSchema ?? d.payloadSchema;
|
|
141
150
|
if (schema && typeof schema === "object") {
|
|
142
151
|
for (const spec of introspectPayload(schema as z.ZodTypeAny, enumTypes)) {
|
|
143
152
|
fieldEntries.push([spec.name, { kind: payloadFieldKind(spec), optional: !!spec.optional }]);
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
|
-
dirEntries.push([d.id, { fields: sortedRec(fieldEntries) }]);
|
|
155
|
+
dirEntries.push([d.businessBirth === undefined ? d.id : "birth", { fields: sortedRec(fieldEntries) }]);
|
|
147
156
|
}
|
|
148
157
|
Object.assign(directives, sortedRec(dirEntries));
|
|
149
158
|
const aggregates: Record<string, AggregateReadShape> = {};
|
|
150
159
|
const aggEntries: Array<[string, AggregateReadShape]> = [];
|
|
151
160
|
for (const agg of (mod.aggregates ?? []) as Array<{ id: string; fields: Record<string, Field> }>) {
|
|
161
|
+
if (isInternal(agg)) continue;
|
|
152
162
|
const label = agg.id;
|
|
153
163
|
const sa = stableIds?.aggregates?.[label];
|
|
154
164
|
const aggSid = sa?.sid ?? label;
|
|
@@ -168,6 +178,7 @@ export function domainInterface(mod: DomainModule, stableIds?: StableIds): Domai
|
|
|
168
178
|
const foreignReadEntries: Array<[string, ForeignEdge[]]> = [];
|
|
169
179
|
for (const d of (mod.directives ?? []) as Array<{ id?: unknown; declaredForeignReads?: ForeignEdge[] }>) {
|
|
170
180
|
if (!d || typeof d.id !== "string") continue;
|
|
181
|
+
if (isInternal(d)) continue;
|
|
171
182
|
if (d.declaredForeignReads !== undefined && d.declaredForeignReads.length > 0) {
|
|
172
183
|
foreignReadEntries.push([d.id, d.declaredForeignReads.map((e) => ({ ...e }))]);
|
|
173
184
|
}
|