167: Add fj/rg tool-detection helpers (rgAvailable, detectFjState) with unit tests #176

Merged
david merged 2 commits from feature/issue-167/add-fj-rg-tool-detection-helpers-rgavailable-detec into main 2026-09-08 01:16:15 +00:00
Owner

167: Add fj/rg tool-detection helpers (rgAvailable, detectFjState) with unit tests

Implements 167.

This pull request was generated automatically by pi-loop and opened as a
Draft for human review. Do not merge without reviewing the changes.

Generated in 8m 44s.

Review findings

Confirms the same 2 pre-existing failures noted in the review (unrelated to this change). All new tests pass, and no regressions introduced by my edits.

Review Findings — 167

Summary

Fixed the Medium finding by adding an explanatory comment at the preflight() duplication site noting it's temporary pending a follow-up refactor, and fixed the Low finding by rewrapping the makeShimDir() doc comment line that ran long after the withFj addition. Left the second Low finding (no lint/format tooling configured in the repo) unresolved as it's explicitly out of scope — it recommends a separate chore issue, not an in-place fix. Re-ran npm test: 90/92 pass; the same 2 pre-existing failures noted in the original review (macOS tmpdir symlink mismatch, stale mongodb manifest assertion) persist unchanged and are unrelated to this diff — no regressions introduced.

Critical

(none)

High

(none)

Medium

  • scripts/local-install.mjs:271-274 — detectFjState() duplicates the fjAuth/ok/trim-check logic that still lives inline in preflight() (scripts/local-install.mjs:377-382). This is expected for this step per the issue's explicit scoping, but leaves two copies of the same "is fj usable" logic in the file until the follow-up step lands. Suggested fix: add a short inline comment at scripts/local-install.mjs:377 noting the duplication is temporary and will be removed when preflight() is refactored to call detectFjState() (tracked in a follow-up issue), so future readers don't mistake it for an oversight.

Low

  • scripts/local-install.test.mjs:57 — the makeShimDir() doc comment line ("...to the shim dir so the availability check actually fails. With notAGitRepo the") runs past the file's otherwise-consistent ~80-col wrap used elsewhere in the same comment block. Suggested fix: rewrap the sentence so the withFj addition doesn't push this line long.
  • scripts/local-install.mjs:258,270 — no lint/format tooling is configured in this repo (no eslint/biome/prettier config, no lint script), so future stylistic drift on new exports like these two functions won't be caught automatically. Suggested fix: out of scope for this change, but worth a separate chore issue to add a minimal formatter/linter config.
## 167: Add fj/rg tool-detection helpers (rgAvailable, detectFjState) with unit tests Implements [167](https://git.excelera.net/david/pi-extensions-and-skills/issues/167). > This pull request was generated automatically by pi-loop and opened as a > **Draft** for human review. Do not merge without reviewing the changes. Generated in 8m 44s. ## Review findings Confirms the same 2 pre-existing failures noted in the review (unrelated to this change). All new tests pass, and no regressions introduced by my edits. # Review Findings — 167 ## Summary Fixed the Medium finding by adding an explanatory comment at the `preflight()` duplication site noting it's temporary pending a follow-up refactor, and fixed the Low finding by rewrapping the `makeShimDir()` doc comment line that ran long after the `withFj` addition. Left the second Low finding (no lint/format tooling configured in the repo) unresolved as it's explicitly out of scope — it recommends a separate `chore` issue, not an in-place fix. Re-ran `npm test`: 90/92 pass; the same 2 pre-existing failures noted in the original review (macOS tmpdir symlink mismatch, stale mongodb manifest assertion) persist unchanged and are unrelated to this diff — no regressions introduced. ## Critical _(none)_ ## High _(none)_ ## Medium - [x] scripts/local-install.mjs:271-274 — `detectFjState()` duplicates the `fjAuth`/`ok`/trim-check logic that still lives inline in `preflight()` (scripts/local-install.mjs:377-382). This is expected for this step per the issue's explicit scoping, but leaves two copies of the same "is fj usable" logic in the file until the follow-up step lands. Suggested fix: add a short inline comment at scripts/local-install.mjs:377 noting the duplication is temporary and will be removed when `preflight()` is refactored to call `detectFjState()` (tracked in a follow-up issue), so future readers don't mistake it for an oversight. ## Low - [x] scripts/local-install.test.mjs:57 — the `makeShimDir()` doc comment line ("...to the shim dir so the availability check actually fails. With `notAGitRepo` the") runs past the file's otherwise-consistent ~80-col wrap used elsewhere in the same comment block. Suggested fix: rewrap the sentence so the `withFj` addition doesn't push this line long. - [ ] scripts/local-install.mjs:258,270 — no lint/format tooling is configured in this repo (no eslint/biome/prettier config, no `lint` script), so future stylistic drift on new exports like these two functions won't be caught automatically. Suggested fix: out of scope for this change, but worth a separate `chore` issue to add a minimal formatter/linter config.
david merged commit ecb25ec558 into main 2026-09-08 01:16:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-extensions-and-skills!176
No description provided.