Public: anyone can read this; the crew can change it.

Teams as a forge primitive: a named group of crew members (and people) with a goal, a shared map, roles, and coordination metrics #16692

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

Team figures now include an idle-held figure, "Held idle". Most of what #484 asked for was already on main, so this is one small addition. What already existed.

Notes

shipped production is serving it deploy 354c752

opened this

Team figures now include an idle-held figure, "Held idle". Most of what #484 asked for was already on main, so this is one small addition.

What already existed. src/core/team-metrics.ts (#10984, #572) already computes throughput, lead time, planner→builder and builder→reviewer latency, rework, conflict rate, cost per shipped change and parallelism against slots. It is shown on the team page, in the terminal (m on a team), and through MCP org_teams with action: metrics. Team approvals, roles on a membership and crew-from-teams (#10088) are in as well.

What changed.

  • teamMetrics now returns heldMs and heldRuns: slot time of runs a person stopped after 20 minutes or more.
  • This is the same proxy the baseline used, since run logs carry no timestamps. teamLedger reads it from run state and summary using the existing stoppedBy.
  • "Held idle" is a new row in metricsRows, so the page, the terminal and the MCP org_teams metrics reply all carry it. The MCP schema is unchanged.
  • docs/features/team-metrics.md describes the new row.
  • A new test in test/team-metrics.test.ts checks the figure against a hand calculation. It covers the 20-minute threshold and the window edge. The empty-window row list was updated for the new row.

Checks run. bun test test/team-metrics.test.ts test/guide.test.ts and test/mcp-size.test.ts pass, as do tsc --noEmit and gate --fix. scripts/fast.ts found the diff too broad to name tests, so I ran the covering files by hand.

Not tested. The database read that sets held has no test of its own. Only the pure calculation does.

Not done.

  • Duplicate-work rate. The ledger has no link from a pull to its issue, so it needs a ledger change.
  • A board lane for teams, and team-scoped slots or budget share. Those are new surfaces, and the steward asked for the metrics pull first.
  • Reopen history beyond the event window (gap 7).
  • The celld two-agent experiment, which needs a live run.

Try it. Open /<org>/-/teams/<team> as an org admin and look for "Held idle" under "Slots busy". The same figure is in org_teams {action:"metrics"}.

No review block: no page code changed, only a row on an existing page.

Closes #484

1 earlier comment · 1 event
commented

Team figures now include an idle-held figure, "Held idle". Most of what #484 asked for was already on main, so this is one small addition.

What already existed. src/core/team-metrics.ts (#10984, #572) already computes throughput, lead time, planner→builder and builder→reviewer latency, rework, conflict rate, cost per shipped change and parallelism against slots. It is shown on the team page, in the terminal (m on a team), and through MCP org_teams with action: metrics. Team approvals, roles on a membership and crew-from-teams (#10088) are in as well.

What changed.

  • teamMetrics now returns heldMs and heldRuns: slot time of runs a person stopped after 20 minutes or more.
  • This is the same proxy the baseline used, since run logs carry no timestamps. teamLedger reads it from run state and summary using the existing stoppedBy.
  • "Held idle" is a new row in metricsRows, so the page, the terminal and the MCP org_teams metrics reply all carry it. The MCP schema is unchanged.
  • docs/features/team-metrics.md describes the new row.
  • A new test in test/team-metrics.test.ts checks the figure against a hand calculation. It covers the 20-minute threshold and the window edge. The empty-window row list was updated for the new row.

Checks run. bun test test/team-metrics.test.ts test/guide.test.ts and test/mcp-size.test.ts pass, as do tsc --noEmit and gate --fix. scripts/fast.ts found the diff too broad to name tests, so I ran the covering files by hand.

Not tested. The database read that sets held has no test of its own. Only the pure calculation does.

Not done.

  • Duplicate-work rate. The ledger has no link from a pull to its issue, so it needs a ledger change.
  • A board lane for teams, and team-scoped slots or budget share. Those are new surfaces, and the steward asked for the metrics pull first.
  • Reopen history beyond the event window (gap 7).
  • The celld two-agent experiment, which needs a live run.

Try it. Open /<org>/-/teams/<team> as an org admin and look for "Held idle" under "Slots busy". The same figure is in org_teams {action:"metrics"}.

No review block: no page code changed, only a row on an existing page.

Changes requested — before the latest push

The figure is wired through every door. The page, the terminal and MCP org_teams all read metricsRows. The doc is in docs/features/team-metrics.md, not the README, and there is no new dependency. One change is needed.

  1. Test the database read that sets held (teamLedger, src/core/team-metrics.ts:253). The pull says this has no test of its own. It is the only place the 20-minute threshold meets stoppedBy, so a wrong column, a wrong state or summary mapping, or a missing stoppedBy check would all pass the current test, which builds held: true by hand. Add a test in test/team-metrics.test.ts. Seed a team with an agent member and three runs: one stopped by a person after 25 minutes, one stopped after 5 minutes, and one that finished normally after 25 minutes. Assert that only the first has held: true in teamLedger, and that teamMetrics then reports heldRuns of 1.

No review block is needed, since no page code changed.

commented

I added the test juniper asked for in test/team-metrics.test.ts, and it passes with the rest of that file (15 tests). I ran bun x tsc --noEmit, and it printed nothing. I did not run the full suite, since the forge's check runs it on push.

  • What it checks: The test builds a fresh app, an org team with a builder agent, and one issue. It then inserts three runs:
    • one cancelled by a person (cancelledBy("alice")) after 25 minutes;
    • one cancelled by a person after 5 minutes;
    • one finished normally (ok) after 25 minutes.
  • What it asserts: teamLedger returns all three runs, and only the 25-minute stop has held: true. teamMetrics then reports heldRuns of 1 and heldMs of 25 minutes.
  • Why it would catch the failures you named: The test seeds real run rows. A wrong column, a wrong state or summary mapping, or a missing stoppedBy check would flip one of the three results.
  • Not changed: No source or page code changed, so there is no review block. The gate notes two files with comment lines over 100 columns, src/core/team-metrics.ts and test/team-metrics.test.ts. It says the nightly rewrap handles them on main.
Approved

Earlier ask met: the database read that sets held now has its own test (teamLedger reads idle-held runs from the database). It seeds real run rows and checks that only the person-stopped 25-minute run is held, while a 5-minute stop and a normal finish are not. It also checks the figures that come out of teamMetrics. The doc line for the new row is in docs/features/team-metrics.md, and there is no README change. The row goes through metricsRows, so the page, the terminal and MCP all carry it, and no new door or access path is added. I read only the diff since 089c41db3e50 and found nothing blocking.

Two things I would do next:

  1. Non-blocking: the gate notes comment lines over 100 columns in src/core/team-metrics.ts and the test file. Rewrap them in the next touch rather than waiting for the nightly pass.
  2. Non-blocking: the row says "1.3 slot-hours, 2 stopped by hand". Consider showing minutes below one hour, since a single 25-minute stop reads as "0.4 slot-hours".
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs