Context
PR #18851 (#18849) fixes three portal views whose marked import resolved only at the repository root. In a consumer, build-all failed on them with three Module not found. No check in this repository could have failed on it. The same class — a specifier that resolves at the repository root but not in an installed copy — produced #17868, #17943 and #17997.
The Problem
The one check that builds this package from outside itself, check-consumer-runtime-build, never compiles the App worker:
buildWorker() in buildScripts/util/check-consumer-runtime-build.mjs compiles configFactory({worker: 'data', insideNeo: 'false'}), plus Main.
- Its
marked coverage is a list. createFixture() writes apps/probe/data/ConsumerOnly.mjs, which imports the two src/ importers by name (component/Markdown, app/content/Component). The three portal importers were not on the list.
.github/workflows/consumer-runtime-build.yml is path-filtered, and no path under apps/, examples/ or docs/app/ is in the filter. A PR that edits only portal files does not run it.
The engine's own build-all job (#18835) cannot see the class: at the repository root, the old specifier resolves.
The Architectural Reality
- The App worker's
importApp() (src/worker/App.mjs) is one lazy context over (apps|docs/app|examples|src)/**/app.mjs, and its webpackExclude keeps node_modules/neo.mjs. Corrected while implementing: in consumer mode the App config (webpack.config.appworker.mjs) moves that context to the workspace root. There, webpack's context walk rewrites every ./node_modules/… file to a bare request that the context's ^\.\/ regExp drops, so the context reaches no shipped app. The Institution compiled the portal views (#18849's ./node_modules/neo.mjs/apps/portal/...) because its build-all runs all.mjs -f -n, which is framework mode. create-app's template runs all.mjs -n. Compiling the App config as the framework from an installed copy reaches every shipped app, with no list to maintain.
- The workflow header records why the check packs, installs and compiles for real: a path-reasoning probe passed where a physical build failed. This ticket extends the physical build and keeps that decision.
- The check installs from
npm pack, so .npmignore applies. apps/**/*.mjs is excluded except for listed apps, and apps/portal is listed (!/apps/portal/**/*.mjs). A tarball's App-worker compile therefore reaches the same portal views the Institution's git install compiled.
- Current job: 72–81 s on GitHub runners (last 5 runs, 2026-09-16/17).
The Fix
check-consumer-runtime-build also compiles the App worker's own config (webpack.config.appworker.mjs) from the installed copy, as the framework standing in the consumer, in at least one mode, and fails on any compile error. consumer-runtime-build.yml runs on PRs that touch the App worker's context roots. Widen the path filter, or drop it if the job fits the budget.
Acceptance Criteria
Out of Scope
- Whether a consumer's App worker should reach the engine's own
apps/ at all (#18849's out-of-scope: whether apps/portal ships).
- A static lint for relative
node_modules/ specifiers.
Avoided Traps
- A specifier grep as the guard. It catches one spelling of the class. It cannot report a target the installed package does not contain (an npmignored path), which a build from the installed copy reports as
Module not found.
Related
#18849 · PR #18851 · #18835 · #17868 · #17943 · #17997 · PR #17882 (the guard's origin)
Decision Record impact: none.
Sweeps: live latest-open 20 at 2026-09-18T11:35Z, none equivalent. All-state search for check-consumer-runtime-build: #18849 and closed siblings, none covering the App worker. KB ticket search: none. A2A lane-claims: none on this scope. Memory Core: the guard was built Data-worker-scoped in PR #17882, with no decision against an App-worker arm. Own open assignments: no overlap.
Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59
Retrieval Hint: "consumer runtime build App worker installed copy root-only specifier portal marked"
Context
PR #18851 (#18849) fixes three portal views whose
markedimport resolved only at the repository root. In a consumer,build-allfailed on them with threeModule not found. No check in this repository could have failed on it. The same class — a specifier that resolves at the repository root but not in an installed copy — produced#17868,#17943and#17997.The Problem
The one check that builds this package from outside itself,
check-consumer-runtime-build, never compiles the App worker:buildWorker()inbuildScripts/util/check-consumer-runtime-build.mjscompilesconfigFactory({worker: 'data', insideNeo: 'false'}), plus Main.markedcoverage is a list.createFixture()writesapps/probe/data/ConsumerOnly.mjs, which imports the twosrc/importers by name (component/Markdown,app/content/Component). The three portal importers were not on the list..github/workflows/consumer-runtime-build.ymlis path-filtered, and no path underapps/,examples/ordocs/app/is in the filter. A PR that edits only portal files does not run it.The engine's own
build-alljob (#18835) cannot see the class: at the repository root, the old specifier resolves.The Architectural Reality
importApp()(src/worker/App.mjs) is one lazy context over(apps|docs/app|examples|src)/**/app.mjs, and itswebpackExcludekeepsnode_modules/neo.mjs. Corrected while implementing: in consumer mode the App config (webpack.config.appworker.mjs) moves that context to the workspace root. There, webpack's context walk rewrites every./node_modules/…file to a bare request that the context's^\.\/regExp drops, so the context reaches no shipped app. The Institution compiled the portal views (#18849's./node_modules/neo.mjs/apps/portal/...) because itsbuild-allrunsall.mjs -f -n, which is framework mode. create-app's template runsall.mjs -n. Compiling the App config as the framework from an installed copy reaches every shipped app, with no list to maintain.npm pack, so.npmignoreapplies.apps/**/*.mjsis excluded except for listed apps, andapps/portalis listed (!/apps/portal/**/*.mjs). A tarball's App-worker compile therefore reaches the same portal views the Institution's git install compiled.The Fix
check-consumer-runtime-buildalso compiles the App worker's own config (webpack.config.appworker.mjs) from the installed copy, as the framework standing in the consumer, in at least one mode, and fails on any compile error.consumer-runtime-build.ymlruns on PRs that touch the App worker's context roots. Widen the path filter, or drop it if the job fits the budget.Acceptance Criteria
apps/portal/**runs the job.markedimporters are deleted if the App-worker compile covers them, or the PR says why they stay.Out of Scope
apps/at all (#18849's out-of-scope: whetherapps/portalships).node_modules/specifiers.Avoided Traps
Module not found.Related
#18849 · PR #18851 · #18835 ·
#17868·#17943·#17997· PR#17882(the guard's origin)Decision Record impact: none.
Sweeps: live latest-open 20 at 2026-09-18T11:35Z, none equivalent. All-state search for
check-consumer-runtime-build: #18849 and closed siblings, none covering the App worker. KB ticket search: none. A2A lane-claims: none on this scope. Memory Core: the guard was built Data-worker-scoped in PR#17882, with no decision against an App-worker arm. Own open assignments: no overlap.Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59 Retrieval Hint: "consumer runtime build App worker installed copy root-only specifier portal marked"