Repository navigation
docs(graph): pin what an edge's age means, and record why F42 is not a leak - #185
Merged
Merged
Conversation
…a leak
F42 claimed the 30-day NREM prune starves: the upsert refreshes `created_at`, so
a dead edge never reaches the stale band and never dies. The mechanism is real —
a 40-day edge that inhibition drove to weight 0 gets a fresh age when its miner
re-derives it at full strength — but the live bases do not show the starvation.
Measured 2026-11-03 (report: .compose/reports/2026-11-03-f42-dryrun.md), Hermes
dead heuristic edges: 56 650 inside the 25-30 d band, 189 just past 30 d, none
beyond. CowAgent 1 765 / 2 / 0. The boundary is crossed in batches and cleared
on the next NREM pass, so pruning lags by up to one pass rather than starving. A
single "0 past 30 d" reading is a moment, not a property: eight minutes later the
same base read 189.
What is actually wrong is semantic. `created_at` means the edge's birth or its
last WEIGHT-INCREASING re-derivation, whichever is later, and there is no way to
recover the birth: `valid_from` is NULL on all 416 113 / 291 152 / 91 002 rows of
the three bases. That is now written down and pinned instead of implied.
- `_insert_edge` docstring: the contract, the measurement, and the explicit
note that changing it is a product decision (every re-derived edge would
start decaying 30 days after first sighting), not a bugfix.
- module docstring: drops "all inserts are INSERT OR IGNORE — re-runs are
no-ops", which the audit flagged as false and which the new contract
contradicts.
- test `test_remine_after_inhibition_refreshes_the_edge_age` pins all four
cases: stronger refreshes the age, equal is a no-op, weaker is a no-op, a
second stronger write moves it again.
One anomaly is recorded, not explained: Mimocode holds 120 dead
`heuristic:tokens` edges at 44.7 d, all stamped within ~0.9 s on 2026-09-19. A
skipped NREM pass over that boundary would explain it, but that is a hypothesis
about that base's schedule, not something these rows prove.
No behaviour changes: the AST is identical to the base aside from docstrings.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что
F42 утверждал, что 30-дневный prune голодает: upsert обновляет
created_at, поэтому мёртвое ребро никогда не доходит до stale-полосы и не умирает.Механизм реален. Репро реальной
_insert_edgeна чистой базе: ребро 40 дней, ингибирование в 0, пересборка на 0.8 →rows_written=1, возраст 0.00 d. Равный и слабый повтор — настоящий no-op.Голодания в данных нет. Замер 2026-11-03, мёртвые heuristic-рёбра:
Граница переходит пачками и чистится на следующем проходе NREM: prune отстаёт максимум на один проход, а не голодает. Одно чтение «0 за 30 дней» — момент, а не свойство: через 8 минут та же база дала 189.
Аудит обещал «~130k перезаписей/ночь» и голодание; измерено 39 251 перезапись в сутки, из них мёртвых 51.
Что реально не так
Семантика.
created_at— это рождение ребра или последняя строго усиливающая пересборка, что позже. Независимого рождения нет:valid_fromпуст у 100% строк во всех трёх базах (416 113 / 291 152 / 91 002). Это теперь записано и запинено, а не подразумевается._insert_edge: контракт + замер + прямая оговорка, что смена поведения (ребро начнёт затухать через 30 дней после первого появления) — продуктовое решение, а не багфикс;Аномалия, зафиксирована без объяснения
Mimocode держит 120 мёртвых
heuristic:tokensна 44.7 д, все проштампованы в пределах ~0.9 с 2026-09-19. Пропуск NREM через границу объяснил бы это, но это гипотеза о расписании той базы — в отчёте она помечена как гипотеза, не как факт.Изменений поведения нет
AST идентичен базе после удаления докстрингов — проверено.
Проверка
Отчёт с замерами: локальный
.compose/reports/2026-11-03-f42-dryrun.md.