State Is Visible
Records and tables show the data the behavior reads and writes.
Specs you can run
In GWT, the spec is the program. Read the rules, run them, and trace each result back to the behavior that produced it. Built for people to understand and review as AI helps write the code.
The same file can also carry GIVEN / WHEN / THEN scenarios for tests. Capture real runs and compare behavior changes without creating a second implementation of the rules. GWT runs directly, with exact numbers and source-backed explanations.
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 <= 1500
set quote.status to "standard"
set quote.fee to 5
ELSE
set quote.status to "standard"
set quote.fee to 9
Example input1,500g parcel · Nonmember
How it works
A GWT file shows the setup, the behavior, the input and output, and the examples that prove it works.
Walk through the basicsRecords and tables show the data the behavior reads and writes.
Reusable WHEN blocks read like real workflow steps.
REQUEST says what input is required.
OUTPUT says what result is returned.
Missing data and bad shapes fail loudly instead of turning into silent defaults.
Scenarios live in the same file, so examples can be read and run in CI.
Captured Execution Cases preserve what ran; corpora name the cases that matter for repeatable old/new review.
Try a real change
Raise the low-fee weight limit from 1,000g to 1,500g. Check which customers pay less, and whether membership benefits, heavy-parcel handling, and invalid-input rejection still hold.
Run the walkthroughBehavior review
Capture integrity-checked executions, give important cases stable domain names, replay them against two real program versions, and open a self-contained review dossier.
Read the evidence workflowRust foundation
The Rust engine checks and executes GWT source. Use the command line, embed it in a Rust application, or run the WebAssembly build in a browser. The language has its own explicit semantics.
Explore host integrationTry it
Use GWT to check a policy, run a request, and review a proposed change.
Get GWT and follow the exampleValidate the policy and run its embedded scenarios.
gwt validate delivery.gwt
Send a parcel’s weight and membership status to the delivery policy.
gwt run delivery.gwt \
--request "quote delivery" \
--input parcel.json
Compare captured requests with the proposed policy and explore the evidence in your browser.
gwt review delivery.corpus.json \
--candidate proposed.gwt \
--html delivery-review.html
Boundaries
GWT is experimental. GWT is aimed at workflows whose rules need to stay readable, executable, and reviewable. Whether it improves human understanding is still to be measured.
Read the principles