Repository navigation
Conversation
|
Speaking as a user's firstmate. This matches a real-world failure in a home with task notes taking its backlog JSON past the ~128 KB per-argument limit: |
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 the contribution-machinery fault filed as this task. Use the transport that already exists in that file, make the failure loud instead of silent, and make the reader treat an empty or failed input as an error rather than a clean zero. This is firstmate's own tooling only — nothing of the CRM, no production work, no database. Report the before and after: what the coverage read before the fix and what it reads after, measured rather than cached.
Context — the fault:
--contribution-inputoutput mode ends by passing both JSON documents to jq on its command line:jq -n --argjson backlog "$BACKLOG_JSON" --argjson tasks "$contribution_tasks" '{backlog:$backlog,tasks:$tasks}'followed by an unconditionalexit 0. At the current backlog size the whole backlog plus every task record no longer fits inside the OS argv limit, so jq fails with "Argument list too long" on stderr, prints nothing on stdout, and the branch then runs thatexit 0— reporting success with an empty document.get_input()calls exactly that mode and does not check the result, so every poll projects an empty input (known 0, checked 0, unreadable_records 1, complete false), and bearings then reports cached coverage from the last measurement that succeeded. A failing check or an unanswered review on a published PR would not surface.--contribution-inputpath returns exit 0, zero stdout bytes, andjq: Argument list too longon stderr; the coverage projection from that input reads known 0 / checked 0 / unreadable_records 1 / complete false. The same data read through the working temp-file--slurpfiletransport (the full-snapshot path) reads known 5 / unreadable_records 0 / counts.fleet 5.What Changed
jq --slurpfiletransport; fail loudly on serialization errors.Risk Assessment
✅ Low: The bounded changes remove aggregate JSON from argv and reject failed or invalid input before projection while surfacing polling failures through the existing diagnostic channel.
Testing
Both focused suites passed. Isolated CLI measurements reproduced the baseline empty-success failure (known 0, checked 0, unreadable 1); the fix produced valid oversized input and fresh coverage of known 5, checked 5, unreadable 0, complete true. Invalid inputs failed visibly, including through the registered watcher. CLI transcripts and persisted output were captured; no live fleet or external forge was accessed.
Evidence: Measured before/after CLI behavior and watcher diagnostics
Source: Measured before/after CLI behavior and watcher diagnostics
Evidence: Freshly persisted fixture observations and pending reviews
Source: Freshly persisted fixture observations and pending reviews
Evidence: Bearings coverage after fresh polling
Source: Bearings coverage after fresh polling
Evidence: Reproducible evidence harness
Source: Reproducible evidence harness
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 4 issues found → auto-fixed ✅
bin/fm-contributions.sh:138- The requirement to "make the reader treat an empty or failed input as an error" is only implemented in get_input(). The publicsnapshot <file>path bypasses this validation and calls project() directly. With an empty file and no saved records, it still succeeds with known=0, checked=0, unreadable_records=1. The full-snapshot producer also invokes this path after an unchecked serialization command. Share input validation between get_input() and snapshot before projection.bin/fm-contributions.sh:135- The newfail 'contribution snapshot unavailable'contradicts "make the failure loud instead of silent" on the actual scheduled polling path: fail() writes only stderr, while fm-watch.sh run_check_capture() discards stderr and ignores the child exit status. A serialization failure therefore still produces no notification. Surface input failures through the existing contribution-check stdout diagnostic channel while retaining the nonzero exit.tests/fm-fleet-snapshot-view.test.sh:1183- Adding this unconditional test increases the successful suite output from 18 to 19ok -lines, but .github/workflows/ci.yml still requires exactly 18 in the required stock-macOS compatibility job. Update that assertion alongside the new test; otherwise even a fully passing suite fails CI.tests/fm-fleet-snapshot-view.test.sh:149- Both new jq wrappers delegate to hardcoded /usr/bin/jq, although the suites accept jq from PATH. Installations with jq elsewhere fail during setup rather than exercising the intended failure. Capture the real jq executable before prepending fakebin and delegate to that path here and in tests/fm-contributions.test.sh:331.🔧 Fix: Share contribution input validation and surface polling failures
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-contributions.test.shbash tests/fm-fleet-snapshot-view.test.shpython3 ~/.no-mistakes/evidence/01M32NQ7HVBTBQ7FGR99NRQDFB/contribution-cli-evidence.py: reproduced the base-commit argv failure, compared coverage, freshly polled five fixture PRs, verified Bearings and persisted reviews, exercised invalid inputs, and confirmed a real watcher diagnostic wake.git status --shortand fixture-directory inspection confirmed clean worktree and cleanup.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.