Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
51907b1
feat(editor): add the WriteGate and decoration-host extensions
HMarzban Nov 17, 2026
c49d549
build(desktop): typecheck the storage worker in a Node-only project
HMarzban Nov 17, 2026
f45c536
feat(desktop): add the library storage engine
HMarzban Nov 17, 2026
4b944d8
feat(platform): add the document migration hook and the import guard
HMarzban Nov 17, 2026
6897139
fix(desktop): only the window holding a document may write it
HMarzban Nov 17, 2026
57ed7ba
feat(desktop): add the storage worker entry and its main-side client
HMarzban Nov 17, 2026
02af525
test(ci): enforce the storage engine and worker import boundaries
HMarzban Nov 17, 2026
e28b900
docs(design): add selection bubble and quick insert spec
HMarzban Nov 17, 2026
7be2755
docs(design): add bubble and quick insert prototype
HMarzban Nov 17, 2026
9639a64
feat(editor): accept no provider and keep one stable Awareness
HMarzban Nov 17, 2026
cf32742
build(editor): fence the chunk budget at main plus the D23 ledger
HMarzban Nov 17, 2026
ec3eaf0
docs: record P2.2's measured ledger line and the caret decision
HMarzban Nov 17, 2026
24d4117
Merge remote-tracking branch 'origin/main' into claude/feat-p2-2-edit…
HMarzban Nov 17, 2026
14b05ef
build(editor): re-measure the fence on main at 1ed981e
HMarzban Nov 17, 2026
ba33787
feat(desktop): report the library pragmas and SQLite version in stats
HMarzban Nov 17, 2026
4cc17fe
test(desktop): add the storage durability soak (T1–T8)
HMarzban Nov 17, 2026
0ba711a
ci(desktop): run the full storage soak on a labelled pull request
HMarzban Nov 17, 2026
3a6cb91
docs(desktop): record the P2.6 storage worker in the changelog and spec
HMarzban Nov 17, 2026
207a5e7
fix(desktop): don't take a home folder named like a sync client for one
HMarzban Nov 17, 2026
26b3bfd
fix(desktop): announce every sidebar change in the index feed
HMarzban Nov 17, 2026
8cb74ea
test(desktop): time the soak's startup from process start
HMarzban Nov 17, 2026
d0d82ed
fix(desktop): finalize bun:sqlite statements before closing
HMarzban Nov 17, 2026
e6aadf3
Merge remote-tracking branch 'origin/claude/feat-p2-1-local-session' …
HMarzban Nov 17, 2026
f6e5306
feat(desktop): create documents at a given schema with any safe id
HMarzban Nov 17, 2026
7a3f09f
test(desktop): run P2.1's DocStore contract on both storage drivers
HMarzban Nov 17, 2026
1390edb
docs(desktop): note the shared contract and T7's home for P2.6
HMarzban Nov 17, 2026
de7a82c
refactor(platform): name the migration step migrate, as local-session…
HMarzban Nov 17, 2026
c5e2613
docs(platform): rewrap the runDocMigrations comment
HMarzban Nov 17, 2026
ca8ddbe
Merge remote-tracking branch 'origin/claude/feat-p2-1-local-session' …
HMarzban Nov 17, 2026
84912b2
docs(design): record owner approval of the bubble and quick insert de…
HMarzban Nov 17, 2026
b1f4f7f
docs(plan): add the bubble and quick insert implementation plan
HMarzban Nov 17, 2026
24aac1f
docs(plan): give plan tasks unique phase IDs
HMarzban Nov 17, 2026
f0db82b
build(desktop): export the desktop renderer without web-only routes
HMarzban Nov 17, 2026
0a8843e
feat(desktop): never register the service worker in the desktop build
HMarzban Nov 17, 2026
9cd1cd8
test(desktop): run the desktop project on the static export
HMarzban Nov 17, 2026
033531b
docs: document the desktop renderer export
HMarzban Nov 17, 2026
226e2e2
fix(desktop): skip Next's type pass in the desktop export
HMarzban Nov 17, 2026
abebef8
test(e2e): find the provider through the caret's forwarding on
HMarzban Nov 17, 2026
5c55dbf
Merge remote-tracking branch 'origin/main' into claude/feat-p2-6-stor…
HMarzban Nov 17, 2026
2e2238f
Merge remote-tracking branch 'origin/main' into claude/feat-p2-2-edit…
HMarzban Nov 17, 2026
1c15715
build(editor): re-measure the fence on main at 08b7663
HMarzban Nov 17, 2026
4289a54
Merge remote-tracking branch 'origin/main' into claude/beautiful-jack…
HMarzban Nov 17, 2026
be206ad
Merge remote-tracking branch 'origin/main' into docs/bubble-quick-ins…
HMarzban Nov 17, 2026
8496a30
fix(desktop): export only in the desktop production build
HMarzban Nov 17, 2026
5a573f3
Merge remote-tracking branch 'origin/claude/feat-p2-6-storage-worker'…
HMarzban Nov 17, 2026
e92f3bf
Merge remote-tracking branch 'origin/claude/feat-p2-2-editor-no-provi…
HMarzban Nov 17, 2026
26614dd
Merge remote-tracking branch 'origin/claude/feat-p2-4-desktop-export'…
HMarzban Nov 17, 2026
7d0e23d
Merge remote-tracking branch 'origin/docs/bubble-quick-insert-design'…
HMarzban Nov 17, 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
152 changes: 152 additions & 0 deletions .github/workflows/desktop-storage-soak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: Desktop storage soak

