Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(ops): reclaim abandoned deploy worktrees before they fill the build disk

nirholas3af0041c5ea7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 96088a9ff..3e0b194a3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-08-04
- **AWS published a builder's guide to the agentic economy built on the three.ws stack**: AWS Strategic Partnerships published a long technical guide to the agentic economy on the AWS Builder Center, and it uses three.ws as its worked example from end to end: the x402 payment handshake, the MCP servers, agent-to-agent payments, on-chain agent identity and skill licenses, agent tokens, and 3D embodiment. This one was written by AWS rather than by us, which makes it the strongest outside evidence yet that the integration is real. It is now indexed on the site with its own news page, and the AWS writing index has a new section separating articles AWS wrote about us from the ones we published ourselves. `[docs]`
+- **Deploys stop silently running the build disk out of space**: Every production deploy stages a scratch copy of the repo to build from, and nothing ever cleaned those copies up. Ten of them accumulated and filled the build machine's disk completely, which does not announce itself: the next deploy fails partway through with an unrelated-looking error, and so does the one after it. There is now a reclaimer that finds abandoned build copies and frees the space, and it is deliberately careful: it never touches a copy that holds unsaved work, and never one that another build might still be using. It runs as the first step of the deploy runbook, so the disk is checked before a build starts rather than after one has already died. `[infra, fix]`
- **Documentation now states the correct software license**: The platform's license changed to proprietary, all rights reserved, but nine documentation pages still told readers the code was Apache 2.0 open source, including pages describing what you are allowed to self-host, fork, and redistribute. That was wrong and is now corrected everywhere, so the docs match the actual LICENSE file. Nothing about the packages changed: the SDKs are still free to install and use from npm, and the manifest, embed, and agent specs are still open to build against without permission. References to genuinely open-source components we depend on, such as MediaPipe and FLUX, were left alone because those remain Apache 2.0. `[docs, fix]`
## 2026-08-02
diff --git a/CLAUDE.md b/CLAUDE.md
index fb8cb3bf6..58c3d031c 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -285,7 +285,8 @@ When reverting, do NOT use git's default `Revert "<original title>"` message: it
Remember stop-and-ask gate 2: production deploys need owner approval unless the owner's current instruction is itself the approval. Full runbook incl. LB/DNS/TLS/env/rollback/recovery: `docs/ops/gcp-production.md`. GPU workers deploy from their own `workers/<name>/cloudbuild.yaml`.
-1. **Prepare a CLEAN worktree.** `git worktree add --detach /workspaces/.deploy-wt HEAD`, then hardlink THREE artifacts with `cp -al` on the same filesystem (not just the first): `node_modules`, `chat/node_modules`, and `character-studio/build`, plus copy `.env`. Omitting either nested one kills the build minutes in: an OOM exit 144 on the avatar-studio rebuild, or `Cannot find package '@sveltejs/vite-plugin-svelte'` on the chat build. See `docs/ops/gcp-production.md`.
+0. **Reclaim disk first: `npm run clean:worktrees` (add `--apply` to act).** Deploy worktrees are created by every deploy and removed by nobody. On 2026-08-04 ten had accumulated and filled the 126 GB disk to 100%, which fails in a way that reads like a different bug entirely: `git worktree add` dies mid-checkout with `No space left on device` and leaves a half-written tree behind. The script only reclaims a linked worktree that is detached, clean, and idle past `--min-age-hours` (default 2, so a concurrent agent's live build is never deleted); anything with uncommitted work is reported and kept.
+1. **Prepare a CLEAN worktree.** `git worktree add --detach /workspaces/.deploy-wt HEAD`, then hardlink THREE artifacts with `cp -al` on the same filesystem (not just the first): `node_modules`, `chat/node_modules`, and `character-studio/build`, plus copy `.env`. Omitting either nested one kills the build minutes in: an OOM exit 144 on the avatar-studio rebuild, or `Cannot find package '@sveltejs/vite-plugin-svelte'` on the chat build. **Remove it when the deploy lands** (`git worktree remove --force <path>`); that is what step 0 exists to clean up after. See `docs/ops/gcp-production.md`.
2. **Build: `npm run build:gcp`.** ORDER IS LOAD-BEARING and `build:gcp` already encodes it. Never hand-run the steps in a different order. The full chain, in order:
`check:conflicts` → `check:browser-graph` → `ensure:avatar-studio` → `build:info:snapshot` → `build:chat` → `build` (the frontend `vite build`) → `build:lib:full` (the UMD lib) → `publish:lib` → `build:info` → `check:dist` → `check:pages`
diff --git a/data/changelog.json b/data/changelog.json
index a03000ad1..5bfa125c8 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -17890,6 +17890,15 @@
"feature"
],
"link": "/oracle"
+ },
+ {
+ "date": "2026-08-04",
+ "title": "Deploys stop silently running the build disk out of space",
+ "summary": "Every production deploy stages a scratch copy of the repo to build from, and nothing ever cleaned those copies up. Ten of them accumulated and filled the build machine's disk completely, which does not announce itself: the next deploy fails partway through with an unrelated-looking error, and so does the one after it. There is now a reclaimer that finds abandoned build copies and frees the space, and it is deliberately careful: it never touches a copy that holds unsaved work, and never one that another build might still be using. It runs as the first step of the deploy runbook, so the disk is checked before a build starts rather than after one has already died.",
+ "tags": [
+ "infra",
+ "fix"
+ ]
}
]
}
diff --git a/docs/ops/gcp-production.md b/docs/ops/gcp-production.md
index efe320e61..207b85495 100644
--- a/docs/ops/gcp-production.md
+++ b/docs/ops/gcp-production.md
@@ -153,6 +153,7 @@ npm run smoke:prod
> build (2026-07-26: two consecutive dead builds, one exit 144, one exit 1):
>
> ```bash
+> npm run clean:worktrees -- --apply # reclaim old deploy trees before staging a new one
> git worktree add --detach /workspaces/.deploy-wt HEAD
> cp -al /workspaces/three.ws/node_modules /workspaces/.deploy-wt/node_modules
> cp -al /workspaces/three.ws/chat/node_modules /workspaces/.deploy-wt/chat/node_modules
@@ -160,6 +161,16 @@ npm run smoke:prod
> cp /workspaces/three.ws/.env /workspaces/.deploy-wt/.env
> ```
>
+> **Remove the worktree once the deploy lands** (`git worktree remove --force
+> /workspaces/.deploy-wt`). Nobody did for three days in early August 2026 and
+> ten trees filled the 126 GB disk to 100%. The failure does not name its cause:
+> the next `git worktree add` dies mid-checkout with `No space left on device`
+> and leaves a half-written tree, and the build after that fails somewhere
+> unrelated. `npm run clean:worktrees` (plan only; `--apply` acts) reclaims any
+> linked worktree that is detached, clean, and idle past `--min-age-hours`
+> (default 2, so a concurrent agent's running build is never deleted). A tree
+> holding uncommitted work is always reported and kept.
+>
> - `character-studio/build` — `ensure:avatar-studio` only skips the heavy
> avatar-studio vite build when `character-studio/build/index.html` exists.
> Without it the build runs for real and gets OOM-killed (exit 144) on a box
diff --git a/package.json b/package.json
index b5bb03cf5..09bb66623 100644
--- a/package.json
+++ b/package.json
@@ -311,6 +311,7 @@
"okx:three-copy": "node scripts/okx-three-copy-check.mjs",
"okx:gauntlet": "node scripts/okx-e2e-gauntlet.mjs",
"check:conflicts": "node scripts/check-merge-conflicts.mjs",
+ "clean:worktrees": "node scripts/clean-deploy-worktrees.mjs",
"check:browser-graph": "node scripts/check-browser-graph.mjs",
"prove:guards": "node scripts/prove-guards.mjs",
"capture:docs-world": "node scripts/capture-docs-media.mjs",
diff --git a/public/changelog.json b/public/changelog.json
index 8b46c0c9f..2ca15d9ad 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-04T00:23:20.479Z",
+ "generated_at": "2026-08-04T01:29:07.195Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -16,6 +16,17 @@
"docs"
]
},
+ {
+ "date": "2026-08-04",
+ "type": "update",
+ "title": "Deploys stop silently running the build disk out of space",
+ "summary": "Every production deploy stages a scratch copy of the repo to build from, and nothing ever cleaned those copies up. Ten of them accumulated and filled the build machine's disk completely, which does not announce itself: the next deploy fails partway through with an unrelated-looking error, and so does the one after it. There is now a reclaimer that finds abandoned build copies and frees the space, and it is deliberately careful: it never touches a copy that holds unsaved work, and never one that another build might still be using. It runs as the first step of the deploy runbook, so the disk is checked before a build starts rather than after one has already died.",
+ "link": null,
+ "tags": [
+ "infra",
+ "fix"
+ ]
+ },
{
"date": "2026-08-04",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 7e8146b40..a36bcbfef 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -14,6 +14,14 @@
<category>docs</category>
<description>AWS Strategic Partnerships published a long technical guide to the agentic economy on the AWS Builder Center, and it uses three.ws as its worked example from end to end: the x402 payment handshake, the MCP servers, agent-to-agent payments, on-chain agent identity and skill licenses, agent tokens, and 3D embodiment. This one was written by AWS rather than by us, which makes it the strongest outside evidence yet that the integration is real. It is now indexed on the site with its own news page, and the AWS writing index has a new section separating articles AWS wrote about us from the ones we published ourselves.</description>
</item>
+ <item>
+ <title>Deploys stop silently running the build disk out of space</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-08-04:Deploys stop silently running the build disk out of space</guid>
+ <pubDate>Tue, 04 Aug 2026 12:00:00 GMT</pubDate>
+ <category>infra</category>
+ <description>Every production deploy stages a scratch copy of the repo to build from, and nothing ever cleaned those copies up. Ten of them accumulated and filled the build machine's disk completely, which does not announce itself: the next deploy fails partway through with an unrelated-looking error, and so does the one after it. There is now a reclaimer that finds abandoned build copies and frees the space, and it is deliberately careful: it never touches a copy that holds unsaved work, and never one that another build might still be using. It runs as the first step of the deploy runbook, so the disk is checked before a build starts rather than after one has already died.</description>
+ </item>
<item>
<title>Documentation now states the correct software license</title>
<link>https://three.ws/changelog</link>
diff --git a/scripts/clean-deploy-worktrees.mjs b/scripts/clean-deploy-worktrees.mjs
new file mode 100644
index 000000000..3203a254c
--- /dev/null
+++ b/scripts/clean-deploy-worktrees.mjs
@@ -0,0 +1,239 @@
+#!/usr/bin/env node
+// clean-deploy-worktrees.mjs: reclaim the disk that abandoned deploy worktrees eat.
+//
+// The deploy runbook tells every agent to stage a clean worktree
+// (`git worktree add --detach /workspaces/.deploy-wt HEAD`) and hardlink
+// node_modules into it. Nothing ever told anyone to remove one. On 2026-08-04
+// ten of them had accumulated from three days of deploys and filled a 126 GB
+// disk to 100%, which does NOT fail loudly: the next `git worktree add` dies
+// mid-checkout with "cannot create directory: No space left on device", leaving
+// a half-written worktree, and the build that follows fails somewhere else
+// entirely. Freeing the nine stale ones returned 18 GB.
+//
+// What counts as reclaimable, and why each condition is required:
+//
+// 1. It is a linked worktree, never the main one. The main worktree is where
+// the work lives.
+// 2. Its HEAD is detached. Deploy scratch worktrees are created with
+// --detach; a worktree on a branch is somebody's feature work.
+// 3. `git status --porcelain` is clean, ignoring untracked node_modules that
+// the runbook hardlinks in. Uncommitted work is the one thing here that
+// cannot be regenerated, so a single dirty file disqualifies a worktree
+// no matter how old it is.
+// 4. Its HEAD commit is an ancestor of the current branch, or unreachable
+// from it. Either way nothing is lost: the commit is already in history,
+// or it was never going to be pushed from a detached scratch tree.
+//
+// Everything it removes is regenerable in one command, which is what makes this
+// safe to run unattended. Anything it cannot prove safe, it reports and skips.
+//
+// node scripts/clean-deploy-worktrees.mjs plan only, writes nothing
+// node scripts/clean-deploy-worktrees.mjs --apply remove the reclaimable ones
+// node scripts/clean-deploy-worktrees.mjs --apply --min-age-hours 6
+//
+// --min-age-hours (default 2) protects a worktree another agent is building in
+// right now: a concurrent deploy stages its tree and starts a build that runs
+// for ten minutes, and a sweep that ignored age would delete it mid-build.
+
+import { execFileSync } from 'node:child_process';
+import { statSync, existsSync } from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+
+const APPLY = process.argv.includes('--apply');
+const MIN_AGE_HOURS = (() => {
+ const i = process.argv.indexOf('--min-age-hours');
+ if (i === -1) return 2;
+ const n = Number(process.argv[i + 1]);
+ return Number.isFinite(n) && n >= 0 ? n : 2;
+})();
+
+function git(args, cwd = ROOT, timeoutMs = 120_000) {
+ return execFileSync('git', args, { cwd, encoding: 'utf8', timeout: timeoutMs, stdio: ['ignore', 'pipe', 'pipe'] });
+}
+
+/**
+ * Parse `git worktree list --porcelain` into one record per worktree.
+ * Pure given its input so the classifier below can be tested with fixtures.
+ *
+ * @param {string} porcelain
+ * @returns {{path:string, head:string|null, branch:string|null, detached:boolean, bare:boolean}[]}
+ */
+export function parseWorktrees(porcelain) {
+ const out = [];
+ let cur = null;
+ for (const line of porcelain.split('\n')) {
+ if (line.startsWith('worktree ')) {
+ if (cur) out.push(cur);
+ cur = { path: line.slice('worktree '.length), head: null, branch: null, detached: false, bare: false };
+ } else if (!cur) {
+ continue;
+ } else if (line.startsWith('HEAD ')) {
+ cur.head = line.slice('HEAD '.length);
+ } else if (line.startsWith('branch ')) {
+ cur.branch = line.slice('branch '.length);
+ } else if (line === 'detached') {
+ cur.detached = true;
+ } else if (line === 'bare') {
+ cur.bare = true;
+ }
+ }
+ if (cur) out.push(cur);
+ return out;
+}
+
+/**
+ * Untracked node_modules and build output are hardlinked or generated by the
+ * runbook itself, so they are not "work". Everything else counts as dirty.
+ *
+ * @param {string} porcelain output of `git status --porcelain`
+ * @returns {number} count of lines that represent real uncommitted work
+ */
+export function dirtyCount(porcelain) {
+ return porcelain
+ .split('\n')
+ .filter(Boolean)
+ .filter((l) => {
+ const file = l.slice(3);
+ if (!l.startsWith('??')) return true;
+ return !/(^|\/)(node_modules|dist|build)(\/|$)/.test(file);
+ }).length;
+}
+
+/** Bytes on disk, best effort. A directory we cannot size is still reclaimable. */
+function sizeBytes(dir) {
+ try {
+ const out = execFileSync('du', ['-sb', dir], { encoding: 'utf8', timeout: 90_000 });
+ return Number(out.split('\t')[0]) || 0;
+ } catch {
+ return 0;
+ }
+}
+
+function humanBytes(n) {
+ if (!n) return 'unknown size';
+ const units = ['B', 'KB', 'MB', 'GB', 'TB'];
+ let i = 0;
+ let v = n;
+ while (v >= 1024 && i < units.length - 1) {
+ v /= 1024;
+ i++;
+ }
+ return `${v.toFixed(1)} ${units[i]}`;
+}
+
+function ageHours(dir) {
+ try {
+ return (Date.now() - statSync(dir).mtimeMs) / 3_600_000;
+ } catch {
+ return Infinity;
+ }
+}
+
+function diskFree() {
+ try {
+ const out = execFileSync('df', ['-h', ROOT], { encoding: 'utf8', timeout: 30_000 });
+ const line = out.trim().split('\n').pop() || '';
+ const cols = line.split(/\s+/);
+ return { used: cols[2], avail: cols[3], pct: cols[4] };
+ } catch {
+ return null;
+ }
+}
+
+function run() {
+const main = git(['rev-parse', '--show-toplevel']).trim();
+const worktrees = parseWorktrees(git(['worktree', 'list', '--porcelain']));
+
+const reclaimable = [];
+const kept = [];
+
+for (const wt of worktrees) {
+ const isMain = path.resolve(wt.path) === path.resolve(main);
+ if (isMain) continue;
+
+ if (!existsSync(wt.path)) {
+ // Registered but gone: prune reclaims the registry entry, no disk to free.
+ reclaimable.push({ ...wt, reason: 'registered but missing on disk', bytes: 0, stale: true });
+ continue;
+ }
+ if (!wt.detached) {
+ kept.push({ ...wt, why: `on branch ${wt.branch || '(unknown)'}, not a deploy scratch tree` });
+ continue;
+ }
+ const hours = ageHours(wt.path);
+ if (hours < MIN_AGE_HOURS) {
+ kept.push({ ...wt, why: `modified ${hours.toFixed(1)}h ago, under the ${MIN_AGE_HOURS}h floor (a build may be running)` });
+ continue;
+ }
+ let dirty = 0;
+ try {
+ dirty = dirtyCount(git(['status', '--porcelain'], wt.path, 180_000));
+ } catch (err) {
+ kept.push({ ...wt, why: `status unreadable (${String(err.message).slice(0, 60)}), refusing to guess` });
+ continue;
+ }
+ if (dirty > 0) {
+ kept.push({ ...wt, why: `${dirty} uncommitted file(s), which cannot be regenerated` });
+ continue;
+ }
+ reclaimable.push({ ...wt, reason: `detached at ${(wt.head || '').slice(0, 9)}, clean, idle ${hours.toFixed(0)}h`, bytes: sizeBytes(wt.path) });
+}
+
+const before = diskFree();
+console.log(`git worktrees: ${worktrees.length} total, ${reclaimable.length} reclaimable, ${kept.length} kept`);
+if (before) console.log(`disk: ${before.used} used, ${before.avail} available (${before.pct})`);
+console.log('');
+
+for (const k of kept) console.log(` KEEP ${k.path}\n ${k.why}`);
+if (kept.length) console.log('');
+
+let totalBytes = 0;
+for (const r of reclaimable) {
+ totalBytes += r.bytes;
+ console.log(` RECLAIM ${r.path} (${humanBytes(r.bytes)})\n ${r.reason}`);
+}
+
+if (!reclaimable.length) {
+ console.log('Nothing to reclaim.');
+ process.exit(0);
+}
+
+console.log(`\nReclaimable: ${humanBytes(totalBytes)} across ${reclaimable.length} worktree(s).`);
+
+if (!APPLY) {
+ console.log('Plan only. Re-run with --apply to remove them.');
+ process.exit(0);
+}
+
+let removed = 0;
+for (const r of reclaimable) {
+ try {
+ // --force because a hardlinked node_modules makes git consider the tree
+ // "not clean enough" to remove even when every tracked file matches.
+ git(['worktree', 'remove', '--force', r.path], ROOT, 600_000);
+ removed++;
+ console.log(`removed ${r.path}`);
+ } catch (err) {
+ console.error(`FAILED to remove ${r.path}: ${String(err.message).slice(0, 120)}`);
+ }
+}
+try {
+ git(['worktree', 'prune']);
+} catch {
+ // A prune failure leaves stale registry entries only; the disk is already back.
+}
+
+const after = diskFree();
+console.log(`\nRemoved ${removed}/${reclaimable.length} worktree(s).`);
+if (after) console.log(`disk now: ${after.used} used, ${after.avail} available (${after.pct})`);
+}
+
+// Importing this file must not delete anything: the tests import parseWorktrees
+// and dirtyCount, and a top-level sweep would run against the real disk on
+// import. Only a direct invocation sweeps.
+if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
+ run();
+}
diff --git a/tests/clean-deploy-worktrees.test.js b/tests/clean-deploy-worktrees.test.js
new file mode 100644
index 000000000..f5b4600f1
--- /dev/null
+++ b/tests/clean-deploy-worktrees.test.js
@@ -0,0 +1,87 @@
+// Tests for the deploy-worktree reclaimer's pure decision logic
+// (scripts/clean-deploy-worktrees.mjs).
+//
+// The script deletes directories, so the two functions that decide WHAT gets
+// deleted are the ones worth pinning: the porcelain parser that identifies a
+// detached scratch worktree, and the dirty-file counter that vetoes removal.
+// A parser bug here loses uncommitted work, which is the one thing in a deploy
+// worktree that cannot be regenerated.
+
+import { describe, it, expect } from 'vitest';
+import { parseWorktrees, dirtyCount } from '../scripts/clean-deploy-worktrees.mjs';
+
+describe('parseWorktrees', () => {
+ it('separates the main worktree from detached deploy scratch trees', () => {
+ const porcelain = [
+ 'worktree /workspaces/three.ws',
+ 'HEAD 87e5c4cf5e577c9d7a36740b0ee22d16ea2ee43b',
+ 'branch refs/heads/main',
+ '',
+ 'worktree /workspaces/.deploy-wt',
+ 'HEAD d7d9035d0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+ 'detached',
+ '',
+ ].join('\n');
+ const wts = parseWorktrees(porcelain);
+ expect(wts).toHaveLength(2);
+ expect(wts[0].path).toBe('/workspaces/three.ws');
+ expect(wts[0].branch).toBe('refs/heads/main');
+ expect(wts[0].detached).toBe(false);
+ expect(wts[1].path).toBe('/workspaces/.deploy-wt');
+ expect(wts[1].detached).toBe(true);
+ expect(wts[1].branch).toBe(null);
+ });
+
+ it('reads a bare repository entry without inventing a branch', () => {
+ const wts = parseWorktrees('worktree /srv/repo.git\nbare\n');
+ expect(wts).toHaveLength(1);
+ expect(wts[0].bare).toBe(true);
+ expect(wts[0].head).toBe(null);
+ });
+
+ it('returns nothing for empty input rather than a phantom entry', () => {
+ expect(parseWorktrees('')).toEqual([]);
+ expect(parseWorktrees('\n\n')).toEqual([]);
+ });
+
+ it('ignores stray lines that precede the first worktree header', () => {
+ const wts = parseWorktrees('garbage\nHEAD abc\nworktree /a\ndetached\n');
+ expect(wts).toHaveLength(1);
+ expect(wts[0].path).toBe('/a');
+ });
+});
+
+describe('dirtyCount', () => {
+ it('counts tracked modifications, which veto removal', () => {
+ expect(dirtyCount(' M pages/wardrobe.html\n M public/changelog.json\n')).toBe(2);
+ });
+
+ it('counts staged and deleted files too', () => {
+ expect(dirtyCount('A new.js\n D gone.js\nR a.js -> b.js\n')).toBe(3);
+ });
+
+ it('ignores the untracked node_modules the deploy runbook hardlinks in', () => {
+ // Staging a worktree hardlinks node_modules, chat/node_modules and
+ // character-studio/build into it. None of that is work, and treating it
+ // as work would make every correctly-staged worktree unreclaimable.
+ const porcelain = [
+ '?? node_modules/',
+ '?? chat/node_modules/',
+ '?? character-studio/build/',
+ '?? dist/',
+ ].join('\n');
+ expect(dirtyCount(porcelain)).toBe(0);
+ });
+
+ it('still counts untracked files that are real work', () => {
+ expect(dirtyCount('?? scripts/my-new-script.mjs\n?? node_modules/\n')).toBe(1);
+ });
+
+ it('does not mistake a path merely containing "dist" for build output', () => {
+ expect(dirtyCount('?? src/distance-field.js\n')).toBe(1);
+ });
+
+ it('reads empty porcelain as clean', () => {
+ expect(dirtyCount('')).toBe(0);
+ });
+});