Skip to content

PLAN: add repoint rule 6 — the media host is LFS-only, so a fold changes host - #50

Merged
mmcky merged 2 commits into
mainfrom
docs/repoint-rule-6-media-host
Aug 7, 2026
Merged

PLAN: add repoint rule 6 — the media host is LFS-only, so a fold changes host#50
mmcky merged 2 commits into
mainfrom
docs/repoint-rule-6-media-host

Conversation

@mmcky

@mmcky mmcky commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Records a host trap found while preparing the french_rev set. It is latent in exactly one remaining piece of work — the high_dim_data fold — and it would break every consuming read in it.

The measurement

media.githubusercontent.com/media/<org>/<repo>/<ref>/<path> is the LFS media endpoint. It resolves only for paths LFS-tracked in that repo, and 404s for a plain-git file. Measured 2026-08-07 with curl:

URL Status
raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/mpd2020.xlsx 200
media.githubusercontent.com/media/QuantEcon/data-lectures/main/lectures/mpd2020.xlsx 404

Both hosts send access-control-allow-origin: *, so this is host routing, not CORS. That makes it a different failure from rule 5, and unlike rule 5 it hits CPython consumers too — intro and Colab, not just the browser.

Why it matters now

high_dim_data tracks *.csv and *.dta under a blanket LFS rule, so all 14 consuming reads go through the media host today. The storage decision lands those six datasets here as plain git (both SCF minis are under the 100 MiB blob limit), after which the media host 404s for them.

So the fold must change host as well as org and repo. A mechanical org/repo swap — the obvious way to do it — breaks all 14. The rule enumerates them with file and line, 12 on the media host and 2 on the github.com/*/raw/ redirect form.

The framing worth keeping: the plain-git decision does not dissolve the raw-vs-media trap for the repoint, it inverts it — from "consumers must know to use the media host" to "consumers already on it must be moved off, in the same PR as the fold."

Not covered by CI

The strict audit's URL-form check catches only the github.com/*/raw/ form, and only in lecture-wasm (#48). A media-host reference to a data-lectures path is invisible to every build and fails at read time. Two of the 14 reads are _static/…/inequality/data.ipynb builder notebooks, which the audit does not scan as data reads at all.

Hence the acceptance grep in the rule and the matching Phase 3 checkbox: grep -rn 'media.githubusercontent.com/media/QuantEcon/data-lectures' repos/ must return nothing after the fold.

Diff

Docs only — rule 6 in the "Repoint rules" section, the section's intro line updated from five rules to six, and one checkbox added to Phase 3 where the fold happens.

Context: QuantEcon/workspace-lectures#23.

🤖 Generated with Claude Code

…ges host

`media.githubusercontent.com` serves only LFS objects and returns 404 for a
plain-git file, while `raw.githubusercontent.com` serves it. Both send
access-control-allow-origin: *, so this is host routing rather than CORS — a
different failure from rule 5, and it affects CPython consumers too.

This is latent in exactly one remaining piece of work, and it would break all
of it. high_dim_data tracks *.csv and *.dta under a blanket LFS rule, so all
14 consuming reads go through the media host today. The storage decision lands
those six datasets here as plain git, after which the media host 404s for them
— so the fold must change host as well as org and repo. A mechanical org/repo
swap breaks every read.

Rule 6 records the measurement, enumerates the 14 reads with file and line, and
gives the acceptance grep. Phase 3 gets a matching checkbox, since that is
where the work happens.

Nothing in CI covers this: the strict audit's URL-form check catches only the
github.com/*/raw/ form, and only in lecture-wasm (#48). Two of the 14 reads are
builder notebooks the audit does not scan as data reads at all.

Found while preparing the french_rev set. Context in
QuantEcon/workspace-lectures#23.
Copilot AI lite review requested due to automatic review settings August 7, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents an additional repointing hazard in PLAN.md: the media.githubusercontent.com/media/... endpoint only serves LFS-tracked paths, so folding LFS-tracked datasets into this repo as plain-git requires updating consumers to a different host, not just a different org/repo.

Changes:

  • Extend “Repoint rules” intro from five to six rules and clarify scope of rules 5–6.
  • Add repoint rule 6 describing the LFS-only nature of the media.githubusercontent.com host, with a measured example and an acceptance grep for the high_dim_data fold.
  • Add a Phase 3 checkbox calling out the need to move all affected consuming reads off the media host during the fold.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PLAN.md Outdated
Comment thread PLAN.md Outdated
Addresses Copilot review on #50.

The "Repoint rules" intro said rules 5 and 6 are "not fully enforced either" —
a doubled construction, and vague where the rest of that paragraph is specific
about what CI does and does not catch. Now says what CI actually covers: the
github.com/*/raw/ form in lecture-wasm, and nothing else.

The Phase 3 checkbox repeated the acceptance grep and both caveats already in
rule 6. A grep string copied into two places drifts, and this one is
load-bearing — if the copies disagree later, the checklist is what someone will
act on. The box keeps the what and the why so it still means something on its
own, and defers the enumerated reads, the acceptance check and the CI caveat to
rule 6, which is now the single canonical place. The grep string appears once
in the file.

Docs only; no change to the rule's substance.
@mmcky
mmcky merged commit a935449 into main Aug 7, 2026
1 check passed
@mmcky
mmcky deleted the docs/repoint-rule-6-media-host branch August 7, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants