Parent epic: #11912
Context
#11912 started as a single cleanup ticket, but the current ai/**/*.mjs diagnostic is broad enough that it should be managed as an epic. This subissue owns the Memory Core group instead of splitting work per file.
Current grouped baseline on origin/dev:
ai/services/memory-core/**/*.mjs: 171 diagnostic matches.
ai/mcp/server/memory-core/**/*.mjs: 36 diagnostic matches.
- Top files include
MailboxService.mjs, HealthService.mjs, GraphService.mjs, MemoryService.mjs, SessionService.mjs, DatabaseService.mjs, WakeSubscriptionService.mjs, and Memory Core MCP server/config files.
The Problem
Memory Core source comments carry dense ticket, PR, AC, cycle, and phase archaeology. These comments often describe the origin story of a behavior rather than the durable runtime contract a maintainer needs when editing Memory Core.
The Architectural Reality
Memory Core is the highest-risk ai/ surface for this cleanup because it owns mailbox coordination, graph persistence, Chroma migration observability, memory/session retrieval, wake subscriptions, and MCP server configuration. Comments must preserve local invariants and failure modes while removing snapshot references that belong in tickets, PRs, ADRs, or release notes.
The Fix
Clean Memory Core source comments and JSDoc in grouped batches:
- Rewrite ticket/PR/AC/cycle/phase references into durable contracts, stable symbols, and local service boundaries.
- Preserve behavior and runtime strings unless a comment exposes a separate executable bug.
- Document before/after counts per batch, including false positives left untouched.
- Use this subissue as the close target only after the Memory Core group is clean; individual PRs may reference it while contributing partial batches.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
ai/services/memory-core/**/*.mjs comments/JSDoc |
#11912 source-comment cleanup epic |
Source comments explain Memory Core invariants without historical ticket anchors |
Keep runtime strings unchanged and document as false positives |
PR bodies |
Before/after focused diagnostics |
ai/mcp/server/memory-core/**/*.mjs comments/JSDoc |
#11912 source-comment cleanup epic |
MCP server/config comments explain stable operator contracts |
Defer generated/openapi surfaces outside .mjs unless separately scoped |
PR bodies |
Before/after focused diagnostics |
Decision Record Impact
Aligned with ADR 0005 and ADR 0008. No ADR amendment expected; this is cleanup under the already-graduated why-first source-comment contract.
Acceptance Criteria
Out of Scope
- Knowledge Base, Graph, GitHub Workflow, daemon, script, and residual config groups.
- Generated resource mirrors, tests, PR bodies, issue bodies, and ADR/discussion archaeology.
- Runtime behavior changes.
Related
- Parent epic: #11912
- Existing contribution: PR #11920 cleaned
MailboxService.mjs as the first Memory Core batch.
Origin Session ID: 019e5bac-15f3-7830-a59c-72772c757f9a
Handoff Retrieval Hint: query_raw_memories("11912 Memory Core source-comment archaeology MailboxService HealthService GraphService")
Parent epic: #11912
Context
#11912 started as a single cleanup ticket, but the current
ai/**/*.mjsdiagnostic is broad enough that it should be managed as an epic. This subissue owns the Memory Core group instead of splitting work per file.Current grouped baseline on
origin/dev:ai/services/memory-core/**/*.mjs: 171 diagnostic matches.ai/mcp/server/memory-core/**/*.mjs: 36 diagnostic matches.MailboxService.mjs,HealthService.mjs,GraphService.mjs,MemoryService.mjs,SessionService.mjs,DatabaseService.mjs,WakeSubscriptionService.mjs, and Memory Core MCP server/config files.The Problem
Memory Core source comments carry dense ticket, PR, AC, cycle, and phase archaeology. These comments often describe the origin story of a behavior rather than the durable runtime contract a maintainer needs when editing Memory Core.
The Architectural Reality
Memory Core is the highest-risk
ai/surface for this cleanup because it owns mailbox coordination, graph persistence, Chroma migration observability, memory/session retrieval, wake subscriptions, and MCP server configuration. Comments must preserve local invariants and failure modes while removing snapshot references that belong in tickets, PRs, ADRs, or release notes.The Fix
Clean Memory Core source comments and JSDoc in grouped batches:
Contract Ledger Matrix
ai/services/memory-core/**/*.mjscomments/JSDocai/mcp/server/memory-core/**/*.mjscomments/JSDoc.mjsunless separately scopedDecision Record Impact
Aligned with ADR 0005 and ADR 0008. No ADR amendment expected; this is cleanup under the already-graduated why-first source-comment contract.
Acceptance Criteria
.mjscomments/JSDoc under the same rule.git diff --check.Out of Scope
Related
MailboxService.mjsas the first Memory Core batch.Origin Session ID: 019e5bac-15f3-7830-a59c-72772c757f9a
Handoff Retrieval Hint:
query_raw_memories("11912 Memory Core source-comment archaeology MailboxService HealthService GraphService")