Prepare scene extraction and deterministic normalization in core

This commit is contained in:
2026-11-25 15:48:32 +00:00
parent 9d2674481b
commit e3ddc177ab
13 changed files with 135 additions and 101 deletions

View File

@@ -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 = &copy
}
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))