<feed xmlns='http://www.w3.org/2005/Atom'>
<title>superpowers.git/tests/brainstorm-server/server.test.js, branch codex-sync-excludes-and-porting-examples</title>
<subtitle>Agentic skills framework and development workflow
</subtitle>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/'/>
<entry>
<title>test(brainstorm-server): stop orphaning the server when a test fails</title>
<updated>2026-09-26T19:32:23+00:00</updated>
<author>
<name>Jesse Vincent</name>
<email>jesse@primeradiant.com</email>
</author>
<published>2026-09-26T19:32:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=bccb109316827b98f7c8676db1140cedbc207394'/>
<id>bccb109316827b98f7c8676db1140cedbc207394</id>
<content type='text'>
process.exit(1) ran inside the try, so the finally that kills the
spawned server never ran. The leftover server held port 3334 and the
next run died with 'preferred port is in use'. Set process.exitCode
instead so teardown runs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
process.exit(1) ran inside the try, so the finally that kills the
spawned server never ran. The leftover server held port 3334 and the
next run died with 'preferred port is in use'. Set process.exitCode
instead so teardown runs.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(brainstorming): preserve literal content replacement tokens (#2364)</title>
<updated>2026-09-26T19:28:21+00:00</updated>
<author>
<name>落尘</name>
<email>cuidong111@gmail.com</email>
</author>
<published>2026-09-26T19:28:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=ddd35ab181073c792781bcdfd646d73cf48e4d44'/>
<id>ddd35ab181073c792781bcdfd646d73cf48e4d44</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add visual companion Prime Radiant branding</title>
<updated>2026-06-16T17:09:47+00:00</updated>
<author>
<name>Drew Ritter</name>
<email>drew@primeradiant.com</email>
</author>
<published>2026-06-15T23:32:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=b3ee712d3a68b604b3f36d872c7ec91501197dcb'/>
<id>b3ee712d3a68b604b3f36d872c7ec91501197dcb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix server test fallback cleanup</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Drew Ritter</name>
<email>drew@primeradiant.com</email>
</author>
<published>2026-06-11T01:33:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=85914fbcf89602a966989db673636f391aa355e1'/>
<id>85914fbcf89602a966989db673636f391aa355e1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Harden root screen containment</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Drew Ritter</name>
<email>drew@primeradiant.com</email>
</author>
<published>2026-06-11T01:25:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=04106797576d0caa9daecab7d4681d21addfbcf7'/>
<id>04106797576d0caa9daecab7d4681d21addfbcf7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Harden brainstorm companion auth regressions</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Drew Ritter</name>
<email>drew@primeradiant.com</email>
</author>
<published>2026-06-10T21:58:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=b17d54f839831b2345aa389e2f65f435f3a82867'/>
<id>b17d54f839831b2345aa389e2f65f435f3a82867</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(brainstorm-server): fix auth-integration bugs from full-branch review</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Jesse Vincent</name>
<email>jesse@primeradiant.com</email>
</author>
<published>2026-06-10T02:13:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=7fbae0252fe90778ce0c06fde3bf5f87aa396fc2'/>
<id>7fbae0252fe90778ce0c06fde3bf5f87aa396fc2</id>
<content type='text'>
A second adversarial review of the merged branch found that combining the
session-key auth with the feature work created real bugs the (vacuous) tests
missed:

- [Critical] GET /files/ (empty name) resolved to CONTENT_DIR and crashed the
  process with uncaught EISDIR — newly reachable because the query-stripping
  refactor turns /files/?key=... into /files/. Reject non-regular-file names.
- [High] --open opened a KEYLESS url, which the auth gate 403s — the headline
  feature landed on the error page. Open the keyed url.
- [High] Same-port restart regenerated the token (port persisted, token not), so
  the open tab's old cookie 403'd and never reconnected — contradicting the
  documented promise. Persist the token (BRAINSTORM_TOKEN_FILE / .last-token)
  alongside the port.
- [Medium] Token sat in world-readable server-info/server.log (0644 in /tmp).
  umask 077 in start-server.sh + mode 0600 on server-info/.last-token.
- [Medium] touchActivity() ran before the auth check, so unauthenticated requests
  defeated the idle timeout. Count activity only after authorization.
- [Low] COOKIE_NAME embedded the pre-fallback port; derive it from the actual
  bound port (also prevents a cross-server cookie-jar collision on fallback).

Tests added/strengthened (previously passed vacuously): /files/ no-crash; the
auto-open url carries the key and is reachable (200); restart reuses the same key
not just the port; unauthenticated requests don't reset the idle clock.
Full suite green (ws-protocol 32, helper 12, auth 13, server 29, lifecycle 8,
stop-server 4); restart smoke confirms same port+key and old URL -&gt; 200.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A second adversarial review of the merged branch found that combining the
session-key auth with the feature work created real bugs the (vacuous) tests
missed:

- [Critical] GET /files/ (empty name) resolved to CONTENT_DIR and crashed the
  process with uncaught EISDIR — newly reachable because the query-stripping
  refactor turns /files/?key=... into /files/. Reject non-regular-file names.
- [High] --open opened a KEYLESS url, which the auth gate 403s — the headline
  feature landed on the error page. Open the keyed url.
- [High] Same-port restart regenerated the token (port persisted, token not), so
  the open tab's old cookie 403'd and never reconnected — contradicting the
  documented promise. Persist the token (BRAINSTORM_TOKEN_FILE / .last-token)
  alongside the port.
- [Medium] Token sat in world-readable server-info/server.log (0644 in /tmp).
  umask 077 in start-server.sh + mode 0600 on server-info/.last-token.
- [Medium] touchActivity() ran before the auth check, so unauthenticated requests
  defeated the idle timeout. Count activity only after authorization.
- [Low] COOKIE_NAME embedded the pre-fallback port; derive it from the actual
  bound port (also prevents a cross-server cookie-jar collision on fallback).

Tests added/strengthened (previously passed vacuously): /files/ no-crash; the
auto-open url carries the key and is reachable (200); restart reuses the same key
not just the port; unauthenticated requests don't reset the idle clock.
Full suite green (ws-protocol 32, helper 12, auth 13, server 29, lifecycle 8,
stop-server 4); restart smoke confirms same port+key and old URL -&gt; 200.
</pre>
</div>
</content>
</entry>
<entry>
<title>test(brainstorm-server): thread session key through tests after auth merge</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Jesse Vincent</name>
<email>jesse@primeradiant.com</email>
</author>
<published>2026-06-10T01:33:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=01de36703dcef42c9c5c5eafa840fb6cd8bcb29a'/>
<id>01de36703dcef42c9c5c5eafa840fb6cd8bcb29a</id>
<content type='text'>
Integrating the per-session-key auth onto the same branch as the dotfile and
lifecycle work: two tests added after the auth commit opened WebSockets without a
key (server.test.js dotfile-reload, lifecycle.test.js idle-shutdown), which the
auth gate now resets. Pass ?key=/BRAINSTORM_TOKEN in both. Full suite green:
ws-protocol 32, helper 12, auth 13, server 28, lifecycle 7, stop-server 4.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Integrating the per-session-key auth onto the same branch as the dotfile and
lifecycle work: two tests added after the auth commit opened WebSockets without a
key (server.test.js dotfile-reload, lifecycle.test.js idle-shutdown), which the
auth gate now resets. Pass ?key=/BRAINSTORM_TOKEN in both. Full suite green:
ws-protocol 32, helper 12, auth 13, server 28, lifecycle 7, stop-server 4.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(brainstorm-server): gate every endpoint behind a per-session key</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Jesse Vincent</name>
<email>jesse@primeradiant.com</email>
</author>
<published>2026-06-09T19:22:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=cb5bb885fd7cf00a1820f20d922df06ec02d4bed'/>
<id>cb5bb885fd7cf00a1820f20d922df06ec02d4bed</id>
<content type='text'>
The companion server is reachable by any local browser tab (default loopback
bind) and by any host that can route to it (remote --host bind). It served
screens, files, and accepted event-injecting WebSocket connections with no
authentication, so a malicious browser tab or a direct remote client could read
brainstorm content or inject events that the agent reads as the user's input
(prompt injection into a live session).

Generate a per-session secret token, carry it in the served URL as ?key=, and
mirror it into an HttpOnly SameSite=Strict per-port cookie on first load so
same-origin subresources and the WebSocket handshake authenticate automatically.
Every HTTP request and WebSocket upgrade now requires a valid key (query or
cookie, constant-time compared); unauthenticated requests get a friendly 403
explaining they need the full URL. A secret authenticates the client uniformly
across loopback, tunnel, and remote binds and defeats DNS rebinding, which a
Host/Origin allowlist cannot.

Also guard handleMessage against a null JSON payload that crashed the process.

Tests: new auth.test.js (13 cases) covering the key on /, /files/*, and WS plus
cookie bootstrap and the null-payload guard; server.test.js threads the key;
ws-protocol.test.js + auth.test.js wired into npm test.

Closes #1014
Refs #1110, #1553, #1504
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The companion server is reachable by any local browser tab (default loopback
bind) and by any host that can route to it (remote --host bind). It served
screens, files, and accepted event-injecting WebSocket connections with no
authentication, so a malicious browser tab or a direct remote client could read
brainstorm content or inject events that the agent reads as the user's input
(prompt injection into a live session).

Generate a per-session secret token, carry it in the served URL as ?key=, and
mirror it into an HttpOnly SameSite=Strict per-port cookie on first load so
same-origin subresources and the WebSocket handshake authenticate automatically.
Every HTTP request and WebSocket upgrade now requires a valid key (query or
cookie, constant-time compared); unauthenticated requests get a friendly 403
explaining they need the full URL. A secret authenticates the client uniformly
across loopback, tunnel, and remote binds and defeats DNS rebinding, which a
Host/Origin allowlist cannot.

Also guard handleMessage against a null JSON payload that crashed the process.

Tests: new auth.test.js (13 cases) covering the key on /, /files/*, and WS plus
cookie bootstrap and the null-payload guard; server.test.js threads the key;
ws-protocol.test.js + auth.test.js wired into npm test.

Closes #1014
Refs #1110, #1553, #1504
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(brainstorm-server): ignore macOS resource-fork dotfiles</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Jesse Vincent</name>
<email>jesse@primeradiant.com</email>
</author>
<published>2026-06-09T21:53:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=2b108b7dc2896df01a58384a3ff46e71ba04e9e2'/>
<id>2b108b7dc2896df01a58384a3ff46e71ba04e9e2</id>
<content type='text'>
On macOS (and ExFAT/SMB volumes) the OS writes ._&lt;name&gt;.html sidecar files
holding binary resource-fork metadata. These end with .html, so they passed the
content filter and could be picked as the newest screen — serving binary garbage
to the browser instead of the mockup — or fetched via /files/.

Skip dotfiles (leading '.') at all four sites that list or serve content:
getNewestScreen, the /files/ endpoint, the known-files seed, and the fs.watch
handler. Tests cover serving (/ and /files/) and the watch path (a ._ file must
not trigger a reload).

Refs #950
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On macOS (and ExFAT/SMB volumes) the OS writes ._&lt;name&gt;.html sidecar files
holding binary resource-fork metadata. These end with .html, so they passed the
content filter and could be picked as the newest screen — serving binary garbage
to the browser instead of the mockup — or fetched via /files/.

Skip dotfiles (leading '.') at all four sites that list or serve content:
getNewestScreen, the /files/ endpoint, the known-files seed, and the fs.watch
handler. Tests cover serving (/ and /files/) and the watch path (a ._ file must
not trigger a reload).

Refs #950
</pre>
</div>
</content>
</entry>
</feed>
