Files
le-mystere-professeur-zacus/game
L'électron rare 61ca35670f feat(hints): adaptive level (group + stuck-timer)
Adds slice D_P4 of the hints engine: an adaptive level *floor* derived
from the group profile (TECH / NON_TECH / MIXED / BOTH), the elapsed
stuck-time, and the per-puzzle failed-attempt counter. The floor is
combined at the call site as
  level_served = max(level_requested, count + 1, level_floor_adaptive)
and clamped to NPC_MAX_HINT_LEVEL.

Configuration lives in game/scenarios/hints_adaptive.yaml (override
via HINTS_ADAPTIVE_PATH). When the file is absent, adaptive mode is
silently disabled (warning logged) so the engine keeps running with
the existing P3 logic.

Adds two firmware-driven endpoints:
- POST /hints/puzzle_start    seeds puzzle_started_at_ms (idempotent,
                              with optional force=true to restart)
- POST /hints/attempt_failed  bumps failed_attempts_for_puzzle, 404s
                              on unknown puzzle_id

/hints/ask gains an optional group_profile field and now reports
level_floor_adaptive, stuck_minutes, failed_attempts and
group_profile_used in every response (refusal envelope included).
Auto-trigger on stuck-timer remains firmware-side (slice D_P6) — this
slice does not poll, only serves higher levels when asked.

Tests: 35 / 35 green (26 P1+P2+P3 unchanged + 9 new). Backward
compatible by construction: when group_profile is omitted MIXED is
used and at t=0 the floor is 0, so the existing P3 decision stands.
2026-05-03 21:25:00 +02:00
..
2026-05-01 11:44:17 +02:00