Skip to content

feat: analyst insights batch 2 — 20 new individual player rules#245

Merged
saggacce merged 2 commits into
mainfrom
feat/analyst-insights-batch2
May 31, 2026
Merged

feat: analyst insights batch 2 — 20 new individual player rules#245
saggacce merged 2 commits into
mainfrom
feat/analyst-insights-batch2

Conversation

@saggacce

Copy link
Copy Markdown
Owner

Implementa 20 nuevas reglas de análisis individual para jugadores (Batch 2).

Nuevas reglas

Riesgo y muertes (event stream)

  • `rule-first-death-rate-{id}` — jugador que muere primero ≥40% de partidas
  • `rule-early-death-rate-{id}` — muertes antes de 10min en ≥35% de partidas
  • `rule-death-before-obj-player-{id}` — muere antes de objetivo mayor ≥30%

Visión individual

  • `rule-low-vision-share-{id}` — contribución de wards < 60% del esperado por rol
  • `rule-low-ward-clear-share-{id}` — limpieza de wards < 55% del esperado por rol
  • `rule-vision-drop-{id}` — bajón >30% en wards/min recientes vs histórico
  • `rule-positive-vision-improvement-{id}` ✅ — mejor mejora en visión

Objetivos y estructuras (usa totalDamageDealtToObjectives/Structures)

  • `rule-low-objective-dmg-share-{id}` — daño a objetivos < 50% del esperado por rol
  • `rule-low-structure-dmg-share-{id}` — daño a estructuras < 50% del esperado por rol
  • `rule-no-objective-impact-after-lead-{id}` — ventaja de oro sin convertir en objetivos
  • `rule-high-objective-impact-{id}` ✅ — mejor impacto en objetivos
  • `rule-high-structure-pressure-{id}` ✅ — mejor presión a estructuras

Eficiencia y recursos

  • `rule-high-gold-low-kp-{id}` — mucho oro, baja kill participation
  • `rule-high-gold-high-death-{id}` — mucho oro y muchas muertes
  • `rule-positive-efficiency-{id}` ✅ — mejor ratio impacto/recursos

Farm y economía (por rol)

  • `rule-low-cs-role-{id}` — CS < 65% del esperado para su rol
  • `rule-cs-drop-{id}` — bajón >25% de CS en partidas recientes
  • `rule-positive-farm-consistency-{id}` ✅ — farm consistente y estable

Hero pool y draft

  • `rule-low-hero-pool-depth-{id}` — pool limitado (<3 héroes con ≥3 partidas)
  • `rule-comfort-overreliance-{id}` — dependencia excesiva de un héroe

Todas las reglas con texto EN/ES. Solo para equipos propios (no rival). Umbrales por rol donde aplica (support excluido de CS/objective damage).

Add 20 new analyst insight rules for individual players (I1–I20):
vision share, ward clears, objective/structure damage, CS, hero pool depth,
first-death/early-death/pre-objective death rates, gold efficiency, and
comfort overreliance. Includes EN/ES strings for all rules.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f2a5ef7d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1264 to +1266
const playerEventMatches = eventMatchIds.filter((mid) =>
heroKills.some((k) => k.matchId === mid && (k.killedPlayerId === playerId || k.killerPlayerId === playerId)),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use played matches for first-death denominator

When a roster player played an event-stream match but had no hero kill or death in that match, this filters the match out of the denominator because it keys participation off heroKills involvement instead of the player's MatchPlayer row. That inflates fdPct for low-death/assist-only games; for example, 2 first deaths across 10 played matches can be reported as 40% if the player only had kills/deaths in 5 of them, incorrectly triggering this insight.

Useful? React with 👍 / 👎.

Comment on lines +1845 to +1850
const winRates = Object.entries(heroStats)
.map(([slug, v]) => {
const s = v as Record<string, unknown>;
const wins = (s?.wins as number) ?? 0;
const matches = (s?.matches as number) ?? 0;
return { slug, wr: matches > 0 ? wins / matches : 0 };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read hero slugs from snapshot heroData

Player snapshots store heroStats as an array of stat objects with the slug under heroData.slug (the sync code builds that shape), so Object.entries(heroStats) yields array indexes like "0", "1", etc. instead of hero slugs. In the comfort-overreliance rule, winRates.includes(topHero[0]) therefore never recognizes that the most-played hero is already top-3 by win rate, causing false overreliance insights whenever a player repeats a strong hero in at least 60% of recent games.

Useful? React with 👍 / 👎.

@saggacce saggacce merged commit a8b594d into main May 31, 2026
3 checks passed
@saggacce saggacce deleted the feat/analyst-insights-batch2 branch May 31, 2026 17:19
saggacce added a commit that referenced this pull request Jun 8, 2026
* docs: sync planning — Tareas 30 y 31 completas, PRs #237-#245

* docs: complete batch2 insights catalog — implemented + pending rules
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.

1 participant