Skip to content

Telemetry can count gstack's own use on Capy, opt-in and kept out of public numbers (GST-3311) - #4576

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy-telemetry-opt-in
Nov 20, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
capy-telemetry-opt-in

Conversation

@garrytan

@garrytan garrytan commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Agent-driven Capy sessions still send no telemetry. If the owner's preferences.yaml holds telemetry_capy: anonymous, each skill run sends one anonymous row labelled source=capy, or source=gt from Garry's own machines.
Why: we couldn't see our own gstack use on Capy, and if we had sent it, it would have been counted as real use.
Nothing to do yet: nothing changes until the owner adds that line, and the ingest change ships in a separate deploy.

What changed

Before this, gstack runs on Capy sent no telemetry at all, so we could not see how much gstack is used there, and if they had sent, those runs would have been counted as real use. Now the owner can turn it on with one line in the preferences file, and those rows go out anonymous and labelled so the public numbers leave them out.

  • bin/gstack-telemetry-tier (new) is the one place that reads the opt-in. It accepts only anonymous: community would send installation_id, a device id reused across sessions, which the consent rules out. A missing file or line, two such lines, another value, or a file over 4 KB all mean off.
  • gstack-skill-end: an unattended session stays silent unless the Capy opt-in is on. When it is on, it sends the telemetry row but still writes no usage log line, so the batch it sends holds exactly one event.
  • gstack-telemetry-log and gstack-telemetry-sync read their tier through the helper, so a Capy machine set to community still sends anonymous under the opt-in.
  • Source label order: flag > GSTACK_TELEMETRY_SOURCE > eval > CI > capy/gt (GSTACK_CAPY=1) > live. Eval runs on Capy stay eval. telemetry_capy_source: gt gives gt; any other value, or none, gives capy.
  • The ingest function accepts capy and gt (before this, it would have stored them as other).
  • lib/agent-model.ts no longer warns about either telemetry key in the preferences file. Docs: privacy, unattended, model-policy and the Capy install guide.
Why

We could not see our own gstack use on Capy. If we had sent it, it would have been counted as real use. This counts it separately, only when the owner opts in, and keeps it out of the public numbers.

Blast radius

This touches the telemetry scripts every skill run calls, the preferences reader and the ingest function. Without the opt-in line nothing changes, because the helper falls back to the machine's own setting (read at bin/gstack-telemetry-tier, and checked by four isolated smoke runs and 84 targeted tests). The public views count only source = 'live' (read in supabase/migrations 006 and 009), so capy and gt rows stay out of them.

Pre-Landing Review

Two reviewers read the whole diff: one combined testing, security, state-machine and red-team reader, and one adversarial reader. Nothing blocks. One testing note was skipped and six notes were recorded.

  • Skipped: lib/agent-model.ts:119: the preferences reader does not warn about a malformed telemetry_capy line. The helper already reads such a line as off, which is the safe default, and adding new session-start warnings is outside this change.
Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL bin/gstack-telemetry-sync:42 Parallel opted-in Capy sessions sharing a state root can pass the 5-minute rate check together and post the same batch twice; capy/gt counts inflate, live numbers untouched.
  • INFORMATIONAL bin/gstack-telemetry-log:152 Stale-marker sweep rows have no source, so ingest files them as live; reachable only when a non-unattended session left a marker on a Capy state root.
  • INFORMATIONAL bin/gstack-skill-start:265 TELEMETRY_WRITE: skipped (unattended session) still prints for an opted-in Capy session whose skill-end then sends a row.
  • INFORMATIONAL supabase/migrations/001_telemetry.sql:77 Internal skill_sequences view reads raw telemetry_events, so it now counts capy/gt rows (already mixed eval and CI; not public).
  • INFORMATIONAL bin/gstack-telemetry-tier:23 One owner opt-in covers every repo a Capy agent works in; rows include the existing redacted error_message and free-text failed_step.
  • INFORMATIONAL bin/gstack-skill-end:126 Background sync throttled to 5 minutes can lose unsent capy rows when a Capy machine sleeps; undercount only.
Exploratory QA

Four smoke runs of bin/gstack-telemetry-tier against isolated fixture files, all passing: an opt-in file gives anonymous and gt; a duplicated opt-in line reads as off; a byte-order mark, Windows line endings, quotes and a comment still opt in, and an unlisted label falls back to capy; outside Capy the file is ignored. gstack-telemetry-log and the sync were not run live, so no row could reach the real endpoint; the targeted tests cover them against a fixture URL.

Eval Results

No prompt, template or judge changed, so evals were skipped. The selector listed every behavior only because the ingest function has no mapped dependency; those stay in scheduled release coverage.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches).

Verification Results

No plan verification items (no plan is bound).

TODOS

