Skip to content

fix(mcp): non dirottare le domande concettuali "differenza tra X e Y" su un war report killboard#5

Merged
WilliamFalci merged 1 commit into
WilliamFalci:mainfrom
dedo1911:fix/conceptual-difference-intent
Jun 5, 2026
Merged

fix(mcp): non dirottare le domande concettuali "differenza tra X e Y" su un war report killboard#5
WilliamFalci merged 1 commit into
WilliamFalci:mainfrom
dedo1911:fix/conceptual-difference-intent

Conversation

@dedo1911

@dedo1911 dedo1911 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Problema

Una domanda definitoria — "what is the difference between Omega and Alpha", "differenza tra account Alpha e Omega", o una comparazione tra moduli — veniva catturata dal matcher generico head-to-head in mcp-intel.mjs e risolta con una card war_report 0-vs-0 senza senso, sopprimendo del tutto la risposta RAG.

Causa: i nomi "Omega"/"Alpha" combaciano per caso con un'alleanza e un personaggio reali su eve-kill, e ok() controlla solo la lunghezza del nome, non l'esistenza dell'entità. Quando mcp.text è valorizzato, l'engine salta il RAG (engine.mjs:762), quindi la risposta enciclopedica corretta non viene mai generata.

![screenshot del bug: card OMEGA vs Alpha con 0 kills / 0 ISK]

Soluzione — due guard non invasivi

Nessuna modifica all'ordine degli intent né ai pattern esistenti: solo una condizione attorno al blocco WAR / HEAD-TO-HEAD.

  • Guard A (pre-rete): salta l'intent quando il framing è concettuale (differenza/difference/cosa cambia/quale è meglio/which is better) → la domanda cade sul RAG. Il framing di guerra reale (guerra/war, "X vs Y", confronta) non usa mai quelle parole, quindi è inalterato.
  • Guard B (post-rete): se war_report torna senza combattimenti in entrambe le direzioni (total_kills e total_isk entrambi 0) si ritorna EMPTY invece della card 0-vs-0 → RAG. Copre il caso scritto con "vs" e le comparazioni di moduli che risolvono a entità a zero attività per collisione di nomi.

Perché è sicuro

  • Le query di guerra legittime continuano a scattare ("guerra tra X e Y", "Goonswarm vs PL", "confronta X e Y" tra entità reali) — verificato 4/4 in un test di routing statico.
  • Le comparazioni concettuali / di moduli che l'utente potrebbe porre vengono gestite dal RAG (Guard A se usano "differenza", altrimenti Guard B).

Test

  • node --check sul modulo: OK.
  • Test di routing statico su 11 query: i casi concettuali cadono sul RAG, i 4 head-to-head legittimi restano attivi.
  • App riavviata in locale con il fix: avvio pulito.

Include il bump di versione 0.1.54 (package.json + package-lock.json).

🤖 Generated with Claude Code

…illboard war + bump 0.1.54

A definitional question ("what is the difference between Omega and Alpha",
"differenza tra account Alpha e Omega", module comparisons) was caught by the
generic head-to-head matcher and answered with a meaningless 0-vs-0 war_report
card, suppressing the RAG answer (entities coincidentally resolve to a real
alliance/character; ok() only length-checks the name).

Two non-invasive guards in the WAR/HEAD-TO-HEAD intent, no change to intent
ordering or existing patterns:
- Guard A (pre-network): skip the intent for conceptual framing
  (differenza/difference/cosa cambia/quale è meglio/which is better) → falls
  through to RAG. Genuine war framing (guerra/war, "X vs Y", confronta) is
  unaffected since it never uses those words.
- Guard B (post-network): if war_report returns no combat in either direction
  (total_kills and total_isk both 0), return EMPTY instead of a 0-vs-0 card →
  RAG. Covers the "vs"-phrased account-type question and module comparisons
  that resolve to zero-activity entities by name collision.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@WilliamFalci WilliamFalci merged commit 3edb49a into WilliamFalci:main Jun 5, 2026
1 check passed
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