feat(tools,www): typed Content Graph with deterministic generate + fail-closed CI gate (#1157, B2.4) - #1303
Merged
Merged
Conversation
…il-closed CI gate (#1157, B2.4) Define the normalized entry/source-location/locale/reference/fingerprint schemas (tools/lib/content-graph.ts) and the five Beta.2 adapters (tools/lib/content-graph-adapters.ts): Markdown collections via the adapter-vite collection loader, public API data from the PACKAGE_SURFACE.md machine blocks, compiler metadata from the @openelement/ui generated manifest, the roadmap timeline via the repo's TypeScript AST tooling, and release truth from docs/release. The generator (tools/generate-content-graph.ts) writes www/app/data/_generated-content-graph.json deterministically (sorted entries/alternates/references/keys; sha256 fingerprints) and --check is the CI drift gate registered in the AutoFlow policy. Validation fails closed on duplicate ids, broken entry/route references and false locale alternates (orphan locales, asymmetric pairs, byte-identical 'translations'). Deterministic queries for doc routes, locale availability, search records and per-route SEO metadata are exposed for the #1159 consumers.
Deploying openelement with
|
| Latest commit: |
8e62d22
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7cc69ee6.lessjs.pages.dev |
| Branch Preview URL: | https://kimi-v044-b24-1157-content-g.lessjs.pages.dev |
Contributor
|
APIError: Insufficient Balance |
This was referenced Sep 4, 2026
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1157 (B2.4, stage #1288). Website-side consumption of the graph's nav/SEO/locale queries lands with #1159; this PR delivers the graph itself, its adapters, validators, queries, determinism and CI drift gate.
Problem
Website/API documentation truth was hand-copied between owned repository sources (Markdown collections, PACKAGE_SURFACE.md machine blocks, the UI compiler manifest, the roadmap timeline, release truth) and public surfaces, with no typed intermediate representation and no mechanical drift gate.
Owner
B2.4 / #1157 — typed Content Graph (tools + generated www data artifact).
Before
No content graph. Adapters for the Beta.2 truth sources did not exist; duplicate ids, broken content references and false locale alternates had no fail-closed validation; there was no deterministic generate/check pipeline for cross-source content truth.
After
tools/lib/content-graph.ts: normalized entry / source-location / locale / reference / fingerprint schemas; fail-closed validators (duplicate ids, broken entry/route references, orphan locales, asymmetric alternate pairs, byte-identical "translations"); deterministic queries for doc routes, locale availability, search records and per-route SEO metadata; a canonical serializer with sorted entries/arrays/keys.tools/lib/content-graph-adapters.ts: exactly the five Beta.2 adapters — Markdown (via the adapter-vite collection loader, no new parser), public API data (PACKAGE_SURFACE.md machine blocks, reusingextractSurfaceMap/extractExportClassMapnow exported from check-package-surface.ts), compiler metadata (packages/ui/src/generated-manifest.json: tags/attributes/events/slots/CSS parts/layer/hydrate), roadmap timeline (viatools/lib/typescript-ast.ts— no hand-rolled TS parser), release truth (docs/release/release-state.json+ per-release notes).tools/generate-content-graph.ts+deno task generate:content-graph/deno task content-graph:check: generateswww/app/data/_generated-content-graph.json(276 entries) and check-mode requires byte-identical regeneration.content-graph:checkregistered intools/autoflow/policy.ts(ci + release tiers) with path triggers over every graph input.Why-not-second-owner
No public-surface change: packages are untouched; the new artifact under www/app/data is not imported by the app yet (consumption is #1159's wiring). The adapter-vite reuse is import-only, so no adapter owner change is needed.
Evidence
deno task generate:content-graph→ 276 entries; two consecutive runscmpbyte-identical;deno task content-graph:checkpasses.tools/lib/content-graph.test.ts+tools/lib/content-graph-adapters.test.ts— 12 passed (duplicate-id, broken-ref, false/asymmetric/orphan/untranslated-alternate cases; determinism; all four queries; real-repo graph contains all five adapter kinds).deno task test— 1830 passed (105 steps) | 0 failed | 1 ignored; supabase example suite 150 passed.deno fmt --check,deno lint,deno task lint:markdown,deno task typecheck— clean.deno task build— green (Pagefind 150 pages; www artifact truth passed).deno task test:e2e(chromium) — 167 passed, 4 failed: only the known local visual-baseline drift on architecture-islands-deep mobile screenshots (stage [B2] Element / Router core convergence, UI dogfood and continuous cleanup #1288 carried-risk build-ssgCLI crashes: Vite SSR throws "Invalid or unexpected token" when evaluating generated.less-ssg-entry.ts #2, CI green; this PR touches no rendering path).Scope
New: 2 tools/lib modules + 2 test files + 1 generator CLI + 1 generated artifact. Modified: deno.json tasks, tools/autoflow/policy.ts (gate registration), tools/check-package-surface.ts (export two existing functions — no behavior change). No frozen-semantics paths touched.
Risk
Low. All new machinery is additive; the only edit to existing logic is exporting two previously private functions. The roadmap AST extraction assumes static string fields in the route's
entriesrecord; non-static values are skipped rather than misread, and the validator fails closed if the timeline disappears.