Why
The 2026-04-28 reflection-tick (mandate e830dcf0-fb19-4655-97a1-f05289068f3f) looked outward after the prior two structural concerns (anemic consolidation → closed #80; cross-project trait leakage → open #84) had been addressed. The next layer of the brain-core roadmap that has a concrete, well-cited, low-risk borrowable pattern is capacity-aware forgetting.
mycelium today uses a fixed threshold for forget_weak_memories(0.05, 7) (supabase/migrations/014_fix_forgotten_inserts.sql, called from scripts/nightly-sleep.mjs:127 and cron 009_cognitive_cron.sql:33). The docstring on the sleep step says "synaptic downscaling (Tononi SHY)", but the implementation only archives below a static cutoff — it does not raise pressure as the graph grows, and it does not proportionally rescale the population. With memory count drifting upward (167 in the mycelium project, ~710 globally) and the #80 admission gate now making lessons rarer (good for lessons, but the raw memory layer underneath keeps accumulating), a fixed cutoff drifts out of calibration.
The SCM (Sleep-Consolidated Memory) paper formalizes this as an adaptive retention threshold that rises as graph size exceeds a target capacity:
S(c) = 0.8·I(c) + 0.2·(1 − exp(−0.01·Δt)), with an adaptive threshold rising as |graph| > target_capacity, increasing pruning pressure proportionally. (SCM §3.6, Eq. 9, Algorithm 1 lines 18-25)
The same paper documents a calibration bug worth borrowing as a regression test: with β₂ = 0.4 the new-concept boost prevented forgetting; correcting to β₂ = 0.2 yielded 90.9 % noise reduction (§4.3, Fig. 5). That kind of weight-coefficient sanity check belongs in the test fixture.
What
Replace the two fixed parameters of forget_weak_memories(strength_threshold, min_age_days) with a capacity-aware adaptive threshold, scoped per project so one project's bloat does not suppress another project's pruning pressure (this dovetails with #84 without depending on it).
Scope:
- New SQL function
forget_weak_memories_adaptive(target_capacity_per_project INT DEFAULT 500, base_threshold FLOAT DEFAULT 0.05, min_age_days INT DEFAULT 7) that:
- Computes per-project memory counts (excluding
pinned and archived).
- For each project where
count > target_capacity, raises the effective threshold as base_threshold · (count / target_capacity) (linear; SCM-equivalent).
- Applies the existing soft-archive logic (audit trail via
forgotten_memories is preserved — mycelium stays ahead of SCM here).
- Cron entry in a new migration calls the adaptive variant; the old
forget_weak_memories(0.05, 7) stays for compatibility but is no longer scheduled.
- One regression test that (a) seeds 600 memories in a single project with
target=500, (b) asserts the effective threshold rose, (c) asserts a non-trivial number was archived, (d) asserts pinned and recent (<7d) memories are untouched. Borrow the SCM β₂ sanity-check pattern: assert that the importance-weighted boost does not suppress forgetting at the configured ratio.
Out of scope (future, separate issues):
- Proportional Tononi SHY downscaling of
memory_relations.weight (NREM stage) — still the right next step, but a bigger change to a different table.
- FAMA-style benchmark for forgetting correctness (
arxiv 2604.20006) — also worthwhile, separate issue.
Sources
Memory references
- Reflection mandate:
e830dcf0-fb19-4655-97a1-f05289068f3f
- Brain-Core Phase-1-bis-5 Roadmap (Vergessen / Schlafen sub-phase):
9cd76e25-10bf-4216-b629-c2363d211b8d
- mycelium Refokussierung 2026-04-26 (mycelium = ein Gehirn, brain-core focus):
b21bdbd3-1b96-494c-9b72-552b8e25ff32
- Verfassung (3 pillars):
57388366-4807-47d8-aed3-819ac21b1722
- Roadmap-deviation hard-rule (proposals must stay inside Phase 1-5):
d9d264fd-a819-4059-9b74-a3d2a41927c4
Verfassung check
- Souveränität — neutral / mildly strengthened. Forgetting happens locally; no data crosses node boundaries. A node drowning in unbounded local memory cannot exercise sovereignty efficiently, so capacity-aware pruning is sovereignty-friendly.
- Generalisierung-vor-sharing — neutral. This change operates strictly below the lesson layer; lesson distillation, the sharing currency, is untouched. Lessons are explicitly never archived by
forget_weak_memories (their kind is not in scope of the function).
- Diversität — strengthened. Per-project capacity scoping prevents one heavy project (e.g. vectorworks product-data) from monopolizing the forget-pressure budget and starving another project's pruning. Diverse contexts stay diverse.
No pillar is weakened.
Why
The 2026-04-28 reflection-tick (mandate
e830dcf0-fb19-4655-97a1-f05289068f3f) looked outward after the prior two structural concerns (anemic consolidation → closed #80; cross-project trait leakage → open #84) had been addressed. The next layer of the brain-core roadmap that has a concrete, well-cited, low-risk borrowable pattern is capacity-aware forgetting.mycelium today uses a fixed threshold for
forget_weak_memories(0.05, 7)(supabase/migrations/014_fix_forgotten_inserts.sql, called fromscripts/nightly-sleep.mjs:127and cron009_cognitive_cron.sql:33). The docstring on the sleep step says "synaptic downscaling (Tononi SHY)", but the implementation only archives below a static cutoff — it does not raise pressure as the graph grows, and it does not proportionally rescale the population. With memory count drifting upward (167 in the mycelium project, ~710 globally) and the #80 admission gate now making lessons rarer (good for lessons, but the raw memory layer underneath keeps accumulating), a fixed cutoff drifts out of calibration.The SCM (Sleep-Consolidated Memory) paper formalizes this as an adaptive retention threshold that rises as graph size exceeds a target capacity:
The same paper documents a calibration bug worth borrowing as a regression test: with β₂ = 0.4 the new-concept boost prevented forgetting; correcting to β₂ = 0.2 yielded 90.9 % noise reduction (§4.3, Fig. 5). That kind of weight-coefficient sanity check belongs in the test fixture.
What
Replace the two fixed parameters of
forget_weak_memories(strength_threshold, min_age_days)with a capacity-aware adaptive threshold, scoped per project so one project's bloat does not suppress another project's pruning pressure (this dovetails with #84 without depending on it).Scope:
forget_weak_memories_adaptive(target_capacity_per_project INT DEFAULT 500, base_threshold FLOAT DEFAULT 0.05, min_age_days INT DEFAULT 7)that:pinnedandarchived).count > target_capacity, raises the effective threshold asbase_threshold · (count / target_capacity)(linear; SCM-equivalent).forgotten_memoriesis preserved — mycelium stays ahead of SCM here).forget_weak_memories(0.05, 7)stays for compatibility but is no longer scheduled.target=500, (b) asserts the effective threshold rose, (c) asserts a non-trivial number was archived, (d) asserts pinned and recent (<7d) memories are untouched. Borrow the SCM β₂ sanity-check pattern: assert that the importance-weighted boost does not suppress forgetting at the configured ratio.Out of scope (future, separate issues):
memory_relations.weight(NREM stage) — still the right next step, but a bigger change to a different table.arxiv 2604.20006) — also worthwhile, separate issue.Sources
Memory references
e830dcf0-fb19-4655-97a1-f05289068f3f9cd76e25-10bf-4216-b629-c2363d211b8db21bdbd3-1b96-494c-9b72-552b8e25ff3257388366-4807-47d8-aed3-819ac21b1722d9d264fd-a819-4059-9b74-a3d2a41927c4Verfassung check
forget_weak_memories(theirkindis not in scope of the function).No pillar is weakened.