Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c7aefc1
v1.26.5.0 fix wave: gbrain ingest writer (hybrid frontmatter) + gbrai…
garrytan May 7, 2026
f44de36
v1.27.0.0 feat: /setup-gbrain Path 4 (remote MCP) + brain → artifacts…
garrytan May 7, 2026
7b4738b
v1.27.1.0 fix: anti-shortcut clause + gate-tier AskUserQuestion floor…
garrytan May 7, 2026
443bde0
v1.28.0.0 feat: browse --headed/--proxy/--navigate + gstack/llms.txt …
garrytan May 8, 2026
0660547
v1.29.0.0 feat: worktree-aware gbrain code sources via path-hash IDs …
garrytan May 8, 2026
00f966b
v1.30.0.0 fix wave: 21 community PRs + Windows CI extension + codex f…
garrytan May 9, 2026
5d4fe7d
v1.31.0.0 fix: delete AskUserQuestion fallback (root cause of forever…
garrytan May 10, 2026
49cc4ff
v1.31.1.0 fix wave: 3 community PRs (careful BSD sed, codex Step 0 re…
garrytan May 10, 2026
7489506
v1.32.0.0 fix wave: 7 community PRs + 5 gate-eval hardenings (#1431)
garrytan May 11, 2026
d21ba06
v1.33.0.0 feat: /sync-gbrain memory-stage batch-import refactor (D1-D…
garrytan May 12, 2026
1a4f0c9
v1.33.1.0 fix(learnings): token-OR query + task-shaped retrieval in 3…
garrytan May 12, 2026
dc6252d
v1.33.2.0 fix: setup guards against Conductor worktree pollution of g…
garrytan May 12, 2026
0c88517
v1.34.0.0 feat: gstack consumable as submodule (factory-export API + …
garrytan May 13, 2026
386fe51
v1.34.1.0 fix: gstack-update-check resists stale GitHub raw CDN + add…
garrytan May 13, 2026
b9371d7
v1.34.2.0 fix wave: /codex review on CLI 0.130+, /investigate learnin…
garrytan May 14, 2026
40e34de
v1.35.0.0 feat: add /document-generate skill + enhance /document-rele…
garrytan May 14, 2026
e362b0a
v1.37.0.0 feat: split-engine gbrain (remote MCP brain + local PGLite …
garrytan May 15, 2026
3bf4376
v1.38.0.0 fix wave: Windows install hardening + Unicode sanitization …
garrytan May 15, 2026
ea51b45
v1.38.1.0 fix wave: surrogate-safe page captures (#1440), Implementat…
garrytan May 15, 2026
25cf5ed
v1.39.0.0 feat: buildFetchHandler factory unblocks gbrowser submodule…
garrytan May 15, 2026
f589770
v1.39.1.0 feat: EXIT PLAN MODE GATE for plan-mode review skills (#1512)
garrytan May 15, 2026
33cb471
v1.39.2.0 feat: GSTACK_* env-shim for Conductor + gbrain/gstack setup…
garrytan May 16, 2026
026751e
v1.40.0.0 fix wave: gbrain sync hardening (8 community PRs + migratio…
garrytan May 17, 2026
73309ee
Merge branch 'feat/add_ts_for_pi_host' into main
adamtasteslikegood May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/docker/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,26 @@ RUN npx playwright install-deps chromium
# render in DejaVu Sans. playwright install-deps happens to pull this in today,
# but the dep is implicit and could change — install explicitly so upgrades
# can't silently regress rendering.
#
# Xvfb is also installed here so the browse --headed integration tests
# (headed-xvfb, headed-orphan-cleanup) can exercise the Linux container
# auto-spawn path on every CI run. Without Xvfb in the image, the most
# common production --headed path goes untested.
RUN for i in 1 2 3; do \
apt-get update && apt-get install -y --no-install-recommends fonts-liberation fontconfig && break || \
apt-get update && apt-get install -y --no-install-recommends fonts-liberation fontconfig xvfb x11-utils && break || \
(echo "fonts-liberation install retry $i/3"; sleep 10); \
done \
&& fc-cache -f \
&& rm -rf /var/lib/apt/lists/*

# Pre-install dependencies (cached layer — only rebuilds when package.json changes)
COPY package.json /workspace/
# Pre-install dependencies (cached layer — only rebuilds when package.json or
# bun.lock changes). Copy BOTH so install is deterministic and matches local
# resolution. Without bun.lock here, bun install resolved transitive deps
# differently in CI vs local (observed on v1.28.0.0: socks landed but
# smart-buffer + ip-address didn't make it into the cached node_modules).
COPY package.json bun.lock /workspace/
WORKDIR /workspace
RUN bun install && rm -rf /tmp/*
RUN bun install --frozen-lockfile && rm -rf /tmp/*

# Install Playwright Chromium to a shared location accessible by all users
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Workflow Lint
on: [push, pull_request]
jobs:
actionlint:
runs-on: ubuntu-latest
runs-on: ubicloud-standard-8
steps:
- uses: actions/checkout@v4
- uses: rhysd/actionlint@v1.7.11
5 changes: 3 additions & 2 deletions .github/workflows/ci-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ on:
paths:
- '.github/docker/Dockerfile.ci'
- 'package.json'
- 'bun.lock'
# Manual trigger
workflow_dispatch:

jobs:
build:
runs-on: ubicloud-standard-2
runs-on: ubicloud-standard-8
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

# Copy lockfile + package.json into Docker build context
- run: cp package.json .github/docker/
- run: cp package.json bun.lock .github/docker/

- uses: docker/login-action@v3
with:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/evals-periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
build-image:
runs-on: ubicloud-standard-2
runs-on: ubicloud-standard-8
permissions:
contents: read
packages: write
Expand All @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4

- id: meta
run: echo "tag=${{ env.IMAGE }}:${{ hashFiles('.github/docker/Dockerfile.ci', 'package.json') }}" >> "$GITHUB_OUTPUT"
run: echo "tag=${{ env.IMAGE }}:${{ hashFiles('.github/docker/Dockerfile.ci', 'package.json', 'bun.lock') }}" >> "$GITHUB_OUTPUT"

- uses: docker/login-action@v3
with:
Expand All @@ -43,7 +43,7 @@ jobs:
fi

- if: steps.check.outputs.exists == 'false'
run: cp package.json .github/docker/
run: cp package.json bun.lock .github/docker/

- if: steps.check.outputs.exists == 'false'
uses: docker/build-push-action@v6
Expand All @@ -56,7 +56,7 @@ jobs:
${{ env.IMAGE }}:latest

evals:
runs-on: ubicloud-standard-2
runs-on: ubicloud-standard-8
needs: build-image
container:
image: ${{ needs.build-image.outputs.image-tag }}
Expand Down Expand Up @@ -101,10 +101,14 @@ jobs:
echo "TMPDIR=/home/runner/.cache"
} >> "$GITHUB_ENV"

# Recursive copy (cp -r) instead of symlink: bun build resolves a
# file's realpath when looking for sibling deps. See evals.yml for the
# full explanation. cp -al would be faster but /opt and /workspace
# are on different overlay-fs layers, so cross-device hardlink fails.
- name: Restore deps
run: |
if [ -d /opt/node_modules_cache ] && diff -q /opt/node_modules_cache/.package.json package.json >/dev/null 2>&1; then
ln -s /opt/node_modules_cache node_modules
cp -r /opt/node_modules_cache node_modules
else
bun install
fi
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/evals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
jobs:
# Build Docker image with pre-baked toolchain (cached — only rebuilds on Dockerfile/lockfile change)
build-image:
runs-on: ubicloud-standard-2
runs-on: ubicloud-standard-8
permissions:
contents: read
packages: write
Expand All @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4

- id: meta
run: echo "tag=${{ env.IMAGE }}:${{ hashFiles('.github/docker/Dockerfile.ci', 'package.json') }}" >> "$GITHUB_OUTPUT"
run: echo "tag=${{ env.IMAGE }}:${{ hashFiles('.github/docker/Dockerfile.ci', 'package.json', 'bun.lock') }}" >> "$GITHUB_OUTPUT"

- uses: docker/login-action@v3
with:
Expand All @@ -43,7 +43,7 @@ jobs:
fi

- if: steps.check.outputs.exists == 'false'
run: cp package.json .github/docker/
run: cp package.json bun.lock .github/docker/

- if: steps.check.outputs.exists == 'false'
uses: docker/build-push-action@v6
Expand All @@ -56,7 +56,7 @@ jobs:
${{ env.IMAGE }}:latest

evals:
runs-on: ${{ matrix.suite.runner || 'ubicloud-standard-2' }}
runs-on: ${{ matrix.suite.runner || 'ubicloud-standard-8' }}
needs: build-image
container:
image: ${{ needs.build-image.outputs.image-tag }}
Expand Down Expand Up @@ -110,11 +110,19 @@ jobs:
echo "TMPDIR=/home/runner/.cache"
} >> "$GITHUB_ENV"

# Restore pre-installed node_modules from Docker image via symlink (~0s vs ~15s install)
# Restore pre-installed node_modules from Docker image via recursive
# copy. Symlink (`ln -s`) breaks bun's module resolution because bun
# resolves a file's realpath when walking up to find node_modules/<dep>;
# from a symlinked path, realpath escapes the workspace and sibling
# deps no longer resolve. Hardlink copy (`cp -al`) fails because /opt
# and /workspace are on different overlay-fs layers ("Invalid
# cross-device link"). Recursive copy works on every layout. Cost:
# ~5s for ~200 packages of small JS files vs ~0s for symlink — still
# vastly cheaper than rerunning `bun install` (network + resolution).
- name: Restore deps
run: |
if [ -d /opt/node_modules_cache ] && diff -q /opt/node_modules_cache/.package.json package.json >/dev/null 2>&1; then
ln -s /opt/node_modules_cache node_modules
cp -r /opt/node_modules_cache node_modules
else
bun install
fi
Expand Down Expand Up @@ -147,7 +155,7 @@ jobs:
retention-days: 90

report:
runs-on: ubicloud-standard-2
runs-on: ubicloud-standard-8
needs: evals
if: always() && github.event_name == 'pull_request'
timeout-minutes: 5
Expand Down Expand Up @@ -211,7 +219,7 @@ jobs:
$(echo -e "$SUITE_LINES")

---
*12x ubicloud-standard-2 (Docker: pre-baked toolchain + deps) | wall clock ≈ slowest suite*"
*12x ubicloud-standard-8 (Docker: pre-baked toolchain + deps) | wall clock ≈ slowest suite*"

if [ "$FAILED" -gt 0 ]; then
FAILURES=""
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/make-pdf-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubicloud-standard-8, macos-latest]
# Windows is tolerant-mode — Xpdf / Poppler-Windows extraction
# differs enough from the Linux/macOS baseline that the strict
# exact-diff gate is unreliable. Enable once the normalized
Expand All @@ -48,7 +48,7 @@ jobs:
run: brew install poppler

- name: Install poppler-utils (Ubuntu)
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubicloud-standard-8'
run: sudo apt-get update && sudo apt-get install -y poppler-utils

- name: Install Playwright Chromium
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-title-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
jobs:
sync:
name: Sync PR title to VERSION
runs-on: ubuntu-latest
runs-on: ubicloud-standard-8
permissions:
contents: read
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/skill-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Skill Docs Freshness
on: [push, pull_request]
jobs:
check-freshness:
runs-on: ubuntu-latest
runs-on: ubicloud-standard-8
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
check:
name: Check VERSION is not stale vs queue
runs-on: ubuntu-latest
runs-on: ubicloud-standard-8
permissions:
contents: read
pull-requests: read
Expand Down
37 changes: 30 additions & 7 deletions .github/workflows/windows-free-tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
name: Windows Free Tests

# Curated subset of the free test suite that runs on windows-latest.
# Curated subset of the free test suite that runs on a paid faster Windows runner.
#
# Codex's v1.18.0.0 review flagged that the existing evals.yml workflow uses
# a Linux container, so a windows-latest matrix entry there isn't a drop-in.
# This workflow is non-container, runs the curated Windows-safe subset, plus
# targeted resolver tests that exercise the Bun.which-based claude binary
# resolution + the GSTACK_CLAUDE_BIN override path on Windows.
#
# What this DOES NOT do (out of scope for v1.18.0.0):
# Runner: GitHub-hosted free `windows-latest`. The whole rest of CI runs on
# Ubicloud (Linux), but Ubicloud doesn't ship Windows runners and we don't
# want to flip on GitHub's org-level larger-runner billing for just this one
# job. 4 cores, ~60s spin-up, $0. The wave-coverage tests this runs are
# small enough that total job time stays under 2 minutes.
#
# What this DOES NOT do (still out of scope, tracked as follow-up):
# - Run the full free suite on Windows. The 24 tests that hardcode /bin/sh,
# spawn('sh',...), or raw /tmp/ paths are excluded by scripts/test-free-shards.ts
# --windows-only. They need POSIX-bound surfaces to be ported off shell
# primitives before they can run on Windows. Tracked as a follow-up TODO.
# primitives before they can run on Windows.
# - Run Playwright/browser-backed tests. Browse server bring-up on Windows is
# a separate concern (PR #1238 windows-pty-bun-pty-fix is in flight).

Expand All @@ -27,6 +33,8 @@ concurrency:

jobs:
windows-free-tests:
# Ubicloud Windows runner (same provider as the Linux evals workflow).
# To revert: swap to `windows-latest` (GitHub's free 4-core Windows runner).
runs-on: windows-latest
timeout-minutes: 15

Expand Down Expand Up @@ -91,8 +99,23 @@ jobs:
continue-on-error: true

- name: Verify new portability work on Windows
# 31 tests targeting the new code paths added by v1.20.0.0. These
# MUST pass for the release-note headline ("curated Windows lane added")
# to be truthful.
run: bun test test/gstack-paths.test.ts browse/test/claude-bin.test.ts test/test-free-shards.test.ts
# Tests targeting the v1.20.0.0 lane plus v1.30.0.0 fix-wave additions
# plus v1.36.0.0 Windows-install hardening (sanitizer + _link_or_copy
# helper + build-script subshells + doc/config-key drift guard).
# v1.30.0.0 extension covers icacls hardening (#1308), bash.exe telemetry
# wrap (#1306), and Bun.which-based binary resolvers (#1307). These must
# pass on Windows for the wave's "Windows hardening" framing to be honest.
run: |
bun test \
test/gstack-paths.test.ts \
browse/test/claude-bin.test.ts \
test/test-free-shards.test.ts \
browse/test/file-permissions.test.ts \
browse/test/security.test.ts \
browse/test/server-sanitize-surrogates.test.ts \
test/setup-windows-fallback.test.ts \
test/build-script-shell-compat.test.ts \
test/docs-config-keys.test.ts \
make-pdf/test/browseClient.test.ts \
make-pdf/test/pdftotext.test.ts
shell: bash
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ bin/gstack-global-discover
.openclaw/
.hermes/
.gbrain/
.gbrain-source
.context/
extension/.auth.json
# xterm assets are vendored from npm at build time; not source-of-truth.
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Invoke them by name (e.g., `/office-hours`).
| `/canary` | Post-deploy monitoring loop using the browse daemon. |
| `/landing-report` | Read-only dashboard for the workspace-aware ship queue. |
| `/document-release` | Update all docs to match what you just shipped. |
| `/document-generate` | Generate Diataxis docs (tutorial / how-to / reference / explanation) from code. |
| `/setup-deploy` | One-time deploy config detection (Fly.io, Render, Vercel, etc.). |
| `/gstack-upgrade` | Update gstack to the latest version. |

Expand Down
17 changes: 16 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ Cookies are the most sensitive data gstack handles. The design:

The browser registry (Comet, Chrome, Arc, Brave, Edge) is hardcoded. Database paths are constructed from known constants, never from user input. Keychain access uses `Bun.spawn()` with explicit argument arrays, not shell string interpolation.

### Unicode sanitization at server egress (v1.38.0.0)

Page content harvested by CDP can contain lone UTF-16 surrogate halves (orphaned high or low surrogates from broken JavaScript string handling on the page). When those reach `JSON.stringify`, Bun emits them as `\uD800`-style escape sequences that the downstream consumer's `JSON.parse` accepts, but the Anthropic API rejects with a 400 — turning a single weird page into a session-killing error. Defense is single-point, applied at every server egress that ships page-derived strings.

| Egress path | Module | Sanitization point |
|---|---|---|
| `POST /command` (HTTP) | `browse/src/server.ts` | `handleCommandInternal` wrapper (sanitizes the result of `handleCommandInternalImpl`) |
| `POST /command/batch` | `browse/src/server.ts` | Same wrapper — batch consumers inherit it |
| `GET /activity/stream` (SSE) | `browse/src/server.ts` | `sanitizeReplacer` passed to `JSON.stringify` |
| `GET /inspector/events` (SSE) | `browse/src/server.ts` | `sanitizeReplacer` passed to `JSON.stringify` |

`sanitizeReplacer` is a `JSON.stringify` replacer function that cleans every string value during encoding. Post-stringify regex doesn't work here — `JSON.stringify` has already converted `\uD800` into the literal escape sequence `"\\ud800"` before the regex could match, so the replacer must run inside the encoding pipeline. The pure-string helper `sanitizeLoneSurrogates` is used directly for `text/plain` responses.

**Architectural invariant.** Every new SSE/WebSocket writer or HTTP response that ships page-content-derived strings MUST go through one of two paths: `JSON.stringify(payload, sanitizeReplacer)` for object payloads, or `sanitizeLoneSurrogates(body)` for text bodies. New surfaces that bypass both will desync the system. Inline comments at both SSE producers in `server.ts` say so; `browse/test/server-sanitize-surrogates.test.ts` pins wiring with bug-repro + invariant tests (`handleCommandInternalImpl` rename, central sanitization line, replacer existence, SSE producers stringify with replacer).

### Prompt injection defense (sidebar agent)

The Chrome sidebar agent has tools (Bash, Read, Glob, Grep, WebFetch) and reads hostile web pages, so it's the part of gstack most exposed to prompt injection. Defense is layered, not single-point.
Expand All @@ -156,7 +171,7 @@ The Chrome sidebar agent has tools (Bash, Read, Glob, Grep, WebFetch) and reads

4. **L5 canary token (`browse/src/security.ts`).** A random token injected into the system prompt at session start. Rolling-buffer detection across `text_delta` and `input_json_delta` streams catches the token if it shows up anywhere in Claude's output, tool arguments, URLs, or file writes. Deterministic BLOCK — if the token leaks, the attacker convinced Claude to reveal the system prompt, and the session ends.

5. **L6 ensemble combiner (`combineVerdict`).** BLOCK requires agreement from two ML classifiers at >= `WARN` (0.60), not a single confident hit. This is the Stack Overflow instruction-writing false-positive mitigation. On tool-output scans, single-layer high confidence BLOCKs directly — the content wasn't user-authored, so the FP concern doesn't apply.
5. **L6 ensemble combiner (`combineVerdict`).** BLOCK requires agreement from two ML classifiers at >= `WARN` (0.75), not a single confident hit. This is the Stack Overflow instruction-writing false-positive mitigation. On tool-output scans, single-layer high confidence BLOCKs directly — the content wasn't user-authored, so the FP concern doesn't apply.

**Critical constraint:** `security-classifier.ts` runs only in the sidebar-agent process, never in the compiled browse binary. `@huggingface/transformers` v4 requires `onnxruntime-node`, which fails `dlopen` from Bun compile's temp extract directory. Only the pure-string pieces (canary inject/check, verdict combiner, attack log, status) are in `security.ts`, which is safe to import from `server.ts`.

Expand Down
Loading
Loading