UI completion pass + accountability & benchmarking

UI (daily-drivable now):
- Board: dnd-kit drag-and-drop between columns; click a card → task detail drawer (Sheet)
  with status, member assignee picker, send-to-AI-seat dispatch, description/artifact,
  parent/children navigation; seat-triad assignee chips (AI indigo monogram / human slate).
- Cartable page (the personal pending slice), Members & invitations page (invite + copy
  join token; V1 sends no email), Review inbox now shows a word-level diff of your edits
  vs the proposal (lib/diff.ts, LCS), Org chart page (React Flow: org → teams → seats in
  the human/open/AI triad). Nav reordered; nothing left "soon".

Accountability & benchmarking:
- Identity: GET /members (directory + org role) and GET /invitations (with join token,
  inviter-only) — the directory also resolves names client-side everywhere.
- OrgBoard: work_item_transitions recorded on every status change (AddWorkItemTransitions
  migration); GET /performance — per assignee (human and AI on the same scale): pending by
  column, done, worked hours (time in InProgress), avg cycle time (start of work → done),
  plus the unassigned-pending count. Owner-level capability.
- Performance page: benchmark table merging board metrics with AI trust metrics (approval
  rate + edit distance from analytics); flags work with no one accountable.

Verified: build green; ArchitectureTests 8/8; IntegrationTests 43/43 (new: directory,
invitations list + Member 403s, transition-derived worked-hours/cycle-time, unassigned
count); client npm build green (TS strict).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-10 12:54:13 +03:30
parent 82033c2733
commit d853609213
21 changed files with 1907 additions and 130 deletions
@@ -30,6 +30,8 @@ internal static class OrgBoardEndpoints
group.MapGet("/seats", ListSeats).RequireAuthorization();
group.MapPost("/seats/{id:guid}/agent", ConfigureAgent).RequireAuthorization();
group.MapGet("/seats/{id:guid}/agent", GetAgent).RequireAuthorization();
group.MapGet("/performance", PerformanceEndpoints.Get).RequireAuthorization();
}
private static TaskResponse ToResponse(WorkItem item) => new(
@@ -175,7 +177,15 @@ internal static class OrgBoardEndpoints
return Results.Forbid();
}
item!.MoveTo(request.Status, clock.GetUtcNow());
var fromStatus = item!.Status;
item.MoveTo(request.Status, clock.GetUtcNow());
if (fromStatus != request.Status)
{
// The raw material for working-hours / cycle-time accountability metrics.
db.Transitions.Add(new WorkItemTransition(
item.Id, team.Id, fromStatus, request.Status, user.MemberId, clock.GetUtcNow()));
}
await db.SaveChangesAsync(ct);
await audit.WriteAsync(new AuditEvent("task.moved", "WorkItem", item.Id, user.MemberId, request.Status.ToString()), ct);