fix: process all documents from stdin, not just the first - #49
Merged
Conversation
This was referenced Jul 23, 2026
MPV
force-pushed
the
claude/stdin-multidoc
branch
from
July 23, 2026 07:10
7e2273e to
8f215aa
Compare
MPV
force-pushed
the
claude/stdin-multidoc
branch
2 times, most recently
from
July 23, 2026 08:24
8696395 to
6e5fb8d
Compare
This was referenced Jul 23, 2026
MPV
force-pushed
the
claude/stdin-multidoc
branch
from
July 24, 2026 06:45
6e5fb8d to
c2e30c5
Compare
MPV
force-pushed
the
claude/stdin-multidoc
branch
3 times, most recently
from
August 6, 2026 20:57
c24a2fe to
177ed18
Compare
MPV
force-pushed
the
claude/stdin-multidoc
branch
from
August 6, 2026 21:52
177ed18 to
bf1dff2
Compare
MPV
force-pushed
the
claude/stdin-multidoc
branch
2 times, most recently
from
August 8, 2026 22:05
0a09dd0 to
fedfc38
Compare
ProcessStdin passed the whole stdin buffer to yamlparser.ProcessData, whose decoder only reads the first YAML document, so a multi-document stream piped in (e.g. `kubectl get ... -o yaml | kir -`) silently dropped every document after the first. Route stdin through the same document-splitting path already used for files (extracted as processDocuments) so both handle multi-document input identically. Cover it end-to-end with a TestCLI/StdinMultiDoc golden: the existing Stdin case pipes a single document, so it passed with or without the fix; the new two-document fixture fails through cmd.Run without it (only the first image is emitted) and pins the fixed behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC
MPV
force-pushed
the
claude/stdin-multidoc
branch
from
August 8, 2026 22:19
fedfc38 to
dc8fda7
Compare
This was referenced Aug 8, 2026
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.
What
Route the stdin path through the same document-splitting the file path already uses, so a multi-document stream piped into
kir -yields images from every document, not just the first.Before → After
Given a two-document manifest on stdin (a Deployment, then a CronJob):
Exit code is 0 in both cases — the failure was silent, which is what made it dangerous.
Why
ProcessStdinhanded the whole stdin buffer toyamlparser.ProcessData, whose decoder reads only the first YAML document. Files already went through a splitting path, sokir file.yamlhandled multiple documents correctly while… | kir -did not — the same input via two routes gave different results. Stdin now goes through the sharedprocessDocumentspath, so both routes behave identically.Tests
Adds a
TestCLI/StdinMultiDocgolden that pipes a two-document stream throughcmd.Run— the seam where the bug lived. The pre-existingTestCLI/Stdincase pipes a single document, so it passed with or without this fix; the new golden emits both images only with the fix (verified: it fails onmaster, printing justnginx:1.27).Release
fix:→ patch. This is silent data loss in an existing path (stdin already worked; it just truncated), not a new capability — contrast #54, which makes the tool tolerate input it previously rejected outright.🤖 Generated with Claude Code
https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC