Skip to content

refactor: extract preflight_check helpers + add 19 tests - #71

Open
TerminalGravity wants to merge 2 commits into
mainfrom
refactor/extract-preflight-helpers
Open

refactor: extract preflight_check helpers + add 19 tests#71
TerminalGravity wants to merge 2 commits into
mainfrom
refactor/extract-preflight-helpers

Conversation

@TerminalGravity

Copy link
Copy Markdown
Collaborator

Extracts pure helper functions from preflight-check.ts into src/lib/preflight-helpers.ts for testability. Adds 19 tests.

  • New: src/lib/preflight-helpers.ts — 5 exported pure functions
  • New: tests/lib/preflight-helpers.test.ts — 19 tests
  • Refactored: preflight-check.ts imports from shared module (no behavior change)
  • All 66 tests pass, build clean

Partial progress on #7

Adds Ollama as a local embedding provider option. Uses the /api/embed
endpoint with batch support. Defaults to nomic-embed-text model.

Configurable base URL, model name, and dimensions for flexibility
with different Ollama models.

Closes #6
- Extract extractFilePaths, detectAmbiguity, estimateComplexity,
  splitSubtasks into src/lib/preflight-helpers.ts
- Update preflight-check.ts to import from shared module
- Add 19 tests covering all extracted helpers
- All 66 tests pass, build clean

@TerminalGravity TerminalGravity left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

19 new tests + cleaner helper extraction — this is the kind of refactor that pays dividends. CI green. Ready for merge.

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