Try A Delivery Policy
Start with the interactive review in your browser, or download the example to run it yourself. The download matches the Preview 1 binaries and includes the rules, a proposed change, input facts, nine captured cases, and matching engine information.
For local execution, install GWT, unzip the example,
and open a terminal in its delivery-example directory.
gwt version --json
You’ll use delivery.gwt for the current policy,
proposed.gwt for the change, and parcel.json for a customer’s request.
Read The Executable Policy
The baseline charges nonmembers 5 up to 1,000g and 9 above that. Members pay zero. Parcels above 5,000g require manual handling, even for members; nonpositive weights fail.
REQUEST describes the input and output. A named WHEN block implements the behavior.
DECIDE executes its first matching arm, so the order expresses policy precedence.
PROGRAM delivery quote
RECORD Parcel
weight_grams: integer
member: boolean
RECORD Quote
status: "standard" | "manual"
fee: integer
REQUEST quote delivery
GIVEN parcel is Parcel
GIVEN quote is Quote
status: "standard"
fee: 0
WHEN quote delivery for parcel into quote
OUTPUT quote is Quote
THEN quote.fee >= 0
WHEN quote delivery for <parcel> into <quote>
GIVEN parcel is Parcel
AND quote is Quote
REQUIRE parcel.weight_grams > 0
DECIDE
WHEN parcel.weight_grams > 5000
set quote.status to "manual"
set quote.fee to 0
WHEN parcel.member
set quote.status to "standard"
set quote.fee to 0
WHEN parcel.weight_grams <= 1000
set quote.status to "standard"
set quote.fee to 5
ELSE
set quote.status to "standard"
set quote.fee to 9The rest of the file contains a shared setup, a scenario, and ten example rows that check weight and membership boundaries.
Read the complete baselineRun The Proposed Change
Before running the change, predict the outcome: a 1,500g nonmember parcel should cost 5; a 1,501g parcel should still cost 9. A 5,001g member parcel should still require manual handling.
The proposed policy in proposed.gwt extends the low-fee band to 1,500g inclusive.
It updates the boundary examples and tests zero-weight rejection. Validate its 14 scenarios, then run a 1,500g nonmember request:
gwt validate delivery.gwt
gwt validate proposed.gwt
gwt run proposed.gwt \
--request "quote delivery" \
--input parcel.jsonThe declared result is:
{"quote":{"status":"standard","fee":5}}The complete run payload also includes final state, diagnostics, source identity, and execution evidence.
Compare The Same Input
The example includes nine captured baseline requests. Compare them with the proposed policy:
gwt review delivery.corpus.json \
--candidate proposed.gwt \
--html delivery-review.html \
--decisions-template pending-decisions.jsonOpen delivery-review.html in your browser. Select Outcome changed, then new-limit, and compare the fee:
9 → 5. Follow the branch and write events to the source conditions:
1500 <= 1000 was false; 1500 <= 1500 is true.
The page lets you record Pending, Accept, Reject, or Needs information, add notes, and download your decisions. The generated review starts pending. Use new output filenames if you repeat the command; existing reviews and decision files are protected from overwrite. Execution evidence explains what happened; the reviewer decides whether it matches the intended policy.
To check the decision gate, run gwt assess-review delivery.corpus.json --candidate proposed.gwt --decisions pending-decisions.json. It intentionally exits with status 1 while all nine decisions are pending; this is not an execution failure.
Only two outcomes change. The zero-weight rejection remains a failure in both revisions; the other cases check unchanged policy boundaries.
Continue to the nine-case walkthroughContinue Exploring
Use the language reference for the rules of GWT, or explore integration with your application.