Source
This app’s code and revision history are public. Download a copy or explore the files below.
Public
The app’s code and revision history are public.
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 7385a6c1c47153b1728160ff
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
policy-tests/bookings.json
{
"version": "1",
"name": "no double booking, moves, cancels, owners and days off",
"actors": {
"Olive": "olive_id",
"Gus": "gus_id",
"Hal": "hal_id",
"Api": "api_principal"
},
"constants": {
"BOUNDED_PUBLIC_PRINCIPAL_API": "api_principal"
},
"steps": [
{
"op": "setTime",
"epoch": 1800000000
},
{
"op": "as",
"who": "Olive"
},
{
"op": "setMany",
"writes": [
{
"path": "pages/olivepage",
"data": {
"name": "Olive",
"title": "Intro call",
"description": "",
"durationMin": 30,
"timezone": "UTC",
"hours": "{\"mon\":[\"09:00-17:00\"]}",
"noticeHours": 0,
"horizonDays": 60,
"bufferMin": 0,
"questions": "[]",
"meeting": "Google Meet",
"createdBy": "$Olive",
"createdAt": 1800000000
}
},
{
"path": "pages/olivepage/owners/olive_id",
"data": {
"at": 1800000000
}
},
{
"path": "pagekeys/olivepage",
"data": {
"key": "ownerkeyownerkeyownerkey"
}
},
{
"path": "pagelinks/olivepage",
"data": {
"meetingUrl": "https://meet.google.com/abc-defg-hij"
}
}
]
},
{
"op": "set",
"path": "pages/olivepage",
"data": {
"name": "Olive",
"title": "Intro call",
"description": "",
"durationMin": 30,
"timezone": "UTC",
"hours": "{\"mon\":[\"09:00-17:00\"]}",
"noticeHours": 0,
"horizonDays": 60,
"bufferMin": 0,
"questions": "[]",
"meeting": "Google Meet",
"createdBy": "$Olive",
"createdAt": 1800000000,
"daysOff": "[[\"2027-01-20\",\"2027-01-22\"]]"
}
},
{
"op": "expect",
"expr": "get(/pages/olivepage).daysOff == '[[\"2027-01-20\",\"2027-01-22\"]]'"
},
{
"op": "as",
"who": "Gus"
},
{
"op": "setMany",
"writes": [
{
"path": "pages/olivepage/bookings/bookingGus111111111",
"data": {
"start": 1800086400,
"end": 1800088200,
"heldUntil": 1800088200,
"name": "Guest",
"email": "guest@example.com",
"note": "",
"answers": "[]",
"status": "booked",
"by": "$Gus",
"createdAt": 1800000000
}
},
{
"path": "pages/olivepage/slots/1800086400",
"data": {
"bookingId": "bookingGus111111111",
"at": 1800086400,
"next": 1800087300
}
},
{
"path": "pages/olivepage/slots/1800087300",
"data": {
"bookingId": "bookingGus111111111",
"at": 1800087300
}
},
{
"path": "bookingkeys/bookingGus111111111",
"data": {
"key": "cancelkeycancelkeycancel",
"handle": "olivepage"
}
},
{
"path": "pages/olivepage/bookers/gus_id",
"data": {
"bookingId": "bookingGus111111111"
}
}
]
},
{
"op": "read",
"path": "pages/olivepage/bookings/bookingGus111111111"
},
{
"op": "read",
"path": "pagelinks/olivepage"
},
{
"op": "set",
"path": "pages/olivepage",
"data": {
"name": "Olive",
"title": "Intro call",
"description": "",
"durationMin": 30,
"timezone": "UTC",
"hours": "{\"mon\":[\"09:00-17:00\"]}",
"noticeHours": 0,
"horizonDays": 60,
"bufferMin": 0,
"questions": "[]",
"meeting": "Google Meet",
"createdBy": "$Olive",
"createdAt": 1800000000,
"daysOff": "[]"
},
"shouldFail": true
},
{
"op": "as",
"who": "Hal"
},
{
"op": "setMany",
"writes": [
{
"path": "pages/olivepage/bookings/bookingHal111111111",
"data": {
"start": 1800087300,
"end": 1800089100,
"heldUntil": 1800089100,
"name": "Guest",
"email": "guest@example.com",
"note": "",
"answers": "[]",
"status": "booked",
"by": "$Hal",
"createdAt": 1800000000
}
},
{
"path": "pages/olivepage/slots/1800087300",
"data": {
"bookingId": "bookingHal111111111",
"at": 1800087300,
"next": 1800088200
}
},
{
"path": "pages/olivepage/slots/1800088200",
"data": {
"bookingId": "bookingHal111111111",
"at": 1800088200
}
},
{
"path": "bookingkeys/bookingHal111111111",
"data": {
"key": "cancelkeycancelkeycancel",
"handle": "olivepage"
}
},
{
"path": "pages/olivepage/bookers/hal_id",
"data": {
"bookingId": "bookingHal111111111"
}
}
],
"shouldFail": true
},
{
"op": "setMany",
"writes": [
{
"path": "pages/olivepage/bookings/bookingHal222222222",
"data": {
"start": 1800086400,
"end": 1800088200,
"heldUntil": 1800088200,
"name": "Guest",
"email": "guest@example.com",
"note": "",
"answers": "[]",
"status": "booked",
"by": "$Hal",
"createdAt": 1800000000
}
},
{
"path": "pages/olivepage/slots/1800086400",
"data": {
"bookingId": "bookingHal222222222",
"at": 1800086400,
"next": 1800087300
}
},
{
"path": "pages/olivepage/slots/1800087300",
"data": {
"bookingId": "bookingHal222222222",
"at": 1800087300
}
},
{
"path": "bookingkeys/bookingHal222222222",
"data": {
"key": "cancelkeycancelkeycancel",
"handle": "olivepage"
}
},
{
"path": "pages/olivepage/bookers/hal_id",
"data": {
"bookingId": "bookingHal222222222"
}
}
],
"shouldFail": true
},
{
"op": "read",
"path": "pages/olivepage/bookings/bookingGus111111111",
"shouldFail": true
},
{
"op": "read",
"path": "pagelinks/olivepage",
"shouldFail": true
},
{
"op": "read",
"path": "pagekeys/olivepage",
"shouldFail": true
},
{
"op": "setMany",
"writes": [
{
"path": "pages/olivepage/bookings/bookingHal333333333",
"data": {
"start": 1800088200,
"end": 1800090000,
"heldUntil": 1800090000,
"name": "Guest",
"email": "guest@example.com",
"note": "",
"answers": "[]",
"status": "booked",
"by": "$Hal",
"createdAt": 1800000000
}
},
{
"path": "pages/olivepage/slots/1800088200",
"data": {
"bookingId": "bookingHal333333333",
"at": 1800088200,
"next": 1800089100
}
},
{
"path": "pages/olivepage/slots/1800089100",
"data": {
"bookingId": "bookingHal333333333",
"at": 1800089100
}
},
{
"path": "bookingkeys/bookingHal333333333",
"data": {
"key": "halkeyhalkeyhalkeyhalkey",
"handle": "olivepage"
}
},
{
"path": "pages/olivepage/bookers/hal_id",
"data": {
"bookingId": "bookingHal333333333"
}
}
]
},
{
"op": "set",
"path": "pages/olivepage/bookings/bookingGus111111111",
"data": {
"status": "cancelled",
"cancelledBy": "guest",
"cancelledAt": 1800000000,
"movedTo": "bookingHal333333333"
},
"shouldFail": true
},
{
"op": "set",
"path": "pages/olivepage/bookings/bookingHal333333333",
"data": {
"movedTo": "bookingHal333333333"
},
"shouldFail": true
},
{
"op": "as",
"who": "Gus"
},
{
"op": "setMany",
"writes": [
{
"path": "pages/olivepage/bookings/bookingGus222222222",
"data": {
"start": 1800090000,
"end": 1800091800,
"heldUntil": 1800091800,
"name": "Guest",
"email": "guest@example.com",
"note": "",
"answers": "[]",
"status": "booked",
"by": "$Gus",
"createdAt": 1800000000
}
},
{
"path": "pages/olivepage/slots/1800090000",
"data": {
"bookingId": "bookingGus222222222",
"at": 1800090000,
"next": 1800090900
}
},
{
"path": "pages/olivepage/slots/1800090900",
"data": {
"bookingId": "bookingGus222222222",
"at": 1800090900
}
},
{
"path": "bookingkeys/bookingGus222222222",
"data": {
"key": "cancelkeycancelkeycancel",
"handle": "olivepage"
}
},
{
"path": "pages/olivepage/bookers/gus_id",
"data": {
"bookingId": "bookingGus222222222"
}
},
{
"path": "pages/olivepage/bookings/bookingGus111111111",
"data": {
"status": "cancelled",
"cancelledBy": "guest",
"cancelledAt": 1800000000,
"movedTo": "bookingGus222222222"
}
}
]
},
{
"op": "deleteMany",
"paths": [
"pages/olivepage/slots/1800086400",
"pages/olivepage/slots/1800087300"
]
},
{
"op": "expect",
"expr": "get(/pages/olivepage/bookings/bookingGus111111111).status == 'cancelled' && get(/pages/olivepage/bookings/bookingGus111111111).movedTo == 'bookingGus222222222'"
},
{
"op": "expect",
"expr": "get(/pages/olivepage/slots/1800086400) == null && get(/pages/olivepage/slots/1800090000).bookingId == 'bookingGus222222222'"
},
{
"op": "set",
"path": "pages/olivepage/bookings/bookingGus111111111",
"data": {
"status": "booked"
},
"shouldFail": true
},
{
"op": "as",
"who": "Hal"
},
{
"op": "setMany",
"writes": [
{
"path": "pages/olivepage/bookings/bookingHal444444444",
"data": {
"start": 1800086400,
"end": 1800088200,
"heldUntil": 1800088200,
"name": "Guest",
"email": "guest@example.com",
"note": "",
"answers": "[]",
"status": "booked",
"by": "$Hal",
"createdAt": 1800000000
}
},
{
"path": "pages/olivepage/slots/1800086400",
"data": {
"bookingId": "bookingHal444444444",
"at": 1800086400,
"next": 1800087300
}
},
{
"path": "pages/olivepage/slots/1800087300",
"data": {
"bookingId": "bookingHal444444444",
"at": 1800087300
}
},
{
"path": "bookingkeys/bookingHal444444444",
"data": {
"key": "halkeyhalkeyhalkeyhalke2",
"handle": "olivepage"
}
},
{
"path": "pages/olivepage/bookers/hal_id",
"data": {
"bookingId": "bookingHal444444444"
}
}
]
},
{
"op": "setMany",
"writes": [
{
"path": "pageclaims/olivepage/c/hal_id",
"data": {
"key": "wrongkeywrongkeywrongkey"
}
},
{
"path": "pages/olivepage/owners/hal_id",
"data": {
"at": 1800000000
}
}
],
"shouldFail": true
},
{
"op": "as",
"who": "Olive"
},
{
"op": "read",
"path": "pages/olivepage/bookings/bookingGus222222222"
},
{
"op": "setMany",
"writes": [
{
"path": "pages/olivepage/bookings/bookingHal333333333",
"data": {
"status": "cancelled",
"cancelledBy": "owner",
"cancelledAt": 1800000000
}
}
]
},
{
"op": "deleteMany",
"paths": [
"pages/olivepage/slots/1800088200",
"pages/olivepage/slots/1800089100"
]
},
{
"op": "set",
"path": "pages/olivepage",
"data": {
"name": "Olive",
"title": "Intro call",
"description": "",
"durationMin": 30,
"timezone": "UTC",
"hours": "{\"mon\":[\"09:00-17:00\"]}",
"noticeHours": 0,
"horizonDays": 60,
"bufferMin": 0,
"questions": "[]",
"meeting": "Google Meet",
"createdBy": "$Olive",
"createdAt": 1800000000,
"daysOff": null
}
},
{
"op": "as",
"who": "Api"
},
{
"op": "read",
"path": "pagekeys/olivepage"
},
{
"op": "as",
"who": "Hal"
},
{
"op": "setMany",
"writes": [
{
"path": "pageclaims/olivepage/c/hal_id",
"data": {
"key": "ownerkeyownerkeyownerkey"
}
},
{
"path": "pages/olivepage/owners/hal_id",
"data": {
"at": 1800000000
}
}
]
},
{
"op": "read",
"path": "pages/olivepage/bookings/bookingGus222222222"
}
]
}Change history
Add favicon.ico and link tag
Quality pass: guest reschedule, days off, calendar feed, API docs
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync