Take a hash before you touch anything
Before your first edit of a session, declare every file you are about to change and the sha256 of each one exactly as you just read it. CODE_LEASE_START, or POST /api/coding-law/start. You get back a lease id and a start hash. A session that edits before it declares has no base version on the record, and a collision involving it can never be detected — only discovered.
