Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

feat(agenda): curated agenda , obligation tags, review cadence, and the Cedar Agenda email

merged#2537CedarCopilot

CedarCopilot wants to merge 0 commits into staging from feat/curated-agenda

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Aug 21, 2026, 12:18 AM
  2. Merged
    Aug 21, 2026, 11:17 AM
  3. Live on staging
    Aug 21, 2026, 11:17 AM
  4. Live on prod
    Aug 21, 2026, 11:17 AM
  5. Observed 4 hours
    Aug 21, 2026, 11:17 AM
  6. Pipelines steady after this deploy
    Aug 21, 2026, 11:17 AM
  7. Pipelines steady after this deploy
    Aug 21, 2026, 11:17 AM
  8. Unobserved

    Live on prod, no production signal yet

    Aug 21, 2026, 2:53 PM

Behaviors Libra is checking

AOP context behavior from db/aop-schema.ts keeps working in prod.Inconclusivelow confidence

Strict CloudWatch fallback saw 505 success-shaped log lines matching pipeline, analytics, quota, aop, but no tied operation was present, so Libra is not calling this working.

prod, checked Aug 21, 2026, 12:48 PM
Background jobs behavior from cron/cron-task-registry.ts, cron/process-agenda-emails.ts, cron/process-daily-recap-emails.ts keeps working in prod.Inconclusivelow confidence

Strict CloudWatch fallback found 1 prod failure log lines for [MEETING_NOTES_WEBHOOK] Error processing webhook (AskElephant webhook payload must contain at least one attendee with a valid email address), but this domain-wide failure family is not tied to this intent.

prod, checked Aug 21, 2026, 1:48 PM
Chat workflow behavior from crm/conversation.ts, crm/conversation-field-definitions.ts, crm/conversation-fields.ts keeps working in prod.Inconclusivelow confidence

