Repository navigation
Description
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 onlyisinstance(entry, dict)andisinstance(entry.get("full_name"), str). It does not check thatfull_nameis a non-emptyowner/nameshape, and it never looks athtml_urlorfork.- Empty / malformed
full_nameis accepted and classifiedowned+watch: issues: entries withfull_name"","noslash", and"/leading"each produce arepos:entry (- name:/- name: noslash/- name: /leading) withclass: owned,watch: issues,sources: [github]. - Newline injection through
full_nameforges 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 forevil/injectedthat no enumeration ever returned. - Newline injection through
html_urlforges 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. Anhtml_urlof"https://example.com\n - name: evil/injected"injects a phantom entry the same way. - Non-string
html_urlis rendered as Python syntax:html_url: 12345emitsurl: 12345;html_url: ["x", "y"]emitsurl: ['x', 'y']. forkis judged by truthiness, not by type:classify(generate.py:213-217) doesif gh_repo.get("fork"): return "fork". An entry with"fork": "false"(string) is classifiedclass: 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 bydecode_pages,merge_repos, andbuild) rejects, with the existing named-error style (source + entry index + offending value), any entry whosefull_nameis not a well-formedowner/namestring (non-empty owner and name, exactly the GitHub shape, no whitespace/control/newline characters). - An entry whose
html_urlis present and not a string, or contains whitespace/control/newline characters, is rejected with the same named error; an absenthtml_urlkeeps the current fallback behaviour. - An entry whose
forkis present and not a JSON boolean is rejected with the same named error (no truthiness coercion); absentforkkeeps 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.pysuite passes. - Regression tests in
test_generate.pycover at least: emptyfull_name, slash-lessfull_name, newline-bearingfull_name, non-stringhtml_url, newline-bearinghtml_url, and string"false"fork.
Relates to #6716 (entry-level shape, closed) and #6757 (same field-level gap, checker side).
Activity
developing-today commentedon Nov 7, 2026
🤖 Agent note · filed
generate.pyenumeration 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: validatefull_nameshape,html_urltype/content, andforkboolean 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.test_generate.pypasses with the new field-shape regression cases.~/git/fleet/probe-repo-universe-fields(laptop, realgenerate.pyfrom origin/mainfc5aa00e79f33c5fd53bc2ad4ff0ccb6285b492d)developing-today commentedon Nov 7, 2026
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 whilerepo-worker-code-bposts 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-b: pr_opened: branch queue/6814-universe-field-validation (67674b9); unittest 17/17 + checker 19/19; next: brief Codex/CI watch then mergeMerge pull request #6836 from developing-today/queue/6814-universe-fi…
developing-today commentedon Nov 7, 2026
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.