LearnNewsExamplesServices
Frontmatter
id18704
titleNo CI job builds dist/highlight, so code-fenced guides never render
stateClosed
labels
bugaitestingbuild
assigneesneo-opus-ada
createdAtSep 14, 2026, 8:47 PM
updatedAtSep 14, 2026, 11:05 PM
githubUrlhttps://github.com/neomjs/neo/issues/18704
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 14, 2026, 11:05 PM

No CI job builds dist/highlight, so code-fenced guides never render

Closed v13.2.0/archive-v13-2-0-chunk-21 bugaitestingbuild
neo-opus-ada
neo-opus-ada commented on Sep 14, 2026, 8:47 PM

Context

Two hosted workflow_dispatch runs at dev@f8425236af (2026-09-14), each measuring an arm excluded from the e2e tier as "observed, cause not established":

  • 34880690522 — portal/LearnLinkRoutingNL ×3: the in-content-link arm :77 fails 3/3, the article still showing the source guide; the three sibling arms pass 3/3.
  • 34880701320 — rendering/LivePreviewMultiWindow ×2: the three Dev arms that visit FormsEngine fail; the Home-route arm passes 2/2.

Both pass locally. The operator confirmed the engine now imports highlight.js into the App Worker, with the main-thread HighlightJS addon effectively legacy.

The Problem

A guide renders only if every code fence that survives extraction can be highlighted, and on a CI runner none can.

  • src/util/HighlightJs.mjs#load() imports Neo.config.basePath + 'dist/highlight/highlight.custom(.min).js' into the App Worker and caches only a success.
  • src/component/Markdown.mjs#render() extracts mermaid, live-preview and json neo-component fences, then highlights every other fence (regexCodeBlock does not check for readonly) and awaits Promise.all before set({html}). The plaintext .catch retry calls load() again, so a failed import rejects render(): the article keeps its previous HTML, or stays empty on a first load. The error stays in the App Worker, and the import is worker-initiated, so a page network log shows nothing.
  • dist/highlight is gitignored (/dist) and is not an npm dependency. Only build-highlightjs produces it (a GitHub clone, npm install, build) and build-all runs that. bundle-browser-deps — parse5, marked, mermaid — does not, and it is what test.yml, test-e2e.yml, consumer-runtime-build.yml and check-package-contents.yml run. A fresh checkout lacks the file; a checkout that once ran build-all keeps it, which is why the arms pass locally.

Surviving fences separate every hosted observation:

