Skip to content

♻️ Extract TDD runtime context assembly#266

Merged
Robdel12 merged 1 commit into
mainfrom
rd/tdd-runtime-split-1
May 19, 2026
Merged

♻️ Extract TDD runtime context assembly#266
Robdel12 merged 1 commit into
mainfrom
rd/tdd-runtime-split-1

Conversation

@Robdel12
Copy link
Copy Markdown
Contributor

Why

src/tdd/tdd-service.js is one of the highest-risk maintenance surfaces in the CLI. Before deeper runtime decomposition, we need a safer constructor shape with explicit seams.

This PR extracts constructor runtime/dependency assembly into a dedicated module so we can keep behavior stable while making follow-up splits smaller and safer.

What Changed

  • Added src/tdd/runtime-context.js:
    • buildTddDependencyOps(...)
    • resolveTddWorkingDirectory(...)
    • resolveTddPaths(...)
  • Updated src/tdd/tdd-service.js constructor to use the extracted runtime-context helpers.
  • Added focused unit coverage in tests/tdd/runtime-context.test.js.

Verification

  • npm run lint
  • node --test tests/tdd/runtime-context.test.js tests/tdd/tdd-service.test.js

Notes

This is intentionally behavior-preserving. It is PR 1 in the new tech-debt train and sets up the next TDD runtime split slices.

Why: reduce constructor complexity in tdd-service by isolating dependency merging and runtime bootstrap logic into a focused module that is easier to test and reason about.

What changed: moved grouped dependency composition plus working-directory/path resolution into src/tdd/runtime-context.js and added dedicated unit coverage.
@vizzly-testing
Copy link
Copy Markdown

vizzly-testing Bot commented May 19, 2026

Vizzly - Visual Test Results

CLI Reporter - Approved

19 comparisons, no changes detected.

View build

CLI TUI - Approved

5 comparisons, no changes detected.

View build


rd/tdd-runtime-split-1 · 2e6820d5

@Robdel12 Robdel12 merged commit bf65150 into main May 19, 2026
30 checks passed
@Robdel12 Robdel12 deleted the rd/tdd-runtime-split-1 branch May 19, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant