Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

feat(chat): default deal queries to CRM-linked deals

merged#2541CedarCopilot

CedarCopilot wants to merge 0 commits into staging from feat/chat-playbook-crm-scope-default

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Aug 21, 2026, 2:55 PM
  2. Merged
    Aug 22, 2026, 9:02 AM
  3. Live on staging
    Aug 22, 2026, 9:02 AM
  4. Live on prod
    Aug 22, 2026, 9:02 AM
  5. Observed 2 days
    Aug 22, 2026, 9:02 AM
  6. Pipelines steady after this deploy
    Aug 22, 2026, 9:02 AM
  7. Pipelines steady after this deploy
    Aug 22, 2026, 9:02 AM
  8. Unobserved

    Live on prod, no production signal yet

    Aug 25, 2026, 7:55 AM

Behaviors Libra is checking

New users receive a default chat-agent playbook that defines CRM-linked deal scope whenever a CRM is connected.Degradedlow confidence

Strict CloudWatch fallback found 1 prod failure log lines for [run-chat-agent-sdk] query() failed (Claude Code process aborted by user) in the last 24h while checking /playbooks/chat_agent.md, seedchatagentplaybookfile, chat_agent, cedar:crm-scope-default v1.

prod, checked Aug 25, 2026, 7:55 AM
Existing chat playbooks for the targeted Vooma, Pirros, Aspireiq, and Listenlabs reps receive CRM-specific deal-scoping instructions for HubSpot or Salesforce without overwriting their current playbook content.Degradedmedium confidence

Strict CloudWatch fallback found 116 prod failure log lines for sync.provider_read_failed_served_snapshot (Requested entity was not found.) in the last 24h while checking /playbooks/chat_agent.md, failed, hubspot, chat_agent, apply-crm-scope-chat-playbook, up from 27 in the.

staging, checked Aug 25, 2026, 8:55 AM
Chat requests for a user's deals, pipeline, rundown, or health check default to CRM-linked deals rather than all email-derived conversations when an external CRM is synced.Inconclusivelow confidence

OTEL fallback found no prod spans matching find-crm-conversations (crmSynced filter) since deploy.

prod, checked Aug 23, 2026, 9:50 PM
Chat includes unlinked conversations only when the user explicitly asks for all deals or everything.Inconclusivelow confidence

OTEL fallback found no prod spans matching find-crm-conversations (crmSynced filter) since deploy.

prod, checked Aug 23, 2026, 9:50 PM
When chat scopes deal results to CRM-linked records, it tells the user which scope was used and that they can request everything.Inconclusivelow confidence

OTEL fallback found no prod spans matching chat agent deal-query response since deploy.

prod, checked Aug 24, 2026, 10:50 AM
Existing chat playbooks for the specified Vooma, Pirros, Aspireiq, and Listenlabs reps receive provider-specific HubSpot or Salesforce deal-scope instructions without overwriting their current playbook content.Inconclusivelow confidence

OTEL fallback found no prod spans matching apply-crm-scope-chat-playbook rollout job since deploy.

prod, checked Aug 24, 2026, 11:51 AM

Libra has verdicts on 0 of 5 tracked behaviors on prod; 5 are still being checked. Libra has 1 low-confidence degraded verdict it is still confirming. Libra checks hourly for 3 days after each deploy.

What & why

When a rep asks the in-app chat agent for "my deals" / "my pipeline" / "a rundown across my deals", it currently includes every email-derived conversation Cedar tracks , because every customer-comms thread becomes a conversation. For reps who sync a CRM, the deals they actually own get buried among non-CRM conversations. (Surfaced by Vooma's Jesse Taylor: "when I ask chat for a rundown on all my deals, it's still including a bunch of things that either aren't mine, or aren't active.")

The crmSynced filter already exists on find-crm-conversations , this change just makes the agent default to it (transparently, overridably), rather than adding a hidden query mutation.

Changes

  • seed-playbook.ts , the seeded chat-playbook default (buildChatAgentPlaybookContent) now includes a generic Deal scope rule: when a CRM is synced, default deal queries to CRM-linked deals; widen only when the user asks for "all". Every newly-seeded user gets it automatically. Provider-agnostic (the default seeds all orgs, incl. non-CRM ones).
  • account-setup-from-transcript skill , documents that CHAT_AGENT.md is auto-created (Phase 2C) but never personalized, and adds a lightweight Phase-5 step to personalize it from the rep's stated style/tone/behavior preferences, and to name the provider for single-CRM orgs.
  • apply-crm-scope-chat-playbook.ts (+ runner) , one-off rollout that appended the provider-specific rule to the 18 existing reps across Vooma/Pirros (HubSpot) and Aspireiq/Listenlabs (Salesforce). Append-only, idempotent (marker-guarded), dry-run by default. Already applied , all 18 verified with correct provider per org.

Notes / follow-ups

  • The chat agent has no runtime CRM-sync signal today, so this is a soft (prompt-level) default the agent can see and the user can override , deliberately, not a silent tool-level filter.
  • A future enhancement would inject a CRM-sync signal into the chat context so a truly universal system-prompt default could be conditional per user.

đŸ¤– Generated with Claude Code

Greptile Summary

This PR adds CRM-linked deal scoping to newly seeded chat-agent playbooks, documents setup-time personalization, and adds an organization-specific rollout script and runner.

  • Seeds a generic, overridable Deal scope rule for new chat playbooks.
  • Adds setup guidance for personalizing chat behavior and naming a known CRM provider.
  • Adds a dry-run-by-default rollout for 18 configured representatives.
  • The rollout’s no-document path currently duplicates the seeded Deal scope section.

Confidence Score: 4/5

The rollout should be corrected before merging because its explicit no-document path persists duplicate and potentially conflicting Deal scope instructions.

Seeding already writes the marker and generic scope section, but the rollout immediately appends a second provider-specific section for users whose playbook was initially absent; the remaining import-convention issue is non-blocking.

Files Needing Attention: apps/server/scripts/apply-crm-scope-chat-playbook.ts; apps/server/scripts/run-apply-crm-scope-chat-playbook.mjs

Important Files Changed

FilenameOverview
apps/server/scripts/apply-crm-scope-chat-playbook.tsAdds an append-only CRM-scope rollout, but its create path seeds and then duplicates the already-seeded scope block.
apps/server/scripts/run-apply-crm-scope-chat-playbook.mjsAdds an esbuild-based runner consistent with sibling scripts, though its relative imports conflict with the repository import rule.
apps/server/src/services/playbook/seed-playbook.tsAdds the generic Deal scope block to canonical newly seeded chat playbooks.
.claude/skills/account-setup-from-transcript/SKILL.mdDocuments setup-time chat-playbook personalization while preserving the seeded Deal scope rule.

Flowchart

Show production surfaces and changed-file mapping

Production surfaces

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

Changed files → surfaces

  • .claude/skills/account-setup-from-transcript/SKILL.mdno production surface mapped
  • apps/server/scripts/apply-crm-scope-chat-playbook.tsno production surface mapped
  • apps/server/scripts/run-apply-crm-scope-chat-playbook.mjsno production surface mapped
  • apps/server/src/services/playbook/seed-playbook.tsno production surface mapped