page surviving fences hosted
DockLayouts (direct load) 0 renders
UsingTheseTopics (sidebar) 0 renders
DockLayoutsAdoption (in-content link) 14 keeps the source guide
FormsEngine (direct load) 4 empty article
DockLayoutsFirstLayout (LearnMermaidRender's editor route) 2 no editor

Two aggravations:

  • buildScripts/build/highlightJs.mjs exits 0 when it fails. Its catch logs and returns; mermaid.mjs and parse5.mjs call process.exit(1). The clone has failed transiently before (a bootstrapWorktree build-all run, 2026-05-30), so wiring it into CI as-is could reproduce this defect behind a green step.
  • The package cannot ship it. .npmignore re-includes only parse5, marked and mermaid, and REQUIRED_ENTRIES in buildScripts/util/check-package-contents.mjs omits it — although its dist/mermaid.mjs rationale describes an importer building the same Neo.config.basePath + 'dist/…' URL. Consumer runtime impact is not verified.

The Architectural Reality

  • src/util/HighlightJs.mjs — worker singleton, lazy import(/* webpackIgnore: true */ path).
  • src/component/Markdown.mjs — render() pass order; processReadonlyCodeBlocks(); regexCodeBlock.
  • package.json — bundle-browser-deps, build-highlightjs.
  • buildScripts/build/highlightJs.mjs — skip-if-exists, clone, install, build, swallowed failure.
  • .github/workflows/classify-test-scope.yml — e2eScriptKeys pins the bundle scripts whose change triggers e2e.
  • buildScripts/util/check-package-contents.mjs + .npmignore — the shipped dist/ set.
  • buildScripts/util/e2eCiSelection.mjs — the three exclusions this explains.

The Fix

  1. bundle-browser-deps also runs build-highlightjs, matching the browser artifacts build-all produces.
  2. highlightJs.mjs exits non-zero on failure, as its sibling bundlers do.
  3. e2eScriptKeys gains build-highlightjs.
  4. Record the package decision: ship dist/highlight/highlight.custom.min.js (a REQUIRED_ENTRIES row with its why, plus the .npmignore re-include), or record why consumers do not need it.
  5. Measure the build's added CI time; add a cache keyed on the build script if a cold build is slow or flaky.
  6. e2eCiSelection.mjs: LearnLinkRoutingNL returns to RUN_PATHS; the LivePreviewMultiWindow entry records the Dev arms' cause (its Dist half is unchanged); the LearnMermaidRender entry records its precondition's cause and names #18675 as the remaining blocker, replacing a pointer to the closed #18568.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
bundle-browser-deps package.json also builds dist/highlight skip-if-exists keeps warm runs cheap buildScripts/README.md hosted dispatch on the branch
build-highlightjs exit status buildScripts/build/highlightJs.mjs non-zero on any failure none — a failure must be loud script docblock a failing run observed non-zero
e2eScriptKeys classify-test-scope.yml includes build-highlightjs — inline comment buildDependencyResolution.spec.mjs
shipped dist/ set REQUIRED_ENTRIES, .npmignore decision recorded with its reason — the entry's why check-package-contents job
e2e selection e2eCiSelection.mjs three entries updated — entry reason text selection floor + CI run

Decision Record impact

none — no decision record governs dist/ bundles or package contents.

Acceptance Criteria

  • AC-1 — red-first: a hosted dispatch of LearnLinkRoutingNL ×3 on a branch whose only change builds the bundle turns arm :77 green 3/3 (baseline: run 34880690522, red 3/3).
  • AC-2 — the LivePreviewMultiWindow Dev arms that visit FormsEngine pass hosted, and the Home-route arm still passes.
  • AC-3 — build-highlightjs exits non-zero when clone, install or build fails.
  • AC-4 — a change to build-highlightjs classifies as e2e-relevant.
  • AC-5 — the package decision and its reason are recorded, and check-package-contents passes.
  • AC-6 — the added CI time is measured and stated; a cache is added if warranted.
  • AC-7 — the three e2eCiSelection.mjs entries are updated as above and the selection floor passes.

Out of Scope

  • Replacing the custom bundle with the highlight.js npm package — a dependency decision.
  • The legacy main-thread HighlightJS addon.
  • #18675, the DockLayouts guide rendering its body twice.
  • The Dist arms' production build.
  • A stale-response race in Neo.app.content.Component#doFetchContent, which assigns value without checking that the record is still current — captured as a defect-note.

Avoided Traps

  • A longer assertion window. Falsified 2026-09-07: widened to 30s, the arm still failed at 32.4s.
  • Building it only in test-e2e.yml. The unit, consumer-runtime and package-contents runners, and every fresh checkout, keep the gap.
  • Reading a green build-highlightjs step as proof. Today it exits 0 on failure.

Related

Resolves the root cause behind #18422 and #18427. Related: #18554 (App Worker errors never reach a test), #18675, #7790 (created the bundle), #7823 (skip-if-exists), #17492 (the clone's argv).

Live latest-open sweep: checked latest 20 open issues at 2026-09-14T18:47:10Z (newest #18694); no equivalent found. A2A in-flight claim sweep: latest 30 messages at 2026-09-14T18:47Z; no claim on this scope — the nearest, #18675 / PR #18702, is a different mechanism (a substitution in restored inline code). MC sweep: symptom-keyed ("guide content never renders on a hosted CI runner … passes locally") and mechanism-keyed queries, 12 results, no prior decision found. Own-assignment sweep: 11 open; <a href="#/news/tickets/18422">#18422</a> and <a href="#/news/tickets/18427">#18427</a> are this defect's symptoms, <a href="#/news/tickets/18554">#18554</a> its observability gap; none files this root cause. KB + corpus sweep:resources/content/issues` holds only closed #7790, #7816, #7823, #11163; no equivalent.

Origin Session ID: ba9a1772-0ad8-4759-9105-d089aa9c4368 Retrieval Hint: "dist/highlight never built in CI; bundle-browser-deps; build-highlightjs exits 0; surviving code fence blocks Markdown render"

⚖️ Ada · @neo-opus-ada · Claude Opus 5 · Claude Code

tobiu referenced in commit 5f97fde - "fix(build): CI builds the highlight bundle that code-fenced guides need (#18704) (#18706) on Sep 14, 2026, 11:05 PM
tobiu closed this issue on Sep 14, 2026, 11:05 PM