@pleasantmachines/kento-contract
v0.1.0
Published
Tests of `@kento/runtime` and the packages above it (`@kento/authority`, `@kento/navigation`, `@kento/frames`, `@kento/fuzz`) through whole games, where an engine test with a toy game would not show the contract holding for a real consumer (save codecs, i
Readme
@kento/contract: the runtime contract suite
Tests of @kento/runtime and the packages above it (@kento/authority, @kento/navigation, @kento/frames,
@kento/fuzz) through whole games, where an engine test with a toy game would not show the contract
holding for a real consumer (save codecs, input parsing, manifests, long runs across former tick caps). The engine's
own tests (engine/<package>/src/*.test.ts) come first; these add the consumer's view. They import only those
packages' public entries and the fixtures below, never a game. fuzz.test.ts fuzzes every fixture through
sessionSimulation. The fixtures are exported as @kento/contract/fixtures/<name> for other tests; labs pages import them by path.
Fixtures
fixtures/ holds the small games these tests play. Each is a complete GamePackage with its own tests; the first
four have a dev page in labs/pages/ (see labs/README.md), the last two are headless agent games with declared
scenarios (an agent export) that the agent CLI validates and recovers in real processes.
| Fixture | What it is | Used by |
| --- | --- | --- |
| movement.ts | Continuous movement at 20 ms ticks around a wall, render-rate independent | fixed, lifetime, tools/bench-runtime.mjs, page movement |
| settlement.ts | World laws (calendar, combustion, vitality, optional rain) and scheduled ignition; law add/remove migration | migration, input, game, page world-laws |
| negotiation.ts | Nonspatial dialogue game with its own versioned save codec | game, input, page negotiation |
| passage.ts | Opposed doorway traffic with admission cohorts | consumer-limits, tools/bench-traffic-progress.mjs, page passage |
| vault.ts (+ vault.agent.ts) | Turn-based exploration and combat on two maps: navigationField for the guard, placementModel for maps, occupancy and disposal; win, loss, terminal rejection, retreat, malformed checkpoints (was games/signal-run) | vault.test.ts, tools/engine/{cli,references}.test.mjs, tools/engine/browser/declarations.test.mjs (the browser bundle) |
| relays.ts (+ relays.agent.ts) | Scheduled work and entity lifetime across two maps: delayed activation, transfer with pending work, cancel, cascade removal, task-reference validation (was games/timed-relays) | relays.test.ts, tools/engine/{cli,references}.test.mjs |
They are test fixtures, not reference games: no game loads them, they are not in index.ts and not in the agent
catalog. Their pages and tools import them by path. The
contract tests that need a bigger game live with it in games/: the RTS tick-cap and obsolete-save checks in
games/iron-crossing/limits.test.ts, and frames, surface picking and replication through the framed workshop in
games/inhabited-workshop/framed/.
