Compare commits

...
2 Commits
Author SHA1 Message Date
jparkerwebandClaude Sonnet 5.5 f28d4d592a Run the root npm test suite only by hand in CI, and run the prose checks on every push and pull request
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 10:18:57 -08:00
jparkerwebandClaude Opus 5.5 272e514372 Show the dashboard in the Linux app by dropping Secure from its frame's sign-in cookie, and release 3.0.1
WebKit (the app's web view on Linux and macOS) drops a Secure cookie sent
over plain http://127.0.0.1, so inside the tauri://localhost frame every
request after the sign-in was a 403 and the app showed "its page did not
show in this window". That frame now gets SameSite=Lax; Windows'
tauri.localhost keeps None; Secure, and standalone keeps Strict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 09:50:15 -08:00
14 changed files with 54 additions and 25 deletions

No files matched your search

+7 -7
View File
@@ -19,8 +19,9 @@ concurrency:
# Speed: a pull request runs on Ubuntu only (the cheapest runner) unless it carries the
# `full-matrix` label; pushes to main and manual runs use all three systems. A change that
# touches only the website, the README, the changelog or similar skips the heavy jobs and runs
# the fast `prose` job instead, which keeps the checks that read those files.
# touches only the website, the README, the changelog or similar skips the heavy `app` job. The
# fast `prose` job runs on every push and pull request. The root `npm test` suite does not run on
# pushes or pull requests at all: run it locally, or start `node-tests` by hand.
jobs:
changes:
name: changes
@@ -56,8 +57,6 @@ jobs:
prose:
name: prose checks
needs: changes
if: needs.changes.outputs.code == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
@@ -170,13 +169,14 @@ jobs:
node-tests:
name: npm test (${{ matrix.os }})
needs: changes
if: needs.changes.outputs.code == 'true'
# Manual runs only: run `npm test` on the dev machine before pushing. Start this from the
# Actions tab to check all three systems.
if: github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'full-matrix') && '["ubuntu-latest"]' || '["windows-latest","macos-latest","ubuntu-latest"]') }}
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-node@v4.4.0
+2 -2
View File
@@ -93,11 +93,10 @@ When you make a mistake, get corrected, or discover something about this codebas
## Failure log
- Do not audit `CHANGELOG.md` headings through PowerShell — the emoji come back as `?`. See the gotcha for the correct approach.
- Sync upstream only through `/sync-repo`, and verify its baseline against the real tree before porting: an earlier sync silently skipped a whole upstream release (the `3-implement-review` skill) while the recorded version froze. Update the baseline with `.claude/skills/sync-repo/set-synced.mjs`, never with a shell pipe over the decrypted body.
- Sync upstream only through `/sync-repo`, and verify its baseline against the real tree before porting: an earlier sync silently skipped a whole upstream release (the `3-implement-review` skill) while the recorded version froze. Update the baseline with `.claude/skills/sync-repo/set-synced.mjs`, never with a shell pipe over the decrypted body. Keep plan2code's ticket-free `commit-msg.mjs` (`<subject>`, `AI Assisted`) through every sync: upstream's ticket-from-branch rule was ported by mistake once and removed in v2.6.0.
- After a sync merge, run `npm test` before trusting a "clean" file: when upstream and plan2code fixed the same bug, `git merge-file` keeps both copies without a conflict (a sync once left `let pattern` declared twice in `app.js`, caught only by `parse-check`).
- When extracting upstream files in Git Bash, run `git show <ref>:<path>` with `MSYS_NO_PATHCONV=1` and `C:/` style paths (never `/c/`): path conversion rewrites `origin/main:.readme/x.md` into `origin\main;.readme\x.md`, the show fails, and the merge silently runs against an empty "theirs". Check every extracted file is non-empty before merging.
- After a sync, grep the result for every upstream name the rebrand map can miss (the `/sync-repo` body lists them): the owner slug and company name in any case, the bare brand word inside identifiers and fixtures, and the ticket key followed by anything, not only digits. Each slipped through once: an owner slug in `feedback-payload.mjs` and its test (fixed by hand to `jparkerweb/plan2code`); in v2.7.0 a `KEPT_<BRAND>_ENTRIES` constant, a `<brand>Dir` option, a `"<brand>"` test folder and an owner slug in a git remote URL; in v2.8.0 git board fixtures built as `` `feature/<KEY>-${11000 + i}-…` `` template literals, which a digits-only rewrite to `ABC-<n>` misses. No upstream name may appear in plain text anywhere in this repo.
- Keep plan2code's ticket-free `commit-msg.mjs` (`<subject>`, `AI Assisted`) in every `/sync-repo`: upstream's ticket-from-branch rule was ported by mistake once and removed in v2.6.0.
- When a new first-run dialog is added to the web console, set its seen flag in `scripts/capture-screenshots.mjs`'s `looks.json` too: the Welcome dialog once covered the regenerated dashboard screenshots until `welcomeSeen: true` was added.
- Import `scripts/skill-script-helpers.mjs` in any test that builds git fixtures for a skill script or `git-repo.mjs`: it scrubs the whole test process's git config, so fixtures, imported modules and spawned scripts agree. Mixed configs broke `git plan switch` once (a global `core.autocrlf=true` checked fixtures out with CRLF the scrubbed script read as changed). It also rebuilds `skills/` and prunes any skill folder `install.js` does not list, so register a new skill in `SOURCE_PROMPTS` before running its `scripts/test-script-<name>.mjs` or the script under test vanishes.
- Before deleting a test file that upstream split or removed, diff plan2code's copy against the rebranded upstream base and port the plan2code-only tests: v2.7.0's split of the web console suite would otherwise have dropped seven hardening tests (now in `scripts/test-web-console-hardening.mjs`).
@@ -108,4 +107,5 @@ When you make a mistake, get corrected, or discover something about this codebas
- Bring the Windows folder picker (`picker.mjs`, copied into `src/launcher/plan2code.js`) to the front with an Alt tap before `SetForegroundWindow`, never with `windowsHide`, the owner form's `TopMost`, `HWND_TOPMOST` or `AttachThreadInput`: measured on Windows 11, `SetWindowPos(HWND_TOPMOST)` returns true while the dialog stays non-topmost behind the browser, and only the Alt tap made it the foreground window. Check with `GetForegroundWindow` from a second process, since no test can see it.
- Add any new file or folder Plan2Code writes at the top of `~/.plan2code/` to `KEPT_PLAN2CODE_ENTRIES` in `src/web-console/sessions.mjs` and to the Cleanup test in `scripts/test-web-console-server.mjs`: User Preferences → System → Cleanup offers every other entry there for deletion once it is an hour old, and the desktop app's `app/` and `app.json` were about to be listed.
- When a test checks how `cmd.exe` finds a `.cmd`/`.bat` (current folder before PATH), clear `NoDefaultCurrentDirectoryInExePath` for the run under test (`env_remove` in Rust, `undefined` in a `test-launcher.mjs` `box.run` env): some shells (Claude Code's among them) already set it, and the decoy `.cmd` test for custom agents passed without its fix until it did.
- Never set a `Secure` cookie for the app's `tauri://localhost` frame (Linux and macOS): WebKit drops a Secure cookie sent over plain `http://127.0.0.1`, so every request after the sign-in got a 403 and the Linux app showed "its page did not show in this window" while working on Windows, where WebView2 counts loopback as secure. `cookieSameSite()` in `src/web-console/routes.mjs` sends Lax there and None; Secure only to `tauri.localhost`; check an embed change in a WebKit view, not only Chrome.
- On Windows, treat a console the agent opened as dying with the agent: the app ends the agent's whole Job Object, so a `detached` server goes too, with no `exit` event. A `console.mjs post` still succeeds because it writes the session's files, so it proves nothing about the server; only the window's reconnect brings the page back. Every loop phase ends this way, and a reconnect budget that never refilled once lost the loop's stop card after Phase 3.
+6
View File
@@ -2,6 +2,12 @@
All notable changes to Plan2Code will be documented in this file.
## v3.0.1
### 🐛 Fixed
- **desktop app**: on Linux (and macOS) the dashboard now shows in the app's window instead of "The console is running but its page did not show in this window." The console's sign-in cookie was marked `Secure`, which WebKit drops on a plain `http://127.0.0.1` page, so every request after sign-in was refused. Inside the app on those systems the cookie is now `SameSite=Lax`; Windows and the standalone browser are unchanged.
## v3.0.0
### ✨ Added
+1 -1
View File
@@ -13,7 +13,7 @@ the next engineer all start from the same specs.
One command opens it, every step is a card, and the terminal is always there if you prefer it.
Version 3.0.0 · MIT · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com)
Version 3.0.1 · MIT · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com)
---
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code",
"version": "3.0.0",
"version": "3.0.1",
"private": true,
"bin": {
"plan2code-install": "./install.js"
+2 -2
View File
@@ -757,7 +757,7 @@ dependencies = [
[[package]]
name = "fake-agent"
version = "3.0.0"
version = "3.0.1"
dependencies = [
"serde_json",
"terminal_size",
@@ -2371,7 +2371,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
[[package]]
name = "plan2code-app"
version = "3.0.0"
version = "3.0.1"
dependencies = [
"chrono",
"libc",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "fake-agent"
version = "3.0.0"
version = "3.0.1"
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.0.0",
"version": "3.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "plan2code-app",
"version": "3.0.0",
"version": "3.0.1",
"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.0.0",
"version": "3.0.1",
"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.0.0"
version = "3.0.1"
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.0.0",
"version": "3.0.1",
"identifier": "com.plan2code.desktop",
"build": {
"frontendDist": "../ui",
+9
View File
@@ -86,6 +86,15 @@ test("the session cookie is Strict standalone and None; Secure under embed", asy
assert.match(embedded, /SameSite=None; Secure/);
});
// WebKit (the app on Linux and macOS) drops a Secure cookie sent over plain
// http, so the page in the app's frame got a 403 after the sign-in.
test("the session cookie is Lax and never Secure under the tauri://localhost embed", async () => {
const embedded = await cookieWith("tauri://localhost");
assert.match(embedded, /SameSite=Lax/);
assert.doesNotMatch(embedded, /Secure/);
assert.match(embedded, /HttpOnly/);
});
test("anything but exactly one allowed origin keeps frame-ancestors 'none'", async () => {
const rejected = [
"https://example.com",
+18 -4
View File
@@ -189,19 +189,33 @@ function signIn(req, res, ctx, url) {
const given = url.pathname.slice(3).replace(/\/$/, "");
if (!ctx.token || !timingSafeEq(given, ctx.token)) return send(res, 403, "Not found", "text/plain");
ctx.touch();
// Inside the app's frame the page is cross-site, and SameSite=Strict would
// never be sent back, so embed mode loosens the cookie to None; Secure, which
// loopback counts as a trustworthy origin for. Anywhere else it stays Strict.
res.writeHead(
302,
baseHeaders({
location: "/",
"set-cookie": `${cookieName(ctx)}=${ctx.token}; HttpOnly; ${embedAncestor() === "'none'" ? "SameSite=Strict" : "SameSite=None; Secure"}; Path=/`,
"set-cookie": `${cookieName(ctx)}=${ctx.token}; HttpOnly; ${cookieSameSite(embedAncestor())}; Path=/`,
})
);
return res.end();
}
// The cookie's SameSite (and Secure) for the frame the page is drawn in.
// Standalone it stays Strict. Inside the app's frame the page is cross-site,
// where Strict would never be sent back:
// - WebView2 (Windows, http(s)://tauri.localhost) sends only a None cookie
// into a cross-site frame, and None needs Secure, which Chromium accepts
// over http because it counts loopback as a trustworthy origin.
// - WebKit (Linux and macOS, tauri://localhost) drops a Secure cookie that
// arrives over plain http, so None; Secure never comes back and every
// request after the sign-in is a 403: the app shows "its page did not show
// in this window". Lax, without Secure, is kept and sent there (measured in
// WebKitGTK 2.52 under both its cookie policies).
function cookieSameSite(ancestor) {
if (ancestor === "'none'") return "SameSite=Strict";
if (ancestor === "tauri://localhost") return "SameSite=Lax";
return "SameSite=None; Secure";
}
// The setup session's hand-over: a launcher process opened this session's
// /s/ link in its own web view, then POSTs here so the launcher's setup page
// (the caller's own console) can move that tab to the new session. Only a
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "Plan2Code",
"version": "3.0.0",
"version": "3.0.1",
"description": "A structured 4-step workflow methodology 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-05",
"releaseDate": "2026-11-06",
"mode": "utility"
}