Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
ci: audit the JS lockfiles, since GitHub never alerts on bun.lock
trohitg6d28bacd35ce
diff --git a/.github/dependabot.yml b/.github/dependabot.ymlindex df0480fc..89b46f5d 100644--- a/.github/dependabot.yml+++ b/.github/dependabot.yml@@ -1,11 +1,13 @@# Dependabot is DISABLED by policy (2026-09-12): no version-update PRs and no# security-update PRs. Dependencies move by hand, alongside test runs:# JS -> bump the range in the relevant package.json (or the top-level-# `overrides` block for transitive pins), `bun install`, run tests+# `overrides` block for transitive pins), `bun install`,+# `bun run audit:deps`, run tests# pip -> `uv lock --upgrade-package <name>` in server/, regenerate# server/requirements.txt with the `uv export` command in its# header, `uv sync`, tests-# Alerts stay visible in the repository's Security tab.+# Alerts stay visible in the repository's Security tab, except for bun.lock,+# which GitHub cannot read: CI's `bun run audit:deps` covers the JS trees.## Why this file still exists: without an entry for a directory, Dependabot# routes that directory's alerts to whatever updater it guesses, and for adiff --git a/.github/workflows/predeploy.yml b/.github/workflows/predeploy.ymlindex d8539723..dae20c0a 100644--- a/.github/workflows/predeploy.yml+++ b/.github/workflows/predeploy.yml@@ -1,6 +1,6 @@# Reusable validation workflow. Called by ci.yml and release.yml.-# Jobs: build-and-lint (client build + lint), backend-tests, cli-tests,-# test-build-start (cross-OS build + start smoke test).+# Jobs: build-and-lint (client build, lint, tests, JS dependency audit),+# backend-tests, cli-tests, test-build-start (cross-OS build + start smoke test).name: Predeploy@@ -27,6 +27,16 @@ jobs:run: bun run --filter react-flow-client typecheck- name: Frontend tests (vitest)run: bun run --filter react-flow-client test+ # GitHub's dependency graph cannot read bun.lock, so no Dependabot alert+ # covers the JS trees and these audits are the only check. Each script+ # carries its ignore list; docs-internal/ci_cd.md ("Dependency update+ # policy") says why each entry is there. desktop/ has its own lockfile,+ # which bun audits without installing it.+ - name: Audit JS dependencies+ run: bun run audit:deps+ - name: Audit desktop JS dependencies+ working-directory: desktop+ run: bun run audit:depsbackend-tests:name: Backend testsdiff --git a/desktop/package.json b/desktop/package.jsonindex 9be67241..0eeec493 100644--- a/desktop/package.json+++ b/desktop/package.json@@ -12,6 +12,7 @@"build": "electron-vite build","preview": "electron-vite preview","typecheck": "tsc --noEmit -p tsconfig.json",+ "audit:deps": "bun audit --ignore=GHSA-ch52-4w7c-c8xp","fetch-runtimes": "bun run scripts/fetch-runtimes.ts","stage": "bun run scripts/stage.ts","gen-icons": "bun run scripts/gen-icons.ts",diff --git a/docs-internal/ci_cd.md b/docs-internal/ci_cd.mdindex 4b9626fa..6f46d1af 100644--- a/docs-internal/ci_cd.md+++ b/docs-internal/ci_cd.md@@ -37,7 +37,7 @@ The repo currently ships **five workflows** plus one composite action. Code scan| Workflow | File | Triggers | Purpose ||----------|------|----------|---------|| CI | `.github/workflows/ci.yml` | push/PR → main | Delegates to predeploy.yml |-| Predeploy | `.github/workflows/predeploy.yml` | `workflow_call` | build/lint + backend tests + CLI tests + cross-OS build/start smoke |+| Predeploy | `.github/workflows/predeploy.yml` | `workflow_call` | build/lint + JS dependency audit + backend tests + CLI tests + cross-OS build/start smoke || Release | `.github/workflows/release.yml` | `v*.*.*` tag, `workflow_dispatch` | predeploy gate → publish (npm + GitHub Packages) || Desktop CI | `.github/workflows/desktop-ci.yml` | PR touching `desktop/**` or the backend host-contract files; push to main touching `desktop/**` | typecheck + unit + staged-tree invariants + `electron-vite build` + Playwright Electron smoke on ubuntu-22.04 (xvfb) and windows-latest || Desktop release | `.github/workflows/desktop-release.yml` | `v*.*.*` tag, `workflow_dispatch` | `prepare` drafts the GitHub Release from the annotated tag's message (first line = title, rest = notes); a 3-runner matrix (windows-latest x64, macos-14 arm64+x64, ubuntu-22.04 x64) checks the synced version against the tag, builds installers with electron-builder and uploads into that one **draft**; `finalize` undrafts once every leg is green. Artifacts-only on dispatch unless `publish` is ticked |@@ -88,7 +88,7 @@ After tool install the composite installs the supervisor CLI editably (`uv pip iReusable `workflow_call` workflow with four independent jobs (no plan/change-detection gate, no aggregator — every job runs on every call):-- `build-and-lint` — `bun install --frozen-lockfile` + `bun run build`, then client lint (`bun run --filter react-flow-client lint`), TypeScript check (`... typecheck`), and frontend tests (`... test`, vitest). Runs on `ubuntu-latest`.+- `build-and-lint` — `bun install --frozen-lockfile` + `bun run build`, then client lint (`bun run --filter react-flow-client lint`), TypeScript check (`... typecheck`), frontend tests (`... test`, vitest), and the JS dependency audit (`bun run audit:deps` at the root and in `desktop/`; see "Dependency update policy" below). Runs on `ubuntu-latest`.- `backend-tests` — `uv lock --check` (the committed `server/uv.lock` must match `pyproject.toml`; the desktop app installs from it with `--frozen`), then `uv sync` + `uv run pytest tests/ -v` in `server/`. Whole suite, unsharded. Runs on `ubuntu-latest`.- `cli-tests` — `uv pip install --system pytest pytest-asyncio pyyaml` + `python -m pytest cli/tests/ -v`. Runs on `ubuntu-latest`.- `test-build-start` — cross-OS matrix (`ubuntu-latest`, `macos-latest`, `windows-latest`, `fail-fast: false`). Runs `bun run build`, then `bun run tsc --version` (proves the per-platform TypeScript 7 Go binary delivered via `optionalDependencies` resolves on every OS — the type-check gate itself runs on ubuntu only; `bun run`, never `bunx`, so it resolves strictly from the root `node_modules/.bin`), then a start smoke test. On Unix it backgrounds `bun run start`, reads `PYTHON_BACKEND_PORT` out of `.env.template` and polls `http://localhost:${APP_PORT}/health` (`curl -sf -m 5`, every 2 s) for up to 90 s, giving up early if the start process exits. It always runs `bun run stop` afterwards, then fails unless `/health` answered. On Windows it starts the supervisor as a background job, waits 15 s, and fails if the job already exited.@@ -198,7 +198,7 @@ folder — both the folder and the workflow are gone.| File | Purpose ||------|---------|| `.github/workflows/ci.yml` | CI entry point (delegates to predeploy.yml) |-| `.github/workflows/predeploy.yml` | Reusable validation (build/lint + backend tests + CLI tests + OS matrix build/start) |+| `.github/workflows/predeploy.yml` | Reusable validation (build/lint + JS dependency audit + backend tests + CLI tests + OS matrix build/start) || `.github/workflows/release.yml` | Tag / manual release: predeploy gate → publish npm + GitHub Packages || `.github/workflows/desktop-ci.yml` | Desktop shell checks on PRs: typecheck, unit, invariants, build, Playwright smoke || `.github/workflows/desktop-release.yml` | Tag-triggered desktop installers (NSIS / DMG+zip / AppImage+deb) into a draft release, then undraft. Separate from `release.yml` so npm publish is never blocked |@@ -253,7 +253,7 @@ by hand, alongside test runs:- JS: bump the range in the relevant `package.json` (or the top-level`overrides` block in the root manifest for transitive pins), `bun install`,- run the suites.+ `bun run audit:deps` (at the root and in `desktop/`), run the suites.- pip: `uv lock --upgrade-package <name>` in `server/`, regenerate`server/requirements.txt` with the `uv export` command in its header,`uv sync`, run the suites (`predeploy.yml` runs `uv lock --check`).@@ -281,6 +281,22 @@ repository setting (Settings > Code security > Dependabot), not somethingthe config file controls; turn them off there if the "Dependabot Updates"job should stop running entirely.+GitHub's dependency graph does not read `bun.lock`; it sees only the ranges+in each `package.json`, so no Dependabot alert ever covers a resolved JS+version. `bun run audit:deps` is the check: `predeploy.yml` runs it at the+root and in `desktop/` (`bun audit` reads the lockfile and needs no install),+and it fails on any advisory except the ones each script ignores. An advisory+is ignored only when it has no patched release and cannot be reached from+untrusted input here:++| Advisory | Package | Reached through | Why it is ignored |+|---|---|---|---|+| [GHSA-vfj7-8cjw-p6xm](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm) | braces 3.0.3 | root: the shadcn CLI's fast-glob | Stack exhaustion from deeply nested brace patterns; the CLI only expands patterns written in this repo |+| [GHSA-ch52-4w7c-c8xp](https://github.com/advisories/GHSA-ch52-4w7c-c8xp) | http-cache-semantics 4.2.0 | `desktop/`: `@electron/get` | Cross-user disclosure through a shared HTTP cache; `@electron/get` only downloads Electron at install and build time |++When an ignored advisory gets a patched release, drop its `--ignore` and pin+the fix in `overrides`.+Re-enable updates deliberately, never by just deleting the ignore rules:raise `open-pull-requests-limit`, add `groups` with `patterns: ["*"]` +`update-types: [minor, patch]`, and `cooldown: {semver-major-days: 30}`.diff --git a/package.json b/package.jsonindex adda6c61..d5fd949c 100644--- a/package.json+++ b/package.json@@ -100,6 +100,7 @@"daemon:restart": "python -m cli daemon restart","version:sync": "python -m cli version sync","typecheck": "tsc --noEmit -p client/tsconfig.json",+ "audit:deps": "bun audit --ignore=GHSA-vfj7-8cjw-p6xm","prepublishOnly": "python -m cli version sync && bun -e \"const p=require('./package.json'); if(!p.bin||!p.version){process.exit(1)}\"","preinstall": "bun scripts/preinstall.js","postinstall": "bun scripts/postinstall.js",