Intent
Intent defines what a Phasor project is required to do. The owner writes it as files and adopts each change. An adopted change is work to be implemented and verified, and a landing references the intent file, or the section of it, that it answers.
Authoring intent
- Files at the project root, in any text format. In Markdown, each heading starts a section, and a section can be adopted, referenced and reopened by itself.
- Describe observable behavior: inputs, outputs, errors, limits. Leave implementation choices to the builder unless a choice is itself a requirement, and then state it.
- Fix a rule with one worked example. A line of input and output placed in the section it governs is delivered with that section.
- Mark what is undecided, and open a thread on it, so that the decision is made on the record.
- Instructions for all work, such as a language or a toolchain, are rules in memory, not intent.
## Its own body If the head runs into any part of the snake's own body the game is over.
Adoption
Editing an intent file has no effect on the project. phasor adopt records the file's current version as an adoption, which is a step in the project's history, and the change becomes open work.
phasor adopt --context "Answering the builder's question." --context-ref 77b84a2fb424
Adopted game.md (adoption c36e7edbedee)
phasor adoptadopts every edited intent file in the project in one step. Name a file to adopt only that one.--contextrecords why, and--context-refwhat the reason refers to, such as a thread. Both are kept with the adoption and delivered with the work it opens.- In a Markdown file, an adoption opens one piece of work for each section it changed, a wording fix included. Gather small edits, and adopt when a change is ready to build.
Who can adopt. Only the project's owner: the identity that created the project or, for a clone, the identity that cloned it. An adoption signed by any other identity is refused. An agent started from your Phasor home signs with your identity, so this check does not tell you from your agents. What keeps an implementing agent from adopting is its instructions and the tools it is served, and neither is an access control: see Tool sets and access.
Intent states
Each adopted intent file, or section, is in one state. Phasor computes the state from the record. It cannot be set by hand.
| State | Meaning |
|---|---|
| not adopted | Written or edited, and not yet adopted |
| open | Adopted, and no landing in force covers it |
| unverified | Covered by a landing, and a check bound to it has no passing result for the current inputs: the check has not run on them, or the run ended in error |
| resolved | Covered by a landing, and every check bound to it has a passing result for the current inputs |
| regressed | A check bound to it has a failing result |
- Intent resolved by a landing with no check bound to it is reported as
resolved, unchecked. - The current inputs of a check are the present versions of the check file and of the files its
inputsname: see Tests. - States are computed from landed work and recorded results. Edits in
.phasor/work/that have not landed do not change them.
Inspecting intent
phasor outline game.md (version 88003dd48b5e#intent/game.md, edited, not adopted) # The game ## The board ## Moving ## Walls ## Its own body phasor show game.md --section "Its own body" ## Its own body If the head runs into any part of the snake's own body the game is over.
phasor audit game.mdfollows the file forward to its landings, with each landing's files, rationale and check results.phasor audit game.md --decisionslists the decisions about it, oldest first.phasor walk game.mdlists the file's versions.
Version history
Every adopted version of an intent file is kept. Read one by its id, or ask for what has changed since it.
phasor show game.md@88003dd48b5e # The game ## The board The board is 20 squares wide and 20 high. The snake starts in the middle, three squares long, moving right. ## Moving Each tick the snake moves one square in the direction it faces. The arrow keys turn it. It cannot turn straight back on itself. ## Walls If the head leaves the board the game is over. phasor show game.md --since 88003dd48b5e { "diff": " If the head leaves the board the game is over.\n+\n+## Its own body\n+If the head runs into any part of the snake's own body the game is over.", "from": "88003dd48b5e#intent/game.md", "ok": true, "path": "game.md" }
Revising and reopening intent
- Revise a requirement. Edit the file and adopt. The sections that changed become open work.
- Return to an earlier version.
phasor reset --version game.md@VERSION --reason "Back to the earlier rule"restores one intent file and leaves the code as it is. - Reopen without changing the text, when the requirement stands and what was built does not meet it.
phasor reopen game.md#moving --context "Turning feels late"reopens one section, or the whole file when no section is named. The code that landed stays in place, and the context is delivered with the reopened work. - Exclude a file from implementation work, such as a README or a license.
phasor code-ignore --add README.mdmarks an intent file as one that nothing is built for.