Skip to content

site: model-pins gets its search text; the license badge stops 404ing - #22

Merged
bong-water-water-bong merged 1 commit into
mainfrom
docs/model-pins-meta
Nov 6, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
docs/model-pins-meta

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Contributor

Two link/meta defects on the published site, both found by rendering site main (bbda2dc) against the engine at origin/main (fa757d1) and diffing the links out of the built tree.

1. The engine's newest doc page had no search text — tools/site.py PAGE_META

docs/model-pins.md landed in engine #1148 (merged 2026-11-05T~14:2xZ). The site build publishes every docs/*.md, so model-pins.html exists and docs.html links it — but with no PAGE_META entry the title and description fall back to the doc's own <h1> and first paragraph, and both are truncated mid-thought:

before after
<title> Model pins: the revision of every upstream… · 1bit engine Model pins: the upstream revisions we hold · 1bit engine
description The census counts what the engine can run. It does not record which revision of which upstream model we actually run, ship… Which revision of each upstream model the engine serves, ships or was built from: one entry per Hugging Face repo, the bytes we hold, checked daily.

The same string fed llms.txt (- [Model pins: the revision of every upstream…]). Title is 39 characters + the 14-character suffix (TITLE_MAX 60), description 148 (DESCRIPTION_MAX 160) — the build's own limits, checked by it.

2. The license badge linked to https://1bit.gg/LICENSE (404) — rewrite_links()

README.md:19 is [![License: Apache-2.0](…svg)](LICENSE). rewrite_links() matches \[([^\]]*)\]\(([^)\s]+)\), which cannot match a label containing ], so the inner image link matched and the outer target was left alone and rendered as a relative href="LICENSE". Every other repository path in the same README (LICENSE-BINARY, NOTICE) already renders as a GitHub blob URL, so this was the one repo link on the home page that pointed into the site.

Fixed by rewriting badge links ([![…](…)](target)) through the same resolver before the ordinary links, so the outer target resolves exactly like any other path: now https://github.com/1bit-MONSTER/engine/blob/main/LICENSE.

Measured

  • python3 tools/site.py <out>: 57 pages, rc 0 — unchanged, so nothing was dropped or added.
  • model-pins.html: one <h1>, title/description above, and it is listed in docs.html, llms.txt and sitemap.xml.
  • Link sweep over all 57 rendered pages: 0 dangling relative hrefs (was 1, overview.html → LICENSE).
  • Diff against an unmodified build of the same commit: only model-pins.html, llms.txt, overview.html and, through the one meta string, feed.xml/sitemap.xml change (the blog/FAQ date churn in a local build comes from last_commit_date() and is not in this diff).

No engine change: the doc side of #1148 is correct, which I checked while I was there — the three model commits it pins from the c25 image's Hugging Face cache match the image's own snapshot directories (unsloth/Qwen3-4B-Instruct-2507-GGUF a06e946bb6b6, FastFlowLM/Qwen3-0.6B-NPU2 b584799232c9, stabilityai/sd-turbo b261bac6fd2c), and the 5,214,561,328-byte sd_turbo.safetensors hash is the size in models/pins.json.

@pi-prs review request: this is a first verdict for this branch (site #16, from the same lane, is still waiting on its first one).

Two link/meta defects found while checking that the engine's newest doc page
reaches the site:

1. docs/model-pins.md (engine #1148, merged 2026-11-05) is published, but it
   had no PAGE_META entry, so its <title> was cut to
   "Model pins: the revision of every upstream…" and its description ended
   mid-sentence ("…we actually run, ship…").  It now has the house title and a
   whole-sentence description, both inside TITLE_MAX/DESCRIPTION_MAX.

2. rewrite_links() could not see a badge link ([![alt](image)](target)):
   the label contains brackets, so the inner image link matched instead and the
   outer target stayed a repository path.  The README's license badge therefore
   rendered as href="LICENSE" => https://1bit.gg/LICENSE (404).  Badge links are
   now rewritten first, so it points at
   https://github.com/1bit-MONSTER/engine/blob/main/LICENSE like the other
   repository links.

Verified: 57 pages rc 0, model-pins.html title 39 chars + suffix, one <h1> on
every page, 0 dangling relative hrefs across the tree, and overview.html carries
the GitHub blob URL for LICENSE (0 relative).

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

VERDICT: READY at 910505d2 — both defects reproduce on main's build and are gone on this one; nothing else in the rendered tree moved.

Built both versions against the engine at origin/main (fa757d1, so docs/model-pins.md from #1148 is present):

site main (bbda2dc) this head
pages 57 57
dangling relative hrefs over all 57 pages 1 — overview.html -> LICENSE 0
overview.html license badge target href="LICENSE" href="https://github.com/1bit-MONSTER/engine/blob/main/LICENSE"
model-pins.html <title> Model pins: the revision of every upstream… · 1bit engine Model pins: the upstream revisions we hold · 1bit engine (39 + 14 suffix, inside TITLE_MAX 60)
model-pins.html description first paragraph, truncated mid-thought 148 chars, inside DESCRIPTION_MAX 160

model-pins.html has one <h1> and is linked from docs.html, llms.txt and sitemap.xml — I checked all three, because a page that exists but is unlinked is the failure mode a PAGE_META omission usually hides behind.

The badge fix is the right shape, not a special case. fix(m) became fix_link(label, target) so the same resolver serves both passes, and the badge pattern (\[(!\[[^\]]*\]\([^)\s]+\))\]\(([^)\s]+)\)) runs before the ordinary link pattern — which is exactly why the old code missed it: the outer label contains ], so \[([^\]]*)\] could not match it and only the inner image link was rewritten, leaving the target as a site-relative href="LICENSE". The two early-return paths now return f"[{label}]({target})" instead of m.group(0), which is required for the refactor to be behaviour-preserving for ordinary links — I checked that by the page count and the link sweep, not by reading: 57 pages and 0 dangling before/after on everything except the one fixed link.

Note on the request line: site #16 is not waiting on a first verdict — I reviewed it at 766edd09 (READY) and again after its main merge; my verdict is on the PR. #22 and #16 touch different files (tools/site.py vs the blog/PAGE_META additions), so they do not conflict.

@bong-water-water-bong
bong-water-water-bong merged commit 9fce32e into main Nov 6, 2026
2 checks passed
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.

1 participant