Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/upgrade-pi-sdk-0-87-1/intent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Intent: Upgrade Pi SDK to 0.87.1
Author: SpireCode maintainer. Status: approved.

## Problem

SpireCode pins `@earendil-works/pi-coding-agent` at 0.85.1 while npm and the locally installed Pi toolchain have advanced to 0.87.1. The application therefore misses the latest SDK fixes, provider updates, and session-context behavior.

## Proposed outcome

Pin SpireCode to `@earendil-works/pi-coding-agent@0.87.1`, regenerate the pnpm lockfile, install the resolved dependencies, and prove compatibility with the repository's complete validation gate.

## Affected users and systems

- SpireCode Electron Main chat, model catalog, settings, and extension integrations.
- Packaging and production dependency/license validation.
- Developers installing dependencies from `pnpm-lock.yaml`.

## Constraints

- Keep the dependency exactly pinned.
- Commit `pnpm-lock.yaml`.
- Do not change Renderer security boundaries or expose Pi SDK access outside Electron Main.
- Preserve current Chat/session behavior unless an SDK compatibility fix is required.
- Run `pnpm check` before opening the pull request.

## Open questions

None.
36 changes: 36 additions & 0 deletions docs/upgrade-pi-sdk-0-87-1/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Plan: Upgrade Pi SDK to 0.87.1 (from docs/upgrade-pi-sdk-0-87-1/spec.md 2026-09-22)

## Files that change

- `package.json` — update the exact Pi SDK dependency pin.
- `pnpm-lock.yaml` — regenerate Pi SDK and transitive dependency resolutions.
- `docs/upgrade-pi-sdk-0-87-1/intent.md` — record the approved upgrade outcome.
- `docs/upgrade-pi-sdk-0-87-1/spec.md` — document compatibility requirements and design.
- `docs/upgrade-pi-sdk-0-87-1/plan.md` — record execution order, risks, and proof.
- Pi integration source files only if compilation or tests reveal a required compatibility migration.

## Order of work

1. Create an isolated upgrade branch from current `main`.
2. Add the intent, spec, and implementation plan for this dependency upgrade.
3. Use pnpm to install exact `@earendil-works/pi-coding-agent@0.87.1`, updating both manifest and lockfile.
4. Inspect the resulting diff and installed Pi package versions for unexpected dependency movement.
5. Run focused type checking first to catch SDK API incompatibilities quickly.
6. Run the complete `pnpm check` validation gate and resolve implementation compatibility issues without weakening tests.
7. Review the final diff for credentials, unrelated changes, and exact dependency pins.
8. Commit, push the branch, and open a GitHub pull request with upgrade risks and validation evidence.

## Risks

- The most dangerous step is resolving the new SDK tree because 0.86 and 0.87 contain breaking TypeScript and runtime changes around sessions, extension events, providers, and tool payloads.
- Transitive dependency changes may affect packaging, native helpers, license policy, or Electron runtime startup even if TypeScript compiles.
- User-installed extensions cannot all be exhaustively tested in this repository; the upgrade relies on upstream compatibility plus bundled-extension and adapter coverage.
- A broader refactor is intentionally rejected: keeping the change dependency-focused makes any regression attributable and easy to revert.
- A floating semver range is rejected because this repository requires pinned npm dependencies and deterministic lockfiles.

## Proof

- `node -p "require('./node_modules/@earendil-works/pi-coding-agent/package.json').version"` prints `0.87.1`.
- `pnpm typecheck` exits 0.
- `pnpm check` exits 0, covering formatting, brand, localization, secrets, licenses, lint, type checking, Renderer/Electron tests, and release tests.
- `git diff --check` exits 0 and the final diff contains only the planned dependency and SDLC artifacts unless a documented SDK compatibility fix is required.
27 changes: 27 additions & 0 deletions docs/upgrade-pi-sdk-0-87-1/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Spec: Upgrade Pi SDK to 0.87.1

## Requirements

1. `package.json` must pin `@earendil-works/pi-coding-agent` to `0.87.1`.
2. `pnpm-lock.yaml` must resolve the Pi package family and transitive dependencies produced by that version.
3. The installed dependency tree must report Pi SDK 0.87.1.
4. Existing SpireCode SDK integration must compile and pass all automated tests.
5. Production dependency license and release packaging checks must continue to pass.

## Design

This is an in-place dependency upgrade. No Renderer API, IPC contract, persistence schema, or product behavior is intentionally changed. pnpm remains the sole dependency resolver and updates the committed lockfile from the exact direct dependency pin.

The relevant SDK integration remains in:

- `electron/domains/chat/piAdapter.ts`
- `electron/domains/chat/spireSettings.ts`
- `electron/domains/models/modelCatalog.ts`
- `electron/domains/settings/index.ts`

Pi 0.86 and 0.87 introduce breaking changes around custom providers, extension event unions, JSON-compatible tool details, and canonical SessionManager context. Current reconnaissance found no SpireCode call sites using the removed `shouldStopAfterTurn` option or assigning `session.agent.state.messages`; TypeScript and tests are the compatibility guard.

## Concerns

- Bundled and user extensions may exercise Pi extension APIs beyond SpireCode's compile-time surface. Existing resource isolation and adapter tests provide local coverage, while CI covers supported host platforms.
- The upgraded SDK replaces and adds transitive packages. License checks and release tests must validate the resolved production tree.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"secrets:check": "node scripts/check-secrets.mjs"
},
"dependencies": {
"@earendil-works/pi-coding-agent": "0.85.1",
"@earendil-works/pi-coding-agent": "0.87.1",
"@mariozechner/clipboard": "0.3.9",
"@monaco-editor/react": "4.7.0",
"@radix-ui/react-context-menu": "2.3.7",
Expand Down
Loading
Loading