@sublang/slc 0.16.4 → 0.16.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.
@@ -1 +1 @@
1
- {"version":3,"file":"verify-coverage.d.ts","sourceRoot":"","sources":["../src/verify-coverage.ts"],"names":[],"mappings":"AA8BA,OAAO,EAkBL,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAErB,sEAAsE;AACtE,eAAO,MAAM,aAAa,YAAY,CAAC;AAgBvC,iFAAiF;AACjF,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,cAGC;CACF;AAyDD,6DAA6D;AAC7D,UAAU,WAAW;IACnB,MAAM,EAAE,iBAAiB,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,OAAO,CAAC,eAAe,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,WAAW,CAAC;IAC3E,mEAAmE;IACnE,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,CAAC;IACF,4EAA4E;IAC5E,IAAI,CAAC,EAAE,qBAAqB,CAAC;CAC9B;AAyBD,UAAU,qBAAqB;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjC;AAqJD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,OAAO,GAAG,WAAW,CAwB3D;AAkyCD,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,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GAAG,CAAC,CAAC;IACvB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAgCnD"}
@@ -1385,10 +1385,10 @@ function probeGuardAssignment(guard, fixedEvent, payloads, extraValues, options
1385
1385
  const descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1386
1386
  if (tag === 'c:' && typeof prop === 'string')
1387
1387
  contextRead(prop);
1388
- if (options.discoverPayloadShape === true &&
1389
- tag !== 'c:' &&
1388
+ if (tag !== 'c:' &&
1390
1389
  typeof prop === 'string' &&
1391
1390
  descriptor === undefined) {
1391
+ // Ordinary descriptor reads guide values without inventing one.
1392
1392
  reads.add(`${tag}${prop}`);
1393
1393
  enumerated.add(tag);
1394
1394
  noteShapeField(tag, prop);
@@ -2033,14 +2033,13 @@ async function searchCoverageEntry(machine, target, refs, captains, playbooks, c
2033
2033
  drive: path.drive,
2034
2034
  steps: [...path.steps, step],
2035
2035
  };
2036
- if (coverageNodeKey(node) === coverageNodeKey(target) &&
2037
- step.questionWait !== undefined)
2036
+ if (coverageNodeKey(step.next) === coverageNodeKey(target))
2038
2037
  continuations.push(successor);
2039
2038
  else
2040
2039
  queue.push(successor);
2041
2040
  }
2042
- // Continue a reached target before unrelated alternative prefixes, but
2043
- // retain candidate order and charge every replay to the same budgets.
2041
+ // Replay a discovered target, including its canonical question continuation,
2042
+ // before unrelated prefixes; retain candidate order and the same budgets.
2044
2043
  queue.unshift(...continuations);
2045
2044
  }
2046
2045
  finally {
@@ -2228,6 +2227,19 @@ function captainPredecessorPlan(machine, target, playbooks, refs, captains) {
2228
2227
  }
2229
2228
  return undefined;
2230
2229
  }
2230
+ /** The direct interrupt required by the retained one-child legacy driver. */
2231
+ function captainPredecessorDrive(machine, predecessor, refs, values) {
2232
+ const entryRef = predecessor.entry?.captain.ref ?? predecessor.playbook.ref;
2233
+ const entryId = predecessor.entry === undefined
2234
+ ? interruptTargetForRef(predecessor.playbook.ref, predecessor.playbook.ref.stableId)
2235
+ : captainInterruptTarget(predecessor.entry.captain);
2236
+ return interruptDriveForRef(machine, refs, entryRef, entryId, values);
2237
+ }
2238
+ function unavailableCaptainPredecessorDrive(machine, captain, refs, captains, playbooks, values = []) {
2239
+ const predecessor = captainPredecessorPlan(machine, captain, playbooks, refs, captains);
2240
+ return (predecessor !== undefined &&
2241
+ !captainPredecessorDrive(machine, predecessor, refs, values).satisfiable);
2242
+ }
2231
2243
  /**
2232
2244
  * Finds a controller path from a hub event to an acting state. Controller-only
2233
2245
  * intermediate states are entered through earlier Captain results rather than
@@ -2399,11 +2411,7 @@ function captainProbeActor(machine, captain, result, gate, refs, captains, playb
2399
2411
  let childUsed = false;
2400
2412
  const actorId = invocationActorId(machine, predecessor.playbook);
2401
2413
  const dynamic = dynamicPlaybookFields(predecessor.playbook);
2402
- const entryRef = predecessor.entry?.captain.ref ?? predecessor.playbook.ref;
2403
- const entryId = predecessor.entry === undefined
2404
- ? interruptTargetForRef(predecessor.playbook.ref, predecessor.playbook.ref.stableId)
2405
- : captainInterruptTarget(predecessor.entry.captain);
2406
- const drive = interruptDriveForRef(machine, refs, entryRef, entryId, interruptValues);
2414
+ const drive = captainPredecessorDrive(machine, predecessor, refs, interruptValues);
2407
2415
  if (!drive.satisfiable)
2408
2416
  return undefined;
2409
2417
  const actor = makeActor(machine, (input) => {
@@ -2812,7 +2820,15 @@ export function fsmCoverageTestTimeout(fsmModule) {
2812
2820
  entryEvents.delete(INTERRUPT_EVENT);
2813
2821
  const entrySettles = entryEvents.size * SETTLE_MS;
2814
2822
  let captainSettles = 0;
2815
- let guardProbeCalls = rootInterruptProbes;
2823
+ // Each ordinary dispatch may inspect two child-output seeds per predecessor
2824
+ // arm, then the selected legacy predecessor's required interrupt drive.
2825
+ let guardProbeCalls = rootInterruptProbes +
2826
+ (controller
2827
+ ? 0
2828
+ : captains.length *
2829
+ (1 +
2830
+ 2 *
2831
+ playbooks.reduce((n, p) => n + transitionArms(p.invocation.onDone).length, 0)));
2816
2832
  let pathSearches = controller
2817
2833
  ? 0
2818
2834
  : playbooks.reduce((total, playbook) => total +
@@ -2838,7 +2854,8 @@ export function fsmCoverageTestTimeout(fsmModule) {
2838
2854
  if (!controller &&
2839
2855
  (rootInterruptProbes === 0 ||
2840
2856
  (captain.binding.actor !== 'script' &&
2841
- !interruptDriveForRef(machine, refs, captain.ref, captainInterruptTarget(captain)).satisfiable))) {
2857
+ !interruptDriveForRef(machine, refs, captain.ref, captainInterruptTarget(captain)).satisfiable) ||
2858
+ unavailableCaptainPredecessorDrive(machine, captain, refs, captains, playbooks))) {
2842
2859
  pathSearches +=
2843
2860
  resultKeys.length +
2844
2861
  (resultKeys.includes(NEEDS_BOSS_REPLY) ? 1 : 0) +
@@ -3176,7 +3193,8 @@ async function runFsmCoverage(fsmModule, sourceText) {
3176
3193
  if (!isController &&
3177
3194
  (!canJump ||
3178
3195
  (captain.binding.actor !== 'script' &&
3179
- !interruptDriveForRef(machine, refs, captain.ref, captainInterruptTarget(captain), sourceCandidates).satisfiable))) {
3196
+ !interruptDriveForRef(machine, refs, captain.ref, captainInterruptTarget(captain), sourceCandidates).satisfiable) ||
3197
+ unavailableCaptainPredecessorDrive(machine, captain, refs, captains, playbooks, sourceCandidates))) {
3180
3198
  findings.push(...(await probeNonPreemptiveActor(machine, captain, refs, captains, playbooks, [...stateCandidates, ...sourceCandidates])));
3181
3199
  continue;
3182
3200
  }