Hand checked processing selections to execution

This commit is contained in:
2026-11-16 14:18:38 +00:00
parent b1d1b8302c
commit e98e525b5c
19 changed files with 268 additions and 102 deletions

View File

@@ -91,12 +91,21 @@ func SharedVariables() map[string]string {
// WithSharedVariables fills missing Audita instruction variables without replacing caller values.
func WithSharedVariables(values map[string]string) map[string]string {
result := make(map[string]string, len(values)+3)
return mergeSharedVariables(values, false)
}
// ProcessingVariables uses the pipeline's instructions for shared variables.
func ProcessingVariables(values map[string]string) map[string]string {
return mergeSharedVariables(values, true)
}
func mergeSharedVariables(values map[string]string, authoritative bool) map[string]string {
result := make(map[string]string, len(values)+4)
for key, value := range values {
result[key] = value
}
for key, value := range SharedVariables() {
if _, exists := result[key]; !exists {
if _, exists := result[key]; authoritative || !exists {
result[key] = value
}
}