Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

feat(coaching): activate the Pirros coaching loop, publish the tree, and tidy document rendering

merged#2590CedarCopilot

CedarCopilot wants to merge 1 commit into staging from fix/skip-agent-runs-for-warmup-traffic

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Aug 26, 2026, 12:38 PM
  2. Aug 26, 2026, 12:46 PM
  3. Merged
    Aug 26, 2026, 12:48 PM
  4. Live on prod
    Aug 26, 2026, 12:48 PM
  5. Observed 2 days
    Aug 26, 2026, 12:48 PM
  6. Pipelines steady after this deploy
    Aug 26, 2026, 12:48 PM
  7. Unobserved

    Live on prod, no production signal yet

    Aug 29, 2026, 1:21 AM

Behaviors Libra is checking

Email workflow behavior from components/markdown-editor.tsx, components/markdown-prose-classes.ts, components/read-only-markdown-view.tsx keeps working in prod.Inconclusivelow confidence

Strict CloudWatch fallback found 22 recent prod failure log lines for mirror.upsertEmailThread failed (Failed query: insert into \), but the same failure had 3 log lines in the comparable pre-deploy baseline. Libra is not blaming this PR intent without a post-deploy increase or.

prod, checked Aug 29, 2026, 1:10 AM
Meeting import behavior from agent-defaults/coach-meeting.ts keeps working in prod.Inconclusivelow confidence

Strict CloudWatch fallback saw 34,651 success-shaped log lines matching calendar, meeting, meetings, but no tied operation was present, so Libra is not calling this working.

prod, checked Aug 29, 2026, 1:21 AM

Libra has verdicts on 0 of 2 tracked behaviors on prod; 2 are still being checked. Libra checks hourly for 3 days after each deploy.

Summary

Five follow-on commits to the coaching work merged in #2581:

  • Activate the loop for Pirros , coach-meeting runs on every call, coach-weekly on Tuesdays.
  • Publish the coaching tree into the Pirros org, plus a runbook for onboarding the next customer.
  • Moment cards use the real conversation badge and a readable header.
  • Section breaks are spaced in the markdown, not the stylesheet.
  • Document section rules get room, and the editor / read-only views stop drifting apart.

Test plan

  • apps/mail/tests/components/markdown-prose-classes.test.ts covers the shared prose classes.
  • apps/server/src/services/coaching/__tests__/coaching-fences.test.ts covers the fence parsing.

🤖 Generated with Claude Code

Greptile Summary

This PR activates Pirros coaching agents, publishes the coaching document tree, adds shared markdown typography, and updates moment-card rendering.

  • Adds meeting and weekly coaching agent definitions plus Pirros trigger activation.
  • Extracts a reusable coaching-suite publisher and documents customer rollout.
  • Shares editable/read-only prose classes and adds markdown round-trip coverage.
  • Replaces the moment deal link with the standard conversation badge.

Confidence Score: 2/5

The PR is not safe to merge until customer publication is made reproducible, trigger insertion validates success, and moment cards preserve their stored deal label.

The publishing command can leave Pirros with a partially written or stale coaching tree, activation can claim success without adding triggers, and historical moment headers can lose their durable deal identity.

Files Needing Attention: apps/server/src/scripts/write-coaching-suite.ts, apps/server/src/scripts/activate-coaching-pirros.ts, apps/mail/modules/documents/coaching/MomentFenceNode.tsx

Important Files Changed

FilenameOverview
apps/server/src/scripts/write-coaching-suite.tsGeneralizes the publisher to arbitrary targets, but customer publication depends on undocumented temporary files and can commit a partial tree.
apps/server/src/scripts/copy-coaching-to-pirros.tsImmediately publishes the full suite into Pirros without validating source artifacts or using a dry-run boundary.
apps/server/src/scripts/activate-coaching-pirros.tsAuthors the two coaching subagents and wires their triggers, but silently reports success if the exact global-block insertion anchor is absent.
apps/mail/modules/documents/coaching/MomentFenceNode.tsxImproves moment-card typography and adopts ConversationBadge, but loses the persisted deal-name fallback for stale conversations.
apps/mail/components/markdown-prose-classes.tsCentralizes document typography and moves optional section spacing into authored markdown.
apps/mail/components/markdown-editor.tsxReuses the shared prose classes; one changed StarterKit property violates repository indentation.
apps/mail/components/read-only-markdown-view.tsxReuses the same prose-class source as the editor to prevent rendering drift.
apps/server/src/services/playbook/agent-defaults/index.tsRegisters both coaching agents as explicit opt-in, non-default system agents.

Flowchart

rendering diagram…

Comments Outside Diff (1)

  1. `apps/server/src/scripts/write-coaching-su
Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • apps/mail/components/markdown-editor.tsxno production surface mapped
  • apps/mail/components/markdown-prose-classes.tsno production surface mapped
  • apps/mail/components/read-only-markdown-view.tsxno production surface mapped
  • apps/mail/modules/documents/coaching/MomentFenceNode.tsxno production surface mapped
  • apps/mail/tests/components/markdown-prose-classes.test.tsno production surface mapped
  • apps/server/docs/coaching-agent.mdno production surface mapped
  • apps/server/docs/coaching-rollout-runbook.mdno production surface mapped
  • apps/server/src/scripts/activate-coaching-pirros.tsno production surface mapped
  • apps/server/src/scripts/copy-coaching-to-pirros.tsno production surface mapped
  • apps/server/src/scripts/publish-runbook.tsno production surface mapped
  • apps/server/src/scripts/write-coaching-suite.tsno production surface mapped
  • apps/server/src/services/coaching/seed-content.tsno production surface mapped
  • apps/server/src/services/document-saving/__tests__/coaching-fences.test.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/coach-meeting.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/coach-weekly.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/index.tsno production surface mapped