# CMD-01 command-refusal experiment

This fixture supports the planned article *A Valid Command Can Still Be
Refused*. It follows one Laravel cancellation request through four distinct
questions:

- whether the HTTP payload has a recognized representation;
- whether an immutable command can be constructed;
- whether current order state permits the transition; and
- whether the state change commits.

The example is synthetic. It does not claim that this cancellation rule,
exception policy, or HTTP mapping came from Brian's production work.

## Run it

Docker is the only host runtime dependency.

```sh
./run.sh
```

The runner builds the digest-pinned image and retains commands, expected and
actual exits, durations, complete output, HTTP inputs and responses, commands,
traces, before and after rows, responsibility reports, source diffs, and tool
versions under `results/`.

## Behavior matrix

| Case | Expected boundary |
| --- | --- |
| unknown reason on placed order | Laravel returns 422 before command construction |
| recognized reason on placed order | command reaches the domain and commits cancellation |
| recognized reason on shipped order | command reaches the domain, is refused, and leaves the row unchanged |
| command created before placed-to-shipped change | the same command object is refused during handling |
| failure after repository save | Laravel rolls the SQLite transaction back |

The fixture maps `OrderCannotBeCancelled` to 409 at the web edge. That is an
explicit example choice, not a universal mapping for domain refusal.

## Negative controls

Owned controls remove the enum rule, remove the aggregate guard, remove the
transaction, and trust a stale placed-state precheck. Each must fail its
specific behavior check. Four source defects also prove the analyzer rejects
cached state in a command, HTTP types in the domain, direct controller writes,
and transport rules in an aggregate.

## Boundary of the conclusion

Laravel feature requests run in-process. SQLite proves the retained state and
rollback behavior used by this example, not MySQL or PostgreSQL concurrency or
locking semantics. The controlled state change proves that a well-formed
command can meet different authoritative state; it does not reproduce a
production race scheduler. The fixture does not measure request speed,
debugging time, defect rates, or the value of a command bus.
