feedback-free.openapps.xyz

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.
Owned app · rev 4a4c54cd95c6
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 54b9c9d7fdc2b68029ce2e57
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.
← All files
policy-tests/votes.json
{
  "version": "1",
  "name": "votes: one per person, counted exactly, removable only by the voter",
  "actors": {
    "Owen": "owen_user",
    "Vic": "vic_user",
    "Ann": "ann_user",
    "Eve": "eve_user"
  },
  "constants": {
    "BOUNDED_PUBLIC_PRINCIPAL_API": "api_principal"
  },
  "steps": [
    {
      "op": "setTime",
      "epoch": 1800000000
    },
    {
      "op": "as",
      "who": "Owen"
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa",
          "data": {
            "name": "Acme feedback",
            "intro": "",
            "tags": "[{\"id\":\"idea\",\"name\":\"Idea\"},{\"id\":\"bug\",\"name\":\"Bug\"}]",
            "createdBy": "owen_user",
            "createdAt": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/joins/owen_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/owners/owen_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boardkeys/board_aaaaaaaaaaaaaaaa",
          "data": {
            "key": "kkkkkkkkkkkkkkkkkkkkkkkk"
          }
        }
      ]
    },
    {
      "op": "as",
      "who": "Vic"
    },
    {
      "op": "set",
      "path": "boards/board_aaaaaaaaaaaaaaaa/joins/vic_user",
      "data": {
        "at": 1800000000
      }
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
          "data": {
            "title": "Dark mode",
            "details": "Please add it.",
            "tags": "[\"idea\"]",
            "status": "new",
            "statusAt": 1800000000,
            "votes": 1,
            "comments": 0,
            "pinned": false,
            "hidden": false,
            "name": "",
            "by": "vic_user",
            "createdAt": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/vic_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/vic_user/votes/p1",
          "data": {
            "at": 1800000000
          }
        }
      ]
    },
    {
      "op": "expect",
      "expr": "get(/boards/board_aaaaaaaaaaaaaaaa/posts/p1).votes == 1"
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p8",
          "data": {
            "title": "Dark mode",
            "details": "Please add it.",
            "tags": "[\"idea\"]",
            "status": "new",
            "statusAt": 1800000000,
            "votes": 1,
            "comments": 0,
            "pinned": false,
            "hidden": false,
            "name": "",
            "by": "vic_user",
            "createdAt": 1700000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p8/votes/vic_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/vic_user/votes/p8",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p2",
          "data": {
            "title": "Dark mode",
            "details": "Please add it.",
            "tags": "[\"idea\"]",
            "status": "new",
            "statusAt": 1800000000,
            "votes": 1,
            "comments": 0,
            "pinned": false,
            "hidden": false,
            "name": "",
            "by": "vic_user",
            "createdAt": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p3",
          "data": {
            "title": "Dark mode",
            "details": "Please add it.",
            "tags": "[\"idea\"]",
            "status": "new",
            "statusAt": 1800000000,
            "votes": 5,
            "comments": 0,
            "pinned": false,
            "hidden": false,
            "name": "",
            "by": "vic_user",
            "createdAt": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p3/votes/vic_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/vic_user/votes/p3",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p4",
          "data": {
            "title": "Dark mode",
            "details": "Please add it.",
            "tags": "[\"idea\"]",
            "status": "planned",
            "statusAt": 1800000000,
            "votes": 1,
            "comments": 0,
            "pinned": false,
            "hidden": false,
            "name": "",
            "by": "vic_user",
            "createdAt": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p4/votes/vic_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/vic_user/votes/p4",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p5",
          "data": {
            "title": "Dark mode",
            "details": "Please add it.",
            "tags": "[\"idea\"]",
            "status": "new",
            "statusAt": 1800000000,
            "votes": 1,
            "comments": 0,
            "pinned": false,
            "hidden": true,
            "name": "",
            "by": "vic_user",
            "createdAt": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p5/votes/vic_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/vic_user/votes/p5",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p6",
          "data": {
            "title": "Dark mode",
            "details": "Please add it.",
            "tags": "[\"idea\"]",
            "status": "new",
            "statusAt": 1800000000,
            "votes": 1,
            "comments": 0,
            "pinned": false,
            "hidden": false,
            "name": "",
            "by": "ann_user",
            "createdAt": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p6/votes/vic_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/vic_user/votes/p6",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "as",
      "who": "Ann"
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p7",
          "data": {
            "title": "Dark mode",
            "details": "Please add it.",
            "tags": "[\"idea\"]",
            "status": "new",
            "statusAt": 1800000000,
            "votes": 1,
            "comments": 0,
            "pinned": false,
            "hidden": false,
            "name": "",
            "by": "ann_user",
            "createdAt": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p7/votes/ann_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/ann_user/votes/p7",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "set",
      "path": "boards/board_aaaaaaaaaaaaaaaa/joins/ann_user",
      "data": {
        "at": 1800000000
      }
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
          "data": {
            "votes": {
              "operation": "increment",
              "value": 1
            }
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/ann_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/ann_user/votes/p1",
          "data": {
            "at": 1800000000
          }
        }
      ]
    },
    {
      "op": "expect",
      "expr": "get(/boards/board_aaaaaaaaaaaaaaaa/posts/p1).votes == 2"
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
          "data": {
            "votes": {
              "operation": "increment",
              "value": 1
            }
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/ann_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/ann_user/votes/p1",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "set",
      "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
      "data": {
        "votes": {
          "operation": "increment",
          "value": 1
        }
      },
      "shouldFail": true
    },
    {
      "op": "as",
      "who": "Eve"
    },
    {
      "op": "set",
      "path": "boards/board_aaaaaaaaaaaaaaaa/joins/eve_user",
      "data": {
        "at": 1800000000
      }
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
          "data": {
            "votes": {
              "operation": "increment",
              "value": 2
            }
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/eve_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/eve_user/votes/p1",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
          "data": {
            "votes": {
              "operation": "increment",
              "value": 1
            },
            "title": "Changed while voting"
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/eve_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/eve_user/votes/p1",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
          "data": {
            "votes": {
              "operation": "increment",
              "value": 1
            }
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/eve_user",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/eve_user/votes/p1",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
          "data": {
            "votes": {
              "operation": "increment",
              "value": 1
            }
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/ann_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/ann_user/votes/p1",
          "data": {
            "at": 1800000000
          }
        }
      ],
      "shouldFail": true
    },
    {
      "op": "delete",
      "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/vic_user",
      "shouldFail": true
    },
    {
      "op": "delete",
      "path": "boards/board_aaaaaaaaaaaaaaaa/people/vic_user/votes/p1",
      "shouldFail": true
    },
    {
      "op": "set",
      "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
      "data": {
        "votes": {
          "operation": "increment",
          "value": -1
        }
      },
      "shouldFail": true
    },
    {
      "op": "setMany",
      "writes": [
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
          "data": {
            "votes": {
              "operation": "increment",
              "value": 1
            }
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/eve_user",
          "data": {
            "at": 1800000000
          }
        },
        {
          "path": "boards/board_aaaaaaaaaaaaaaaa/people/eve_user/votes/p1",
          "data": {
            "at": 1800000000
          }
        }
      ]
    },
    {
      "op": "expect",
      "expr": "get(/boards/board_aaaaaaaaaaaaaaaa/posts/p1).votes == 3"
    },
    {
      "op": "as",
      "who": "Ann"
    },
    {
      "op": "deleteMany",
      "paths": [
        "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/ann_user",
        "boards/board_aaaaaaaaaaaaaaaa/people/ann_user/votes/p1"
      ],
      "shouldFail": true
    },
    {
      "op": "delete",
      "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1/votes/ann_user",
      "shouldFail": true
    },
    {
      "op": "set",
      "path": "boards/board_aaaaaaaaaaaaaaaa/posts/p1",
      "data": {
        "votes": {
          "operation": "increment",
          "value": -1
        }
      },
      "shouldFail": true
    },
    {
      "op": "expect",
      "expr": "get(/boards/board_aaaaaaaaaaaaaaaa/posts/p1).votes == 3"
    }
  ]
}

Change history

Point store links to openapps.free
4a4c54cd95 · 18 hours ago
Release with preview
1d0728818d · 19 hours ago
Retry release
1abc843b3f · 19 hours ago
Bind app agent address in policy
00eb15f50d · 19 hours ago
Use OpenApps service URLs and add contribution strip
347a7b8ca0 · 19 hours ago
Bounded source sync
a0aaceae63 · 1 day ago
Bounded source sync
3125b8113f · 1 day ago
Bounded source sync
882a76ba95 · 1 day ago
Bounded source sync
852d9782ee · 1 day ago
Bounded source sync
a8ee705109 · 1 day ago