Open tsandall opened 6 years ago
Another (perhaps better) option would be to allow callers to specify a set of known paths (perhaps in addition to paths defined by rules). Any reference to a path outside the set would be treated as unknown and trigger a save. In terms of implementation, we would have to review the places in the evaluator where the save set is checked and generalize it to support this alternative set.
Adding this issue into the TODO backlog.
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.
Today, only the caller is able to specify the unknowns to use during partial evaluation. If the list of unknowns is hard to predict or changes frequently over time, this can become an issue.
Similarly, tohttps://github.com/tsandallday, certain built-in functions (like
time.now_ns
) are ignored during partial eval. This works fine for optimization use cases however for translation use cases, callers should probably not have to deal with expressions unnecessarily.The handle use cases like this, the policy author could define rules that would be evaluated before partial eval is run to determine the unknowns to use later. For example:
One downside of this approach is that we cannot reify terms in OPA today so the policy author would have to encode their refs as strings.
We could extend some control to the caller in this scenario. For example, the caller could specify the name of the document to query to obtain the unknowns.