Skip to content

fix(bin): read Helm sync schema-check records from file to avoid ARG_MAX - #29

Merged
geojitsu merged 2 commits into
mainfrom
fm/fm-helm-sync-schema-check-argmax-001
Sep 17, 2026
Merged

geojitsu merged 2 commits into
mainfrom
fm/fm-helm-sync-schema-check-argmax-001

Conversation

@geojitsu

Copy link
Copy Markdown
Owner

Intent

Land, properly reviewed and tested, a production hotfix firstmate already applied and verified live: fm-helm-sync.sh's per-board schema check passes a potentially-large JSON array as a literal command-line argument, which exceeds the OS argument-list limit at real fleet scale and broke Helm sync for the live production board. This task lands the already-proven fix through the normal path - it is not a design task.

What Changed

  • bin/fm-helm-sync.sh: the per-board schema check now passes the desired-records JSON to jq via --slurpfile records_wrap "$group_desired" (unwrapped as $records_wrap[0]) instead of --argjson records "$(cat "$group_desired")", so the array is read from a file instead of being expanded into a literal command-line argument that can exceed the OS ARG_MAX limit at fleet scale.
  • tests/fm-helm-sync.test.sh: adds a regression test that builds a board and backlog large enough to exceed ARG_MAX (2097152 bytes) and asserts the sync still completes and needs no writes when the schema already matches.
  • Adds docs/bugs/2026-09-17-helm-sync-schema-check-argv-limit.md documenting the bug and registers it in docs/documentation-audiences.json.

Risk Assessment

✅ Low: The change swaps one --argjson (which embeds JSON as a literal argv string) for --slurpfile (which reads the same file directly), a minimal one-line-of-logic fix matching the already-proven production pattern used a few lines below in the same file, backed by a real end-to-end test that runs the actual sync binary against an oversized fixture and checks observable output.

Testing

Completed 1 recorded test check.

  • Outcome: ⚠️ 1 error across 2 runs (55m8s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 error
  • 🚨 tests failed with exit code 1
  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated

🔧 Fix: Confirm helm-sync argv fix passes; unrelated pre-existing timing tests flaky
1 error still open:

  • 🚨 tests failed with exit code 1
  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

firstmate-crewmate added 2 commits September 17, 2026 00:29
… limits

fm-helm-sync.sh passed a board group's whole desired-records JSON as a
literal jq --argjson command-line argument. Real fleet card bodies
exceed Linux's per-argument limit, so the schema check silently failed
on every board at real fleet scale, reporting fields and options as
unavailable even when they were present. Switch to --slurpfile, the
same pattern the file's plan-building jq call already uses. Audited
fm-helm-lib.sh and fm-helm-project-map.sh for the same pattern; every
other --argjson call in the Helm sync path passes a small, bounded
value, so nothing else needed changing.

Adds a regression test with a fleet-scale (100-card) fixture whose
combined desired-records JSON exceeds the real argv limit.
@geojitsu
geojitsu merged commit b07dc5a into main Sep 17, 2026
14 checks passed
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.

1 participant