From 1dc1c20cd614d38a8bfe8ef23d0cea4e391fc561 Mon Sep 17 00:00:00 2001 From: gensokyo-dev Date: Mon, 23 Nov 2026 15:57:55 +0000 Subject: [PATCH] docs(analysis-view): qualify javascript-fact-groups readback to scalar values where.properties selects only present JSON scalar values, so a group over array, object or missing values cannot be read back through it. Say so in the group_by description and the workflow guide, and assert the exact node count of a repeated channel in the MCP test. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --- .../guides/javascript/javascript-application-workflows.md | 8 +++++--- src/domain/analysisView/javascriptFactsView.ts | 2 +- tests/boundary/mcp/javascriptFactGroupsMcp.test.ts | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/guides/javascript/javascript-application-workflows.md b/docs/guides/javascript/javascript-application-workflows.md index ddf694cf9c..ff07738434 100644 --- a/docs/guides/javascript/javascript-application-workflows.md +++ b/docs/guides/javascript/javascript-application-workflows.md @@ -166,9 +166,11 @@ Each row reports one distinct combination with its `observation_count` and `node_count`. A missing key is omitted from the combination, distinct from a retained null such as an unresolved dynamic channel. Rows are ordered by the canonical JSON of their values; the default offset/limit is 0/256 and the page -total counts distinct combinations. Read a group's observations, with -provenance, through `javascript-facts` and the same `where` plus matching -`where.properties`. +total counts distinct combinations. When every grouped value is a present JSON +scalar, read that group's observations, with provenance, through +`javascript-facts` and the same `where` plus matching `where.properties`. +`where.properties` cannot select array, object or missing values, so read +such groups by paging `javascript-facts` with the same `where`. Rows follow retained node/observation order. The default offset/limit is 0/64; follow `coverage.next_offset`. Page totals count matching retained observations, diff --git a/src/domain/analysisView/javascriptFactsView.ts b/src/domain/analysisView/javascriptFactsView.ts index 2f77596fd2..f82c7a670a 100644 --- a/src/domain/analysisView/javascriptFactsView.ts +++ b/src/domain/analysisView/javascriptFactsView.ts @@ -83,7 +83,7 @@ export const javascriptFactGroupsViewRequestSchema = z.strictObject({ .array(propertyKeySchema) .min(1) .describe( - 'Exact retained property names whose value combinations form groups, e.g. ["operation", "channel"]. A missing key is omitted from the group, distinct from retained null. Rows are ordered by the canonical JSON of their values. Read matching observations with javascript-facts and the same where plus where.properties.', + 'Exact retained property names whose value combinations form groups, e.g. ["operation", "channel"]. A missing key is omitted from the group, distinct from retained null. Rows are ordered by the canonical JSON of their values. When every grouped value is a present JSON scalar, read its observations with javascript-facts and the same where plus where.properties; array, object and missing values cannot be selected that way.', ), offset: z.number().int().nonnegative().default(0), limit: z.number().int().positive().default(256), diff --git a/tests/boundary/mcp/javascriptFactGroupsMcp.test.ts b/tests/boundary/mcp/javascriptFactGroupsMcp.test.ts index 7dd13df578..8d8bfc6bc9 100644 --- a/tests/boundary/mcp/javascriptFactGroupsMcp.test.ts +++ b/tests/boundary/mcp/javascriptFactGroupsMcp.test.ts @@ -101,7 +101,7 @@ it("counts distinct retained IPC channels per operation and reads one group's ob { properties: { operation: "send", channel: "ready" }, observation_count: 2, - node_count: expect.any(Number), + node_count: 1, }, { properties: { operation: "send", channel: "window-close" },