Skip to content

Commit 8ccc1b6

Browse files
committed
[docs] Type checks and fuzz suites in the agents guide
1 parent de6e8e1 commit 8ccc1b6

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

‎agents.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,18 @@ code rather than gulp's, so a failed `preCommit` or `prePublishPackage` looks
264264
like a success. Redirect to a file and check `$?`.
265265

266266
Tests import `tinybase` from `dist`, so run `npm run compileForTest` after
267-
changing `src` before running any test.
267+
changing `src` before running any test. That build does not check types, so
268+
also run `npx gulp ts` before committing: a change can pass every test and
269+
still not compile for a release.
270+
271+
Seeded fuzz suites live in `test/unit/core/fuzz`, and in
272+
`test/unit/synchronizers/convergence.fuzz.test.ts`, built on the helpers in
273+
`test/unit/common/fuzz.ts`. Each applies random operations and checks an
274+
invariant after every one. A failure names its seed and lists the operations
275+
that led to it, and `FUZZ_RUNS` and `FUZZ_SEED` lengthen a hunt or replay one
276+
seed. A bug that a suite finds, but that is not yet fixed, is kept as a
277+
`test.fails` case, and what the suite generates is narrowed at a place marked
278+
`KNOWN BUG`. Remove both along with the bug.
268279

269280
`test/unit/synchronizers/efficiency.test.ts` holds each synchronization scenario
270281
to a budget of messages and bytes crossing the WebSocket server. When the

‎site/guides/19_agents.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,18 @@ code rather than gulp's, so a failed `preCommit` or `prePublishPackage` looks
264264
like a success. Redirect to a file and check `$?`.
265265

266266
Tests import `tinybase` from `dist`, so run `npm run compileForTest` after
267-
changing `src` before running any test.
267+
changing `src` before running any test. That build does not check types, so
268+
also run `npx gulp ts` before committing: a change can pass every test and
269+
still not compile for a release.
270+
271+
Seeded fuzz suites live in `test/unit/core/fuzz`, and in
272+
`test/unit/synchronizers/convergence.fuzz.test.ts`, built on the helpers in
273+
`test/unit/common/fuzz.ts`. Each applies random operations and checks an
274+
invariant after every one. A failure names its seed and lists the operations
275+
that led to it, and `FUZZ_RUNS` and `FUZZ_SEED` lengthen a hunt or replay one
276+
seed. A bug that a suite finds, but that is not yet fixed, is kept as a
277+
`test.fails` case, and what the suite generates is narrowed at a place marked
278+
`KNOWN BUG`. Remove both along with the bug.
268279

269280
`test/unit/synchronizers/efficiency.test.ts` holds each synchronization scenario
270281
to a budget of messages and bytes crossing the WebSocket server. When the

0 commit comments

Comments
 (0)