metaphasor
Docs menu

Code

The code record holds the implementation of adopted intent: source files and test files. They are ordinary files in the project's work folder, and an agent or an engineer edits, builds and runs them with standard tools.

Project layout

Intent files are at the project root. Code and tests are in .phasor/work/, and the record is in .phasor/record/. Test files sit in the work folder beside the code. What Phasor records about running them is described under Tests.

phasor audit game.md --paths
.phasor/work/.checks/unit.json
.phasor/work/snake/__init__.py
.phasor/work/snake/game.py
.phasor/work/tests/test_game.py

phasor where prints the project's paths: the root, the work folder, the record and the memory folder.

Landing changes

A landing is the step that records work. It stores the changed files as new versions, a resolution that names the intent they cover and gives the rationale, and the results of the checks that ran.

phasor land --covers game.md#its-own-body --rationale "Running into its own body ends the game, as the owner decided." --ref 77b84a2fb424

land prints the id of the landing, the id of its resolution, and one line for each check.

Agents land through the land tool. To land by hand, run phasor next --load first: a landing stops until the latest change to the intent it covers has been retrieved.

Unfinished work is landed without --covers, with a rationale that begins PARTIAL: and a thread that says what is left. This is a convention in the agent instructions, not a separate kind of landing. The intent stays open.

Implementation provenance

phasor trace follows a file back through its versions. For each version it gives the resolution that produced it, that resolution's rationale and references, and the intent it covers.

phasor trace .phasor/work/snake/game.py
{
  "end": "creation",
  "ok": true,
  "walk": [
    {
      "content": "e9281d305177",
      "context": {
        "68a1f9c16656": {
          "refs": [
            "77b84a2fb424"
          ],
          "text": "Running into its own body ends the game, as the owner decided."
        }
      },
      "covers": {
        "68a1f9c16656": [
          "4f3e847d004c#its-own-body"
        ]
      },
      "producedBy": "68a1f9c16656",
      "version": "677c77c6bccf"
    },
    {
      "content": "15f4bdbe036c",
      "context": {
        "c61303af29ed": {
          "text": "The board, moving and walls, with a test for each rule."
        }
      },
      "covers": {
        "c61303af29ed": [
          "88003dd48b5e#intent/game.md"
        ]
      },
      "producedBy": "c61303af29ed",
      "version": "1acfb49e1449"
    }
  ]
}

Reverting a landing

phasor revert undoes one landed resolution and keeps the work that landed after it. It takes the resolution's id, which land prints and trace shows as producedBy. The revert is recorded as a landing of its own, with the context you give, and the intent the resolution covered is open again.

phasor revert 68a1f9c16656 --context "The tail square should not count as the body."

If later work changed the same lines, the revert stops and leaves the conflict in the work folder, between conflict markers, to be resolved and landed.

Build artifacts and ignored paths

Compilers and package managers write into the work folder. Name their output folders in a .gitignore in .phasor/work/, in Git's syntax, and Phasor leaves them out of the record. phasor clean lists build output, largest first. It deletes the paths you name, or all of it with --all.