# Changing an existing store rule twice

Run [the store-credit trial](spree-trial.md) on an isolated Spree test store first. Keep its orders, driver classes, private configuration and result state. The next trial imports the actual v1 and v2 order references and checks their original $50 outcomes. It creates paid test orders and posts native credit using the same Spree API connection. Use a separate test store for each independent reproduction.

## Measured code changes

The archived v15 controls still ran on all three engines. The new purchase-time exception initially failed on all three. Its raw input added an `unless` property to the existing monetary condition. The recorded diagnostics are in [checkout-v15.json](checkout-v15.json).

| First exception | Added source files | Physical lines |
| --- | ---: | ---: |
| Phaseline public exception syntax and structured-input adapter | 2 | 61 |
| Python and Alloy baseline exception adapter, shared between them | 1 | 43 |
| Edition history, authority, observation and credit decision, shared by all | 1 | 206 |
| Store comparison fixture and instrumentation, shared by all | 1 | 174 |
| Existing Spree credit connector, existing numeric engines and Alloy Java driver | 0 edits | 0 |

These are file inventories, including comments, blank lines and validation. They do not measure authoring effort. The language example and CLI were also updated to expose the new syntax to users. The first-stage fixture/imports and source are downloadable in the [comparison kit](/capacity-kit.zip).

On the subsequent draw, all source files in the execution manifest stayed byte-identical. Each tool received one edited eligibility declaration and one new fact-to-catalog mapping. The declarative effect binding and credit adapter were reused. The common release book carries durable decisions and authority for every arm. An owner-approved edition has a content digest that includes the evidence mappings. A read with missing history requests the order's exact edition. A missing fact that can change delivery requests the named evidence owner. The evaluator can decide without the missing classification when no allowed value changes the effect. Local owner/reader roles here are test identities supplied by the operator.

The machine clock for each stage and arm includes local work and its store API calls. Additional site authoring, store provisioning, initial code development, program launch by the operator and the shared restart are outside that timer. A setup run encountered HTTP 429; the measured harness honors rate-limit feedback and retries only reads or mutations carrying an idempotency key. Human engineer minutes and actual interruptions are unmeasured. One approval was simulated per release per tool, with an explicit repeat and stale-proposal checks. Each phase includes six deliberate hold controls and one withheld purchase whose genuinely missing classification prevents delivery.

## Reproduce

Use Python 3.11+, Node 22+, the existing Alloy 6.2.0 JAR and JDK. The tested JAR SHA-256 was `6037cbeee0e8423c1c468447ed10f5fcf2f2743a2ffc39cb1c81f2905c0fdb9d`. In a fresh extraction of the kit replace the example `spree-orders.json` with the successful result from **your** store’s original run. All amounts are positive whole US cents, up to 999999999. This SKU port admits one purchased variant per order. A multi-item basket with a material unknown must have an agreed aggregation rule.

Create three extra single-variant test products using the same store, active channel, price and inventory setup as the original voucher in the Spree instructions. Write a private JSON object named `catalog.json`, mapping `Standard` to the original voucher variant and `Outlet`, `Display`, and `Unknown` to their three distinct Spree variant IDs. The first binding classifies the outlet stock as final sale. The last product deliberately has no classification.

```sh
export ALLOY_CP="$PWD/old-trial:$ALLOY_JAR"
javac -cp "$ALLOY_JAR" -d ./old-trial ReadProfiles.java
cp old-trial/state.json spree-orders.json
python3 checkout_trial.py exception ./successive ./private ./catalog.json
cp successive/result.json successive/frozen.json
python3 checkout_trial.py draw ./successive ./private ./catalog.json
python3 checkout_trial.py transfer ./successive ./private ./catalog.json
# Restart the isolated store's web process, then wait for /up.
python3 checkout_trial.py audit ./successive ./private ./catalog.json
```

The second edit’s property name and threshold are drawn only after freezing. Its case family (a different SKU exception) and independent oracle were designed in advance by the same operator. This is controlled transfer within a supported rule family. The test compares old and new source, checks both named consequences, pins each order to its original policy, retries credit and reads the actual balance on a fresh connection. Previously earned credits remain usable under their original terms. A purchase can be released after a denied grant is restored or the missing edition is recovered. The fixture checks that the affected purchase stayed untouched during those controls.

## Independent comparison, on hold

Give an unfamiliar engineer a new change, the same shop history, API permissions, tooling setup and time budget. Keep expected outcomes with a separate examiner. Let each arm reuse its installed code. Start the clock on receipt of the request; stop only after independently reading actual balances. Log active setup, policy editing, troubleshooting, approval wait and readback separately. Record who was interrupted, why, what evidence was missing and whether it was needed. Score wrong grants, missed grants, unnecessary holds and changed source/configuration before comparing engineer time. Rotate tool order across participants; report participant-level results and uncertainty. Retain the incumbent where it achieves the same safety and cost. [GitHub work item](https://github.com/verifyrun/verify-platform/issues/196#issuecomment-7055352274)
