Skip to content

feat(tools,www): drive www nav/locale/link/SEO truth from owned sources with fail-closed gates (#1159, B2.4) - #1305

Merged
SisyphusZheng merged 2 commits into
devfrom
kimi/v044-b24-1159-web-truth
Sep 4, 2026
Merged

feat(tools,www): drive www nav/locale/link/SEO truth from owned sources with fail-closed gates (#1159, B2.4)#1305
SisyphusZheng merged 2 commits into
devfrom
kimi/v044-b24-1159-web-truth

Conversation

@SisyphusZheng

Copy link
Copy Markdown
Member

Part of #1159 (B2.4, stage #1288). Follows #1157 (PR #1303) and #1158 (PR #1304).

Problem

After B2.3 rebuilt the website, several public surfaces were still hand-maintained with no fail-closed gate: built-output internal links/fragments, generated nav freshness, bilingual locale availability, roadmap↔package version agreement, per-page SEO invariants, and guide code examples (never compiled against the real framework).

Owner

B2.4 / #1159 — website navigation, releases, i18n, SEO and link truth.

Before

  • Nothing checked that built HTML links/fragments resolve (first run of the new gate found 7 broken repo-relative links on /changelog and an unnormalized self-link on a blog post, ×2 locales).
  • _generated-nav.ts and the vite.config headerNav could drift from route truth silently.
  • No orphan/missing/duplicated-untranslated zh detection.
  • The CURRENT roadmap entry's version was not mechanically tied to the package line.
  • Guide @openelement/* code examples were never type-checked.

After

  • tools/check-www-links.ts + tools/lib/www-links.ts: built-output internal link/fragment gate (resolves every internal href/src against www/dist, anchors every #fragment, resolves every sitemap.xml URL) + per-page SEO invariants (exactly one <title>, non-trivial meta description, og:title). Wired into deno task build → the CI build gate fails closed.
  • www/app/routes/changelog.tsx: repo-relative CHANGELOG.md links project onto the canonical GitHub tree at the render seam (source stays GitHub-native).
  • tools/check-www-truth.ts (deno task www:check-truth): nav freshness (byte-identical regeneration of route meta + headerNav via the adapter's own scanner/writer, headerNav read through the TS AST), headerNav hrefs resolve to scanned routes, locale availability (orphan zh, missing zh, byte-identical en/zh all fail), roadmap CURRENT entry == package version tag.
  • tools/check-content-examples.ts (deno task content:examples-check): ts/tsx guide examples importing @openelement/* compile against the real framework via the TS compiler API (en/zh duplicates deduped). Only documented snippet elision is suppressed (consumer-project imports, elided app names, implicit any, the uninferred loader-data generic, the adapter-virtual @openelement/generated/* namespace); unknown framework modules/exports, argument errors, syntax/JSX errors fail closed.
  • AutoFlow policy: both gates registered at ci + release tiers; the build gate's triggers cover the link checker.
  • Already-gated surfaces composed, not duplicated: version.ts constants (docs:check-version-anchors), release-state.json agreement (release:truth:check), roadmap theme staleness (www:check-current-truth).

Why-not-second-owner

No package source or workflow changes; the adapter's nav scanner/writer and route scanner are consumed as libraries. Scheduled external link checks stay deferred to Beta.3 under #1156 (workflow cap 8; no ninth workflow added).

Evidence

  • deno run tools/check-www-links.ts — first run RED with 14 real broken-link findings; after fixes, green over 150 built pages; sitemap.xml URLs all resolve.
  • deno task www:check-truth — green on current truth; nav freshness proven by regenerating via the adapter scanner/writer and byte-comparing the committed module.
  • deno task content:examples-check — green; RED proof in tests (unknown @openelement module → TS2307 fail; unknown export → TS2305 fail; suppression boundary unit-tested).
  • deno task test — full suite (see checks); deno task build — green including the embedded link gate; deno fmt/lint/lint:markdown/typecheck — clean.
  • Policy tests (33) green, including the [B2] Reduce duplicated CI/check/task governance surface #1230 gate-command uniqueness rule.

Scope

New: 3 checkers + 1 lib + 3 test files. Modified: deno.json (tasks + build wiring), tools/autoflow/policy.ts (gates), www/app/routes/changelog.tsx (link projection). No frozen paths, no packages, no workflows.

Risk / recorded scope cuts (stage ruling)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploying openelement with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8fa53df
Status: ✅  Deploy successful!
Preview URL: https://9cc03907.lessjs.pages.dev
Branch Preview URL: https://kimi-v044-b24-1159-web-truth.lessjs.pages.dev

View logs

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

@SisyphusZheng
SisyphusZheng force-pushed the kimi/v044-b24-1159-web-truth branch from ef2cd8f to 8320b18 Compare September 4, 2026 03:36
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

DevBot added 2 commits September 4, 2026 11:54
…es with fail-closed gates (#1159, B2.4)

- tools/check-www-links.ts + tools/lib/www-links.ts: built-output internal
  link/fragment gate over www/dist (every internal href/src resolves to a
  built file; every #fragment anchors; every sitemap.xml URL resolves) plus
  per-page SEO invariants (exactly one <title>, non-trivial meta
  description, og:title). Wired into the build task so the CI build gate
  fails on broken links. First run found and this change fixes real broken
  links: CHANGELOG.md's repository-relative links are now projected onto
  the canonical GitHub tree at the changelog route's render seam.
- tools/check-www-truth.ts: the remaining hand-maintained surfaces must
  mechanically agree with owned truth — _generated-nav.ts byte-identical
  regeneration of route meta + vite.config headerNav (read through the TS
  AST), headerNav hrefs resolve to scanned routes, bilingual locale
  availability (orphan/missing zh and byte-identical en/zh pairs fail), and
  the CURRENT roadmap entry names the package version tag.
- tools/check-content-examples.ts: ts/tsx guide examples importing
  @openelement/* type-check against the real framework sources (en/zh
  duplicates deduped); only documented snippet elision (consumer-project
  imports, elided app names, implicit any, the uninferred loader-data
  generic) is suppressed — framework-surface errors fail closed.
- AutoFlow policy: www:check-truth and content:examples-check registered
  (ci + release tiers); the build gate's triggers cover the link checker.

Version constants and release-state agreement were already pinned by
docs:check-version-anchors / release:truth:check; this composes with them
instead of duplicating. Scheduled external link checks stay deferred to
Beta.3 under #1156 (workflow cap 8 — no ninth workflow added).
Clean CI checkouts do not carry the gitignored .tmp directory, so
Deno.makeTempDir({ dir: '.tmp' }) failed closed (NotFound) in
content:examples-check and its tests. Create it recursively first.
@SisyphusZheng
SisyphusZheng force-pushed the kimi/v044-b24-1159-web-truth branch from 8320b18 to 8fa53df Compare September 4, 2026 03:54
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

@SisyphusZheng
SisyphusZheng merged commit bddbb9d into dev Sep 4, 2026
10 checks passed
@SisyphusZheng
SisyphusZheng deleted the kimi/v044-b24-1159-web-truth branch September 4, 2026 04:28
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