Files
Pulse/pkg
rcourtman ac3efdaa61 Count map opens and saved images in telemetry (#4604)
The infrastructure map is a named bet, graded on 18 December on whether
people open it and save its image. Nothing counted either.

Supersedes #4597, which counted saves per view. The map now has one view
(#4599), so those counts are gone.

## What is counted

Telemetry schema v24 adds three counts, each a number of browser
sessions over 30 days:

| Field | Counts sessions that |
|---|---|
| `infrastructure_map_open_sessions_30d` | opened the map |
| `infrastructure_map_export_sessions_30d` | saved an image |
| `infrastructure_map_export_names_hidden_sessions_30d` | saved an image
with names hidden |

## What is not sent

The map draws names, addresses and networks, and the saved image
contains them. None of them, nor the image, leaves the browser for this
count. The browser posts one closed value to `POST
/api/usage/infrastructure-map`, once per session. The route rejects
unknown fields, unknown values and trailing JSON. The server keeps a
daily tally and drops any key outside the closed set on read and on
write.

Density (names or compact) is not counted. It defaults from estate size,
so it would measure the estate and not a choice.

## Also in here

- The once-per-session rule is the one the workload-history counters
already had. Both now use one recorder (`src/api/sessionActivity.ts`).
The workload-history test is unchanged and passes.
- `InfrastructureMapSurface.test.tsx` renders the page and reads the
saved image's markup for names and addresses. It is registered as a
proof for the `infrastructure-map` policy.
- The tally file is registered under `security-privacy`.
- `PRIVACY.md` and its shipped mirror list the three fields, schema 24
and the dated change row.

## Bundle budget

A third commit raises one number in `.bundlesize.json`. On main the
`UserAssignmentsPanel` chunk measures 7991 gzip bytes against a limit of
7991, with no headroom. It reached that limit in #4602 (before it, the
chunk built at about 7.77 kB). On this branch the same panel code
measures 7997, so the bundle check failed by 6 bytes. This change does
not edit that panel. The likely cause is that new exports in the shared
entry rename the bindings the chunk imports; I measured the sizes, not
the cause. The chunk's reference goes from 6949 to 6975, which allows
8021 bytes and leaves 24 of headroom.

## Order of landing

- Built on #4599 (the map as the service diagram only) and #4601 (the
map fitted to one screen), which have both merged. The map page file
changed in #4601 and here, so the merge combined them and a follow-up
commit records the browser pass for the combined file.
- Receiver: rcourtman/pulse-pro#919 added the columns and
rcourtman/pulse-pro#923 drops the per-view ones. The licence server
needs a deploy before counts are stored.
- No release note file is added. Schema v22 did not add one either. The
first release that carries v24 has to name it in its notes, as
`PRIVACY.md` promises.

## Checks

- Go: the telemetry package, the tally tests, and the handler and route
inventory tests in `internal/api` pass.
- Frontend: type-check, the lint audits, header audit and cpd pass, and
so do the 200 test files run (the map, the API clients, Settings,
Workloads and the app architecture tests).
- `registry_audit.py --check`, `contract_audit.py --check`, the
completion and receipt guards and `check_telemetry_schema_parity.py`
pass.
- Browser, private mock stack at 1280 and 375 wide, on the combined
page: opening the map posted one count, a save posted one, a save with
names hidden posted one, a repeat save and a reload posted nothing, and
the telemetry preview showed schema 24 with all three counts at 1. The
workload-history range counter still posted.
- Not checked in a browser: a real file download (the download click was
intercepted), how the fit responds to dragging the window narrower,
light theme, Firefox and Safari.
2026-11-18 16:52:38 +00:00
..