Skip to content

tech-debt T7: Give the CLI a shared spine: config precedence, one worker pool, shared state #175

Description

@mmcky

.translate/config.yml's target-language is written, validated and reported by doctor — and read by nothing. Three commands hardcode 'zh-cn', so translate forward against a French edition with no -l runs the whole resync as Chinese, silently.

Also: three near-identical Logger contracts, two divergent batch barriers (a lockstep barrier rather than a pool — measured ~62% wall-clock waste at the shipped -j 5 default), a byte-for-byte duplicated realGhRunner, and translate-state.ts sitting inside src/cli/ though the Action writes the same files.

Mostly re-export-compatible; nine test files need zero edits.

Findings covered

10 audit findings land here. F<n> are stable references into the audit; rank is the report ordering (1 = act first of 139).

  • F11 · rank 7 · high · s/s — .translate/config.yml's target-language is read by nothing; forward with no -l runs a French edition as zh-cn
  • F20 · rank 41 · med · s/m — State lives in src/cli/ and is imported upward by core; four hand-rolled FileState literals disagree
  • F59 · rank 86 · low · s/s — getToolVersion() has no test oracle — Jest's CJS transform always takes the unguarded first strategy
  • F60 · rank 108 · low · s/s — status --check-sync is the only bulk LLM loop with no -j; its description still claims "no LLM calls"
  • F61 · rank 109 · low · s/s — backward and non---github forward use a lockstep batch barrier at -j 5
  • F63 · rank 110 · low · s/s — Three byte-identical logger interfaces keep BufferedLogger fenced inside backward.ts
  • F26 · rank 111 · low · s/s — forward and backward solve interleaved parallel output in opposite ways
  • F77 · rank 112 · low · t/t — realGhRunner duplicated byte-for-byte in two files, untested in either
  • F72 · rank 113 · low · t/t — Shared review domain types live in the command orchestrator rather than a types module
  • F89 · rank 114 · low · s/s — The ### Source PR and metadata-block literals are hand-copied across four modules

Plan

Estimate 3 days · Wave 2, step T7 · strict dependency order within the wave

Four small shared modules, resolveFromConfig with precedence flag > config > default, runPool replacing both batch barriers, translate-state.ts moved into src/ with one recordSync(). Mostly re-export-compatible; nine test files need zero edits.


From the technical-debt audit of 2026-07-23 (141 candidates adversarially verified, re-validated against v0.23.0, 139 live). Effort is stopgap / full — t≈0.5h, s≈3.5h, m≈11h, L≈28h. Items marked ½ were partially addressed by v0.22.0/v0.23.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorBehaviour-preserving restructuring of product source

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions