Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
932469d
ci: pin the Deno runtime floor and probe explicit resource management
ofriw Oct 27, 2026
e3426ea
ci: split type check and runtime floor probes into separate steps
ofriw Oct 16, 2026
d7a699c
ci: install Playwright browsers on Node and pin its version
ofriw Oct 16, 2026
28d413a
ci: verify committed system assets stay fresh with pinned esbuild
ofriw Oct 16, 2026
72022a6
chore: ignore local agent harness state
ofriw Oct 16, 2026
71c54d4
fix(cli): append .exe for Windows targets and return compiled path fr…
ofriw Oct 16, 2026
7c30215
fix(ci): fail the run when Deno tests fail
ofriw Oct 16, 2026
06c160b
chore(npm): add a type-check surface for public entrypoints
ofriw Oct 18, 2026
51c3bcc
refactor(base): use runtime id and typed config in getEnvVar
ofriw Oct 18, 2026
fea2dde
fix(test-runner): validate worker timeout, report heartbeats and coll…
ofriw Oct 23, 2026
12c956c
build(npm): share the production manifest and gate package archives
ofriw Oct 23, 2026
c435ac2
fix(cli): ship dotfile templates and fail init on install errors
ofriw Oct 23, 2026
8b3aef9
build(deps): declare fast-check, react-dom, and chokidar
ofriw Oct 26, 2026
9df4276
ci: verify npm archive contents and path contract
ofriw Oct 26, 2026
a0a6dc1
fix(system-info): report invalid hardware config as a validation error
ofriw Oct 26, 2026
9526ce5
chore(logging): use type-only imports in log entries
ofriw Oct 26, 2026
64c455b
fix(json-log): type the worker postMessage transfer list
ofriw Oct 27, 2026
01769e7
feat(tests): report skipped tests and gate them with --fail-on-skip
ofriw Oct 27, 2026
32774b3
chore(assets): rebuild system assets
ofriw Oct 27, 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
35 changes: 19 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
deno-version: v2.3.3 # floor: native explicit resource management (V8); see denoland/deno#29282

- uses: actions/setup-node@v4
with:
Expand All @@ -30,9 +30,22 @@ jobs:
- name: Install npm dependencies
run: rm -rf node_modules && npm install

- name: Type check and runtime floor probe
run: |
deno task check
deno eval 'using x = { [Symbol.dispose]() {} };'
# deno eval defaults to TypeScript; --ext=js guards the native JS path.
deno eval --ext=js 'using x = { [Symbol.dispose]() {} };'

- name: Build npm artifact
run: npm run build:npm

# Publication check: the archive must contain every export, bin, and
# template. Source tests validate the checkout; this validates the
# release artifact.
- name: Verify npm archive contents
run: deno task verify:npm-archive

# Extract version once from deno.json; reused across all publish steps (DRY).
- name: Extract version from deno.json
id: extract_version
Expand All @@ -41,23 +54,13 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

# Rewrite package.json version + exports for npm publish.
# In the repo, exports point to .ts source (for local dev/tests). Here we switch to dist/.
# In the repo, exports point to .ts source (for local dev/tests). The shared
# transform in scripts/npm-manifest.ts switches them to dist/. The package
# contract test applies the same transform, so a shipped-manifest
# regression fails the gate rather than the release.
# This runs AFTER npm install + build so the lockfile matches during install.
- name: Sync version and exports from deno.json → package.json
run: |
deno eval --node-modules-dir=none "
import pkg from './package.json' with {type:'json'};
import cfg from './deno.json' with {type:'json'};
pkg.version = cfg.version;
pkg.exports = {
'.': { import: './dist/mod.js', types: './dist/mod.d.ts' },
'./react': { import: './dist/react/hooks.js', types: './dist/react/hooks.d.ts' },
'./server': { import: './dist/server.js', types: './dist/server.d.ts' },
'./server/build': { import: './dist/server-build.js', types: './dist/server-build.d.ts' },
'./link': { import: './dist/cli/link.js', types: './dist/cli/link.d.ts' },
};
await Deno.writeTextFile('./package.json', JSON.stringify(pkg, null, 2) + '\n');
"
run: deno run -A scripts/npm-manifest.ts

