From 078d675bbf6d78415c31038a011b10f21d1697d0 Mon Sep 17 00:00:00 2001 From: Sylvain Duchesne Date: Mon, 13 Jul 2026 15:06:30 +0200 Subject: [PATCH] =?UTF-8?q?chore(client):=20clarifier=20le=20log=20d'acc?= =?UTF-8?q?=C3=A8s=20=E2=80=94=20"N=20rows"=20=E2=86=92=20"N=20triple-rows?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le journal d'accès compte des triplets RDF (?s ?p ?o), pas des objets métier. Clarification demandée côté Festipod (les logs "readDoc → N rows" étaient ambigus). Test access-log mis à jour en conséquence. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/client/src/docs.ts | 6 +++++- packages/client/test/access-log.test.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/client/src/docs.ts b/packages/client/src/docs.ts index b51b5b5..f405f0e 100644 --- a/packages/client/src/docs.ts +++ b/packages/client/src/docs.ts @@ -93,7 +93,11 @@ export async function sparqlQuery( // rows under an identity that should see nothing) can be appended. Skip the // rowCount work entirely when the log is off. if (accessLogEnabled()) { - logAccess("READ", anchor ?? "(no anchor)", label, " → " + rowCount(result) + " rows"); + // `rows` here are raw RDF triple bindings (the SPARQL `?s ?p ?o` result), NOT + // domain objects — one document's entity is spread across several triple rows. + // Spell that out so the log isn't mistaken for an object count (the app-level + // object/shape count is logged separately by useShapeQuery → dataStats). + logAccess("READ", anchor ?? "(no anchor)", label, " → " + rowCount(result) + " triple-rows"); } return result; } diff --git a/packages/client/test/access-log.test.ts b/packages/client/test/access-log.test.ts index f64c4f6..2a39bd9 100644 --- a/packages/client/test/access-log.test.ts +++ b/packages/client/test/access-log.test.ts @@ -164,7 +164,7 @@ describe("access-log: ON via configure({ debugAccessLog: true })", () => { expect(lines[0]).toMatch(/READ/); expect(lines[0]).toMatch(/did:ng:o:q/); expect(lines[0]).toMatch(/myLabel/); - expect(lines[0]).toMatch(/→ 1 rows/); // row-count from the 1-row fake result + expect(lines[0]).toMatch(/→ 1 triple-rows/); // triple-count from the 1-row fake result }); it("sparqlUpdate emits a WRITE line with identity, anchor nuri, and label", async () => {