chore(client): clarifier le log d'accès — "N rows" → "N triple-rows"
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) <noreply@anthropic.com>
This commit is contained in:
@@ -93,7 +93,11 @@ export async function sparqlQuery(
|
|||||||
// rows under an identity that should see nothing) can be appended. Skip the
|
// rows under an identity that should see nothing) can be appended. Skip the
|
||||||
// rowCount work entirely when the log is off.
|
// rowCount work entirely when the log is off.
|
||||||
if (accessLogEnabled()) {
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ describe("access-log: ON via configure({ debugAccessLog: true })", () => {
|
|||||||
expect(lines[0]).toMatch(/READ/);
|
expect(lines[0]).toMatch(/READ/);
|
||||||
expect(lines[0]).toMatch(/did:ng:o:q/);
|
expect(lines[0]).toMatch(/did:ng:o:q/);
|
||||||
expect(lines[0]).toMatch(/myLabel/);
|
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 () => {
|
it("sparqlUpdate emits a WRITE line with identity, anchor nuri, and label", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user