Skip to content

fix(which): copri la Giunta per le autorizzazioni, togli il mis-route su immunità#81

Merged
aborruso merged 2 commits into
mainfrom
fix/78-which-giunta-autorizzazioni
Jul 26, 2026
Merged

fix(which): copri la Giunta per le autorizzazioni, togli il mis-route su immunità#81
aborruso merged 2 commits into
mainfrom
fix/78-which-giunta-autorizzazioni

Conversation

@aborruso

Copy link
Copy Markdown
Member

Closes #78

Il problema

Due sintomi, una sola area:

  • which "giunta per le autorizzazioni" e which "autorizzazione a procedere" → nessun comando, pur essendo il tema pienamente servito da committees list + committee-members list (la Giunta è o19_3520, 137 sedute in leg. 19).
  • which "immunità parlamentare"search find, cioè "cerca un parlamentare per nome". Un match sbagliato è peggio di nessun match per chi si fida dell'output.

La causa del mis-route

search find aveva tra i termini "parlamentare", nudo. Lo scorer assegna 60 punti quando la query contiene il termine (q.includes(t)), quindi qualunque domanda con quella parola dentro finiva lì: "immunità parlamentare", ma anche "gruppo parlamentare".

Cosa fa questa PR

  1. "parlamentare""cerca parlamentare" su search find. Chi cerca "parlamentare" da solo continua a trovarlo (match parziale sul termine più lungo); chi cerca altro non lo pesca più.
  2. Termini su giunta / autorizzazione a procedere / immunità / insindacabilità aggiunti a committees list e committee-members list, con le desc allineate ("Commissioni e giunte").

Non ho toccato lo scorer. Irrigidirlo (match su parola intera, soglia sulla lunghezza del termine) avrebbe cambiato il punteggio di tutte e 33 le voci per curare un termine mal scelto: più rischio di regressioni che guadagni. Se emergono altri falsi positivi dello stesso tipo, allora il problema è lo scorer e si affronta lì.

Verifica

$ which "giunta per le autorizzazioni"   # prima: nessun comando
committees list — Commissioni e giunte Camera+Senato
committee-members list — Membri di una commissione o giunta con ruoli

$ which "immunità parlamentare"          # prima: search find
committees list — Commissioni e giunte Camera+Senato
committee-members list — Membri di una commissione o giunta con ruoli

$ which "gruppo parlamentare"            # prima: anche search find
groups list — Gruppi parlamentari Camera

$ which "parlamentare"                   # invariato
search find — Cerca un parlamentare per nome (Camera+Senato)

+4 test in capabilities.test.ts (copertura dei tre temi, assenza di search find dove non c'entra, non-regressione su "cerca"/"nome"/"parlamentare"/"trova persona"). Suite completa verde: 210 test.

🤖 Generated with Claude Code

… su immunità (#78)

Il term "parlamentare" nudo su `search find` catturava query di tutt'altro
tema — "immunità parlamentare", "gruppo parlamentare" — perché lo scorer
assegna 60 quando la query contiene il term. Diventa "cerca parlamentare":
chi cerca "parlamentare" da solo trova ancora il comando, chi cerca altro no.

Aggiunti a `committees list` e `committee-members list` i termini su giunta,
autorizzazione a procedere, immunità e insindacabilità: il tema era scoperto
pur essendo pienamente servito da quei due comandi.

Closes #78

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 26, 2026 07:55

Copilot AI 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.

Pull request overview

This PR improves the which command’s capability routing by removing an overly-generic term that caused false positives, and by expanding committee-related capabilities to cover “Giunta per le autorizzazioni”/immunità-related queries.

Changes:

  • Adjusted search find terms to avoid mis-routing queries that merely contain “parlamentare”.
  • Added giunta/autorizzazioni/immunità/insindacabilità terms to committees list and committee-members list, aligning descriptions to “Commissioni e giunte”.
  • Added targeted tests to cover the new routing behavior and prevent regressions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/core/capabilities.ts Updates the which capability index terms/descriptions to fix mis-routing and cover giunta/immunità queries.
src/core/capabilities.test.ts Adds regression tests ensuring “immunità parlamentare” no longer routes to search find and giunta-related queries are covered.

@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR refines command discovery for parliamentary authorization boards.

  • Replaces the broad person-search keyword with a longer phrase.
  • Adds authorization-board, immunity, and non-accountability terms to committee commands.
  • Adds routing and regression coverage for the affected queries.

Important Files Changed

Filename Overview
src/core/capabilities.ts Updates routing terms and descriptions, but the replacement committee phrase creates an equal-score false positive for the supported parlamentare query.
src/core/capabilities.test.ts Adds focused routing tests, though the person-search regression assertion permits the newly introduced committee result.

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/core/capabilities.ts:44
**Parlamentare triggers committee routing**

When a user runs `which "parlamentare"`, the new `giunta parlamentare` term receives 70 points because it contains the query, causing `committees list` to appear at the same score as the intended `search find` command. The non-regression test only checks that `search find` is present, so it permits this incorrect extra result.

Reviews (2): Last reviewed commit: "fix(which): "giunta parlamentare" invece..." | Re-trigger Greptile

Comment thread src/core/capabilities.ts Outdated
Da review PR #81: il term nudo ricreava lo stesso difetto che questa PR
rimuove per "parlamentare" — "giunta regionale" o "delibera di giunta"
avrebbero pescato un comando che copre solo il Parlamento. Chi cerca
"giunta" da solo trova ancora committees; le giunte locali no.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread src/core/capabilities.ts
@aborruso
aborruso merged commit 8d7865e into main Jul 26, 2026
2 checks passed
@aborruso
aborruso deleted the fix/78-which-giunta-autorizzazioni branch July 26, 2026 08:16
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.

which: nessun match su 'giunta per le autorizzazioni' e match fuorviante su 'immunità parlamentare'

2 participants