Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

Coaching: leader rollups in the leader's own space, per-rep view in the Files tab

merged#2929CedarCopilot

CedarCopilot wants to merge 2 commits into staging from worktree-send-it-coaching-leader-view

Customer behavior verdict

Libra exercised 1 changed behavior; none regressed.

Who this touches

  • Manager teammate listings stay within managed agents and the caller’s organization: no production calls in the last 7 days.
  • Leader coaching rollups are written in the leader’s team space: no production calls in the last 7 days.
  • Leaders can open each teammate’s files as separate lazy read-only sections: 2 of 604 API requests in the last 7 days; 0 failed (0%).
  • Leaders can open each teammate’s files as separate lazy read-only sections: Held on this PR; the scenario fails when this is broken on purpose.

What Libra verified

  • Leaders can open each teammate’s files as separate lazy read-only sections

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • each teammate appears as a separately keyed labeled section even when teammates share the same agent path
    • each teammate section for an org-namespaced agent is marked read-only

    Changed code: AgentOutputTab.tsx.

Live on prod, 0 of 10 surfaces working, 2 days leftTimeline and evidence
  1. Opened
    Sep 23, 2026, 11:44 PM
  2. Sep 24, 2026, 12:21 AM
  3. Merged
    Sep 24, 2026, 12:49 PM
  4. Live on prod
    Sep 24, 2026, 12:49 PM
  5. Observed 0 hours, 10 surfaces, 9 requests
    Sep 24, 2026, 12:49 PM
  6. Watching

    Live on prod, 0 of 10 surfaces working, 2 days left

    Sep 24, 2026, 12:49 PM
  7. Pipelines steady after this deploy
    Sep 24, 2026, 12:49 PM

Behaviors Libra is checking

An org-scoped leader's agent Files tab displays one labeled section per returned teammate in the returned order, while representatives and read-only views receive no extra team sections.Not checked
prod
A text document opened from a teammate section is selectable and copyable with live links, remains non-editable, accepts remote updates, and never sends local Yjs changes to the server.Not checked
prod
Each teammate's copy of the shared `user/agent-{id}` path is fetched under that teammate's user scope and kept separate by a unique section key, preventing rows from one representative appearing in another representative's section.Not checked
prod
Teammate sections start collapsed, fetch their contents only after being opened, and do not keep the leader's primary file tree in a loading state while unopened sections load.Not checked
prod
An attachment opened from a read-only teammate section remains usable for downloading because downloads are not treated as edits.Not checked
prod
Files shown in a teammate section are review-only with create, rename, move, delete, share, drag-and-drop, drop-target, and selection actions removed, while opening the file and viewing history remain available.Not checked
prod

Libra found 10 production surfaces on prod but could not judge any of them yet. 2 surfaces had under 20 requests, so Libra has not judged them; 8 surfaces had no requests at all. Libra checks hourly for 3 days after each deploy.

Summary

  • Leader weekly output no longer collides with reps' rows. A leader's run cannot write into a rep's row: the path text is identical per person and the row belongs to whoever ran the write, so each Tuesday run created a second, leader-owned coaching/{slug}/coaching-overview next to the rep's own. Per-rep rollups now go to the leader's own space (user/agent-{id}/team/{slug}/...), the agent body lists the only paths each run may write, and the playbook/template text that contradicted it (legacy coaching/outputs/reps/{name} layout, second-pass schedule, per-call documents, manager notes) is removed.
  • Leaders can browse each rep's folder in the agent Files tab. New agent.getTeamMembers plus read-only, lazy per-teammate sections (extends the "My files" cross-scope sections from #2868). An org admin already passed the scope gate; an agent manager who is not an org admin now can for listings only.
  • The manager path is deliberately narrow. It is an explicit second gate used only by listChildren, requires a same-org target who owns a live row under an agent the caller manages, is read-only, and is confined to user/agent-{id} for the agents the caller manages. By-id routes (getDownloadUrl, unseenAgentSessions, applyUpdate, markOpened), search, grep, graph, map and asUserId are refused (tested).

