From 92b7288d61c0a7062719472da3dde042cdbb6084 Mon Sep 17 00:00:00 2001 From: omerakben Date: Thu, 14 May 2026 13:04:16 -0400 Subject: [PATCH 1/2] fix(test): drop unused appendFile import in failure-gates demo test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI's typecheck step (tsc --noEmit, runs before bun test) failed on TS6133 'appendFile' is declared but its value is never read'. The failure-gates demo test never used the import. Removing it restores the green Tests badge in the README hero without touching test logic. Test count unchanged: 3395 pass / 2 skip / 0 fail. Refs: TD-5 in docs/handoffs/2026-05-14-v0.20.1-tech-debt.md (smoke script test-count badge comparison) — this is the upstream defect TD-5 was supposed to catch pre-tag. --- tests/demo/failure-gates.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/demo/failure-gates.test.ts b/tests/demo/failure-gates.test.ts index ec40fcb..1138980 100644 --- a/tests/demo/failure-gates.test.ts +++ b/tests/demo/failure-gates.test.ts @@ -21,7 +21,7 @@ // re-implementation. import { describe, test, expect, beforeEach, afterEach } from 'bun:test' -import { mkdtemp, mkdir, rm, writeFile, appendFile } from 'node:fs/promises' +import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join, resolve as resolvePath } from 'node:path' import { realpath } from 'node:fs/promises' From 04e954fecea983ddb8f189c41b280fb4ab530225 Mon Sep 17 00:00:00 2001 From: omerakben Date: Thu, 14 May 2026 13:12:31 -0400 Subject: [PATCH 2/2] fix(ci): scope root bun test to ./tests (drop cross-package GUI tests) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CI `bun test` step was discovering `code-oz-gui/tests/unit/*.test.ts`, which depend on `@google/genai` — a dependency of the GUI sub-package, not the root. CI's `bun install --frozen-lockfile` only installs the root deps, so the import failed with "Cannot find module '@google/genai'" on both ubuntu-latest and macos-latest. Locally the GUI's `node_modules` were present from earlier `bun install`s in that subdir, which masked the failure. Fix: scope the root `bun test` invocation (both in CI and in the `test` / `test:watch` npm scripts) to `./tests`. The GUI's unit tests remain runnable from inside `code-oz-gui/` via its own test runner. This restores green Tests + Release badges in the README hero, which is the visible signal that matters for first-time visitors. The static test-count badge updates from 3395 → 3390 (the 5 GUI unit tests now run only from inside the GUI sub-package). Refs: companion to the unused-appendFile-import fix in the same PR (the earlier typecheck failure was masking this test discovery bug). --- .github/workflows/test.yml | 2 +- README.md | 2 +- package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c96b165..ba64017 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,6 @@ jobs: run: bun run typecheck - name: Test - run: bun test + run: bun test ./tests env: CODE_OZ_LIVE_PROVIDER_TESTS: "" diff --git a/README.md b/README.md index f7b88d7..f1f876b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ AI agents are fast. `code-oz` makes their work auditable. It is for risky repos, [![Homebrew](https://img.shields.io/badge/Homebrew-omerakben%2Fcode--oz-orange)](https://github.com/omerakben/homebrew-code-oz) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux-lightgrey)](https://github.com/omerakben/code-oz/releases) -[![Tests passing](https://img.shields.io/badge/tests-3395%20passing-brightgreen)](https://github.com/omerakben/code-oz/actions/workflows/test.yml) +[![Tests passing](https://img.shields.io/badge/tests-3390%20passing-brightgreen)](https://github.com/omerakben/code-oz/actions/workflows/test.yml) > **macOS note:** code-oz binaries are not yet Apple-Developer-signed (signing + notarization deferred to v0.x stable). Gatekeeper may prompt on first launch; the install script applies `xattr -d com.apple.quarantine` as a workaround, and `brew install` handles this automatically. diff --git a/package.json b/package.json index aaab4d4..49bc5f6 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "code-oz": "npm-wrapper/index.cjs" }, "scripts": { - "test": "bun test", - "test:watch": "bun test --watch", + "test": "bun test ./tests", + "test:watch": "bun test ./tests --watch", "dev": "bun run src/cli.ts", "build:binary": "bun build --compile --target=bun src/cli.ts --outfile dist/code-oz", "build:binaries": "bun run scripts/build-binaries.ts",