Prepare scene extraction and deterministic normalization in core
This commit is contained in:
@@ -100,6 +100,18 @@ func executeNative[T any](ctx context.Context, execution ExecutionContext[T], op
|
||||
var err error
|
||||
var cacheKey string
|
||||
cache := execution.Cache
|
||||
if cache != nil && cache.Decode != nil && operation.Reuse != nil {
|
||||
copy := *cache
|
||||
decode := cache.Decode
|
||||
copy.Decode = func(content []byte) (T, error) {
|
||||
value, err := decode(content)
|
||||
if err != nil {
|
||||
return value, err
|
||||
}
|
||||
return operation.Reuse(value)
|
||||
}
|
||||
cache = ©
|
||||
}
|
||||
if execution.Execution.Capture != nil {
|
||||
if err := execution.Execution.RecordEvidence("cache/selection.json", map[string]any{"mode": execution.Controls.Cache, "reuse_eligible": execution.ReuseEligible, "store_available": cache != nil && cache.Store != nil}); err != nil {
|
||||
return empty, captureFailure(err, capture.Finish(nil, err, false, false))
|
||||
|
||||
Reference in New Issue
Block a user