Skip to content

feat(j5): report Exchanges, playbook runs, Crews and fleet size - #516

Merged
Jacksondr5 merged 4 commits into
j5/mainfrom
j5/first-cut-analytics
Oct 10, 2026
Merged

Jacksondr5 merged 4 commits into
j5/mainfrom
j5/first-cut-analytics

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Problem

J5's features sent no product analytics, so we could not tell whether asks get answered, whether playbook runs finish, how people respond to Crew rosters, or how many agents work at once. This is the rest of the first cut agreed in #510; j5.turn.started landed in #515.

What changed

Four groups of events, one commit each. All carry counts, enums and durations only: no text, no IDs, no names.

Event Recorded when Answers
j5.exchange.closed An Exchange closes or is dropped Reply rate, time to reply, how long an ask waits on the person
j5.playbook.run.started, j5.playbook.run.finished A run starts; a run completes or is cancelled (by its agent or by a Crew archive) Completion rate and how far runs get
j5.crew.proposal.resolved, j5.crew.launched The person approves or declines a roster or an addition; seats are spawned Approval and edit rates, time at the gate, Crew size, seats that fail to start
j5.fleet.snapshot Every fifteen minutes How many threads work at once, how many an agent started, open asks

How each counts once:

  • Exchanges are read from the ledger's committed-event stream, which publishes once per commit.
  • Playbook runs are recorded after the run's change commits, and a replayed client_request_id records nothing.
  • Crew decisions are recorded after the decision is stored; a second decision on the same proposal is refused before that point.

The playbook and Crew services take the analytics service if the layer graph has one and record nothing otherwise (j5/analytics/recorder.ts), so their many unit layers did not have to change. The server's graph always has it.

j5.playbook.run.started was not in the first cut as listed in #510. Without it, a run that is abandoned never produces an event, so completion rate had no denominator.

Not covered: a run cancelled because its owner thread was deleted (a bulk update with no per-run record), whether an Exchange crossed servers, and which providers a Crew's seats use (the provider instance id is a name the person chooses).

UI changes

The privacy page's event list gains five items.

Before After
Usage data section before Usage data section after, with the five new items

Checklist

  • One concern: the description has no "also". Four event groups in one PR, because each touches the same wiring file and the privacy page; they are separate commits.
  • Tests cover the changed behavior (backend changes ship with focused tests)
  • UI changes: before/after screenshots above, and a video for motion or interaction
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR. None edited.
  • Upstream product: any change to what upstream's product does has a human decision linked above and a register entry in docs/j5/product/upstream.md. Upstream's events are unchanged; J5 sending its own was decided in J5 analytics, later: UI-only moments and health measures #510.
  • Surfaces: entry points, clients, providers, contracts, reverse states, connection modes (see AGENTS.md). Server only. Each event is recorded in the service method every door reaches (UI, MCP tools, Crew archive), on every provider.
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them. docs/user/telemetry.md and the privacy page.

Claude Opus 5.5 (1M context), Claude Code in J5 Code.

🤖 Generated with Claude Code

Jacksondr5 and others added 4 commits October 10, 2026 12:53
Nothing told us whether asks between agents, or from an agent to the
person, get answered, or how long one waits. J5 now records
j5.exchange.closed when an Exchange closes or is dropped, with the
outcome, the kind of participant on each side, the urgency and the time
it was open. It reads the ledger's committed events, so a retried reply
or withdrawal counts once.

Part of #510

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Nothing told us whether playbook runs finish or how far they get. J5 now
records j5.playbook.run.started with the run's shape, and
j5.playbook.run.finished when a run completes or is cancelled, with the
step it reached and how long it ran. Both are recorded after the run's
change commits and skip a replayed request, so a retry counts once.

Part of #510

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Nothing told us how often a person approves, edits or declines a roster,
how big Crews are, or how often a seat fails to start. J5 now records
j5.crew.proposal.resolved when the person decides, with what they
changed and how long the gate was open, and j5.crew.launched when seats
are spawned, with counts of seats by kind and by launch outcome.

Part of #510

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The boot heartbeat counts threads and projects, which says nothing about
how many agents work at once. J5 now records j5.fleet.snapshot every
fifteen minutes with counts of working threads, the ones an agent
started, queued turns, live Crews and their largest roster, and asks
waiting on the person and on agents.

