---
id: 12545
title: Drop orphaned Memory Core backupRetention leaf
state: CLOSED
labels:
  - enhancement
  - ai
  - refactoring
  - architecture
assignees:
  - neo-gpt
createdAt: '2026-06-04T21:09:00Z'
updatedAt: '2026-06-05T13:59:51Z'
githubUrl: 'https://github.com/neomjs/neo/issues/12545'
author: neo-gpt
commentsCount: 0
parentIssue: 12461
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2026-06-05T13:59:51Z'
---
# Drop orphaned Memory Core backupRetention leaf

## Context

PR #12542 completes #12541 by moving the maintenance backup/defrag retention resolvers to direct ADR-0019-aligned reads from the top-level maintenance subtree:

```js
aiConfig.maintenance.backup.retention
aiConfig.maintenance.defrag.snapshotRetention
```

That resolves the B3 optional-chain / fallback cleanup, but it leaves a non-blocking follow-up: after #12542 merges, the Memory Core `backupRetention` config leaf is no longer consumed by `backup.mjs`.

V-B-A before filing:
- PR #12542 is `APPROVED`, `CLEAN`, and all checks green at `f0223ce60`.
- On the #12542 branch, `rg -n "backupRetention|memoryCoreConfig\.backupRetention|resolveBackupRetention" ai/scripts/maintenance/backup.mjs ai/mcp/server/memory-core/config.mjs ai/mcp/server/memory-core/config.template.mjs test/playwright/unit/ai/scripts/maintenance/backup-retention.spec.mjs learn` shows the runtime resolver now reads `resolveBackupRetention()` from top-level maintenance config; remaining `backupRetention` references are Memory Core config/template declarations and stale test commentary.
- `gh issue list --state all --search "backupRetention orphan Memory Core config leaf"` returned no equivalent issue.
- `gh pr list --state open --search "backupRetention Memory Core maintenance AiConfig"` returned only #12542, not a cleanup PR.
- `ask_knowledge_base(type='ticket', query='backupRetention Memory Core maintenance orphan AiConfig ticket')` surfaced historical #11663 context, not an active duplicate.

## Problem

Once #12542 lands, `ai/mcp/server/memory-core/config.mjs` and `config.template.mjs` still advertise `backupRetention`, but the only live backup retention reader has moved to `aiConfig.maintenance.backup.retention`.

Keeping the Memory Core leaf after its reader is removed creates a misleading operator config surface: an operator can set `memoryCore.backupRetention` and reasonably expect it to affect bundle retention, but the maintenance resolver will no longer consult it.

## Architectural Reality

The maintenance backup policy now belongs to the top-level AI maintenance subtree. Memory Core still owns storage paths, Chroma coordinates, graph paths, and service-specific config. It should not retain a dead backup policy leaf after bundle retention is governed by the maintenance subtree.

This ticket is dependent on #12542. Before #12542 merges, `dev` still contains the old fallback reader, so implementation must wait for the approved PR to land or else branch from a post-merge `dev`.

## Fix

After #12542 is merged to `dev`:

1. Remove the `backupRetention` leaf from:
   - `ai/mcp/server/memory-core/config.mjs`
   - `ai/mcp/server/memory-core/config.template.mjs`
2. Update touched test/commentary surfaces so they no longer describe deployments without `backupRetention` as a live Memory Core config mode.
3. Verify no tracked runtime/source docs still imply `memoryCoreConfig.backupRetention` controls bundle retention.

Do not add a new fallback, alias, or migration shim. The top-level maintenance subtree is the source of truth.

## Contract Ledger

| Target Surface | Source of Authority | Proposed Behavior | Fallback | Docs / Commentary | Evidence |
| --- | --- | --- | --- | --- | --- |
| `aiConfig.maintenance.backup.retention` | Top-level AI config maintenance subtree | Remains the bundle retention policy consumed by `backup.mjs` | None | Existing maintenance config JSDoc | #12542 direct-read diff + tests |
| `memoryCoreConfig.backupRetention` | Memory Core config/template | Removed after its reader disappears | None | Remove stale mentions from touched runtime/test commentary | `rg` shows no remaining runtime reader after #12542 |
| Operator local config expectation | Config template + source comments | No dead leaf that appears configurable but is ignored | None | Template no longer advertises the leaf | Focused source grep after removal |

## Decision Record Impact

Aligned with ADR 0019: consumed config must have a single source of truth, and missing config should fail loudly at the direct resolved-leaf read site. This ticket removes a dead secondary config source rather than preserving a dual-source fallback.

## Acceptance Criteria

- [ ] #12542 has merged before implementation begins, or the implementation branch is explicitly based on post-#12542 `dev`.
- [ ] `backupRetention` is removed from `ai/mcp/server/memory-core/config.mjs` and `ai/mcp/server/memory-core/config.template.mjs`.
- [ ] No tracked runtime source still reads or documents `memoryCoreConfig.backupRetention` as a bundle retention control. Historical `resources/content/**` archives may remain unchanged.
- [ ] Existing maintenance backup retention behavior remains governed by `aiConfig.maintenance.backup.retention`.
- [ ] Focused maintenance retention tests still pass.
- [ ] `npm run ai:lint-config-template-ssot` still passes.

## Out of Scope

- Changing retention defaults.
- Changing backup bundle semantics or atomic-bundle behavior.
- Reworking historical issue/PR archive content under `resources/content/**`.
- Implementing before #12542 lands.

## Related

- Parent: #12461
- Prerequisite PR: #12542
- Source ticket: #12541
- Historical origin: #11663
- ADR: `learn/agentos/decisions/0019-aiconfig-reactive-provider-ssot.md`

## Origin Session ID

`dcdaac0b-9ae0-45b5-b4da-da39541af497`

## Retrieval Hint

`backupRetention Memory Core maintenance orphan AiConfig #12542 f0223ce60`

## Timeline

- 2026-06-04T21:09:02Z @neo-gpt added the `enhancement` label
- 2026-06-04T21:09:02Z @neo-gpt added the `ai` label
- 2026-06-04T21:09:02Z @neo-gpt added the `refactoring` label
- 2026-06-04T21:09:03Z @neo-gpt added the `architecture` label
- 2026-06-04T21:09:16Z @neo-gpt added parent issue #12461
- 2026-06-05T04:03:25Z @neo-gpt assigned to @neo-gpt
- 2026-06-05T04:08:24Z @neo-gpt cross-referenced by PR #12559
- 2026-06-05T13:59:52Z @tobiu referenced in commit `489c448` - "fix(ai): drop orphaned backupRetention config leaf (#12545) (#12559)"
- 2026-06-05T13:59:52Z @tobiu closed this issue

