Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

feat(pipeline-review-default): forecast summary, CRM sync-scope, cross-object checks, voice register

merged#2494CedarCopilot

CedarCopilot wants to merge 0 commits into staging from feat/pipeline-review-default-forecast-sync-scope

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

    Live on prod, no production signal yet

    Aug 18, 2026, 10:24 AM

Behaviors Libra is checking

Pipeline reviews explicitly calculate closed-won deal value and count for the current forecast period, including the CRM close-date field, so closed revenue is included in forecast reporting.Inconclusivemedium confidence

The deployed pipeline-review prompt contains the exact closed-won query, including CRM close_date and closed_value/deals fields. Production logs since 2026-08-15 show many run-sql tool-call records, but no telemetry/log record containing closed_value, "Closed this period", or.

prod, checked Aug 18, 2026, 2:26 AM
Pipeline reviews distinguish CRM deal types that are synced into Cedar from filtered-out types and query the CRM directly for any excluded-object counts or checks.Inconclusivelow confidence

OTEL fallback found no prod spans matching pipeline-review playbook / reconcile-deals-with-provider since deploy.

prod, checked Aug 18, 2026, 3:24 AM
For CRM models with paired object types, pipeline reviews can flag missing counterpart objects and detect objects carrying values appropriate to the paired type, including via direct CRM queries when one type is unsynced.Inconclusivelow confidence

OTEL fallback found no prod spans matching pipeline-review playbook / run-code-executor since deploy.

prod, checked Aug 18, 2026, 4:24 AM
Pipeline reviews use the CRM connection's mapped custom forecast field when configured instead of assuming the built-in CRM forecast category is current.Inconclusivelow confidence

OTEL fallback found no prod spans matching pipeline-review playbook / connection fieldMappings since deploy.

prod, checked Aug 18, 2026, 5:24 AM
Pipeline reviews can use a configured voice register for deep-dive preparation—such as lowercase, direct, minimally embellished prose—while keeping the audit ping clean and readable.Inconclusivelow confidence

OTEL fallback found no prod spans matching pipeline-review delivery / deep-dive prep since deploy.

prod, checked Aug 18, 2026, 6:24 AM
Pipeline reviews display forecast categories that do not count toward the rep's formula separately and exclude them from the headline call and weighted figures.Inconclusivelow confidence

OTEL fallback found no prod spans matching pipeline-review playbook / forecast rollup since deploy.

prod, checked Aug 18, 2026, 7:24 AM

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

What

Generalizes four wins from Willem / Listen Labs' pipeline-review agent into the default pipeline-review template (apps/server/src/services/playbook/agent-defaults/pipeline-review.ts). New customers inherit these; existing agents are unchanged until re-authored.

Why

Building Willem's agent surfaced gaps the default silently mishandled , most importantly, it assumed everything is in Cedar after reconcile, which is false when a connection filters which deal types sync.

Changes (all marker + guidance edits , no behavior change until re-authored)

  • MARK_SYNC_SCOPE (the big one) , handle connections with a dealSyncFilter (e.g. Willem syncs only Contract_Type__c=Subscription). Numbers/checks about un-synced object types (pilots) must query the CRM directly (SOQL via run-code-executor), not run-sql. Includes the exact REST recipe.
  • MARK_FORECAST_SUMMARY , lead with the number the rep actually calls: closed / the call (counting-categories + closed) / weighted (probability-weighted). Adds closed-won-this-period; makes the per-stage breakdown opt-out.
  • MARK_FORECAST strengthened , prefer the org's custom forecast field over the CRM built-in (often stale); show non-forecasted categories (Nurture/uncategorized) on a separate line, excluded from the headline.
  • MARK_ANOMALIES , cross-object integrity checks (pilot↔subscription pairing); note these usually need the direct-CRM query.
  • MARK_VOICE , voice register scoped to the deep-dive (copy-paste prep that should read hand-written) vs the audit ping (stays clean/readable).
  • Part-C grounding guard , state every date from the structured field value + today's date, never paraphrased from timeline prose (prevents the "close date passed" error on a deal whose close date is still in the future).

Test

All 10 agent-defaults/__tests__ marker-strip tests pass (pnpm --filter @zero/server exec vitest run src/services/playbook/agent-defaults/__tests__/).

🤖 Generated with Claude Code

Greptile Summary

The PR expands the default pipeline-review authoring template with CRM sync-scope handling, closed and weighted forecast guidance, cross-object checks, structured-date grounding, and separate deep-dive voice customization. It also adds an Understudy Labs account setup plan and customer-facing proposal.

  • Adds direct-CRM guidance for deal types excluded from Cedar synchronization.
  • Adds closed-period, call-number, weighted-forecast, and custom forecast-field guidance.
  • Adds cross-object anomaly and deep-dive voice customization markers.
  • Documents the proposed Understudy Labs CRM, agent, drafting, and activation setup.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking template inconsistency that should be resolved so authored weighted forecasts reliably exclude non-forecasted categories.

The new forecast markers require category-specific exclusion and weighting, while the pinned SQL combines all non-high-confidence categories into one bucket and therefore cannot deterministically satisfy those instructions.

Files Needing Attention: apps/server/src/services/playbook/agent-defaults/pipeline-review.ts

Important Files Changed

FilenameOverview
apps/server/src/services/playbook/agent-defaults/pipeline-review.tsExpands pipeline-review guidance substantially, but the new excluded-category and weighted-summary requirements conflict with the existing mandatory collapsed rollup query.
docs/account-setup/understudylabs-com-2026-08-15.mdAdds a detailed pre-execution account setup plan covering CRM stages, fields, agents, integrations, and approval gates.
docs/account-setup/understudylabs-com-proposal.mdAdds the customer-facing Understudy Labs setup proposal corresponding to the internal implementation plan.
Prompt
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/src/services/playbook/agent-defaults/pipeline-review.tsno production surface mapped