Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

[2026-08-23] merging staging to prod

merged#2558CedarCopilot

CedarCopilot wants to merge 3 commits into main from staging

Not deployedTimeline and evidence
  1. Opened
    Aug 23, 2026, 9:40 PM
  2. Aug 23, 2026, 10:22 PM
  3. Merged
    Aug 23, 2026, 11:41 PM
  4. Live on staging, live on prod, observed
    Pending
  5. Not deployed

    Not deployed

    Pending

Libra has no production signal for this change yet because it has not deployed. Libra checks hourly for 3 days after each deploy.

Greptile Summary

This PR adds JSON custom-field support across CRM storage, agent updates, synchronization, filtering, and table editing, while also extracting Slack channel matching into a reusable service and exposing an account-setup command. It additionally updates analysis skills and adds generated audit artifacts.

  • Adds JSON field schemas, serialization, deep-merge helpers, persistence behavior, context formatting, CRM mapping support, and focused tests.
  • Adds a key/value JSON table editor and JSON column selection in the mail client.
  • Reuses Slack channel matching from both the hourly cron and a new authenticated CLI/tRPC path.
  • Updates deal-intelligence and data-audit guidance and includes new customer audit deliverables.

Confidence Score: 3/5

The PR should not merge until JSON cell edits stop overwriting concurrent key updates and preserve null values.

The new JSON editor submits stale whole-object snapshots through a merge-bypassing route and changes nulls to empty strings on blur, creating two independent paths to incorrect persisted custom-field data; Slack state concurrency is an additional non-blocking concern.

Files Needing Attention: apps/mail/modules/crm/components/crm-cell.tsx, apps/server/src/trpc/routes/crm.ts, apps/server/src/services/integrations/slack/link-matching-channels.ts

Important Files Changed

FilenameOverview
apps/mail/modules/crm/components/crm-cell.tsxAdds the JSON key/value editor, but whole-snapshot commits can overwrite concurrent changes and null values are converted to empty strings on blur.
apps/server/src/trpc/routes/crm.tsAdds the UI JSON write path and deliberately treats client payloads as authoritative whole objects, exposing stale-snapshot data loss.
apps/server/src/services/crm/json-field-merge.tsImplements partial deep merging and rejection handling, while explicitly retaining last-writer-wins behavior and bypassing validation for jsonWhole values.
apps/server/src/services/crm/conversations.tsIntegrates resolved JSON values into the common conversation persistence path with extensive focused tests.
apps/server/src/services/crm/crm-field-sync.tsTreats external CRM JSON values as authoritative whole values and forwards final persisted values through synchronization.
apps/server/src/services/integrations/slack/link-matching-channels.tsExtracts existing channel-matching behavior, but whole-map channelState persistence can lose idempotency updates when the new entrypoints overlap.
apps/server/src/trpc/routes/channels.tsAdds an authenticated on-demand Slack linking mutation for account setup.
apps/server/src/mastra/tools/conversation/updateConversationFieldsTool.tsResolves JSON partial patches before CRM push and persists the resulting authoritative whole value.

Flowchart

rendering diagram…
Prompt To Fix All With AI
### Issue 1
apps/server/src/trpc/routes/crm.ts:4093-4101
**Whole-object writes lose JSON keys**

If another writer updates a different key after the table loads, `JsonFieldCell` submits its stale full snapshot and this route marks it `jsonWhole`, bypassing the partial merge and silently overwriting the concurrent key update.

### Issue 2
apps/mail/modules/crm/components/crm-cell.tsx:559-562
**Null values become empty strings**

