Compare commits

..
16 Commits
Author SHA1 Message Date
jparkerweb cfc58f5a06 Release 3.1.4: retry an update that stopped partway, and refresh the launcher's model menu and agent install data
AI Assisted
2026-11-20 16:57:47 -08:00
jparkerweb 630a1169c3 Let the lessons reader fill its dialog: lift the 68ch cap and stop balancing long lesson titles
AI Assisted
2026-11-19 19:41:52 -08:00
jparkerweb ab4e3322d6 Record the latest upstream sync in the sync skill
AI Assisted
2026-11-19 13:48:46 -08:00
jparkerweb 1616019705 Free runner disk for the Linux app build, and keep the deps fixture lockfiles under a name dependency scanners skip
AI Assisted
2026-11-19 13:48:39 -08:00
jparkerweb f2e9b8bde8 Record the latest reverse port in the sync skill
AI Assisted
2026-11-19 11:15:49 -08:00
jparkerweb fb81f80ce5 Fix the Subagents dialog test on Chrome 158: count its flow-end reading of justify-content as flex-end
AI Assisted
2026-11-19 08:40:42 -08:00
jparkerweb e5ce951b93 Release 3.1.3: the stranded finish screen's way out, and the CI and test upkeep
AI Assisted
2026-11-18 22:21:15 -08:00
jparkerweb 8658631b5d Steady the status line test: wait for the post's redraw before typing the answer
AI Assisted
2026-11-18 21:40:10 -08:00
jparkerweb 09fb4f4eec Steady the git tab scroll test: note the place after the scroll a click on a tab makes
AI Assisted
2026-11-18 20:18:20 -08:00
jparkerweb c96e1f0f52 Draw a stranded finish screen's way out when the press goes unanswered by time alone
AI Assisted
2026-11-18 19:45:06 -08:00
jparkerweb 3b09d03090 Fix two tests that fail on macOS: the temp folder's real path and the select-all key
AI Assisted
2026-11-18 19:45:04 -08:00
jparkerweb ce073cd07a Fix two page tests the git board path and the Markdown box click fix left failing
AI Assisted
2026-11-18 17:56:28 -08:00
jparkerweb 65fbd1bfe1 Move CI's checkout, setup-node and artifact actions to their Node.js 24 versions
AI Assisted
2026-11-18 17:34:35 -08:00
jparkerweb 52efac51b8 Release 3.1.2: changelog for the git board path and the installer's release redirect
AI Assisted
2026-11-18 16:47:46 -08:00
jparkerwebandClaude Opus 5.5 775b693583 Trim the console card back under its byte budget, say skills/ is gitignored in the internals guide, and record the latest reverse port
AI Assisted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:28:24 -08:00
jparkerwebandClaude Opus 5.5 cc7d89181d Send installers fetched from unreleased main to the newest release, for launchers older than the release channel
AI Assisted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 09:23:38 -08:00
37 changed files with 480 additions and 105 deletions

No files matched your search

