Skip to content
Merged
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
19 changes: 19 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"all": true,
"include": [
"bin/**/*.js",
"extensions/**/*.js",
"mcp/**/*.ts",
"server/**/*.ts",
"workers/public.ts",
"workers/screenshot.ts"
],
"reporter": ["text", "json-summary"],
"reports-dir": "coverage/node",
"temp-directory": "coverage/node/tmp",
"check-coverage": true,
"statements": 85.1,
"branches": 83.3,
"functions": 94.3,
"lines": 85.1
}
2 changes: 2 additions & 0 deletions .changeset/curly-flies-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- run: npm run format:check
- run: npm run lint
- run: npm run typecheck
- run: npm test
- run: npm run coverage
- run: npm run test:worker

- name: Release-note changeset
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ viewer/dist-embed/
.dev.vars
test-results/
playwright-report/
coverage/
16 changes: 14 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ consciously, not as a side effect):
## Validation

```sh
npm test # unit/API + store contract (node --test)
npm test # Node unit/API/store tests + viewer unit tests
npm run coverage # all-source Node/Pi + viewer unit reports and floors
npm run test:worker # real local workerd + Durable Object integration
npm run typecheck # three tsc programs: node + workers + viewer
npm run lint # oxlint, warnings are errors
npm run format:check # oxfmt
Expand All @@ -189,12 +191,22 @@ npm run test:e2e # Playwright, chromium + webkit (separate CI job);
# builds the viewer first via e2e/globalSetup.ts
```

The first five must pass before committing; e2e should pass before merge for
The first seven must pass before committing; e2e should pass before merge for
viewer/rendering changes. CI also gates PRs on changeset status and smoke-tests
the packed CLI. Pre-commit formats staged files (`npm run prepare` after a fresh clone).

Testing notes:

- Coverage is deliberately split by runtime. c8 uses `--all` for every shipped
Node/Pi source under `bin/`, `extensions/`, `mcp/`, and `server/`, plus the
Node-testable Worker exports/helpers; Vitest reports every executable
`viewer/src/` TypeScript/TSX file, including untested TSX. Do not combine those
percentages. `workers/index.ts`
runs in workerd (`npm run test:worker`) and browser behavior runs in Playwright;
both are required behavioral gates, not falsely attributed to Node coverage.
Coverage floors pin the honest baselines. Never lower one merely to make CI
green or hide shipped source to preserve a headline number; a reviewed reset is
allowed when the source inventory or instrumentation intentionally changes.
- `runStoreContract()` runs the same suite against every store. SqlStore runs
on `createSqliteStorage()` (`:memory:`), the same `node:sqlite` adapter the
local server uses on disk — so the contract covers the real Node SQLite path.
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ browser, so the action is shown but disabled.

```sh
npm run dev # server with watch + viewer watch build
npm test # node --test (unit/API + store contract)
npm test # Node unit/API/store tests + viewer unit tests
npm run coverage # separate all-source Node and viewer-TS coverage reports
npm run test:worker # real local workerd + Durable Object integration
npm run typecheck # three tsc programs: node + workers + viewer
npm run lint # oxlint
npm run format # oxfmt
Expand All @@ -187,7 +189,10 @@ npm run format # oxfmt
The server and CLI have no build step — TypeScript runs directly on Node via
native type-stripping, and the npm package ships compiled JS built on prepack.
The viewer (`viewer/src/`, Solid) is Vite-built into a single self-contained
`viewer/dist/index.html` (`npm run build:viewer`). See
`viewer/dist/index.html` (`npm run build:viewer`). Coverage is reported separately
for Node/Pi code and viewer unit tests rather than combining incompatible runtimes;
the Worker entrypoint is exercised in `workerd` and browser behavior in Playwright,
neither of which is folded into a misleading Node percentage. See
[AGENTS.md](AGENTS.md) for the full architecture and rules.

## Sponsor
Expand Down
Loading
Loading