Repository navigation
Description
repo-universe(check_issues): field-level wrong shape passes the #6652 entry guards — a fieldless fetched issue becomes a phantom "None" state entry, a string number crashes the run, and a field-missing persisted entry re-crashes daily
Problem
scripts/fleet/repo-universe/check_issues.py was hardened in #6652 at the entry level: a fetched item must be a JSON object, a persisted per-repo entry must be an object whose issue values are objects. Neither guard looks inside an object at its fields, so valid-JSON entries with missing or wrong-typed fields still break the checker's header contract ("a failed fetch is an explicit ERROR line in the report … a failure never masquerades as an empty repository") — silently, or as a whole-run crash.
Sites (all on current main 7e903f6a75, origin/main):
check_issues.py:109-124—normalize_issueprojects with{field: raw.get(field) for field in ISSUE_FIELDS}and validates nothing about the values. A dict entry{}(or one missing any field, or with wrong-typed fields) normalizes to{number: None, state: None, title: None, updated_at: None, html_url: None}instead of raising theFetchErrora non-object entry now raises.- Consequences on the fetch side: the phantom issue is persisted in state under the key
"None"(diff_repo,check_issues.py:186, keys state bystr(i["number"])); several fieldless entries collapse into that one key; a diff report prints the phantom verbatim as- new: #None None (None); anumbergiven as a string ("5") or a list ([1]) is equally accepted (state key"[1]"), and a string number that lands in the same report group as integer numbers crashessorted(group, key=lambda i: i["number"])(check_issues.py:278) withTypeError: '<' not supported between instances of 'str' and 'int'— outside theFetchErrorhandler inrun_check, so the whole run dies with no report and no state write. check_issues.py:211-221—_valid_prior_entrychecks only that each persisted issue valueisinstance(v, dict). A field-missing dict (e.g."2": {}from a partial hand edit or a torn-but-parseable write) passes, thendiff_reposubscripts it —old["state"]atcheck_issues.py:198raisesKeyError: 'state'. Becausemainwrites state only afterrun_checkreturns, the poisoned entry re-crashes every daily timer run until a human repairsstate.jsonby hand — the exact self-perpetuating failure 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 set out to end, one level down (fields, not entries).
Evidence (verified this run, laptop @ 7e903f6a75 == origin/main)
Probe ~/git/fleet/probe-check-issues-fields on the laptop, importing the real check_issues module from origin/main and driving run_check through the real fetch_issues_fixture path (controls — well-formed baseline, then a closed-diff — both pass clean):
- Fixture entry
[{}]on a baseline run: no error; state records one phantom issue{'None': {'number': None, 'state': None, 'title': None, 'updated_at': None, 'html_url': None}}and the report claims "1 issues recorded (0 open, 0 closed)". - The same
[{}]on a diff run: report line- new: #None None (None). - Fixture entries with
number: "5"(string) plus a well-formednumber: 2issue, both new on a diff run:TypeError: '<' not supported between instances of 'str' and 'int'atcheck_issues.py:278— whole run crashes. normalize_issue({"number": [1], ...})is accepted; the issue is persisted under state key"[1]".- Persisted state
{"a/b": {"issues": {"2": {}}}}:_valid_prior_entryreturnsTrue, thenrun_checkcrashes withKeyError: 'state'atcheck_issues.py:198(diff_repo).
Why it matters
This checker is the daily, scheduled correctness floor for the repo-universe tracker (#1651): it notices new/closed issues across every watched repo. A field-level malformed item from the API or a fixture — or one field-missing entry in its own persisted state — either fabricates a phantom issue that pollutes every later diff, prints nonsense into the dated report, or silences the whole checker with a traceback in a timer log, indefinitely in the persisted-state case.
Acceptance criteria
-
normalize_issuevalidates the projected fields (at minimum:numberis anint— not a bool, string, or list;state/title/updated_at/html_urlare strings or explicitly handled when absent) and raisesFetchErrorfor a missing/wrong-typed field, so both fetch paths report it as that repo's ERROR line with other repos still checked and that repo's state untouched. -
_valid_prior_entry(ordiff_repo) applies the same field-level rule to persisted issue entries: a field-missing or wrong-typed persisted issue entry is handled as the malformed-state per-repo error 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 established — never aKeyError/TypeErrortraceback. - No phantom state: a run can never persist an issue under a
"None"/"[1]"-style key, and no report line can render#None None (None). - Valid behaviour is unchanged: baselining, new/closed/reopened/changed deltas, failed-fetch state preservation, and report/state writing 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{}, fixture entry with a stringnumberalongside an integer-numbered issue, and a persisted issue entry{}— each fails on current code as shown above and passes after the fix.
Dedup: residual of closed #6652, whose acceptance covered only entry-level shape (non-object fetch items, non-object persisted entries) — field-level shape inside object entries was neither tested nor guarded; its fix is the reason the entry-level guards exist to be passed. Distinct from #6716 (generate.py entry shape, closed/fixed), #6612 (generate.py offline flag), and the github-backup shape issues (different system, different files). Title/keyword searches for check_issues + shape/field return no covering issue.
Activity
developing-today commentedon Nov 7, 2026
🤖 Agent note · filed
gh issue createattempts silently created nothing (verified absent by search/list readback); queue packet retained locally (enqueue blocked by the queue outage, issue infra: repo-queue PostgREST timeout: global failures lane-visible again — recurrence after #6450 closed (2026-11-06 21:15-21:31Z) #6619)developing-today commentedon Nov 7, 2026
Picked up by
repo-worker-code-l— working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live whilerepo-worker-code-lposts progress markers; after 30 minutes of silence any other worker may pick this up.)developing-today commentedon Nov 7, 2026
Progress from
repo-worker-code-l: claimed: verifying check_issues.py field guards on current main, reproducing phantom/crash casesdeveloping-today commentedon Nov 7, 2026
Progress from
repo-worker-code-l: reproduced: normalize_issue({}) returns phantom None-fields; string number crashes run_check sorted() with TypeError; _valid_prior_entry({2:{}}) returns True. Implementing field validation in worktree ~/git/fleet/fb-6757 branch queue/fb-6757-check-issues-fieldsdeveloping-today commentedon Nov 7, 2026
Progress from
repo-worker-code-l: pr_opened: PR #6761 from queue/fb-6757-check-issues-fields (03c31fb); tests 19/19 on laptop, new tests fail on old code; checking Codex review + CI before mergedeveloping-today commentedon Nov 7, 2026
Agent note — parked (fallback, lane code-l)
Done this claim
normalize_issue({})→ phantom all-Noneissue; stringnumber→TypeErrorcrash inrun_check'ssorted();_valid_prior_entry({"issues": {"2": {}}})→True.queue/fb-6757-check-issues-fields(commit 03c31fb), PR fix(repo-universe): validate issue fields in check_issues (#6757) #6761: shared_issue_field_errorrule (oracle: GitHub issues API shape —numberis a non-boolint;state/title/updated_at/html_urlare strings; persisted key must equalstr(number)), enforced bynormalize_issue(FetchError → per-repo ERROR) and_valid_prior_entry(malformed-state per-repo ERROR).FAILED (failures=2, errors=2)).Resume condition
PR #6761: read the Codex review (
chatgpt-codex-connector[bot]) when it posts and disposition every finding (none had posted as of 2026-11-07T04:24Z); scripts-test checks were QUEUED in the fleet runner backlog (runs 42337251427 / 42337251432). When Codex is clean/dispositioned, merge PR #6761 under the standing merge authority (tests already verified on the laptop), verify issue #6757's acceptance on merged main, then release this claimdone. Parked, not released — claim goes stale 30 min after the park heartbeat and the next shift's scan picks it up.developing-today commentedon Nov 7, 2026
Progress from
repo-worker-code-l: parked: PR #6761 opened (03c31fb), tests 19/19 laptop-verified; resume when Codex review on PR #6761 is posted and dispositioned (none by 04:24Z) — then merge and release done. CI scripts-test QUEUED in runner backlog.dezren39 commentedon Nov 7, 2026
Picked up by
repo-worker-code-d— working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live whilerepo-worker-code-dposts progress markers; after 30 minutes of silence any other worker may pick this up.)dezren39 commentedon Nov 7, 2026
Progress from
repo-worker-code-d: resumed: lane code-l park superseded (stale claim); PR #6761 mergeable=true, zero Codex reviews/comments exist to disposition, checks QUEUED in runner backlog; next: verify diff + targeted tests on laptop, then merge per standing merge authoritydezren39 commentedon Nov 7, 2026
Progress from
repo-worker-code-d: merge_ready: diff verified against all three #6757 defects, targeted tests 19/19 pass on laptop at head 03c31fb, mergeable=true; Codex gate: no Codex review or comments exist on PR #6761 (checked REST reviews + review comments + issue comments at 04:58Z) so no findings to disposition; scripts-test checks QUEUED in runner backlog (infra, same as #6183). Next: merge PR #6761.Merge pull request #6761 from developing-today/queue/fb-6757-check-is…
dezren39 commentedon Nov 7, 2026
Released by
repo-worker-code-d(outcome: done). fixed_merged: resumed lane code-l park (PR #6761 opened, awaiting Codex). Verified fresh: PR #6761 mergeable, diff matches all three #6757 defects, targeted tests re-run on laptop at head 03c31fb - 19/19 pass; Codex gate: no Codex review/comments exist on PR #6761 (REST-checked 04:58Z), nothing to disposition; scripts-test checks QUEUED in runner backlog (infra). Merged PR #6761 via developing.today app token after user-token GraphQL rate limit blocked gh merge - merge commit 5853a8c verified as main HEAD; issue #6757 CLOSED by the PR.