### wai-quantum: the person's rules for proposals, checked change by change

Feature 7 of the co-design report: region-scoped edits with locks and keep/avoid marks.

- **The rules** (`engine::locks`):
  - held blocks, marked in the program between `// @lock` and `// @unlock`, so they travel with it to a model, an agent and a file;
  - the gates a change may add; the qubit declarations held;
  - gates and text to avoid; and the region a rewrite must keep to.
- **The check** (`locks::check`) names each change a proposal makes (`versions::changes`) and the rules it breaks.
  - Only what a change adds is judged, so a gate the program already used is never a proposal's breach.
  - A generator's gates are read at its inputs, and a proposal that does not read cannot pass a gate rule.
- **The brief** (`locks::brief`) states the rules as a model is told them.
- **On a version:** `versions::Review` keeps the changes the rules blocked (`History::propose_with`), and a change both blocked and accepted is refused there and in `History::verify`. A review with nothing blocked has the digest it had before.
- **The command line:**
  - `wai-quantum locks check | brief`;
  - `history changes` names each change's breaches;
  - `history propose` refuses a blocked change, and `--accept all` takes the allowed ones;
  - the rules sit beside the program as `prog.locks.json`.
- **For agents:** `history_commit` refuses an agent's edit that breaks a rule, with the rule, and `history_changes` shows the breaches and the rules.
- **The Studio's Rules:**
  - "Hold the selected lines" marks them, and they are shaded in the editor, their gates marked on the diagram;
  - the gates allowed, the qubit declarations, what to avoid;
  - "Keep the next proposal to the selected lines".
  - In the review, a change that breaks a rule is shown with it and cannot be taken, and the version records it as blocked.
  - Alternatives leaves out a candidate whose every change breaks a rule, and the model is told the rules with every request.
- **For hosts:** `locks::call`, `engine_locks` in the page and `locks` in the desktop app; `locks::held_ops` gives the held gates.
- `versions::call` and `locks::check` name an unreadable program `unread`, not `error`: a page's worker reads an answer with an `error` as a failed call, so an unreadable draft had lost its lines' authors.

