Skip to content

Telemetry records why skill runs end, which host and model ran them, and how upgrades went (GST-3234) - #4542

Merged
capy-ai[bot] merged 7 commits into
mainfrom
next-telemetry-fields
Nov 19, 2026
Merged

capy-ai[bot] merged 7 commits into
mainfrom
next-telemetry-fields

Conversation

@garrytan

@garrytan garrytan commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

gstack's anonymous usage telemetry now records nine more fields: the host and model family, how a skill was started, why it ended, whether checks passed, how skill routing is set up, a random per-session id, and for upgrades the version left and any error.
This tells us where skills stop working and which setups break upgrades, which the current outcome-only data can't show.
Deploy in order after merge: apply migration 009, deploy the telemetry-ingest function, then release the client; apply migration 007 after that.

What each new field holds
Field Values Set by
host claude_code, codex, cursor, openclaw, hermes, other, unknown detected by gstack-skill-end
model_family claude_opus, claude_sonnet, claude_haiku, claude_other, gpt, gemini, other the agent, at skill end
invoked user, model, chained the agent
exit_reason completed, user_stopped, blocked, tool_error, test_failed, context_limit, gave_up the agent
checks passed, failed, not_run the agent
routing none, block, hooks, both detected from CLAUDE.md / AGENTS.md and settings.json
harness_session_id 16 hex characters, random per agent session, never reused stored in the existing session marker
from_version the version an upgrade started from gstack-upgrade
upgrade_error none, refused_dirty, busy, fetch_failed, setup_failed, other gstack-upgrade

An empty value is stored as null and a value outside the list as unknown, on both the client and the server, so a wrong guess from a model can't add new categories. The session id is sent on both the community and anonymous tiers; the consent text now says so: "Anonymous mode sends the same usage with no device ID; a random id per agent session that is never reused." docs/privacy.md lists every field.

Other fixes in this change
  • Runs started by evals or CI are now labelled eval or ci instead of live (an explicit flag still wins, then GSTACK_TELEMETRY_SOURCE).
  • The server keeps the raw outcome in outcome_raw and maps known spellings to the four standard outcomes.
  • A skill run with no start time records an empty duration instead of 0.
  • Migration 007 now drops the three old row-level policies first and counts only non-zero backup_version values, so it can be applied cleanly after this merges.
  • Migration 009 grants the new view and columns to the service role only and revokes them from public, anon and authenticated.
  • The added prompt lines are byte-neutral: the telemetry step was reworded so every generated skill stays exactly its previous size.
Deploy steps and notes from the live project
  1. Apply supabase/migrations/009_next_telemetry_fields.sql.
  2. Deploy supabase/functions/telemetry-ingest (verify_jwt off, as today).
  3. Release the client (gstack-skill-end, gstack-telemetry-log, gstack-upgrade).
  4. Apply migration 007.