Strict CloudWatch fallback found 44 prod failure log lines for [UpdateExternalCrmWorkflow] Driver update failed (Step updateOpportunityField failed: HTTP 400: [{\), up from 17 in the comparable baseline, but this domain-wide failure family is not tied to this intent.

prod, checked Aug 21, 2026, 1:48 PM
CRM integration behavior from ConversationCellComponents/InlineTaskCreation.tsx, db/crm-schema.ts, account-setup/phase6-canvases.ts keeps working in prod.Inconclusivelow confidence

Strict CloudWatch fallback found 55 prod failure log lines for [UpdateExternalCrmWorkflow] Driver update failed (Step updateOpportunityField failed: HTTP 400: [{\), up from 21 in the comparable baseline, but this domain-wide failure family is not tied to this intent.

prod, checked Aug 21, 2026, 2:42 PM
Data model behavior from migrations/agenda_email_flag.sql, migrations/crm_conversations_drop_next_review_after.sql, migrations/crm_conversations_review_cadence.sql keeps working in prod.Inconclusivelow confidence

OTEL fallback saw 9,075 prod spans for the repo/env since deploy, but 282 were errors and the intent has no concrete surface to attribute them to.

prod, checked Aug 21, 2026, 2:43 PM
Email workflow behavior from components/UserSettingsEditor.tsx, notifications/page.tsx, components/AgendaBadgeRow.tsx keeps working in prod.Inconclusivelow confidence

Strict CloudWatch fallback found 1 prod failure log lines for [MEETING_NOTES_WEBHOOK] Error processing webhook (AskElephant webhook payload must contain at least one attendee with a valid email address), but this domain-wide failure family is not tied to this intent.

prod, checked Aug 21, 2026, 2:53 PM

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

Summary

Three interleaved changes behind the curated morning agenda, plus the runtime fixes they surfaced.

Obligation tags. user_tasks.tags records who owes whom , promised (the user owes it) or awaiting-them (the other side does) , written at task-create time, in the turn that read the thread, with no backfill and no re-tag sweep. Stage D used to rank on a proxy for obligation (task shape), and shape lies: a chase-task reads as the user's action while the obligation is the counterparty's. The vocabulary is closed and capped at one, enforced at the tool boundary with an agent-actionable message and again by a DB CHECK. Cards get a derived badge row (obligation → staleness → priority, capped at three), computed server-side and rendered verbatim by the client.

Review cadence. Replaces the stored next_review_after schedule with bands derived from last_contacted_at, which every activity path already writes , removing ten clear-sites that duplicated a signal the table already had. The old column had also become a query filter: the seeded prompt passed dueForReview: true on every sweep, so the top-twenty ranking was chosen from a set the cadence had already pruned. Cadence decides what gets reviewed, never what gets seen. The idempotency window narrows from 12h to 1h now that "already handled" has a real home.

The Cedar Agenda email. Replaces the daily recap. It is a rendering of the agenda document, not a second report that agrees with it , every per-deal line comes from a reason the curator wrote, read from contentYjs (the markdown mirror is lossy for exactly that attribute). No document means no email; silence beats a degraded one. The footer's "Get this in Slack instead" is authorized by an HMAC over (purpose, userId, expiry) rather than a session, because the link is clicked from mail clients that aren't logged in , and it is a GET that renders plus a POST that writes, so Gmail's proxy and SafeLinks scanners can't flip preferences for people who never clicked.

Also: one event is now one interruption , notify-user resolves a single channel from settings instead of fanning out to Slack + iMessage + WhatsApp concurrently. And an ESM require fix across seven modules that had been killing the automation path under tsx.

Review pass

A pre-merge review of this branch found and fixed two real bugs:

  • cancel-task never reported spared promises. The spared-count query derived its scope positionally (conditions.slice(0, -1)), but the promised exclusion is only last when no cutoff or conversation scope is pushed after it , i.e. never, on the sweep's actual calls. It silently counted zero, telling the agent nothing was spared. Now both queries compose from a shared base with opposite signs on one predicate, with a regression test that fails on the old shape.
  • Every internal meeting was reported as external. The cron never passed userEmail, so the calendar stat had no domain to compare attendees against and counted colleagues as outsiders.

Plus stale docstrings across the notify path that asserted the opposite of the code (the email fallback landed after they were written), the agent-facing tool description that still promised delivery to every channel, and several unused symbols.

Test plan

  • pnpm run autofix:local , green: oxlint --deny-warnings, deps:check (no layering violations), 2416 Jest tests, 7135 Vitest tests.
  • tsc -b --force clean (forced, not incremental , this branch changes shared types).
  • Merged origin/staging and resolved 7 conflicts. staging had independently fixed the same Mastra ESM cycle with a better API (registerMastraInstance no-ops when the root was never loaded, rather than throwing); took staging's version wholesale, since this branch contributed nothing else to those files.
  • The merge surfaced staging's new bound-cell invalidation inventory guard; review-cadence.ts is a new crm_conversations writer and no
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
  • .cursor/skills/account-setup-from-transcript/SKILL.mdno production surface mapped
  • apps/mail/app/(routes)/playground/components/UserSettingsEditor.tsxno production surface mapped
  • apps/mail/app/(routes)/settings/notifications/page.tsxno production surface mapped
  • apps/mail/modules/agentCanvas/components/AgendaBadgeRow.tsxno production surface mapped
  • apps/mail/modules/agentCanvas/components/ConversationTaskCard.tsxno production surface mapped
  • apps/mail/modules/agentCanvas/context/ConversationHeadersContext.tsxno production surface mapped
  • apps/mail/modules/agentCanvas/extensions/AgendaTaskNode.tsxno production surface mapped
  • apps/mail/modules/agentCanvas/utils/agenda-markdown.tsno production surface mapped
  • apps/mail/modules/cedar-os/src/store/agentConnection/responseProcessors/clientExecutionResponseProcessors.tsno production surface mapped
  • apps/mail/modules/conversations/components/timeline/TaskCreatorDialogue.tsxno production surface mapped
  • apps/mail/modules/crm/components/ConversationCellComponents/InlineTaskCreation.tsxno production surface mapped
  • apps/mail/modules/userTasks/CURATED_AGENDA_DESIGN.mdno production surface mapped
  • apps/mail/modules/userTasks/components/TaskCommandBar.tsxno production surface mapped
  • apps/mail/modules/userTasks/hooks/use-create-task-optimistic.tsno production surface mapped
  • apps/mail/modules/userTasks/slice/userTasksSlice.tsno production surface mapped
  • apps/mail/tests/modules/agentCanvas/agenda-markdown.test.tsno production surface mapped
  • apps/mail/tests/modules/agentCanvas/agendaBadgeRow.test.tsxno production surface mapped
  • apps/mail/tests/modules/agentCanvas/conversationTaskCard.test.tsxno production surface mapped
  • apps/mail/tests/modules/agentCanvas/helpers/agendaTaskMocks.tsxno production surface mapped
  • apps/server/.claude/skills/documents/agenda-format.mdno production surface mapped
  • apps/server/.claude/skills/playbook-instruction-eval/tag-fire-rate.tsno production surface mapped
  • apps/server/.claude/skills/sherlock/SHERLOCK_SYSTEM_KNOWLEDGE.mdno production surface mapped
  • apps/server/.claude/skills/tasks/SKILL.mdno production surface mapped
  • apps/server/docs/wiki/README.mdno production surface mapped
  • apps/server/docs/wiki/curated-agenda.mdno production surface mapped
  • apps/server/docs/wiki/server-boot-cycles-and-esm-require.mdno production surface mapped
  • apps/server/docs/wiki/task-obligation-tags.mdno production surface mapped
  • apps/server/src/cli/agenda.tsno production surface mapped
  • apps/server/src/cron/__tests__/process-agenda-emails.test.tsno production surface mapped
  • apps/server/src/cron/cron-task-registry.tsno production surface mapped
  • apps/server/src/cron/process-agenda-emails.tsno production surface mapped
  • apps/server/src/cron/process-daily-recap-emails.tsno production surface mapped
  • apps/server/src/db/aop-schema.tsno production surface mapped
  • apps/server/src/db/crm-schema.tsno production surface mapped
  • apps/server/src/db/migrations/agenda_email_flag.sqlno production surface mapped
  • apps/server/src/db/migrations/crm_conversations_drop_next_review_after.sqlno production surface mapped
  • apps/server/src/db/migrations/crm_conversations_review_cadence.sqlno production surface mapped
  • apps/server/src/db/migrations/scripts/account-setup/phase6-canvases.tsno production surface mapped
  • apps/server/src/db/migrations/user_tasks_tags.sqlno production surface mapped
  • apps/server/src/http/app.tsno production surface mapped
  • apps/server/src/lib/cedar-routes.tsno production surface mapped
  • apps/server/src/lib/driver/google.tsno production surface mapped
  • apps/server/src/lib/effect.tsno production surface mapped
  • apps/server/src/lib/schemas.tsno production surface mapped
  • apps/server/src/lib/signed-link-token.tsno production surface mapped
  • apps/server/src/mastra/skills/crm/conversation.tsno production surface mapped
  • apps/server/src/mastra/tools/agenda/__tests__/reviewConversationTool.test.tsno production surface mapped
  • apps/server/src/mastra/tools/agenda/reviewConversationTool.tsno production surface mapped
  • apps/server/src/mastra/tools/document/readDocumentTool.tsno production surface mapped
  • apps/server/src/mastra/tools/notify/__tests__/notifyUserTool.test.tsno production surface mapped
  • apps/server/src/mastra/tools/notify/notifyUserTool.tsno production surface mapped
  • apps/server/src/mastra/tools/task/__tests__/cancelTaskTool.promised.test.tsno production surface mapped
  • apps/server/src/mastra/tools/task/__tests__/task-tags.test.tsno production surface mapped
  • apps/server/src/mastra/tools/task/cancelTaskTool.tsno production surface mapped
  • apps/server/src/mastra/tools/task/createTaskTool.tsno production surface mapped
  • apps/server/src/mastra/tools/task/listTasksTool.tsno production surface mapped
  • apps/server/src/mastra/tools/task/schemas.tsno production surface mapped
  • apps/server/src/mastra/tools/task/taskTool.tsno production surface mapped
  • apps/server/src/mastra/tools/task/updateTaskTool.tsno production surface mapped
  • apps/server/src/pipelines.tsno production surface mapped
  • apps/server/src/routes/__tests__/agenda-email-prefs.test.tsno production surface mapped
  • apps/server/src/routes/agenda-email-prefs.tsno production surface mapped
  • apps/server/src/scripts/agenda-email-preview.tsno production surface mapped
  • apps/server/src/scripts/agenda-email-send-one.tsno production surface mapped
  • apps/server/src/scripts/task-tags-smoke.tsno production surface mapped
  • apps/server/src/services/agenda-email/AGENDA_EMAIL_DESIGN.mdno production surface mapped
  • apps/server/src/services/agenda-email/__tests__/agenda-email.test.tsno production surface mapped
  • apps/server/src/services/agenda-email/__tests__/stalled-deals.test.tsno production surface mapped
  • apps/server/src/services/agenda-email/agenda-email-html.tsno production surface mapped
  • apps/server/src/services/agenda-email/agenda-run-stats.tsno production surface mapped
  • apps/server/src/services/agenda-email/build-agenda-email.tsno production surface mapped
  • apps/server/src/services/agenda-email/stalled-deals.tsno production surface mapped
  • apps/server/src/services/agenda/__tests__/agenda-markdown.test.tsno production surface mapped
  • apps/server/src/services/agenda/__tests__/cadence-independence.test.tsno production surface mapped
  • apps/server/src/services/agenda/__tests__/heal-agenda-markdown.test.tsno production surface mapped
  • apps/server/src/services/agenda/__tests__/review-cadence.test.tsno production surface mapped
  • apps/server/src/services/agenda/agenda-markdown.tsno production surface mapped
  • apps/server/src/services/agenda/review-cadence.tsno production surface mapped
  • apps/server/src/services/agenda/review-triage.tsno production surface mapped
  • apps/server/src/services/agenda/tasks-to-agenda.tsno production surface mapped
  • apps/server/src/services/crm/__test__/channel-deal-binding.test.tsno production surface mapped
  • apps/server/src/services/crm/__test__/linkedin-linking.test.tsno production surface mapped
  • apps/server/src/services/crm/conversation-field-definitions.tsno production surface mapped
  • apps/server/src/services/crm/conversation-fields.tsno production surface mapped
  • apps/server/src/services/documents/doc-type-registry.tsno production surface mapped
  • apps/server/src/services/mail/lib/gmail-rate-limit.tsno production surface mapped
  • apps/server/src/services/notifications/__tests__/agenda-email-switch.test.tsno production surface mapped
  • apps/server/src/services/notifications/__tests__/notification-recipient-safety.test.tsno production surface mapped
  • apps/server/src/services/notifications/__tests__/primary-channel.test.tsno production surface mapped
  • apps/server/src/services/notifications/agenda-email-switch.tsno production surface mapped
  • apps/server/src/services/notifications/primary-channel.tsno production surface mapped
  • apps/server/src/services/notifications/user-email-notifier.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/seed-playbook.test.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/daily-agenda-legacy.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/daily-agenda.tsno production surface mapped
  • apps/server/src/services/playbook/playbook-execution-triggers.tsno production surface mapped
  • apps/server/src/services/user-tasks/NEXT_STEPS_LIFECYCLE_STAGING_VERIFICATION.mdno production surface mapped
  • apps/server/src/services/user-tasks/__tests__/conversation-badges.test.tsno production surface mapped
  • apps/server/src/services/user-tasks/conversation-badges.tsno production surface mapped
  • apps/server/src/services/user-tasks/tasks.tsno production surface mapped
  • apps/server/src/trpc/routes/__tests__/user-tasks-conversation-scope.test.tsno production surface mapped
  • apps/server/src/trpc/routes/user-tasks.tsno production surface mapped
  • apps/server/src/workflows/conversation-refresh-workflow.tsno production surface mapped
  • aws/lib/stacks/app-stack.tsno production surface mapped