No TODO items completed in this PR.

Documentation

Status: updated (one factual cross-reference added, no blockers)

Scope: branch capy-telemetry-opt-in against main base 593d7e1, 3 commits and 14 files (the telemetry tier helper, skill-end, telemetry-log and telemetry-sync, the agent-model preferences reader, the telemetry ingest function, tests, and docs). Nothing was staged, unstaged or untracked.

Documentation health

  • docs/privacy.md: current. Describes the Capy opt-in, the anonymous tier and the capy/gt labels, matching bin/gstack-telemetry-tier.
  • docs/model-policy.md: current. Lists the new preference keys the reader accepts without a warning.
  • docs/unattended.md: current. Documents the one exception to unattended sessions sending nothing.
  • docs/capy-install.md: updated. Now notes that gstack-telemetry-tier also reads GSTACK_PREFERENCES_FILE.
  • changelog.d/capy-telemetry-opt-in.md: reviewed and accurate (not edited).

Coverage debt: gstack-telemetry-tier and the telemetry_capy/telemetry_capy_source keys have reference coverage (privacy.md, model-policy.md) but no how-to section for turning the opt-in on. This is a common gap; /document-generate could fill it.

Diagram drift: none found.

Tests
  • Targeted: bun test test/telemetry-capy.test.ts test/next-telemetry-fields.test.ts test/agent-model.test.ts test/supabase-telemetry-schema.test.ts test/telemetry.test.ts: 84 pass
  • Full free suite (bun run test): carried from CI run 44827196067 at this head, 1721 files
  • macOS named regressions: green in the same run
Agent notes

Lane GSTA-680 for GST-3311. The ingest edge function is not deployed by this PR; deploy separately per skills/gstack-telemetry-supabase.

Refs GST-3311

Approvals

No approvals recorded for branch capy-telemetry-opt-in. Plan: none recorded (Garry asked for this change directly).

Pre-Landing Review: 7 issues — 0 auto-fixed, 1 asked (0 fixed, 1 skipped), 0 deferred, 6 noted
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=6 fixed=0 scope=frozen unbound=2 ledgers_read=3 dispatches=1
Gate edits: none detected (4 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

{
  "schema_version": 1,
  "pr": 4576,
  "head": "568ea550da7453a42f2234c07e97164d75aba076",
  "version": "1.102.1.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1721,
      "fail": 0,
      "skip": 0
    },
    "targeted": {
      "pass": 84,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44827196067,
      "attempt": 1,
      "tree": "31791a642ff312b69ad83d775db36b68cb79a412"
    }
  ],
  "calls": 27,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/gst3311-ship2",
  "head_tree": "31791a642ff312b69ad83d775db36b68cb79a412",
  "product_patch_id": "5f09b268b8f3d713a6b56f667e9ddd1117c4e749",
  "gstack_version": "1.102.1.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 91,
    "rules": "85b3923b1a978e41",
    "base": "ad65f62edff0740449b70cbab6f519e40316b10e",
    "registry": "ad65f62edff0740449b70cbab6f519e40316b10e",
    "gate_scan": {
      "tagged": 0,
      "head": "568ea550da7453a42f2234c07e97164d75aba076"
    },
    "reasons": [
      "runtime=91"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @31791a642ff3 (8 checks, current for 568ea550da74)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44827196067/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=31791a642ff3 tests=38591 skipped=67 runs=44827196067/1 profiles=ci-reuse/free-tests heads=568ea550da74 verified=2026-11-20T22:21:19.538Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md and CONTRIBUTING.md against base 593d7e16 (docs/capy-install.md edited)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 6,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 3,
    "unbound": 2,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}
{
  "schema_version": 1,
  "pr": 4576,
  "head": "568ea550da7453a42f2234c07e97164d75aba076",
  "version": "1.102.1.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1721,
      "fail": 0,
      "skip": 0
    },
    "targeted": {
      "pass": 84,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44827196067,
      "attempt": 1,
      "tree": "31791a642ff312b69ad83d775db36b68cb79a412"
    }
  ],
  "calls": 27,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/gst3311-ship2",
  "head_tree": "31791a642ff312b69ad83d775db36b68cb79a412",
  "product_patch_id": "5f09b268b8f3d713a6b56f667e9ddd1117c4e749",
  "gstack_version": "1.102.1.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 91,
    "rules": "85b3923b1a978e41",
    "base": "ad65f62edff0740449b70cbab6f519e40316b10e",
    "registry": "ad65f62edff0740449b70cbab6f519e40316b10e",
    "gate_scan": {
      "tagged": 0,
      "head": "568ea550da7453a42f2234c07e97164d75aba076"
    },
    "reasons": [
      "runtime=91"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @31791a642ff3 (8 checks, current for 568ea550da74)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44827196067/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=31791a642ff3 tests=38591 skipped=67 runs=44827196067/1 profiles=ci-reuse/free-tests heads=568ea550da74 verified=2026-11-20T22:21:19.538Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md and CONTRIBUTING.md against base 593d7e16 (docs/capy-install.md edited)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 6,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 3,
    "unbound": 2,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}

