<feed xmlns='http://www.w3.org/2005/Atom'>
<title>superpowers.git/tests/brainstorm-server/lifecycle.test.js, branch dev</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): run shell helpers without a login shell</title>
<updated>2026-09-27T02:28:19+00:00</updated>
<author>
<name>Jesse Vincent</name>
<email>jesse@primeradiant.com</email>
</author>
<published>2026-09-27T02:28:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=a0415daa1f33b00f3fe300f5c250a5beefafce4d'/>
<id>a0415daa1f33b00f3fe300f5c250a5beefafce4d</id>
<content type='text'>
The lifecycle tests ran their helpers with `bash -lc`, so anything a
login profile prints landed in captured output (a path from mktemp,
the newest session dir) and broke the test. Plain `bash -c` keeps the
helpers independent of the user's shell setup. Fixes #2190.

From #2192 by @tugrulguner.

Co-authored-by: tugrulguner &lt;47668043+tugrulguner@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The lifecycle tests ran their helpers with `bash -lc`, so anything a
login profile prints landed in captured output (a path from mktemp,
the newest session dir) and broke the test. Plain `bash -c` keeps the
helpers independent of the user's shell setup. Fixes #2190.

From #2192 by @tugrulguner.

Co-authored-by: tugrulguner &lt;47668043+tugrulguner@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix companion stop metadata and token permissions</title>
<updated>2026-06-16T17:09:46+00:00</updated>
<author>
<name>Drew Ritter</name>
<email>drew@primeradiant.com</email>
</author>
<published>2026-06-11T17:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=3a907d6a0a033eee1f6a3abce27fe97dbc2133e4'/>
<id>3a907d6a0a033eee1f6a3abce27fe97dbc2133e4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Windows lifecycle validation</title>
<updated>2026-06-16T17:09:46+00:00</updated>
<author>
<name>Drew Ritter</name>
<email>drew@primeradiant.com</email>
</author>
<published>2026-06-11T03:09:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=2a8479b21d88e1b7c17f86290c531742092d1ae4'/>
<id>2a8479b21d88e1b7c17f86290c531742092d1ae4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Isolate companion fallback tokens</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:39:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=8f2525a80324106802d447af4f4dbae649dd4be6'/>
<id>8f2525a80324106802d447af4f4dbae649dd4be6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Harden companion Windows lifecycle coverage</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Drew Ritter</name>
<email>drew@primeradiant.com</email>
</author>
<published>2026-06-10T23:23:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=69270c9007d9f68ab2ea8867eff409fbcff58dd6'/>
<id>69270c9007d9f68ab2ea8867eff409fbcff58dd6</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>fix(brainstorm-server): address adversarial review findings</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Jesse Vincent</name>
<email>jesse@primeradiant.com</email>
</author>
<published>2026-06-09T22:59:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=fb08947dedcb206dc783188951c17f18a0cbc399'/>
<id>fb08947dedcb206dc783188951c17f18a0cbc399</id>
<content type='text'>
From a two-reviewer adversarial pass:

- [High] EADDRINUSE fallback clobbered the shared .last-port: onListen wrote the
  bound port unconditionally, so a fallback to a random port overwrote the
  preferred port another live session still owns — stranding that session's open
  tab forever. Now persist only when we bound the preferred port (not on
  fallback). The fallback test now asserts .last-port integrity (teeth-verified).

- [Medium] maybeOpenBrowser ran the URL through a shell (exec + JSON.stringify),
  which does NOT neutralize $(...) in a url-host. Platform launchers now use
  execFile with the URL as an argv element (no shell). The operator-set
  BRAINSTORM_OPEN_CMD path stays shell-based (trusted input).

- [Medium] --open was a silent no-op on native Windows (no win32 branch). Added.

- [Medium] helper.js reconnect/status/tombstone had only substring-grep tests.
  Added behavioral tests driving the state machine against a mocked browser:
  Reconnecting+backoff (500-&gt;1000-&gt;2000), tombstone after the grace period, and
  reload-on-recovery.

- [Low] status pill showed a false 'Connected' before the socket opened; now
  starts 'Connecting…' until onopen.

Not changed (flagged): stop-server.sh's PID-ownership check still matches any
'node ... server.cjs' (narrow residual — a recycled PID onto an unrelated node
server.cjs); robust fix needs fragile cross-platform process introspection.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From a two-reviewer adversarial pass:

- [High] EADDRINUSE fallback clobbered the shared .last-port: onListen wrote the
  bound port unconditionally, so a fallback to a random port overwrote the
  preferred port another live session still owns — stranding that session's open
  tab forever. Now persist only when we bound the preferred port (not on
  fallback). The fallback test now asserts .last-port integrity (teeth-verified).

- [Medium] maybeOpenBrowser ran the URL through a shell (exec + JSON.stringify),
  which does NOT neutralize $(...) in a url-host. Platform launchers now use
  execFile with the URL as an argv element (no shell). The operator-set
  BRAINSTORM_OPEN_CMD path stays shell-based (trusted input).

- [Medium] --open was a silent no-op on native Windows (no win32 branch). Added.

- [Medium] helper.js reconnect/status/tombstone had only substring-grep tests.
  Added behavioral tests driving the state machine against a mocked browser:
  Reconnecting+backoff (500-&gt;1000-&gt;2000), tombstone after the grace period, and
  reload-on-recovery.

- [Low] status pill showed a false 'Connected' before the socket opened; now
  starts 'Connecting…' until onopen.

Not changed (flagged): stop-server.sh's PID-ownership check still matches any
'node ... server.cjs' (narrow residual — a recycled PID onto an unrelated node
server.cjs); robust fix needs fragile cross-platform process introspection.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(brainstorm-server): opt-in auto-open of the browser on the first screen</title>
<updated>2026-06-16T17:09:45+00:00</updated>
<author>
<name>Jesse Vincent</name>
<email>jesse@primeradiant.com</email>
</author>
<published>2026-06-09T22:26:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/superpowers.git/commit/?id=463dfb7fd4737e51c2a17d5beae6b4e510f88b6f'/>
<id>463dfb7fd4737e51c2a17d5beae6b4e510f88b6f</id>
<content type='text'>
When the user approves the visual companion, open their browser automatically the
first time a screen is actually ready to show — rather than at startup (just the
waiting page) or making them open the URL by hand.

Opt-in and gated on approval: off unless BRAINSTORM_OPEN is set (start-server.sh
--open, which the agent passes only after the user agrees to use the companion).
Even then it fires once, and is skipped if a browser is already connected, on a
non-loopback/remote bind, or when headless. Launcher is the platform default
(open / xdg-open / WSL cmd.exe) or BRAINSTORM_OPEN_CMD; best-effort, never fatal.

lifecycle.test.js: opens once on the first screen when approved; does NOT open
without approval.

Closes #755
Refs #759
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the user approves the visual companion, open their browser automatically the
first time a screen is actually ready to show — rather than at startup (just the
waiting page) or making them open the URL by hand.

Opt-in and gated on approval: off unless BRAINSTORM_OPEN is set (start-server.sh
--open, which the agent passes only after the user agrees to use the companion).
Even then it fires once, and is skipped if a browser is already connected, on a
non-loopback/remote bind, or when headless. Launcher is the platform default
(open / xdg-open / WSL cmd.exe) or BRAINSTORM_OPEN_CMD; best-effort, never fatal.

lifecycle.test.js: opens once on the first screen when approved; does NOT open
without approval.

Closes #755
Refs #759
</pre>
</div>
</content>
</entry>
</feed>
