Keep an agent’s next edit from undoing the fix
Save the requirement that the fix restored, check it after the next agent edit, and repeat the same check after a repair. Choose the failure below to find the relevant implementation, recorded broken/fixed source and downloadable Perch rule.
Invalidate the older request before the next one starts, and check that identity before writing either a result or an error. Cancellation saves work; the state guard decides which completion may update the screen.
Keep the authenticated tenant or owner in the database operation that reads or changes the record. Save that requirement beside the code and check it after a refactor, including edits that leave a route-level permission check intact.
Keep the state change and its outbox or job record on the same transaction handle. A commit between the writes can leave the state changed without a durable event. Dispatch external work after the transaction commits.
Put the availability decision inside a lock or conditional update, and reject edits based on an obsolete version. Choose the mechanism for the conflict: competing reservations and a customer submitting an old screen need different checks.
Record whether an operation has already been applied, and keep that record atomic with its side effect. For a partial write, retain the completed byte count and advance from it. These examples distinguish duplicate delivery from incomplete progress.
Keep release or disposal on every path that ends ownership, including exceptions and cancellation. A successful request alone cannot reveal a connection leak; check the error path and the lifetime of the component that owns the resource.
Set up an agent to check a fix before committing
Use the implementation that matches your application
The examples preserve different boundaries: a browser completion writes state, a database update enforces access, or a transaction owns an event. Keep that boundary explicit in the rule. Browse all language and framework implementations.