# Plan T1–T8 (P2.6): the storage worker on node:sqlite inside Electron,
# SIGKILLed during appends, compactions and migrations, quit with writes in
# flight, opened by an older app, and run through a simulated year with
# 1,000 documents. The verifier reopens every library with the engine on
# bun:sqlite. See tests/load/desktop-durability-soak.ts.
#
# Pull requests that touch storage run a short profile (20 kills per case);
# the nightly and manual runs use the plan's 200, and so does a pull request
# labelled `storage-soak-full` (workflow_dispatch needs the file on main).
# Not a required check.
# Read-only token and no secrets, like CI.

on:
pull_request:
types: [opened, synchronize, reopened, labeled]
paths:
- desktop/storage/**
- desktop/storage-harness/**
- desktop/dev/bun-sqlite-driver.ts
- lib/platform/desktop/**
- lib/platform/doc-store.ts
- tests/helpers/doc-store-contract.ts
- tests/load/desktop-durability-soak.ts
- .github/workflows/desktop-storage-soak.yml
workflow_call:
inputs:
kills:
type: number
default: 200
workflow_dispatch:
inputs:
kills:
description: Kills per kill case (T1, T2; T1-dense runs half)
type: number
default: 200

permissions:
contents: read

concurrency:
group: desktop-storage-soak-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
soak:
name: ${{ matrix.group.name }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 90
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [macos-26, windows-latest, ubuntu-24.04]
group:
- name: contract, T3–T6
cases: contract,T3,T4,T5,T6
- name: T1 kill during append
cases: T1,T1-dense
- name: T2 kill during compaction
cases: T2
- name: T8 year and startup
cases: T8
defaults:
run:
shell: bash
env:
KILLS: ${{ github.event_name != 'pull_request' && (inputs.kills || 200) || contains(github.event.pull_request.labels.*.name, 'storage-soak-full') && 200 || 20 }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: .tool-versions

# The root install brings Yjs and the engine's dependencies; the
# harness has its own lockfile with Electron, whose binary downloads
# on first use.
- name: Install
run: |
bun install --frozen-lockfile
cd desktop/storage-harness
bun install --frozen-lockfile
bun -e 'require("electron")'

# Everything after install runs on Bun. The runner image ships Node,
# so a stub makes any call to it fail loudly. Install comes first:
# lifecycle scripts (husky) call `node`.
- name: Block Node.js
run: |
mkdir -p "$RUNNER_TEMP/no-node"
cat > "$RUNNER_TEMP/no-node/node" <<'EOF'
#!/bin/sh
echo "::error::node was called: $*" >&2
exit 1
EOF
chmod +x "$RUNNER_TEMP/no-node/node"
echo "$RUNNER_TEMP/no-node" >> "$GITHUB_PATH"

# Windows process spawns look for node.exe and never run the sh stub
# above, so put a compiled stub beside it (found in spike S3).
- name: Block Node.js (node.exe on Windows)
if: runner.os == 'Windows'
run: |
cat > "$RUNNER_TEMP/node-stub.ts" <<'EOF'
console.error(`::error::node was called: ${process.argv.slice(2).join(" ")}`);
process.exit(1);
EOF
bun build --compile "$RUNNER_TEMP/node-stub.ts" --outfile "$RUNNER_TEMP/no-node/node.exe"
if cmd.exe //d //c "node --version" > /dev/null 2>&1; then
echo "::error::the node.exe stub is not first on PATH"
exit 1
fi

- name: Audit the harness dependencies
working-directory: desktop/storage-harness
run: bun audit --audit-level=high

- name: Typecheck and build the harness
working-directory: desktop/storage-harness
run: |
bun run typecheck
bun run build

- name: Allow the Chromium sandbox (electron/electron#42510)
if: runner.os == 'Linux'
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

- name: Soak
env:
CASES: ${{ matrix.group.cases }}
run: |
if [ "$RUNNER_OS" = Linux ]; then
xvfb-run -a bun tests/load/desktop-durability-soak.ts --case="$CASES" --kills="$KILLS" --out=soak-out
else
bun tests/load/desktop-durability-soak.ts --case="$CASES" --kills="$KILLS" --out=soak-out
fi

- name: Upload results
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: storage-soak-${{ matrix.os }}-${{ strategy.job-index }}
path: soak-out
if-no-files-found: ignore
retention-days: 30
77 changes: 77 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ name: Nightly
# from 3 clients against Hocuspocus (spec §7 abuse soak)
# mixed-version N+1, release N and pre-N clients on one document with
# the gate env at its default (spec §3.1 N+1 ship gate)
# desktop-renderer the desktop static export (bun run build:desktop) on
# Linux, where releases build it (#103), served with the
# protocol handler's path rules, under the desktop project
# desktop-smoke the D-A12 Electron smoke (desktop-smoke.yml) on macOS,
# Windows and Linux
# desktop-storage-soak plan T1–T8 against the storage worker in Electron
# (desktop-storage-soak.yml), 200 kills per case, 3 OSes
#
# Read-only token and no secrets, like CI. A red run means a regression in
# offline editing, long sessions, concurrency or schema rollout safety that
Expand Down Expand Up @@ -354,10 +359,82 @@ jobs:
if-no-files-found: ignore
retention-days: 7

desktop-renderer:
name: Desktop renderer (static export)
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: .tool-versions

- name: Install
run: bun install --frozen-lockfile

- name: Install Chromium
run: bun playwright install --with-deps chromium

# Fails if a web-only route or web metadata tag reaches out/, or on the
# Windows segment layout; leaves app/ as it was.
- name: Desktop export
run: NEXT_PUBLIC_HOCUS_URL=ws://127.0.0.1:1234 bun run build:desktop

- name: Web-only files are back in app/
run: git diff --exit-code --stat -- app

# The renderer still syncs through Hocus until the dev bridge (P2.4,
# after P2.1 and P2.2) replaces it.
- name: Start servers
id: servers
run: |
PORT=3849 bun scripts/serve-desktop-export.ts > "$RUNNER_TEMP/serve.log" 2>&1 &
make dev-hocus > "$RUNNER_TEMP/hocus.log" 2>&1 &
for _ in $(seq 1 60); do
if curl -s -o /dev/null http://127.0.0.1:1234 &&
curl -sf -o /dev/null http://127.0.0.1:3849/; then
exit 0
fi
sleep 1
done
echo "::error::servers did not start"
exit 1

- name: Run the desktop project
run: >-
DESKTOP_BASE_URL=http://127.0.0.1:3849 CI=
bun playwright test --project=desktop --trace retain-on-failure

- name: Upload failure artifacts
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: nightly-desktop-renderer
path: |
test-results/
${{ runner.temp }}/*.log
if-no-files-found: ignore
retention-days: 7

# D-A12: node:sqlite, WAL, a worker thread and a custom app protocol in the
# pinned Electron build, on the nightly schedule (no cron of its own).
desktop-smoke:
name: Desktop smoke (D-A12)
permissions:
contents: read
uses: ./.github/workflows/desktop-smoke.yml

desktop-storage-soak:
name: Desktop storage soak (T1–T8)
permissions:
contents: read
uses: ./.github/workflows/desktop-storage-soak.yml
with:
kills: 200
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# next.js
/.next/
/out/
# web metadata files parked during a desktop export (scripts/build-desktop.ts)
/.desktop-export-parked/

# production
/build
Expand Down
Loading
Loading