The previous change (#4537) is already deployed. While deploying it we also deleted the unused community-benchmarks and community-recommendations functions; their sources are saved and both now return 404. Two things seen on the live project, left as they are: default privileges set by supabase_admin in the public schema still grant anon and authenticated, because the postgres role can't change them; and a handful of rows arrived with source "other" after the deploy.

Known limits left open
  • Deploy order matters: the new telemetry-ingest must not go live before migration 009, or every insert fails until 009 lands (clients keep their events and retry).
  • Some upgrades are mislabelled: an upgrade through --ff-only-no-reinstall (how Capy sessions upgrade) reports success before the install check runs, and /gstack-upgrade goes through gstack-ff-update, which sends no upgrade event.
  • Routing detection reads CLAUDE.md and AGENTS.md in the current directory only.
  • People who already opted in don't see the new consent text.
  • Pending events written before this change have no source and count as live.
  • outcome_raw keeps the raw outcome cut to 20 characters.
  • The migration tests check the SQL text only; nothing applies it to a database.
  • Smaller review notes: gstack-skill-end --help lists --checks none, which is sent as unknown; an outcome spelled like a built-in object key (constructor) can fail an ingest batch; two skill ends racing on an empty session marker can split one session's id; migration 009 adds CHECK columns and an index without CONCURRENTLY, so inserts wait while it runs; an upload batch over 45,000 bytes is not tested past the first POST.
Agent notes
  • Approval: Garry, 2026-11-19, "do it" (E1, F1, G1), relayed by the maintainer's coordinator on GST-3234; plan reviewed with /autoplan (gate_rev=1).
  • Focused checks on this tree: typecheck clean; 32 test files, 1303 pass, 1 skip, 0 fail, including parity-suite and context-budget-ratchet with no thresholds changed; gstack-regen check fresh (skill-docs and ship goldens).
  • Ruled: Captain GStack Minder (GSTA-36), 2026-11-19: one read-only full review of Telemetry records why skill runs end, which host and model ran them, and how upgrades went (GST-3234) #4542 at 4865435 (R51 past-two-rounds), no fix round; reason: both Step 11 blockers were fixed in 9705772 and the approved-list alignment in 4865435 is unreviewed. Recorded as approval a-8e25260a2993.
  • Full review at 4865435 (run ship-4542-4865, tree f2f6782a): batched specialist (testing, security, data-migration, state-machines), red team, native adversarial and a GPT-6.1 Sol second-model review. The second-model review raised 2 blockers (v1/outside-voice#1 upload cap counted characters, not bytes; v1/outside-voice#2 a recycled pid kept a stale session id).
  • Fix-check grant a-760f5e4cd63a (Captain GStack Minder, 2026-11-19) bought one scoped fix-check for the stop at 4865435. Fixes in 8dc7ab6 with failing-first tests; the fix-check reader (ship-4542-4865-fc1) found no findings and confirmed both new tests fail without the fix. finish: FIX_CHECK: reviewed bin/gstack-skill-start,bin/gstack-telemetry-sync,test/next-telemetry-fields.test.ts.
  • REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=8 fixed=2 scope=frozen fix_checks=1 dispatches=5
  • Gate edits: none detected (7 listed, 4 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
  • Documentation: current (docs/ and README.md; audit docs-4542-1).
  • Tests ran: targeted 99 (6 telemetry test files at tree e0536638); the full free suite is carried from CI at the final head.

Approvals

Approved: yes (record r-363fc947c1db). The full approval record stays private.
Plan: approved (record r-f52780186857)
Plan check: approved (record r-f52780186857)

{
  "schema_version": 1,
  "pr": 4542,
  "head": "8dc7ab61ce3f8849f856345acaff80abedbec6a0",
  "version": "1.102.0.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 99,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44632353564,
      "attempt": 1,
      "tree": "e053663868652c0799c93a23f6a74e5604ec3360"
    }
  ],
  "calls": 19,
  "session_kind": "unattended",
  "run": "ship-4542-4865",
  "head_tree": "e053663868652c0799c93a23f6a74e5604ec3360",
  "product_patch_id": "d0892c894682f47f7355f7f7885ac41845278d9a",
  "gstack_version": "1.102.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 283,
    "rules": "1afa38a4be3b5eef",
    "base": "9093238eef258f50738178c17f600360574e936b",
    "registry": "9093238eef258f50738178c17f600360574e936b",
    "gate_scan": {
      "tagged": 0,
      "head": "8dc7ab61ce3f8849f856345acaff80abedbec6a0"
    },
    "reasons": [
      "gate-class",
      "risk:data",
      "runtime=283"
    ],
    "risk": [
      "data"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @e05366386865 (8 checks, current for 8dc7ab61ce3f)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44632353564/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44629470962/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=e05366386865 tests=38437 skipped=104 runs=44632353564/1 profiles=ci-reuse/free-tests heads=8dc7ab61ce3f verified=2026-11-19T22:59:04.407Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md (docs/privacy.md and README Privacy & Telemetry checked against the telemetry code)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 8,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "dispatches": {
      "specialist": 4,
      "red-team": 1
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "486543578906a102cef574769bd97ecd61194576",
      "pr": 4542,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "Captain GStack Minder (GSTA-36), 2026-11-19: one scoped fix-check on #4542 for v1/outside-voice#1 (count batch bytes with LC_ALL=C) and #2 (delete stale session markers before the touch)",
      "at": "2026-11-19T22:33:19.836Z",
      "approval": "a-760f5e4cd63a",
      "stop_run": "ship-4542-4865",
      "findings": [
        "v1/outside-voice#1",
        "v1/outside-voice#2"
      ]
    }
  ],
  "gate_dispositions": []
}
{"head":"2dbf241b29cee780109030cf2bd99a63a2ab3afd","run":"ship-4542-e6b8","status":"started","review_loop":{"passes":1,"blocking_found":2,"deferred":0,"noted":6,"fixed":2,"scope":"frozen","fix_checks":1,"rounds":2,"dispatches":{"specialist":1,"red-team":1}}}
{"head":"486543578906a102cef574769bd97ecd61194576","run":"ship-4542-4865","mark":"stop","tree":"f2f6782a229889822463215149a93f08a4794e2f"}
{"head":"486543578906a102cef574769bd97ecd61194576","run":"ship-4542-4865","mark":"grant","grant":"a-760f5e4cd63a"}

Open in Capy

garrytan and others added 2 commits November 19, 2026 21:12
… them

Adds migration 009 (new columns with value checks, a session index, the refreshed live-events view, and service-role-only grants), teaches the ingest function to accept and normalize the fields, and fixes migration 007 so it can be applied after this lands.

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

gstack-skill-end and gstack-telemetry-log take the approved new fields, gstack-upgrade reports its outcome, the consent text names them, and the skill telemetry step asks for them without growing any skill's size.

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

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 5 commits November 19, 2026 21:18
The previous wording matched every skill's byte size but grew the character count by 4, which the per-host size pins count.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A reinstall whose only failure is the stale Drive wrapper now reports success instead of setup_failed, and a test pins one upgrade_completed event per run.

Review-Finding: p1/specialist-batched#2 reader=specialist-batched
Review-Finding: p1/specialist-batched#3 reader=specialist-batched
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…t hosts send no session id

Each upload now stops adding events before 45,000 bytes, so a backlog of the larger events can no longer be refused forever with 413. Under a host that runs every session in one process (Capy's capy-server), skill runs send no harness_session_id, so separate sessions are never linked.

Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Review-Finding: p1/outside-voice#2 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
host keeps the approved seven values (other gstack hosts report other), checks drops the unapproved none, the skill prompt lists claude_other, the telemetry step no longer claims it writes only to analytics, and migration 009's header records that 007 has not been applied yet. Every generated skill keeps its byte and character size.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s id never inherits an old session id

The 45,000 limit on each upload now counts bytes (LC_ALL=C), so batches with multi-byte text no longer pass 50,000 bytes and stall on 413. gstack-skill-start deletes stale session markers before touching the current one, so a new process that reuses an old pid gets a fresh harness_session_id.

Review-Finding: v1/outside-voice#1 reader=outside-voice
Review-Finding: v1/outside-voice#2 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 9ea26ec into main Nov 19, 2026
78 checks passed
@garrytan garrytan mentioned this pull request Nov 20, 2026
capy-ai Bot added a commit that referenced this pull request Nov 20, 2026
- Two /ship approval records stop needing workarounds. (#4549)
- For contributors: the paid auto-decide check counts a start step that ran while the skill loaded. (#4543)
- The destructive-command check closes three ways past its disk-wipe and force-push blocks. (#4534)
- A green CI run still counts when the repository's artifact storage is full. (#4536)
- `/cso` now audits repositories that track symlinks. (#4567)
- A doc-sync eval stops failing when the audit child drops one field from its result line. (#4555)
- The browse daemon no longer picks port 10080, which Chromium refuses to open. (#4554)
- Opted-in telemetry now says why a skill run ended, which coding agent and model family ran it, and whether an upgrade worked. (#4542)
- A preregistration with only its write-up and plain data now gets the write-up review: one reviewer, one round. (#4544)
- When owner rulings don't clear a stopped review, `gstack-review-read` now says which findings are left. (#4553)
- The prompt-routing hook now names your installed bug-fix skill on bug reports, alone, and never puts /verify ahead of it. (#4539)
- Owner rulings now close a stopped review whose findings were logged in a findings file. (#4568)
- /ship can finish after the owner accepts a stopped review's findings as open notes. (#4552)
- /ship no longer starts the full test suite on your machine when CI's earlier run can't be reused (GST-3277). (#4565)
- The prompt-routing hook no longer acts on words inside backticks. (#4566)
- In Claude Code, a gstack skill's start step now runs when the skill loads, so the model can't skip it. (#4509)
- gstack's telemetry backend only accepts writes through its own validated endpoint, and the community dashboard now counts real use. (#4537)
- gstack now says what it's adding before it adds a background job or a browser extension. (#4538)
- For contributors: every flaky pass in Free Tests is now recorded. (#4572)
- For contributors: Free Tests on pull requests starts its test shards one round of small jobs sooner. (#4570)
- Secret values written as `name=value` at the end of a path are now hidden. (#4571)

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