+1 -1
View File
@@ -123,7 +123,7 @@ plan2code/
### Release channel
Install and update follow release tags, never `main`. `release-app.yml`'s `publish` job ends by fast-forwarding the `release` branch to the tag it just published (no force: a tag not ahead of the branch fails the job), and the README's first install is `npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release`. `plan2code update` installs the newest `vX.Y.Z` tag (`newestReleaseTag()` in `src/launcher/plan2code.js`, using `latestTag()` and `runLsRemote()` from the copy of `update-check.mjs` beside it); `--main` installs the tip of `main`, `--tag <ref>` any ref (how to go back to a release); `--main` and a `--tag` naming a branch always pass `--force`, since unreleased work keeps the last release's version and the installer's `Already on` check would install nothing. `plan2code uninstall` runs the newest release's installer the same way, falling back to `main` only when no release tag can be found. The console's release check (`update-check.mjs`) and the app's notice (`versions.rs` `latest_tag()`) use the same rule: the highest plain `vX.Y.Z` in `git ls-remote --tags`, peeled and pre-release tags skipped. The app's Update skills still pins to the app's own tag.
Install and update follow release tags, never `main`. `release-app.yml`'s `publish` job ends by fast-forwarding the `release` branch to the tag it just published (no force: a tag not ahead of the branch fails the job), and the README's first install is `npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release`. `plan2code update` installs the newest `vX.Y.Z` tag (`newestReleaseTag()` in `src/launcher/plan2code.js`, using `latestTag()` and `runLsRemote()` from the copy of `update-check.mjs` beside it); `--main` installs the tip of `main`, `--tag <ref>` any ref (how to go back to a release); `--main` and a `--tag` naming a branch always pass `--force`, since unreleased work keeps the last release's version and the installer's `Already on` check would install nothing. `plan2code uninstall` runs the newest release's installer the same way, falling back to `main` only when no release tag can be found. Launchers older than the channel (and install commands copied without `#release`) still fetch `main`, so `install.js` redirects itself (`redirectToRelease()`): when npx fetched it from a commit no `vX.Y.Z` tag points at (`fetchedCommit()` reads npm's hidden `node_modules/.package-lock.json`; `releaseRedirectRef()` decides), it reruns the same options from `#v<newest>`. The launcher sets `PLAN2CODE_INSTALL_REF` on every installer run (`main` for `--main`) so a deliberate ref is never redirected, a checkout is not under `node_modules` so it never is either, and anything unknown (no lock file, no network) runs in place. The redirect lives on `main` for old launchers to find, so it must stay there. The console's release check (`update-check.mjs`) and the app's notice (`versions.rs` `latest_tag()`) use the same rule: the highest plain `vX.Y.Z` in `git ls-remote --tags`, peeled and pre-release tags skipped. The app's Update skills still pins to the app's own tag.
### Agents file
+1 -1
View File
@@ -148,7 +148,7 @@ The root `npm test` does not run the metrics or bot vitest suites; run them in t
|------|--------|
| `--build-skills` | Regenerate `skills/` from `src/`, pruning stale skills and reference files |
| `--verify-skills` | Diff local `skills/` against `src/`; exits 1 on drift. Diagnostic only, the installer rebuilds anyway |
| `--update [--force]` | No menu: reinstall what `~/.plan2code/install.json` lists (skills, launcher, app, statusline; metrics and bot only when run from a git checkout, since they run from the install folder, which npx's cache is not), never uninstalling; with no record, the skills and the `plan2code` command. Compact output: `Updating <old> -> <new>` from the record's version (or `Already on <new>`, which stops unless `--force`), each piece's own output held back (`captureOutput()`) and shown only for a warning or a failure, one summary with human piece names (`PIECE_LABELS`), the release notes link and the restart hint; a failed update also prints `plan2code update --tag v<old>`. A failed update, or one whose desktop app was kept because the release has no app file yet, puts the old version back on `install.json`, so the next update (the app's Update and restart included) runs instead of stopping at Already on. `plan2code update` runs it through npx, pinned to the newest `vX.Y.Z` tag the launcher finds with update-check.mjs's `git ls-remote` pick (`--main` takes the tip of `main`, `--tag <ref>` any ref, `--force` is passed on; `PLAN2CODE_LS_REMOTE_FILE` replaces the git call in tests) |
| `--update [--force]` | No menu: reinstall what `~/.plan2code/install.json` lists (skills, launcher, app, statusline; metrics and bot only when run from a git checkout, since they run from the install folder, which npx's cache is not), never uninstalling; with no record, the skills and the `plan2code` command. Compact output: `Updating <old> -> <new>` from the record's version (or `Already on <new>`, which stops unless `--force`, and only when the installed command's `bin/version.json` agrees with the record, so an update stopped after its skills step installs again), each piece's own output held back (`captureOutput()`) and shown only for a warning or a failure, one summary with human piece names (`PIECE_LABELS`), the release notes link and the restart hint; a failed update also prints `plan2code update --tag v<old>`. While an update runs, record writes keep the old version (`recordVersionHold`) and the new one is stamped only when every piece is in; a failed update, or one whose desktop app was kept because the release has no app file yet, leaves the old version on `install.json`, so the next update (the app's Update and restart included) runs instead of stopping at Already on. `plan2code update` runs it through npx, pinned to the newest `vX.Y.Z` tag the launcher finds with update-check.mjs's `git ls-remote` pick (`--main` takes the tip of `main`, `--tag <ref>` any ref, `--force` is passed on; `PLAN2CODE_LS_REMOTE_FILE` replaces the git call in tests) |
| `--uninstall [--yes] [--purge]` | No menu: confirm y/N (`--yes` skips it), run `uninstallAll()`, then ask whether to also delete `~/.plan2code` (`purgeData()`; `--purge` says yes without asking, `--yes` alone keeps the data). `uninstallAll()` is driven by the pieces `install.json` records plus a quiet probe for strays (`UNINSTALL_STEPS`, `UNINSTALL_PROBES`), prints one line per piece actually removed, falls back to deleting the `plan2code*` folders under `~/.agents/skills` when the skills CLI is unreachable, and removes the versioned console folders and `console-dir` (`removeConsoleFolders()`, stopping a running console first). What stays in `~/.plan2code` is listed by name with its size (`listKeptData()`), and the run always ends with the Removed / Could not remove / To finish block (`printUninstallReport()`). Deleting the data also removes the app's webview data outside `~/.plan2code` (`appWebviewDirs()`, `purgeAppWebview()`), and a running app is named before anything is removed (`appRunning()`). `plan2code uninstall [--yes] [--purge]` runs it through npx |
## How the Installer Works
+1
View File
@@ -7,6 +7,7 @@ Which checks cover which files, read by PR Prep and Test (`test-map.mjs read` ch
|---|---|---|---|
| Activities games | `src/web-console/public/activities/**`, `src/web-console/public/tones.js`, `src/web-console/public/music.js` | `node --test scripts/test-web-console-tones.mjs scripts/test-web-console-activities.mjs` | no |
| Launcher | `src/launcher/**` | `node --test scripts/test-launcher.mjs` | no |
| Installer update | `scripts/test-install-update.mjs` | `node --test scripts/test-install-update.mjs` | no |
| Dead Code script | `src/plan2code-dead-code-scripts/**`, `scripts/fixtures/dead-code/**` | `npm run build:skills && node scripts/node-test.mjs scripts/test-script-dead-code.mjs` | no |
| Update Dependencies script | `src/plan2code-deps-scripts/**`, `scripts/fixtures/deps/**` | `npm run build:skills && node scripts/node-test.mjs scripts/test-script-deps.mjs` | no |
| UI Prototype script and shell | `src/skill-scripts/ui-prototype*.mjs`, `src/plan2code-ui-prototype-references/**`, `scripts/fixtures/ui-prototype/**` | `npm run build:skills && node scripts/node-test.mjs scripts/test-script-ui-prototype.mjs scripts/test-ui-prototype-page.mjs` | no |
+1 -1
View File
@@ -1 +1 @@
U0VOQwFXeZZ2LQjdLUSSPDZ4vtw/FiDmfXw9fG8bM3nucaLO+T9XQN9U9t3VdtYnGqX/wKp/UefGXZmTT9BatYKzavI8O9yxDFbOkhu2eA8rQ+LfJ3J7H94EeD9GdEoPvoSaW9GJqyBk/zTVcqapukaBllICd/iouX0PzNk0rMOc7yfhsbWuWsYb4q9E/qn5G4SI3n2zOvsaGZqppJPVQMxWAJQvrQhk6VL+8l48ftO9L02hieVdDs8bmLqhTkF19FQkT1DzGuESlMVEcQP546QtAqtXOpTnO7twtXsCpBOguZ/jLArPFh8lAjMsM3/0LQ8WV7i98zKRyCxELlB+BYwz25BRBIUj2uJNRYloXeLuEyVqS+qC/SScOOlY5Oh2oyFcxyZ8K/ESBKai9djOB36/QlrYD69PNOv2Sb39oHcCObPUofzFSGAVydCtQOsc//my+S/aPkNhTtQEsCAwws5AuCPpuQ1UCUHjkNuWfYWOkOGRNHnlbnLjdKTjm/4ggZQYb4jeGAWqPg+da/ZMSn5Bj+ZTiKOk0d4FPQOwZQlkg6vhdNKYRCJRuni2UC3YaY7dLvtKEPcUpjvI6dK40xt3Lt+DY0i+6r6P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kFZM4QodQHCzSIeAwFGK7+iFcXW+PBl2OYHpCU/AS/R+CZez6n+LWXblzH1Rlg2NTUEykUd5gvXsIF5sbW/Z69wZmQlWtMh4A1Gz4cX3gOUL6s4pS4igOSHXuNC0aiK3VnNhQsoKI2edkQeT0HK6Gv5xK7gFnFRiXvtlnQSosDBYxslaOO6PkHESgjYI+BO23B/thOywxTP0GZx/u5AEiUKOJ9zx0c8QuTmbtiAda6DmoTt1q1y0Kt3yGcZDMqbJ4ELPS6ie0j3wJkb5s/9eshkdRP25R4i/xjf8ikUgZzCzNVJVtaDJWvmI29xCzOGtk0iCZdYNnriGTRVAMEDwcNpV83UeRKn+xIMy+FzLcDhJkct7qyvZvG/ahfLT9zEJiCJPzGYewwvNr3GEx/94RXep5z+q8XvNrocHZshX3+XiGPalwN28joBPb7P6jrOsPIuFKrBkHuSBxpSuOejd1SSVGnFHjrU2Cw4iZo8SGwUNWZjTjpgF/J1Wc1ulM5fWukiINp8dSbBwn9SKD4sj23kIwp128A8FHbuZGsTx6slutVJ11SiPa0q9ly5etA8MgbLXggNrJJ7OANcrrDSL6ZE/GJOEzOzKgvZPQy4xk5jE+98ydiVBPX5BS/pjug/yxvyuiklDo635jhFI6YDsPr6robNEgDpM1p/CKVS+aM8aQEvmIOmZX9aTtCsSOxViMFVgLqRsWEmm4rxuwTjD13J4JXobC8SeeIe2+Qyio1KWPmw3kxUFEV4aCW2PWXGqJLine truncated
+18 -7
View File
@@ -30,7 +30,7 @@ jobs:
outputs:
code: ${{ steps.diff.outputs.code }}
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
- id: diff
@@ -60,8 +60,8 @@ jobs:
name: prose checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-node@v4.4.0
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
with:
node-version: 20
- name: Versions agree
@@ -81,9 +81,20 @@ jobs:
defaults:
run:
working-directory: plan2code-app
env:
# Debug info and incremental state are most of target/'s size; the ubuntu
# runner ran out of disk building both the debug and the release app.
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 0
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-node@v4.4.0
- name: Free disk space on the Linux runner
if: runner.os == 'Linux'
working-directory: .
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
df -h /
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
with:
node-version: 20
cache: npm
@@ -179,8 +190,8 @@ jobs:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-node@v4.4.0
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
with:
node-version: 20
- name: Cache the npm downloads
+4 -4
View File
@@ -27,8 +27,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-node@v4.4.0
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
with:
node-version: 20
- name: Cache the npm downloads
@@ -60,8 +60,8 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-node@v4.4.0
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
with:
node-version: 20
- name: Cache the npm downloads
+5 -5
View File
@@ -64,10 +64,10 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@v4.4.0
- uses: actions/setup-node@v7.1.0
with:
node-version: 22
cache: npm
@@ -121,7 +121,7 @@ jobs:
VERSION="$(node -p "require('./plan2code-app/src-tauri/tauri.conf.json').version")"
mkdir -p dist
cp "plan2code-app/target/release/${{ matrix.built }}" "dist/plan2code-app-${VERSION}-${{ matrix.label }}${{ matrix.suffix }}"
- uses: actions/upload-artifact@v4.6.2
- uses: actions/upload-artifact@v7.0.2
with:
name: app-${{ matrix.label }}
path: dist/*
@@ -136,8 +136,8 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/download-artifact@v4.3.0
- uses: actions/checkout@v7.0.1
- uses: actions/download-artifact@v8.0.2
with:
path: dist
pattern: app-*
+5
View File
@@ -38,6 +38,11 @@
- About: install.js
- Noted: 2026-11-17, implement-review
### Every heading and .md-h gets text-wrap: balance from tokens.css, so a long heading such as a lesson title splits into two even halves; set text-wrap: wrap where a heading runs longer than a line.
- Kind: how-it-works
- About: src/web-console/public/styles/tokens.css, src/web-console/public/styles/learning.css
- Noted: 2026-11-19, quick-task
### In a Markdown field (md-field.js), CodeMirror's scroller and content are only as tall as the text, not the bordered host: code that hit-tests the scroller must not assume it fills the box.
- Kind: how-it-works
- About: src/web-console/public/md-field.js
+3 -3
View File
@@ -208,9 +208,9 @@ origin.
| Screenshots | `node scripts/capture-screenshots.mjs` (needs a local Chrome or Edge, driven through `playwright-core` from `npm install`; `PLAN2CODE_TEST_BROWSER=chrome|msedge` forces one) |
| Dependencies | none at runtime. `marked` 15.0.7 (MIT) is vendored for its lexer only, and CodeMirror 6 (MIT) for the notebook's editor as one bundled file, `public/vendor/codemirror.esm.js`, made by the dev-only `node scripts/vendor-codemirror.mjs` from a pinned lock (about 500 KB, loaded only when the Notebook is first opened); the page's policy blocks the `<style>` element CodeMirror writes, so the editor lives in a shadow root where it adopts its rules as a constructed stylesheet (steps in the architecture doc's Notebook point) |
Edit `src/` only. `skills/` is a committed build artifact: regenerate it with
`npm run build:skills` and commit it with the source change, since `npm test`
(via `--verify-skills`) fails when it drifts from `src/`.
Edit `src/` only. `skills/` is gitignored build output: the installer and
`npm test` (via `--build-skills`) regenerate it, and `npm run build:skills`
rebuilds it by hand.
### Driving it by hand
+31
View File
@@ -4,6 +4,37 @@ All notable changes to Plan2Code will be documented in this file.
<!-- Format from 3.1.0 on: `## vX.Y.Z (YYYY-MM-DD)` with the date from version.json; a minor release opens with a three-bullet `### Highlights`; sections run Added, Changed, Fixed; game changes sit under one Activities line; tooling and test lines go under "For contributors". Older headings have no date and are not backfilled. -->
## v3.1.4 (2026-11-20)
### 🔧 Changed
- **launcher**: the model menu offers Claude Fable 5.2 in place of 5.1, Gemini 4 Hydrogen and Gemini 4 Neon for Devin, and GPT-6.2 Astra and GPT-6.2 Sol for Codex; Gemini 3.8 Flash, GLM-5.3 Low and SWE-2 Flash Medium leave Devin's list, and Claude's `haiku` and `fable` labels follow the Claude Code docs.
- **launcher**: Claude Code's install options add the Windows CMD installer and install `@latest` through npm, the OpenCode starter template opens with `@plan2code`, and the Gemini CLI note also names Gemini Code Assist for GitHub.
### 🐛 Fixed
- **launcher**: `plan2code update` no longer stops at "Already on" after an earlier update stopped partway and left the `plan2code` command on the old version; the install record keeps the old version until every piece is in.
## v3.1.3 (2026-11-18)
### 🔧 Changed
- **For contributors**: the CI workflows use the Node.js 24 versions of the checkout, setup-node and artifact actions, two tests that always failed on macOS are fixed, and four page tests no longer depend on redraw timing.
### 🐛 Fixed
- **web console**: on a finished screen, a press that nothing ever collects now shows its way out (Start a New Session in the app, or the command to run in a browser) together with the "Plan2Code is not running" line; before, it appeared only if something else happened to redraw the card.
## v3.1.2 (2026-11-18)
### 🔧 Changed
- **web console**: the git board now walks you through four steps, Save, Share, Review and Tidy, with one task card for the step you are on; the Changes, Branches and Sync tabs are folded into **All branches and tools**.
### 🐛 Fixed
- **installer**: an install, update or uninstall started by a launcher older than the release channel, or by an install command copied from an older README, no longer gets unfinished work from `main`: the installer notices, says so and switches to the newest release. `plan2code update --main` still takes `main`.
## v3.1.1 (2026-11-17)
### ✨ Added
+1 -1
View File
@@ -13,7 +13,7 @@
Plan2Code is a spec-driven workflow for AI coding agents. You work through it on a page in your browser: the dashboard lists every step as a card, and each step's questions, progress and sign-offs arrive on that same page while your agent does the work. An approved plan becomes phase documents, and the agent builds to them one phase at a time.
Version 3.1.1 · Apache 2.0 · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com)
Version 3.1.4 · Apache 2.0 · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com)
---
+140 -20
View File
@@ -2569,8 +2569,13 @@ function readInstallRecord() {
return null;
}
// While update() runs, every record write keeps the version the update started from (`{ version }`),
// so an update stopped partway (Ctrl+C, a closed window, a killed child) never leaves the record
// claiming the new version over pieces that are still old. update() stamps the new one at the end.
let recordVersionHold = null;
/** Temp file, then rename, so a crash never leaves a half-written record. A failure only skips the record. */
function writeInstallRecord(pieces, skipped = (readInstallRecord() || {}).skipped || [], version = projectVersion.version) {
function writeInstallRecord(pieces, skipped = (readInstallRecord() || {}).skipped || [], version = recordVersionHold ? recordVersionHold.version : projectVersion.version) {
const record = {
version,
scope: 'global',
@@ -2591,15 +2596,25 @@ function writeInstallRecord(pieces, skipped = (readInstallRecord() || {}).skippe
}
/**
* Put `version` back in the record (null when none was known) without touching its pieces: every
* recordInstalled() stamps the version being installed, so an update that failed uses this to
* stay behind, and the next `plan2code update` does not answer "Already on".
* Write `version` on the record without touching its pieces: update() uses it to stamp the new
* version once every piece is in, and to keep the old one (null when none was known) after a
* failure or a kept app, so the next `plan2code update` does not answer "Already on".
*/
function setRecordVersion(version) {
const record = readInstallRecord();
if (record) writeInstallRecord(record.pieces, record.skipped || [], version);
}
/** The version in the installed plan2code command's version.json, or null when it is missing or unreadable. */
function installedLauncherVersion() {
try {
const { version } = JSON.parse(fs.readFileSync(LAUNCHER_VERSION_DEST, 'utf8'));
return typeof version === 'string' ? version : null;
} catch {
return null;
}
}
/** Add a piece after a successful global install. */
function recordInstalled(piece) {
const record = readInstallRecord();
@@ -3725,7 +3740,8 @@ function releaseNotesUrl(version) {
/**
* Reinstall whatever ~/.plan2code/install.json lists, without the menu or any prompt, and print
* one compact summary: `Updating <old> -> <new>` (or `Already on <new>`, which stops early unless
* `force`), one line per piece by its human name, then the release notes link and the restart
* `force`, and only when the installed command's bin/version.json agrees with the record whenever
* the record lists `launcher`), one line per piece by its human name, then the release notes link and the restart
* hint. Each piece's own output is held back and shown only when that piece warns or fails.
* Returns the exit code: 0 when every piece updated, 1 naming the pieces that failed.
*/
@@ -3733,15 +3749,33 @@ async function update({ steps = UPDATE_STEPS, cleanShims = removeLegacyLoopShims
const record = readInstallRecord();
const version = projectVersion.version;
const before = record && typeof record.version === 'string' ? record.version : null;
if (before === version && !force) {
const pieces = record ? record.pieces : ['skills', 'launcher'];
// The record alone is not proof: an update stopped before its launcher step (or one run by a
// launcher too old to pass --force on) left the record new and the command old, and every later
// update stopped here. The command's own version.json says what is really in place.
const launcherVersion = pieces.includes('launcher') ? installedLauncherVersion() : version;
if (before === version && launcherVersion === version && !force) {
console.log(`${COLORS.GREEN}${MARKS.DONE}${COLORS.RESET} Already on ${version}`);
console.log(`${COLORS.DIM}Run plan2code update --force to install it again.${COLORS.RESET}`);
return 0;
}
console.log(`${COLORS.BRIGHT}${before ? `Updating ${before} -> ${version}` : `Updating to ${version}`}${COLORS.RESET}`);
const pieces = record ? record.pieces : ['skills', 'launcher'];
if (before === version && launcherVersion !== version && !force) {
console.log(`${COLORS.DIM}The plan2code command is still on ${launcherVersion || 'an unknown version'}, so everything is installed again.${COLORS.RESET}`);
}
if (!record) console.log(`${COLORS.DIM}No install record found; updating the skills and the plan2code command.${COLORS.RESET}`);
recordVersionHold = { version: before };
try {
return await updatePieces({ steps, cleanShims, pieces, before, version });
} finally {
recordVersionHold = null;
}
}
/** update()'s body once it has decided to install: the pieces, the summary, and the version stamp. */
async function updatePieces({ steps, cleanShims, pieces, before, version }) {
await captureOutput(async () => cleanShims());
const results = {};
@@ -3798,7 +3832,7 @@ async function update({ steps = UPDATE_STEPS, cleanShims = removeLegacyLoopShims
console.log('');
if (failed.length > 0) {
console.log(`${COLORS.RED}${MARKS.FAIL} Update failed for: ${failed.join(', ')}${COLORS.RESET}`);
// The pieces that did install stamped the new version on the record: take it back, so running
// Keep the old version on the record (writes during the update already held it), so running
// plan2code update again retries instead of stopping at "Already on".
setRecordVersion(before);
console.log(`To try again, run: ${COLORS.CYAN}plan2code update${COLORS.RESET}`);
@@ -3809,7 +3843,9 @@ async function update({ steps = UPDATE_STEPS, cleanShims = removeLegacyLoopShims
// The release had no desktop app file yet, so the installed app is still the old one: keep the
// old version on the record, or the next update (the app's Update and restart among them) stops
// at "Already on" and never fetches the app once the file is attached.
if (before && typeof results.app === 'string' && results.app.startsWith('kept')) setRecordVersion(before);
// Otherwise every piece is in: only now does the record name the new version.
const appKept = typeof results.app === 'string' && results.app.startsWith('kept');
setRecordVersion(before && appKept ? before : version);
console.log(`${COLORS.GREEN}${MARKS.DONE} Plan2Code is up to date (v${version})${COLORS.RESET}`);
console.log(`What's new: ${releaseNotesUrl(version)}`);
console.log('Close any open Plan2Code console or app and start `plan2code` again.');
@@ -3817,20 +3853,90 @@ async function update({ steps = UPDATE_STEPS, cleanShims = removeLegacyLoopShims
return 0;
}
// ============================================================================
// RELEASE REDIRECT
// ============================================================================
//
// Launchers older than the release channel run `plan2code update` (and uninstall) as
// `npx git+<repo> --update`, which is the tip of main, and so does an install command copied from
// an older README. Without this, those people would get unreleased work. When this copy came from
// an npx fetch of a commit that no `vX.Y.Z` tag points at, it hands the same command to the
// newest release instead. Any run the current launcher starts says which ref it picked on purpose
// (PLAN2CODE_INSTALL_REF, `--main` included), and a checkout (`node install.js`) is never under
// node_modules, so neither is redirected. Anything unknown (no lock file, no network) also means
// no redirect: the run goes on exactly as before.
/** The commit npx fetched this copy from (from npm's hidden lock file beside it), or null. */
function fetchedCommit(dir = __dirname) {
const modules = path.dirname(dir);
if (path.basename(modules) !== 'node_modules') return null;
try {
const lock = JSON.parse(fs.readFileSync(path.join(modules, '.package-lock.json'), 'utf8'));
const entry = lock && lock.packages && lock.packages[`node_modules/${path.basename(dir)}`];
const m = entry && typeof entry.resolved === 'string' ? /#([0-9a-f]{40})$/i.exec(entry.resolved) : null;
return m ? m[1].toLowerCase() : null;
} catch {
return null;
}
}
/**
* The release tag to hand this run to, as `vX.Y.Z`, or null to run here. `lsRemote` is
* `git ls-remote --tags` output and `newest` its newest release (update-check.mjs's pick). A
* commit any release tag points at (peeled or not) stays, so an older launcher's
* `update --tag v3.0.2` and the `#release` branch are left alone.
*/
function releaseRedirectRef({ commit, lsRemote, newest, env = process.env }) {
if (env.PLAN2CODE_INSTALL_REF || !commit || !newest || typeof lsRemote !== 'string') return null;
for (const line of lsRemote.split(/\r?\n/)) {
const m = /^([0-9a-f]{40})\s+refs\/tags\/v\d+\.\d+\.\d+(\^\{\})?$/i.exec(line.trim());
if (m && m[1].toLowerCase() === commit) return null;
}
return `v${newest}`;
}
/**
* Run the newest release's installer with the same options when this copy is unreleased work
* fetched by an older launcher. Resolves the child's exit code, or null to carry on here.
*/
async function redirectToRelease(argv) {
if (!argv.every((a) => /^--[a-z]+$/.test(a))) return null;
const commit = fetchedCommit();
if (!commit || process.env.PLAN2CODE_INSTALL_REF) return null;
let ref = null;
try {
const checker = await import(pathToFileURL(UPDATE_CHECK_SRC).href);
const stub = process.env.PLAN2CODE_LS_REMOTE_FILE;
const lsRemote = stub ? fs.readFileSync(stub, 'utf8') : await checker.runLsRemote();
ref = releaseRedirectRef({ commit, lsRemote, newest: checker.latestTag(lsRemote) });
} catch {
return null;
}
if (!ref) return null;
console.log(`This installer is unreleased work from main, so Plan2Code is switching to the newest release, ${ref}.`);
console.log(`${COLORS.DIM}Fetching it can take a minute or two.${COLORS.RESET}`);
const command = ['npx', '--yes', '--allow-git=all', `git+https://github.com/jparkerweb/plan2code.git#${ref}`, ...argv].join(' ');
return new Promise((resolve) => {
let child;
try {
child = spawn(command, { shell: true, stdio: 'inherit', env: { ...process.env, PLAN2CODE_INSTALL_REF: ref } });
} catch {
resolve(null);
return;
}
// The child owns the terminal now: Ctrl+C reaches it, and this process waits for its code.
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.on(signal, () => {});
child.on('error', () => resolve(null));
child.on('exit', (code) => resolve(code ?? 1));
});
}
// ============================================================================
// MAIN
// ============================================================================
// Run only when invoked directly; requiring the file (the update tests do) is load-only.
if (require.main === module) {
// Non-interactive build hooks for the generated skills/ artifact.
const argv = process.argv.slice(2);
if (argv.includes('--build-skills')) {
process.exit(buildSkills() ? 0 : 1);
} else if (argv.includes('--verify-skills')) {
process.exit(verifySkillsSync() ? 0 : 1);
} else if (argv[0] === '--update' && argv.slice(1).every((a) => a === '--force')) {
function runCommand(argv) {
if (argv[0] === '--update' && argv.slice(1).every((a) => a === '--force')) {
update({ force: argv.includes('--force') }).then((code) => process.exit(code));
} else if (argv[0] === '--uninstall' && argv.slice(1).every((a) => a === '--yes' || a === '--purge')) {
uninstall({ yes: argv.includes('--yes'), purge: argv.includes('--purge') }).then((code) => process.exit(code));
@@ -3844,4 +3950,18 @@ if (require.main === module) {
}
}
module.exports = { printKeptData, uninstallSkillsPiece, removeSkillsDirectly, removeConsoleFolders, uninstallStatusLine, listKeptData, newUninstallReport, printUninstallReport, UNINSTALL_STEPS, UNINSTALL_PROBES, PIECE_LABELS, createSpinner, printGettingStarted, pathFixLine, fullCommandPath, desktopAppState, detectAgents, agentInstallLine, writeLauncherShim, isOurLauncherShim, LAUNCHER_MARKER, NO_TERMINAL_MESSAGE, appAllowLine, APP_GUIDE_URL, formatBytes, nodeVersionProblem, appWebviewDirs, purgeAppWebview, appRunning, uninstall, uninstallAll, purgeData, installSharedConsole, sweepOldConsoles, consoleHomeDir, CONSOLE_SHARED_DIR, update, installDesktopApp, offerDesktopApp, recordSkipped, appAssetName, checksumFor, APP_DEST, UPDATE_STEPS, INSTALL_RECORD, INSTALL_PIECES, readInstallRecord, recordInstalled, forgetInstalled, SOURCE_PROMPTS, generateSkillName };
// Run only when invoked directly; requiring the file (the update tests do) is load-only.
if (require.main === module) {
const argv = process.argv.slice(2);
// Non-interactive build hooks for the generated skills/ artifact.
if (argv.includes('--build-skills')) {
process.exit(buildSkills() ? 0 : 1);
} else if (argv.includes('--verify-skills')) {
process.exit(verifySkillsSync() ? 0 : 1);
} else {
redirectToRelease(argv).then((code) => (code === null ? runCommand(argv) : process.exit(code)));
}
}
module.exports = { fetchedCommit, releaseRedirectRef, printKeptData, uninstallSkillsPiece, removeSkillsDirectly, removeConsoleFolders, uninstallStatusLine, listKeptData, newUninstallReport, printUninstallReport, UNINSTALL_STEPS, UNINSTALL_PROBES, PIECE_LABELS, createSpinner, printGettingStarted, pathFixLine, fullCommandPath, desktopAppState, detectAgents, agentInstallLine, writeLauncherShim, isOurLauncherShim, LAUNCHER_MARKER, NO_TERMINAL_MESSAGE, appAllowLine, APP_GUIDE_URL, formatBytes, nodeVersionProblem, appWebviewDirs, purgeAppWebview, appRunning, uninstall, uninstallAll, purgeData, installSharedConsole, sweepOldConsoles, consoleHomeDir, CONSOLE_SHARED_DIR, update, installDesktopApp, offerDesktopApp, recordSkipped, appAssetName, checksumFor, APP_DEST, UPDATE_STEPS, INSTALL_RECORD, INSTALL_PIECES, readInstallRecord, recordInstalled, forgetInstalled, SOURCE_PROMPTS, generateSkillName };
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code",
"version": "3.1.1",
"version": "3.1.4",
"private": true,
"license": "Apache-2.0",
"engines": {
+2 -2
View File
@@ -957,7 +957,7 @@ dependencies = [
[[package]]
name = "fake-agent"
version = "3.1.1"
version = "3.1.4"
dependencies = [
"serde_json",
"terminal_size",
@@ -2647,7 +2647,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
[[package]]
name = "plan2code-app"
version = "3.1.1"
version = "3.1.4"
dependencies = [
"chrono",
"libc",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "fake-agent"
version = "3.1.1"
version = "3.1.4"
description = "A stand-in agent program for the Plan2Code app's tests"
edition = "2021"
publish = false
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "plan2code-app",
"version": "3.1.1",
"version": "3.1.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "plan2code-app",
"version": "3.1.1",
"version": "3.1.4",
"dependencies": {
"@tauri-apps/api": "2.12.4",
"@xterm/addon-fit": "0.11.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code-app",
"version": "3.1.1",
"version": "3.1.4",
"private": true,
"description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.",
"scripts": {
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "plan2code-app"
version = "3.1.1"
version = "3.1.4"
description = "Plan2Code desktop app"
edition = "2021"
publish = false
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Plan2Code",
"version": "3.1.1",
"version": "3.1.4",
"identifier": "com.plan2code.desktop",
"build": {
"frontendDist": "../ui",
+142
View File
@@ -175,9 +175,18 @@ test("update: prints the version change, one line per piece by name, the release
assert.doesNotMatch(out, /Happy coding|PARAMETERS|To go back to a release/);
});
const LAUNCHER_VERSION = path.join(HOME, ".plan2code", "bin", "version.json");
/** The installed plan2code command's version.json, as installLauncher() writes it. */
function writeLauncherVersion(version) {
fs.mkdirSync(path.dirname(LAUNCHER_VERSION), { recursive: true });
fs.writeFileSync(LAUNCHER_VERSION, JSON.stringify({ name: "Plan2Code", version }));
}
test("update: already on the new version it says so and stops, until --force", async () => {
fs.mkdirSync(path.dirname(RECORD), { recursive: true });
fs.writeFileSync(RECORD, JSON.stringify({ version: VERSION, scope: "global", pieces: ["skills", "launcher"] }));
writeLauncherVersion(VERSION);
const idle = fakeSteps();
const stopped = await runUpdate(idle.steps);
assert.equal(stopped.code, 0, stopped.out);
@@ -202,6 +211,52 @@ test("update: already on the new version it says so and stops, until --force", a
assert.match(out, new RegExp(`Updating ${VERSION.replace(/\./g, "\\.")} -> ${VERSION.replace(/\./g, "\\.")}`));
});
test("update: a record on the new version over an older plan2code command installs again, without --force", async () => {
// An update stopped after the skills step: the record says new, the command is still old.
fs.mkdirSync(path.dirname(RECORD), { recursive: true });
fs.writeFileSync(RECORD, JSON.stringify({ version: VERSION, scope: "global", pieces: ["skills", "launcher"] }));
for (const launcher of ["1.0.0", null]) {
if (launcher) writeLauncherVersion(launcher);
else fs.rmSync(LAUNCHER_VERSION, { force: true });
const fake = fakeSteps();
const { code, out } = await runUpdate(fake.steps);
assert.equal(code, 0, out);
assert.doesNotMatch(out, /Already on/);
assert.match(out, new RegExp(`The plan2code command is still on ${launcher ? "1\\.0\\.0" : "an unknown version"}`));
assert.deepEqual(fake.ran(), ["skills"]);
assert.match(out, /plan2code command: updated/);
}
// A record without the command does not look at its version.json.
fs.writeFileSync(RECORD, JSON.stringify({ version: VERSION, scope: "global", pieces: ["statusline"] }));
const idle = fakeSteps();
assert.match((await runUpdate(idle.steps)).out, /Already on/);
assert.deepEqual(idle.ran(), []);
});
test("update: the record keeps the old version until every piece is in, so a stopped update retries", async () => {
writeRecord(["skills", "launcher", "app"]);
const seen = [];
const fake = fakeSteps();
// As the real steps: each records its piece as it finishes.
for (const piece of ["skills", "app"]) {
const step = fake.steps[piece];
fake.steps[piece] = async (options) => {
const code = await step(options);
installer.recordInstalled(piece);
seen.push(installer.readInstallRecord().version);
return code;
};
}
const { code, out } = await runUpdate(fake.steps);
assert.equal(code, 0, out);
assert.deepEqual(seen, ["1.0.0", "1.0.0"], "mid-update writes keep the old version");
assert.equal(installer.readInstallRecord().version, VERSION, "stamped once the update finished");
assert.deepEqual(installer.readInstallRecord().pieces, ["app", "launcher", "skills"]);
// Outside an update, a record write stamps the version being installed again.
installer.recordInstalled("statusline");
assert.equal(installer.readInstallRecord().version, VERSION);
});
test("update: a step's own output stays out of the summary, except its warnings and its failures", async () => {
writeRecord(["skills", "statusline", "bot"]);
const fake = fakeSteps();
@@ -312,6 +367,93 @@ test("install.js --update: an option other than --force is refused", () => {
assert.match(refused.stderr, /Unknown option\(s\): --update --nope/);
});
const SHA_RELEASE = "a".repeat(40);
const SHA_OLD_RELEASE = "b".repeat(40);
const SHA_MAIN = "c".repeat(40);
const TAGS = [`${SHA_OLD_RELEASE}\trefs/tags/v3.0.2`, `${SHA_RELEASE}\trefs/tags/v3.1.2`, `${"d".repeat(40)}\trefs/tags/nightly`].join("\n");
test("release redirect: unreleased work goes to the newest release; a release commit, a chosen ref or an unknown stays", () => {
const ref = (commit, extra = {}) => installer.releaseRedirectRef({ commit, lsRemote: TAGS, newest: "3.1.2", env: {}, ...extra });
assert.equal(ref(SHA_MAIN), "v3.1.2");
assert.equal(ref(SHA_RELEASE), null, "the newest release (and the release branch on it) stays");
assert.equal(ref(SHA_OLD_RELEASE), null, "an older launcher's update --tag v3.0.2 stays on v3.0.2");
assert.equal(ref("d".repeat(40)), "v3.1.2", "a tag that is not vX.Y.Z is not a release");
assert.equal(ref(SHA_MAIN, { env: { PLAN2CODE_INSTALL_REF: "main" } }), null, "the current launcher's --main stays on main");
assert.equal(ref(null), null);
assert.equal(ref(SHA_MAIN, { newest: null }), null);
assert.equal(ref(SHA_MAIN, { lsRemote: null }), null);
// An annotated tag's commit is on its peeled line.
assert.equal(ref(SHA_MAIN, { lsRemote: `${"e".repeat(40)}\trefs/tags/v3.1.2\n${SHA_MAIN}\trefs/tags/v3.1.2^{}` }), null);
});
/** install.js laid out as npx leaves a git package: node_modules/plan2code beside npm's hidden lock file. */
function npxCopy(commit) {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "p2c-npx-copy-"));
const pkg = path.join(dir, "node_modules", "plan2code");
fs.mkdirSync(path.join(pkg, "src", "web-console"), { recursive: true });
fs.copyFileSync(INSTALL, path.join(pkg, "install.js"));
fs.copyFileSync(path.join(ROOT, "version.json"), path.join(pkg, "version.json"));
fs.copyFileSync(path.join(ROOT, "src", "web-console", "update-check.mjs"), path.join(pkg, "src", "web-console", "update-check.mjs"));
if (commit) {
const resolved = `git+ssh://git@github.com/jparkerweb/plan2code.git#${commit}`;
fs.writeFileSync(path.join(dir, "node_modules", ".package-lock.json"), JSON.stringify({ packages: { "node_modules/plan2code": { version: VERSION, resolved } } }));
}
fs.writeFileSync(path.join(dir, "ls-remote.txt"), TAGS + "\n");
// A stand-in npx that records its arguments and the ref the redirect handed it.
const bin = path.join(dir, "bin");
fs.mkdirSync(bin);
const recorder = path.join(bin, "record.js");
fs.writeFileSync(
recorder,
'require("fs").writeFileSync(require("path").join(__dirname, "npx.json"), JSON.stringify({ args: process.argv.slice(2), ref: process.env.PLAN2CODE_INSTALL_REF }));\nprocess.exitCode = 5;\n'
);
if (process.platform === "win32") fs.writeFileSync(path.join(bin, "npx.cmd"), `@"${process.execPath}" "${recorder}" %*\r\n`);
else {
fs.writeFileSync(path.join(bin, "npx"), `#!/bin/sh\nexec "${process.execPath}" "${recorder}" "$@"\n`);
fs.chmodSync(path.join(bin, "npx"), 0o755);
}
const run = (args, env = {}) => {
const runEnv = { ...process.env, HOME, USERPROFILE: HOME, PLAN2CODE_LS_REMOTE_FILE: path.join(dir, "ls-remote.txt"), ...env };
delete runEnv.PLAN2CODE_INSTALL_REF;
for (const key of Object.keys(runEnv)) if (key.toUpperCase() === "PATH") delete runEnv[key];
runEnv.PATH = bin + path.delimiter + (process.env.PATH || process.env.Path || "");
Object.assign(runEnv, env);
return spawnSync(process.execPath, [path.join(pkg, "install.js"), ...args], { encoding: "utf8", env: runEnv, input: "" });
};
const npx = () => (fs.existsSync(path.join(bin, "npx.json")) ? JSON.parse(fs.readFileSync(path.join(bin, "npx.json"), "utf8")) : null);
return { dir, run, npx, cleanup: () => fs.rmSync(dir, { recursive: true, force: true }) };
}
test("release redirect: an old launcher's update from main runs the newest release's installer with the same options", (t) => {
const copy = npxCopy(SHA_MAIN);
t.after(copy.cleanup);
const result = copy.run(["--update", "--force"]);
assert.equal(result.status, 5, "the release installer's exit code is passed through\n" + result.stderr);
assert.match(result.stdout, /switching to the newest release, v3\.1\.2/);
const { args, ref } = copy.npx();
assert.deepEqual(args, ["--yes", "--allow-git=all", "git+https://github.com/jparkerweb/plan2code.git#v3.1.2", "--update", "--force"]);
assert.equal(ref, "v3.1.2", "the handed-off run is marked, so it never redirects again");
});
test("release redirect: a release copy, a run the launcher chose, or a copy with no lock file is not redirected", (t) => {
for (const [commit, env] of [[SHA_RELEASE, {}], [SHA_MAIN, { PLAN2CODE_INSTALL_REF: "main" }], [null, {}]]) {
const copy = npxCopy(commit);
t.after(copy.cleanup);
// An unknown option shows the run carried on here: the usage error, and no npx.
const result = copy.run(["--update", "--nope"], env);
assert.equal(result.status, 1, result.stdout + result.stderr);
assert.match(result.stderr, /Unknown option\(s\)/);
assert.equal(copy.npx(), null);
}
});
test("release redirect: an interactive install from main is handed to the newest release too", (t) => {
const copy = npxCopy(SHA_MAIN);
t.after(copy.cleanup);
assert.equal(copy.run([]).status, 5);
assert.deepEqual(copy.npx().args.slice(-1), ["git+https://github.com/jparkerweb/plan2code.git#v3.1.2"]);
});
test("update: the real status line step keeps a custom statusLine without asking", async () => {
const claudeDir = path.join(HOME, ".claude");
const settingsFile = path.join(claudeDir, "settings.json");
+5
View File
@@ -58,6 +58,8 @@ function sandbox(clis, { installed, project = true, lookup = true, agents } = {}
fs.writeFileSync(
recorder,
'require("fs").writeFileSync(require("path").join(__dirname, process.argv[2] + ".json"), JSON.stringify(process.argv.slice(3)));\n' +
// The ref the launcher marks its installer runs with, so install.js never redirects them.
'if (process.env.PLAN2CODE_INSTALL_REF) require("fs").writeFileSync(require("path").join(__dirname, process.argv[2] + ".ref"), process.env.PLAN2CODE_INSTALL_REF);\n' +
"process.exitCode = Number(process.env.P2C_TEST_EXIT || 0);\n"
);
for (const cli of clis) {
@@ -503,6 +505,7 @@ test("launcher: update installs the newest release tag, by version and not by na
assert.ok(args.includes("--update"), args.join(" "));
assert.ok(args.includes(`${REPO}#v3.10.0`), args.join(" "));
assert.ok(!args.includes("--force"), args.join(" "));
assert.equal(fs.readFileSync(path.join(box.dir, "bin", "npx.ref"), "utf8"), "v3.10.0", "the run is marked with the ref it picked");
assert.equal(box.argsOf("claude"), null);
});
@@ -518,6 +521,8 @@ test("launcher: update --main installs the tip of main, as it always did", (t) =
// Unreleased work on main carries the last release's version, so the installer's "Already on"
// check would stop it: --main always reinstalls.
assert.ok(args.includes("--force"), args.join(" "));
// Marked as chosen, so install.js's redirect for older launchers leaves it on main.
assert.equal(fs.readFileSync(path.join(box.dir, "bin", "npx.ref"), "utf8"), "main");
});
test("launcher: update --tag reinstalls for a branch, and not for a release tag", (t) => {
+15 -4
View File
@@ -27,6 +27,17 @@ const FIXTURES = path.join(ROOT, "scripts", "fixtures", "deps");
const MANIFESTS = path.join(FIXTURES, "manifests");
const readJson = (...p) => JSON.parse(fs.readFileSync(path.join(FIXTURES, ...p), "utf8"));
// Recorded npm projects keep their lockfile as package-lock.fixture.json, so
// dependency scanners never read the old versions the recordings pin as the
// repository's own. A copy gets the real name back.
const FIXTURE_LOCK = "package-lock.fixture.json";
function copyFixture(src, dir) {
fs.cpSync(src, dir, { recursive: true });
for (const rel of fs.readdirSync(dir, { recursive: true })) {
if (path.basename(rel) === FIXTURE_LOCK) fs.renameSync(path.join(dir, rel), path.join(dir, path.dirname(rel), "package-lock.json"));
}
}
const runDeps = (args, opts) => runScript("plan2code-deps", "deps.mjs", args, opts);
const made = [];
@@ -849,7 +860,7 @@ function runStubbed(args, pathDir) {
/** The recorded project copied into a temp folder (extra files on top), so a run never touches the fixture. */
function project(extra = {}) {
const dir = tmp("deps-project");
fs.cpSync(path.join(NPM, "project"), dir, { recursive: true });
copyFixture(path.join(NPM, "project"), dir);
for (const [rel, content] of Object.entries(extra)) write(dir, rel, typeof content === "string" ? content : JSON.stringify(content, null, 2) + "\n");
return dir;
}
@@ -1206,7 +1217,7 @@ test("apply refuses a batch with no backup (exit 5) and reports a pick that neve
test("backup then restore --verify puts an untracked CRLF lockfile and a tracked one back byte for byte", () => {
const root = project({
"web/package.json": fs.readFileSync(path.join(NPM, "project", "package.json"), "utf8"),
"web/package-lock.json": fs.readFileSync(path.join(NPM, "project", "package-lock.json"), "utf8"),
"web/package-lock.json": fs.readFileSync(path.join(NPM, "project", FIXTURE_LOCK), "utf8"),
});
// The root lockfile is untracked and written with CRLF, as some Windows tools leave one: put back exactly as found.
const lockPath = path.join(root, "package-lock.json");
@@ -1534,7 +1545,7 @@ const UV = fx("uv-0.13.7");
/** A recorded project folder copied into a temp folder, extra files on top. */
function copyFrom(src, extra = {}) {
const dir = tmp("deps-eco");
fs.cpSync(src, dir, { recursive: true });
copyFixture(src, dir);
for (const [rel, content] of Object.entries(extra)) write(dir, rel, content);
return dir;
}
@@ -2564,7 +2575,7 @@ const PINS = fx("pins", "project");
/** The pins fixture project copied into a temp folder, with extra files on top. */
function pinsProject(extra = {}) {
const dir = tmp("deps-pins");
fs.cpSync(PINS, dir, { recursive: true });
copyFixture(PINS, dir);
for (const [rel, content] of Object.entries(extra)) write(dir, rel, content);
return dir;
}
+2 -1
View File
@@ -374,7 +374,8 @@ test("wait reads --seconds 6s as six seconds, not as nothing", () => {
});
test("only an installed console's open leaves the console-dir pointer; status, help, a bad command and a source checkout's open do not", () => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), "p2c-pointer-"));
// macOS hands out a temp folder under the /var link, and the console writes the real path.
const home = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), "p2c-pointer-")));
const env = { PLAN2CODE_CONSOLE_HOME: home, PLAN2CODE_MODELS_DIR: path.join(home, "plan2code") };
const pointer = path.join(home, "console-dir");
fs.writeFileSync(path.join(home, "update-check.json"), JSON.stringify({ checkedAt: Date.now(), latest: null }));
+2 -2
View File
@@ -96,7 +96,7 @@ test("a press in the empty part of the answer box selects like a textarea: Shift
const range = () => host.evaluate((el) => [el.field.selectionStart, el.field.selectionEnd]);
const box = await host.boundingBox();
const low = { x: box.x + box.width / 2, y: box.y + box.height - 12 };
assert.equal(await host.evaluate((el) => getComputedStyle(el).cursor), "text", "the whole box shows the text pointer");
assert.equal(await styleOf(host, "cursor"), "text", "the whole box shows the text pointer");
await s.page.keyboard.press("Home");
// page.mouse takes no modifiers option: hold Shift on the keyboard.
@@ -621,7 +621,7 @@ test("a note box over the git board grows no box, and the card flows at its own
project: dir,
payload: { reread: true, board: { describe: "export-more" }, items: [confirm] },
});
await git.page.getByRole("tablist").waitFor();
await git.page.locator(".git-step").first().waitFor();
const gitCard = itemCard(git.page, "y1");
await gitCard.waitFor();
const note = gitCard.locator(".md-host").first();
+8
View File
@@ -91,6 +91,14 @@ test("each git tab keeps its own scroll place, across a tab switch and an agent
await tab("Changes").click();
await page.getByRole("tabpanel").getByText(/in the Save step above/).waitFor();
await scrollCard(page.locator("#main"), 120);
// The tabs sit below this short window, so a click on one scrolls the column to it first:
// a scroll like the person's own, which the board notes. Make it now and give the page a
// moment to note it, so the place Changes is left at is known before the switch.
// Done in the page in one step: a redraw may swap the tab for a new one at any moment.
await page.evaluate(() => {
document.getElementById("git-tab-branches").scrollIntoView({ block: "center" });
return new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
});
const changesAt = await column();
assert.ok(changesAt > 0, "the board's column scrolls");
// Another tab opens at its own place, not where Changes was left.
+1 -1
View File
@@ -544,7 +544,7 @@ test("each tab keeps its own text and pictures, and switching never saves into t
const notes = idOf(s, "Notes");
const ideas = idOf(s, "Ideas");
// The new tab opens with its heading and the editor focused: clear it to start from empty.
await s.page.keyboard.press("Control+a");
await s.page.keyboard.press("ControlOrMeta+a");
await s.page.keyboard.press("Delete");
await until(() => readNotepad(s.project, notes).text === "notes text" && readNotepad(s.project, ideas).text === "", 4000);
await typeInto(s, "ideas text");
+3
View File
@@ -973,6 +973,9 @@ test("the Subagents dialog looks as it did before Preferences moved to tabs", as
second: await stylesOf(modal.locator("fieldset.modal-ranges").nth(1), ["margin-top"]),
actions: await stylesOf(modal.locator(".modal-actions"), ["display", "justify-content"]),
};
// Chrome 158 reads `justify-content: flex-end` back as "flow-end"; older Chrome and Edge
// say "flex-end". The stylesheet is the same either way, so count them as one.
if (got.actions["justify-content"] === "flow-end") got.actions["justify-content"] = "flex-end";
if (process.env.P2C_PRINT_SUBAGENTS) console.log("SUBAGENTS " + JSON.stringify(got));
assert.deepEqual(got, SUBAGENTS_BEFORE);
});
+8 -1
View File
@@ -11,7 +11,7 @@ import test from "node:test";
import assert from "node:assert/strict";
import fs from "node:fs";
import path from "node:path";
import { pageSuite, openSession, itemCard, drawn, textOf, tempProject , fillBox, boxValue, sendAsk, styleOf } from "./page-test-helpers.mjs";
import { pageSuite, openSession, itemCard, drawn, textOf, tempProject , fillBox, boxValue, sendAsk, styleOf, quiet } from "./page-test-helpers.mjs";
import { cli, until, HOME } from "./web-console-test-helpers.mjs";
import { STOP_HANDOFF_REPLY, HOME_REPLY } from "../src/web-console/public/answers.js";
import { CHAT_OFFLINE_TEXT } from "../src/web-console/public/chat.js";
@@ -818,6 +818,10 @@ test("the quiet, not running and not connected lines offer What to check, openin
// Answered and sent, never collected, and nobody listening: the saved line.
await s.page.clock.setSystemTime(Date.now());
s.post({ agent: { status: "waiting" } });
// The post redraws the question: an answer typed before that redraw lands is lost with the
// old box, and Send then stays off. Wait for the page to show the post and go quiet.
await lineSays(s, /^Your turn: 1 question waiting\./);
await quiet(s.page);
await fillBox(itemCard(s.page, "q1").locator(".md-host, input[type=text]").first(), "audit-export");
await s.page.click("#btn-send");
await lineSays(s, /^Sent\. Waiting for Plan2Code\./);
@@ -1156,6 +1160,9 @@ async function strandedFinish(t, opts) {
const main = s.page.locator("#main");
await main.getByRole("button", { name: "Review it now" }).click();
await main.getByRole("button", { name: "Review requested…" }).waitFor();
// Let the page hear the press is saved while it is still fresh, as it does for a person:
// the way out then has to appear by time alone, with no frame to draw it.
await quiet(s.page, { quietMs: 1000 });
await s.page.clock.fastForward(200_000);
await s.page.waitForFunction(() => document.body.innerText.includes("Plan2Code is not running"));
return { s, main };
+6 -5
View File
@@ -14,15 +14,16 @@
"install": {
"win": [
{ "label": "PowerShell", "run": "irm https://claude.ai/install.ps1 | iex" },
{ "label": "npm", "run": "npm install -g @anthropic-ai/claude-code", "note": "Needs Node.js 22 or later" }
{ "label": "CMD", "run": "curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd" },
{ "label": "npm", "run": "npm install -g @anthropic-ai/claude-code@latest", "note": "Needs Node.js 22 or later" }
],
"mac": [
{ "label": "Terminal", "run": "curl -fsSL https://claude.ai/install.sh | bash" },
{ "label": "npm", "run": "npm install -g @anthropic-ai/claude-code", "note": "Needs Node.js 22 or later" }
{ "label": "npm", "run": "npm install -g @anthropic-ai/claude-code@latest", "note": "Needs Node.js 22 or later" }
],
"linux": [
{ "label": "Terminal", "run": "curl -fsSL https://claude.ai/install.sh | bash" },
{ "label": "npm", "run": "npm install -g @anthropic-ai/claude-code", "note": "Needs Node.js 22 or later" }
{ "label": "npm", "run": "npm install -g @anthropic-ai/claude-code@latest", "note": "Needs Node.js 22 or later" }
]
},
"installDirs": {
@@ -103,7 +104,7 @@
"name": "OpenCode",
"kind": "template",
"command": "opencode",
"prompt": "Use the plan2code skill",
"prompt": "@plan2code",
"args": ["{model}", "--prompt", "{prompt}"],
"bypassArgs": ["--auto"],
"modelArgs": ["--model", "{model}"]
@@ -117,7 +118,7 @@
"args": ["{model}", "{prompt}"],
"bypassArgs": ["--approval-mode=yolo"],
"modelArgs": ["--model", "{model}"],
"note": "For Google AI Pro and Ultra accounts and free Gemini Code Assist for individuals, Gemini CLI was replaced by Antigravity CLI on June 18, 2026; Standard and Enterprise licenses and paid API keys are unaffected."
"note": "For Google AI Pro and Ultra accounts, free Gemini Code Assist for individuals and Gemini Code Assist for GitHub, Gemini CLI was replaced by Antigravity CLI on June 18, 2026; Standard and Enterprise licenses and paid API keys are unaffected."
},
{
"id": "pi",
+46 -34
View File
@@ -15,7 +15,7 @@
},
{
"id": "haiku",
"label": "latest Haiku"
"label": "fast and efficient Haiku"
},
{
"id": "opusplan",
@@ -23,7 +23,7 @@
},
{
"id": "fable",
"label": "latest Fable"
"label": "Fable for your hardest tasks"
},
{
"id": "best",
@@ -79,22 +79,6 @@
"id": "gpt-6-luna-high",
"label": "GPT-6 Luna High Thinking"
},
{
"id": "gemini-3-8-flash-low",
"label": "Gemini 3.8 Flash Low"
},
{
"id": "gemini-3-8-flash-medium",
"label": "Gemini 3.8 Flash Medium"
},
{
"id": "gemini-3-8-flash-high",
"label": "Gemini 3.8 Flash High"
},
{
"id": "glm-5-3-low",
"label": "GLM-5.3 Low"
},
{
"id": "glm-5-3-high",
"label": "GLM-5.3 High"
@@ -115,18 +99,6 @@
"id": "claude-haiku-5-5-high",
"label": "Claude Haiku 5.5 High"
},
{
"id": "claude-fable-5-1-low",
"label": "Claude Fable 5.1 Low"
},
{
"id": "claude-fable-5-1-medium",
"label": "Claude Fable 5.1 Medium"
},
{
"id": "claude-fable-5-1-high",
"label": "Claude Fable 5.1 High"
},
{
"id": "gpt-6-astra-low",
"label": "GPT-6 Astra Low Thinking"
@@ -139,13 +111,45 @@
"id": "gpt-6-astra-high",
"label": "GPT-6 Astra High Thinking"
},
{
"id": "swe-2-flash-medium",
"label": "SWE-2 Flash Medium"
},
{
"id": "swe-2-flash-high",
"label": "SWE-2 Flash High"
},
{
"id": "claude-fable-5-2-low",
"label": "Claude Fable 5.2 Low"
},
{
"id": "claude-fable-5-2-medium",
"label": "Claude Fable 5.2 Medium"
},
{
"id": "claude-fable-5-2-high",
"label": "Claude Fable 5.2 High"
},
{
"id": "gemini-4-hydrogen-low",
"label": "Gemini 4 Hydrogen Low"
},
{
"id": "gemini-4-hydrogen-medium",
"label": "Gemini 4 Hydrogen Medium"
},
{
"id": "gemini-4-hydrogen-high",
"label": "Gemini 4 Hydrogen High"
},
{
"id": "gemini-4-neon-low",
"label": "Gemini 4 Neon Low"
},
{
"id": "gemini-4-neon-medium",
"label": "Gemini 4 Neon Medium"
},
{
"id": "gemini-4-neon-high",
"label": "Gemini 4 Neon High"
}
],
"codex": [
@@ -164,6 +168,14 @@
{
"id": "gpt-6-luna",
"label": "GPT-6 Luna"
},
{
"id": "gpt-6.2-astra",
"label": "GPT-6.2 Astra"
},
{
"id": "gpt-6.2-sol",
"label": "GPT-6.2 Sol"
}
],
"strengths": {
+5 -1
View File
@@ -1700,6 +1700,7 @@ async function runUpdate({ tag, main, force } = {}) {
}
console.log(ref === undefined ? 'Updating Plan2Code to the newest work on main...' : `Updating Plan2Code to ${ref}...`);
console.log(c.dim('One update covers the skills, the plan2code command and the desktop app (when installed).'));
console.log(c.dim('npx fetches it quietly first, which can take a minute or two.'));
const unreleased = main || (tag !== undefined && !/^v\d+\.\d+\.\d+$/.test(tag));
return runInstaller(['--update', ...(force || unreleased ? ['--force'] : [])], ref);
}
@@ -1745,7 +1746,10 @@ function runInstaller(installerArgs, tag) {
return process.exit(127);
}
const spec = tag ? `git+${REPO_URL}#${tag}` : `git+${REPO_URL}`;
const child = spawnCommand(npx, ['--yes', '--allow-git=all', spec, ...installerArgs], { stdio: 'inherit' });
// The ref was picked on purpose (main included): install.js's release redirect, there for
// launchers older than the release channel, must leave this run where it is.
const env = { ...process.env, PLAN2CODE_INSTALL_REF: tag || 'main' };
const child = spawnCommand(npx, ['--yes', '--allow-git=all', spec, ...installerArgs], { stdio: 'inherit', env });
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
process.on(signal, () => {});
}
+2 -2
View File
@@ -54,7 +54,7 @@ One-line JSON, only what changed; the patch merges (`items`, `topics`, `docs` an
Every item: `id` (new for each question, whole session), `kind`, `title` (2 to 4 plain words), `body` (markdown: the question and why it matters), optional `topic`, `doc`, `required:false` (adds Skip), `token` (`{"A":"approved"}`: the typed word an answer stands for).
- `choice`: `{"id":"q1","kind":"choice","title":"Export format","body":"Which format?","options":[{"text":"CSV","detail":"Opens in Excel","recommended":true},{"text":"JSON","detail":"For scripts"}]}`. Back: `{k}` or `{text}`; `allowOther:false` drops the free-text row.
- `text`: `{"id":"q2","kind":"text","title":"Who uses it","body":"Who, and for what?","placeholder":"For example: reviewers, in Excel every Monday."}`. Back: `{text}`. `pattern` plus `patternHint` checks shape (kebab-case). The placeholder is an offer, so write a whole answer. On the fresh-idea card in Pathfinder, Plan and Quick Task add `"templates":"idea"` (also when the idea came as the argument, with a one-line summary in `placeholder`; a resumed map, PLAN-DRAFT or checkpoint gets no idea card; never mention templates in the terminal); a Notebook tab fills a box marked `"fill":"note"`.
- `text`: `{"id":"q2","kind":"text","title":"Who uses it","body":"Who, and for what?","placeholder":"For example: reviewers, in Excel every Monday."}`. Back: `{text}`. `pattern` plus `patternHint` checks shape (kebab-case). The placeholder is an offer: write a whole answer. On the fresh-idea card in Pathfinder, Plan and Quick Task add `"templates":"idea"` (also when the idea came as the argument, with a one-line summary in `placeholder`; a resumed map, PLAN-DRAFT or checkpoint gets no idea card; never mention templates in the terminal); a Notebook tab fills a box marked `"fill":"note"`.
- `confirm`: `{"id":"q3","kind":"confirm","title":"Keep going","body":"Continue?","yesLabel":"Yes","noLabel":"Not yet"}`. Back: `{yes,text?}`.
- `recap`: `{"id":"q4","kind":"recap","title":"What we heard","body":"Is this right?","summary":"- ..."}`. Back: `{ok,text?}`.
- `menu`: `{"id":"q5","kind":"menu","title":"Next step","body":"What now?","options":[{"text":"Plan it"}],"command":"/plan2code-1-plan"}`. Back: `{k}`.
@@ -65,7 +65,7 @@ Every item: `id` (new for each question, whole session), `kind`, `title` (2 to 4
| `review` | read, then approve | `doc` (required), `summary`, `verdicts:[{id,label,danger?}]`, `nothingYet` (false once the change is on disk) | `{verdict,text?}` |
| `checklist` | steps only they can do | `steps`, `valuesLabel` | `{done?,state?,text?}` |
| `list` | reorder or edit a breakdown | `rows:[{id,title,body}]` | `{rows}` or `{text}` |
| `lessons` | approve noted lessons | `rows`, `opening`, `firstAsk` (from `lessons.mjs list`), `suggested` (row id to a choice: outlined, not picked) | `{decisions}` or `{firstAsk}` |
| `lessons` | approve lessons | `rows`, `opening`, `firstAsk` (`lessons.mjs list`), `suggested` | `{decisions}` or `{firstAsk}` |
| `notice` | read, no answer | none | none |
Items show in the order sent, so send them in answering order.
+9
View File
@@ -2616,6 +2616,7 @@ export function wireChrome() {
// render and nothing was triggering one. Watch the flip and draw the rest.
let wasAdrift = false;
let wasPastGrace = false;
let wasPressStranded = false;
export function startClock() {
setInterval(checkIn, 5000);
@@ -2637,6 +2638,14 @@ export function startClock() {
wasPastGrace = past;
if (page.S) renderFooter();
}
// A finished screen's press goes stranded by time alone, with no frame to say so: draw
// the card again so its way out (Start a New Session, or the command) appears with the
// status line that names it.
const strandedNow = pressStranded();
if (strandedNow !== wasPressStranded) {
wasPressStranded = strandedNow;
if (page.S) render();
}
// The agent coming or going changes whether the chat can be used, with no
// frame to say so: redraw the Ask pane when that flips. Even mid-typing:
// the draft is saved on every keystroke and withFocus() keeps the caret,
@@ -116,6 +116,10 @@
/* Open the lessons: each file under its own name. */
.learn-lessons-file + .learn-lessons-file { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.learn-lessons-name { margin: 0 0 6px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-3); }
/* Each file's own .md block would keep the page-wide 68ch cap; let it fill the dialog.
A lesson's title is a long heading: balanced wrapping (tokens.css) halves it, so fill each line. */
.learn-lessons-file .md { max-width: none; }
.learn-lessons-file .md-h { text-wrap: wrap; }
/* The lessons card (cards.js buildLessons): one block per item, none chosen at first. */
.lessons-opening { margin: 14px 0 0; font-size: var(--fs-md); color: var(--ink-3); }
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "Plan2Code",
"version": "3.1.1",
"version": "3.1.4",
"description": "A structured workflow of six steps (Pathfinder, Plan, Document, Implement, Review, Finalize) for AI-assisted software development",
"keywords": [
"ai",
@@ -17,6 +17,6 @@
"url": "https://github.com/jparkerweb/plan2code"
},
"homepage": "https://github.com/jparkerweb/plan2code",
"releaseDate": "2026-11-18",
"releaseDate": "2026-11-20",
"mode": "utility"
}