poe-code 12.0.8 → 12.0.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/README.md CHANGED
@@ -323,6 +323,27 @@ Full browser SafeJS SDK/runtime support remains pending. Guest codec integration
323
323
  portable SDK declaration closure and shared host-call policy/replay metadata
324
324
  require separate integration; a browser filesystem build does not prove them.
325
325
 
326
+ #### Host-operation recovery policy
327
+
328
+ The Node SafeJS SDK selects recovery policy when a host call is issued:
329
+ `declareHostOperation(function, policy)` takes precedence, otherwise the exact
330
+ journaled module/operation pair registered with `registerPendingHostCallPolicy`
331
+ supplies the default, otherwise the call is `re-issue`. Named registration is not
332
+ limited to legacy snapshot reconciliation. Caller bindings use module ID
333
+ `<bindings>`. Registration affects subsequent calls, not previously captured
334
+ history; a changed policy on replay fails closed rather than downgrading a
335
+ captured side effect.
336
+
337
+ Recorded outcomes are reused. A pending `read-side-effect` call requires a
338
+ matching external reconciliation proof and is not blindly invoked again;
339
+ `re-issue` permits another invocation. Neither registration nor checkpointing
340
+ makes arbitrary external effects exactly-once. Shared function aliases retain
341
+ their existing canonical journal identity, so declare the function itself when
342
+ its aliases must share an effect policy. See the
343
+ [host-policy contract](packages/safe-js/CHECKPOINT_REPLAY.md#host-operation-policy-selection)
344
+ for registration lifetime, naming and reconciliation requirements. This changes
345
+ no CLI flags and adds no browser SafeJS runtime support.
346
+
326
347
  ## Building from Source
327
348
 
328
349
  Run `npm run build` to compile the workspace and generate the published bundles.
package/dist/index.js CHANGED
@@ -137803,6 +137803,9 @@ function registerPendingHostCallPolicy(registration) {
137803
137803
  MODULE_PENDING_HOST_CALL_POLICIES[moduleId] ??= /* @__PURE__ */ Object.create(null);
137804
137804
  MODULE_PENDING_HOST_CALL_POLICIES[moduleId][operation] = policy;
137805
137805
  }
137806
+ function readRegisteredPendingHostCallPolicy(moduleId, operation) {
137807
+ return MODULE_PENDING_HOST_CALL_POLICIES[moduleId]?.[operation];
137808
+ }
137806
137809
  function pendingHostCallResumeIdentityMatches(expected, actual) {
137807
137810
  return actual.callId === expected.callId && actual.sourceHash === expected.sourceHash && actual.moduleId === expected.moduleId && actual.operation === expected.operation && actual.argumentDigest === expected.argumentDigest;
137808
137811
  }
@@ -141684,10 +141687,10 @@ function wrapCallerInjectedFunction(name, value, options, state) {
141684
141687
  const hostArgs = deepCopyFromSandbox([...args], {
141685
141688
  wrapClosure: (closure) => wrapSandboxClosureForHost(closure, stackFrames, options.budget, callbacks)
141686
141689
  });
141687
- const policy = readHostOperationPolicy(value) ?? "re-issue";
141688
141690
  const hostCalls = options.hostCalls;
141689
141691
  const operation = options.operation ?? bindingName;
141690
141692
  const moduleId = options.moduleId ?? "<bindings>";
141693
+ const policy = readHostOperationPolicy(value) ?? readRegisteredPendingHostCallPolicy(moduleId, operation) ?? "re-issue";
141691
141694
  if (hostCalls === void 0) {
141692
141695
  return copyHostResultToSandbox(
141693
141696
  invokeHostCallback(() => Reflect.apply(callable, void 0, hostArgs), options),
@@ -142515,6 +142518,7 @@ var init_host_bridge = __esm({
142515
142518
  init_float32();
142516
142519
  init_exceptions();
142517
142520
  init_otel2();
142521
+ init_policy();
142518
142522
  init_host_call();
142519
142523
  init_values();
142520
142524
  init_running_state();
@@ -156452,7 +156456,7 @@ var init_package2 = __esm({
156452
156456
  "package.json"() {
156453
156457
  package_default2 = {
156454
156458
  name: "poe-code",
156455
- version: "12.0.8",
156459
+ version: "12.0.9",
156456
156460
  description: "CLI tool to configure Poe API for developer workflows.",
156457
156461
  license: "MIT",
156458
156462
  type: "module",