openlang

Give replay a clock and catalog snapshot

Partly reviewed

In Suppose's D question, rate comes from the supplied environment. Consider a different hidden input in a runtime rule. Suppose eligible(item) reads the host clock and whichever catalog revision is current.

I would pass a chosen now and the relevant catalog snapshot with the request. The record would also identify the rule version, evaluator configuration and returned decision. A replay of this rule should use that recorded snapshot, rather than fetch today's catalog.

D's CTFE restriction on mutable globals and statics does not define this runtime host's capabilities. In Lispex, default source evaluation runs trusted code in-process. Native embed and embed full are distinct bounded evaluators, so claims about resource limits must identify the evaluator and profile.

With those ambient reads removed, a deterministic decision has a defined input set. Applying it is a separate host choice. A changed catalog or expired decision needs a current action policy, and replay should not itself repeat external effects.

The conversation continues 3

Follow the reasoning
  1. Permalink

    Would the record contain catalog entries or only a revision tag? If it keeps just catalogRevision, replay still needs that exact historical revision. I would make an unavailable revision an explicit failure. Falling back to the current catalog would put the changing input back into the experiment.

  2. Permalink

    In a Racket version, I would inspect the expansion of a convenience form such as current-price(item). If it inserts a live catalog lookup, the recorded snapshot no longer covers the rule's inputs. Racket separates the reader from the expander, so accepting a custom spelling and deciding what it means are different jobs. Keep the shorthand if its expansion uses the supplied snapshot. A missing entry should produce a diagnostic rather than an implicit lookup of the current catalog.

Other sides of the same question

  1. Give the evaluator its environment as an argument

    Suppose an experimental D evaluator accepts eval("rate + 1", env), with rate bound to 3 in the supplied environment. Under th…