Test plan

  • pnpm -w run autofix:local: brand, oxlint, deps:check and paraglide pass; mail jest 5252 pass, 1 fail (chatHistoryList.test.ts, date-dependent, also fails on the primary checkout at baseline, unrelated); the full server vitest run src/ passes (1170 files).
  • New/extended scoped tests: agent-template, rubric (new), seed-content; agent-team-members, files-manager-teammate-scope, manager-teammate-scope, manager-opens-rep-document; mail team-sections, cross-scope-sections, useFileTree.crossScopeSections.
  • Live eval (claude-sonnet-5, the model prod uses; record-only stubs, no side effects), 10 trials of the new weekly leader run with the real body and the real injected <agent_namespace> block: 0 writes to a forbidden path in all 10 trials; 8/10 wrote all three team/{slug}/coaching-overview rollups plus team-summary at the right paths; 2/10 wrote nothing (ended after reads with empty output, likely the harness's 2500-token output cap, not confirmed). Cost about $2.34. Not covered: a rep (meeting-triggered) run against the conversation-scoped namespace block.
  • Three independent thermo reviews. Round 1 found a blocker (the widening also reached by-id routes with no row filter, fixed by making it opt-in); round 2 found that the row filter also admits user/<x>/agent-<id>/... (fixed with a namespace restriction); round 3 had no blockers and two should-fix items, fixed without a fourth review (cap reached).

Verify in prod

  • Axiom (cedar-prod) or CloudWatch /aws/ecs/aws-prod-api/api-service:
    ['cedar-prod'] | where _time > ago(1h) and message == "[agent] getTeamMembers"
    | project _time, caller_user_id, agent_id, via, member_count, truncated
    
    and the audit trail for the new access path:
    ['cedar-prod'] | where _time > ago(1h) and message == "[files] manager teammate-scope read"
    | project _time, caller_user_id, target_user_id, org_id, agents_held
    
  • Working: a leader opening an org agent's Files tab logs via of org_admin or agent_manager with member_count equal to the reps who own rows; the second line appears only when a non-admin manager expands a rep's section. via: none is not logged.
  • Regression: any [files] manager teammate-scope read line whose caller_user_id is an org admin (the fallback should never be what grants them), or any rep (non-leader) with agent_manager.
  • Next Tuesday's cron: after the playbooks are re-seeded, each rep's coaching/{slug}/coaching-overview must stop being written, and team/{slug}/coaching-overview plus team-summary should appear in the leader's s
Show production surfaces and changed-file mapping

Production surfaces

SurfaceRequestsErrorsp95UsersVerdict
model_chunk Automation Agent (Understudy)0 → 50 → 0 (0%)not measured → 1 ms0Insufficient traffic
5 requests, under the 20 Libra needs
orchestrator_agent_step6 → 40 → 0 (0%)7741 ms → 32 ms4Insufficient traffic
4 requests, under the 20 Libra needs
/api/trpc/agentExecutions.getAgentExecutions0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
POST /api/trpc/agentExecutions.getAgentExecutions0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
model_chunk On-Event Execution Agent (Understudy)0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
model_chunk Automation Agent (Sol experiment)0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/trpc/documents.getDoc0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/trpc/files.searchForLink0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/trpc/documents.getAncestors0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/trpc/agent.list0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.

Changed files → surfaces

  • apps/mail/modules/documents/document.tsx/api/trpc/documents.getDoc/api/trpc/documents.getAncestors
  • apps/server/src/trpc/routes/agent.tsmodel_chunk Automation Agent (Understudy)orchestrator_agent_step/api/trpc/agentExecutions.getAgentExecutionsPOST /api/trpc/agentExecutions.getAgentExecutionsmodel_chunk On-Event Execution Agent (Understudy)model_chunk Automation Agent (Sol experiment)+1
  • apps/server/src/trpc/routes/files.ts/api/trpc/files.searchForLink
  • apps/mail/components/markdown-editor.tsxno production surface mapped
  • apps/mail/jest.config.cjsno production surface mapped
  • apps/mail/modules/agents/__tests__/team-sections.test.tsno production surface mapped
  • apps/mail/modules/agents/components/AgentOutputTab.tsxno production surface mapped
  • apps/mail/modules/agents/utils/team-sections.tsno production surface mapped
  • apps/mail/modules/conversations/components/files/ConversationFileTree.tsxno production surface mapped
  • apps/mail/modules/conversations/components/files/__tests__/cross-scope-sections.test.tsno production surface mapped
  • apps/mail/modules/conversations/components/files/__tests__/useFileTree.crossScopeSections.test.tsxno production surface mapped
  • apps/mail/modules/documents/yjs/CedarYjsProvider.tsno production surface mapped
  • apps/mail/modules/documents/yjs/__tests__/CedarYjsProvider.readOnly.test.tsno production surface mapped
  • apps/mail/modules/documents/yjs/providerRegistry.tsno production surface mapped
  • apps/mail/modules/files/__tests__/open-file-mode.test.tsno production surface mapped
  • apps/mail/modules/files/components/FileBrowser.tsxno production surface mapped
  • apps/mail/modules/files/utils/cross-scope-sections.tsno production surface mapped
  • apps/mail/modules/files/utils/open-file-mode.tsno production surface mapped
  • apps/mail/tests/components/markdown-editor-liveness.test.tsxno production surface mapped
  • apps/server/src/services/access/__tests__/manager-opens-rep-document.test.tsno production surface mapped
  • apps/server/src/services/access/__tests__/manager-teammate-scope.test.tsno production surface mapped
  • apps/server/src/services/access/manager-teammate-scope.tsno production surface mapped
  • apps/server/src/services/access/viewer.tsno production surface mapped
  • apps/server/src/services/agent-workspace/team-members.tsno production surface mapped
  • apps/server/src/services/coaching/__tests__/agent-template.test.tsno production surface mapped
  • apps/server/src/services/coaching/__tests__/rubric.test.tsno production surface mapped
  • apps/server/src/services/coaching/agent-template.tsno production surface mapped
  • apps/server/src/services/coaching/rubric.tsno production surface mapped
  • apps/server/src/services/coaching/seed-content.tsno production surface mapped
  • apps/server/src/services/documents/convention-paths.tsno production surface mapped
  • apps/server/src/services/file-system/index.tsno production surface mapped
  • apps/server/src/trpc/routes/__tests__/agent-team-members.test.tsno production surface mapped
  • apps/server/src/trpc/routes/__tests__/files-manager-teammate-scope.test.tsno production surface mapped