Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 16 additions & 1 deletion .github/workflows/moss-vscode-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,26 @@ jobs:
- name: Build
run: npm run build

# Worker-survival E2E + supervisor negative control. Runs on every OS in
# the matrix and EXECUTES the real installed native addon for that runner:
# macOS arm64 (macos-latest), Linux x64 (ubuntu-latest), Windows x64
# (windows-latest). GitHub offers no hosted Darwin x64 or Linux arm64
# runners, so those two shipped binaries are not executed here; they are
# bundled and statically version/hook-checked by verify-package. Hermetic:
# loopback auth stub, no model download, no customer data (MOS-166).
- name: Regression tests (worker survival + supervisor abort/restart)
run: npm test

- name: Package VSIX (Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: npm run package

- name: Verify VSIX contents (Ubuntu only)
# VSIX integrity gate: asserts the bundled wrapper/core/platform versions
# are the fixed pinned set, that the lockfile has not dropped below the
# fix, that no test source / fixtures / hidden test-hook exports leaked,
# and executes the extracted worker against the VSIX's own bundled .node.
# Packaging fails if the boundary regresses or the lock drops (MOS-166).
- name: Verify VSIX integrity (Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: npm run verify-package

Expand Down
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ asks for an experimental landing spot.
| `apps/moss-bun/` | Production Bun + Moss application |
| `apps/moss-llamaindex/` | Full-stack PDF → LlamaIndex + Liteparse + Moss semantic search demo |
| `apps/next-js/` | Next.js 16 browser-based semantic search UI using `@moss-dev/moss-web`; reference UI for semantic search |
| `apps/moss-vscode/` | VS Code extension. Runs `@moss-dev/moss` in a forked Node worker (`src/worker/mossWorker.ts`) supervised by `src/moss/client.ts`; bundles all five native `moss-core` platform packages into the VSIX. Exact-pinned to the fixed crash-boundary versions — see Testing Notes |

### Reusable Packages (`packages/`)

Expand Down Expand Up @@ -260,6 +261,7 @@ When adding examples or cookbook integrations, follow the existing patterns:
- CI runs Python SDK tests across versions 3.10–3.14 in a GitHub Actions matrix using `pytest` directly
- CI lints Python with `ruff` and type-checks with `mypy`; format locally with `black` + `isort`
- JS tests use Vitest; CI runs on Node 20
- `apps/moss-vscode` has its own hermetic regression suite (`apps/moss-vscode/test/`, `npm test`, gated by `.github/workflows/moss-vscode-ci.yml`): it forks the built worker, initializes through a loopback auth stub (`MOSS_AUTH_URL`), and asserts a torn on-disk session cache yields a catchable IPC error while the worker survives — plus a supervisor abort/restart negative control and a VSIX-integrity check (`scripts/verify-package.mjs`). It uses `modelId: "custom"` to stay offline (no model download); the native `loadFromDisk` deserialize boundary is model-independent. The app must stay at or above `@moss-dev/moss@1.4.1` / `@moss-dev/moss-core@0.20.1` (below that ships a native addon that can abort the process on a corrupt cache); `prepackage.mjs` and `verify-package.mjs` enforce that floor

## CI Workflows

Expand All @@ -268,3 +270,4 @@ The `.github/workflows/ci.yml` pipeline runs on push to `main` and on PRs:
- `python-sdk-test` — matrix over Python 3.10–3.14
- `javascript-lint` — eslint
- Separate release workflows publish to PyPI / npm on tagged releases
- `moss-vscode-ci.yml` — builds, tests (worker-survival + supervisor negative control), packages, and verifies the `apps/moss-vscode` VSIX on macOS / Linux / Windows
6 changes: 5 additions & 1 deletion apps/moss-vscode/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
.vscode-test/**
src/**
**/*.ts
!dist/**
tsconfig.json
esbuild.mjs
scripts/**
test/**
promo/**
**/*.test.mjs
*.log
**/*.log
.env
.env.*
.gitignore
Expand Down
2 changes: 1 addition & 1 deletion apps/moss-vscode/PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ The extension runs Moss in a child Node process. Resolution order:
3. System Node (`node` on PATH)
4. VS Code embedded Node (`process.execPath` + `ELECTRON_RUN_AS_NODE`)

If indexing fails with a native crash, install Node 20+ and set `moss.nodePath`, or set `NODE_BINARY`.
If indexing fails with a native crash, install Node 20.4+ and set `moss.nodePath`, or set `NODE_BINARY`.
67 changes: 32 additions & 35 deletions apps/moss-vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions apps/moss-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"qna": "https://github.com/samanyugoyal2010/moss-vs-code/issues",
"engines": {
"vscode": "^1.85.0",
"node": ">=20"
"node": ">=20.4"
},
"categories": [
"Other",
Expand Down Expand Up @@ -146,7 +146,7 @@
"moss.nodePath": {
"type": "string",
"default": "",
"description": "Optional path to a Node.js 20+ binary for the Moss worker (defaults to system Node, then VS Code embedded Node)"
"description": "Optional path to a Node.js 20.4+ binary for the Moss worker (defaults to system Node, then VS Code embedded Node)"
}
}
}
Expand All @@ -156,12 +156,15 @@
"build": "node esbuild.mjs",
"watch": "node esbuild.mjs --watch",
"typecheck": "tsc --noEmit",
"test": "npm run build && node --test test/worker-survival.test.mjs test/supervisor-negative-control.test.mjs test/node-floor.test.mjs",
"test:worker": "npm run build && node --test test/worker-survival.test.mjs",
"test:supervisor": "npm run build && node --test test/supervisor-negative-control.test.mjs",
"prepackage": "node scripts/prepackage.mjs",
"package": "npm run prepackage && vsce package",
"verify-package": "node scripts/verify-package.mjs"
},
"dependencies": {
"@moss-dev/moss": "^1.3.2",
"@moss-dev/moss": "1.4.1",
"dotenv": "^17.2.3",
"ignore": "^7.0.5"
},
Expand Down
19 changes: 19 additions & 0 deletions apps/moss-vscode/scripts/prepackage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ if (!mossCoreVersion) {
throw new Error("Could not resolve @moss-dev/moss-core version for packaging");
}

// Crash-boundary floor (MOS-166): the packaged native addon must be at or above
// the fixed @moss-dev/moss-core 0.20.1 (shipped in @moss-dev/moss 1.4.1). Fail
// packaging early if the lockfile regresses below it.
const FIXED_CORE = "0.20.1";
const cmp = (a, b) => {
const pa = a.split("-")[0].split(".").map(Number);
const pb = b.split("-")[0].split(".").map(Number);
for (let i = 0; i < 3; i++) {
if ((pa[i] ?? 0) !== (pb[i] ?? 0)) return (pa[i] ?? 0) - (pb[i] ?? 0);
}
return 0;
};
if (cmp(mossCoreVersion, FIXED_CORE) < 0) {
throw new Error(
`@moss-dev/moss-core ${mossCoreVersion} is below the fixed crash-boundary floor ${FIXED_CORE}; ` +
`refusing to package a source-affected native addon (MOS-166).`,
);
}

const platformPackages = [
"@moss-dev/moss-core-darwin-arm64",
"@moss-dev/moss-core-darwin-x64",
Expand Down
Loading
Loading