Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(f8): clear vendor-bucket recommendations, not just tasks

merged#2713CedarCopilot

CedarCopilot wants to merge 0 commits into staging from chore/f8-clear-vendor-bucket-recommendations

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Sep 6, 2026, 9:57 PM
  2. Merged
    Sep 6, 2026, 10:02 PM
  3. Live on prod
    Sep 6, 2026, 10:02 PM
  4. Observed 1 hour
    Sep 6, 2026, 10:02 PM
  5. Unobserved

    Live on prod, no production signal yet

    Sep 6, 2026, 10:02 PM
  6. Pipelines steady after this deploy
    Sep 6, 2026, 10:02 PM

Behaviors Libra is checking

The vendor-bucket cleanup clears both misrouted `todo` tasks and `recommended` items by marking them `agent_deleted`, so stale vendor notifications no longer remain in the agenda recommendation section.Not checked
prod

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

Already executed: 18 cleared, 6 conversations, 5 users, read-back clean.

Why

The vendor-bucket cleanup only covered todo. A recommendation carries the same misrouted content as a task , same wrong object, same customer named in a vendor's notification , and surfaces in the agenda's recommendation section.

So after Xander's six PandaDoc tasks were cancelled, six PandaDoc recommendations were still sitting there, all overdue:

Mark fully-executed deals Closed Won in CRM , WZMH A…     08-21
Approve Utile order form in PandaDoc , unblocks Xand…     08-24
Follow up with Matt Bedee re: Middough Executive Sum…     08-25
Mark Geis Companies as Closed Won in CRM , order for…     08-31

Those would have reappeared on Monday's agenda looking exactly like the problem he reported.

userconversationcleared
PandaDoc6
Broadband Hospitality3
Canto3
Small Business Loans3
KBMCo2
Procurement Sciences AI1

<email>'s "Small Business Loans" is newly caught: 286 inbound, 285 from DocuSign.

Safety

The predicate is unchanged and is what makes this safe: >= 5 inbound, >= 70% from a single vendor sender, and zero inbound from a real counterparty. Nothing holding a genuine customer email is touched , the same test that correctly spared a conversation carrying four PandaDoc notices and one message from the actual customer.

Test added pinning that both statuses are covered, so a later edit can't silently narrow it back.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NVHnt2pEEjhVwSyhkcaxoC

Greptile Summary

This PR extends the vendor-bucket cleanup to remove both open tasks and recommendations while retaining the existing conversation qualification predicate.

  • Counts both todo and recommended rows during candidate selection.
  • Marks both statuses as agent_deleted during an applied cleanup.
  • Verifies that neither status remains after mutation.
  • Adds regression coverage and records the completed cleanup outcome.

Confidence Score: 4/5

The implementation appears safe to merge, with a non-blocking weakness in the new regression test’s ability to detect partial status-filter regressions.

The cleanup consistently handles both target statuses, but the added test checks duplicated source literals rather than the behavior or consistency of all four filters.

Files Needing Attention: apps/server/tests/scripts/cancel-vendor-bucket-tasks-selection.test.ts

Important Files Changed

FilenameOverview
apps/server/scripts/cancel-vendor-bucket-tasks.tsConsistently broadens candidate selection, mutation, and verification from todo tasks to both todo and recommended tasks.
apps/server/tests/scripts/cancel-vendor-bucket-tasks-selection.test.tsAdds status coverage assertions, but the source-substring approach does not ensure that every operational filter retains both statuses.
docs/design/f8-agent-log.mdDocuments the final state and conclusions of the related task-routing remediation work.

Flowchart

rendering diagram…
Prompt To Fix All With AI
### Issue 1
apps/server/tests/scripts/cancel-vendor-bucket-tasks-selection.test.ts:59-60
**Status test misses regressions**

These assertions only verify that each status-list literal appears so
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/scripts/cancel-vendor-bucket-tasks.tsno production surface mapped
  • apps/server/tests/scripts/cancel-vendor-bucket-tasks-selection.test.tsno production surface mapped
  • docs/design/f8-agent-log.mdno production surface mapped