Repository navigation
Description
repo-universe(check_issues): valid-JSON wrong-shape fetch/state entries crash the whole checker instead of a per-repo ERROR — poison state re-crashes daily
Problem
scripts/fleet/repo-universe/check_issues.py promises in its header that a failed fetch is "an explicit ERROR line in the report (and a non-zero exit); the repo's persisted state is left untouched, so a failure never masquerades as an empty repository." That contract only holds for failures raised as FetchError. Every valid-JSON-but-wrong-shape input escapes as an unhandled TypeError / AttributeError, kills the whole run before any report or state file is written, and — for persisted state — re-crashes every daily timer run until a human repairs state.json by hand.
Sites (all on current main fff580fb1e, origin/main):
check_issues.py:109-113—normalize_issue:"pull_request" in rawthenraw.get(field). A non-object item (123,"x") raisesTypeError/AttributeError, notFetchError.check_issues.py:150-161—fetch_issues_fixture: only a dict entry containing"error"becomes aFetchError. A dict entry without"error"(e.g. one issue object instead of a list) is iterated by key; an int entry is not iterable; a list of non-objects reachesnormalize_issueand crashes the same way.load_fixture(:146-147) likewise returns any JSON shape, so a top-level list fixture crashes atfixture.get(:151).check_issues.py:116-147—fetch_issues_ghhas the same hole on the live path: a parsed JSON page that is not a list of objects (a string, a list containing a scalar) is iterated intonormalize_issueand raises outside theFetchErrorwrapping that covers the subprocess and the JSON parse.check_issues.py:261-262+:202-203+:216-217— persisted state:mainloadsstate.jsonwith barejson.loads;run_checkdoesstate.get("repos", {}),dict(prior_repos)andprior_repos.get(repo); a top-level list, a list-valuedrepos, or an int per-repo entry raises before any repo is checked.diff_repo(:179-188) then subscripts persisted issue entries (old["state"]etc.), so an int entry for one issue number crashes that repo's diff.check_issues.py:207-215—run_checkcatches onlyFetchErroraroundfetch(repo); the shape crashes above are raised inside the fetch callables and insidediff_repo, outside that handler, so one bad repo / one bad state entry takes down every other watched repo's delta for the run.
Evidence (verified this run, laptop @ fff580fb1e == origin/main)
Probe ~/git/fleet/probe-check-issues/probe.py on the laptop, importing the real check_issues module from origin/main:
- Control —
run_checkwith a valid in-memory fetch: Ok (had_error=False); control baseline-then-diff with a well-formed persisted entry: Ok. - Fixture entry
{"number": 1}(object, noerror) →AttributeError: 'str' object has no attribute 'get'; entry123→TypeError: 'int' object is not iterable; entry[123]→TypeError: argument of type 'int' is not a container or iterable; entry["x"]→AttributeError: 'str' object has no attribute 'get'; top-level fixture[1, 2]→AttributeError: 'list' object has no attribute 'get'. - Persisted state as a top-level list →
AttributeError: 'list' object has no attribute 'get';{"repos": []}→ same;{"repos": {"a/b": 123}}→TypeError: 'int' object is not subscriptable;{"repos": {"a/b": {"issues": {"1": 123}}}}with a current issue test #1 →TypeError: 'int' object is not subscriptable.
No report file and no state file are written on any of these paths (main writes both only after run_check returns, :271-280).
Why it matters
This checker is the daily, scheduled correctness floor for the repo-universe tracker (#1651): it is the thing that notices new/closed issues across every watched repo. Its one job on bad data is to say so per-repo and keep going. Instead, one malformed fixture/API item — or one wrong-shape entry in its own persisted state.json (a partial hand edit, a future schema change, a torn-but-parseable write) — silences the whole checker with a traceback in a timer log, and the state poison is self-perpetuating because the crashing run never rewrites the file.
Acceptance criteria
- Non-object fetch items (from the fixture path and the
gh apipath alike) and non-list per-repo fixture entries are reported as that repo'sFetchError— an ERROR line in the report, a non-zero exit, other repos still checked, and that repo's persisted state untouched. - A wrong-shape persisted
state.json(non-object top level, non-objectrepos, non-object per-repo entry, non-object persisted issue entry) is handled under the same rule: named as an error and either skipped per-repo or failed as a single named load error — never an unhandledTypeError/AttributeErrortraceback that aborts the run for every repo. - Valid behaviour is unchanged: baselining, new/closed/reopened/changed deltas, failed-fetch state preservation, and report/state writing all work exactly as before on well-formed inputs (in-tree
test_check_issues.pystill passes). - Regression tests in
test_check_issues.pycover at least: fixture entry as an object withouterror, fixture entry[123], state as a top-level list, per-repo state entry as an int, and a persisted issue entry as an int — each fails on current code with the exceptions above and passes after the fix.
Dedup: distinct from #6612 (generate.py offline --forks-org-json omission — the generator, not the checker), #5945/#1651 (the checker existing / being wired at all), and the github-backup shape issues #6637/#6606/#6575 (different system, different files). Title/keyword searches for check_issues + shape/state return no covering issue.
Activity
developing-today commentedon Nov 7, 2026
CODE-2055
dezren39 commentedon Nov 7, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 7, 2026
Picked up by repo-worker-code-y (Lane Y queue worker shift, FALLBACK MODE — queue backend down: fleet queue health returns HTTP 503 PGRST002; fallback protocol in doc/fleet/queue-fallback-mode.md followed manually via the gh CLI).
🤖 Agent note · picked up
14 remaining items
dezren39 commentedon Nov 7, 2026
🤖 Agent note · picked up
repo-worker-code-a(issue repo-universe(check_issues): valid-JSON wrong-shape fetch/state entries crash the whole checker instead of a per-repo ERROR — poison state re-crashes daily #6652 is the task in fallback mode)queue/queueditems in scan order; triage by lane code-y confirmed the bug and re-queued this issue as the fix vehicle)scripts/fleet/repo-universe/check_issues.pyso valid-JSON wrong-shape fetch/state inputs become per-repoFetchErrorreports (or a single named load error for state) instead of unhandledTypeError/AttributeErrorcrashes; add the five named regression tests totest_check_issues.pyqueue/6652-check-issues-shape(laptop worktree~/git/fleet/fb-6652), to be created this shiftdezren39 commentedon Nov 7, 2026
Progress from
repo-worker-code-a: fix in progress in ~/git/fleet/fb-6652 (branch queue/6652-check-issues-shape): normalize_issue/fixture/gh shape guards raising FetchError, run_check state-shape validation (per-repo ERROR for malformed prior entries, named load error for top-level state shape), main maps FetchError to a named exit-2; regression tests for all five named shapes + main-level state file case.dezren39 commentedon Nov 7, 2026
Progress from
repo-worker-code-a: targeted_tests_passed: python3 test_check_issues.py — 15 tests OK (8 pre-existing + 7 new WrongShapeTests) on the laptop. Committed + pushed; opening PR.Merge pull request #6705 from developing-today/queue/6652-check-issue…
dezren39 commentedon Nov 7, 2026
🤖 Agent note · done
repo-worker-code-a(issue repo-universe(check_issues): valid-JSON wrong-shape fetch/state entries crash the whole checker instead of a per-repo ERROR — poison state re-crashes daily #6652 is the task in fallback mode)check_issues.pynow surfaces as per-repoFetchErrorERROR lines (fetch paths) or a single named load error (state top-level shapes, exit 2 frommain); malformed per-repo persisted entries are reported per-repo with state left untouched.c05ada56a9e387af12811c87d8dcd973a9939008), closing issue repo-universe(check_issues): valid-JSON wrong-shape fetch/state entries crash the whole checker instead of a per-repo ERROR — poison state re-crashes daily #6652. Codex review on head6fa0aa40a9: completed, zero findings. PRscripts-testchecks stayed QUEUED (runner backlog) — merged under standing criteria on laptop verification:python3 test_check_issues.py= 15 tests OK (8 pre-existing + 7 newWrongShapeTests).queue/6652-check-issues-shape· commit6fa0aa40a9dezren39 commentedon Nov 7, 2026
Released by
repo-worker-code-a(outcome: done). Done: check_issues wrong-shape fetch/state JSON now becomes per-repo FetchError ERRORs / a named load error (exit 2). PR #6705 merged (c05ada5), closing #6652. Laptop: test_check_issues.py 15 tests OK (7 new); Codex zero findings; scripts-test CI QUEUED (runner backlog).