# What is VPF?
VPF, the Verifiable Plan Format, is one way to write any plan, so that any program can run it.
VPF is a file format for plans. A person or a machine writes the plan, and a program reads it, checks it and runs it,
step by step. Every step says how we will know it is done, before the work begins.
## The three questions
A plan in VPF answers three questions. Here they are for a team that wants its monthly sales report:
What do you want?“The monthly sales report, sent to the team.”wish, do
Who will do it?An agent, an algorithm, a person, or another plan.by
How will we know it is done?The report is there, every number matches the sales, and the manager approves it.proof
## Why it matters
Agents can now do real work: write a report, fix a test, answer a customer. What they still lack is a common way to
say, before they start, what done means. Without it, the one who did the work is also the one who says it is good.
VPF writes the measure down first. The command that must pass, what another agent must find true and the question a
person will answer are part of the plan, so that every step is proven by something that stood before it.
- **For people**: one file says what will happen and how each step will be checked, in words anyone can read.
- **For agents**: they know what will prove their work before they begin, and refused work comes back with the reasons.
- **For programs**: one format to read, check and run, whatever made the plan.
## VPF and VEP
Every plan is made of a vision, an execution and a proof. Together they are called VEP. VEP is what a plan is, and VPF
is the file that says it, as a score writes music down so that any musician can play it.
## Where to go next
# A first plan
A team wants its monthly sales report. Read the plan in words and then as the file. It is the same plan.
VisionExecutionProof
## In words
## The file
<<< @/../examples/monthly-sales-report.vpf.json [monthly-sales-report.vpf.json]
## What happens when it runs
1. A command exports last month's sales. If it fails, an agent fixes what stands in its way, and the command runs
again as the proof.
2. An agent writes the report. Three proofs stand between its work and the next step: the file must be there, another
agent must find every number the same as in the sales, and a person must say it is ready.
3. A command sends the report to the team.
If a proof refuses the report, it goes back to the agent with the reasons, and every proof is asked again. After two
refused attempts, set by `limits.repeats`, the person is asked whether to go on.
## Next
- Learn the [principle](/docs/learn/principle) behind every plan.
- [Write a plan](/docs/develop/write-a-plan) of your own.
- See more [examples](/examples/) of everyday work.
# The principle
Every plan is made of three things: a vision, an execution and a proof.
Written down or not, a plan has a vision, an execution and a proof. Together they are called VEP. They are older than
any computer: you say what you want, someone makes it, and someone looks and says it is good.
VisionWhat is wanted.
ExecutionWho makes it, and the making.
ProofWhat shows it was made.
A plan that cannot answer the third question is not another kind of plan. It is an unfinished one.
## VEP and VPF
VEP is what a plan is. VPF is the file that says it. The format is named after the proof, since it is the part a plan
is most often written without.
| In VEP | In the file |
| --------- | ----------------------------------------------- |
| Vision | `wish` for the whole plan, `do` for each step |
| Execution | `by`, and what belongs to who does the step |
| Proof | `proof` |
## Four rules that do not change
1. Nothing is done without its proof.
2. The proof comes from what stood before the work: what is true of the world, what the plan said would prove it, and
whoever gave the vision. Who makes a piece of work may check it, and never sets its measure.
3. Work that is refused goes back to who made it, with the reason.
4. Whoever gave the vision has the last word, and what they approve is the ground of their next wish.
::: tip
The kinds of who does a step, the kinds of proof and the fields of the file may grow. The three things and the four
rules stay.
:::
# Steps
A plan is a list of steps, done in the order they are written. Each step says what to do, who does it and what proves
it.
```json
{ "id": "report", "do": "Write report/report.md from report/sales.csv.", "by": "agent", "proof": { "by": "agent", "check": "Every number matches report/sales.csv." } }
```
- `id` is how other steps name it: small letters, digits and `-`, at most 24.
- `do` says what to do, in words. Whoever does the step is also told the plan's `wish`.
- `by` says who does it.
## Who does a step
| `by` | The work | Its proof |
| ----------- | ---------------------------------------------------------- | ------------------------------------------------- |
| `agent` | An agent does what `do` says. | Required. An agent does not set its own measure. |
| `algorithm` | The command in `run`. It did its work when it ended with 0. | The command itself, and any proofs you add. |
| `person` | The person is asked what `do` says and answers. | None. Their word stands. |
| `plan` | Another plan, named in `plan`, runs as this step. | None here. Its own steps carry its proofs. |
An agent's step may name the agent (`agent`), the model (`model`) and the only kinds of tools it may use (`tools`:
`read`, `write`, `commands`, `internet`, `screen`). Give an agent only the tools the step needs.
## An agent behind a command
A command that fails can get help. With `"on_fail": "agent"`, an agent is given what the command wrote, fixes what
stands in its way, and then the same command runs again as the proof of the agent's work.
```json
{ "id": "tests", "do": "Run the whole test suite.", "by": "algorithm", "run": "make test", "on_fail": "agent" }
```
## Naming what came before
A text of a step can use the answer of an earlier step, `{{id}}`, or what the run was started with, `{{asked}}`.
```json
{ "id": "welcome", "do": "Write onboarding/welcome.md for {{asked}}.", "by": "agent", "proof": { "by": "person" } }
```
A step's work may only name steps written before it. Its proofs come after the work, so they may also name the step
itself.
See the [specification of steps](/specification/v1/steps) for every rule.
# Proofs
A proof says how the work of a step is known to be done. It is written before the work, and there are three kinds.
| `by` | Fields | It passes when |
| ----------- | ------------------------- | ---------------------------------------------------------------------- |
| `algorithm` | `run` | The command ends with 0. What it wrote is the points against the work. |
| `algorithm` | `needs` | Everything named is in the folder. No model is asked. |
| `agent` | `check`, `agent`, `model` | Another agent finds what `check` says true of the work. It only reads. |
| `person` | `ask` | The person approves. |
A step can have one proof or a list of up to eight. They are asked in order, and all must pass.
## Cheapest first
Put the cheapest proof first: an algorithm, then an agent, then a person. A person is then asked only about work that
already stands.
```json
"proof": [
{ "by": "algorithm", "needs": [{ "need": "files", "path": "report/report.md" }] },
{ "by": "agent", "check": "Every number in the report is the same as in report/sales.csv." },
{ "by": "person", "ask": "Is this report ready to send?" }
]
```
## Needs
A proof by an algorithm can name what the work must leave in the folder, with no command to write.
| `need` | Fields | It is met when |
| ------------ | ------------------ | ---------------------------------------------------------------------------- |
| `files` | `path`, `at_least` | At least `at_least` files (1 when absent) match `path`. |
| `folder` | `path` | The folder exists and has something in it. |
| `names` | `path`, `files` | The file `path` names each file that matches `files`: a caption per picture. |
| `headings` | `path`, `headings` | The page has each heading, each with words under it. |
| `repository` | `path`, `branch` | `path` is a version-control repository, on `branch` when given. |
Every path stays inside the folder, and `*` stands for any text within a name.
## Who judges
The agent that proves a step is never the agent that did it, and it only reads: it can look at the work, not change
it. That is the second rule: who makes a piece of work may check it, and never sets its measure.
See the [specification of proofs](/specification/v1/proofs) for every rule.
# How a plan runs
A program that runs plans is called a runner. Every runner does the same things, in the same order.
1. **It checks the plan.** A plan with a [problem](/specification/v1/problems) does not run.
2. **It does the steps in order.** A step starts when the one before it has passed.
3. **It tells each worker the wish.** An agent is also told, before it works, what will prove its work.
4. **It asks the proofs in order.** The first that refuses stops the others.
5. **Refused work goes back.** It returns to who made it, with the points against it, and every proof is asked again.
6. **The person decides when it repeats.** After `limits.repeats` refused attempts (3 when absent), the person is
asked whether to go on.
## Starting a run
A run starts when someone asks for it, unless `start` says otherwise:
| `on` | A run starts |
| ---------- | -------------------------------------------------------------- |
| `asked` | When someone asks for it. |
| `schedule` | On some days at a time, such as every Monday at 07:00. |
| `every` | Every so many minutes. |
| `files` | When a file that matches one of the paths changes. |
| `request` | When another program asks the runner. |
## Limits
`limits` says how far one run may go: how many repeats (`repeats`), how many minutes (`minutes`, 60 when absent), how
much one run may cost (`cost`) and how much all runs may cost in a month (`month`). A runner stops a run that reaches
a limit and says why.
## What a runner keeps
A runner keeps, for each run, what each step answered and each proof asked, with its result and points. That record is
what lets anyone see that each step was proven.
See the [specification of running a plan](/specification/v1/running) for every rule.
# Versioning
Every plan names its version in `$schema`. This version is `vpf/1`.
- A later version that only adds optional fields or new kinds keeps the major number, and is written `vpf/1.1`,
`vpf/1.2` and so on. A plan written for `vpf/1` stays valid.
- A change that makes a valid plan invalid, or changes what a valid plan means, takes a new major number, such as
`vpf/2`.
- A runner refuses a major version it does not know, so a plan never runs under rules it was not written for.
Version 1 is a draft until it is published. Until then it may still change; the
[specification](/specification/v1/) says so on every page.
See [how the format changes](/community/changes) for how a version is proposed and published.
# Write a plan
Five steps from a wish to a plan that may run.
1. **Say the wish.** One sentence, in your own words. Every step works toward it, and whoever does a step is told it.
2. **List the steps, in order.** Give each a short name and say what to do. A step that is too big is a plan of its
own, and a step can be another plan.
3. **Say who does each step.** An agent, an algorithm (a command), a person, or another plan.
4. **Say what proves each step, before the work.** A command that must pass, something that must be in the folder,
something another agent must find true, or a question a person answers.
5. **Check it.** Paste it in [Check a plan](/docs/tools/check). A plan with no problems may run.
## A skeleton
```json
{
"$schema": "vpf/1",
"wish": "What you want, in your words",
"steps": [
{
"id": "first",
"do": "What to do first.",
"by": "agent",
"proof": { "by": "agent", "check": "What must be true of the work." }
}
]
}
```
Save it with a name that ends in `.vpf.json`. Editors that read JSON Schema can check it as you type: point them at
[the schema](/docs/tools/schema).
## Good habits
- **Make every proof something that can fail.** “The report is good” cannot fail; “every number matches
report/sales.csv” can.
- **Prove with what stood before.** A file the work must leave, a command that already exists, a person who asked.
- **Keep a person at the end of what matters.** A step that sends, pays or publishes is better after a person's yes.
- **Give an agent only the tools it needs.** A writer needs `read` and `write`, not `internet`.
::: tip
You do not have to write the file by hand. [Ask an agent for a plan](/docs/develop/ask-an-agent), then read it in
words before it runs.
:::
# Ask an agent for a plan
Any agent that can write JSON can write a plan in VPF. Give it the wish and the rules, then check what it writes.
## Give the agent the skill
The [vpf-plans skill](https://github.com/verifiableplanformat/vpf/tree/main/skills/vpf-plans) teaches an agent to
write, check and explain plans. It follows the open [Agent Skills](https://agentskills.io) format, so any agent that
reads skills can use it: put the `vpf-plans` folder where your agent reads its skills, and ask for a plan in your own
words. The agent reads the skill when the work calls for it.
## Connect the MCP server
The [VPF MCP server](https://github.com/verifiableplanformat/mcp-server) gives any agent that speaks the
[Model Context Protocol](https://modelcontextprotocol.io) four tools: `vpf_guide` for the rules, `vpf_examples` for
plans to start from, `vpf_check` to find every problem, and `vpf_show` to tell a plan in words. None of them touches
your files or the network. Add it to your agent's MCP servers:
```json
{
"mcpServers": {
"vpf": { "command": "npx", "args": ["-y", "github:verifiableplanformat/mcp-server"] }
}
}
```
## Or paste a request
```text
Write a plan in VPF (the Verifiable Plan Format, https://verifiableplanformat.org) for this wish:
Rules:
- The file is JSON with "$schema": "vpf/1", a "wish" and a list of "steps".
- Each step has an "id" (small letters, digits and -), "do" (what to do) and "by":
"agent", "algorithm" (with "run", a command), "person" or "plan".
- Every agent's step has a "proof", written before the work: "algorithm" with "run" or "needs",
"agent" with "check", or "person" with "ask". Put the cheapest proof first.
- The agent that judges a step is never the one that did it.
- Give each agent only the "tools" it needs: read, write, commands, internet, screen.
Answer with the file only.
```
The full rules for a language model are at [llms-full.txt](https://verifiableplanformat.org/llms-full.txt), and an
index of every page at [llms.txt](https://verifiableplanformat.org/llms.txt).
## Then check it
Paste the answer in [Check a plan](/docs/tools/check) and read it in words. An agent can write a plan, and only you can
say it is the plan you meant.
# Check a plan
Paste a plan and check it. The check runs here, in your browser, and nothing is sent anywhere.
::: tip
This page checks the plan itself. A program that runs the plan also checks what only it knows, such as whether a named
agent or another plan exists.
:::
The checker finds every [problem](/specification/v1/problems) of the specification and passes every
[conformance case](/specification/v1/conformance).
# JSON Schema
The shape of a plan is published as a JSON Schema (draft 2020-12):
```text
https://verifiableplanformat.org/schema/vpf-1.schema.json
```
## In an editor
Editors that read JSON Schema check a plan as you type. In VS Code, add this to your settings:
```json
{
"json.schemas": [
{
"fileMatch": ["*.vpf.json"],
"url": "https://verifiableplanformat.org/schema/vpf-1.schema.json"
}
]
}
```
## What it checks, and what it does not
The schema checks the shape: the fields a plan may have, their types and the kinds each one allows. A file it refuses
is not a plan, with the problem `file.invalid`.
Some problems only a checker finds, such as a step that names a later one, an agent's step with no proof or a path
outside the folder. A plan that passes the schema can still have them: use [Check a plan](/docs/tools/check), or a
checker from an [SDK](/docs/sdk).
The schema is kept in the repository at
[`schema/vpf-1.schema.json`](https://github.com/verifiableplanformat/vpf/blob/main/schema/vpf-1.schema.json).
# SDKs and runners
Programs that read, check and run plans in VPF.
## SDKs
Each SDK reads a plan, checks it with the problems of the [specification](/specification/v1/problems) and shows it in
words. Each one passes every [conformance case](/specification/v1/conformance), and each comes with the same `vpf`
command: `vpf check` tells every problem of a plan, and `vpf show` says the plan in words.
| Language | Repository and package |
| ---------- | -------------------------------------------------------------------------------------------------- |
| Rust | [rust-sdk](https://github.com/verifiableplanformat/rust-sdk), crate `vpf` |
| TypeScript | [typescript-sdk](https://github.com/verifiableplanformat/typescript-sdk), `@verifiableplanformat/vpf` |
| Python | [python-sdk](https://github.com/verifiableplanformat/python-sdk), `verifiableplanformat` |
All three are at version 0.1 and are not published yet.
```sh
vpf check plan.vpf.json # every problem; ends with 1 when the plan may not run
vpf show plan.vpf.json # the plan in words: what to do, who does it and what proves it
```
## Runners
| Runner | What it is |
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [runner](https://github.com/verifiableplanformat/runner) | The reference runner, `vpf-run`: runs a plan in a folder as the specification says, and keeps a record of each run. |
| [Plenior](https://plenior.dev) | A workspace for agents that reads, checks and runs VPF plans. |
The reference runner reaches agents through one command line: it gives the command the prompt and reads its answer,
so any agent can do a step or prove one. It is at version 0.1 and is not published yet.
```sh
vpf-run plan.vpf.json --agent "your-agent-command" --asked "March"
```
## Add yours
A program that reads or runs VPF plans can be listed here. Show that it passes the conformance cases and open a pull
request; see [Contributing](/community/contributing).
# Overview
::: warning Draft
This version may still change before it is published.
:::
The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT" and "MAY" are to be read as described in
[RFC 2119](https://www.rfc-editor.org/rfc/rfc2119) and [RFC 8174](https://www.rfc-editor.org/rfc/rfc8174) when, and
only when, they appear in capitals.
The Verifiable Plan Format (VPF) is a file format for plans. A person or a machine writes a plan, and a program reads
it, checks it and runs it, step by step. Every step says what is wanted, who does it and what proves it is done, and
the proof is written before the work begins.
## The principle
Every plan, written down or not, is made of three things. Together they are called VEP:
| In VEP | What it is | Where it is written in VPF |
| --------- | ----------------------------- | --------------------------------------------------- |
| Vision | What is wanted. | `wish` for the whole plan, `do` for each step. |
| Execution | Who makes it, and the making. | `by`, and the fields that belong to who does it. |
| Proof | What shows it was made. | `proof`. |
VEP is what a plan is. VPF is the file that writes it down, so that any program can run it.
## The four rules
A program that runs a plan MUST keep these rules. The rest of this specification says how.
1. Nothing is done without its proof.
2. The proof comes from what stood before the work: what is true of the world, what the plan said would prove it, and
whoever gave the vision. Who makes a piece of work may check it, and never sets its measure.
3. Work that is refused goes back to who made it, with the reason.
4. Whoever gave the vision has the last word, and what they approve is the ground of their next wish.
## Terms
- **Plan**: a file in this format.
- **Runner**: a program that runs plans.
- **Checker**: a program that tells whether a file is a plan that may run, and if not, why. A runner MUST check a plan
before it runs it.
- **Person**: whoever asked for the run and answers for it.
- **Agent**: a program that does work from instructions in words, such as one driven by a language model.
- **Algorithm**: a command, run with no model.
- **Folder**: the directory a run works in. Every path in a plan is inside it.
- **Run**: one time a plan is done, from its first step to its end.
- **Answer**: what a step gave back: a text, and for an agent also the files it changed.
- **Points**: the reasons a proof gives when it refuses work.
# The file
::: warning Draft
This version may still change before it is published.
:::
A plan is one JSON text ([RFC 8259](https://www.rfc-editor.org/rfc/rfc8259)), encoded in UTF-8. Its name SHOULD end in
`.vpf.json`. Its JSON Schema is [`vpf-1.schema.json`](https://verifiableplanformat.org/schema/vpf-1.schema.json), kept in the repository at [`schema/vpf-1.schema.json`](https://github.com/verifiableplanformat/vpf/blob/main/schema/vpf-1.schema.json).
The file is one object:
| Field | Required | Meaning |
| --------- | -------- | ----------------------------------------------------------------------------------------- |
| `$schema` | yes | Always the string `vpf/1`. |
| `wish` | yes | What the person wants, in their words. Whoever does a step is told it. |
| `start` | no | When a run starts ([Start](./file#start)). `{ "on": "asked" }` when absent. |
| `limits` | no | How far one run may go ([Limits](./file#limits)). |
| `steps` | yes | 1 to 200 steps ([Steps](./steps)), done in the order written. |
Every object in a plan accepts only the fields this specification defines. A checker MUST refuse a field it does not
define, so that a mistyped name is told and not passed over. A file whose `$schema` is not `vpf/1` is not a plan of
this version, and a checker MUST NOT read it as one.
## Start
`start` says when a run starts. It is one object whose `on` field names the kind:
| `on` | Other fields | A run starts |
| ---------- | ------------------------------- | ------------------------------------------------------------------- |
| `asked` | | When the person asks for it. |
| `schedule` | `days`, `time` | On these days at this time of day, where the runner runs. |
| `every` | `minutes` | Every so many minutes. |
| `files` | `paths` | When a file of the folder that matches one of the paths changes. |
| `request` | | When another program asks the runner, in a way the runner defines. |
- `days` is a list of one or more of `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`.
- `time` is the time of day as `HH:MM`, from `00:00` to `23:59`.
- `minutes` is a whole number of at least 1.
- `paths` is a list of paths or patterns inside the folder, where `*` stands for any text within a name. At least one
MUST not be blank.
A runner that cannot start a run in some way MUST say so when it is given the plan, and MUST NOT run it in another way.
## Limits
`limits` is an object with these fields, all optional:
| Field | Default | Meaning |
| --------- | ------- | -------------------------------------------------------------------------------------------------------- |
| `repeats` | 3 | How many times refused work may be done again before the person is asked whether to go on. 1 to 100. |
| `minutes` | 60 | The longest a run may take, in minutes. 1 to 10080 (a week). |
| `cost` | | The most one run may cost, in the currency the runner reports costs in. More than 0. |
| `month` | | The most all runs of the plan may cost together in a calendar month, in the same currency. More than 0. |
# Steps
::: warning Draft
This version may still change before it is published.
:::
A step is one object:
| Field | For | Meaning |
| --------- | ------------------ | ------------------------------------------------------------------------------------------------ |
| `id` | every step | What the other steps call it: 1 to 24 of `a` to `z`, `0` to `9` and `-`, unique in the plan, and not `asked`. |
| `do` | every step | What to do, in words. Not blank. |
| `by` | every step | Who does it: `agent`, `algorithm`, `person` or `plan`. |
| `proof` | see [Proofs](./proofs) | What proves the work: one proof, or a list of 1 to 8 asked in order. All MUST pass. |
| `run` | `algorithm` only | The command line. Required for an algorithm. |
| `on_fail` | `algorithm` only | `agent`: an agent is put behind the command ([An algorithm's step](./running#an-algorithm-s-step)). |
| `agent` | `agent` only | A named agent, from those the runner knows. Any agent the runner chooses when absent. |
| `model` | `agent` only | The model the agent uses, by a name the runner knows. The runner's default when absent. |
| `tools` | `agent` only | The only kinds of tools the agent may use ([Kinds of tools](./steps#kinds-of-tools)). Every kind when absent. |
| `plan` | `plan` only | The name of another plan, which runs as this step. Required for a plan. |
## Who does a step
- `agent`: an agent is asked to do what `do` says. Its step MUST carry a proof, since an agent does not set the
measure of its own work.
- `algorithm`: the command in `run` is the work. It did its work when it ended with the exit code 0. Its step MAY
carry proofs; the command ending with 0 is always the first.
- `person`: the person is asked what `do` says and answers with a text. A person's step MUST NOT carry a proof: their
word stands.
- `plan`: another plan runs as this step. Its own steps carry its proofs, so this step MUST NOT carry one. How a
runner finds a plan by its name is the runner's own; a runner that reads plans from a folder SHOULD find the plan
`name` in the file `name.vpf.json`.
## Kinds of tools
| Kind | The agent may |
| ---------- | -------------------------------------------------- |
| `read` | Read the folder's files and look at them. |
| `write` | Write, change and remove the folder's files. |
| `commands` | Run commands. |
| `internet` | Reach the web. |
| `screen` | See and use the computer's screen, mouse and keys. |
A runner MUST NOT give an agent a tool of a kind its step does not list, when the step lists kinds.
## References
A text of a step may name what came before it:
- `{{id}}` is the answer of the earlier step `id`.
- `{{asked}}` is what the run was started with: the person's words when asked, or what the starting event carried.
Spaces inside the braces are ignored. The texts that may hold references are a step's `do` and `run`, and the `run`,
`check` and `ask` of its proofs and the paths of their needs. A reference in `do` or `run` MUST name `asked` or a step
written before the one it is in. A proof is asked after the work it proves, so a reference in a proof MAY also name
its own step. A runner fills each reference with the text it names before the text is used.
# Proofs
::: warning Draft
This version may still change before it is published.
:::
A proof is one object, whose `by` says who proves:
| `by` | Fields | It passes when |
| ----------- | ------------------------- | --------------------------------------------------------------------------------------------------- |
| `algorithm` | `run` | The command ends with 0. What it wrote is the points against the work. |
| `algorithm` | `needs` | Everything the needs name is in the folder ([Needs](./proofs#needs)). No model is asked. |
| `agent` | `check`, `agent`, `model` | Another agent finds what `check` says true of the work. |
| `person` | `ask` | The person approves. They are asked what `ask` says, or what the step does when `ask` is absent. |
- A proof by an algorithm has exactly one of `run` and `needs`.
- A proof by an agent MUST have a `check` that is not blank. Its `agent`, when given, MUST NOT be the `agent` of its
step. The agent that proves sees the step, its answer and the folder, and only reads: a runner MUST NOT let it
change the folder.
- A proof by a person may have an `ask`.
- A proof MUST NOT carry a field of another kind of proof.
A step SHOULD list its cheapest proof first: an algorithm, then an agent, then a person, so that a person is asked
only about work that already stands.
## Needs
`needs` is a list of one or more needs. Each is an object whose `need` field names the kind. Every `path` is inside
the folder: it MUST NOT be blank, start with `/` or `\`, hold a drive such as `C:`, or have a `..` part.
| `need` | Other fields | It is met when |
| ------------ | -------------------------- | ------------------------------------------------------------------------------------ |
| `files` | `path`, `at_least` | At least `at_least` files (1 when absent, never 0) match `path`, where `*` stands for any text within a name. |
| `folder` | `path` | The folder `path` exists and has something in it. |
| `names` | `path`, `files` | The file `path` names, by its name, each file that matches the pattern `files`. |
| `headings` | `path`, `headings` | The page `path` has each of `headings` (at least one, not blank), each with words under it. |
| `repository` | `path`, `branch` | `path` is a version-control repository, on `branch` when it is given. |
# Running a plan
::: warning Draft
This version may still change before it is published.
:::
## A run
A runner MUST check a plan before it runs it, and MUST NOT run a plan with problems ([Problems](./problems)).
A run does the steps in the order they are written. A step starts when the step before it has passed. A step has
passed when its work is done and every one of its proofs has passed. When the last step has passed, the run is done.
Whoever does a step MUST be told the plan's `wish`. An agent MUST also be told, before it works, what will prove its
work, in the order the proofs will be asked.
## Proofs and refused work
The proofs of a step are asked in the order written, and the first that refuses stops the others. Work that a proof
refuses goes back to who made it, with the points against it; when it is done again, every proof is asked again from
the first.
After `limits.repeats` more attempts are refused, the runner MUST ask the person whether to go on. If they say yes, the
step may be tried `limits.repeats` more times; if they say no, the run stops.
## An algorithm's step
The command in `run` is run in the folder. When it ends with a code other than 0, the work is refused, and what it
wrote is the points.
With `on_fail: "agent"`, a refused command goes to an agent with its points. The agent fixes what stands in the
command's way, and then the same command runs again, this time as the first proof of the agent's work, followed by
the step's own proofs. Without `on_fail`, a refused command is run again as it is.
## Limits
When a run reaches `limits.minutes` or `limits.cost`, the runner MUST stop it and tell the person why. When the runs of
a plan in a calendar month reach `limits.month`, the runner MUST NOT start another that month, and SHOULD tell the
person when four fifths of it are spent.
## What a runner keeps
A runner SHOULD keep, for each run, what each step answered, each proof asked with its result and points, and who
decided when the person was asked. This record is what lets anyone see that each step was proven.
# Problems
::: warning Draft
This version may still change before it is published.
:::
A checker tells each problem with a reason that does not change, the step it is about when it is about one, and a
sentence. A reason is an id, so that any program can say it in the reader's language.
A file that is not JSON, has no `$schema` or another one, has a field this specification does not define, or has a field
of the wrong type, is not a plan. A checker MUST refuse it as a whole and SHOULD say why, with the reason
`file.invalid`.
A checker MUST find each of these problems:
| Reason | The problem |
| ------------------------ | -------------------------------------------------------------------------------------------- |
| `file.invalid` | The file is not a plan: not JSON, another `$schema`, a field not defined, or a wrong type. |
| `plan.wish` | The plan does not say what the person wishes. |
| `plan.steps` | The plan has no step, or more than 200. |
| `start.days` | A schedule has no day. |
| `start.time` | A schedule's time is not `HH:MM` from `00:00` to `23:59`. |
| `start.minutes` | A run every so many minutes is set to 0. |
| `start.paths` | A start on files names no path. |
| `limits.repeats` | `limits.repeats` is not 1 to 100. |
| `limits.minutes` | `limits.minutes` is not 1 to 10080. |
| `limits.cost` | `limits.cost` is not more than 0. |
| `limits.month` | `limits.month` is not more than 0. |
| `step.id` | An id is not 1 to 24 of `a` to `z`, `0` to `9` and `-`, or it is `asked`. |
| `step.duplicate` | Two steps have the same id. |
| `step.do` | A step does not say what to do. |
| `step.run` | An algorithm has no command, or a step done by someone else has one. |
| `step.plan` | A step done by a plan names none, or a step done by someone else names one. |
| `step.agent` | A step no agent does chooses an agent, a model or tools. |
| `step.on_fail` | A step that is not done by an algorithm has someone behind it. |
| `proof.missing` | A step an agent does has no proof. |
| `proof.misplaced` | A step a person or another plan does carries a proof. |
| `proof.count` | A step has more than 8 proofs. |
| `proof.algorithm` | A proof by an algorithm has neither a command nor needs, or has both. |
| `proof.agent` | A proof by an agent does not say what to look for. |
| `proof.same_agent` | The agent that does a step is the one that judges it. |
| `proof.fields` | A proof has a field of another kind of proof. |
| `need.path` | A need has no path, or its path is outside the folder. |
| `need.at_least` | A need of files asks for at least 0. |
| `need.files` | A need of names does not say which files. |
| `need.headings` | A need of headings names no heading. |
| `reference.unknown` | A text names something that is neither `asked` nor a step. |
| `reference.not_before` | A text names its own step or a later one where it may not. |
A checker MAY also tell problems only a runner can know, such as a named agent, model or plan it does not have, with
reasons of its own outside these families. A checker MAY tell the problems of references only once a plan has no other
problem.
# Versions
::: warning Draft
This version may still change before it is published.
:::
The `$schema` of this version is `vpf/1`. A later version that only adds optional fields or new kinds keeps the major
number and is written `vpf/1.N`; a change that makes a valid plan invalid, or changes what a valid plan means, takes a
new major number. A runner MUST refuse a major version it does not know.
# Conformance
::: warning Draft
This version may still change before it is published.
:::
A checker conforms to this version when, for every case in [`conformance/cases.json`](https://github.com/verifiableplanformat/vpf/blob/main/conformance/cases.json), it
accepts the valid plans and refuses the invalid ones with at least the reasons the case lists. A runner conforms when
its checker conforms and it keeps [the four rules](./index#the-four-rules) and the [steps](./steps), [proofs](./proofs) and [running](./running) of this specification.
# Examples
Plans for everyday work in a company. Each one passes the [checker](/docs/tools/check), and each one is a file in the
repository's [`examples`](https://github.com/verifiableplanformat/vpf/tree/main/examples) folder that you can copy.
| Plan | What it does |
| ---- | ------------ |
| [Monthly sales report](/examples/monthly-sales-report) | A command exports the month's sales, an agent writes the report, and a command sends it to the team. |
| [Weekly stock count](/examples/weekly-stock-count) | Every Monday at 07:00, the stock is counted, compared with the minimum of each item, and what is missing is ordered. |
| [Supplier invoices](/examples/supplier-invoices) | Every invoice that arrives in a folder is read, matched to its order and approved for payment. |
| [New employee onboarding](/examples/new-employee-onboarding) | Accounts, a welcome page, equipment and a check with the manager, for the person named when the run starts. |
| [Support inbox triage](/examples/support-inbox-triage) | Every 30 minutes, new support messages are labelled and an answer is drafted for each, for a person to send. |
| [Blog post](/examples/blog-post) | An agent writes a post in the company's voice, and it is published only after a person approves it. |
| [Help pages translation](/examples/help-pages-translation) | An agent translates the help pages, and a command checks that every page, heading and link is kept. |
| [Market research brief](/examples/market-research-brief) | An agent researches a market on the web and writes a brief with a source for every fact. |
| [Product photo captions](/examples/product-photo-captions) | An agent writes a caption for every product photo of the new catalogue. |
| [Software release](/examples/software-release) | Tests, release notes and a tag, for the version named when the run starts. |
| [Failing test fix](/examples/failing-test-fix) | When another program asks, the build is run, and an agent fixes it until it passes. |
## What they show
| To see | Look at |
| ------------------------------------ | ------------------------------------------------------------------------------------------- |
| A plan that starts on its own | [Weekly stock count](/examples/weekly-stock-count), [Supplier invoices](/examples/supplier-invoices), [Support inbox triage](/examples/support-inbox-triage) |
| An agent behind a command | [Monthly sales report](/examples/monthly-sales-report), [Software release](/examples/software-release), [Failing test fix](/examples/failing-test-fix) |
| Proofs with no model | [Product photo captions](/examples/product-photo-captions), [Weekly stock count](/examples/weekly-stock-count) |
| Another plan as a step | [New employee onboarding](/examples/new-employee-onboarding) |
| Limits on time and cost | [Supplier invoices](/examples/supplier-invoices), [Market research brief](/examples/market-research-brief) |
# Monthly sales report
A command exports the month's sales, an agent writes the report, and a command sends it to the team.
## In words
## The file
<<< @/../examples/monthly-sales-report.vpf.json [monthly-sales-report.vpf.json]
## Why it is written this way
Three proofs stand before the report is sent: the file is there, another agent finds every number right, and a person says it is ready. The export has an agent behind it, so a failing command gets fixed and run again.
# Weekly stock count
Every Monday at 07:00, the stock is counted, compared with the minimum of each item, and what is missing is ordered.
## In words
## The file
<<< @/../examples/weekly-stock-count.vpf.json [weekly-stock-count.vpf.json]
## Why it is written this way
The plan starts on a schedule. The comparison is proven by a command that recounts it, with no model asked, and a person places the order.
# Supplier invoices
Every invoice that arrives in a folder is read, matched to its order and approved for payment.
## In words
## The file
<<< @/../examples/supplier-invoices.vpf.json [supplier-invoices.vpf.json]
## Why it is written this way
The plan starts when a file arrives. Its limits keep each run under 20 minutes and its cost low, by run and by month. Another agent compares each line with its PDF.
# New employee onboarding
Accounts, a welcome page, equipment and a check with the manager, for the person named when the run starts.
## In words
## The file
<<< @/../examples/new-employee-onboarding.vpf.json [new-employee-onboarding.vpf.json]
## Why it is written this way
`{{asked}}` carries the new colleague's name into each step. The equipment is another plan, run as one step, and the welcome page must have its three headings.
# Support inbox triage
Every 30 minutes, new support messages are labelled and an answer is drafted for each, for a person to send.
## In words
## The file
<<< @/../examples/support-inbox-triage.vpf.json [support-inbox-triage.vpf.json]
## Why it is written this way
The `names` need proves that every message got a label. A person sends the answers, so nothing reaches a customer without a yes.
# Blog post
An agent writes a post in the company's voice, and it is published only after a person approves it.
## In words
## The file
<<< @/../examples/blog-post.vpf.json [blog-post.vpf.json]
## Why it is written this way
The proofs go from the cheapest to the dearest: the file, a word count, another agent reading it against the voice guide, then a person.
# Help pages translation
An agent translates the help pages, and a command checks that every page, heading and link is kept.
## In words
## The file
<<< @/../examples/help-pages-translation.vpf.json [help-pages-translation.vpf.json]
## Why it is written this way
The step names a model good at the language. Another agent compares the meaning, and a person reads the result.
# Market research brief
An agent researches a market on the web and writes a brief with a source for every fact.
## In words
## The file
<<< @/../examples/market-research-brief.vpf.json [market-research-brief.vpf.json]
## Why it is written this way
Only this agent gets `internet`. The headings need proves the brief's shape, and another agent checks each fact against its source.
# Product photo captions
An agent writes a caption for every product photo of the new catalogue.
## In words
## The file
<<< @/../examples/product-photo-captions.vpf.json [product-photo-captions.vpf.json]
## Why it is written this way
The `names` need proves that every photo has a caption, with no model asked. Another agent checks that each caption says what its photo shows.
# Software release
Tests, release notes and a tag, for the version named when the run starts.
## In words
## The file
<<< @/../examples/software-release.vpf.json [software-release.vpf.json]
## Why it is written this way
The tests have an agent behind them. The notes are proven by a command and by another agent that compares them with the commits.
# Failing test fix
When another program asks, the build is run, and an agent fixes it until it passes.
## In words
## The file
<<< @/../examples/failing-test-fix.vpf.json [failing-test-fix.vpf.json]
## Why it is written this way
One step does it all: the command fails, an agent fixes the code, and the command runs again as the proof, followed by an agent that makes sure no test was skipped.
# Contributing
VPF is developed in the open, in the [verifiableplanformat](https://github.com/verifiableplanformat) organization on
GitHub. Questions, problems and ideas are welcome.
## Where things live
| Repository | What it holds |
| --------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [vpf](https://github.com/verifiableplanformat/vpf) | The specification, JSON Schema, examples, conformance cases and this site. |
| [rust-sdk](https://github.com/verifiableplanformat/rust-sdk) | The Rust SDK. |
| [typescript-sdk](https://github.com/verifiableplanformat/typescript-sdk) | The TypeScript SDK. |
| [python-sdk](https://github.com/verifiableplanformat/python-sdk) | The Python SDK. |
| [runner](https://github.com/verifiableplanformat/runner) | The reference runner. |
## How to help
- **Ask or report.** Open an issue in the repository it is about.
- **Fix the site or an example.** Open a pull request. A typo needs no issue first.
- **Change the format.** Open an issue first; see [how the format changes](/community/changes).
- **Add an implementation.** Show that it passes the conformance cases, and add it to [SDKs and runners](/docs/sdk).
## Pull requests
- Commits follow [Conventional Commits](https://www.conventionalcommits.org), such as `docs(spec): say when a run stops`.
- Each commit is signed off under the [Developer Certificate of Origin](https://developercertificate.org), with
`git commit -s`.
- Run the checks before you push:
```sh
python3 -m pip install -r tools/requirements.txt
npm ci
npm test
```
`npm test` checks that the examples and cases match the schema, that the site's checker passes every case, that the
specification, the cases and the site name the same problems, and that the site builds with no broken link.
## Run the site
```sh
npm ci
npm run docs:dev
```
# How the format changes
The format changes in the open, and every change is written down before it is made.
## A change to the format
1. **An issue.** Say what a plan cannot say today, with a plan that shows it. Say what it would change for the plans
that already exist.
2. **A pull request.** Change the specification, the JSON Schema, the conformance cases and the site's checker
together, so that they keep agreeing. The checks fail when they do not.
3. **A review.** A change is merged when the maintainers agree it keeps the [principle](/docs/learn/principle): the
three things and the four rules do not change.
## Versions
A change that only adds an optional field or a new kind goes into the next minor version, such as `vpf/1.1`. A change
that makes a valid plan invalid, or changes what one means, waits for the next major version. See
[Versioning](/docs/learn/versioning).
## Draft and published
Version 1 is a draft. While it is, it may change in any way. When it is published, the version and its conformance
cases are fixed, and later changes follow the rules above.
# License
VPF is free to read, use, implement and build on.
- The specification, the JSON Schema, the examples, the conformance cases, the site's code and the tools are licensed
under the [Apache License 2.0](https://github.com/verifiableplanformat/vpf/blob/main/LICENSE).
- The guide text of this site may also be used under
[CC BY 4.0](https://github.com/verifiableplanformat/vpf/blob/main/LICENSE-DOCS).
A program that reads or runs plans in VPF needs no permission and pays nothing.