Skip to content

Locate only Hub dataset ids; say when a file link is read - #650

Merged
bact merged 11 commits into
mainfrom
hub-card-dataset-links
Dec 3, 2026
Merged

bact merged 11 commits into
mainfrom
hub-card-dataset-links

Conversation

@bact

@bact bact commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Follow-up to #604/#636 (round-2 review, 0.25.2). Stacked on #641.

  • A card datasets: entry that is no Hub dataset id (free text, reserved owner) keeps its name and gets no made-up huggingface.co/datasets/... location; a dataset page URL is named by its id.
  • A Hub URL naming a file or folder (/resolve/main/x.gguf, /tree/main/sub) says target-ambiguous/hf-url-path: the SBOM describes the repository, not that path.

All 164 HF fixtures byte-identical; regression tests fail on the base.


Generated by Claude Code

bact added 2 commits December 3, 2026 06:23
A model card's datasets: entry gets a Hub download location only when it
is a Hub dataset id whose owner is no reserved Hub name; a dataset page
URL is named by its id. Any other text keeps its name with no location
and is not looked up. The shared rule lives in core/hub_dataset_id.py,
used by the card route, the dataset lookup and the GGUF reader.

A Hub model URL naming a file or directory (/resolve/main/<file>,
/blob/..., /tree/main/<dir>) now says once, on every route, that the
SBOM describes the repository, not that file or directory
(target-ambiguous/hf-url-path).

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added the test-all-os Use this to trigger full tests on all platforms label Dec 3, 2026 — with Claude
bact added 7 commits December 3, 2026 07:06
hub_dataset_page() refuses text with white space or a non-printable
character, as stated_url() does: urlsplit drops a tab or a newline.
A local model card's datasets: (enrich) is named and located through
hub_card_datasets(), so a dataset page and its id are one dataset across
the Hub card, GGUF and enrich routes. The display-escape tests expect no
location for a card entry that is no Hub dataset id; a library caller's
dataset location covers the IRI escape end to end.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
…own one

A local model card's bare name is no Hub id: it gets no location, only a
dataset page does (named by its id). A page entry's name provenance is
one record (Source, Field: datasets, Method: hub_dataset_id), built with
the provenance builders. A card entry naming a dataset an earlier source
gave fills that dataset's unset fields (merge_dataset_into), and within a
card a later page locates an earlier bare entry.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
…flict

ReadmeEnricher keeps its pylint suppression above the class. A dataset
conflict from a local card names the model as its reader does
(dataset_model, now in core.dataset_merge). Two spellings of one Hub
dataset page (http/https, a trailing slash) are one download location.
A local card's page entry is cited with the Hub route's field wording.
The docs say a loom enrich fragment does not carry a fill of a dataset
the model already names.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
- dataset_merge._differ compares download URLs that are one Hub dataset
  page by dataset_key, so scheme, case and a trailing slash are no
  conflict.
- loom enrich says once per dataset, in an INFO line
  (field-not-recordable/fragment), that a model card's download location
  for a dataset the model already names is written with --enrich but not
  carried in the fragment.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
A dataset location dropped from an enrichment fragment is a deviation
the user can act on, so it is a WARNING with an action (rule R1), not an
INFO outlier.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
enrich_model() now names generate_model_sbom(enrich=True), not the
--enrich flag, as what records a dataset location the fragment drops.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added the enhancement New feature or request label Dec 3, 2026
@bact
bact changed the base branch from ccr-5d41e097-sud42y-hub-routing-refusals to main December 3, 2026 11:56
bact added 2 commits December 3, 2026 11:58
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>

# Conflicts:
#	CHANGELOG.md
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>

# Conflicts:
#	CHANGELOG.md
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.98%. Comparing base (9bdca54) to head (40a4a8d).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #650   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         544      545    +1     
  Lines       35609    35697   +88     
  Branches     5018     5028   +10     
=======================================
+ Hits        35602    35690   +88     
  Misses          4        4           
  Partials        3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bact
bact merged commit 950c895 into main Dec 3, 2026
26 checks passed
@bact
bact deleted the hub-card-dataset-links branch December 3, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request test-all-os Use this to trigger full tests on all platforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants