Add architectural guidance for configuration system in CONTRIBUTING.md
## Problem
Several open feature requests exist around the configuration system (#5849, #5782, #5765), but contributors lack documented guidance on how the configuration architecture works and where to implement changes. This creates friction for implementing features like:
- STRYKER_CONFIG_PATH environment variable support
- Making MAX_CONCURRENT_INIT configurable
- Adding new mutators
Without this guidance, contributors must reverse-engineer the config system by reading source code, leading to slower, less consistent implementations.
## What's Missing
The CONTRIBUTING.md file should document:
1. **Configuration Flow**: How does a config option flow from user input (CLI args, env vars, config file) → parsed schema → runtime behavior?
2. **Where Configuration Lives**: Map of key files:
- `packages/core/src/config/` structure and responsibilities
- Which files handle parsing vs validation vs defaults
- Where environment variables are read (if at all currently)
3. **How to Add a Config Option**: Step-by-step walkthrough:
- Update the schema (what file?)
- Add validation logic
- Wire it to the runtime code
- Add tests
4. **Mutator Registration**: How do mutators register themselves with the core system?
## Why This Matters
- **Contributor Onboarding**: New contributors can self-serve instead of asking maintainers
- **Consistency**: Ensures all config options follow the same pattern
- **Quality**: Reduces chances of incomplete implementations missing validation or tests
- **Speed**: PRs get merged faster when the approach is pre-validated
## What Good Looks Like
Look at how other projects document this (e.g., TypeScript's architecture overview, ESLint's plugin development guide). A minimal version would include:
```
## Architecture: Configuration System
### Overview
[1-2 paragraphs explaining the flow]
### Key Files
- `packages/core/src/config/schema.ts` — JSON schema definition
- `packages/core/src/config/configReader.ts` — Loads and parses config
[...]
### Adding a Config Option
1. Update schema in `schema.ts`
2. Add validation in `configValidator.ts`
3. Wire to usage in `src/runner.ts`
4. Add test in `test/unit/config/`
### Example: Adding `maxConcurrentInit`
[Walkthrough of actual PR or commit that added a recent config option]
```
## Acceptance Criteria
- [ ] CONTRIBUTING.md has a dedicated "Configuration System" section
- [ ] Section includes config flow diagram (ASCII art OK)
- [ ] Key files mapped with 1-line descriptions of responsibility
- [ ] Step-by-step "Adding a Config Option" guide with real example
- [ ] Links to relevant source files or recent related PRs
---
*Contributed by [Klement Gunndu](https://github.com/KlementMultiverse)*
关闭于 2026-03-09 1 条评论