Part of #510

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Oct 10, 2026 4:55pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: bab92f2c-d075-470c-8087-015f93270498


📥 Commits

Reviewing files that changed from the base of the PR and between f75195f and 5e0d7a1.



📒 Files selected for processing (14)
  • apps/marketing/src/pages/privacy-policy.astro
  • apps/server/src/j5/a2a/CrewLaunchService.test.ts
  • apps/server/src/j5/a2a/CrewLaunchService.ts
  • apps/server/src/j5/a2a/CrewProposalService.test.ts
  • apps/server/src/j5/a2a/CrewProposalService.ts
  • apps/server/src/j5/a2a/runtimeLayer.ts
  • apps/server/src/j5/analytics/ExchangeAnalytics.test.ts
  • apps/server/src/j5/analytics/ExchangeAnalytics.ts
  • apps/server/src/j5/analytics/FleetSnapshot.test.ts
  • apps/server/src/j5/analytics/FleetSnapshot.ts
  • apps/server/src/j5/analytics/recorder.ts
  • apps/server/src/j5/playbooks/PlaybookStore.test.ts
  • apps/server/src/j5/playbooks/PlaybookStore.ts
  • docs/user/telemetry.md


Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.




📝 Walkthrough
📝 Walkthrough

Walkthrough

Changes

The pull request adds J5 analytics recording for playbook run lifecycle events, Crew proposals and launches, exchange closures, and periodic fleet snapshots. Runtime wiring, integration tests, privacy-policy text, and telemetry documentation are included.

J5 analytics instrumentation

Layer / File(s) Summary
Analytics recorder and playbook lifecycle
apps/server/src/j5/analytics/recorder.ts, apps/server/src/j5/playbooks/PlaybookStore.ts, apps/server/src/j5/playbooks/PlaybookStore.test.ts
Adds optional J5 event recording and timestamp duration calculation. Playbook starts, completions, cancellations, and Crew-archive cancellations record lifecycle events.
Crew proposal and launch events
apps/server/src/j5/a2a/CrewProposalService.ts, apps/server/src/j5/a2a/CrewProposalService.test.ts, apps/server/src/j5/a2a/CrewLaunchService.ts, apps/server/src/j5/a2a/CrewLaunchService.test.ts
Records proposal decisions, roster changes, launch configuration, and launch outcomes. Tests verify approval, decline, initial launch, and added-seat records.
Exchange and fleet analytics services
apps/server/src/j5/analytics/ExchangeAnalytics.ts, apps/server/src/j5/analytics/FleetSnapshot.ts, apps/server/src/j5/analytics/*.test.ts, apps/server/src/j5/a2a/runtimeLayer.ts
Adds committed exchange event handling and fifteen-minute fleet snapshots. Runtime composition includes both analytics layers.
Telemetry documentation
apps/marketing/src/pages/privacy-policy.astro, docs/user/telemetry.md
Documents the added event types and recorded fields.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant PlaybookStore
  participant CrewProposalService
  participant CrewLaunchService
  participant j5AnalyticsRecorder
  participant AnalyticsService
  PlaybookStore->>j5AnalyticsRecorder: record playbook lifecycle event
  CrewProposalService->>j5AnalyticsRecorder: record proposal resolution
  CrewLaunchService->>j5AnalyticsRecorder: record crew launch
  j5AnalyticsRecorder->>AnalyticsService: record j5 event
Loading


Merge Risk: ⚪ Minimal · up to 5e0d7

The investigated analytics paths do not introduce a demonstrated workflow failure. The PR is mergeable after normal checks.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the primary change: reporting analytics for Exchanges, playbook runs, Crews, and fleet size.
Description check Passed The description includes the problem, implementation details, UI evidence, testing information, scope notes, checklist status, and documentation impact. It is mostly complete, although the template's …

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Jacksondr5
Jacksondr5 merged commit ce235f8 into j5/main Oct 10, 2026
37 checks passed
@Jacksondr5
Jacksondr5 deleted the j5/first-cut-analytics branch October 10, 2026 17:15
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026

This branch was successfully deployed

1 active deployment
Preview — 5e0d7a1b Deployed Oct 10, 2026 by vercel[bot]
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