Repository navigation
fix: merge per-worktree hooks storage and include untracked files in diff stats - #79
Conversation
…diff stats - consolidate latest-run.json + skill-results.json into single hooks.json (eliminates hooks/ subdirectory that survived worktree deletion) - skip persisting hook results for worktree-removed trigger (ensureDir was recreating the directory after deletion) - remove /api/worktrees/:id/hooks/skill-results endpoint (skills now returned inline via PipelineRun.skills from /hooks/status) - include untracked file line counts in git diff stats (UI was showing +0 for worktrees with only new files)
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
📝 WalkthroughWalkthroughConsolidates per-worktree hook data into a single Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/server/src/verification-manager.ts (1)
207-225:⚠️ Potential issue | 🟠 MajorRecompute
PipelineRun.statusfrom skills as well as steps.After moving skill results into
PipelineRun.skills, these write paths can persist an inconsistent run state:reportSkillResult()reuses the existing status, andmergeAndPersistRun()derives status frommergedStepsonly. That can leave/hooks/statusreturningstatus: "completed"with arunningor failed skill, andcompletedAtcan be set too early. Please move this into a shared reducer/helper that derives the run status from both collections on every persist.Also applies to: 497-514
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/server/src/verification-manager.ts` around lines 207 - 225, reportSkillResult and mergeAndPersistRun can persist inconsistent PipelineRun.status because status is currently derived only from steps or reused from existing run; create a shared reducer/helper (e.g., deriveRunStatusFromStepsAndSkills or reducePipelineRunStatus) that accepts mergedSteps and skills and returns the correct status and timestamps (including completedAt) based on both collections, then call this helper wherever runs are created/updated (reportSkillResult, mergeAndPersistRun, and the other write path referenced around lines 497-514) so that getStatus/makeRun/persistRun use the computed status/timestamps rather than reusing or deriving from steps alone.
🧹 Nitpick comments (1)
apps/web-app/src/components/detail/HooksTab.tsx (1)
30-30: Switch this import to a configured alias.The updated
../../hooks/useHookspath adds another parent-relative import in app source. Please use the repo alias here instead of extending the../chain.As per coding guidelines, "Do not use parent-relative imports (for example
../or../../) in app/lib source files. Only same-folder relative imports are allowed (for example./file). For anything outside the current folder, use configured aliases."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web-app/src/components/detail/HooksTab.tsx` at line 30, Replace the parent-relative import of useEffectiveHooksConfig in HooksTab.tsx (currently importing from "../../hooks/useHooks") with the configured repo alias import (e.g. use the project's alias for the hooks folder) so the symbol useEffectiveHooksConfig is imported via the alias instead of a ../../ path; update the import statement in HooksTab.tsx to reference the alias for the hooks module and keep the imported identifier useEffectiveHooksConfig unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web-app/src/components/detail/HooksTab.tsx`:
- Around line 411-421: The fetchStatus callback currently only updates state
when result.status is truthy, so stale step/skill results persist and fetch
errors are silent; modify fetchStatus (the async function calling
api.fetchHooksStatus) to clear both local states by calling setStepResults({})
and setSkillResults([]) when result.status is null/undefined, and wrap the
api.fetchHooksStatus call in try/catch so on failure you call logger.error(...)
with the caught error and then surface a persistent toast using
showPersistentErrorToast or reportPersistentErrorToast with a user-friendly
message; ensure you still populate state when result.status exists (building the
map from result.status.steps into setStepResults and setting
setSkillResults(result.status.skills)).
In `@docs/CONFIGURATION.md`:
- Around line 560-562: The fenced code block containing
".openkit/worktrees/<worktreeId>/hooks.json" needs a language tag to satisfy
MD040; update the fence starting before ".openkit/..." (the triple backticks) to
include a language identifier such as "text" (i.e. change ``` to ```text) so the
block becomes ```text followed by .openkit/worktrees/<worktreeId>/hooks.json and
a closing ```; no other content changes required.
In `@docs/HOOKS.md`:
- Around line 188-195: The fenced code block showing the directory tree in
HOOKS.md (the block starting with ``` and the lines ".openkit/ .openkit/
hooks.json ...") lacks a language tag; update that opening fence to include a
neutral language (for example change ``` to ```text) so the block becomes
```text to satisfy MD040 and keep markdown lint clean.
- Around line 199-214: Remove all references to the now-removed frontend hook
helper useHookSkillResults and any mention of the deprecated endpoint
/api/worktrees/:id/hooks/skill-results from the frontend section in HOOKS.md;
update text to describe the unified status flow (use the combined status
endpoint /api/worktrees/:id/hooks/status and the report endpoint
/api/worktrees/:id/hooks/report) and adjust examples/snippets to use the unified
status shape and hooks skill reporting fields instead of the old skill-results
usage.
In `@libs/integrations/src/github/gh-client.ts`:
- Around line 359-369: The call to execFile("wc", ["-l", ...untrackedFiles]) can
misinterpret filenames beginning with "-" and the catch currently swallows
errors; update the args to include the POSIX separator (execFile("wc", ["-l",
"--", ...untrackedFiles"])) and replace the empty catch with a logged error that
records context (e.g., worktreePath and untrackedFiles) and the thrown error so
failures around the execFile/wcOut/linesAdded logic are visible; keep the
original behavior of not failing the whole operation but ensure the error is
logged via your module's logger (e.g., logger.error or this.logger.error) with
clear context.
---
Outside diff comments:
In `@apps/server/src/verification-manager.ts`:
- Around line 207-225: reportSkillResult and mergeAndPersistRun can persist
inconsistent PipelineRun.status because status is currently derived only from
steps or reused from existing run; create a shared reducer/helper (e.g.,
deriveRunStatusFromStepsAndSkills or reducePipelineRunStatus) that accepts
mergedSteps and skills and returns the correct status and timestamps (including
completedAt) based on both collections, then call this helper wherever runs are
created/updated (reportSkillResult, mergeAndPersistRun, and the other write path
referenced around lines 497-514) so that getStatus/makeRun/persistRun use the
computed status/timestamps rather than reusing or deriving from steps alone.
---
Nitpick comments:
In `@apps/web-app/src/components/detail/HooksTab.tsx`:
- Line 30: Replace the parent-relative import of useEffectiveHooksConfig in
HooksTab.tsx (currently importing from "../../hooks/useHooks") with the
configured repo alias import (e.g. use the project's alias for the hooks folder)
so the symbol useEffectiveHooksConfig is imported via the alias instead of a
../../ path; update the import statement in HooksTab.tsx to reference the alias
for the hooks module and keep the imported identifier useEffectiveHooksConfig
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8b779d99-f343-41c3-b212-97d3046b975e
📒 Files selected for processing (14)
apps/server/src/git-status.test.tsapps/server/src/routes/verification.tsapps/server/src/verification-manager.test.tsapps/server/src/verification-manager.tsapps/web-app/src/components/detail/HooksTab.tsxapps/web-app/src/hooks/api.tsapps/web-app/src/hooks/useApi.tsapps/web-app/src/hooks/useHooks.tsdocs/API.mddocs/ARCHITECTURE.mddocs/CONFIGURATION.mddocs/HOOKS.mdlibs/integrations/src/github/gh-client.tslibs/shared/src/worktree-types.ts
💤 Files with no reviewable changes (4)
- apps/web-app/src/hooks/useApi.ts
- docs/API.md
- apps/server/src/routes/verification.ts
- apps/web-app/src/hooks/useHooks.ts
| const fetchStatus = useCallback(async () => { | ||
| const result = await api.fetchHooksStatus(worktreeId); | ||
| if (result.status?.steps) { | ||
| if (result.status) { | ||
| const map: Record<string, StepResult> = {}; | ||
| for (const step of result.status.steps) { | ||
| for (const step of result.status.steps ?? []) { | ||
| map[step.stepId] = step; | ||
| } | ||
| setStepResults(map); | ||
| setSkillResults(result.status.skills ?? []); | ||
| } | ||
| }, [api, worktreeId]); |
There was a problem hiding this comment.
Reset local results on null status and handle fetch failures explicitly.
This only updates state when result.status is truthy, so a fresh or deleted worktree can keep rendering the previous worktree's step/skill results indefinitely. Also, this callback is now the single refresh path for both sections, but a rejected fetchHooksStatus() here is not logged or surfaced to the user. Clear both result states when no status is returned, and wrap the request with logger + persistent toast handling.
As per coding guidelines, "Always surface user-facing errors through toast notifications (showPersistentErrorToast / reportPersistentErrorToast). Errors that surface as toasts must also be logged through the logger."
Also applies to: 423-436
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/web-app/src/components/detail/HooksTab.tsx` around lines 411 - 421, The
fetchStatus callback currently only updates state when result.status is truthy,
so stale step/skill results persist and fetch errors are silent; modify
fetchStatus (the async function calling api.fetchHooksStatus) to clear both
local states by calling setStepResults({}) and setSkillResults([]) when
result.status is null/undefined, and wrap the api.fetchHooksStatus call in
try/catch so on failure you call logger.error(...) with the caught error and
then surface a persistent toast using showPersistentErrorToast or
reportPersistentErrorToast with a user-friendly message; ensure you still
populate state when result.status exists (building the map from
result.status.steps into setStepResults and setting
setSkillResults(result.status.skills)).
| ``` | ||
| .openkit/worktrees/<worktreeId>/hooks/latest-run.json | ||
| .openkit/worktrees/<worktreeId>/hooks/skill-results.json | ||
| .openkit/worktrees/<worktreeId>/hooks.json | ||
| ``` |
There was a problem hiding this comment.
Add a language to the fenced code block.
Line 560 uses a plain fence; please annotate it (for example text) to satisfy MD040.
Suggested patch
-```
+```text
.openkit/worktrees/<worktreeId>/hooks.json</details>
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 markdownlint-cli2 (0.21.0)</summary>
[warning] 560-560: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against the current code and only fix it if needed.
In @docs/CONFIGURATION.md around lines 560 - 562, The fenced code block
containing ".openkit/worktrees//hooks.json" needs a language tag to
satisfy MD040; update the fence starting before ".openkit/..." (the triple
backticks) to include a language identifier such as "text" (i.e. change totext) so the block becomes text followed by .openkit/worktrees/<worktreeId>/hooks.json and a closing ; no other content
changes required.
</details>
<!-- fingerprinting:phantom:poseidon:hawk -->
<!-- This is an auto-generated comment by CodeRabbit -->
| ``` | ||
| .openkit/ | ||
| .openkit/ | ||
| hooks.json # Global hooks configuration | ||
| hooks.json # Global hooks configuration | ||
| worktrees/ | ||
| <worktreeId>/ | ||
| hooks/ | ||
| latest-run.json # Most recent command step run | ||
| skill-results.json # Agent-reported skill results | ||
| hooks.json # Combined step run + skill results | ||
| ``` |
There was a problem hiding this comment.
Add a language to this fenced block.
Line 188 should use a language tag (e.g. text) to satisfy MD040 and keep markdown lint clean.
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 188-188: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/HOOKS.md` around lines 188 - 195, The fenced code block showing the
directory tree in HOOKS.md (the block starting with ``` and the lines ".openkit/
.openkit/ hooks.json ...") lacks a language tag; update that opening fence to
include a neutral language (for example change ``` to ```text) so the block
becomes ```text to satisfy MD040 and keep markdown lint clean.
| | Method | Path | Description | | ||
| | -------- | -------------------------------------- | ----------------------------------------------------------------------------- | | ||
| | `GET` | `/api/hooks/config` | Get hooks configuration | | ||
| | `PUT` | `/api/hooks/config` | Save full hooks configuration | | ||
| | `POST` | `/api/hooks/steps` | Add a step (`{ name, command, kind? }` or `{ name, kind: "prompt", prompt }`) | | ||
| | `PATCH` | `/api/hooks/steps/:stepId` | Update a step (`{ name?, command?, prompt?, kind?, enabled?, trigger? }`) | | ||
| | `DELETE` | `/api/hooks/steps/:stepId` | Remove a step | | ||
| | `POST` | `/api/hooks/skills/import` | Import a skill (`{ skillName, trigger?, condition? }`) | | ||
| | `GET` | `/api/hooks/skills/available` | List available skills from registry | | ||
| | `PATCH` | `/api/hooks/skills/:name` | Toggle a skill (`{ enabled, trigger? }`) | | ||
| | `DELETE` | `/api/hooks/skills/:name` | Remove a skill (`?trigger=` query param) | | ||
| | `POST` | `/api/worktrees/:id/hooks/run` | Run enabled command steps for a worktree (`{ trigger? }`) | | ||
| | `POST` | `/api/worktrees/:id/hooks/run/:stepId` | Run a single step | | ||
| | `GET` | `/api/worktrees/:id/hooks/status` | Get latest run status (includes both step and skill results) | | ||
| | `POST` | `/api/worktrees/:id/hooks/report` | Report a skill result (`{ skillName, trigger?, success, summary, ... }`) | | ||
| | `GET` | `/api/files/read?path=...` | Read a file by absolute path (used for MD report preview) | |
There was a problem hiding this comment.
Update the frontend section to remove useHookSkillResults references.
The REST API table reflects the unified status flow, but this file still documents useHookSkillResults later, which is stale after removing /api/worktrees/:id/hooks/skill-results.
Suggested doc adjustment
-### useHookSkillResults (`apps/web-app/src/hooks/useHooks.ts`)
-
-Hook for fetching agent-reported skill results for a worktree.
+### Skill results in hook status (`apps/web-app/src/hooks/useHooks.ts`)
+
+Skill results are returned inline via `status.skills` from `GET /api/worktrees/:id/hooks/status`; there is no separate skill-results endpoint.As per coding guidelines {docs/**/*.md,README.md}: “Keep ALL docs in sync at ALL TIMES.”
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/HOOKS.md` around lines 199 - 214, Remove all references to the
now-removed frontend hook helper useHookSkillResults and any mention of the
deprecated endpoint /api/worktrees/:id/hooks/skill-results from the frontend
section in HOOKS.md; update text to describe the unified status flow (use the
combined status endpoint /api/worktrees/:id/hooks/status and the report endpoint
/api/worktrees/:id/hooks/report) and adjust examples/snippets to use the unified
status shape and hooks skill reporting fields instead of the old skill-results
usage.
| const { stdout: wcOut } = await execFile("wc", ["-l", ...untrackedFiles], { | ||
| cwd: worktreePath, | ||
| encoding: "utf-8", | ||
| }); | ||
| // wc -l outputs " <count> <filename>" per file; for multiple files the last line is the total | ||
| const lastLine = wcOut.trim().split("\n").pop()!.trim(); | ||
| linesAdded += parseInt(lastLine.split(/\s+/)[0], 10) || 0; | ||
| } | ||
| } catch { | ||
| // Ignore — e.g. no untracked files or wc unavailable | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify current wc invocation and whether '--' is used
rg -n 'execFile\("wc", \["-l"' libs/integrations/src/github/gh-client.ts
# Verify local logger availability and usage pattern in integrations package
fd logger.ts libs/integrations
rg -n 'domain:\s*"' libs/integrations/src -g '*.ts'Repository: fum4/openkit
Length of output: 256
🏁 Script executed:
#!/bin/bash
# Check the exact catch block and surrounding context
sed -n '350,375p' libs/integrations/src/github/gh-client.ts
# Verify logger import in gh-client.ts
head -30 libs/integrations/src/github/gh-client.ts | grep -E 'import|logger'
# Check logger.ts to understand available API
cat libs/integrations/src/github/logger.tsRepository: fum4/openkit
Length of output: 1274
🏁 Script executed:
#!/bin/bash
# Check what's in the local logger.ts
cat libs/integrations/src/github/logger.ts
# Verify the exact import and usage in gh-client.ts around line 359-369
sed -n '1,50p' libs/integrations/src/github/gh-client.tsRepository: fum4/openkit
Length of output: 1627
🏁 Script executed:
#!/bin/bash
# Check how the logger is used elsewhere in gh-client.ts
rg -n 'log\.' libs/integrations/src/github/gh-client.ts | head -20
# Verify Logger API by checking `@openkit/logger` documentation or examples
find libs -name 'logger.ts' -type f | head -3 | xargs head -20Repository: fum4/openkit
Length of output: 461
🏁 Script executed:
#!/bin/bash
# Check if 'log' is imported from './logger' in gh-client.ts
rg -n "from.*logger" libs/integrations/src/github/gh-client.ts
# Find other catch blocks in gh-client.ts to see if any log errors
rg -n -B2 -A2 'catch.*{' libs/integrations/src/github/gh-client.ts | head -40
# Check Logger API methods available
rg -n 'log\.(debug|info|warn|error|success)' libs/integrations/src/github -g '*.ts'Repository: fum4/openkit
Length of output: 135
🏁 Script executed:
#!/bin/bash
# Check if 'log' is imported from './logger' in gh-client.ts
rg -n "from.*logger" libs/integrations/src/github/gh-client.ts
# Find other catch blocks in gh-client.ts to see if any log errors
rg -n -B2 -A2 'catch' libs/integrations/src/github/gh-client.ts
# Check Logger API methods in other integrations
rg -n 'log\.(debug|info|warn|error|success)' libs/integrations/src -g '*.ts' | head -20Repository: fum4/openkit
Length of output: 4260
🏁 Script executed:
#!/bin/bash
# Get the full import section of gh-client.ts to see if log is imported
head -15 libs/integrations/src/github/gh-client.ts
# Check if log is used anywhere in the file at all
grep -n "^import.*log" libs/integrations/src/github/gh-client.ts
grep -n "log\." libs/integrations/src/github/gh-client.ts
# Look for Logger API signature to understand available methods
rg -A5 'class Logger' libs -g '*.ts' | head -30Repository: fum4/openkit
Length of output: 1298
🏁 Script executed:
#!/bin/bash
# Get the Logger implementation to understand available methods
cat libs/logger/node/src/index.ts | head -100
# Check method signatures for debug/info/warn/error
rg -A3 'debug\(|info\(|warn\(|error\(' libs/logger/node/src/index.ts | head -40Repository: fum4/openkit
Length of output: 4148
Add -- separator before filenames and log errors instead of silently ignoring them.
Line 359 passes filenames directly to wc without a -- separator, which means a filename starting with - could be interpreted as a flag. Additionally, the catch block at line 367 silently ignores all errors, violating the logging guideline that every error must be logged with context.
Suggested patch
+import { log } from "./logger";
+
export async function checkGhInstalled(): Promise<boolean> {
@@
- const { stdout: wcOut } = await execFile("wc", ["-l", ...untrackedFiles], {
+ const { stdout: wcOut } = await execFile("wc", ["-l", "--", ...untrackedFiles], {
cwd: worktreePath,
encoding: "utf-8",
});
@@
- } catch {
- // Ignore — e.g. no untracked files or wc unavailable
+ } catch (err) {
+ log.debug("Failed to include untracked files in diff stats", {
+ domain: "github",
+ worktreePath,
+ error: err instanceof Error ? err.message : String(err),
+ });
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@libs/integrations/src/github/gh-client.ts` around lines 359 - 369, The call
to execFile("wc", ["-l", ...untrackedFiles]) can misinterpret filenames
beginning with "-" and the catch currently swallows errors; update the args to
include the POSIX separator (execFile("wc", ["-l", "--", ...untrackedFiles"]))
and replace the empty catch with a logged error that records context (e.g.,
worktreePath and untrackedFiles) and the thrown error so failures around the
execFile/wcOut/linesAdded logic are visible; keep the original behavior of not
failing the whole operation but ensure the error is logged via your module's
logger (e.g., logger.error or this.logger.error) with clear context.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/server/src/git-status.test.ts`:
- Around line 12-17: The mock callback currently passes the result object as the
second arg which doesn't match execFile(error, stdout, stderr); update the mock
in the block that calls mockExec(args[0], args[1], args[2]) so that when result
is an Error you call cb(result) and when it's the success case you call cb(null,
result.stdout, result.stderr) to mirror the real execFile signature (referencing
mockExec and the cb callback).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c175f301-1196-44a9-9f39-dbcbc3862687
📒 Files selected for processing (1)
apps/server/src/git-status.test.ts
| const result = mockExec(args[0], args[1], args[2]); | ||
| if (result instanceof Error) { | ||
| cb(result); | ||
| } else { | ||
| cb(null, result); | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In Node.js child_process.execFile API, what is the callback signature and what values are passed for stdout/stderr?
💡 Result:
In child_process.execFile(file[, args][, options][, callback]), the optional callback is invoked on process termination with the signature:
(error, stdout, stderr) => { ... } [1]
error:nullon success; otherwise anError(with properties likeerror.codefor exit code anderror.signalif terminated by a signal). [1]stdout/stderr: the child process’s buffered standard output / standard error. By default they are UTF-8 decoded strings; ifoptions.encodingis'buffer'(or an unrecognized encoding), they are passed asBufferobjects. [1][2]
🏁 Script executed:
cat -n apps/server/src/git-status.test.ts | head -40Repository: fum4/openkit
Length of output: 1815
🏁 Script executed:
cat -n apps/server/src/git-status.test.ts | sed -n '39,80p'Repository: fum4/openkit
Length of output: 1882
Fix callback mock signature to match execFile API.
The mock's callback on line 16 currently passes (null, result) where result is { stdout, stderr }, but the real execFile callback signature expects (error, stdout, stderr) as separate arguments. This mismatch could hide bugs if callback-style usage is introduced. Unpack the result object to match the actual API:
- if (result instanceof Error) {
- cb(result);
- } else {
- cb(null, result);
- }
+ if (result instanceof Error) {
+ cb(result, "", "");
+ } else {
+ cb(null, result.stdout, result.stderr);
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const result = mockExec(args[0], args[1], args[2]); | |
| if (result instanceof Error) { | |
| cb(result); | |
| } else { | |
| cb(null, result); | |
| } | |
| const result = mockExec(args[0], args[1], args[2]); | |
| if (result instanceof Error) { | |
| cb(result, "", ""); | |
| } else { | |
| cb(null, result.stdout, result.stderr); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/server/src/git-status.test.ts` around lines 12 - 17, The mock callback
currently passes the result object as the second arg which doesn't match
execFile(error, stdout, stderr); update the mock in the block that calls
mockExec(args[0], args[1], args[2]) so that when result is an Error you call
cb(result) and when it's the success case you call cb(null, result.stdout,
result.stderr) to mirror the real execFile signature (referencing mockExec and
the cb callback).
Summary by CodeRabbit
New Features
Refactor
API Changes
Tests
Documentation