…public numbers (GST-3311)

Agent-driven Capy sessions still send nothing. With telemetry_capy: anonymous in the owner's preferences.yaml, each skill run sends one anonymous row labelled source=capy; eval and CI labels still win, and the ingest function accepts the new label.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 20, 2026 21:44
…it to a test

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…y (GST-3311)

telemetry_capy_source: gt in the owner's preferences file picks the gt label from a fixed list; anything else stays capy. Eval and CI labels still win, and the ingest function accepts gt.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e same preferences file

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 14a8498 into main Nov 20, 2026
77 checks passed
@garrytan garrytan mentioned this pull request Nov 21, 2026
capy-ai Bot added a commit that referenced this pull request Nov 21, 2026
- Habits from nine teams, written into gstack. (#4585)
- Three more habits from teams that run evals. (#4602)
- The /ship conductor trial plan gives its real-problem judge one more attempt on fresh labels after it missed its agreement bar twice, and stops the trial incomplete if it misses again (GST-3003). (#4611)
- The /ship conductor trial plan now stops a trial only at the final remote-gate refusal, gives both arms the same note that the brief overrides team rules, and counts every report the no-gstack arm returns (GST-3003). (#4609)
- The /ship conductor trial plan now ends a trial at the remote gate when its case base isn't main, gives the no-gstack arm a test runner, and audits every trial for exposure to the plan (GST-3003). (#4605)
- The /ship conductor trial plan now runs an uncounted pilot in every arm before its counted trials and takes one planned look at half the cases (GST-3003). (#4587)
- gstack's own use on Capy can be counted, and is kept out of real-use numbers. (#4576)
- Free Tests shards finish closer together. (#4578)
- The weekly test-time recording can land again on its own. (#4581)
- The job-log tree.json step's recommended sleep is long enough for real runners. (#4589)
- Pull requests no longer wait on the Trunk flaky-test upload, and the quick tier's flaky passes now reach Trunk. (#4579)
- Windows Setup E2E finishes sooner on install changes. (#4575)
- Skills no longer stop on Codex when they clean up temp files. (#4612)
- /review on Codex with OpenAI models no longer holds back a review that ran its adversarial pass. (#4622)
- Crew threads on Capy now check in at 500M own tokens, standing threads rotate at 250M and any subagent past 50M gets a look, half the old lines, because Capy's token counts read about half what they did before 2026-11-15. (#4582)
- gstack no longer offers to add a `## Skill routing` section to your project's CLAUDE.md. (#4629)
- The README and docs no longer say gstack makes your agent fix more bugs. (#4598)
- `/eval-plan` now writes eval plans that waste less money. (#4591)
- /cso checks every folder above a source file before it looks at the file, so it never looks through a symlinked folder. (#4592)
- Plan reviews no longer read a /design-review audit summary as the branch's design doc. (#4623)
- Node's built-in test files now run with `node --test` in repos that use vitest or jest. (#4626)
- A quarantined test that the runner skipped now fails the run instead of passing it. (#4590)
- A flaky free test is fixed: the spawnSync overflow check no longer fails about once an hour on CI. (#4613)
- Free Tests runs its shards on 16-core runners. (#4600)
- /office-hours asks for ground truth first. (#4468)
- Every startup session ends with a dated test. (#4468)
- /plan-tune's dream cycle now logs each send of your typed answers to Anthropic. (#4621)
- Landing a ready PR no longer depends on a hand-copied gate decision, and the ready note, release PR and squash message say the right thing. (#4596)
- /ship no longer asks for a fresh review because of a stacked parent that main already had. (#4580)
- Results PRs with large captured agent sessions can be reviewed. (#4574)
- /ship no longer stalls on review notes a reviewer already cleared, counts review rounds the way the review policy reads them, and keeps security findings out of the PR body. (#4595)
- /ship's review readers are now told never to stop processes they didn't start. (#4607)
- /ship's review no longer stops when Capy's own drive sync database grows past 100 MB. (#4606)
- /ship's preflight now honors your repository's time limit for rerunning CI-skipped tests, and tells you when a fresh worktree needs its packages installed. (#4608)
- The slowest free test file is now six files. (#4588)
- Step 11.5 keeps a reviewed head current across base-only merges. (#4577)
- On a Capy install, only the owner's opt-in sends telemetry. (#4597)
- New page: working across agent systems. (#4583)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.

1 participant