> For AI agents: the complete documentation index is available at https://docs.phax.run/llms.txt, the full documentation bundle is available at https://docs.phax.run/llms-full.txt.

# phax 0.38.0 \{#phax-0380}

Changes since 0.37.0: [v0.37.0...v0.38.0](https://github.com/lbdremy/phax/compare/v0.37.0...v0.38.0).

## Highlights \{#highlights}

- **Revise a Draft artifact**
- **Plan paths in one canonical form** — A plan path is made canonical, or refused, where the plan is decoded, and nowhere else.

## Upgrading \{#upgrading}

- **`phax artifact revise` commits leave revision records.** A new record format, `revision-record-manifest` on `phax/records/v1`, keyed `revision/<authoringId>/<NN>`. An `@lbdremy/phax-schemas` before 0.38.0 cannot read it: `parseRecordManifest` fails at `$schema` with an unknown format, so upgrade the package before reading such records. `phax records list` shows a new entry kind, `revision`.
- **Plan paths have one canonical form.** A plan.md's `./src/x.ts` is read as `src/x.ts`; a path that is empty, absolute, leaves the repository, names a directory or contains a backslash is a lint error and `phax run` refuses it. A headless planner's or a sidecar's non-canonical path is refused, naming the spelling to write.
- **phax-plan, plan-document and phax-plan-extraction move to 0.38.0 shapes.** An `@lbdremy/phax-schemas` before 0.38.0 refuses documents of those shapes, so upgrade the package. The package reads the 0.33.0 shapes as a release and keeps their paths as written.
- **Run `phax artifact migrate-documents` once in each repository.** Live plan sidecars stamped 0.33.0 are an older shape, and approve, reopen, decide and revise refuse until they are migrated. A sidecar holding a non-canonical path is refused: edit the path to its canonical form in the sidecar and plan.md alike, rerun `phax artifact migrate-documents`, then re-approve the plan if needed.
- **A run started by 0.37.0 or earlier cannot be resumed.** Finish it with that release, or archive it with `phax archive <run> --force` and run its plan again.
- **A plan whose extraction fell back to the model is extracted once more**, because the extractor version changed.

## What's new \{#whats-new}

### Revise a Draft artifact \{#revise-a-draft-artifact}

### Plan paths in one canonical form \{#plan-paths-in-one-canonical-form}

> A plan path is made canonical, or refused, where the plan is decoded, and nowhere else.

- A plan document, whether a headless planner's answer or a sidecar, is refused when a file list holds a path that is not canonical, and the refusal names the spelling to write instead. `docs/plans/<stamp>-<slug>-plan.json (plan document)`

  Now:

  ```text
  {
    "$schema": "https://docs.phax.run/schemas/plan-document/0.38.0.json",
    "phases": [{ "id": "phase-02",
      "plannedFilesToEdit": ["./src/x.ts", "../shared/y.ts"], … }]
  }
  # refused at the first violation:
  phases[1].plannedFilesToEdit[0]: phase-02 plans "./src/x.ts", which is not canonical: write "src/x.ts"
  # with plannedFilesToEdit ["src/x.ts", "../shared/y.ts"]:
  phases[1].plannedFilesToEdit[1]: phase-02 plans "../shared/y.ts", which leaves the repository
  ```

  :::details Before

  ```text
  {
    "$schema": "https://docs.phax.run/schemas/plan-document/0.33.0.json",
    "phases": [{ "id": "phase-02",
      "plannedFilesToEdit": ["./src/x.ts", "../shared/y.ts"], … }]
  }
  # accepted as written
  ```

  :::

- Lint reads `./src/x.ts` in a plan.md as `src/x.ts`, names files by that spelling in its findings, and reports an unplannable path as an error on its phase. `phax plans lint`

  Now:

  ```text
  $ phax plans lint docs/plans/2611140900-widget-plan.md
  ✗ phase-01 files: create and edit both list src/x.ts

  # a plan.md listing `../shared/y.ts` under Planned files to edit:
  ✗ phase-02: Planned files to edit: "../shared/y.ts" leaves the repository
  $? = 1
  ```

  :::details Before

  ```text
  $ phax plans lint docs/plans/2611140900-widget-plan.md
  # phase-01 create: ./src/x.ts   edit: src/x.ts   → no finding
  ```

  :::

- Two plans that write the same file under two spellings are reported as overlapping on that file's canonical path. `phax plans overlap`

  Now:

  ```text
  $ phax plans overlap plan-a.md plan-b.md
  shared: src/x.ts  (plan-a edit, plan-b edit)
  ```

  :::details Before

  ```text
  $ phax plans overlap plan-a.md plan-b.md
  no shared files
  ```

  :::

- A phase that plans `./src/x.ts` and changes `src/x.ts` is reconciled as having edited a planned file, with no missing or unplanned entry. `phax run (phase reconciliation)`

  Now:

  ```text
  Edited as planned:
    src/x.ts
  ```

  :::details Before

  ```text
  Missing planned edits:
    ./src/x.ts
  Unplanned edits:
    src/x.ts
  ```

  :::

- An older plan sidecar holding a path that is not canonical is refused by name, so the operator can fix the path and re-approve. `phax artifact migrate-documents`

  Now:

  ```text
  $ phax artifact migrate-documents
  ✗ docs/plans/2610020800-widget-plan.md phase-02 plannedFilesToEdit "./src/x.ts" is not canonical: write "src/x.ts"
    edit the path in the plan, then re-approve it
  ```

- A run's phax-plan.json holds only canonical paths and is stamped with the release that introduced the rule. `.phax/runs/<run>/phax-plan.json`

  Now:

  ```text
  { "$schema": "https://docs.phax.run/schemas/phax-plan/0.38.0.json",
    "phases": [{ "plannedFilesToEdit": ["src/x.ts"], … }] }
  ```

  :::details Before

  ```text
  { "$schema": "https://docs.phax.run/schemas/phax-plan/0.33.0.json",
    "phases": [{ "plannedFilesToEdit": ["./src/x.ts"], … }] }
  ```

  :::

## Fixes \{#fixes}

- fix(release-notes): match a run to its plan by the title's slug too ([95cf574](https://github.com/lbdremy/phax/commit/95cf57431c3071e8d65bcce4ae5a8674708fb14f))
