Repository navigation
Conversation
…fits fm-fleet-snapshot.sh --contribution-input passed the whole backlog JSON to jq as an --argjson argument, so a home whose backlog exceeds the 128 KiB per-argument limit failed with 'Argument list too long' at session start and still exited 0 with empty output. Stream both documents through stdin and fail when assembly fails.
|
limitall
force-pushed
the
fm/fm-snapshot-argmax
branch
from
October 1, 2026 12:00
3e65cd9 to
f76aa62
Compare
# Conflicts: # tests/fm-contributions.test.sh
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
Session start can fail with
jq: Argument list too longwhen a home holds a large backlog and many task records, because large JSON reaches jq as command-line arguments. Pass it through stdin or a file instead, so the fleet snapshot completes whatever the backlog size.What Changed
bin/fm-fleet-snapshot.sh --contribution-inputno longer passes the backlog and task JSON tojqas--argjsonarguments. It now pipes both documents through stdin withjq -s. Before, a large backlog went over the per-argument size limit and the command failed withjq: Argument list too long. If assembling the input fails, the script now printsfm-fleet-snapshot: contribution input assembly failedand exits non-zero.test_large_backlog_contribution_inputtotests/fm-contributions.test.sh. It adds 1500 filler items to a backlog, checks that the generated backlog JSON is larger than 128 KiB, and then checks two things:fm-contributions.sh snapshotstill projects the one tracked PR, and the full bearings snapshot still reports the contribution.The run printed messages about MCP connectors, which this change doesn't use:
claude mcpor /mcp in an interactive session).🤖 Generated with Claude Code
Risk Assessment
✅ Low: One small, well-bounded change: the last place that passed the whole backlog to jq as a command-line argument (the --contribution-input path) now sends it through stdin, and jq failures now exit non-zero. The full snapshot path already passed this data through files, and a new behavioral test runs both entry points on a backlog larger than 128 KiB.
Testing
I drove the real session-start path, the snapshot
--contribution-inputmode, the contributions poll and the full bearings snapshot in a disposable lab home with a large real-shaped backlog, on base and on target. Base shows the exact reportedArgument list too longerror in BOOTSTRAP and returns empty contribution input with exit 0. Target prints no error and carries the full backlog. It also holds up when the tasks payload goes over the argument limit, and an empty home still works. The new regression test fails on base and passes on target; that is an automated test, not a live run. The contributions suite has the same 6 failures on base and target, so they come from before this change. All checks are CLI transcripts saved to the evidence directory; there is no UI surface.Evidence: Session-start BOOTSTRAP section, base vs target (error on base, clean on target)
Source: Session-start BOOTSTRAP section, base vs target (error on base, clean on target)
base BOOTSTRAP: <repo>/bin/fm-fleet-snapshot.sh: line 1994: /usr/bin/jq: Argument list too long target BOOTSTRAP: (no such line)Evidence: Large backlog repro: contribution-input / poll / full snapshot, base vs target
Source: Large backlog repro: contribution-input / poll / full snapshot, base vs target
Evidence: Adversarial: backlog and tasks both over 128 KiB
Source: Adversarial: backlog and tasks both over 128 KiB
target: {"backlog_bytes":226728,"backlog_records":122,"tasks_bytes":229887,"tasks":1100,...}Evidence: Empty home contribution input on target
Source: Empty home contribution input on target
Evidence: Regression test fails on base, passes on target
Source: Regression test fails on base, passes on target
Evidence: fm-contributions.test.sh: same 6 failures on base and target
Source: fm-contributions.test.sh: same 6 failures on base and target
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
tests/fm-contributions.test.sh- On the target, tests/fm-contributions.test.sh reports 5 failures: the issue ready-for-pr planning wake, fresh-issue maintainer triage, the add/remove ready-for-pr transition, record task identity, and the reservation poll unavailable wake. None of them obviously touches the changed jq call, but the task-identity and poll tests do go through the contribution input path. The same file on base 549e07f had not finished, so it is not yet known whether these failed before this change. Compare withbash tests/fm-contributions.test.shon base before shipping.Disposable lab home created withbin/fm-lab-home.sh create, then filled with a 294 KB backlog (1600 items) and 201 data dirsFM_HOME=$LAB bin/fm-fleet-snapshot.sh --contribution-inputrun on base 549e07f and on target 3e65cd9Base and target compared onfm-fleet-snapshot.sh --contribution-input | fm-contributions.sh snapshot <input> --allwith a real open-PR contribution recordfm-bearings-snapshot.sh --jsonrun on base and target against the lab hometest_large_backlog_contribution_inputrun alone against base bin/ (fails) and target bin/ (passes)bash tests/fm-contributions.test.shon target: 5 failuresSame test file on base 549e07f started in the background; not finished when this result was dueLab home and temp files removed; worktree clean🔧 No changes applied.
1 warning still open:
tests/fm-contributions.test.sh- tests/fm-contributions.test.sh fails 6 tests on this host, identically on base 549e07f and on target: the ready-for-pr planning wake, fresh-issue maintainer triage, the add/remove ready-for-pr transition, the watcher surfacing a new contribution, record task identity, and the reservation poll unavailable wake. They existed before this change and were not caused by it. Target passes one more test than base (the new large-backlog test). CI will hit them anyway; fixing them belongs in separate follow-up work.FM_HOME=$LAB bin/fm-session-start.shon base 549e07f vs target, in a lab home made bybin/fm-lab-home.sh createwith a copy of the real backlog.md grown past 128 KiB of JSON, comparing the BOOTSTRAP sectionFM_HOME=$LAB bin/fm-fleet-snapshot.sh --contribution-inputon base vs target (exit code, stderr, backlog bytes and record count)FM_HOME=$LAB bin/fm-contributions.sh pollon base vs targetFM_HOME=$LAB bin/fm-fleet-snapshot.sh(full bearings) on base vs targetAdversarial: 1100 task metas plus the large backlog so both halves of the pair exceed 128 KiB,--contribution-inputon base vs targetEmpty lab home with no backlog:--contribution-inputon targetNewtest_large_backlog_contribution_inputrun alone against base bin/ (fails) and target bin/ (passes)bash tests/fm-contributions.test.shon base and target side by side, to settle the prior-round question about failing tests✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.