Skip to content

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 #6757

Closed

Description

@developing-today

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_issue projects 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 the FetchError a 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 by str(i["number"])); several fieldless entries collapse into that one key; a diff report prints the phantom verbatim as - new: #None None (None); a number given 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 crashes sorted(group, key=lambda i: i["number"]) (check_issues.py:278) with TypeError: '<' not supported between instances of 'str' and 'int' — outside the FetchError handler in run_check, so the whole run dies with no report and no state write.
  • check_issues.py:211-221 — _valid_prior_entry checks only that each persisted issue value isinstance(v, dict). A field-missing dict (e.g. "2": {} from a partial hand edit or a torn-but-parseable write) passes, then diff_repo subscripts it — old["state"] at check_issues.py:198 raises KeyError: 'state'. Because main writes state only after run_check returns, the poisoned entry re-crashes every daily timer run until a human repairs state.json by 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-formed number: 2 issue, both new on a diff run: TypeError: '<' not supported between instances of 'str' and 'int' at check_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_entry returns True, then run_check crashes with KeyError: 'state' at check_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_issue validates the projected fields (at minimum: number is an int — not a bool, string, or list; state/title/updated_at/html_url are strings or explicitly handled when absent) and raises FetchError for 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 (or diff_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 a KeyError/TypeError traceback.
  • 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.py still passes).
  • Regression tests in test_check_issues.py cover at least: fixture entry {}, fixture entry with a string number alongside 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

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/repo-universescripts/fleet/repo-universe generator + issue checker
    on Nov 7, 2026
  2. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    🤖 Agent note · filed

  3. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    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 while repo-worker-code-l posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  4. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 7, 2026
  5. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    Progress from repo-worker-code-l: claimed: verifying check_issues.py field guards on current main, reproducing phantom/crash cases

  6. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    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-fields

  7. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    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 merge

  8. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    Agent note — parked (fallback, lane code-l)

    Done this claim

    • Reproduced all three defects on current main (450ec30): normalize_issue({}) → phantom all-None issue; string number → TypeError crash in run_check's sorted(); _valid_prior_entry({"issues": {"2": {}}}) → True.
    • Fix on branch queue/fb-6757-check-issues-fields (commit 03c31fb), PR fix(repo-universe): validate issue fields in check_issues (#6757) #6761: shared _issue_field_error rule (oracle: GitHub issues API shape — number is a non-bool int; state/title/updated_at/html_url are strings; persisted key must equal str(number)), enforced by normalize_issue (FetchError → per-repo ERROR) and _valid_prior_entry (malformed-state per-repo ERROR).
    • Tests on the laptop: 19/19 pass after the fix; the 4 new regression tests fail/error on the pre-fix code (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 claim done. Parked, not released — claim goes stale 30 min after the park heartbeat and the next shift's scan picks it up.

  9. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 7, 2026
  10. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    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.

  11. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    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 while repo-worker-code-d posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  12. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    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 authority

  13. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    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.

  14. added a commit that references this issue on Nov 7, 2026
  15. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    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.

  16. removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/repo-universescripts/fleet/repo-universe generator + issue checkerkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions