feat(analysis-view): count distinct retained JavaScript fact values

Counting the distinct IPC channels of one operation meant paging every
observation, each with its full Evidence, and deduplicating by hand; real
clients miscounted send channels on a large Electron app. Add the
javascript-fact-groups view: with the javascript-facts selectors and
group_by property names, it returns each distinct combination with its
observation and node counts, ordered by canonical JSON, and its total. A
missing key stays omitted, distinct from a retained null such as an
unresolved dynamic channel. The analyze_javascript_application description
names the IPC grouping.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
gensokyo-devandgensokyo-dev authored and Ysopwnable committed 2026-11-24 00:08:10 +08:00
1 parent 25e93a8139
commit e19dbcf857
8 files changed
+366 -5

No files matched your search

@@ -150,6 +150,26 @@ semantic unknown records remain in complete parent Evidence and trace tools.
with one of its JSON scalar values; a missing key or non-scalar value never
matches, and `values: []` matches none.
To count distinct values instead of paging observations, use
`javascript-fact-groups` with the same `where` and the property names to group
by:
```json
{
"kind": "javascript-fact-groups",
"where": { "paths": ["preload.js"], "kinds": ["ipc-channel"] },
"group_by": ["operation", "channel"]
}
```
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`.
Rows follow retained node/observation order. The default offset/limit is 0/64;
follow `coverage.next_offset`. Page totals count matching retained observations,
while `source_coverage` preserves caller selection and application/semantic