# Django: preserve requirements through advanced agent edits - [Keep Django cancellation writes scoped to the authenticated tenant](https://frameworkrecipes.dev/django/scoped-cancellation/guide.md): A locked row prevents concurrent state changes while this transaction decides whether cancellation is allowed. The tenant restriction belongs in the lookup that acquires the row; a lock by itself is not an access check. - [tenant-scoped-lock rule pack](https://reporules.fyi/django/scoped-cancellation/rule-pack.zip): YAML requirement and agent task. - [Create a Django outbox event atomically with the order change](https://frameworkrecipes.dev/django/durable-outbox/guide.md): An on_commit callback runs after commit but does not make message delivery durable. Store the event in the transaction and let a retrying worker publish it. Moving create outside the block makes a failed event insert leave a confirmed order without a delivery record. - [outbox-same-atomic-block rule pack](https://reporules.fyi/django/durable-outbox/rule-pack.zip): YAML requirement and agent task. - [Framework rule pack](https://reporules.fyi/django/rule-pack.zip): All requirements from this framework site.