Skip to content

AGENTS.md: fix the check-links recipe - #2075

Merged
marcleblanc2 merged 2 commits into
mainfrom
marc/docs/agents-check-links-recipe
Oct 8, 2026
Merged

marcleblanc2 merged 2 commits into
mainfrom
marc/docs/agents-check-links-recipe

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Just editing the AGENTS.md file. Amp's long-winded description below:

Problem

The ### Links section of AGENTS.md told you to run

pnpm run check links ... --check-external --diff <(git diff -U0 origin/main)

which fails with EBADF: bad file descriptor, open '/dev/fd/63'. dev/checks.mjs spawns check-links.mjs with stdio: 'inherit', so only fds 0-2 reach the child and bash's process-substitution descriptor is gone. Running node dev/check-links.mjs directly works, which is why it went unnoticed.

AGENTS.md also did not mention --baseline, the flag CI uses to drop the hundreds of pre-existing findings on main. --diff never filters findings; it only scopes --check-external and the review comments to added lines, so a local run without --baseline reports every finding on main.

Change

  • Pipe the diff to --diff /dev/stdin (stdin is inherited through pnpm and checks.mjs), with a note on why process substitution fails
  • Document the CI recipe: record the merge base with --format json --root, pass it as --baseline
  • EBADF added to cspell-allow-list.txt

Test plan

  • Reproduced the failure on main: direct node dev/check-links.mjs --diff <(...) works; node dev/checks.mjs links --diff <(...) and pnpm run check links --diff <(...) both fail with EBADF
  • Ran the new snippet verbatim in a fresh worktree of this branch: 266 findings on the merge base, No new dead links found! on the branch, with --check-external probing the added lines
  • Ran it on marc/docs/experimental-features-cleanup (27 added lines) with the same result
  • node dev/check-spelling.mjs --base origin/main: no issues
  • markdownlint-cli2 AGENTS.md: the only findings are pre-existing trailing spaces on lines 57-59, outside this change

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>
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Oct 8, 2026 3:55pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

@marcleblanc2 marcleblanc2 changed the title AGENTS.md: fix the check-links recipe and document --baseline AGENTS.md: fix the check-links recipe Oct 6, 2026
@marcleblanc2
marcleblanc2 requested a review from a team October 6, 2026 21:39
@marcleblanc2
marcleblanc2 enabled auto-merge (squash) October 6, 2026 21:39
@marcleblanc2
marcleblanc2 merged commit 16676ab into main Oct 8, 2026
7 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/docs/agents-check-links-recipe branch October 8, 2026 15:55

This branch was successfully deployed

1 active deployment
Preview — 45296eaf Deployed Oct 8, 2026 by vercel[bot]
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