Repository navigation
Description
Problem
Running the CLI test suite sends real telemetry to production (POST https://api.squirrelscan.com/v1/traces). On 2026-11-22, every CI and agent run of apps/cli/tests/self/updater.test.ts produced one fresh install ID, under version 0.0.190, reporting the same three events: error with self_update:SIGNATURE_FAILED, self_update:SIGNATURE_REQUIRED and self_update:ATTESTATION_FAILED. That's 31 rows between 10:27 and 11:29 UTC, and no released binary sends those codes yet. Leaked update events from the same tests appear too.
The cause is in the test file. describe("updater")'s beforeEach runs delete process.env.NO_TELEMETRY so telemetry behaviour can be tested, but only tests that call captureTelemetry() replace globalThis.fetch. Every other test that takes a failure path (signature, attestation) or starts an update sends a real request. Setting NO_TELEMETRY=1 in CI doesn't help, because the test removes it.
Impact: production telemetry counts for update failures and update attempts are inflated by test runs. The post-release monitoring of ATTESTATION_FAILED can't tell test runs from real installs without a heuristic.
Acceptance Criteria
- No test in
apps/clican reach the real API: a test that wants telemetry stubs the transport. A shared default (preload or the updater file'sbeforeEach) points every unstubbed send at a dead local endpoint, or otherwise blocks it. - A guard test fails if a test in
updater.test.tsattempts a request to a non-local host. Removing the default stub makes it fail. - Running
apps/cli/tests/self/updater.test.tswith telemetry enabled and network access sends zero requests toapi.squirrelscan.com. Show it, for example with a fetch spy that counts non-local calls across the file. - Other
apps/clitest files that deleteNO_TELEMETRYorDO_NOT_TRACKare checked for the same pattern, and fixed or confirmed safe. - The audit covers EVERY telemetry event the CLI tests can trigger, not only
self_update:*. That includesupdate(sent when an update starts),install,first_audit_*anderrorviatrackError. Each test file that can reachtrackTelemetryEvent,trackErrorortrackFirstRunEventis listed, with how it is kept off the network. Prod showedupdateevents from about 294 distinct installs at 0.0.190-beta.1, 60 at beta.2 and 18 at 0.0.190 in 3 days, far more than real beta users, so this leak predates pub#2244.
Activity
test(cli): stub telemetry transport in updater tests and guard agains…
test(cli): make the updater telemetry guard independent of the defaul…