WorkSweep re-creates every [Goal] and [BPE] issue when gh issue list fails
LifeOS/install/LIFEOS/TOOLS/WorkSweep.ts:195-209: ghListOpenIssues returns [] both when the repo has no open issues and when gh issue list fails (line 202, if (exit !== 0) return [];, and the catch on JSON parse). The caller at line 607 cannot tell the two apart. On a failed listing, sweepGoals (:441) finds no [goal:Gn] tag and opens a fresh issue for every active goal, and sweepBpeCadence (:511) does the same for [bpe-audit-due]. sweepStaleIssues and sweepProjectChecks also run against the empty view.
Observed on one install (LifeOS 7.40.4, hourly sweep on a laptop that sleeps and roams between networks): within about two weeks the work repo held 18 open [Goal] issues for 5 TELOS goals (2 to 4 copies each) and 5 copies of the BPE reminder. In the sweep log the bad runs took 40 to 64 s instead of the usual 1 to 3 s, next to error connecting to api.github.com.
Reproduced with --dry-run: with the real gh the sweep reports 0 goals and 0 BPE issues to create; with a stub gh that exits 1 on issue list it reports 5 goals and 1 BPE issue to create.
Suggested fix (about 6 lines): return null (or throw) from ghListOpenIssues on a non-zero exit or unparsable output, and when it is null, skip the issue-creating steps (goals, BPE, stale, project checks) for that run and log the failure. The next hourly run catches up.
Related, same file, different dedupe path: #1936.
[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler
Thanks, this is fixed: WorkSweep now treats a failed gh list as LookupFailed and skips creation (WorkSweep.ts). The Goal and BPE sweeps were retired.