Skip to content

fix(taxonomy): preserve prior scoped tree on persist-phase regeneration failure#4036

Draft
cursor[bot] wants to merge 2 commits into
developmentfrom
cursor/critical-bug-management-9846
Draft

fix(taxonomy): preserve prior scoped tree on persist-phase regeneration failure#4036
cursor[bot] wants to merge 2 commits into
developmentfrom
cursor/critical-bug-management-9846

Conversation

@cursor

@cursor cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a data-loss bug in custom behavior taxonomy regeneration (#4027). When the persist phase failed after materializing new clusters but before assignment upsert completed, the onError compensation called deprecateCustomBehaviorTreeUseCase, which deprecated every active scoped cluster — including the prior serving tree.

The fix deprecates only clusters born in the failing pass, leaving continued and untouched prior clusters active.

Related issue (if applicable)

N/A — found by automated bug scan.

How was this tested?

  • Added regression test: prior scoped tree stays active when assignment upsert fails on regeneration with a topic change.
  • Existing test still passes: first-build failure deprecates all born clusters.
  • pnpm --filter @domain/taxonomy test -- build-custom-behavior-taxonomy.test.ts (98 tests pass).

Checklist

  • Lint, type-checking, and tests pass locally
  • PR title follows Conventional Commits
  • I have signed the CLA
Open in Web View Automation 

…on failure

When assignment upsert failed during custom behavior regeneration, the
onError compensation deprecated every active scoped cluster — including
the prior serving tree — leaving users with an empty tree and failed status.

Only deprecate clusters born in the failing pass; continued and untouched
prior clusters stay active.

Co-authored-by: Gerard <gerard@latitude.so>
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
design-system Skipped Skipped Jul 15, 2026 8:07am

Request Review

Co-authored-by: Gerard <gerard@latitude.so>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

1 participant