Skip to content

feat(cli): measure the first run: setup, login and first-audit telemetry, persist install source #1194 - #1198

Merged
nc9 merged 9 commits into
mainfrom
feat/first-run-telemetry
Oct 27, 2026
Merged

nc9 merged 9 commits into
mainfrom
feat/first-run-telemetry

Conversation

@nc9

@nc9 nc9 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1194. Tracked internally.

What

  • squirrel setup sends setup_started, one setup_step per step (step:outcome slug only) and setup_completed. Nothing on --dry-run.
  • squirrel auth login sends login_completed once the session is saved.
  • The install's first audit sends first_audit_ok or first_audit_failed (failure class from the engine's fixed statusReasonCode vocabulary, or exception), once; marker first_audit_reported_at in settings.
  • Signed in, telemetry carries the login session token (sqcli_...) so the API attributes the user. Only to the production API URL; an org API key (env or settings) is never sent. Anonymous when signed out.
  • Opt-out: NO_TELEMETRY and telemetry=false send nothing (also re-checked from disk inside the sender for callers that had no settings).
  • Telemetry notice text updated.
  • Install source: SQUIRREL_INSTALL_SOURCE is validated (^[a-z0-9-]{1,32}$, else dropped) and persisted by self install as install_source, because registration runs on a later command whose env no longer has it (so every install reported binary). Registration re-validates and sends it as source. install.sh default stamp changes from install.sh (dot, now invalid) to install-sh.
  • Docs: telemetry section of docs/cli/self.mdx and the FAQ list the events and state the user-ID and opt-out behaviour. CHANGELOG entries.

Order

