@neocompose/cli 0.89.7 → 0.89.8

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.
@@ -26889,11 +26889,10 @@ function remapRuntimeReferences(value, overlay, seen, preservedReferences) {
26889
26889
  const next = {};
26890
26890
  seen.set(value, next);
26891
26891
  for (const [key, entry] of Object.entries(value)) {
26892
- next[key] = remapRuntimeReferences(
26893
- entry,
26894
- overlay,
26895
- seen,
26896
- preservedReferences
26892
+ setOwnField(
26893
+ next,
26894
+ key,
26895
+ remapRuntimeReferences(entry, overlay, seen, preservedReferences)
26897
26896
  );
26898
26897
  }
26899
26898
  return next;
@@ -28689,7 +28688,7 @@ function applyOverlayAssignment(target, targetTypeInfo, value, scope, ctx, desti
28689
28688
  if (entryId !== null) {
28690
28689
  const collection = Array.isArray(receiver) ? receiver : objectArg(receiver, "Assignment target");
28691
28690
  const entryKey = typeof key === "number" ? key : String(key);
28692
- Reflect.set(collection, String(entryKey), entryId);
28691
+ setOwnField(collection, String(entryKey), entryId);
28693
28692
  recordWrittenEntry(collection, entryKey, true, ctx);
28694
28693
  if (!indexRuntimeCollectionChange(
28695
28694
  collection,
@@ -28785,7 +28784,7 @@ function applyOverlayAssignment(target, targetTypeInfo, value, scope, ctx, desti
28785
28784
  );
28786
28785
  noteDetachedRow(object[stringKey], referenceValueId, ctx);
28787
28786
  }
28788
- object[stringKey] = referenceValueId;
28787
+ setOwnField(object, stringKey, referenceValueId);
28789
28788
  if (!field) recordWrittenEntry(object, stringKey, true, ctx);
28790
28789
  if (field || !indexRuntimeCollectionEntryWrite(
28791
28790
  object,
@@ -28801,7 +28800,7 @@ function applyOverlayAssignment(target, targetTypeInfo, value, scope, ctx, desti
28801
28800
  return;
28802
28801
  if (field && (targetTypeInfo.type === 7 /* Class */ || targetTypeInfo.type === 22 /* Interface */))
28803
28802
  noteDetachedRow(object[stringKey], value, ctx);
28804
- object[stringKey] = value;
28803
+ setOwnField(object, stringKey, value);
28805
28804
  if (!field) recordWrittenEntry(object, stringKey, false, ctx);
28806
28805
  const scalarField = (previous == null || typeof previous === "number" || typeof previous === "boolean" || typeof previous === "string") && (value == null || typeof value === "number" || typeof value === "boolean" || typeof value === "string");
28807
28806
  if (field && !scalarField || !indexRuntimeCollectionEntryWrite(object, previous, value, stringKey, ctx))
@@ -28883,7 +28882,7 @@ function copiedCollectionContents(source, entryTypeInfo, slotId, ctx) {
28883
28882
  }
28884
28883
  }
28885
28884
  if (Array.isArray(copy)) copy.push(entry);
28886
- else copy[String(key)] = entry;
28885
+ else setOwnField(copy, String(key), entry);
28887
28886
  return 0 /* Continue */;
28888
28887
  });
28889
28888
  const cache = unorderedListProjectionCache(ctx);
@@ -28952,107 +28951,6 @@ function keepAssignedCollectionValues(value, targetTypeInfo, row, ctx) {
28952
28951
  return 0 /* Continue */;
28953
28952
  });
28954
28953
  }
28955
- function pendingConstructorRootsForRow(valueId, ctx) {
28956
- const roots = /* @__PURE__ */ new Set();
28957
- const open = ctx.__executionState?.openConstructions;
28958
- if (open === void 0 || open.size === 0) return roots;
28959
- const visited = /* @__PURE__ */ new Set();
28960
- const pending = [valueId];
28961
- const parentEntries = /* @__PURE__ */ new Map();
28962
- const placingMembers = /* @__PURE__ */ new Map();
28963
- while (pending.length > 0) {
28964
- const id = pending.pop();
28965
- if (id === void 0 || visited.has(id)) continue;
28966
- visited.add(id);
28967
- const row = evalValueById(
28968
- ctx,
28969
- id,
28970
- ctx.__runtimeSessionValues,
28971
- ctx.__valueOverlay
28972
- );
28973
- if (row === null) continue;
28974
- if (typeof row.value === "object" && row.value !== null && open.has(row.value))
28975
- roots.add(id);
28976
- for (const owner of currentOwnedValueAttachments(
28977
- id,
28978
- ctx,
28979
- parentEntries,
28980
- placingMembers
28981
- )) {
28982
- if (!owner.identity.startsWith("value:")) continue;
28983
- const parent = evalValueById(
28984
- ctx,
28985
- owner.label,
28986
- ctx.__runtimeSessionValues,
28987
- ctx.__valueOverlay
28988
- );
28989
- if (parent === null) continue;
28990
- if (parent.classId === void 0 || parent.classId === null) {
28991
- const raw = placingMember(
28992
- parent,
28993
- ctx,
28994
- void 0,
28995
- 0,
28996
- placingMembers,
28997
- parentEntries
28998
- );
28999
- if (raw === null) continue;
29000
- const member = raw.kind === 21 /* Generic */ ? substituteMember(raw, rowGenericEnv(parent, ctx), ctx.vm.members) : resolveMember(raw, ctx.vm.members);
29001
- if (isMemberWithEntries(member)) {
29002
- const rawEntry = evalMemberById(ctx.vm, member.entryMemberId);
29003
- if (rawEntry === null) continue;
29004
- const entry = rawEntry.kind === 21 /* Generic */ ? substituteMember(
29005
- rawEntry,
29006
- rowGenericEnv(parent, ctx),
29007
- ctx.vm.members
29008
- ) : resolveMember(rawEntry, ctx.vm.members);
29009
- if (entry.kind === 21 /* Generic */ || isMemberLookupBase(entry))
29010
- continue;
29011
- }
29012
- }
29013
- pending.push(owner.label);
29014
- }
29015
- for (const link of evaluatorParentLinks(evaluatorIndexes(ctx), id)) {
29016
- const parent = evalValueById(
29017
- ctx,
29018
- link.parentId,
29019
- ctx.__runtimeSessionValues,
29020
- ctx.__valueOverlay
29021
- );
29022
- if (parent === null || !Array.isArray(parent.value)) continue;
29023
- const member = placingMember(
29024
- parent,
29025
- ctx,
29026
- void 0,
29027
- 0,
29028
- placingMembers,
29029
- parentEntries
29030
- );
29031
- if (member === null || !isMemberTupleBase(member)) continue;
29032
- const positions = ownershipParentEntryKeys(
29033
- parent.value,
29034
- id,
29035
- parentEntries
29036
- );
29037
- for (const position of positions ?? []) {
29038
- if (typeof position !== "number") continue;
29039
- const entryId = member.elementMemberIds[position];
29040
- const rawEntry = entryId === void 0 ? null : evalMemberById(ctx.vm, entryId);
29041
- if (rawEntry === null) continue;
29042
- const entry = rawEntry.kind === 21 /* Generic */ ? substituteMember(
29043
- rawEntry,
29044
- rowGenericEnv(parent, ctx),
29045
- ctx.vm.members
29046
- ) : resolveMember(rawEntry, ctx.vm.members);
29047
- if (entry.kind === 21 /* Generic */ || isMemberLookupBase(entry))
29048
- continue;
29049
- pending.push(parent.id);
29050
- break;
29051
- }
29052
- }
29053
- }
29054
- return roots;
29055
- }
29056
28954
  function preflightAssignedCollection(collection, member, row, ctx) {
29057
28955
  if (member === null) return;
29058
28956
  const env = rowGenericEnv(row, ctx);
@@ -29065,8 +28963,6 @@ function preflightAssignedCollection(collection, member, row, ctx) {
29065
28963
  const attached = /* @__PURE__ */ new Set();
29066
28964
  const preflight = {
29067
28965
  parentEntries: /* @__PURE__ */ new Map(),
29068
- constructorRootIds: pendingConstructorRootsForRow(row.id, ctx),
29069
- constructorArgumentTransfers: /* @__PURE__ */ new Map(),
29070
28966
  dependencies: /* @__PURE__ */ new Map()
29071
28967
  };
29072
28968
  forEachRawCollectionEntry(collection, ctx, ({ raw, key, valueId }) => {
@@ -29089,8 +28985,6 @@ function preflightAssignedCollection(collection, member, row, ctx) {
29089
28985
  );
29090
28986
  return 0 /* Continue */;
29091
28987
  });
29092
- for (const [id, destination] of preflight.constructorArgumentTransfers)
29093
- ctx.__executionState?.ownedValueAttachments.set(id, destination);
29094
28988
  for (const [id, destination] of preflight.dependencies)
29095
28989
  recordConstructorGroupDependency(id, destination, ctx);
29096
28990
  }
@@ -30945,7 +30839,11 @@ function applyLocalCollectionMutation(targetValue, mutation, args, ctx, unique =
30945
30839
  }
30946
30840
  return null;
30947
30841
  }
30948
- objectArg(targetValue, "Dictionary Add target")[String(args[0])] = args[1];
30842
+ setOwnField(
30843
+ objectArg(targetValue, "Dictionary Add target"),
30844
+ String(args[0]),
30845
+ args[1]
30846
+ );
30949
30847
  return null;
30950
30848
  case "Remove" /* Remove */:
30951
30849
  if (Array.isArray(targetValue)) {
@@ -37432,6 +37330,7 @@ function publishConstructedRows(args) {
37432
37330
  if (beforeRetain !== null) {
37433
37331
  for (const rowId of beforeRetain) {
37434
37332
  if (retained.has(rowId)) continue;
37333
+ if (constructorGroupForRow(rowId, ctx) !== null) continue;
37435
37334
  deleteRuntimeSessionValue(ctx, rowId);
37436
37335
  }
37437
37336
  }
@@ -37517,16 +37416,55 @@ function assertImplicitConstructionAllowed(schemaClass2) {
37517
37416
  `Class '${schemaClass2.name}' declares a required constructor, so it cannot be constructed without one.`
37518
37417
  );
37519
37418
  }
37419
+ function constructionReplayContext(descriptor, ctx) {
37420
+ if (ctx.storedConstructionReplay !== true) return ctx;
37421
+ const target = ctx.__storedInitializerReplay;
37422
+ let rowId;
37423
+ let candidate;
37424
+ if (target !== void 0) {
37425
+ const row = storedReplayRowById(target.rowId, ctx);
37426
+ if (row !== null && classIdForValueRow(row, ctx) === descriptor.schemaClass.id) {
37427
+ rowId = target.rowId;
37428
+ candidate = { reattached: false };
37429
+ target.candidates.push(candidate);
37430
+ }
37431
+ } else if (ctx.__executionState?.constructionStack.length === 0 && ctx.__storedConstructionReplaySlot?.classId === descriptor.schemaClass.id) {
37432
+ rowId = ctx.__storedConstructionReplayRowId;
37433
+ }
37434
+ return {
37435
+ ...ctx,
37436
+ __storedInitializerReplay: void 0,
37437
+ __storedReplayCandidate: candidate,
37438
+ __storedConstructionReplayRowId: rowId,
37439
+ __storedConstructionReplayRootId: void 0,
37440
+ __storedConstructionReplaySlot: rowId === void 0 ? ctx.__storedConstructionReplaySlot : {
37441
+ classId: descriptor.schemaClass.id,
37442
+ classArguments: descriptor.classArguments ?? {}
37443
+ }
37444
+ };
37445
+ }
37446
+ function rollbackStoredConstructionReplay(ctx, checkpoint) {
37447
+ if (checkpoint === void 0) return;
37448
+ for (const row of createdSessionValuesSince(ctx, checkpoint))
37449
+ deleteRuntimeSessionValue(ctx, row.id);
37450
+ if (ctx.__storedReplayCandidate !== void 0)
37451
+ ctx.__storedReplayCandidate.reattached = false;
37452
+ }
37520
37453
  function constructClassValue(info, scope, ctx) {
37521
37454
  const descriptor = validateClassConstructorDescriptor(
37522
37455
  info,
37523
37456
  ctx,
37524
37457
  ctx.constructionBaselineReplay !== true
37525
37458
  );
37459
+ ctx = constructionReplayContext(descriptor, ctx);
37526
37460
  assertImplicitConstructionAllowed(descriptor.schemaClass);
37461
+ const replayCheckpoint = ctx.__storedConstructionReplayRowId === void 0 ? void 0 : sessionCreationCheckpoint(ctx);
37527
37462
  const closeFrame = pushConstructionFrame(ctx, descriptor.schemaClass.name);
37528
37463
  try {
37529
37464
  return constructClassValueWithinFrame(descriptor, scope, ctx);
37465
+ } catch (error) {
37466
+ rollbackStoredConstructionReplay(ctx, replayCheckpoint);
37467
+ throw error;
37530
37468
  } finally {
37531
37469
  closeFrame();
37532
37470
  }
@@ -37626,6 +37564,8 @@ function constructClassValueWithinFrame(descriptor, scope, ctx) {
37626
37564
  });
37627
37565
  root.classId = classId;
37628
37566
  stampConstructedRootGenericBindings(root, descriptor);
37567
+ if (ctx.__storedReplayCandidate !== void 0)
37568
+ ctx.__storedReplayCandidate.value = root.value;
37629
37569
  if (typeof root.value !== "object" || root.value === null || Array.isArray(root.value)) {
37630
37570
  throw new Error(
37631
37571
  `Class constructor for '${schemaClass2.name}' produced a non-record root.`
@@ -38055,15 +37995,20 @@ function constructionInitEvaluator(ctx, createdValues, argumentScopes, construct
38055
37995
  sourceValueId: sourceValueId ?? null,
38056
37996
  compileMemberId: scopeMemberId
38057
37997
  });
37998
+ const childId = storedInitializerChildId(member, ctx);
37999
+ const initializerCtx = childId === void 0 ? ctx : {
38000
+ ...ctx,
38001
+ __storedInitializerReplay: { rowId: childId, candidates: [] }
38002
+ };
38058
38003
  const evaluate = (argumentValues = []) => {
38059
- return withConstructionGenericSlots(
38004
+ const result = withConstructionGenericSlots(
38060
38005
  member,
38061
- ctx,
38006
+ initializerCtx,
38062
38007
  genericEnv,
38063
38008
  () => evaluateInitializerInContext(
38064
38009
  init,
38065
38010
  member,
38066
- ctx,
38011
+ initializerCtx,
38067
38012
  createdValues,
38068
38013
  argumentValues,
38069
38014
  sourceValueId ?? null,
@@ -38071,6 +38016,17 @@ function constructionInitEvaluator(ctx, createdValues, argumentScopes, construct
38071
38016
  genericEnv
38072
38017
  )
38073
38018
  );
38019
+ for (const candidate of initializerCtx.__storedInitializerReplay?.candidates ?? []) {
38020
+ if (!candidate.reattached) continue;
38021
+ if (candidate.value !== result.value) {
38022
+ throw new NSGetterRuntimeError(
38023
+ `Stored initializer '${member.name}' constructed an already owned value outside its returned child. Call Clone() explicitly.`
38024
+ );
38025
+ }
38026
+ if (ctx.__storedReplayCandidate !== void 0)
38027
+ ctx.__storedReplayCandidate.reattached = true;
38028
+ }
38029
+ return result;
38074
38030
  };
38075
38031
  const ownerClassId = scopeMemberId === null ? null : owningClassId(scopeMemberId);
38076
38032
  const expectedArgumentCount = compiled.parameters.slice(2).length;
@@ -38283,6 +38239,13 @@ function evaluateInitializerInContext(init, member, ctx, createdValues, argument
38283
38239
  (argument2) => trackedRowForValueReference(argument2, ctx)?.id === existingValueRow.id
38284
38240
  )) {
38285
38241
  assertInitializerPlacement(existingValueRow.id, member, ctx);
38242
+ if (storedInitializerChildId(member, ctx) === existingValueRow.id) {
38243
+ return {
38244
+ value: result.value,
38245
+ classId: existingRuntimeClassId,
38246
+ existingValueRow
38247
+ };
38248
+ }
38286
38249
  }
38287
38250
  if (existingValueRow !== null && existingRuntimeClassId !== null && isClassSlotMember(member)) {
38288
38251
  const storage = constructorArgumentStorage(existingValueRow.id, ctx);
@@ -38486,18 +38449,14 @@ function encodeRequiredConstructorArgument(args) {
38486
38449
  args.ctx.__valueOverlay
38487
38450
  ) !== null ? args.value : null;
38488
38451
  const adoptTracked = (id, suffix) => {
38489
- if (constructorGroupForRow(id, args.ctx) !== null) {
38490
- assertOwnedValueAttachable(
38491
- id,
38492
- {
38493
- identity: `value:${args.ownerRootId}:constructorArg:${args.parameterId}:${suffix}`,
38494
- label: args.ownerRootId
38495
- },
38496
- `constructor argument '${args.parameterId}'`,
38497
- args.ctx,
38498
- true
38499
- );
38500
- }
38452
+ recordConstructorGroupDependency(
38453
+ id,
38454
+ {
38455
+ identity: `value:${args.ownerRootId}:constructorArg:${args.parameterId}:${suffix}`,
38456
+ label: args.ownerRootId
38457
+ },
38458
+ args.ctx
38459
+ );
38501
38460
  return id;
38502
38461
  };
38503
38462
  if (args.typeInfo.type === 21 /* Generic */) {
@@ -39419,7 +39378,8 @@ function constructDeclaredClassValue(info, scope, ctx) {
39419
39378
  const descriptor = validateClassConstructorDescriptor(info, ctx, false);
39420
39379
  const schemaClass2 = descriptor.schemaClass;
39421
39380
  const record4 = resolveDeclaredConstructorRecord(info, schemaClass2, ctx);
39422
- const replayCheckpoint = ctx.storedConstructionReplay === true && ctx.__storedConstructionReplayRowId !== void 0 && ctx.__storedConstructionReplaySlot?.classId === schemaClass2.id && ctx.__executionState?.constructionStack.length === 0 ? sessionCreationCheckpoint(ctx) : void 0;
39381
+ ctx = constructionReplayContext(descriptor, ctx);
39382
+ const replayCheckpoint = ctx.storedConstructionReplay === true && ctx.__storedConstructionReplayRowId !== void 0 && ctx.__storedConstructionReplaySlot?.classId === schemaClass2.id ? sessionCreationCheckpoint(ctx) : void 0;
39423
39383
  const closeFrame = pushConstructionFrame(ctx, schemaClass2.name);
39424
39384
  try {
39425
39385
  return constructDeclaredClassValueWithinFrame(
@@ -39430,11 +39390,7 @@ function constructDeclaredClassValue(info, scope, ctx) {
39430
39390
  ctx
39431
39391
  );
39432
39392
  } catch (error) {
39433
- if (replayCheckpoint !== void 0) {
39434
- for (const row of createdSessionValuesSince(ctx, replayCheckpoint)) {
39435
- deleteRuntimeSessionValue(ctx, row.id);
39436
- }
39437
- }
39393
+ rollbackStoredConstructionReplay(ctx, replayCheckpoint);
39438
39394
  throw error;
39439
39395
  } finally {
39440
39396
  closeFrame();
@@ -39495,6 +39451,8 @@ function constructDeclaredClassValueWithinFrame(descriptor, record4, info, scope
39495
39451
  });
39496
39452
  root.classId = classId;
39497
39453
  stampConstructedRootGenericBindings(root, descriptor);
39454
+ if (ctx.__storedReplayCandidate !== void 0)
39455
+ ctx.__storedReplayCandidate.value = root.value;
39498
39456
  } catch (error) {
39499
39457
  if (error instanceof NSGetterRuntimeError) {
39500
39458
  positionAtPassingArgument(error, info, record4, argumentValues, ctx);
@@ -39507,7 +39465,7 @@ function constructDeclaredClassValueWithinFrame(descriptor, record4, info, scope
39507
39465
  `Declared constructor for '${schemaClass2.name}' produced a non-record root.`
39508
39466
  );
39509
39467
  }
39510
- if (ctx.storedConstructionReplay === true && ctx.__storedConstructionReplayRowId !== void 0 && ctx.__storedConstructionReplaySlot?.classId === classId && ctx.__executionState?.constructionStack.length === 1) {
39468
+ if (ctx.storedConstructionReplay === true && ctx.__storedConstructionReplayRowId !== void 0 && ctx.__storedConstructionReplaySlot?.classId === classId) {
39511
39469
  ctx = { ...ctx, __storedConstructionReplayRootId: root.id };
39512
39470
  }
39513
39471
  const rootRecord = root.value;
@@ -39671,8 +39629,13 @@ function assertOwnedValueAttachable(valueId, destination, destinationName, ctx,
39671
39629
  ctx,
39672
39630
  preflight?.parentEntries
39673
39631
  )) {
39674
- if (mode === "assign" && ownedAttachmentIdentity(owner, ctx) === ownedAttachmentIdentity(destination, ctx))
39632
+ if (mode === "assign" && ownedAttachmentIdentity(owner, ctx) === ownedAttachmentIdentity(destination, ctx)) {
39633
+ if (ctx.__storedReplayCandidate !== void 0 && ctx.__storedConstructionReplayRowId !== void 0 && owner.identity.startsWith(
39634
+ `value:${ctx.__storedConstructionReplayRowId}:slot:`
39635
+ ))
39636
+ ctx.__storedReplayCandidate.reattached = true;
39675
39637
  continue;
39638
+ }
39676
39639
  const error = new NSGetterRuntimeError(
39677
39640
  `Aggregate value '${valueId}' is already owned by parent value '${owner.label}' and cannot be attached to '${destinationName}'. Call Clone() explicitly.`
39678
39641
  );
@@ -39681,23 +39644,6 @@ function assertOwnedValueAttachable(valueId, destination, destinationName, ctx,
39681
39644
  }
39682
39645
  const reserved = ctx.__executionState?.ownedValueAttachments.get(valueId);
39683
39646
  if (reserved !== void 0 && (mode === "insert" || reserved.identity !== destination.identity)) {
39684
- const constructorArgumentReservation = reserved.identity.startsWith(
39685
- `value:${reserved.label}:constructorArg:`
39686
- );
39687
- const destinationConstructorGroup = constructorGroupForRow(
39688
- destination.label,
39689
- ctx
39690
- );
39691
- if (constructorArgumentReservation && (destination.label === reserved.label || destinationConstructorGroup === reserved.label || preflight?.constructorRootIds.has(reserved.label) === true)) {
39692
- if (preflight === void 0) {
39693
- ctx.__executionState?.ownedValueAttachments.set(valueId, destination);
39694
- recordConstructorGroupDependency(valueId, destination, ctx);
39695
- } else {
39696
- preflight.constructorArgumentTransfers.set(valueId, destination);
39697
- preflight.dependencies.set(valueId, destination);
39698
- }
39699
- return;
39700
- }
39701
39647
  throw new NSGetterRuntimeError(
39702
39648
  `Aggregate value '${valueId}' is already owned by parent value '${reserved.label}' and cannot be attached to '${destinationName}'. Call Clone() explicitly.`
39703
39649
  );
@@ -39709,6 +39655,29 @@ function assertOwnedValueAttachable(valueId, destination, destinationName, ctx,
39709
39655
  recordConstructorGroupDependency(valueId, destination, ctx);
39710
39656
  else preflight.dependencies.set(valueId, destination);
39711
39657
  }
39658
+ function storedReplayRowById(id, ctx) {
39659
+ ctx.valueDependencies?.add(id);
39660
+ ctx.__getterReads?.add(id);
39661
+ const database = ctx.vm.databaseVM;
39662
+ if (database?.storedValueById !== void 0)
39663
+ return database.storedValueById(id);
39664
+ if (database?.evaluatorIndexes !== void 0)
39665
+ return database.evaluatorIndexes.valueById.get(id) ?? null;
39666
+ return ctx.vm.values.find((row) => row.id === id) ?? null;
39667
+ }
39668
+ function storedInitializerChildId(member, ctx) {
39669
+ if (ctx.storedConstructionReplay !== true) return void 0;
39670
+ const parentId = ctx.__storedConstructionReplayRowId;
39671
+ const memberId = Reflect.get(member, "id");
39672
+ if (parentId === void 0 || typeof memberId !== "string") return void 0;
39673
+ const parent = storedReplayRowById(parentId, ctx);
39674
+ if (parent?.value === null || typeof parent?.value !== "object")
39675
+ return void 0;
39676
+ const schemaKey = cachedSchemaKeyForMember(memberId, ctx);
39677
+ if (schemaKey === null) return void 0;
39678
+ const childId = Reflect.get(parent.value, schemaKey);
39679
+ return typeof childId === "string" ? childId : void 0;
39680
+ }
39712
39681
  function assertInitializerPlacement(valueId, member, ctx) {
39713
39682
  const replayRowId = ctx.__storedConstructionReplayRowId;
39714
39683
  const memberId = Reflect.get(member, "id");
@@ -39746,7 +39715,7 @@ function ownershipParentEntryKeys(value, valueId, cache) {
39746
39715
  }
39747
39716
  return entries.get(valueId) ?? [];
39748
39717
  }
39749
- function currentOwnedValueAttachments(valueId, ctx, parentEntries, placingMembers) {
39718
+ function currentOwnedValueAttachments(valueId, ctx, parentEntries) {
39750
39719
  const indexes4 = evaluatorIndexes(ctx);
39751
39720
  const cached = indexes4.ownedValueAttachmentsByValueId.get(valueId);
39752
39721
  if (cached !== void 0) return [...cached];
@@ -39809,14 +39778,7 @@ function currentOwnedValueAttachments(valueId, ctx, parentEntries, placingMember
39809
39778
  let member = null;
39810
39779
  let classId = parent.classId;
39811
39780
  if (classId === void 0 || classId === null) {
39812
- member = activeStaticBindingRoot(parent.id, ctx)?.member ?? (placingMembers === void 0 ? memberForValueRow(parent, ctx) : placingMember(
39813
- parent,
39814
- ctx,
39815
- void 0,
39816
- 0,
39817
- placingMembers,
39818
- parentEntries
39819
- ));
39781
+ member = activeStaticBindingRoot(parent.id, ctx)?.member ?? memberForValueRow(parent, ctx);
39820
39782
  if (member !== null) {
39821
39783
  try {
39822
39784
  member = resolveMember(member, ctx.vm.members);
@@ -53856,8 +53818,8 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
53856
53818
  this.persistingMethodGroup = false;
53857
53819
  }
53858
53820
  }
53859
- /** P112 §2.2. Checks a stored default's `Reference(place)` the push can't settle. */
53860
- resolvePersistedReference(expression, expected) {
53821
+ /** Check an initializer with its expected type, including contextual expressions. */
53822
+ validateInitializerExpression(expression, expected) {
53861
53823
  const resolved = this.resolveExpression(
53862
53824
  expression,
53863
53825
  this.initialScope(),
@@ -59631,6 +59593,8 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
59631
59593
  }
59632
59594
  const staticType = this.project.typeByName.get(receiverAst.name);
59633
59595
  if (staticType && staticType.kind !== "enum") {
59596
+ if (receiverAst.typeQualifier)
59597
+ this.resolveType(receiverAst.typeQualifier);
59634
59598
  this.assertUserSafe(
59635
59599
  { kind: "named", typeId: staticType.id },
59636
59600
  "a static receiver",
@@ -59770,6 +59734,9 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
59770
59734
  pointer: listIndexPointer(receiver.pointer, index),
59771
59735
  type: viewType,
59772
59736
  writability: "readOnly" /* ReadOnly */,
59737
+ ...receiver.entryWritability !== void 0 ? { entryWritability: receiver.entryWritability } : {},
59738
+ entryUserData: receiver.entryUserData === true,
59739
+ ...receiver.writeRoot !== void 0 ? { writeRoot: receiver.writeRoot } : {},
59773
59740
  indexDefinition: index,
59774
59741
  indexCollectionPointer: receiver.pointer
59775
59742
  };
@@ -59778,7 +59745,10 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
59778
59745
  return {
59779
59746
  pointer: receiver.pointer,
59780
59747
  type: { kind: "primitive", name: "unknown" },
59781
- indexSurface: receiver.type
59748
+ indexSurface: receiver.type,
59749
+ entryWritability: receiver.entryWritability ?? receiver.writability ?? "runtime" /* Runtime */,
59750
+ entryUserData: receiver.entryWritability === void 0 ? receiver.userData === true : receiver.entryUserData === true,
59751
+ writeRoot: this.expressionWriteRoot(receiver, scope)
59782
59752
  };
59783
59753
  }
59784
59754
  if ((name === "Keys" || name === "Values") && receiver.type.kind === "dictionary") {
@@ -60053,7 +60023,7 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
60053
60023
  pos
60054
60024
  );
60055
60025
  }
60056
- if (entry.id.startsWith(NEOSCRIPT_PENDING_SYMBOL_ID_PREFIX)) {
60026
+ if (entry.id.startsWith(NEOSCRIPT_PENDING_SYMBOL_ID_PREFIX) && !this.options.allowPendingRegistryEntries) {
60057
60027
  throw new CompileError(
60058
60028
  `${registry.entryType} '${name}' has no @id, so it has never been pushed and has no project file to reference. Push the file before referencing it.`,
60059
60029
  pos
@@ -60181,7 +60151,10 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
60181
60151
  key.pointer
60182
60152
  ),
60183
60153
  type: resultType,
60184
- writability: "readOnly" /* ReadOnly */
60154
+ writability: "readOnly" /* ReadOnly */,
60155
+ ...receiver.entryWritability !== void 0 ? { entryWritability: receiver.entryWritability } : {},
60156
+ entryUserData: receiver.entryUserData === true,
60157
+ ...receiver.writeRoot !== void 0 ? { writeRoot: receiver.writeRoot } : {}
60185
60158
  };
60186
60159
  }
60187
60160
  const readonlyCollection = receiver.symbol?.readonlyDeclaration === true && receiver.initWritability !== void 0 ? {
@@ -61017,6 +60990,8 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
61017
60990
  }
61018
60991
  const staticType = this.project.typeByName.get(callee.receiver.name);
61019
60992
  if (staticType && staticType.kind !== "enum") {
60993
+ if (callee.receiver.typeQualifier)
60994
+ this.resolveType(callee.receiver.typeQualifier);
61020
60995
  this.assertUserSafe(
61021
60996
  { kind: "named", typeId: staticType.id },
61022
60997
  "a static receiver",
@@ -78591,15 +78566,7 @@ function calculateDeclarationSignature(ctx, projectionClassId, schemaKey, declar
78591
78566
  declarationClassId: declaration.classDef.id,
78592
78567
  memberId: declaration.memberId,
78593
78568
  isAbstract: isAbstractMember(member) === true,
78594
- isVirtual: isVirtualMember(member) !== false,
78595
- // Openness belongs to the DECLARING class, not to whoever is asking: a
78596
- // descendant that closes the param still has to see a declaration it is
78597
- // obliged to implement.
78598
- requiresClosingImplementation: lookupDeclaredTypeInfo2(member) === null ? false : lookupNarrowingAwaitsClosingBinding(
78599
- ctx,
78600
- member,
78601
- resolveGenericEnvForEmission(ctx, declaration.classDef.id)
78602
- )
78569
+ isVirtual: isVirtualMember(member) !== false
78603
78570
  };
78604
78571
  if (isCallableMemberForCodegen(member)) {
78605
78572
  const parameterTypes = member.argumentTypes.map(
@@ -78809,7 +78776,7 @@ function generatedInstanceMemberSignaturesEqual(left, right) {
78809
78776
  return false;
78810
78777
  }
78811
78778
  function emitsAbstractDeclaration(signature) {
78812
- return signature.isAbstract || signature.requiresClosingImplementation;
78779
+ return signature.isAbstract;
78813
78780
  }
78814
78781
  function resolveGeneratedInstanceMemberPlan(ctx, classDef, schemaKey) {
78815
78782
  const declaration = ownInstanceMemberDeclaration(classDef, schemaKey);
@@ -80867,41 +80834,6 @@ function lookupDeclaredTypeInfo2(member) {
80867
80834
  if (!isMemberLookupBase(member)) return null;
80868
80835
  return member.declaredTypeInfo ?? null;
80869
80836
  }
80870
- function lookupTargetClassProjection(ctx, member, env) {
80871
- if (!isMemberLookupBase(member)) return null;
80872
- const declaredTypeInfo = lookupDeclaredTypeInfo2(member);
80873
- if (declaredTypeInfo === null) {
80874
- const entryMember = resolveLookupEntryMember(ctx, member);
80875
- if (entryMember === null) return null;
80876
- if (!isClassTypedMember(entryMember)) return null;
80877
- return {
80878
- classId: entryMember.classId,
80879
- constructedSuffix: constructedTypeArgumentsSuffix(ctx, entryMember, true, env) ?? ""
80880
- };
80881
- }
80882
- if (declaredTypeInfo.type === 7 /* Class */) {
80883
- return {
80884
- classId: declaredTypeInfo.classId,
80885
- constructedSuffix: typeInfoConstructedSuffix(ctx, declaredTypeInfo, true, env) ?? ""
80886
- };
80887
- }
80888
- if (declaredTypeInfo.type !== 21 /* Generic */) return null;
80889
- if (!isClassGenericParamTypeInfo(declaredTypeInfo)) return null;
80890
- const entry = env?.get(declaredTypeInfo.genericParamId);
80891
- if (entry === void 0) return null;
80892
- if (entry.kind !== "member") return null;
80893
- const bindingMember = resolveMemberById(
80894
- ctx,
80895
- entry.memberId,
80896
- `classes.${declaredTypeInfo.ownerClassId}.genericParams.${declaredTypeInfo.genericParamId}`
80897
- );
80898
- if (bindingMember === null) return null;
80899
- if (!isClassTypedMember(bindingMember)) return null;
80900
- return {
80901
- classId: bindingMember.classId,
80902
- constructedSuffix: constructedTypeArgumentsSuffix(ctx, bindingMember, true, env) ?? ""
80903
- };
80904
- }
80905
80837
  function referenceHandleTypeInfo(ctx, reference) {
80906
80838
  const target = reference.targetTypeInfo;
80907
80839
  if (referenceCategory(target, classConstrainedGenerics(ctx.classes)) !== "handle" /* Handle */) {
@@ -80965,11 +80897,6 @@ function lookupReferenceElementType(ctx, member, env) {
80965
80897
  function lookupNarrowsThroughGenericParam(member) {
80966
80898
  return lookupDeclaredTypeInfo2(member)?.type === 21 /* Generic */;
80967
80899
  }
80968
- function lookupNarrowingAwaitsClosingBinding(ctx, member, env) {
80969
- if (!lookupNarrowsThroughGenericParam(member)) return false;
80970
- if (lookupProjection(ctx, member) !== "class" /* Class */) return false;
80971
- return lookupTargetClassProjection(ctx, member, env) === null;
80972
- }
80973
80900
  function lookupTargetValueType(ctx, member, saved, env) {
80974
80901
  if (!isMemberLookupBase(member)) return "NeoLookupSelection";
80975
80902
  const targetSaved = lookupTargetSaved(ctx, member) ?? saved;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neocompose/cli",
3
- "version": "0.89.7",
3
+ "version": "0.89.8",
4
4
  "description": "Neo Compose native project-source CLI with bidirectional sync.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,7 +9,7 @@ description: >-
9
9
  `@neocompose/cli` or `node cli/bin/neo.mjs` in the neo-compose repository.
10
10
  ---
11
11
 
12
- <!-- reviewed-through-cli: 0.89.7 -->
12
+ <!-- reviewed-through-cli: 0.89.8 -->
13
13
 
14
14
  # Neo Compose CLI
15
15
 
@@ -118,6 +118,11 @@ codec reads when changing either projection. Class-generic results whose binding
118
118
  is known only at runtime use the SDK generic reader, including recursive tuple,
119
119
  collection, enum, and reference projections; scalar conversion alone is insufficient.
120
120
 
121
+ Direct class-constrained `Reference<T>` and `Set<Reference<T>>` fields emit concrete
122
+ accessors using the SDK generic reader, even while the declaring class leaves `T`
123
+ open. Only authored abstract declarations emit abstract members. Compile the
124
+ open class and exercise direct, inherited, closed, and read-only instances.
125
+
121
126
  A stored `Reference<T>` implementing an inherited get-only `T` property emits a
122
127
  value getter that reads the reference target. Keep its interface and field tokens
123
128
  on the inherited type, and compile both open and closed generic overrides.
@@ -138,7 +143,7 @@ The marker near the top of `SKILL.md` must exactly match the package version,
138
143
  and this quoted copy is checked too:
139
144
 
140
145
  ```html
141
- <!-- reviewed-through-cli: 0.89.7 -->
146
+ <!-- reviewed-through-cli: 0.89.8 -->
142
147
  ```
143
148
 
144
149
  Keep this skill on current behavior. Upgrade steps, rollout prerequisites,
@@ -142,6 +142,10 @@ class Child(string name) : Base {
142
142
  explicitly when needed.
143
143
  - Base-constructor arguments use the constructed class's concrete generic
144
144
  bindings, including an `Item<T>` parameter forwarded through its base chain.
145
+ - Recording a constructor argument does not claim ownership. An initializer
146
+ may pass it to a nested constructor or attach it to a collection while
147
+ retaining its identity. Giving the same aggregate two owned fields or
148
+ collection positions still requires an explicit `Clone()`.
145
149
  - Constraints may construct another generic from a sibling parameter:
146
150
 
147
151
  ```neo