This file is the source of truth for day-to-day engineering standards in this repository.
- Every behavior change MUST include tests in the same pull request.
- Bug fixes MUST include a regression test that fails before the fix and passes after.
- New public APIs MUST include at least one usage-level test.
- Refactors that alter control flow MUST include safety tests, even if behavior is intended to stay the same.
- PRs that change logic without tests are not merge-ready.
- Core engine logic (
retrostash-core): add/update unit tests incommonTest. - OkHttp adapter logic (
retrostash-okhttp): add/update JVM unit tests insrc/jvmTest. - Ktor plugin behavior (
retrostash-ktor): add/update KMP/JVM tests for plugin metadata and interception behavior. - Annotation/metadata parsing changes: add parser/extractor tests for old and new annotation shapes.
- Serialization/key-resolution changes: include nested body, escaped string, missing placeholder, and happy-path tests.
A change is done only when all are true:
- Code compiles.
- Relevant tests are present and pass.
- Existing module checks pass.
- Public API changes include docs or KDoc updates.
- No known warnings are introduced without rationale.
Run the minimum impacted checks plus the baseline suite:
./gradlew :retrostash-core:jvmTest :retrostash-core:iosSimulatorArm64Test./gradlew :retrostash-okhttp:jvmTest :retrostash-okhttp:assemble./gradlew :retrostash-ktor:jvmTest :retrostash-ktor:iosSimulatorArm64Test./gradlew :retrostash-annotations:assemble
If a change is module-specific, run its focused tests first, then run affected integration modules.
- Preserve backward compatibility unless intentionally versioned as breaking.
- If introducing a replacement API, keep compatibility aliases for at least one release cycle.
- Document migration steps for any breaking changes.
- Avoid transport-coupled behavior in core modules.
- Keep PRs narrowly scoped.
- Review for behavior regressions first, style second.
- Reject "works locally" claims without test proof.
- Any skipped test requirement must include explicit written justification.
- Use clear commit messages describing behavior impact.
- Separate mechanical edits from behavioral changes when possible.
- Do not mix unrelated refactors with feature work.
- Update docs when public API or integration flow changes.
- Keep examples aligned with current module names and APIs.
- Never leave stale snippets that reference removed symbols.
Exceptions are rare and must include:
- Reason tests are not added.
- Risk assessment.
- Follow-up issue with owner and due date.
Without all three, the exception is invalid.