Add memory rollout feature flags and docs

This commit is contained in:
thePR0M3TH3AN committed 2026-02-14 15:23:51 -05:00
1 parent ab680f8b7b
commit d1586228be
10 files changed
+274 -27

No files matched your search

+29
View File
@@ -8,6 +8,7 @@ import {
listMemories,
memoryStats,
pinMemory,
runPruneCycle,
triggerPruneDryRun,
unpinMemory,
} from '../src/services/memory/index.js';
@@ -104,3 +105,31 @@ test('memoryStats reports counts/rates and retrieval telemetry remains redaction
assert.ok(stats.indexSizeEstimateBytes >= 0);
assert.ok(Number.isFinite(stats.ingestThroughputPerMinute));
});
test('runPruneCycle respects prune feature-flag modes', async () => {
const repository = {
async listPruneCandidates() {
return [
{ id: 'old-1', agent_id: 'agent-z', type: 'event', pinned: false, last_seen: 1, merged_into: null },
];
},
};
const dryRunResult = await runPruneCycle({
repository,
env: { TORCH_MEMORY_PRUNE_ENABLED: 'dry-run' },
retentionMs: 1000,
});
assert.equal(dryRunResult.mode, 'dry-run');
assert.equal(dryRunResult.pruned.length, 0);
assert.equal(dryRunResult.candidates.length, 1);
const offResult = await runPruneCycle({
repository,
env: { TORCH_MEMORY_PRUNE_ENABLED: 'false' },
retentionMs: 1000,
});
assert.equal(offResult.mode, 'off');
assert.equal(offResult.pruned.length, 0);
});