@shapeshift-labs/frontier-swarm 0.5.7 → 0.5.9

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/dist/index.js CHANGED
@@ -2880,7 +2880,11 @@ function semanticSummaryIsWeak(summary) {
2880
2880
  return summary.imported === 0
2881
2881
  || summary.semanticIndex.symbols === 0
2882
2882
  || summary.semanticSidecars.ownershipRegions === 0
2883
- || summary.sourceMapMappingCount === 0;
2883
+ || summary.sourceMapMappingCount === 0
2884
+ || summary.proofSpec.failed > 0
2885
+ || summary.proofSpec.stale > 0
2886
+ || summary.proofSpec.open > 0
2887
+ || summary.proofSpec.unknown > 0;
2884
2888
  }
2885
2889
  function dedupeAdaptiveObservations(observations) {
2886
2890
  const byKey = new Map();
@@ -4155,12 +4159,103 @@ function normalizeSemanticImportSummary(input) {
4155
4159
  lossesBySeverity: normalizeCounterRecord(object.lossesBySeverity),
4156
4160
  semanticIndex: normalizeSemanticIndexSummary(object.semanticIndex),
4157
4161
  semanticSidecars: normalizeSemanticSidecarSummary(object.semanticSidecars),
4162
+ proofSpec: normalizeProofSpecSummary(object.proofSpec),
4163
+ paradigmSemantics: normalizeParadigmSemanticsSummary(object.paradigmSemantics),
4158
4164
  sourceProjections: normalizeSourceProjectionSummary(object.sourceProjections),
4159
4165
  nativeCompiles: normalizeNativeCompileSummary(object.nativeCompiles),
4160
4166
  readiness: normalizeCounterRecord(object.readiness),
4161
4167
  ...(metadata ? { metadata } : {})
4162
4168
  };
4163
4169
  }
4170
+ const paradigmSemanticsSummaryGroups = [
4171
+ 'bindingScopes',
4172
+ 'bindings',
4173
+ 'patterns',
4174
+ 'typeConstraints',
4175
+ 'evaluationModels',
4176
+ 'memoryLocations',
4177
+ 'effectRegions',
4178
+ 'controlRegions',
4179
+ 'logicPrograms',
4180
+ 'actorSystems',
4181
+ 'stackEffects',
4182
+ 'arrayShapes',
4183
+ 'numericKernels',
4184
+ 'dataflowNetworks',
4185
+ 'clockModels',
4186
+ 'objectModels',
4187
+ 'macroExpansions',
4188
+ 'reflectionBoundaries',
4189
+ 'loweringRecords'
4190
+ ];
4191
+ function normalizeParadigmSemanticsSummary(input) {
4192
+ const object = toJsonObject(input);
4193
+ const counts = Object.fromEntries(paradigmSemanticsSummaryGroups.map((group) => [
4194
+ group,
4195
+ nonNegativeCount(object?.[group])
4196
+ ]));
4197
+ const total = nonNegativeCount(object?.total) || Object.values(counts).reduce((sum, count) => sum + count, 0);
4198
+ const byGroup = normalizeCounterRecord(object?.byGroup);
4199
+ const byKind = normalizeCounterRecord(object?.byKind);
4200
+ const hasRuntimeSemantics = object?.hasRuntimeSemantics === true
4201
+ || counts.evaluationModels > 0
4202
+ || counts.memoryLocations > 0
4203
+ || counts.effectRegions > 0
4204
+ || counts.controlRegions > 0
4205
+ || counts.actorSystems > 0
4206
+ || counts.clockModels > 0;
4207
+ const hasLogicSemantics = object?.hasLogicSemantics === true || counts.logicPrograms > 0;
4208
+ const hasStackSemantics = object?.hasStackSemantics === true || counts.stackEffects > 0;
4209
+ const hasArraySemantics = object?.hasArraySemantics === true || counts.arrayShapes > 0 || counts.numericKernels > 0;
4210
+ const hasMacroOrReflection = object?.hasMacroOrReflection === true || counts.macroExpansions > 0 || counts.reflectionBoundaries > 0;
4211
+ const hasLowering = object?.hasLowering === true || counts.loweringRecords > 0;
4212
+ return {
4213
+ total,
4214
+ ids: uniqueStrings(stringArray(object?.ids)),
4215
+ groups: uniqueStrings(stringArray(object?.groups)),
4216
+ kinds: uniqueStrings(stringArray(object?.kinds)),
4217
+ evidence: nonNegativeCount(object?.evidence),
4218
+ ...counts,
4219
+ byGroup,
4220
+ byKind,
4221
+ hasRuntimeSemantics,
4222
+ hasLogicSemantics,
4223
+ hasStackSemantics,
4224
+ hasArraySemantics,
4225
+ hasMacroOrReflection,
4226
+ hasLowering,
4227
+ empty: object?.empty === true || total === 0
4228
+ };
4229
+ }
4230
+ function normalizeProofSpecSummary(input) {
4231
+ const object = toJsonObject(input);
4232
+ const total = nonNegativeCount(object?.total);
4233
+ return {
4234
+ total,
4235
+ ids: uniqueStrings(stringArray(object?.ids)),
4236
+ contracts: nonNegativeCount(object?.contracts),
4237
+ refinements: nonNegativeCount(object?.refinements),
4238
+ invariants: nonNegativeCount(object?.invariants),
4239
+ termination: nonNegativeCount(object?.termination),
4240
+ temporal: nonNegativeCount(object?.temporal),
4241
+ obligations: nonNegativeCount(object?.obligations),
4242
+ artifacts: nonNegativeCount(object?.artifacts),
4243
+ assumptions: nonNegativeCount(object?.assumptions),
4244
+ evidence: nonNegativeCount(object?.evidence),
4245
+ discharged: nonNegativeCount(object?.discharged),
4246
+ failed: nonNegativeCount(object?.failed),
4247
+ open: nonNegativeCount(object?.open),
4248
+ unknown: nonNegativeCount(object?.unknown),
4249
+ stale: nonNegativeCount(object?.stale),
4250
+ assumed: nonNegativeCount(object?.assumed),
4251
+ contractKinds: uniqueStrings(stringArray(object?.contractKinds)),
4252
+ artifactKinds: uniqueStrings(stringArray(object?.artifactKinds)),
4253
+ byStatus: normalizeCounterRecord(object?.byStatus),
4254
+ byContractKind: normalizeCounterRecord(object?.byContractKind),
4255
+ byArtifactKind: normalizeCounterRecord(object?.byArtifactKind),
4256
+ empty: object?.empty === true || total === 0
4257
+ };
4258
+ }
4164
4259
  function normalizeSemanticIndexSummary(input) {
4165
4260
  const object = toJsonObject(input);
4166
4261
  return {
@@ -4390,6 +4485,9 @@ function slug(value) {
4390
4485
  function uniqueStrings(values) {
4391
4486
  return Array.from(new Set(values.map((value) => String(value ?? '').trim()).filter(Boolean)));
4392
4487
  }
4488
+ function stringArray(value) {
4489
+ return Array.isArray(value) ? value.map((entry) => String(entry ?? '').trim()).filter(Boolean) : [];
4490
+ }
4393
4491
  function positiveNumber(value) {
4394
4492
  return typeof value === 'number' && Number.isFinite(value) && value > 0;
4395
4493
  }