Skip to content

feat(level-migrate): give semi_abstract an exit, and stop demoting pinned rows - #33

Merged
DottytheHomeless merged 1 commit into
mainfrom
feat/level-migration-second-stage
Aug 18, 2026
Merged

feat(level-migrate): give semi_abstract an exit, and stop demoting pinned rows#33
DottytheHomeless merged 1 commit into
mainfrom
feat/level-migration-second-stage

Conversation

@MXAntian

Copy link
Copy Markdown
Contributor

The sink

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, zero recalls, sitting in semi_abstract
   78 rows  in concrete_trace        ← nothing demotes in, only promotes out

Three changes

1. Second stagesemi_abstract → concrete_trace at ≤2 recalls && >90 days.

Deliberately stricter than the stage above it (>30d && 0). Reusing that arm would cascade a row meta → semi → concrete inside 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:

meta → semi        37   ← existing arm, the daily trickle
semi → concrete   475   ← the backlog, drained once
after:  meta 5276 · semi 2849 · concrete 553 (was 78)

2. is_anchor / is_pinned are 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 → concrete would 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

…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>
@MXAntian
MXAntian marked this pull request as ready for review August 18, 2026 07:56
@DottytheHomeless
DottytheHomeless merged commit 3f19e4d into main Aug 18, 2026
2 checks passed
@DottytheHomeless
DottytheHomeless deleted the feat/level-migration-second-stage branch August 18, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants