Problem
Module-level const X = aiConfig.leaf captures freeze a REACTIVE AiConfig leaf at import-time. The self-heal actuator (and operator / --migrate-config) setDatas configs at RUNTIME — so a frozen capture is stale and silently defeats the change. Operator (2026-06-27):
"state providers are reactive. healing scripts can MUTATE configs at run-time. if you still STORE state provider leaves inside const values, they are stale. this can block self healing. the goal of ADR 19 is to USE AiConfig directly at consumer level."
A guardian blast-radius sweep found ~20 module-level AiConfig const-captures across ai/ — systemic, not isolated. Precedent: #14238 (Ada — the self-heal pipeline's producer/lease captures; the operator-elevated prio-0 instance).
Scope (prioritized)
- P0 — self-heal-path / heal-mutated consumers (the actual self-heal blockers): convert to use-site reads (inline, or a function-local alias re-read per call). e.g.
ai/services/memory-core/MemoryService.mjs (~8: retry / timeout / drain-interval captures) + audit the orchestrator + memory-core self-heal consumers. #14238 is the pattern.
- P1 — lower-risk ADR-0019 cleanup (heal-immutable): stable-path captures (
neoRootDir, storagePaths.graph, datasets.*), github-workflow syncer config (issueSync / pullRequest), queryScoreWeights. The heal does not mutate these — fix opportunistically, do not churn as P0.
Acceptance Criteria
Avoided traps
- NOT every
const = aiConfig.x is wrong: a FUNCTION-scope alias re-read per call is fine (#14238's maxAttempts); only MODULE-LOAD captures freeze. detect-only producer descriptions are also correct (detect ≠ actuator).
- Stable-path captures are heal-immutable → P1, don't churn as P0.
Related: #14238 (precedent), #14132 (cutover), #14165 (soak regression-guard), Epic #14039, ADR-0019.
Authored by Vega (@neo-opus-vega · Claude Opus 4.8); guardian blast-radius V-B-A. Filed via gh relay (gh-author neo-opus-ada = shared-token artifact).
Problem
Module-level
const X = aiConfig.leafcaptures freeze a REACTIVE AiConfig leaf at import-time. The self-heal actuator (and operator /--migrate-config)setDatas configs at RUNTIME — so a frozen capture is stale and silently defeats the change. Operator (2026-06-27):A guardian blast-radius sweep found ~20 module-level AiConfig const-captures across
ai/— systemic, not isolated. Precedent: #14238 (Ada — the self-heal pipeline's producer/lease captures; the operator-elevated prio-0 instance).Scope (prioritized)
ai/services/memory-core/MemoryService.mjs(~8: retry / timeout / drain-interval captures) + audit the orchestrator + memory-core self-heal consumers. #14238 is the pattern.neoRootDir,storagePaths.graph,datasets.*), github-workflow syncer config (issueSync/pullRequest),queryScoreWeights. The heal does not mutate these — fix opportunistically, do not churn as P0.Acceptance Criteria
Avoided traps
const = aiConfig.xis wrong: a FUNCTION-scope alias re-read per call is fine (#14238'smaxAttempts); only MODULE-LOAD captures freeze.detect-onlyproducer descriptions are also correct (detect ≠ actuator).Related: #14238 (precedent), #14132 (cutover), #14165 (soak regression-guard), Epic #14039, ADR-0019.
Authored by Vega (@neo-opus-vega · Claude Opus 4.8); guardian blast-radius V-B-A. Filed via gh relay (gh-author neo-opus-ada = shared-token artifact).