diff --git a/.agents-docs/AGENTS-development-commands.md b/.agents-docs/AGENTS-development-commands.md index d9a0893..ce66039 100644 --- a/.agents-docs/AGENTS-development-commands.md +++ b/.agents-docs/AGENTS-development-commands.md @@ -4,10 +4,12 @@ ## Common Commands ```bash -# Install dev dependencies (sets up husky pre-commit hooks only; each sub-package -# below needs its own npm install. Running `npm test` needs Node 20+; users of +# Install dev dependencies, then turn on the husky pre-commit hooks, once per clone. Never put +# this in a `prepare` script: the install ref publisher refuses it, since npm would install +# every dev dependency on each user's machine. (Each sub-package below needs its own npm install. Running `npm test` needs Node 20+; users of # the installed skills still need only Node 18+) npm install +npm run setup:hooks # Run the interactive installer node install.js diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml index a4be40a..6403905 100644 --- a/.github/workflows/release-app.yml +++ b/.github/workflows/release-app.yml @@ -193,7 +193,7 @@ jobs: # The README's first install is `npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release`, so new users # get the newest release and never a half-finished main, and exact updates fetch the # immutable `install-vX.Y.Z` tag. scripts/publish-install-refs.mjs builds one synthetic - # commit holding only the runtime payload (install.js, package.json, version.json, src/) + # commit holding only the runtime payload (install.js, package.json, version.json, LICENSE, NOTICE, src/) # and a manifest binding it to this tag, then pushes it to both refs in one atomic push. # Last step, after the release is public: a failure earlier leaves both refs on the # previous release. Fast-forward only (no --force), and an existing install tag is never diff --git a/CHANGELOG.md b/CHANGELOG.md index e426973..9425480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to Plan2Code will be documented in this file. +## v3.2.5 (2026-12-03) + +### ๐Ÿ”ง Changed + +- **Installer**: the slim install refs also carry `LICENSE` and `NOTICE`. +- **For contributors**: run `npm run setup:hooks` once after `npm install` to turn on the pre-commit hooks; the `prepare` script that did it is gone. + +### ๐Ÿ› Fixed + +- **Installer**: the slim install refs announced in v3.2.4 were not published with it, because the release step refuses a `package.json` with a `prepare` script, so first installs kept getting v3.2.3. `npm test` now checks the real `package.json` for such scripts. + ## v3.2.4 (2026-12-03) ### โœจ Added diff --git a/README.md b/README.md index faa6605..d49a4b7 100644 --- a/README.md +++ b/README.md @@ -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.2.4 ยท Apache 2.0 ยท ๐Ÿ“– [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com) +Version 3.2.5 ยท Apache 2.0 ยท ๐Ÿ“– [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com) --- @@ -128,7 +128,7 @@ cd plan2code node install.js # Only if you plan to modify or contribute to Plan2Code itself -npm install && npx husky +npm install && npm run setup:hooks ``` diff --git a/package.json b/package.json index c6d0eb7..b877d6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plan2code", - "version": "3.2.4", + "version": "3.2.5", "private": true, "license": "Apache-2.0", "engines": { @@ -10,7 +10,7 @@ "plan2code-install": "./install.js" }, "scripts": { - "prepare": "husky", + "setup:hooks": "husky", "build:skills": "node install.js --build-skills", "fix:eol": "node scripts/fix-line-endings.mjs", "set-version": "node scripts/set-version.mjs", diff --git a/plan2code-app/Cargo.lock b/plan2code-app/Cargo.lock index c098a4f..12e3ba2 100644 --- a/plan2code-app/Cargo.lock +++ b/plan2code-app/Cargo.lock @@ -957,7 +957,7 @@ dependencies = [ [[package]] name = "fake-agent" -version = "3.2.4" +version = "3.2.5" dependencies = [ "serde_json", "terminal_size", @@ -2647,7 +2647,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" [[package]] name = "plan2code-app" -version = "3.2.4" +version = "3.2.5" dependencies = [ "chrono", "libc", diff --git a/plan2code-app/fake-agent/Cargo.toml b/plan2code-app/fake-agent/Cargo.toml index aad2895..d311254 100644 --- a/plan2code-app/fake-agent/Cargo.toml +++ b/plan2code-app/fake-agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fake-agent" -version = "3.2.4" +version = "3.2.5" description = "A stand-in agent program for the Plan2Code app's tests" edition = "2021" publish = false diff --git a/plan2code-app/package-lock.json b/plan2code-app/package-lock.json index 74cce4b..6f7b9f3 100644 --- a/plan2code-app/package-lock.json +++ b/plan2code-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "plan2code-app", - "version": "3.2.4", + "version": "3.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "plan2code-app", - "version": "3.2.4", + "version": "3.2.5", "dependencies": { "@tauri-apps/api": "2.12.4", "@xterm/addon-fit": "0.11.0", diff --git a/plan2code-app/package.json b/plan2code-app/package.json index 67e84e2..7bf30b8 100644 --- a/plan2code-app/package.json +++ b/plan2code-app/package.json @@ -1,6 +1,6 @@ { "name": "plan2code-app", - "version": "3.2.4", + "version": "3.2.5", "private": true, "description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.", "scripts": { diff --git a/plan2code-app/src-tauri/Cargo.toml b/plan2code-app/src-tauri/Cargo.toml index 7827a54..d14f113 100644 --- a/plan2code-app/src-tauri/Cargo.toml +++ b/plan2code-app/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "plan2code-app" -version = "3.2.4" +version = "3.2.5" description = "Plan2Code desktop app" edition = "2021" publish = false diff --git a/plan2code-app/src-tauri/tauri.conf.json b/plan2code-app/src-tauri/tauri.conf.json index e980cb4..fb3e24f 100644 --- a/plan2code-app/src-tauri/tauri.conf.json +++ b/plan2code-app/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Plan2Code", - "version": "3.2.4", + "version": "3.2.5", "identifier": "com.plan2code.desktop", "build": { "frontendDist": "../ui", diff --git a/scripts/install-e2e-fixture.mjs b/scripts/install-e2e-fixture.mjs index 5c18b16..0986658 100644 --- a/scripts/install-e2e-fixture.mjs +++ b/scripts/install-e2e-fixture.mjs @@ -57,6 +57,8 @@ export function compactRuntimeFiles(version) { "install.js": readRepo("install.js"), "package.json": `${JSON.stringify(pkg, null, 2)}\n`, "version.json": `${JSON.stringify(versionJson, null, 2)}\n`, + "LICENSE": readRepo("LICENSE"), + "NOTICE": readRepo("NOTICE"), }; for (const rel of walkFiles(path.join(ROOT, "src"), path.join(ROOT, "src"))) { diff --git a/scripts/publish-install-refs.mjs b/scripts/publish-install-refs.mjs index 0b65966..9878ece 100644 --- a/scripts/publish-install-refs.mjs +++ b/scripts/publish-install-refs.mjs @@ -1,7 +1,7 @@ #!/usr/bin/env node // Publishes the slim install refs of one release: a synthetic commit whose tree -// holds only the runtime payload (install.js, package.json, version.json and -// src/) plus a binding manifest, pushed once as the immutable +// holds only the runtime payload (install.js, package.json, version.json, LICENSE, +// NOTICE and src/) plus a binding manifest, pushed once as the immutable // `refs/tags/install-vX.Y.Z` and as the new fast-forward tip of // `refs/heads/release`. Dev-only: lives in scripts/ so it never ships inside a // skill or the runtime payload it assembles. @@ -26,7 +26,7 @@ import { fileURLToPath } from "node:url"; export const INSTALL_REF_MANIFEST = ".plan2code-install-ref.json"; // The package scripts that make npm prepare a git dependency with a full dev install (pacote). -const GIT_DEP_LIFECYCLE = new Set(["prepare", "build", "install", "preinstall", "postinstall", "prepack"]); +export const GIT_DEP_LIFECYCLE = new Set(["prepare", "build", "install", "preinstall", "postinstall", "prepack"]); export const RELEASE_BRANCH_REF = "refs/heads/release"; export const REMOTE = "origin"; const TAG_SHAPE = /^v(\d+\.\d+\.\d+)$/; @@ -40,7 +40,7 @@ const TAG_SHAPE = /^v(\d+\.\d+\.\d+)$/; * required on top of these (`workflowSkillSources()`). */ export const RUNTIME_PAYLOAD = Object.freeze({ - files: Object.freeze(["install.js", "package.json", "version.json"]), + files: Object.freeze(["install.js", "package.json", "version.json", "LICENSE", "NOTICE"]), prefixes: Object.freeze(["src/"]), excludedSegments: Object.freeze(["node_modules", ".git", "fixtures", "__fixtures__"]), forbiddenTopLevel: Object.freeze([ @@ -58,6 +58,8 @@ export const RUNTIME_PAYLOAD = Object.freeze({ "install.js", "package.json", "version.json", + "LICENSE", + "NOTICE", "src/launcher/plan2code.js", "src/web-console/update-check.mjs", "src/web-console/console.mjs", diff --git a/scripts/test-publish-install-refs.mjs b/scripts/test-publish-install-refs.mjs index 013f43a..a13da52 100644 --- a/scripts/test-publish-install-refs.mjs +++ b/scripts/test-publish-install-refs.mjs @@ -20,6 +20,7 @@ import { execFileSync, spawnSync } from "node:child_process"; import { ROOT, scrubbedEnv } from "./skill-script-helpers.mjs"; import { + GIT_DEP_LIFECYCLE, INSTALL_REF_MANIFEST, RUNTIME_PAYLOAD, runtimePayloadAllowlist, @@ -67,6 +68,8 @@ function runtimeTree(version) { "install.js": { content: INSTALL_JS }, "package.json": { content: json({ name: "plan2code", version }) }, "version.json": { content: json({ name: "Plan2Code", version, releaseDate: "2026-12-01" }) }, + "LICENSE": { content: "license\n" }, + "NOTICE": { content: "notice\n" }, "src/launcher/plan2code.js": { content: `#!/usr/bin/env node\n// launcher ${version}\n`, mode: "100755" }, "src/web-console/update-check.mjs": { content: `// update-check ${version}\n` }, "src/web-console/console.mjs": { content: `// console ${version}\n` }, @@ -196,7 +199,7 @@ const indexHash = (fx) => crypto.createHash("sha256").update(fs.readFileSync(pat test("allowlist: one constant-driven structure of explicit files and prefixes", () => { const allow = runtimePayloadAllowlist(); assert.equal(allow, RUNTIME_PAYLOAD); - assert.deepEqual([...allow.files], ["install.js", "package.json", "version.json"]); + assert.deepEqual([...allow.files], ["install.js", "package.json", "version.json", "LICENSE", "NOTICE"]); assert.deepEqual([...allow.prefixes], ["src/"]); assert.ok(Object.isFrozen(allow) && Object.isFrozen(allow.files) && Object.isFrozen(allow.required)); for (const ok of ["install.js", "src/launcher/plan2code.js", "src/web-console/public/activities/snake.js"]) assert.equal(isAllowedPayloadPath(ok), true, ok); @@ -237,6 +240,14 @@ test("arguments: unknown, missing and malformed arguments print the usage and ex } }); +test("the real repository can be published: no lifecycle script npm would prepare a git package for, and every required file is here", () => { + const root = ROOT; + const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8")); + assert.deepEqual(Object.keys(pkg.scripts || {}).filter((name) => GIT_DEP_LIFECYCLE.has(name)), [], "rename the script: the release run refuses it after the release is public"); + const required = [...RUNTIME_PAYLOAD.required, ...workflowSkillSources(fs.readFileSync(path.join(root, "install.js"), "utf8"))]; + assert.deepEqual(required.filter((rel) => !fs.existsSync(path.join(root, rel))), []); +}); + test("first publication: parents the legacy release tip, pushes one slim commit to both refs", (t) => { const fx = createSource(); t.after(fx.cleanup); diff --git a/version.json b/version.json index fd635a5..4ebbbfb 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "name": "Plan2Code", - "version": "3.2.4", + "version": "3.2.5", "description": "A structured workflow of six steps (Pathfinder, Plan, Document, Implement, Review, Finalize) for AI-assisted software development", "keywords": [ "ai",