fix: prevent fleet snapshot argument overflow - #2812
Open
unhexquadium wants to merge 1 commit into
Open
Conversation
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code failure identified. The streamed inputs remain valid, positionally stable JSON documents, the refactored field mappings preserve their prior semantics, and the regression exercises the argument-overflow path through both snapshot and view generation. Reviews (1): Last reviewed commit: "Fix fleet snapshot jq argument scaling" | Re-trigger Greptile |
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.
Intent
Fix fm-fleet-view/fm-fleet-snapshot failing with jq 'Argument list too long' at bin/fm-fleet-snapshot.sh:635 once the fleet reaches 17+ task metas, reproducing the current 29-meta failure first. Move all fleet-sized JSON payloads off jq argv and onto stdin or equivalent streamed/file transport while keeping normal-case output byte-identical. Sweep bin/fm-fleet-snapshot.sh and bin/fm-fleet-view.sh for any other jq or xargs call whose argv grows with fleet size and fix those in the same pass. Add a tests/fm-fleet-snapshot-view.test.sh regression using a large synthetic fleet sufficient to trip the old limit. Do not merge the PR. Push the feature branch to the fork over SSH at git@github.com:unhexquadium/firstmate.git, open the PR against upstream kunchenguid/firstmate, and preserve this exact line under a ## Pipeline section in the PR body: Updates from git push no-mistakes. Use a concise top-level summary, a dedicated Risk assessment section with a green/yellow/red status-color emoji, and collapsible details for per-item breakdowns, background, validation notes, and caveats; refer to the captain as she/her. Drive all no-mistakes gates through PR and CI, and when the fork-PR workflow is awaiting upstream maintainer approval after the pipeline finishes, report the PR as delivered with CI awaiting that approval.
What Changed
jqthrough stdin instead of passing fleet-sized payloads through--argjsonarguments.Risk Assessment
✅ Low: Captain, the change is a focused transport refactor that moves every fleet-sized JSON value in both snapshot modes off jq argv while preserving the existing JSON structure and rendering path.
Testing
The focused behavior suite passed, the base commit reproduced
jq: Argument list too longat line 635 with 29 metas, and the target preserved all 29 tasks through snapshot JSON, secondmate-summary, and rendered-view paths while remaining byte-identical for a normal two-task fleet; the CLI evidence was captured and the worktree remained clean.Evidence: 29-meta base-versus-target CLI transcript
Source: 29-meta base-versus-target CLI transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
tests/fm-fleet-snapshot-view.test.sh/home/kalvira/.no-mistakes/evidence/01M0NSSEMQB2TYB1GZFWXJ9RF8/large-fleet-e2e.sh "$PWD" 1231b6ae7fd4c5ff7e94d2f5ca2159536c4c41cbrg -n "OUTPUT_MODE|secondmate-home-summary|jq |xargs" bin/fm-fleet-snapshot.sh bin/fm-fleet-view.shgit status --short✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.