Commit bd193c6
committed
docs(spec): cancelRun's
The contract docblock said `true` is answered "only when a suspension was
consumed by THIS call". The only implementation gives no such guarantee:
the engine has no `cancelling` guard (only `resuming` / `restoring`), and
`cancelRun` consumes through `forgetSuspendedRun(run, 'cancelled')`, whose
store delete is by id and unconditional — nothing like `resume`'s advance
claim. Two cancels of one run overlapping in time therefore both answer
`true` and both record the terminal `cancelled` log.
Say what the engine does: `true` means this call cancelled a suspended run
(the `@returns` line, unchanged), NOT that it was the only one — a caller
may not read sole authorship out of it, nor use it as an idempotency token
for a once-only side effect. Prose only; the `@returns` line, the pin, the
changeset and the result shape are untouched. Whether the engine should
grow a cancel-side compare-and-set is the services half's call, not this
contract's.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Enotrue is not exclusive to the call that read it1 parent 60aaf36 commit bd193c6
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
688 | 688 | | |
689 | 689 | | |
690 | 690 | | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
698 | 702 | | |
699 | 703 | | |
700 | 704 | | |
| |||
0 commit comments