Overview
Locking prevents simultaneous edits at two levels:- Symbol level for TypeScript and JavaScript, using the symbol graph. Two agents can edit the same file as long as they touch different functions or classes.
- File level for everything else, or when a change spans an entire file.
How Reservations Work
refreshToken in the same file, no conflict — the write goes through and creates a separate symbol reservation.
Reservation Rules
| Rule | Detail |
|---|---|
| Duration | 10 minutes, sliding window (reset on every edit by the owning session) |
| Scope | Workspace + file + (optional) symbol ID + session |
| Uniqueness | UNIQUE(workspace_id, file_path, symbol_id) at the DB level — race-free |
| Self-reservation | Same user, different conversation → still locks (two tabs lock each other) |
| Auto-release | On sessionEnd or expiry |
| Fallback | If we can’t resolve symbols (parse failure, non-TS/JS), we fall back to whole-file reservation |
Coexistence with must-tier Conventions
preToolUse runs two checks in parallel:
- Reservation conflict (someone else holds this file/symbol).
- Convention match (
must-tier rule matches this file + change).
IDE Support
| IDE | Enforcement level |
|---|---|
| Cursor | Full — preToolUse/postToolUse hooks intercept write_file, edit_file, etc. |
| Claude Code | Full — hooks intercept both Edit and Write tools |
| Codex | Full — hook intercepts tool calls in the same way |
Viewing Reservations
- Dashboard — workstream view shows owned files and symbols per member.
sync— returns areservationsarray in the response.- API —
GET /workspaces/:id/reservations.