- name: Publish to JSR
run: |
Expand Down
111 changes: 107 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,73 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
deno-version: v2.3.3 # floor: native explicit resource management (V8); see denoland/deno#29282

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24.x'

- name: Type check
run: deno task check

- name: Path contract pre-check
run: deno task test:paths
env:
FC_SEED: 42

- name: Runtime floor probe (TypeScript)
run: deno eval 'using x = { [Symbol.dispose]() {} };'

- name: Runtime floor probe (native JavaScript)
# deno eval defaults to TypeScript; --ext=js guards the native JS path.
run: deno eval --ext=js 'using x = { [Symbol.dispose]() {} };'

- name: Run Deno tests
run: deno task test --runtime=deno
env:
CI: true
FC_SEED: 42

- name: Run Node.js tests
run: deno task test --runtime=node
env:
CI: true
FC_SEED: 42

package-validation:
name: Package Archive
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.3.3 # floor: native explicit resource management (V8); see denoland/deno#29282

# Validates the JSR upload set and publish-time specifier rewriting
# without publishing. The compile E2E links local source, so it cannot
# cover this package-boundary contract.
- name: Validate JSR package
run: deno publish --dry-run

system-assets-check:
name: System Assets Freshness
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.3.3 # floor: native explicit resource management (V8); see denoland/deno#29282

- name: Rebuild system assets
run: deno task build

- name: Verify system assets are fresh
run: git diff --exit-code -- system-assets/assets.json

docs-build:
name: Docs Build
Expand All @@ -45,7 +96,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
deno-version: v2.3.3 # floor: native explicit resource management (V8); see denoland/deno#29282

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -69,6 +120,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.3.3 # floor: native explicit resource management (V8); see denoland/deno#29282

- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -77,9 +133,46 @@ jobs:
- name: Install npm dependencies
run: npm install

- name: Type check npm surface
run: npm run check:npm-types

- name: Build npm package
run: npm run build:npm

# Archive membership is checked on every push, not only at tag time.
# Same verifier as publish, so a staging regression fails the PR.
- name: Verify npm archive contents
run: deno task verify:npm-archive

build-contract:
name: Build Contract
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.3.3 # floor: native explicit resource management (V8); see denoland/deno#29282

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24.x'

- name: Install npm dependencies
run: npm install

# Builds the current checkout. The suite loads dist in place and must not
# install the package or resolve it from a registry. `prefer-offline`
# keeps the registry traffic down without failing on a dependency that
# the cache does not hold yet.
- name: Package contract
run: deno task test:package
env:
GOATDB_TEST_PACKAGE: '1'
npm_config_prefer_offline: 'true'

test-browser:
name: Browser Tests
runs-on: ubuntu-latest
Expand All @@ -89,7 +182,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
deno-version: v2.3.3 # floor: native explicit resource management (V8); see denoland/deno#29282

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -105,7 +198,17 @@ jobs:
playwright-

- name: Install Playwright browsers and system dependencies
run: deno run -A npm:playwright@^1.48.0 install --with-deps chromium
# Runs under Node, not Deno: Playwright's downloader passes a `lookup`
# option that Deno's node:http does not implement. Tests still run on Deno.
# Version comes from deno.json so the install and the test runner cannot drift.
# deno.json must stay strict JSON (no comments): the probe reads it with require().
run: |
PLAYWRIGHT_VERSION=$(node -e "console.log(require('./deno.json').imports.playwright.split('@').pop().replace(/^[\^~]/, ''))")
if [ -z "$PLAYWRIGHT_VERSION" ]; then
echo '::error::Could not parse the playwright version from deno.json imports.playwright (expected e.g. npm:playwright@1.64.1)'
exit 1
fi
npx --yes "playwright@${PLAYWRIGHT_VERSION}" install --with-deps chromium

