Repository navigation
Description
Problem
Every analytics event the server sends to PostHog is upstream's. No code under any src/j5 directory calls AnalyticsService, so we can't see whether A2A, the Inbox, Crews, personas, playbooks, artifacts, skills or the Fleet page are used, or whether they work.
The upstream events also undercount fleet activity. client.turn.requested and client.thread.started fire only when a person sends from the composer over the websocket (apps/server/src/ws.ts). Turns started by an agent-to-agent delivery, an Inbox reply, a spawn_agent brief, a Crew seat launch, a Crew notice, a playbook hand-off, delegate_task or a scheduled task skip that path. They still produce provider.turn.completed, but that event has nothing saying who started the turn or whether it was a Crew seat. "Active use" is therefore composer-only, and gets less representative the more J5 is used.
Decision
Jackson, 2026-10-10: J5 will send its own events, starting with the first cut below.
First cut
| Event | Fires when | Properties (counts, enums, durations only) | Answers |
|---|---|---|---|
j5.turn.started |
J5 starts a turn without the composer | origin (a2a, spawn_brief, crew_seat, playbook_step, notice), senderKind (human, agent, system), steer |
How much work happens without a human turn; fixes the undercount |
j5.fleet.snapshot |
Periodically | running agents, agent-spawned agents, live Crews, largest Crew, open asks to the person and to agents, stuck runs | Fleet size and concurrency per install |
j5.exchange.closed |
An Exchange closes or is dropped | outcome, receiverKind, urgency, durationMs, crossServer |
Reply rate, time to reply, how long asks wait in the Inbox |
j5.crew.proposal.resolved |
The person approves or declines a roster or an addition | kind, decision, requested and approved seat counts, edit counts, seconds open |
Approval, edit and decline rates; gate latency |
j5.crew.launched |
Seats are spawned | seat count, persona vs custom, per-driver and runtime-mode counts, spawn failure counts | Crew size and mix; seat launch failures |
j5.playbook.run.finished |
A run completes or is cancelled | outcome, cause, position, stepCount, crewBound, durationMs |
Completion rate and how far runs get |
Constraints
- Collection boundary (
docs/internals/product-analytics.md): no prompts, message bodies, briefs or document contents; no thread, participant, Exchange or Crew IDs; no user- or agent-written text. That rules out Crew, persona, playbook and skill names, artifact paths, Exchangeintent, peer labels, and error message strings (send the error tag only). - Count once. Most J5 commands are idempotent and several workers re-run at boot. Record on the committed-once branch (for the ledger, a subscriber on
LedgerService.subscribeCommitted), not in the service method a retry re-enters. - Stay out of upstream's files. Labelling
provider.turn.completedwith turn origin would mean editing upstream's ingestor, soj5.turn.startedis a separate event instead. - Opt-out unchanged. J5 events go through
AnalyticsServiceand so honourT3CODE_TELEMETRY_ENABLED=false. - Docs ship with the events. The privacy page lists events exhaustively (and already omits the ChatGPT auth events), and
docs/user/telemetry.mddescribes only turn-completion fields.docs/internals/product-analytics.mdtells readers to useclient.turn.requestedfor active use; that guidance is upstream's file, so J5's caveat belongs underdocs/j5/.
Later
- UI-only moments (Fleet page opened, expanders, archive warning shown or cancelled) have no route to PostHog, because clients have no analytics call. This needs a small J5-owned client-to-server path; see Move J5's client-facing actions onto WebSocket methods #506 for which transport.
- Delivery health per provider, MCP tool mix and rejection codes, silence notices, handoff written or missing, artifact reads, skill link targets, archive outcomes, peer pairing and poll failures.
Memos and the Spawning Guide aren't built, and scheduled tasks are upstream's, so none of the three is in scope.
Activity
feat(j5): report who started each turn (#515)
Jacksondr5 commentedon Oct 10, 2026
First cut status, 2026-10-10:
j5.turn.startedmerged in feat(j5): report who started each turn #515. It carriescreatedBy,creationSource,scheduled,wake,firstTurn,threadCreatedBy,threadCreationSourceandcrewSeatin place of the singleoriginfield proposed above, and it includes composer turns. Verified live against the dev project.J5CODE_TELEMETRY_TAGto find one run's events: Dev servers report usage into the real PostHog project, as the developer's own identity #513, merged in fix(j5): dev servers report usage to a separate PostHog project #514.j5.exchange.closed,j5.playbook.run.started/.finished,j5.crew.proposal.resolved,j5.crew.launched,j5.fleet.snapshot.feat(j5): report Exchanges, playbook runs, Crews and fleet size (#516)
Jacksondr5 commentedon Oct 24, 2026
Upstream now has generic feature and tool counting (Jackson, 2026-10-24)
The 2026-10-24 upstream advance brings three upstream analytics additions, adopted as shipped:
feature.used{ feature, variant?, surface? }(feat(server): count which product features people use pingdotgg/t3code#15921). It is recorded in the RPC authorization middleware after a request succeeds, using an allowlist inapps/server/src/telemetry/FeatureUsage.ts. Variants come only from closed contract enums.mcp.tool.invoked(feat(server): count which T3 MCP tools agents use pingdotgg/t3code#15913, with the volume fix in fix(server): stop flooding analytics with successful MCP tool calls pingdotgg/t3code#24287). It counts agent MCP tool calls, J5'sj5_*tools included, because they register throughtoolkitRegistration. That covers this issue's "MCP tool mix" item under Later.installIdandinstall.owner_observed(feat(server): analytics records a stable install id and who owns each install pingdotgg/t3code#21506).Decision: J5's person-triggered actions report through
feature.usedinstead of separatej5.*events wherever that fits. J5's client actions are WebSocket RPCs (apps/server/src/j5/wsRpc.ts,a2a/clientActionRpc.ts,agents/agentPersonaRpc.ts,skills/skillCatalogRpc.ts), so a J5-owned allowlist joined to upstream's lookup can count them: Inbox replies, Crew proposal approve, edit and decline, playbook start and cancel, persona assignment, skill install and link, artifact actions, and sharing. That needs one small integration case.This lands as its own PR after the advance merges, not inside the advance.
What stays as
j5.*events from the first cut: the thingsfeature.usedcan't express, because they aren't one person's request:j5.turn.started(turn origin);j5.fleet.snapshot;j5.exchange.closed(outcomes and durations);j5.crew.launched(seat mix);j5.playbook.run.finished(outcomes).j5.crew.proposal.resolvedmay become afeature.usedvariant, with only its counts and timing left over. Settle that when building.The privacy page and
docs/user/telemetry.mdgain the new upstream data in the advance itself.Jacksondr5 commentedon Oct 28, 2026
The
feature.usedpart of the decision above is now tracked as #766, in the v0.1.3 advance milestone.Jacksondr5 commentedon Nov 7, 2026
Narrowed to the "Later" list (Jackson, 2026-11-06, during the v0.1.7 advance review).
The first cut shipped. Checked by event name in the code at
j5/main2487e4240f, not in PostHog:j5.turn.started,j5.fleet.snapshot,j5.exchange.closed,j5.crew.launchedandj5.playbook.run.finishedare sent.j5.crew.proposal.resolvedwas built as upstream'sfeature.usedwith featurecrew.proposal.resolveand variant approve or decline (apps/server/src/j5/a2a/CrewProposalService.ts:343). It doesn't carry the requested and approved seat counts, edit counts or time open that the table above listed.feature.usedfor J5's person-triggered actions shipped in Count J5's person actions through upstream's feature.used #766.What remains here:
Claude Opus 5.5
[-]J5 features send no product analytics, and agent-started turns are invisible in what we do send[/-][+]J5 analytics, later: UI-only moments and health measures[/+]