When a top
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
  • .claude/skills/data-audit/resources/deliverable-formats/analysis-artifact-presentation.mdno production surface mapped
  • .claude/skills/data-audit/resources/staff-methods/method-call-quality-judge.mdno production surface mapped
  • apps/mail/modules/crm/components/add-column-popover.tsxno production surface mapped
  • apps/mail/modules/crm/components/crm-cell.tsxno production surface mapped
  • apps/mail/modules/crm/components/editable-column-header.tsxno production surface mapped
  • apps/mail/modules/crm/types/index.tsno production surface mapped
  • apps/mail/modules/crm/utils/compute-canvas-filters.tsno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/SKILL.mdno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/resources/answer-format.mdno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/resources/artifact-presentation.mdno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/resources/choosing-quotes.mdno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/resources/extra-tagging.mdno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/resources/lever-search.mdno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/resources/method-call-quality-judge.mdno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/resources/operationalize-and-approximate.mdno production surface mapped
  • apps/server/.claude/skills/deal-intelligence-analysis/resources/staff-data-and-viz.mdno production surface mapped
  • apps/server/src/cli/channels.tsno production surface mapped
  • apps/server/src/cron/process-periodic-slack-channel-sync.tsno production surface mapped
  • apps/server/src/db/aop-schema.tsno production surface mapped
  • apps/server/src/lib/conversation-filter-schema.tsno production surface mapped
  • apps/server/src/mastra/tools/conversation/__tests__/updateConversationFieldsTool.test.tsno production surface mapped
  • apps/server/src/mastra/tools/conversation/updateConversationFieldsTool.tsno production surface mapped
  • apps/server/src/mastra/utils/context-formatting/conversation-context.tsno production surface mapped
  • apps/server/src/services/crm/__tests__/conversations.json-persist.test.tsno production surface mapped
  • apps/server/src/services/crm/__tests__/crm-field-sync-full.test.tsno production surface mapped
  • apps/server/src/services/crm/__tests__/field-type-utils.json.test.tsno production surface mapped
  • apps/server/src/services/crm/__tests__/json-field-merge.test.tsno production surface mapped
  • apps/server/src/services/crm/conversation-field-values.tsno production surface mapped
  • apps/server/src/services/crm/conversations.tsno production surface mapped
  • apps/server/src/services/crm/crm-field-sync.tsno production surface mapped
  • apps/server/src/services/crm/field-type-utils.tsno production surface mapped
  • apps/server/src/services/crm/json-field-merge.tsno production surface mapped
  • apps/server/src/services/integrations/crm/external-crm-field-mapping.tsno production surface mapped
  • apps/server/src/services/integrations/crm/hubspot.tsno production surface mapped
  • apps/server/src/services/integrations/slack/link-matching-channels.tsno production surface mapped
  • apps/server/src/trpc/routes/channels.tsno production surface mapped
  • apps/server/src/trpc/routes/crm.tsno production surface mapped
  • apps/server/src/trpc/routes/user-tasks.tsno production surface mapped
  • docs/aspire/aspire-agent-tracker.mdno production surface mapped
  • docs/aspire/aspire-requirements-2026-08-20.mdno production surface mapped
  • docs/audits/aspire/artifacts/aspire-discovery-judge.htmlno production surface mapped
  • docs/audits/aspire/artifacts/data/aspire-scope-altitude-tags.jsonno production surface mapped
  • docs/audits/aspire/aspire-sent-slack-messages.mdno production surface mapped
  • docs/audits/heytelo/artifacts/process-map.htmlno production surface mapped
  • docs/audits/heytelo/artifacts/vocab-review.htmlno production surface mapped
  • docs/audits/heytelo/data/process-map/process-map-data.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_business.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_competitive.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_discovery.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_features.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_multithreading.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_objections.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_pitch.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_pricing.jsonno production surface mapped
  • docs/audits/heytelo/data/process-map/section_useCases.jsonno production surface mapped
  • docs/audits/heytelo/heytelo-2026-08-22-requirements.mdno production surface mapped
  • docs/audits/vooma/artifacts/vooma-discovery-judge.htmlno production surface mapped
  • docs/audits/vooma/vooma-sent-slack-messages.mdno production surface mapped
  • docs/design/custom-field-types-json-timestamp.mdno production surface mapped
  • docs/design/pirros-deal-brief-agent-plan.mdno production surface mapped