Skip to content

Insights: what agents got done, for a workspace, a project and each person #621

Open

Description

@fctl-sh

People running fctl for an organization want to know what it's doing for them:

  • how many sessions people start, and how;
  • how many pull requests merge, and how fast;
  • who uses it and who doesn't yet;
  • where agents get stuck waiting for people;
  • whether the runner fleet is the right size.

fctl shows each session in detail, but nothing adds them up. The answers exist in fctl's data, but only someone who reads every session, or builds their own dashboards on webhooks, can see them.

How it works now

  • What each session records:
    • its stats in sessions.stats (SessionStats in crates/fctl-proto/src/session.rs): turns, input, output and cached tokens, tool calls, files changed, lines added and removed, busy time, and compactions;
    • who it runs for (created_by), and how it started (schedule_id, autopilot_id, service_account_id, ticket);
    • when it was created, started and ended.
  • Pull requests are in pull_request_sessions (migration 0019, crates/fctl-control/src/pull_requests.rs) with their state (open, draft, queued, merged, closed), kept current by GitHub's webhook (crates/fctl-control/src/api/webhooks.rs, ADR 0032).
    • No opened, merged or closed times are kept.
    • merge_checks.merged_at exists only for autopilots' pull requests, and goes three days after the merge.
  • Other activity in D1:
    • review agents' reviews and their findings (reviews, migration 0027);
    • questions (sessions.question, messaged_at, requested_at);
    • retrospectives with their outcomes (retrospectives);
    • plan usage per Claude connection (claude_usage).
  • Runners. FleetDO knows each runner's busy slots and each queued session's wait (fctl_domain::schedule::Wait), but keeps no history of either.
  • Webhooks post session.*, pull_request.opened/merged/closed and review.finished (docs/automation.md#webhooks), so an organization can build its own dashboards today.
  • Where pull requests show today: the pull requests page (web/src/routes/pulls.tsx) lists them, without numbers over time.

What should happen

  • Pull request facts. A pull_requests table (or columns on pull_request_sessions):

    • when each pull request opened, merged or closed;
    • its additions, deletions and changed files, and its base branch;
    • when it got its first review.

    It's filled from GitHub's pull_request and review events, which already arrive, and from the hourly lookups. A migration back-fills what GitHub still has for existing sessions' pull requests.

  • Questions' waits. A row for each question (asked, answered, by whom, how long it waited), written by SessionDO as it delivers the message that answers it.

  • Daily rollups: insights_daily (workspace, project, person, origin, day, …counters).

    • Counters are bumped where the facts happen: a session started or ended, a turn ended, a pull request opened or merged, a review posted, a question answered.
    • The hourly job (crates/fctl-control/src/housekeeping.rs) recomputes the last two days from the source tables, so a missed bump heals itself.
    • Long periods read only the rollups.
  • Runner history. FleetDO samples each workspace's (and pool's, Runner pools that grow and shrink with the sessions waiting for them #615) busy slots, capacity and waiting sessions every minute, and folds them into hours after a day and days after a month.

  • Runner hours per project and person, the sandbox time weighed by its size, for organizations that charge teams for what they use.

  • The API: GET /api/v1/workspaces/{id}/insights?from=&to=&by=day|person|project|origin, the same for a project, and a CSV download.

    • Access tokens that read see only their places.
    • Per-person rows follow the privacy setting below.
  • The CLI: fctl insights -w acme --since 30d --by person, with --json and --csv.

  • The page (Design and UX below), and a short "This month" on a project's page and "Your week" on the Agent Floor.

  • Docs: docs/architecture.md (what's counted and how), docs/api.md, docs/cli.md, docs/llms.txt, and fctl-site's privacy policy if per-person numbers count as new processing.

What the page measures

  • Six numbers for the period, each against the period before:
    • sessions started;
    • pull requests merged;
    • merge rate: merged of those opened that were decided;
    • median time from a session's start to its pull request merging;
    • agent hours (busy time);
    • median time agents waited for people, from a question to its answer.
  • Sessions over time, stacked by how they started: people, schedules, autopilots, Linear, Slack (Start and steer agents from Slack, with agents that read only what they should there #620), service accounts and review agents.
  • Pull requests per week: opened, merged, and closed without merging.
  • Where sessions ended up: a pull request that merged, one still open, no pull request needed, failed, stopped.
  • Reviews and follow-ups: findings per review, the share agents fixed, and the CI failures, conflicts and comments agents took care of by themselves.
  • Runners: busy slots against capacity, and how long sessions waited for a runner (median and 95th percentile). That's the chart that says whether the fleet is the right size.
  • Plan limits: sessions paused on Claude usage limits, by person. That shows where a bigger plan would pay off.
  • People and Projects tables:
    • sessions, pull requests opened and merged, merge rate, median time to merge, lines in merged pull requests, agent hours, questions answered and how fast;
    • a sparkline of their weeks;
    • sortable, exported as CSV.

Design and UX

Insights should be the page an engineering lead opens on Monday morning and understands in ten seconds: calm, accurate, and honest about what fctl observed. It's built to fctl's design standard, not a generic dashboard.

  • Where it lives. A workspace's admins already see nine tabs, and a tenth overflows the strip (measured in feat: service accounts that start agents for the people who allow them #587). So Insights is its own page in the sidebar, as Pull requests is, with the scope (a workspace, a project, a person) and the period (7, 30, 90 days, or chosen dates) in its header and its address.

  • The six numbers sit in a row of quiet tiles, each with its change ("+12 % on the 30 days before"). A tile that can't be computed says why: "No pull requests merged yet".

  • Charts follow one palette used for meaning, with origins in fixed colors everywhere they appear and red only for failures. Numbers roll rather than jump as the period changes, and motion stays off under reduced motion. Every chart has a table view for screen readers. Use the repository's dataviz skill for forms, colors and tooltips.

  • People see their own first. Members open on their own numbers, and admins on the workspace's.

  • Per-person numbers are sensitive. A workspace setting decides who sees each person's numbers:

    • admins and the person themselves (the default);
    • everyone in the workspace;
    • nobody (totals only).

    The page says which applies ("Only Acme's admins and each person see their own numbers").

  • No ranking. The people table sorts by name until someone sorts it, and has no medals or podium. There are no invented measures such as "hours saved": only what fctl observed, in its plain words.

  • Empty and early states teach: a new workspace sees what the page will show once sessions run, drawn from a made-up example and labelled as one.

  • On a phone, the tiles stack two by two, charts keep their meaning at 390 px, and tables turn into lists.

  • The CLI prints a compact summary in the same order as the page, and --by person a table that fits 100 columns.

  • Follow hyperstructure/design's docs: docs/principles.md; docs/web-app/explaining.md for pages that set something up (a headline that names the outcome, a lead built from this place's facts, a preview of the result, one primary action, and who can act); docs/web-app/kit.md for controls.

  • Design every state before building it: the first visit, loading, errors and refusals, waiting, partial setups and long lists.

  • Say what happens, plainly, and never leave someone at a disabled control without saying who can act.

  • Prototype the main screens with realistic data (cargo xtask demo's world) and review them before building the rest.

  • Check both themes, a phone's width, the keyboard, screen readers and reduced motion, and show screenshots in each pull request.

  • Give the CLI the same care: readable output, --json, and errors that say what to do next.

  • Add or update the pages of hyperstructure/design's docs for each new component, with the reasons behind its choices.

Compatibility

  • Control plane and web app only. Hosts and agents already report everything needed.
  • Data. New D1 tables in a new migration, and a back-fill that runs in the hourly job in batches, so that it never holds the database for long. FleetDO's samples live in its own storage.
  • Older sessions have no question rows. Their waits start counting from the release.

Decisions for a person

  • Visibility: the default for who sees each person's numbers.
  • Cost: whether runner hours (cost) belong on this page, or on the Runners tab.
  • Shape of the page: whether Insights is its own page in the sidebar, or a workspace tab once GitHub, Linear and Slack fold into one Integrations tab.
  • Retention: how long rollups are kept, and whether deleting a session removes it from past numbers.

Related: #615, #620, #627

Session: https://app.fctl.sh/s/ses_01M8450BECFP8DN88R0ZP0N0MS

Activity

  1. added
    enhancement
    control-plane
    web
    cli
    on Nov 23, 2026
  2. fctl-sh commented on Nov 24, 2026

    @fctl-sh
    ContributorAuthor

    A note from fctl session #1545 for the Runner history item: #615's design wants a small 24-hour chart of busy slots against capacity, and of waiting sessions, on each pool's card on the Runners tab, from the same series. #644 adds those cards without the chart, since the control plane keeps no such series yet. Once this history exists, the cards (PoolCard in web/src/components/workspace/runners.tsx) are where each pool's series goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clicontrol-planeenhancementweb

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions