Skip to content

Commit b279808

Browse files
aborrusoclaude
andcommitted
fix(camera): keyword entità HTML anche con input maiuscolo accentato
Recepiti due rilievi Copilot sulla PR #64: - htmlEntityKeywordVariants ora mappa anche À/È/É/Ì/Ò/Ù → la variante encoded viene generata pure con keyword maiuscola (es. CRIMINALITÀ) - test di regressione keyword: limit 10 → 100 (fragile all'ordinamento, 19 atti matchano) + nuovo caso maiuscolo Bump versione 0.25.2 nei 5 punti. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7da8335 commit b279808

8 files changed

Lines changed: 28 additions & 7 deletions

File tree

LOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 2026-07-13
44

5+
- **v0.25.2** — release patch che consolida il fix keyword-entità HTML (bug ad alto impatto: ricerche Camera silenziosamente vuote). Recepiti due rilievi Copilot sulla PR #64 (già mergiata): (1) `htmlEntityKeywordVariants` copriva solo le vocali accentate **minuscole** → una keyword in maiuscolo (`CRIMINALITÀ`) non generava la variante `&Agrave;` e, nonostante il match SPARQL sia `LCASE`-insensitive, falliva sul dato grezzo; aggiunte À/È/É/Ì/Ò/Ù alla mappa e al regex, con test di regressione dedicato; (2) il test di regressione usava `limit: 10`, fragile rispetto all'ordinamento (19 atti matchano `criminalità`): alzato a 100. 43 tool invariati, 162/162 test verdi.
56
- **fix keyword Camera con entità HTML**`bills --keyword` e `bill-progress --uri/--branch C --keyword` ora cercano anche la variante HTML-escaped della keyword (`criminalità``criminalit&agrave;`). Il LOD Camera salva alcuni `rdfs:label`/`dc:title` con entità HTML ma la CLI decodifica l'output: prima una ricerca sul testo visibile (`--keyword "criminalità"`) non trovava atti il cui titolo mostrato contiene `criminalità organizzata`; funzionavano solo workaround come `criminalit` o `criminalit&agrave;`. Aggiunto helper condiviso `htmlEntityKeywordVariants`, test di regressione su `ac19_2696`, build/tsc/test completi verdi (161/161).
67

78
## 2026-07-12

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dxt_version": "0.1",
33
"name": "italianparliament-mcp",
4-
"version": "0.25.1",
4+
"version": "0.25.2",
55
"display_name": "Italian Parliament MCP",
66
"description": "Query Italian Parliament open data (Camera dei Deputati + Senato della Repubblica)",
77
"long_description": "MCP server for the Italian Parliament SPARQL endpoints (dati.camera.it, dati.senato.it). Tools for deputies, senators, bills, votes, speeches, parliamentary groups, government members, oversight acts, committees, rankings, and direct links to bill texts. Designed for journalists, researchers and parliamentary analysts.",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aborruso/italianparliament-mcp",
3-
"version": "0.25.1",
3+
"version": "0.25.2",
44
"description": "CLI and MCP server for querying Italian Parliament SPARQL endpoints (Camera dei Deputati and Senato della Repubblica)",
55
"main": "dist/index.js",
66
"type": "module",

src/core/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function sparqlRequest(
6161
method: "GET",
6262
headers: {
6363
Accept: "application/json",
64-
"User-Agent": "italianparliament-mcp/0.25.1",
64+
"User-Agent": "italianparliament-mcp/0.25.2",
6565
},
6666
signal: controller.signal,
6767
});

src/core/html-entity-variants.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ const HTML_ENTITY_BY_CHAR: Record<string, string> = {
2020
"\u00ec": "&igrave;",
2121
"\u00f2": "&ograve;",
2222
"\u00f9": "&ugrave;",
23+
"\u00c0": "&Agrave;",
24+
"\u00c8": "&Egrave;",
25+
"\u00c9": "&Eacute;",
26+
"\u00cc": "&Igrave;",
27+
"\u00d2": "&Ograve;",
28+
"\u00d9": "&Ugrave;",
2329
};
2430

25-
const HTML_ENTITY_CHARS = /["'&<>\u2018\u2019\u201c\u201d\u2013\u2014\u2026\u20ac\u00ab\u00bb\u00e0\u00e8\u00e9\u00ec\u00f2\u00f9]/g;
31+
const HTML_ENTITY_CHARS = /["'&<>\u2018\u2019\u201c\u201d\u2013\u2014\u2026\u20ac\u00ab\u00bb\u00e0\u00e8\u00e9\u00ec\u00f2\u00f9\u00c0\u00c8\u00c9\u00cc\u00d2\u00d9]/g;
2632

2733
/**
2834
* Camera LOD often stores title/label literals with HTML entities

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function makeHandler(tool: Tool) {
9797
export function createServer(): McpServer {
9898
return new McpServer({
9999
name: "italianparliament-mcp",
100-
version: "0.25.1",
100+
version: "0.25.2",
101101
});
102102
}
103103

src/tools/tools.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,21 @@ describe("Camera tools", () => {
117117
const result = await billsTool.execute({
118118
legislature: 19,
119119
keyword: "criminalità",
120-
limit: 10,
120+
limit: 100,
121+
offset: 0,
122+
});
123+
expect(
124+
result.rows.some(
125+
(r) => r.uri === "http://dati.camera.it/ocd/attocamera.rdf/ac19_2696",
126+
),
127+
).toBe(true);
128+
}, 30000);
129+
130+
it("bills: HTML-entity keyword match is case-insensitive on accented input", async () => {
131+
const result = await billsTool.execute({
132+
legislature: 19,
133+
keyword: "CRIMINALITÀ",
134+
limit: 100,
121135
offset: 0,
122136
});
123137
expect(

src/worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
return new Response(
1111
JSON.stringify({
1212
name: "italianparliament-mcp",
13-
version: "0.25.1",
13+
version: "0.25.2",
1414
description:
1515
"MCP server for querying Italian Parliament SPARQL endpoints (Camera + Senato)",
1616
mcp_endpoint: "/mcp",

0 commit comments

Comments
 (0)