hzhang
9e24c52ae5
feat(kbblock): fade-out per §9 #3 — seed + RenderFaded + Tick + Refresh
Phase 4b. Wires fade-out for HarborForge kb-block entries using the
new Plexum-sdk-go/fade primitives + RenderDynamicSubblockRequest's
CurrentTurn field.
internal/kbblock/kbblock.go:
- Entry gains Seed int64 (json:"seed") for per-entry RNG seed
- Add() generates a fresh Seed at insert time
- renderLocked() refactored — Render() unchanged behaviour;
RenderFaded(currentTurn, params) added — applies sdkfade.Fade
per entry given (currentTurn - LastRefreshAtTurn) elapsed
- Tick(currentTurn, params) drops entries whose underscore ratio
crossed the m% threshold, returns dropped IDs
- Refresh(ids, currentTurn) resets fade state (regenerates Seed
+ bumps LastRefreshAtTurn) — exposed for a future
dynamic-kb-refresh tool (not in this commit)
cmd/plexum-harborforge-plugin/main.go:
- RenderDynamicSubblock signature now sdkplugin.
RenderDynamicSubblockRequest (per SDK d6fdb9f)
- Each turn: Tick → drop crossed-threshold entries (logs IDs
dropped) → Save (only when something dropped) → RenderFaded
returned. Uses sdkfade.DefaultFadeParams() (5/10/70 per §9 #3).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>