mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-09 05:24:49 +09:00
`return default` gave every caller the same object the caller passed in, and callers do mutate what they get back (git_service, build_service and monitoring_service all assign into it). No caller is actually bitten today -- all six construct a fresh literal at the call site -- so this hardens the shared helper rather than repairing a live leak. That matters because config_store is the one door the remaining hand-rolled copies are meant to converge on, and the next adopter is the one that would pass a module-level default. Deep, not shallow: several defaults nest mutable dicts (backup_service's notifications, security_service's scheduled_scan) that a shallow copy would still alias. The test mutates through both a top-level list and a nested dict for that reason -- it fails against `return default` AND against `copy.copy(default)`. Reported by Copilot on the plan-75 PR. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>