Problem
When a building group is deleted from the DApp, only localStorage is cleaned up. The on-chain policies on those assemblies remain unchanged.
Additionally, if an assembly belongs to multiple building groups, deleting one group should only remove that group's rules from the assembly's policy — not wipe the entire policy.
Current behavior
- Delete building group → removed from localStorage only
- On-chain policies unchanged
- If assembly is in group A (rules 1,2) and group B (rules 3,4), Apply from group B overwrites all rules (loses rules 1,2)
Required behavior
- On delete: remove only the rules associated with the deleted group from each assembly's on-chain policy
- On Apply: merge rules from all building groups that contain the assembly
- Exclusive check: warn if adding an assembly that's already in another group, or support multi-group membership with proper merging
- Condition cleanup: condition objects can stay on-chain (they're reusable shared objects)
Design considerations
- Each assembly has ONE policy on-chain (flat rule list)
- Multiple building groups may reference the same assembly
- Need to track which rules came from which group, either in localStorage metadata or on-chain
- Consider making building group membership exclusive (simpler) vs supporting overlap (more flexible)
🤖 Generated with Claude Code
Problem
When a building group is deleted from the DApp, only localStorage is cleaned up. The on-chain policies on those assemblies remain unchanged.
Additionally, if an assembly belongs to multiple building groups, deleting one group should only remove that group's rules from the assembly's policy — not wipe the entire policy.
Current behavior
Required behavior
Design considerations
🤖 Generated with Claude Code