Skip to main content

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 files
    • runners/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.

  1. Map and unify Git/build wrappers.
  2. Map repeated Hermes binary adapters and replace only the isomorphic ones with metadata plus a dispatcher.
  3. Consolidate truly duplicated fixtures.
  4. Re-run the merged runtime checks and compare the changed-file count before considering behavioral refactors.