Skip to content

repo-universe(generate): field-level wrong shape passes the #6716 entry guard — malformed full_name/html_url forge phantom repos in the artifact, and a string "false" fork silently un-watches an owned repo #6814

Closed

Description

@developing-today

Problem

scripts/fleet/repo-universe/generate.py validates enumeration entries at the entry level (#6716: an entry must be a JSON object with a string full_name), but it never validates the fields inside an object entry. A capture whose entries are objects with wrong-shaped fields is accepted silently and produces a corrupt maintained artifact (doc/fleet/repo-universe.yaml) — or silently misclassifies a real repo so it stops being watched.

This is the field-level residual of #6716 on the generator side, the same shape of gap #6757 fixed on the checker side (check_issues.py).

Evidence (verified this run, laptop, origin/main fc5aa00e79f33c5fd53bc2ad4ff0ccb6285b492d)

Probe: ~/git/fleet/probe-repo-universe-fields — the real generate.py taken verbatim from origin/main, driven through its public build():

  • validate_entry (generate.py:79-99) checks only isinstance(entry, dict) and isinstance(entry.get("full_name"), str). It does not check that full_name is a non-empty owner/name shape, and it never looks at html_url or fork.
  • Empty / malformed full_name is accepted and classified owned + watch: issues: entries with full_name "", "noslash", and "/leading" each produce a repos: entry (- name: / - name: noslash / - name: /leading) with class: owned, watch: issues, sources: [github].
  • Newline injection through full_name forges phantom repos: full_name "a/b\n - name: evil/injected\n url: https://evil.example\n class: owned\n watch: issues\n sources: [github]" is emitted verbatim at generate.py:327 (lines.append(f" - name: {full}")), so the artifact gains a complete, well-formed-looking second repo entry for evil/injected that no enumeration ever returned.
  • Newline injection through html_url forges phantom repos too: build() takes the URL as (repo or {}).get("html_url") or ... (generate.py:317-321) with no type or content check and emits it verbatim at :328. An html_url of "https://example.com\n - name: evil/injected" injects a phantom entry the same way.
  • Non-string html_url is rendered as Python syntax: html_url: 12345 emits url: 12345; html_url: ["x", "y"] emits url: ['x', 'y'].
  • fork is judged by truthiness, not by type: classify (generate.py:213-217) does if gh_repo.get("fork"): return "fork". An entry with "fork": "false" (string) is classified class: fork / watch: inventory-only — a non-fork owned repo silently drops out of issue watching because a capture field carried the wrong JSON type.

Control: a well-formed entry (full_name developing-today/code, string html_url, fork: false) builds exactly as before (class: owned, correct URL).

Why it matters

The artifact this generator writes is the fleet's repo universe: class and watch decide which repos get their issues pulled in and tracked (#1511). A single wrong-shaped capture — a hand-saved API error page, a truncated/edited capture file, a proxy that stringifies booleans — either corrupts the artifact with phantom repos (which downstream consumers then try to watch) or silently un-watches a real owned repo. #6716 made wrong-shape entries fail with a named error precisely so a bad capture cannot silently rewrite the universe; the field-level hole re-opens that door one level down.

Acceptance criteria

  • validate_entry (or an equivalent single gate used by decode_pages, merge_repos, and build) rejects, with the existing named-error style (source + entry index + offending value), any entry whose full_name is not a well-formed owner/name string (non-empty owner and name, exactly the GitHub shape, no whitespace/control/newline characters).
  • An entry whose html_url is present and not a string, or contains whitespace/control/newline characters, is rejected with the same named error; an absent html_url keeps the current fallback behaviour.
  • An entry whose fork is present and not a JSON boolean is rejected with the same named error (no truthiness coercion); absent fork keeps current behaviour.
  • No input accepted today with well-formed fields changes output: regeneration on well-formed captures is byte-identical, and the in-tree test_generate.py suite passes.
  • Regression tests in test_generate.py cover at least: empty full_name, slash-less full_name, newline-bearing full_name, non-string html_url, newline-bearing html_url, and string "false" fork.

Relates to #6716 (entry-level shape, closed) and #6757 (same field-level gap, checker side).

Activity

  1. added
    source/creatorFiled by the new-issue-creator job
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    priority/normalOrdinary priority (the default)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    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

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: new-issue-creator-code-a run 2026-11-06 23:35 CST
    • Found via: filed this run
    • Task: Field-level shape validation for repo-universe generate.py enumeration entries — the residual of repo-universe(generate): wrong-shape enumeration entries crash the whole generator — a non-object entry or a dict without full_name aborts regeneration with a bare TypeError/KeyError #6716: validate full_name shape, html_url type/content, and fork boolean type at the entry gate so a wrong-shaped capture fails with a named error instead of forging phantom repos in the artifact or silently un-watching an owned repo.
    • Expectation: effort/s — done when the acceptance criteria in the issue body hold and test_generate.py passes with the new field-shape regression cases.
    • Links: probe ~/git/fleet/probe-repo-universe-fields (laptop, real generate.py from origin/main fc5aa00e79f33c5fd53bc2ad4ff0ccb6285b492d)
  3. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    Picked up by repo-worker-code-b — 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-b 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-b: pr_opened: branch queue/6814-universe-field-validation (67674b9); unittest 17/17 + checker 19/19; next: brief Codex/CI watch then merge

  6. added a commit that references this issue on Nov 7, 2026
  7. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    Released by repo-worker-code-b (outcome: done). DONE fixed_merged (fallback, lane code-b): validate_entry in scripts/fleet/repo-universe/generate.py now validates fields inside an entry - full_name must match the GitHub owner/name shape (FULL_NAME_RE), html_url present-and-non-null must be a string free of whitespace/control chars, fork present-and-non-null must be a JSON boolean - all rejected with the existing named-error style at the single gate decode_pages/merge_repos/build share. PR #6836 MERGED (branch queue/6814-universe-field-validation, 67674b9); unittest test_generate 17/17 (2 new tests cover all six acceptance cases + end-to-end named CLI failure with no artifact) and test_check_issues 19/19 on the laptop; direct build() probe re-run rejects all three issue evidence shapes; no Codex findings existed. Verified on fresh main; issue #6814 CLOSED by the merge.

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 jobstatus/needs-triageNot yet triaged; needs a first looktask/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