Runtime PR file-reduction plan
Goalβ
Reduce the runtime PR from 629 changed files to fewer than 500 without removing runtime behavior, compatibility work, or validation coverage.
Evidenceβ
- The pushed PR head matches the local merged checkout.
- At least 130 changed files must be removed from the diff.
- The largest areas are:
api/src: 241 filesrunners/hermes-binary: 170 files- Tests and fixtures: 142 files
- Git/build-related files: 74 files
Reduction strategyβ
1. Consolidate isomorphic Git and build wrappersβ
Replace repeated thin Git/build wrappers with one shared implementation, preserving their public interfaces through configuration or a small dispatch layer.
- Target: most of the 74 Git/build-related files.
- Keep behavior in the shared core; do not delete capabilities.
- Use focused tests to prove each preserved wrapper contract resolves to the same operation.
2. Collapse repeated Hermes binary adaptersβ
Identify per-command, per-platform, or per-mode adapters that differ only in declarative values. Move those values into generated or declarative metadata and route execution through one dispatcher.
- Preserve probe behavior, lifecycle boundaries, and error semantics.
- Reduce wrappers, not runtime boundaries.
3. Review test fixtures only for genuine duplicationβ
Tests and fixtures are not a deletion target by default. Consolidate only mechanically identical fixtures into parameterized cases or shared fixture builders. Retain cases that describe distinct runtime boundaries or regressions.
Do not use as file-count paddingβ
- Database migrations
- Hermes probes and runtime gates
- Container and deployment safety files
- Distinct integration fixtures
These encode compatibility, rollout safety, and verification. Removing them would reduce evidence, not only structure.
Recommended orderβ
- Map and unify Git/build wrappers.
- Map repeated Hermes binary adapters and replace only the isomorphic ones with metadata plus a dispatcher.
- Consolidate truly duplicated fixtures.
- Re-run the merged runtime checks and compare the changed-file count before considering behavioral refactors.