Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

feat(coaching): data-driven rubric + generic org onboarding, fix repSlug bug

merged#2865CedarCopilot

CedarCopilot wants to merge 3 commits into staging from feat/coaching-rubric-productization

Live on prod, watching, 2 days leftTimeline and evidence
  1. Opened
    Sep 21, 2026, 4:31 PM
  2. Sep 21, 2026, 7:08 PM
  3. Merged
    Sep 21, 2026, 9:02 PM
  4. Live on prod
    Sep 21, 2026, 9:02 PM
  5. Observed 1 hour
    Sep 21, 2026, 9:02 PM
  6. Watching

    Live on prod, watching, 2 days left

    Sep 21, 2026, 9:02 PM
  7. Pipelines steady after this deploy
    Sep 21, 2026, 9:02 PM

Behaviors Libra is checking

Coaching configuration and representative outputs are stored under the agent namespace so the Files UI identifies them as coaching-owned work and associates each representative document with the correct Cedar user.Not checked
prod
Coaching delivers results by updating Cedar documents and does not send Slack messages, emails, or tasks by default.Not checked
prod
Recognized documents in an existing organisation/coaching tree can be copied byte-for-byte into the new agent namespace with organization-scoped config and user-scoped representative ownership, without deleting the legacy copies.Not checked
prod
Each eligible transcribed customer meeting in a seeded organization triggers coaching analysis and writes a per-meeting coaching document.Not checked
prod
Legacy coaching documents whose slug does not match a current organization user's canonical rep slug are reported for manual review and are not moved or guessed.Not checked
prod
New organizations remain free of coaching agents and coaching executions until an operator explicitly seeds coaching after a rubric is available.Not checked
prod

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

Summary

  • Replace coaching's hardcoded Pirros-shaped rubric template with a CoachingRubric data shape (services/coaching/rubric.ts) , an unconstrained list of criteria per section , so a second real customer (Aspire, 3 discovery rows vs. Pirros' 5, with a promoted row) can be onboarded without forking the template. Verified the Pirros render is byte-identical to the original hand-authored playbook before changing anything downstream.
  • Replace the one-bespoke-script-per-customer onboarding path with one generic seed-coaching-org.ts --org --aop --user --rubric <name>, which also verifies the trigger wiring actually compiled before reporting success , a check the old script never had.
  • Fix the rep-slug data-corruption bug that produced a duplicate peter-johann folder in Pirros' live coaching data: coach-meeting asked the model to invent a rep-folder slug from meeting metadata on every run instead of using the deterministic <current_user> identity already injected into its own prompt. coach-weekly doesn't share the bug.
  • Update coach-meeting/coach-weekly's fill_instructions so onboarding asks the human for their finished dimension analysis and transcribes it, rather than implying the agent should invent dimensions. Reference both agents from agent-capabilities and playbook-authoring so they're discoverable like other system agents.

Known risks (flagged by Libra pre-commit check, not resolved in this PR)

  • No new test coverage for seed-coaching-org.ts/rubric.ts specifically (idempotency, re-running against an already-seeded org). Existing coaching test suite (49/49) passes unchanged.
  • The old operational scripts (activate-coaching-pirros.ts, copy-coaching-to-pirros.ts, write-coaching-suite.ts, publish-coaching-playbook.ts, publish-runbook.ts) are deleted in this same change. They have real production pedigree (seeded Pirros); the replacement has only been dry-run once, against Aspire , never executed anywhere yet.

Test plan

  • pnpm run types clean
  • Coaching test suite: 49/49 pass, unchanged
  • Rendered PIRROS_RUBRIC diffed byte-for-byte against the original hand-authored COACHING_PLAYBOOK string
  • Dry-run of seed-coaching-org.ts --rubric aspire against Aspire's real org id , plan output reviewed, no writes performed
  • Execute seed-coaching-org.ts --rubric aspire --execute against Aspire's live org (separate decision, not part of this PR)
  • Re-publish the fixed coach-meeting body into Pirros' already-live subagent document so the repSlug fix actually takes effect there (source fix alone doesn't retroactively update an already-seeded document)

🤖 Generated with Claude Code

RetriggerConfidence Score: 2/5

This PR is not safe to merge because the advertised Aspire onboarding path installs Pirros-specific coaching behavior and can continue splitting a representative's output across folders.

Findings

  1. P1 Aspire receives Pirros instructions ▶
  2. P1 Aspire gets Pirros plays ▶
  3. <img alt="P1" src="https://greptile-static-
Show production surfaces and changed-file mapping

Production surfaces

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

Changed files → surfaces

  • apps/server/.claude/skills/cedar-configuration/agent-capabilities.mdno production surface mapped
  • apps/server/.claude/skills/playbook-authoring/SKILL.mdno production surface mapped
  • apps/server/docs/coaching-rollout-aspire.mdno production surface mapped
  • apps/server/docs/coaching-rollout-runbook.mdno production surface mapped
  • apps/server/docs/inline-meeting-video-in-documents.mdno production surface mapped
  • apps/server/src/mastra/agents/automation-agent.tsno 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/delete-coaching-stubs.tsno production surface mapped
  • apps/server/src/scripts/migrate-coaching-to-agent-namespace.tsno production surface mapped
  • apps/server/src/scripts/publish-aspire-coaching.tsno production surface mapped
  • apps/server/src/scripts/publish-coaching-playbook.tsno production surface mapped
  • apps/server/src/scripts/publish-runbook.tsno production surface mapped
  • apps/server/src/scripts/seed-coaching-agent.tsno production surface mapped
  • apps/server/src/scripts/seed-coaching-org.tsno production surface mapped
  • apps/server/src/scripts/write-coaching-suite.tsno production surface mapped
  • apps/server/src/services/agent-workspace/__tests__/agent-folders.test.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/automations-service.test.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/system-subagents-registry.test.tsno production surface mapped
  • apps/server/src/services/aop/aop-agents.tsno production surface mapped
  • apps/server/src/services/coaching/__tests__/agent-template.test.tsno production surface mapped
  • apps/server/src/services/coaching/__tests__/migration-paths.test.tsno production surface mapped
  • apps/server/src/services/coaching/__tests__/seed-content.test.tsno production surface mapped
  • apps/server/src/services/coaching/agent-template.tsno production surface mapped
  • apps/server/src/services/coaching/migration-paths.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/llm/__tests__/oss-tasks.test.tsno production surface mapped
  • apps/server/src/services/llm/oss-tasks.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