Repository navigation
AGENTS.md: fix the check-links recipe - #2075
Merged
Merged
Conversation
The documented command piped the diff with process substitution (--diff <(git diff ...)), which fails with EBADF through `pnpm run check`: dev/checks.mjs spawns the check with only stdin/stdout/stderr, so the substitution descriptor is gone. Pipe to --diff /dev/stdin instead. Also document --baseline as the way to see only the findings a branch adds, the way CI does, since --diff never filters findings. Amp-Thread-ID: https://ampcode.com/threads/T-01a1130b-3f95-71cb-bbbc-b0e2da2593c9 Co-authored-by: Amp <amp@ampcode.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
marcleblanc2
enabled auto-merge (squash)
October 6, 2026 21:39
valerybugakov
approved these changes
Oct 7, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just editing the AGENTS.md file. Amp's long-winded description below:
Problem
The
### Linkssection ofAGENTS.mdtold you to runpnpm run check links ... --check-external --diff <(git diff -U0 origin/main)which fails with
EBADF: bad file descriptor, open '/dev/fd/63'.dev/checks.mjsspawnscheck-links.mjswithstdio: 'inherit', so only fds 0-2 reach the child and bash's process-substitution descriptor is gone. Runningnode dev/check-links.mjsdirectly works, which is why it went unnoticed.AGENTS.mdalso did not mention--baseline, the flag CI uses to drop the hundreds of pre-existing findings on main.--diffnever filters findings; it only scopes--check-externaland the review comments to added lines, so a local run without--baselinereports every finding on main.Change
--diff /dev/stdin(stdin is inherited throughpnpmandchecks.mjs), with a note on why process substitution fails--format json --root, pass it as--baselineEBADFadded tocspell-allow-list.txtTest plan
node dev/check-links.mjs --diff <(...)works;node dev/checks.mjs links --diff <(...)andpnpm run check links --diff <(...)both fail withEBADFNo new dead links found!on the branch, with--check-externalprobing the added linesmarc/docs/experimental-features-cleanup(27 added lines) with the same resultnode dev/check-spelling.mjs --base origin/main: no issuesmarkdownlint-cli2 AGENTS.md: the only findings are pre-existing trailing spaces on lines 57-59, outside this change