The private API accepts the new event names (squirrelscan/repo#3555, merged first). The CLI release must follow its deploy.

Skill

No change needed to the squirrelscan skill (internal telemetry, no new command or flag).

Verified

CLI typecheck, bun run lint, format; tests by path: first-run-telemetry, install-source, install-meta, telemetry, setup-telemetry, auth-login, startup, banner (66+47 pass); tangly check --strict passes. A focused privacy review (Sonnet, codex unavailable) found hardening items, all fixed: settings opt-out re-check in the sender, token only to the production API, persisted source re-validated.

Privacy review note (accepted): install_source is persisted in ~/.squirrel/settings.json (a slug, mode 0600) even with telemetry off; it is only ever sent through the gated registration.

@claude

claude Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review of #1198 (first-run telemetry). I read the non-test source diff. I did not run the tests.

I checked the main privacy risk. Dropping auth: "none" does not make the call fall back to the org API key. packages/api-client/src/index.ts:135 returns init.token whenever it is not undefined, so token: null forces an anonymous request.

  • (low) apps/cli/src/self/telemetry.ts loginSessionToken: the login bearer token is now attached to every telemetry event (audit, errors, update checks), not only the new first-run events. The docs and notice cover this. A leaked or logged /v1/traces request would now expose a live session credential. Consider limiting the token to the login_completed, setup_* and first_audit_* events, or sending a server-resolved user identifier instead.
  • (low) telemetry.ts: setup_audit_accepted and setup_audit_declined are added to TelemetryEvent but nothing in this diff emits them. Either wire them up or drop them, so the private API does not carry dead event names.
  • (low) setup.ts: the "Couldn't read your settings" branch in step 3 emits no updates step event. The funnel therefore has a gap for users with unreadable settings. Settings failures also disable all setup telemetry, so this is probably acceptable.
  • (nit) trackFirstAudit writes first_audit_reported_at before it sends. If the send fails, that first audit is never reported. This fits the "once" semantics, but a comment saying so would help.
  • (nit) install.sh changes the default stamp to install-sh. Installs already registered as install.sh will split in analytics from new ones. Worth noting in the PR or CHANGELOG.

Otherwise the opt-out checks, the slug validation (DETAIL_PATTERN, SOURCE_PATTERN) and the production-URL-only token gating look sound.

@nc9

nc9 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Triage:

  • Token on every event: intended. The decision is that telemetry carries the user after login, on all events (an anonymous audit event cannot be joined to the first-run events otherwise). The token only goes to the production API URL and is the short-lived login session, same credential every authenticated call already sends there. Rebut.
  • setup_audit_accepted/declined: wired in the follow-up PR (First audit right after install: install.sh and setup lead to an audit #1195, setup ends in an audit offer). The names are in the private enum already so the API deploys once.
  • updates gap on unreadable settings: accepted, setup telemetry is deliberately off when settings are unreadable (they may hold the opt-out).
  • Marker comment: added.
  • install.sh stamp split: no prod install has ever registered as install.sh (the stamp never reached registration, which is what this PR fixes), so there is nothing to split; noted in the PR body and the CHANGELOG entry.

@github-actions

Copy link
Copy Markdown
Contributor

Auto-review did not complete

The claude-review session ended without posting a review. This PR has not been auto-reviewed. Run a review manually (/review) before merging.

  • Result: success / is_error=false after 8 turns, 1 permission denial(s), $0.17
  • Job log
Permission denials (1)
Bash {"command":"cd /home/runner/work/squirrelscan/squirrelscan; gh pr diff 1198 > /tmp/d.diff; awk '/^diff --git/{p = ($0 ~ /apps\\/cli\\/src/)} p' /tmp/d.diff | head -600"}

Partial findings recovered from the session (incomplete, unverified, and NOT a merge signal):

Show partial review

I reviewed the full diff and found no blockers. The nits and mediums below are mostly about telemetry accuracy and consent. I read the code only: I ran no tests and checked no CI results.

What looks right:

  • token: null is honoured as anonymous. api-client returns an explicit init.token as-is (packages/api-client/src/index.ts:135), so it never falls back to resolveCredential(), and org API keys can't leak.
  • Install-source validation and the settings opt-out re-check in the sender look correct.

Findings:

  • (medium) apps/cli/src/self/telemetry.ts (showTelemetryNotice) — Telemetry now attaches a user ID once someone signs in, which is a real change in what is collected. The notice is gated by telemetry_notice_shown, so existing installs never see the new wording. Consider re-showing the notice once for installs that saw the old text (for example a telemetry_notice_version field), or call out clearly in the release notes that existing users get no new notice.

  • (medium) apps/cli/src/cli/commands/audit.ts (the trackFirstAudit call sites) — For installs that predate this release, first_audit_reported_at is unset. Their next ordinary audit will therefore be reported as first_audit_ok or first_audit_failed, which pollutes the funnel metric. Consider seeding the marker for installs that already have registered or setup_completed_at set, or for settings that show prior audits. If that is intended, say so in the docs.

  • (low) apps/cli/src/self/telemetry.ts (trackFirstAudit) — The marker is written before the send, so a dropped send loses the event permanently. That is a documented tradeoff. But trackFirstRunEvent is fire-and-forget, and the process may exit right after the audit. In that case you lose the event and still burn the marker. Please confirm the send is awaited or flushed on exit, since safeExit runs soon after.

  • (low) apps/cli/src/cli/commands/audit.ts (trackFirstAudit call) — A failed first audit caused by a user typo (bad URL, DNS) consumes the "first" marker. Later successes then never report first_audit_ok. If the funnel is meant to measure "first success", consider marking only on ok, and capping the failures that get reported.

  • (low) apps/cli/src/self/telemetry.ts (loginSessionToken) — new Date(auth.expiresAt).getTime() < Date.now() is false when expiresAt is an unparseable string, because the value is NaN. A malformed expiry is then treated as valid. Use !(t > Date.now()).

  • (low) apps/cli/src/self/telemetry.ts (sendTelemetryEvent) — Each event now does an extra loadUserSettings() disk read, plus another one in loginSessionToken(). That is two synchronous reads per event, and it matters for audit and error events too. Load once and pass it through.

  • (low) apps/cli/src/self/telemetry.ts (TelemetryEvent) — setup_audit_accepted and setup_audit_declined are added to the union but nothing emits them. Either wire them up or drop them, since dead event names suggest a missing feature.

  • (low) apps/cli/src/self/telemetry.ts (trackFirstRunEvent) — detail is sent in the error_type field for setup_step events. Reusing that field for step names will make server-side error analytics noisy. Check that the private API handles it, or use a dedicated field.

  • (nit) apps/cli/src/self/telemetry.ts — The JSDoc block for trackFirstAudit sits above let firstAuditReported, so it documents the wrong declaration. Move the variable above the comment.

  • (nit) apps/cli/src/cli/commands/setup.ts — In updates, the "updates: enabled" step is not tracked if updateSettings fails, and the branch has no outcome at all. Add a failed outcome for symmetry with the other steps.

  • (nit) install.sh — The default stamp changes to install-sh. Confirm that install.ps1 and the npm wrapper stamp slugs that match ^[a-z0-9-]{1,32}$, since an invalid value is silently dropped to binary.

Test coverage looks adequate for the new modules per the PR description. I'd add two cases: a pre-existing install reporting its first audit (the marker case above), and an unparseable expiresAt.

@claude

claude Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review of #1198. I read the diff and checked how the api-client resolves `token: null`. I did not run the tests.

  • (medium) `telemetry.ts` (`sendTelemetryEvent`): the login session token is now attached to every telemetry event, not only the first-run ones. That includes `audit`, `error` and the update events. Those events used to be anonymous and are now tied to a user ID. The docs and the notice text say so, but the PR description scopes it to the first-run funnel. Confirm this is intended. If it isn't, only `trackFirstRunEvent` should pass the token. Also, the privacy-sensitive fallback depends on `token: null` being honored. It is (`resolveToken` returns `init.token` when it is not undefined), but a test that asserts no `Authorization` header is sent when signed out with an org API key would pin that.
  • (low) `telemetry.ts` (`loginSessionToken`): `new Date(auth.expiresAt).getTime() < Date.now()` is false when `expiresAt` is unparseable (NaN), so the token is sent. Use `!(t > Date.now())` to fail closed.
  • (low) `telemetry.ts` (`trackFirstAudit`): when the caller has no settings snapshot (`effectiveSettings` undefined), the `first_audit_reported_at` check is skipped and `updateSettings` overwrites an existing marker. A second process can then re-send the event. Re-read the marker from disk before sending.
  • (low) `telemetry.ts`: `setup_audit_accepted` and `setup_audit_declined` are added to `TelemetryEvent` but nothing emits them. Either drop them or wire them up. The PR description doesn't list them.
  • (low) `telemetry.ts` (`sendTelemetryEvent`): every event now does a synchronous `loadUserSettings()` disk read, plus another one in `loginSessionToken`. That is cheap, but you could load once per send.
  • (low) `install-meta.ts` (`sysctlFlag`): `spawnSync` blocks for up to 250 ms per probe, so two probes can add up to 500 ms to registration on a slow system. The comment says "a few ms". This only runs once and is macOS only, but reword the comment or run it off the hot path.
  • (nit) `setup.ts`: in the `updateSettings({ auto_update: true })` branch, no step event is sent if the write fails. The other branches always report an outcome. Consider `trackStep("updates", "failed")`.
  • (nit) The `install_source` fallback in `install.ts` writes `null` when there is no env value. That is fine, since it is optional in the schema.

Test coverage looks good: new tests for setup, first-run, install-source and install-meta. The docs and CHANGELOG are updated. The PR description says the private API change must be deployed before the CLI release. Make sure that ordering is enforced.

@nc9

nc9 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Round 2 fixes: telemetry notice re-shown once to existing installs (telemetry_notice_version 2), unparseable session expiry fails closed (tested), first-audit marker re-read from disk before sending, CHANGELOG notes it. Token on every event is intended (decided: telemetry carries the user after login), tested signed-out and org-key cases. setup_audit_* are wired in #1195's PR.

@nc9
nc9 force-pushed the feat/first-run-telemetry branch from 47e9834 to 30b739d Compare October 27, 2026 09:53
@claude

claude Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review of the first-run telemetry change. Privacy handling is careful (slug allowlist on detail, token only sent to the production API URL, sqcli_ prefix check, expiry failing closed, disk re-check for opt-out) and tests cover it well. Diff-only read; I did not run the tests.

  • (medium) telemetry.ts trackFirstAudit: the first_audit_reported_at marker is written even with telemetry off (a test asserts this). If the user enables telemetry later, their first audit is never reported, and an offline first audit never sets it. Probably acceptable, but add a comment: the marker really means "first audit seen".
  • (medium) trackFirstAudit: the marker is written before the send, so if the send fails (network down on the first run) the event is lost for good. That undercounts first-audit failures caused by connectivity. Worth a note in the PR.
  • (low) loginSessionToken calls loadUserSettings() per event, and the sender loads settings again for the opt-out check: two sync disk reads per event. Consider sharing one load.
  • (low) install-meta.ts detectCpuInfo: spawnSync("sysctl") can block up to 2 x 250ms on darwin at registration. Use an absolute path (/usr/sbin/sysctl) so a hostile PATH entry cannot be run.
  • (low) setup.ts: track is gated on settings.ok. If settings are unreadable, all setup events are dropped silently.
  • (low) install.sh default stamp changed to install-sh. Confirm install.ps1 and scripts/install-contract.test.ts are consistent.
  • (nit) trackFirstAudit takes failureClass: string. A union of AuditFailureReasonCode | "unknown" | "exception" would make the fixed vocabulary explicit.
  • (nit) telemetry_notice_version could be .int().
  • (nit) DETAIL_PATTERN and the install-source pattern are separate regexes. A shared slug helper would show the difference clearly.

Docs, CHANGELOG and the notice bump are present and consistent. Please confirm the detect-secrets baseline passes after the test edits (sqcli_ and sq_live_ fixtures may need pragma: allowlist secret).

@claude

claude Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review of the first-run telemetry PR. I read the diff and grepped the CLI source. I did not run the tests.

  • (medium) apps/cli/src/self/telemetry.ts (loginSessionToken): the login session token (sqcli_...) is attached to every telemetry event, including trackError and audit, not only the new first-run events. That is a wider disclosure than "events carry a user ID" suggests. It also puts a bearer credential on an always-on, opt-out path. The server side is private, so I can't check that it resolves the token to a user ID and drops it instead of logging it. Please confirm that, and consider limiting the token to the first-run events.
  • (medium) telemetry.ts (trackFirstAudit): the marker is written before the send, so a failed send (offline, or the process exits before the request completes) loses the first-audit event for good. safeExit runs right after an audit, so this is plausible, and it may skew the funnel numbers. If the process can exit before trackTelemetryEvent flushes, check that the call is awaited or flushed. The comment says this is deliberate, but it is a real data-loss path.
  • (low) telemetry.ts: setup_audit_accepted and setup_audit_declined are added to TelemetryEvent, but nothing in src emits them, and the PR description doesn't mention them. Either remove them or wire them up. update_prompt_declined is used in banner.ts, so it is fine.
  • (low) telemetry.ts (trackFirstAudit): loadUserSettings() is read from disk on every first-audit call, and sendTelemetryEvent and loginSessionToken each read settings again. It's cheap, but three disk reads per event could be one.
  • (low) setup.ts: trackStep("updates", "enabled") is only sent when updateSettings succeeds. A failed write sends no step event at all, so the funnel can't tell that case apart from the user abandoning setup. Consider sending updates:failed.
  • (low) install-meta.ts (detectCpuInfo): spawnSync runs two sysctl probes, each with a 250ms timeout, so in the worst case registration blocks for up to 500ms. That's fine if registration is already a background task. Please confirm it doesn't run on the hot startup path. The cpu_translated/hw_arm64 payload fields aren't mentioned in the PR description or the docs.
  • (nit) telemetry.ts: the comment on the marker write is mis-wrapped ("Marker first, send second..." runs past the line width). The DETAIL_PATTERN allows _ and multi-colon slugs, while the test regex is stricter, which is fine.
  • (nit) The new tests mock node:os with mock.module. That works because the mock is restored in afterAll, but AGENTS.md prefers spyOn. They also don't call isolateSquirrelHome, so confirm that squirrel-home-guard.test.ts accepts them.
  • (nit) I saw no test that checks the session token is omitted when the API URL isn't the production URL, or that an expired token is dropped. Both are important privacy invariants.

Nothing here blocks the merge. The main thing to confirm is the token scope and handling.

@nc9

nc9 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Round 3 (independent privacy review): DO_NOT_TRACK=1/true honoured in the CLI gate, install.sh and install.ps1; project-scope telemetry:false respected (unreadable project or user file fails closed); first-audit marker is written only after the gate (opt-out never consumes it); login session token attached only once telemetry_notice_version>=2; notice and README reworded truthfully (session token is sent after login, never an API key); install_source schema uses the slug regex (bad value reads as unset); docs say the notice reappears once. /v1/traces treats an unknown or revoked sqcli_ bearer as anonymous (apps/api routes/v1/traces.ts: lookup in try/catch, userId stays null, no reject). setup_audit_accepted/declined are emitted by the follow-up PR for #1195.

@claude

claude Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review of #1198 (first-run telemetry).

Overall the privacy hardening is solid: the step:outcome slug gate, the opt-out re-check from disk, the token sent only to the production API, and the notice-version gate before the token is attached.

  • (medium) apps/cli/src/self/telemetry.ts isTelemetryDisabled: this now does a synchronous disk read (loadSettingsFromScope("local"), which walks up for the project settings) on every call, and sendTelemetryEvent then reads user settings again. This sits on hot paths such as trackError and registerInstall. It is probably fine in cost, but it is a behaviour change to a shared gate. Consider memoising per process, or at least confirm it adds no noticeable startup latency.
  • (medium) projectOptOut fails closed on any local-scope error, including findLocalSettingsPath failures. A corrupt or unreadable project .squirrel/settings.json therefore silently disables telemetry. The intent is reasonable, but it also affects showTelemetryNotice and registerInstall (registration is skipped, since it uses the same gate). Please confirm this is intended, and add a test for the unreadable-project-file case.
  • (medium) DO_NOT_TRACK and project-scope opt-out are new behaviours. The CHANGELOG bullet doesn't mention them, but the README does. Add a user-facing line (Added) so it matches the docs.
  • (low) telemetry.ts: setup_audit_accepted and setup_audit_declined are added to TelemetryEvent but nothing emits them. Remove them, or the API will carry dead event names (and the private API allow-list has to know about them).
  • (low) trackFirstAudit writes the marker before the send, so a failed first audit (or a lost send) permanently consumes "first". Failure-then-success on the same install will never report first_audit_ok. That is documented as "once beats at least once", but it does skew the funnel. Consider only consuming the marker on ok, or on a second failure, if the funnel needs success after failure.
  • (low) audit.ts: the trackFirstAudit call is placed after the report handling. An early safeExit or return path (for example a failed-status path that exits before it) would skip it. Verify that every terminal path of audit reaches it.
  • (low) install_source regex is duplicated in types.ts and install-meta.ts. Export one constant and reuse it, ideally in packages/utils/src/constants.ts or the CLI constants file as AGENTS.md asks.
  • (nit) detectCpuInfo spawns two sysctl processes synchronously, each with a 250ms timeout, so the worst case is about 500ms of blocking on the registration path. Consider one call, or a lower timeout.
  • (nit) setup.ts: updates:enabled is tracked only when updateSettings succeeds. A failure produces no step event, so funnel counts can have gaps. A failed outcome would be cleaner.

No critical or high issues found.

@nc9

nc9 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Round 4 triage. Fixed: CHANGELOG now lists DO_NOT_TRACK and project opt-out; one INSTALL_SOURCE_PATTERN shared by the env reader and the schema. Rebutted: (a) setup_audit_accepted/declined are emitted by #1201 and are already in the deployed private allow-list; (b) unreadable-project-file fail-closed is intended and tested ("an unreadable project settings file fails closed" in first-run-telemetry.test.ts); (c) per-call local-scope read is one small file lookup on rare paths (events, registration), no startup hot path; (d) marker before send is deliberate (once over at-least-once), a failed-then-successful first audit reports the failure only; (e) trackFirstAudit sits after the report handling, which every audit status (completed, failed, blocked) reaches; the early-exit paths before it are usage errors, not audits.

nc9 added 9 commits October 27, 2026 21:53
…try, persist install source #1194

Signed-off-by: Nik Cubrilovic <[email protected]>
…ail closed on a bad session expiry, re-read the first-audit marker #1194

Signed-off-by: Nik Cubrilovic <[email protected]>
…rst-audit marker, session token only after the v2 notice, truthful notice and README #1194

Signed-off-by: Nik Cubrilovic <[email protected]>
…tes the first-audit marker #1194

Signed-off-by: Nik Cubrilovic <[email protected]>
… setup_audit_* events (owned by #1201)

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the feat/first-run-telemetry branch from 67dda9c to 35e0aba Compare October 27, 2026 10:53
@claude

claude Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review of #1198 (first-run telemetry, install source, DO_NOT_TRACK).

  • (medium) CHANGELOG.md The "First-run telemetry" bullet is added four times, identical, under the existing ### Fixed block. It also lands in the wrong section: it is a new feature, so it belongs under ### Added. The diff then opens a second ### Fixed heading for the install-channel bullet. Keep one bullet in ### Added and put the install-source bullet under the existing ### Fixed.
  • (medium) apps/cli/src/self/telemetry.ts (projectOptOut) This reads project-scope settings on every isTelemetryDisabled call. findLocalSettingsPath walks up the directory tree each time, and isTelemetryDisabled is also called from trackError and similar paths. Memoise it per process. Failing closed on an unreadable project file is reasonable. Add a test for it, since I don't see one in the diff.
  • (medium) apps/cli/src/self/telemetry.ts (loginSessionToken / the notice gate) The session token is attached to every telemetry event, but first-run-telemetry.test.ts never covers the notice-version gate. That gate is the consent mechanism for sending it. Add a test that a v1 notice (telemetry_notice_version < 2) sends no token. The existing signIn helper defaults to version 2, so it can't reach that branch.
  • (low) apps/cli/src/self/telemetry.ts The notice gate only works if showTelemetryNotice has run before the first signed-in event. Confirm that every entry point showing the notice does so before login_completed, which is sent right after login with no notice step in between. If the notice has not been shown by then, the event goes out anonymously. That is safe, but it may skew the funnel.
  • (low) apps/cli/src/self/register-install.ts / install-meta.ts The Rosetta detection (detectCpuInfo, using spawnSync of /usr/sbin/sysctl) is not mentioned in the PR description or CHANGELOG. It adds two blocking child-process spawns, up to 250ms each, on the registration path, and two new fields in the registration payload. Either split it out or document it. Also state whether the API accepts the new fields.
  • (low) README.md / telemetry.ts DO_NOT_TRACK and the project-scope opt-out are new behaviour, and the PR description doesn't mention them. They are good additions, but give them a CHANGELOG line and tests. Today only the DO_NOT_TRACK marker case is tested.
  • (low) apps/cli/src/self/telemetry.ts (trackFirstAudit) The marker is written before the send, so a failed or aborted send permanently loses the first-audit event. This is a documented tradeoff. A short-lived process exit just after trackFirstAudit may also drop the event. Make sure the audit command awaits or flushes the telemetry fetch.
  • (nit) apps/cli/src/cli/commands/setup.ts settings is now loaded before track("setup_started"), and the old loadUserSettings() call is removed. This looks right, but confirm that no later code relied on its original position.
  • (nit) setup-telemetry.test.ts uses setTimeout(60) settles. That can be flaky under load. Poll until the expected event count is reached instead.

No security blockers found. The token is sent only to the production API, only for sqcl i_ tokens, and only when the token is unexpired and telemetry is on. error_type details are restricted to a slug pattern.

@nc9
nc9 merged commit 1e18378 into main Oct 27, 2026
15 checks passed
@nc9
nc9 deleted the feat/first-run-telemetry branch October 27, 2026 11:08
nc9 added a commit that referenced this pull request Oct 27, 2026
…vent union (#1198 left them to this PR)

Signed-off-by: Nik Cubrilovic <[email protected]>
nc9 added a commit that referenced this pull request Oct 27, 2026
…vent union (#1198 left them to this PR)

Signed-off-by: Nik Cubrilovic <[email protected]>
nc9 added a commit that referenced this pull request Oct 27, 2026
…ad with it #1195 (#1201)

Closes #1195. Depends on #1198 (this branch is built on its head, so the diff shows its commits until it merges; I rebase once it lands). Tracked internally.

## What
- install.sh and install.ps1 closing message lead with `squirrel audit https://your-site.com` (one line saying what it does); `squirrel setup` comes second.
- `squirrel setup` ends by asking for a site URL and offering to run the audit now. A bare host (`example.com`) is taken as https; a typed URL runs the audit in-process; enter skips; one retry on a malformed answer.
- Non-interactive (no TTY, CI, an agent), `--yes` and `--dry-run` never ask or block: they print the audit command.
- Emits `setup_audit_accepted` / `setup_audit_declined` (no URL), the two event names #1198 added to the allow-list.
- Docs: setup, quickstart, cli index, `--yes` help text. CHANGELOG. No new flag, so no completion change.

## Skill
No change needed to the squirrelscan skill (no new command or flag).

## Verified
format:check, lint, typecheck, tangly strict; tests by path (setup-audit-offer: URL parser + `--yes`/`--dry-run` print the command and make no network call; setup-telemetry). Smoke: built binary, isolated HOME under ops/scratch, pty-driven `squirrel setup`: declined sign-in and skills, typed a site at the offer, the audit ran (3 pages via a project max_pages) and printed the report; `setup --yes </dev/null` and `--dry-run` print the command and exit. Nothing was written to the real ~/.squirrel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Measure the first run: setup, login and first-audit telemetry, install source

1 participant