- name: Run browser tests
run: deno task test --runtime=browser
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ temp_bench_*
.chunkhound.json
.mcp.json

# Agent harness state (local only)
.pi/

# API docs build artifacts
docs/api.json

Expand All @@ -26,6 +29,9 @@ docs/api.json
# npm build artifacts
dist/

# npm entrypoint guard test temp dirs
.npm-entrypoints-*

# Benchmark JSON output (generated by deno task bench:json)
benchmarks/results/

Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,36 @@ and are pinned by characterization tests:
and do not start loading. A fresh unobserved query reports `loading === false`
and, when `queryInactivityTimeoutMs` is set, is eligible for auto-close. A
closed query is replaced by calling `db.query()` again.
- `compile()` now resolves to the path of the compiled executable
(`Promise<string>`). Callers that ignore the value need no change.

### Changed

- `goatdb init` on Deno now requests `react`, `react-dom`, `yargs` and
`@types/react` as `^` ranges and installs all dependencies in one
`deno add` call, bounded by a 180s timeout. Exact pins let a transitive
peer resolve a newer `react` than `react-dom`, which crashes at runtime
with "Incompatible React versions".
- `GOATDB_TEST_TIMEOUT_MS` now sets the whole-worker timeout and is validated
strictly: non-integer values and values outside `1` to `2147483647` abort the
run with an explicit error instead of silently using the 5-minute default.
Workers send a heartbeat every 10 seconds, and a timeout reports the active
suite and test, the test's elapsed time and the last heartbeat age.

### Fixed

- `deno compile` output names now include `.exe` for Windows targets, so
`compile()` returns and logs the path that the compiler actually writes.
- `goatdb init` now scaffolds `.gitignore` and `.npmrc` again when run from
the published npm package. `npm pack` drops dotfile sources, so the
templates use plain names (`gitignore`, `npmrc`) that `init` maps back to
their dotted targets.
- `goatdb init` now exits non-zero when dependency installation fails,
reporting the command, its exit code and its output. Previously a failed
`npm install` only warned, so a broken scaffold looked successful.
- The test runner no longer stops at the first failing runtime. Deno, Node and
browser results are all collected, and the process exits non-zero with the
combined failures.

### Breaking Changes

Expand Down
5 changes: 5 additions & 0 deletions base/browser-runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { kMinuteMs, kSecondMs } from './date.ts';
import { ProcessManager } from './process-manager.ts';
import { getEnvVar } from './os.ts';

/**
* Options for running browser-based tests or benchmarks.
Expand Down Expand Up @@ -121,6 +122,10 @@ export async function runBrowserTests(
if (options.benchmark) {
env['GOATDB_BENCHMARK'] = options.benchmark;
}
const failOnSkip = getEnvVar('GOATDB_FAIL_ON_SKIP');
if (failOnSkip) {
env['GOATDB_FAIL_ON_SKIP'] = failOnSkip;
}

// Start debug server with HTTPS using the appropriate entry point
const serverArgs = [
Expand Down
2 changes: 1 addition & 1 deletion base/file-watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function createQueuedWatcher(
}

function createChokidarWatcher(
chokidar: typeof import('chokidar'),
chokidar: { watch: typeof import('chokidar').watch },
dir: string,
): FileWatcher {
const underlying = chokidar.watch(dir, {
Expand Down
8 changes: 7 additions & 1 deletion base/json-log/json-log-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,12 @@ export function jsonLogWorkerMain(): void {
gPostMessage = (msg, transfer) => parentPort.postMessage(msg, transfer);
} else {
onmessage = safeHandler;
gPostMessage = (msg, transfer) => postMessage(msg, transfer ?? []);
// lib.dom types postMessage as a window API; the worker runtime accepts a
// transfer list. Cast at the runtime boundary.
gPostMessage = (msg, transfer) =>
(postMessage as (
message: unknown,
transfer?: Transferable[],
) => void)(msg, transfer ?? []);
}
}
Loading
Loading