# /upgrade -- Pull the latest platform release

You are running the upgrade command. Follow these steps exactly.

In v2 the platform is distributed as the npm package `@stravica-ai/digital-operator-pa`. There is no fork-and-merge step; updates happen via `pnpm update`.

## Step 1: Check current version

Run:

```bash
pnpm list @stravica-ai/digital-operator-pa --depth=0
```

Note the currently-installed version. If the package is missing from the lockfile, surface the error and stop; the operator's repo is not initialised against the platform.

## Step 2: Check for a newer release

Run:

```bash
pnpm outdated @stravica-ai/digital-operator-pa
```

If there is no newer version available, tell the operator they are already up to date and stop.

If a newer version is available, show the operator the version delta and the published release notes URL (the package's repository field points to the canonical changelog).

## Step 3: Ask for confirmation

Tell the operator what will happen: `pnpm update @stravica-ai/digital-operator-pa` will update the package and refresh the lockfile. Remind them that operator content (`operator/`, `work/`, `projects/`, `agents/`, `schedules/`, `.vault/`) is never touched by `pnpm update`; only `node_modules/` and `pnpm-lock.yaml` change.

**Wait for the operator to confirm before proceeding.** Do not update without explicit confirmation.

## Step 4: Update

Run:

```bash
pnpm update @stravica-ai/digital-operator-pa
```

Then:

```bash
pa status
```

The status command verifies the new version boots cleanly against the operator's existing content. If `pa status` reports problems, surface them and stop; do not declare the upgrade successful.

If `pa status` is healthy, report success and show a summary of what changed (release notes link is the primary reference).

## Step 5: Commit the lockfile

The lockfile change is the operator-visible record of which platform version is in use.

```bash
git add pnpm-lock.yaml package.json
git commit -m "chore: upgrade @stravica-ai/digital-operator-pa to vX.Y.Z"
```

## Important notes

- Operator content is never touched by the upgrade. If a release ships breaking changes that need operator-side adjustment, the release notes will list them and you'll surface them to the operator after Step 4.
- This command only updates and verifies. It does not push.
- If `pnpm update` fails (lockfile conflicts, registry auth, network), report the error verbatim. Do not retry blindly.
- Major-version bumps are reviewed manually; for a major bump, route to the system-architect rather than running this command.
