CodeVetter · Repo Unpack · Contributor handoff
mochajs/mocha
This brief is pinned to the inspected commit and provides a bounded source map. Tests and CI were inspected, not executed; future changes need authorized validation against the exact scripts. Follow the executable package and workflow configuration when onboarding prose differs. Preserve generated-output boundaries, public return contracts, and the distinction between main-process and worker lifecycles.
- Read AGENTS.md and the affected package/workflow first; its playbook calls for minimal changes, compatibility preservation, and trusting executable script configuration when prose disagrees.
- Tests and CI were inspected, not executed in this investigation; this bounded inventory is not proof of passing checks or exhaustive coverage, and smoke itself documents a package-content limitation.
- For CLI edits, read bin/mocha.js, cli.js, options.cjs, run.cjs, and run-helpers.cjs in execution order; required modules must load before legacy reporter/interface validation.
- For runner edits, preserve Mocha.run's immediate Runner return value and callback completion contract, lifecycle state guards, and event-driven stats/reporting.
- For parallel edits, verify process-based pool configuration rather than thread terminology in comments; global fixture plugins are ignored in worker bootstrap, and serialized functions are omitted.
- Never hand-edit mocha.js or mocha.js.map; Rollup owns them, and test-browser performs clean/build before browser checks. Runtime signature checks use tsc with noEmit over lib.
- When execution is authorized, use smoke plus the nearest node suite for CLI/runtime changes, test-node:reporters or test-node:interfaces for those areas, and test-browser for browser changes; inspect integration's .spec.cjs-only glob before assuming a new .spec.js test runs.
- Preserve captured timer references and named runtime ESM exports; keep docs work in its separate package, and recognize that the main test workflow ignores docs, Markdown, and .github-only changes.