diff --git a/.jules/bolt.md b/.jules/bolt.md new file mode 100644 index 0000000..f6112e6 --- /dev/null +++ b/.jules/bolt.md @@ -0,0 +1,5 @@ +# Bolt's Journal + +## 2025-02-17 - Global process.platform Interleaving in Concurrent Testing +**Learning:** Redefining global state properties like `process.platform` in async/concurrent test suites causes state pollution and race conditions across test blocks. In Bun, concurrent test execution means async describes/its yield control, causing different platform-based mock suites to run concurrently and override the shared `process.platform` back and forth. +**Action:** Isolate mock configurations inside test execution contexts or run tests using strict serial execution (or stub process/platform on a per-function dependency injection basis) rather than mutating global/process-level state. diff --git a/packages/mcp/src/shared/list-files-response.ts b/packages/mcp/src/shared/list-files-response.ts index d70221d..a39ff07 100644 --- a/packages/mcp/src/shared/list-files-response.ts +++ b/packages/mcp/src/shared/list-files-response.ts @@ -438,6 +438,11 @@ function longestPathLength(entries: LeanRepoFileEntry[]): number { return max; } +/** + * Optimized padding using native `String.prototype.padEnd`. + * Built-in native implementation in C++ is faster and more efficient + * than manually concatenating strings via `repeat` inside loops. + */ function padRight(text: string, width: number): string { - return text.length >= width ? text : text + " ".repeat(width - text.length); + return text.padEnd(width); }