Bug: a single failed run permanently corrupts the collector state, and it can never self-heal
bin/gitwork reads its own previous output (the -output path, e.g.
~/.local/state/omarchy/git/overview.json) on every run and passes its
content to jq as --argjson previous "$previous" so it can carry forward
stale-host data.
If that file ever ends up containing invalid JSON (e.g. from a run that
was interrupted mid-write, or a bug in the merge step itself under some
edge case), every subsequent run fails immediately with:
jq: invalid JSON text passed to --argjson
gitwork: could not assemble the overview
Because the failure happens while reading the previous state, the script
exits before it can write a fresh, valid file. The broken file is never
replaced — the collector is stuck permanently, silently failing every
refreshIntervalSec forever, with no self-recovery path.
Reproduction
# Seed a "previous" file with one extra trailing brace, simulating a corrupt write
cat > /tmp/overview.json << 'JSON'
{
"schemaVersion": 3,
"updatedAt": "2026-01-01T00:00:00Z",
"providers": []}}
JSON
bin/gitwork -output /tmp/overview.json
# -> jq: invalid JSON text passed to --argjson
# -> gitwork: could not assemble the overview
# /tmp/overview.json is left untouched (still invalid) — every future run fails the same way
Expected behavior
A malformed previous-state file should be treated the same way a missing
one is (e.g. fall back to previous={} with a warning), rather than
aborting the whole collection run. That would let the collector recover on
its own the next cycle instead of requiring the user to manually delete
overview.json to unstick it.
Environment
- Plugin version: 2.1.0
- Symptom: bar widget shows stale/no data indefinitely;
journalctl --user
shows dev.git jq: invalid JSON text passed to --argjson /
gitwork: could not assemble the overview repeating every refresh interval
Bug: a single failed run permanently corrupts the collector state, and it can never self-heal
bin/gitworkreads its own previous output (the-outputpath, e.g.~/.local/state/omarchy/git/overview.json) on every run and passes itscontent to
jqas--argjson previous "$previous"so it can carry forwardstale-host data.
If that file ever ends up containing invalid JSON (e.g. from a run that
was interrupted mid-write, or a bug in the merge step itself under some
edge case), every subsequent run fails immediately with:
Because the failure happens while reading the previous state, the script
exits before it can write a fresh, valid file. The broken file is never
replaced — the collector is stuck permanently, silently failing every
refreshIntervalSecforever, with no self-recovery path.Reproduction
Expected behavior
A malformed previous-state file should be treated the same way a missing
one is (e.g. fall back to
previous={}with a warning), rather thanaborting the whole collection run. That would let the collector recover on
its own the next cycle instead of requiring the user to manually delete
overview.jsonto unstick it.Environment
journalctl --usershows
dev.git jq: invalid JSON text passed to --argjson/gitwork: could not assemble the overviewrepeating every refresh interval