Files
archie/internal/app/archied/config_update.go
T
sam 5fa010c9c2 fix(plugin): add missing CLAUDE.md reference to plugin engine rule
Test TestPluginEngineRuleIsCanonicalAndSharedByAgentInstructions was
missing entirely, letting CLAUDE.md drift out of sync with
ARCHITECTURE.md#plugin-engine-rule-strict. Added the test and the
missing reference.
2026-08-31 21:25:20 +10:00

25 lines
977 B
Go

package archied
import (
"github.com/samcharles93/archie-core/internal/config"
"github.com/samcharles93/archie-core/internal/infrastructure/configuration"
"github.com/samcharles93/archie-core/internal/infrastructure/configuration/overlay"
)
// applyDottedOverlay decodes dotted-path updates into cfg. yaml cannot
// decode dotted keys ("budgets.max_steps" is not a struct field), so
// the updates are nested into a map first -- the same nesting the
// overlay store's Snapshot performs -- then decoded with the same
// field-level merge the file overlay uses. cfg must be a copy the
// caller owns (a Clone of the published config); it is never decoded
// into a published snapshot directly.
func applyDottedOverlay(cfg *config.Config, updates map[string]any) error {
nested := make(map[string]any)
for key, value := range updates {
if err := overlay.Nest(nested, key, value); err != nil {
return err
}
}
return configuration.ApplyOverlayValues(cfg, nested)
}