Repository navigation
EN Contribute Coverage Ratchet
Français · Type: how-to · Audience: contributor · Context: engine repository · Status: ready · Applies from: 4.2.3
The coverage floors of vite.config.ts only rise. Two checks hold them: Vitest fails when the tests reach less than a
floor, and the ratchet fails when a floor lags three points or more behind what the tests reach. This page says what
to do when either is red.
A coverage job green again: every floor met, and every floor within three points of what the tests measure.
The engine repository. The floors date from 4.1.0 "Clarity" (the level measured then); the ratchet,
tools/coverage-ratchet.ts, from 4.1.3; its GitHub annotations from 4.1.9.
What is measured: V8 coverage of src/**/*.ts (not *.d.ts), bridge/src/**/*.ts and studio-server/src/**/*.ts,
by the unit suite and the asset tests (npm run test:coverage). The floors as of 4.4.0:
| Scope | Floor |
|---|---|
| All measured files | lines 75, statements 74, functions 71, branches 70 |
src/engine/core/{cond,diff,migrate,save}.ts |
branches 100 |
src/engine/core/session-runtime.ts, tools/replay.ts, core/content-ids.ts
|
branches 94, 99, 96 |
src/engine/core/reality-runtime.ts, reality/protocol.ts, reality/client.ts, reality/http-port.ts
|
lines and branches, 90 to 100 |
| 23 files of the Studio Server (the journal, the gate, OIDC, leases, previews, the worker's jobs…) | lines and branches, set two points under what was measured when each arrived |
6 files of the Bridge (bridge.ts, store.ts, server.ts, policy.ts, lock.ts, cli.ts) |
lines and branches |
The exact values are in vite.config.ts, test.coverage.thresholds, with the reason for each
floor below 100 written beside it.
Limit ·
lines-not-proofCoverage counts lines and branches run, not results checked. The browser-only parts ofsrc/(the player's UI and the Studio's) are covered by the e2e, not by this measure; whether the tests tell a right result from a wrong one is Mutation testing's question.
A prepared repository with Python and its image modules (Developer setup): the asset tests run under coverage too.
In the engine repository, on your machine. CI runs the same in its coverage job.
-
Measure.
# in the engine repository npm run test:coverageIt runs the unit suite under coverage and writes
.cache/coverage/(a text summary,coverage-summary.json, an HTML report in.cache/coverage/index.html). Vitest fails here when a floor is not met, naming the file and the metric.
-
A floor not met (the tests reach less than it): your change removed tests or added code no test runs. Add the
tests; open
.cache/coverage/index.htmlto see the lines and branches not run. A floor is never lowered to let a change through.
-
Read the ratchet.
# in the engine repository, after test:coverage npx tsx tools/coverage-ratchet.ts # warns npx tsx tools/coverage-ratchet.ts --strict # fails, as on main
Each line
⚠ <scope> <metric>: floor <n>, measured <m>is a floor three points or more under what the tests reach. The end says✔ every coverage floor is within three points of what the tests reach, or the count to raise.
-
Raise the floors it names in
vite.config.ts(test.coverage.thresholds), to a value at or a little under what was measured, and commit them with the change that earned them.vite.config.tsis a file the maintainer reviews (CODEOWNERS).
Limit ·
ratchet-scopeThe ratchet reads only the floors that exist: a file without a floor of its own is held by the global floors alone. A per-file floor applies when the summary holds that file.
npm run test:coverage passes and npx tsx tools/coverage-ratchet.ts --strict exits 0. In CI, the coverage job is
green with no "coverage ratchet" annotation.
| Symptom | Cause | Fix |
|---|---|---|
| Vitest: a threshold for lines, branches, functions or statements not met | Fewer lines run than the floor | Add tests (step 2) |
⚠ coverage ratchet annotation on a pull request |
A floor three points or more under the measure | Not blocking on a pull request: raise it (step 4), or leave it to the next change |
✖ n floor(s) at least 3 points below… on main, a tag or release-check
|
The same, under --strict
|
Raise the floors, in a pull request |
✖ …: no coverage summary (npm run test:coverage first) |
The ratchet ran without a measure | Run npm run test:coverage first (exit 2 otherwise) |
vite.config.ts (the floors); the measure writes only .cache/coverage/.
A floor raised too high fails the next run: lower it back to what the tests reach (with the reason in the pull request), since a floor above the measure is a red build, not a promise.
Generated publication · publication générée — current documentation · documentation courante: quest'n'click 4.4.0 r1, documentation revision · révision de la documentation 8dc717c69acb62c4742b69c54a7e7dfb620f75d8.
Earlier versions and permalinks · versions précédentes et liens permanents: https://wanoo.github.io/quest-n-click/docs/
An edit made in this wiki is overwritten at the next publication · une modification faite dans ce wiki est écrasée à la publication suivante.
Edit the source · Modifier la source · Report an error · Signaler une erreur
Index (6)
Start (6)
Play (9)
Install (17)
- Requirements
- Install from the release archive
- Install from npm, once published
- Install from the repository to work on the engine
- doctor: checking your machine
- Image toolchain
- Audio toolchain: ffmpeg, fluidsynth, Furnace, uv
- Upgrade
- Upgrade notes: 4.4
- Upgrade notes: 4.3
- Upgrade notes: 4.2
- Upgrade notes: 4.1
- Upgrade notes: v3
- Upgrade notes: v2 to v3
- Coming from web-scumm
- Package reference
- Install troubleshooting
Create a game (55)
- Your first game
- Layout of a created project and of the engine repository
- The working loop
- Content principles and the identity contract
- Rooms
- Geometry: placement, walk zones, masks, layers, camera
- Something is visible but unreachable
- Reactions
- Game commands
- Conditions
- Flags, variables and events: which to use
- Custom code
- Characters
- Items and inventory
- World map
- Dialogues
- Scripts and events
- Moving characters: patrols and walks
- Exits
- Chapters and objectives
- State and saves: persistent or temporary, renaming an id, migrations
- Staging: wide rooms and animations
- The stage: lights, particles, floors
- Skin and fonts
- Title and credits
- Heroes: several characters and hero choice
- Built-in minigames
- A custom minigame
- Translations
- Music in stems
- Sound effects
- Voices: per language and per hero
- Images: prompts, cutting sheets, transparency, scale
- Asset provenance
- The storyboard, source of truth
- Puzzle design
- Classic mechanics
- Review pages
- DSL reference
- Checking your game
- What the solver proves
- Solver options
- Playtests
- Remix
- Speedrun for authors
- The sealed ending
- Production template
- Example games
- Working with an AI
- Build and release a game
- Publish on GitHub Pages
- The static game on Clever Cloud
- Other static hosts
- Sub-path, cache and service worker, incomplete deploys, going back
- Testing on a phone over the LAN
Local Studio (24)
- The local Studio: overview and launch
- Edit a room
- Placement and stage
- Preview, apply, undo
- Storyboard
- Assets and cutting
- Check: validator, solver, critical path, heat, health, coverage
- Before and after captures
- Semantic diff
- Play and replay a session
- Rule explainer
- Language and objectives
- Voices and the heroes × languages matrix
- Map
- Notes
- Remix in the Studio
- Music
- The Assistant: bring your own key
- Demo mode and studio-apply
- Local and LAN security
- Studio API
- Local MCP: setting up each client
- MCP tools
- Studio troubleshooting
Team Studio (21)
- What runs where
- Concepts: revision, transaction, span, lease, preview, build
- Starting as an invited dev
- Working together day to day
- Roles and actions: the full matrix
- Invitations
- Managing members
- Write refused on the hosted Studio: stale base revision (409)
- Write refused on the hosted Studio: span locked (423)
- Recovering after a lost lease, a disconnection or a stale preview
- Comments
- Map and semantic diff
- Publishing builds
- Remote MCP
- The game in Git
- Upgrading the engine of a hosted game
- Hosted assets
- The server's command line
- Health and metrics routes
- Trying it locally with compose.yml
- Known limits
Clever Cloud (23)
- Clever Cloud: overview, cost and prerequisites
- Apps and add-ons
- Domains and TLS
- Keycloak
- Generic OIDC and GitLab
- Configuration
- First deployment
- Backups
- RPO and RTO
- Restore the Studio on a fresh installation
- Redeploys
- Upgrading the server and checking state after a migration
- Limits of going back
- Monitoring
- Security
- Rotating keys
- Recovering admin access
- Changing domain or OIDC provider
- Worker, PostgreSQL or Cellar down
- Exporting the game and leaving the installation
- Retention
- Clever Cloud troubleshooting
- Costs and teardown
Reality Bridge and connectors (16)
- The Reality Bridge: what it is
- Quick start
- Guarantees
- Install and run the Bridge
- Backup and restore
- Several tenants
- Signals and the manifest
- The Bridge's command line
- Connectors overview
- Email connector
- Telnet connector
- SSH connector
- Open Badges connector
- The connector SDK
- Security: Biscuit and signatures
- Bridge and connector troubleshooting
Contribute (25)
- Welcome
- Developer setup
- The dev loop
- Before a pull request
- Conventions
- Writing documentation
- Architecture
- Code tour
- Import boundaries
- Which tests run when
- Mutation testing
- The coverage ratchet
- The quality baseline
- CI explained
- Field passes
- Benchmarks
- Releasing
- npm packages
- Decisions and ADRs
- Governance
- Bot pull requests
- Contributing with AI agents
- Security policy
- Code of conduct
- Licences and credits