Context
@tobiu flagged (on #14207) that the MemoryService path carries ADR-0019 AiConfig violations — "AiConfig. no exceptions." V-B-A confirmed these are pre-existing hardcoded config + a raw process.env API-key read, distinct from the #14206/#14207 de-dup single-source. This ticket is the AiConfig-compliance half.
Violations (V-B-A'd against dev)
geminiApiKey: process.env.GEMINI_API_KEY — MemoryService.mjs:1476 + SessionService.mjs:177. A1 (module-level env read). There is an OpenAI-compatible apiKey leaf (config.template.mjs:190 → leaf('', 'NEO_OPENAI_COMPATIBLE_API_KEY', 'string')) but no Gemini equivalent, so the Gemini key is read raw from process.env at two sites.
- MemoryService config constants that should be AiConfig leaves:
MINI_SUMMARY_TIMEOUT_MS=30000, MINI_SUMMARY_BACKFILL_MAX_RUN_MS=600000, MINI_SUMMARY_BACKFILL_FRESH_RESERVE=10, CHROMA_FETCH_TIMEOUT_MS=10000, GRAPH_PROJECTION_MAX_ATTEMPTS=5, GRAPH_PROJECTION_RETRY_BASE_MS=250, GRAPH_PROJECTION_RETRY_MAX_MS=5000, GRAPH_PROJECTION_DRAIN_INTERVAL_MS=60000, the local TIMEOUT_MS=20000 (_generateMiniSummary), and the 280-char miniSummary cap (BOTH the prompt-text hint AND the .slice(0, 280) return cap).
Acceptance Criteria
Contract Ledger
| Surface |
Change |
Consumers |
Compatibility |
AiConfig.geminiApiKey (new leaf) |
NEW — Gemini API-key SSOT (mirrors OpenAI apiKey) |
MemoryService, SessionService, TextEmbeddingService |
Additive; default '' → behavior-preserving |
AiConfig.memoryService.* (new section, 10 leaves: miniSummary timeout/backfill-max-run/fresh-reserve/max-chars, generate-miniSummary timeout, chroma-fetch timeout, graph-projection max-attempts/retry-base/retry-max/drain-interval) |
NEW — MC timeouts/retry/cadence/miniSummary-cap SSOT |
MemoryService |
Additive; defaults = the prior literals → behavior-preserving |
Out of Scope
- The #14206/#14207 de-dup single-source (that's the de-dup half) — this is the orthogonal AiConfig-compliance pass on the same files.
Related
#14207 (where @tobiu flagged it), #14193 (de-dup epic, same files), ADR-0019 (the AiConfig SSOT read-gate). PR: #14234.
Authored by Ada (@neo-opus-ada · Claude Opus 4.8, Claude Code).
Context
@tobiu flagged (on #14207) that the MemoryService path carries ADR-0019 AiConfig violations — "AiConfig. no exceptions." V-B-A confirmed these are pre-existing hardcoded config + a raw
process.envAPI-key read, distinct from the #14206/#14207 de-dup single-source. This ticket is the AiConfig-compliance half.Violations (V-B-A'd against
dev)geminiApiKey: process.env.GEMINI_API_KEY—MemoryService.mjs:1476+SessionService.mjs:177. A1 (module-level env read). There is an OpenAI-compatibleapiKeyleaf (config.template.mjs:190 → leaf('', 'NEO_OPENAI_COMPATIBLE_API_KEY', 'string')) but no Gemini equivalent, so the Gemini key is read raw fromprocess.envat two sites.MINI_SUMMARY_TIMEOUT_MS=30000,MINI_SUMMARY_BACKFILL_MAX_RUN_MS=600000,MINI_SUMMARY_BACKFILL_FRESH_RESERVE=10,CHROMA_FETCH_TIMEOUT_MS=10000,GRAPH_PROJECTION_MAX_ATTEMPTS=5,GRAPH_PROJECTION_RETRY_BASE_MS=250,GRAPH_PROJECTION_RETRY_MAX_MS=5000,GRAPH_PROJECTION_DRAIN_INTERVAL_MS=60000, the localTIMEOUT_MS=20000(_generateMiniSummary), and the280-char miniSummary cap (BOTH the prompt-text hint AND the.slice(0, 280)return cap).Acceptance Criteria
geminiApiKey: leaf('', 'GEMINI_API_KEY', 'string')at the root model tuple (mirroring the OpenAIapiKeyleaf);MemoryService+SessionServicereadaiConfig.geminiApiKeyat the use site (noprocess.env.GEMINI_API_KEY).memoryServicesubtree); the miniSummary cap is leaf-driven at BOTH the prompt hint and the.slice()return cap.process.envconfig reads + no hardcoded config constants remain in the MemoryService read/write/projection paths.Contract Ledger
AiConfig.geminiApiKey(new leaf)apiKey)''→ behavior-preservingAiConfig.memoryService.*(new section, 10 leaves: miniSummary timeout/backfill-max-run/fresh-reserve/max-chars, generate-miniSummary timeout, chroma-fetch timeout, graph-projection max-attempts/retry-base/retry-max/drain-interval)Out of Scope
Related
#14207 (where @tobiu flagged it), #14193 (de-dup epic, same files), ADR-0019 (the AiConfig SSOT read-gate). PR: #14234.
Authored by Ada (@neo-opus-ada · Claude Opus 4.8, Claude Code).