garrytan / garrytan/gstack

health scores a crashing tsc as CLEAN because EXIT_CODE reads tail's status

Open Beginner friendly
#2,788 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133k
Forks
19.9k
Avg merge
18h 46m
Merged PRs (30d)
26

Description

\`health/SKILL.md.tmpl\` line 125 runs \`tsc --noEmit 2>&1 | tail -50\` and line 126 sets \`EXIT_CODE=$?\`. Without \`pipefail\`, \`$?\` is tail's status, which is 0 whenever tail ran.

Input that passes while broken: tsc that fails before emitting diagnostics (missing \`typescript\`, a broken \`tsconfig.json\`, an out-of-memory crash, a non-zero exit with a bare stack trace). No \`error TS\` lines survive, \`EXIT_CODE\` is 0, and the scoring rule (count \`error TS\` lines) awards 10/10 CLEAN to a typecheck that never ran.

Fix: prefix the block with \`set -o pipefail\`, or capture \`EXIT_CODE=${PIPESTATUS[0]}\` immediately after the pipeline.

Contributor guide

Open the contributing guide

Research direction

Start in health/SKILL.md.tmpl at lines 125-126 and review how the tsc pipeline determines EXIT_CODE. Run the health check with a failing TypeScript setup such as a missing compiler or broken tsconfig.json, then confirm that the result is no longer scored CLEAN and that successful checks still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, typescript
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.