Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

docs(crm): fix stale Mastra Deals-AOP diagram

merged#2847CedarCopilot

CedarCopilot wants to merge 0 commits into staging from docs/fix-mastra-deals-aop-diagram

Live on prod, watching, 2 days leftTimeline and evidence
  1. Opened
    Sep 20, 2026, 1:30 PM
  2. Merged
    Sep 20, 2026, 1:52 PM
  3. Live on prod
    Sep 20, 2026, 1:52 PM
  4. Observed 4 hours
    Sep 20, 2026, 1:52 PM
  5. Watching

    Live on prod, watching, 2 days left

    Sep 20, 2026, 1:52 PM
  6. Pipelines steady after this deploy
    Sep 20, 2026, 1:52 PM

Libra has no production signal for this change on prod yet. Libra checks hourly for 3 days after each deploy.

Summary

The Mastra target-state diagram in docs/design/crm-custom-object-linkage-leads.md showed boundObjectApiName: "deals" on Mastra's Deals AOP. The actual implementation never does this , DEAL_OBJECT_API_NAME (bound-object-resolution.ts) is a single 'Opportunity' sentinel shared across all three provider drivers, not each provider's own wire slug for its Deal-equivalent object. attio.ts's updateOpportunityFields explicitly checks against that shared sentinel, confirmed by its own inline comment.

Literally following the stale diagram later (e.g. setting Mastra's real Deals AOP's boundObjectApiName to the literal string "deals") would make resolveBoundAopForObject/resolveAopReassignmentTarget treat it as a non-Deal object and silently stop resolving it as the Deals AOP , the exact class of regression this doc's Phase 0 fix exists to prevent, just in the opposite direction. Fixed the diagram to show null (the correct, implicit default) with an explanation.

Docs-only change, no code touched.

🤖 Generated with Claude Code

RetriggerConfidence Score: 4/5

The documentation correction is safe to merge, with a non-blocking wording fix recommended so it does not imply all provider drivers import the shared constant.

Findings

  1. P2 Provider constant usage overstated ▶
Fix with agent prompt
### Issue 1
docs/design/crm-custom-object-linkage-leads.md:110-113
This says every provider driver compares against the shared `DEAL_OBJECT_API_NAME` constant, but only Attio imports it. Salesforce and HubSpot each compare against a hardcoded `'Opportunity'` literal. Describing this as a shared sentinel value rather than a shared constant would avoid leading maintainers to assume that changing the constant updates all three drivers.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This documentation-only PR corrects the Mastra Deals AOP diagram to show its implicit null binding and explains how Deal resolution uses the 'Opportunity' sentinel.

  • The diagram now matches the stored default and resolver behavior.
  • The explanation accurately warns that using Attio's "deals" wire slug would disable Deals fallback resolution.
  • One sentence overstates use of the shared constant across provider implementations.

Reviews (1) · Last reviewed commit: "docs(crm): fix stale Mastra Deals-AOP di..."

Show production surfaces and changed-file mapping

Production surfaces

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

Changed files → surfaces

  • docs/design/crm-custom-object-linkage-leads.mdno production surface mapped