feat(level-migrate): give semi_abstract an exit, and stop demoting pinned rows - #33
Merged
Merged
Conversation
…nned rows semi_abstract was terminal. Rows arrived from meta_knowledge and never left, so an entry that stopped being useful kept competing at recall weight 1.0 with live ones, forever. Measured on a 10k-row store: 1,276 rows past 30 days with zero recalls sitting in semi, against 78 in concrete_trace — nothing demoted into it, only promoted out. Three changes. 1. Second stage: semi_abstract -> concrete_trace at <=2 recalls and >90 days. Deliberately stricter than the stage above it (>30d and zero). Reusing that arm would cascade a row meta -> semi -> concrete inside a single night, which is not ageing, it is deleting by ladder. Surviving 90 days on two recalls is the evidence this asks for. Dry run on the live store: 475 rows move, against 37 for the existing arm — the backlog, drained once, then a trickle. 2. is_anchor / is_pinned are exempt from demotion. Both flags mean "keep this surfaced", set by hand against a quota, and the nightly job was overruling them silently — the flag stays set while the weight it was meant to guarantee drops. Demotion only; promotion still applies, since raising a pinned row never contradicts the pin. Pre-existing on the meta arm, and adding a second demotion without fixing it would have doubled the exposure. 3. Direction is now judged by level rank. The tally read `old_level === 'meta_knowledge' ? demoted : promoted`, correct only while meta was the sole source of demotions; semi -> concrete would have been counted as a promotion and the nightly report would have shown the ladder running backwards. Test covers the new stage, both exemptions, the one-step-per-run brake, that a 40d semi is untouched (the 30d arm stays meta-only), continued descent on a later run, and the direction counting. 306 passed / 0 failed. Co-authored-by: 千夏 <qianxia@clawgamers.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The sink
semi_abstractwas terminal. Rows arrived frommeta_knowledgeand never left, so an entry that stopped being useful kept competing at recall weight 1.0 with live ones, forever.Measured on a 10k-row store:
Three changes
1. Second stage —
semi_abstract → concrete_traceat≤2 recalls && >90 days.Deliberately stricter than the stage above it (
>30d && 0). Reusing that arm would cascade a rowmeta → semi → concreteinside a single night — that is not ageing, it is deleting by ladder. Surviving 90 days on two recalls is the evidence this asks for.Dry run on the live store:
2.
is_anchor/is_pinnedare exempt from demotion.Both flags mean "keep this surfaced", set by hand against a quota. The nightly job was overruling them silently — the flag stays set while the weight it was meant to guarantee drops. Demotion only; promotion still applies, since raising a pinned row never contradicts the pin.
Pre-existing on the meta arm. Adding a second demotion without fixing it would have doubled the exposure.
3. Direction judged by level rank. The tally read
old_level === 'meta_knowledge' ? demoted : promoted— correct only while meta was the sole source of demotions.semi → concretewould have counted as a promotion, and the nightly report would have shown the ladder running backwards.Test
New stage · both exemptions · the one-step-per-run brake · a 40d semi untouched (the 30d arm stays meta-only) · continued descent on a later run · direction counting.
306 passed / 0 failed. Added to CI.
🤖 Generated with Claude Code