mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #216] [MERGED] fix(public-repo-hygiene): stop reading huggingface.co model paths as GitHub repo references (BE-8910) #223
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/216
Author: @mattmillerai
Created: 8/24/2026
Status: ✅ Merged
Merged: 8/24/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-8910-hf-host-aware-repo-refs📝 Commits (4)
e413739fix(public-repo-hygiene): stop reading huggingface.co model paths as GitHub repo references (BE-8910)ba11694fix(public-repo-hygiene): require the non-GitHub host to be the URL authority (BE-8910)12782bdfix(public-repo-hygiene): close three fail-open holes in the non-GitHub host skip (BE-8910)034a009Merge origin/main into matt/be-8910-hf-host-aware-repo-refs📊 Changes
5 files changed (+438 additions, -2 deletions)
View changed files
📝
.github/public-repo-hygiene/README.md(+15 -2)📝
.github/public-repo-hygiene/check_public_repo_hygiene.py(+146 -0)📝
.github/public-repo-hygiene/tests/test_check_public_repo_hygiene.py(+185 -0)📝
.github/workflows/test-public-repo-hygiene.yml(+65 -0)📝
docs/callers/public-repo-hygiene.md(+27 -0)📄 Description
ELI-5
Comfy-Org/somethingis not automatically a GitHub repo — Comfy-Org publishes model weights on Hugging Face under the same org name, and the leak checker was reading those model names as references to private GitHub repos.#217fixed that for the URL spelling:https://huggingface.co/Comfy-Org/<model>now clears, because the host sits right in front of the name.It does not fix the markdown link spelling, where the same name appears twice on the line:
The target has a host in front of it and clears. The label is a bare token preceded by
[, so no offset the host scan produces can reach it, and it stays a finding — as unfixable from the caller's side as the URL was, for exactly the same two reasons (the name cannot go on a GitHub allowlist because there is no GitHub repo of that name, and the link is the product content telling a user where to download the weights). This PR clears the label, and only when the link target is a model-host URL naming the same repo.Measured effect — this is the whole delta
Swept
comfy-org/comfy-cliate64435awith the caller's ownticket_allowlist: HAILUO-03:mainbefore#217maintoday (#217)The two that clear are exactly the label shape, both on
tests/comfy_cli/fixtures/gallery/02_qwen_Image_edit_subgraphed.json:117—Comfy-Org/Qwen-Image_ComfyUIandComfy-Org/Qwen-Image-Edit_ComfyUI. A full-output diff of the two runs shows no other line moved, and categories 1 and 2 are untouched.The remaining 10 are
Comfy-Org/cloud(8),Comfy-Org/cql(1) andComfy-Org/comfy-knowledge(1) — genuine references to non-public GitHub repos, correctly flagged, and out of scope here: they need scrubbing in comfy-cli, not a checker change.What changed
.github/public-repo-hygiene/check_public_repo_hygiene.py— one new skip, gated on both ends, and nothing else in the verdict path:_labels_non_github_linkruns the same host test as the line-level scan (MODEL_HOST_PREFIX_RE,main's) against the link destination rather than against the line. It clears the label only when a model-host prefix ends exactly where the target's own reference starts, and the two names match._md_link_destinationreads that destination under a length bound and reports whether the bound cut it.Also updated: the checker README,
docs/callers/public-repo-hygiene.md, and the CI smoke fixtures intest-public-repo-hygiene.yml.#217touched none of those three, so the smoke layer had no model-host coverage at all before this PR — the clean-repo fixture and ninecheck_onecases now cover both shapes end to end.What this branch DELETED to get here
The merge commit (
034a009) removes this branch's own host machinery wholesale —_NON_GITHUB_HOST_PREFIX_RE,_NON_GITHUB_HOST_AUTHORITY_L,_URL_TOKEN_CHARS,_HOST_PREFIX_LOOKBACK,NON_GITHUB_ORG_NAMESPACE_HOSTS,_NON_GITHUB_HOST_PATH_PREFIXESand_is_non_github_host_prefixed— and keepsmain's. That is not deference;#217's version is genuinely ahead on three counts this branch never had: thecollections/route, anapi/that requires a resource segment (Hugging Face routes no/api/<owner>/), and(?-i:…)-scoped route segments so/MODELS/does not clear. Both branches independently landed on the same central insight — that a suppressor cannot reuse a detector's anchor, since the looseness that over-flags safely in one fails open in the other.16 tests were dropped with that machinery, each a duplicate of coverage
#217landed inRepoReferenceCategoryTest(host spellings, routes, ports, lookalikes, the IDN neighbour, path-segment authority). 12 remain, all of them the label shape and the ways clearing it could become a bypass.The three fail-open holes the review panel found, carried forward
The cursor-review panel ran against
e413739, one commit behind the authority anchor, so two of its eight findings were already closed and one was stale in its stated mechanism. Three were real, all of them reproduced by probe before anything was touched, and all three apply unchanged to the label skip:REPO_REF_RE's name class is ASCII, so a target naming<private>‐model(U+2010) or<private>%2Dotherread as<private>, compared equal to the label and silenced it — the prefix-vs-full-name hole_nonascii_tailclosed on the other side, reached through this door. The target's name must now span a whole path segment.…/resolve/main/split_files/diffusion_models/<file>.safetensors), and refusing them re-opens the false positives this skip exists to close. The truncation is detected, and only the comparison it can corrupt is refused.](<matching URL>was read as link text with no[ever opening a label. The reference now has to open the label — the shape the docstring, the README and the caller doc all describe, and the shape every instance in the swept corpus is written in.The panel's fourth real finding, the non-ASCII neighbour (
https://éhuggingface.co/…silently clearing, which this PR's body and README had both wrongly claimed was a bare-spelling-only residual), needs no carrying:main's_AUTHORITY_Lis a positive delimiter class, so that spelling fails it already and#217pins it with a test.Two panel findings were declined rather than fixed, with reasoning on their threads: the
.git-on-the-target suggestion rests on a premise that is inverted (the.gitstrip happens after the label skip, so both sides are compared on equal terms), and the path-segment/authority finding was already closed a commit earlier.Residual risk a reviewer should weigh
[Comfy-Org/<model>][ref]with the URL defined elsewhere is still a finding; no fixture in the swept corpus uses that shape, and clearing it would mean resolving link definitions across lines, which a line-oriented scan cannot do.[see Comfy-Org/x](…)) is now a finding, because the reference has to open the label. Every label-shape instance in the swept corpus is written[Comfy-Org/<name>](, and the sweep is byte-identical across that tightening — but it is a real narrowing, not a free one.comfy-org/comfy-cliwas swept; the rest of the enrolled fleet is unmeasured for this change.Unexercised artifacts
The source ticket cites a parent tracking issue and three sibling issues by identifier. Those live in an issue tracker this run has no access to, so their bodies and comments were never read. Their in-repo traces were read.
#217's own review threads were not read either — only its merged code and commit messages.Provenance
python3 -m unittest discover -s .github/public-repo-hygiene/tests -p 'test_*.py'— 165 tests, OK, 1 skipped; cursor-review 194 OK; agents-md-integrity 46 OK; groom 365 OK, 1 skipped;bash .github/bump-callers/tests/test_bump_callers.sh— 437 passed, 0 failed;shellcheck -xon the bump-callers scripts — clean;python3 -m py_compileon both changed Python files — clean; before/after full-output sweep ofcomfy-org/comfy-cliate64435a—main12 category-3 findings, this branch 10, no other category moved, and byte-identical to this branch's own pre-merge output; every bypass the review panel raised reproduced by probe against the pre-fix code and re-probed against the merged tree; CI smoke fixtures replicated by hand — clean fixture exit 0 (including the no-scheme spellings and an over-long-but-complete destination), all nine dirty cases exit 1 with the expected message;gh repo view(5 × not found) and the Hugging Face model API (5 × 200) run against the five names.mainafter#217shipped a parallel implementation of shape 1; this PR's own host machinery was deleted rather than reconciled, because#217's is ahead on three narrowings and is already merged. 16 tests were dropped as duplicates of coverage#217landed. Two review-panel findings were declined rather than fixed, with reasoning left on their threads. Beyond the stated scope, the checker README, the caller-facing doc and the CI smoke fixtures are updated in the same branch, because#217updated none of them and leaving them describing the pre-#217rule would have made them state the opposite of the code. One thing this PR does NOT fix and did not touch: this repo's ownAGENTS.mdis 305 lines against the 200-line hard ceiling its ownagents-md-integritychecker enforces — pre-existing onmain, ungated here because this repo has noci-agents-md-integrity.ymlcaller.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
ref:step output on a flow WORKFLOWS_REF binding line (BE-9099) #230