Skip to content

fix(core): name the ripgrep acquisition stage that failed (TKT-378) - #59

Open
sepo-eng wants to merge 1 commit into
devfrom
fix/tkt-378-ripgrep-diagnosability
Open

fix(core): name the ripgrep acquisition stage that failed (TKT-378)#59
sepo-eng wants to merge 1 commit into
devfrom
fix/tkt-378-ripgrep-diagnosability

Conversation

@sepo-eng

Copy link
Copy Markdown

What

Makes the Windows ripgrep failure diagnosable. It does not fix it — the cause is still unconfirmed, and this is deliberate.

TKT-378's diagnosis established that the failure survived an entire investigation uncaused by construction: ripgrep.ts wrapped the whole program — acquiring the binary as well as running it — in a catch-all mapError reporting "ripgrep execution failed", and the reported message discarded the cause the tagged error carried. A stalled download, a shell that never exits, and a genuine execution failure all produced the same string.

Three changes, exactly the ones the diagnosis asked for:

  1. The cause is surfaced. Both acquisition and execution failures put the underlying cause in the reported message instead of only in the unread cause field.
  2. Acquisition is separated from execution. binary.filepath gets its own label, so a failed download can no longer report itself as a failed execution.
  3. Stages are bounded individually. Download (60s) and extraction (30s) each carry their own timeout naming the stage, so a hang says which step hung. Extraction failures also report the interpreter and exit code alongside its output.

Why the test-timeout change is part of it

The four ripgrep suites get a per-test timeout above the acquisition budget. Without it a hung stage still dies on bun's generic 30s test timeout, naming nothing — the labelled failure would never be the one you see, which is the dead end this is meant to remove.

Getting a Windows answer

test.yml has no Windows leg at all (TKT-338 removed it to stop burning GitHub-hosted minutes), so there was no job to re-enable. This adds ripgrep-windows.yml: dispatch-only, running the four ripgrep suites and nothing else. The fork publishes a signed Windows CLI (publish.yml's sign-cli-windows job plus a win-arm64 leg) whose core search fails on first use, and that shipping platform currently has zero automated signal on search. One short run on demand answers it without putting minutes back on every push.

Dispatch it after merge (a workflow_dispatch workflow has to be on the default branch before it can be dispatched), then fix the stage the labelled failure names.

What was verified

  • Cold-cache acquisition genuinely runs on Linux. No system rg on PATH, fresh XDG_CACHE_HOME — a 4.5 MB rg appears in the empty cache and all four suites pass. The download→extract→execute chain was exercised, not skipped past a preinstalled binary.
  • Each new message was seen to fire, not assumed:
    • forced 404 → ripgrep acquisition failed: ripgrep download failed from <url>: StatusCode: non 2xx status code (404 GET ...)
    • forced download timeout → ripgrep download timed out after <d> from <url>
    • forced extraction timeout → ripgrep extraction timed out after <d> running tar on <archive>
  • packages/core full suite: 1216 pass, 0 fail. Typecheck clean (also via the pre-push hook's repo-wide bun typecheck). Prettier and oxlint clean on the changed files.

What is deliberately not here

No PowerShell-quoting fix. Quoting is the most visible difference on the Windows path, not the demonstrated cause, and the evidence — a 30s hang rather than a fast fail — points away from it. Guessing here is what produced the previous dead end.

Linux is refuted on evidence and needs no change; the Windows severity stands.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KbNYZHcnxRCknFmhhPHe7L

The Windows ripgrep failure survived a full investigation uncaused because
every distinct failure collapsed into one string. ripgrep.ts wrapped the whole
program -- acquiring the binary as well as running it -- in a catch-all
mapError reporting "ripgrep execution failed", and the reported message
discarded the cause the tagged error carried. A stalled download and a shell
that never exits were indistinguishable from a genuine execution failure.

Acquisition is now labelled separately from execution, both carry their cause
in the reported message, and the download and extraction stages each have their
own timeout naming the stage, so a hang says which step hung. Extraction
failures report the interpreter and exit code alongside its output.

The four ripgrep suites get a per-test timeout above the acquisition budget;
without it a hung stage would still surface as a generic test timeout naming
nothing, which is the dead end this is meant to remove.

Adds ripgrep-windows.yml, dispatch-only, running those four suites and nothing
else. This fork publishes a signed Windows CLI whose core search fails on first
use while test.yml has no Windows leg at all, so the shipping platform has no
automated signal on search; one short run on demand answers it without putting
GitHub-hosted minutes back on every push.

No speculative fix for the failure itself: quoting is the most visible
difference on the Windows path, not the demonstrated cause, and the evidence
(a 30s hang rather than a fast fail) points away from it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbNYZHcnxRCknFmhhPHe7L
Copilot AI lite review requested due to automatic review settings August 13, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants