# How to verify an app before you publish it

The pages workflow does this for every example before the site goes live. Do the same for your own prompt before you push it.

**Figure: The steps, in order.** 5 steps. Each section below is one of them.

| Step | What happens |
| --- | --- |
| 1. Clone prism-devrel | the builder and the lock |
| 2. Check the prompt | refused prompts stop here |
| 3. Build and run the gate | just vv in the locked SDK |
| 4. Record observed axioms | only when LLV7005 is reported |
| 5. Find the holo | the verified app |

## 1. Clone prism-devrel

```
git clone https://github.com/afflom/prism-devrel.git && cd prism-devrel
```

The clone has the builder, frame.lock (the template commit) and prismpm.lock (the SDK image).

## 2. Check the prompt

```
node builder/cli.mjs check examples/rule-30-cell.prompt.json
```

Exit codes: 0 done, 2 the prompt was refused (the reason is printed), 64 usage.

## 3. Build and run the gate

Save this as verify.sh, with PROMPT set to your prompt. It is the pages workflow's own steps for an example.

```
set -euo pipefail
PROMPT=examples/rule-30-cell.prompt.json
RUNNER_TEMP=$(mktemp -d)
field() { node -e 'process.stdout.write(JSON.parse(require("fs").readFileSync("frame.lock", "utf8")).source[process.argv[1]])' "$1"; }
instance="$RUNNER_TEMP/instance"
git init -q "$instance"
git -C "$instance" fetch -q --depth 1 "https://github.com/$(field repository)" "$(field commit)"
git -C "$instance" checkout -q --detach FETCH_HEAD
test "$(git -C "$instance" rev-parse HEAD)" = "$(field commit)"
node builder/cli.mjs build "$PROMPT" --out "$instance"
image=$(sed -n 's/.*"sdk_image":"\([^"]*\)".*/\1/p' prismpm.lock)
if [[ ! $image =~ ^[a-z0-9.-]+(:[0-9]{1,5})?/[a-z0-9./_-]+@sha256:[0-9a-f]{64}$ ]]; then
  printf '%s\n' 'prismpm.lock does not select an immutable SDK image' >&2
  exit 64
fi
docker_config=$(mktemp -d)
# The SDK's /tmp is a private directory on the runner's own disk, so the
# build's scratch space is bounded by the disk the runner has, not by a
# fixed size; it is removed with the credentials when the step ends.
scratch=$(mktemp -d)
mkdir -p "$scratch/prismpm-home/.docker"
trap 'rm -rf "$docker_config" "$scratch"' EXIT
printf '{}\n' >"$docker_config/config.json"
docker run --rm \
  --user "$(id -u):$(id -g)" \
  --group-add "$(stat -c '%g' /var/run/docker.sock)" \
  --volume "$scratch:/tmp" \
  --volume "$instance:$instance" \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  --volume "$docker_config:/tmp/prismpm-home/.docker:ro" \
  --workdir "$instance" \
  --env DOCKER_CONFIG=/tmp/prismpm-home/.docker \
  --env BUILDX_CONFIG=/tmp/prismpm-buildx \
  --env HOME=/tmp/prismpm-home \
  --env PRISMPM_EPHEMERAL_HOME=1 \
  "$image" just vv
```

It calls git, node and docker.

```
bash verify.sh 2>&1 | tee verify.log
```

## 4. Record observed axioms

If the log reports LLV7005, record what the verify observed. Record in the prompt the exact axiom set each declaration was observed to use, from the LLV7005 diagnostics of a verify (as prism-code does).

```
node builder/cli.mjs axioms examples/rule-30-cell.prompt.json verify.log
```

Then run verify.sh again.

## 5. Find the holo

When the gate passes, the verified holo is in the instance the script made. Add this line to the end of verify.sh to print where.

```
ls "$instance"/app/.prism/build/*/*.holo
```

## Next

- [How to publish an app on GitHub Pages](../../guides/publish/index.md)
