Authored by Claude Opus 4.7 (Claude Code 1M). Origin Session ID: ba55de70-c601-448e-9eb4-9c214be1d9c6. Sub of #12101 (parent Epic).
Context
Post-Stage-3/4 cleanup. By this stage, ZERO consumers of Env.parseX() from src/util/Env.mjs should remain (Stages 3 + 4 migrated them all to AiConfig.X.Y Proxy-routed reads). Stage 5 retracts the consumer-facing surface + deletes the regression-as-doctrine JSDoc.
The Problem
src/util/Env.mjs currently exports parseBool / parseNumber / parsePort / parseString / parseUrl / parseKeepAlive / applyEnvBindings as a public consumer API. JSDoc at lines 18-19 + line 128 institutionalizes the regression as canonical:
"The canonical 2-value chain is Env.parseX('NEO_X') ?? AiConfig.X — the env var name appears ONCE per consumer call site."
This documented pattern drove the accretion across multiple agent cycles per Epic #12101 Problem statement.
The Architectural Reality
Post-Stage-1: Env.parsers typed-parser registry lives inside BaseConfig's scope; parsers are internal. Stage 4 codemod migrated all consumer-side Env.parseX() calls to AiConfig.X.Y direct reads. By Stage 5, only BaseConfig itself uses Env.parseX internally.
The Fix
- Retract
parseBool / parseNumber / parsePort / parseString / parseUrl / parseKeepAlive consumer-facing exports — move to BaseConfig-internal scope (or keep as Env.parsers typed-parser registry per Stage 1 OQ5).
- Delete
applyEnvBindings default export (no remaining callers).
- Delete consumer-pattern JSDoc anti-doctrine on lines 18-19, 128 — the
Env.parseX('NEO_X') ?? AiConfig.X framing was the regression-as-doctrine.
- Replace top-of-file JSDoc with new framing: "Internal parser registry for Neo.ai.BaseConfig; not consumer-facing. Consumers read
AiConfig.X.Y via Provider-extending substrate."
Acceptance Criteria
Out of Scope
- Legacy
applyEnv() path deletion in BaseConfig.mjs (Stage 6 owns)
- Parser-registry mechanism (Stage 1 decides location per OQ5)
Related
- Parent Epic: #12101
- Blocked by: Stage 3 + Stage 4 (all consumers migrated)
- Discussion: #12100 Stage 5 v14
Handoff Retrieval Hints: query_raw_memories("Stage 5 Env.mjs retraction consumer-facing") + grep Env\.parse in ai test post-Stage-4-merge to verify zero consumers
Authored by Claude Opus 4.7 (Claude Code 1M). Origin Session ID:
ba55de70-c601-448e-9eb4-9c214be1d9c6. Sub of #12101 (parent Epic).Context
Post-Stage-3/4 cleanup. By this stage, ZERO consumers of
Env.parseX()fromsrc/util/Env.mjsshould remain (Stages 3 + 4 migrated them all toAiConfig.X.YProxy-routed reads). Stage 5 retracts the consumer-facing surface + deletes the regression-as-doctrine JSDoc.The Problem
src/util/Env.mjscurrently exportsparseBool/parseNumber/parsePort/parseString/parseUrl/parseKeepAlive/applyEnvBindingsas a public consumer API. JSDoc at lines 18-19 + line 128 institutionalizes the regression as canonical:This documented pattern drove the accretion across multiple agent cycles per Epic #12101 Problem statement.
The Architectural Reality
Post-Stage-1:
Env.parserstyped-parser registry lives insideBaseConfig's scope; parsers are internal. Stage 4 codemod migrated all consumer-sideEnv.parseX()calls toAiConfig.X.Ydirect reads. By Stage 5, only BaseConfig itself usesEnv.parseXinternally.The Fix
parseBool/parseNumber/parsePort/parseString/parseUrl/parseKeepAliveconsumer-facing exports — move to BaseConfig-internal scope (or keep asEnv.parserstyped-parser registry per Stage 1 OQ5).applyEnvBindingsdefault export (no remaining callers).Env.parseX('NEO_X') ?? AiConfig.Xframing was the regression-as-doctrine.AiConfig.X.Yvia Provider-extending substrate."Acceptance Criteria
parseBool/parseNumber/parsePort/parseString/parseUrl/parseKeepAliveconsumer-facing exports retracted fromsrc/util/Env.mjs.applyEnvBindingsdefault export deleted (verify zero remaining callers viagrep "applyEnvBindings" ai test src --include="*.mjs").Out of Scope
applyEnv()path deletion in BaseConfig.mjs (Stage 6 owns)Related
Handoff Retrieval Hints:
query_raw_memories("Stage 5 Env.mjs retraction consumer-facing")+ grepEnv\.parseinai testpost-Stage-4-merge to verify zero consumers