Skip to content

Apply non-draft open PRs: parallelize @path resolution, fix TS casts, harden dir validation#99

Merged
TrueAlpha-spiral merged 2 commits into
verify-conscience-11044070125345138680from
copilot/initial-setup
May 11, 2026
Merged

Apply non-draft open PRs: parallelize @path resolution, fix TS casts, harden dir validation#99
TrueAlpha-spiral merged 2 commits into
verify-conscience-11044070125345138680from
copilot/initial-setup

Conversation

Copy link
Copy Markdown

Copilot AI commented May 11, 2026

TLDR

Applies three non-draft open PRs into this branch. Core change: @path file stat resolution now runs concurrently via Promise.all instead of serially, with debug message ordering preserved. Two smaller correctness fixes round it out.

Dive Deeper

PR #93 — Parallelize @path stat resolution (atCommandProcessor.ts)

  • Replaces sequential for...of + await over atPathCommandParts with Promise.all over mapped async handlers.
  • Each path resolution collects its debug messages locally; they're flushed in original input order after Promise.all settles — preserving deterministic output.
  • Introduces discriminated union AtPathResolutionResult (invalid | ignored | success | skipped) to make result handling explicit and type-safe.
  • IgnoreReason renamed → FileIgnoreReason; ignoredByReasonignoredPathsByReason for clarity.
  • Measured ~3.5× speedup on multi-path queries (23 ms → 6.5 ms for 200 files across multiple workspace dirs).

PR #71 — Safer EventEmitter → Readable cast in shellExecutionService.test.ts

  • as Readableas unknown as Readable: the double-cast is the correct TypeScript pattern when the types have no structural overlap. Removes the stale // FIX comment.

PR #65 — Reject whitespace-only dir in memoryDiscovery.ts

  • if (dir)if (dir && dir.trim() !== ''): truthy whitespace strings (e.g. " ") would previously pass the guard and produce bogus resolved paths via path.resolve.

Reviewer Test Plan

  1. Pass multiple @file references in a single query — confirm all resolve correctly and debug messages appear in input order.
  2. Pass a whitespace-only string as dir to getGeminiMdFilePathsInternalForEachDir — confirm no path resolution is attempted.
  3. Run shellExecutionService tests — confirm no TypeScript errors on the mock child process setup.
npx vitest run packages/cli/src/ui/hooks/atCommandProcessor.test.ts \
  packages/core/src/services/shellExecutionService.test.ts \
  packages/core/src/utils/memoryDiscovery.test.ts

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

Related to #93, #71, #65

Copilot AI and others added 2 commits May 11, 2026 03:55
- PR #65: validate whitespace-only dir in memoryDiscovery.ts
- PR #71: fix as unknown as Readable cast in shellExecutionService.test.ts
- PR #93: parallelize @path file stat loop with Promise.all in atCommandProcessor.ts and add test"

Agent-Logs-Url: https://github.com/Sovereign-Data-Foundation/gemini-cli/sessions/eeea9ea5-aa47-48b3-af4d-684ea7154a27

Co-authored-by: TrueAlpha-spiral <199723968+TrueAlpha-spiral@users.noreply.github.com>
… ignoredPathsByReason

Agent-Logs-Url: https://github.com/Sovereign-Data-Foundation/gemini-cli/sessions/eeea9ea5-aa47-48b3-af4d-684ea7154a27

Co-authored-by: TrueAlpha-spiral <199723968+TrueAlpha-spiral@users.noreply.github.com>
@TrueAlpha-spiral
Copy link
Copy Markdown
Collaborator

IgnoreReason → FileIgnoreReason
ignoredByReason → ignoredPathsByReason

Cite_GPT:: PR #99 is the correct continuation path.
Do not merge #93 separately if #99 fully supersedes it.
Mark #99 ready only after confirming no hidden CI requirement is missing.

@TrueAlpha-spiral TrueAlpha-spiral marked this pull request as ready for review May 11, 2026 12:23
@TrueAlpha-spiral TrueAlpha-spiral merged commit e5ab2a5 into verify-conscience-11044070125345138680 May 11, 2026
@TrueAlpha-spiral
Copy link
Copy Markdown
Collaborator

I see strong financial incentives pushing AI systems to stay adaptable rather than fully auditable.
Others see opportunity and profit—I see risk and red flags.

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.

2 participants