Files
foxhunt/docs/superpowers/specs
jgrusewski 9395b983cc spec(sp11): fix all 13 review issues — straight-up implementation
Critical bugs fixed:
1. Z-score formula: was mean(Δ)/mean(|Δ|), bounded to [-1,+1] — sigmoid
   never saturated, controller stuck in [0.27, 0.73]. Now true Z-score:
   delta_ema / sqrt(delta_var_ema) with two-pass var. Renamed canary
   slot 351 from VAL_SHARPE_STD_EMA to VAL_SHARPE_VAR_EMA.
2. Component weight renormalization added — Σweights = 1 enforced
   post-floor so PopArt's reward-magnitude EMA stays uncontaminated.
3. SABOTEUR_MIN bound violation — engagement-floor (0.1) was silently
   pulling output below 0.5 stated minimum. Added post-multiplication
   clamp to [SABOTEUR_MIN, SABOTEUR_MAX].
4. ratios[] undeclared — now __shared__ float ratios[6] block-loaded
   once from ISV.
5. §3.6 slot count off-by-five (15 → 20). All 20 slots get FoldReset
   entries; cold-start window behavior specified explicitly (no NaN path).

Architectural fixes:
6. Q-overconfidence concern addressed in scope — controller's
   REWARD_CF_WEIGHT_INDEX covers CQL conservatism. No SP11′ deferral;
   if T10 fails, extend controller outputs (e.g., target-update τ).
7. Curiosity recompute-at-replay specified (§3.5.1) — replay buffer
   stores base reward only; curiosity added per-tuple at replay time
   against current visit-count and current ISV. Eliminates stale-signal
   replay contamination that would worsen ep1-overfitting.

Smaller fixes:
8. Novelty signal specified — SimHash 42×16 projection → 16-bit code,
   1M-slot per-bucket count table, 1/sqrt(1+count). Hash table lives
   in state-reset registry (cleared at fold boundary).
9. Saboteur engagement operationally defined — per-bar
   |reward_with_saboteur − reward_without_saboteur| > EPS_ENGAGEMENT,
   block tree-reduce, EMA'd. EPS_ENGAGEMENT = 0.01 × PnL_EMA.
10. Duplicate sentence in §7 component-starvation paragraph removed.
11. Validation criteria strengthened (§9): aggregation across 9
    trajectories specified; primary metric = median peak-epoch ≥ 10
    (baseline median peak-epoch = 1); secondary = drop-from-peak ≤ 5%
    by ep20; tertiary = ep20 mean ≥ baseline ep1 mean. §9.3 fix-forward
    response codified — no rollback.
12. Phases split per project pattern — Layer A additive (3 commits:
    slots, canaries, controller), Layer B atomic consumer migration
    (1 commit, including replay-time curiosity), Layer C validation +
    close-out. No falsification gate; smoke is validation only.
13. Pearls A+D applied to controller outputs (§3.4.1) — chained
    apply_pearls_ad_kernel after controller writes scratch, smoothed
    values land in ISV. Consumers read smoothed slots.

Constants surviving (Invariant-1 anchors only, all rate-not-regime):
EPS_DIV, WEIGHT_HARD_FLOOR, SABOTEUR_MIN/MAX, CURIOSITY_PERMANENT_FRACTION,
CURIOSITY_BOUND_FRACTION, WEIGHT_FLOOR_FRACTION, ENGAGEMENT_FLOOR.

Spec is now full straight-up implementation; smoke validates Layer A
infrastructure and Layer B consumers, T10 validates SP11 success metric.
~1550 LOC across 3 commits in Layer A + 1 atomic commit in Layer B +
close-out in Layer C.
2026-05-04 00:20:25 +02:00
..