The validator is
src/themes/validator/; the server,theme validateandtheme packall run it.
Every archive is validated at upload, again at activation and rollback (an installed theme that no longer validates is not activated), on demand with Validate in Site & Content › Themes, by theme validate and before theme pack writes an archive. One rule table (VALIDATION_RULES in src/themes/validator/rules.ts) drives all of them and the copy exported with the contract (validator.mjs), so a theme that passes locally passes on upload. A rejection names the rule and the file and line. Errors block; warnings are reported and do not.
The Theme Contract page describes the validator’s internals; this page lists what each rule means for an author.
Manifest
- The manifest matches the schema.
engines.contractis a range that includes the running contract version.extends, when set, names an installed theme (checked by the server at upload).- Every view id, part area id and section type either exists in the contract or is namespaced
theme.<slug>.*.
Package
- File extensions are from the allow-list:
js css json woff2 svg png webp jpg mp3 ogg md txt. - Size caps: package 30 MB; CSS 500 KB; JavaScript 300 KiB gzipped in total and 120 KiB gzipped per chunk.
- Every asset the manifest references exists.
- Every font family has a licence file.
- No reference to a remote font host.
CSS
- No
@import. - No non-relative
url(). - No
expression(). - No
!importanton contract nodes. - No
display: noneorvisibility: hiddenondata-pe-*nodes. - No
@layerother thanpe-theme. - Token values are colours, lengths, font stacks or same-origin paths.
JavaScript
The scanner parses every module into an abstract syntax tree and rejects the archive on any of these:
- A module that does not parse as an ES module.
- An import from anything but the externals list:
react,react/jsx-runtime,react-dom,@pe/sdk. - Any read of the host object other than the one generated prologue shape.
eval,new Function,with.WebSocket,EventSource,fetch,XMLHttpRequest,navigator.sendBeacon,Worker,ServiceWorker,importScripts,new Image.document.cookie,localStorage,sessionStorage,indexedDB.createElement('script'),createElement('style'),setAttribute('style', …), assignment toinnerHTMLorouterHTML,insertAdjacentHTML,document.write.- A dynamic
import()outside the package’s own chunks. globalThis,self,top,parent.- Any reference to the socket library, the shared game package, the game store, the game socket hook, gameplay event names or gameplay routes.
- Obfuscation markers.
Bundling minified third-party libraries is not allowed, because the scanner would flag them. Themes use the SDK and plain source.
SEO markup, public templates only
One check exists today: seo.section-text warns when a hero or call-to-action section’s default has no text. The other markup rules for public templates (exactly one <h1>, landmarks, alt text from section settings, links through the SDK Link) are guidance, not validated (not yet supported); see Templates and View Ids.
Every rule
| Rule | Severity | Fails when |
|---|---|---|
manifest.missing | error | theme.json is missing |
manifest.invalid | error | theme.json fails the schema (unknown fields included) |
manifest.contract-range | error | engines.contract does not include the running contract version |
manifest.unknown-view | error | A view id is neither host-owned nor theme.<slug>.* |
manifest.unknown-part | error | A part id is neither a host part area nor theme.<slug>.* |
manifest.unknown-section | error | A section type is neither host-owned nor theme.<slug>.* |
manifest.section-schema | error | A theme section type has no schema, or a host type carries one |
manifest.foreign-namespace | error | An id uses another theme’s theme.<other>.* namespace |
manifest.layout-id | error | A layout reuses the built-in id standard |
manifest.file-missing | error | A file the manifest names is not in the package |
manifest.strings-missing | error | A declared language has no strings/<lang>.json |
manifest.surface-table | warning | Layouts are declared without the table surface |
package.path | error | A path is absolute, escapes the package, or is deeper than 20 levels |
package.extension | error | A file extension is outside the allow-list |
package.size | error | The package exceeds 30 MB |
package.file-count | error | The package has more than 5,000 files |
package.css-size | error | CSS exceeds 500 KB |
package.js-size | error | JavaScript exceeds 300 KiB gzipped in total |
package.chunk-size | error | A chunk exceeds 120 KiB gzipped |
package.font-license | error | A font family ships without a licence file |
package.google-fonts | error | fonts.googleapis.com is referenced |
package.entry | error | The entry is not under dist/, or a chunk is outside dist/chunks/ |
package.stray-js | error | A JavaScript file is neither the entry nor a chunk |
package.json-invalid | error | A JSON file does not parse |
css.import | error | @import in a packaged stylesheet |
css.url | error | A url() that is not relative to the package |
css.expression | error | expression(), behavior or -moz-binding |
css.important-contract | error | !important on a DOM-contract node |
css.hidden-contract | error | A rule that hides a DOM-contract node |
css.layer | error | An @layer other than pe-theme |
css.charset | warning | @charset, which is ignored |
js.parse | error | A file that does not parse as an ES module |
js.import | error | An import outside the four externals and the package’s own chunks |
js.import-name | error | A named import the external does not have |
js.dynamic-import | error | import() of anything but an own chunk |
js.host-object | error | window.__pokerEngine read outside the one prologue shape |
js.eval | error | eval, new Function, with, or code in a string |
js.forbidden-api | error | A transport, storage, worker, DOM-injection or navigation API |
js.forbidden-global | error | A free global outside the allow-list |
js.global-member | error | A window, document or navigator member outside the allow-list |
js.computed-access | error | Computed member access on a global root or the host object |
js.prototype-escape | error | .constructor, .__proto__ or Reflect |
js.dom-injection | error | innerHTML, outerHTML, insertAdjacentHTML, document.write, dangerouslySetInnerHTML, script or style elements |
js.gameplay-reference | error | A reference to the socket, the game store, gameplay events or gameplay routes |
js.obfuscation | error | Escape-heavy identifiers or strings, decoders, minified code (a line over 2,000 characters or a mean over 300) |
js.external-url | warning | An absolute http(s) URL, listed for review |
js.import-meta | error | import.meta |
tokens.invalid | error | tokens.json is not an object of token name to string |
tokens.unknown | warning | A token name is not in the contract |
tokens.value | error | A token value does not match its kind |
strings.invalid | error | A strings file is not a flat object of theme.<slug>.* keys to strings |
strings.merge-tag | warning | A merge tag is unknown or misformatted |
seo.section-text | warning | A hero or call-to-action default has no text |
What the scanner is and is not
The scanner stops accidents and crude attempts. The guarantees are architectural: the server has authority over every action, the SDK is the only data path, the socket is never exposed, installing a theme needs the appearance:install permission, and a table layout needs a certification record. Two channels the content security policy leaves open, images from any HTTPS host and WebSocket connections, are a recorded limit, not something the scanner can close.
Reading a validation report
Site & Content › Themes shows the report for every installed theme, and the CLI prints the same report:
npm run theme -- validate <theme-dir | archive.tgz> [--json] [--contract <version>]
A directory is read as an extracted package (theme.json at its root, so a theme after theme build); a .tgz is read the way an upload is, with the archive’s root folder stripped. Every finding is printed on one line, errors before warnings:
js.import error dist/theme.js:5:1 "socket.io-client" is not an allowed import; themes import only react, react/jsx-runtime, react-dom, @pe/sdk and their own dist/chunks/*.js
css.hidden-contract error dist/theme.css:5:1 [data-pe="seat"] is hidden by display: none
theme validate: sample-parts@0.1.0 failed against contract 0.1.0: 2 errors, 0 warnings; 10 files, 2.6 KiB package, 0.5 KiB css, 0.5 KiB js gzipped (largest chunk 0.2 KiB)
The columns are the rule id, the severity, file:line:column (a file alone for manifest and package rules, - when no file applies) and the message. The exit code is 0 when no error finding remains (warnings do not fail), 1 on errors and 2 for a usage error such as a path that does not exist. --json prints the full report (findings, statistics, contract version) for scripts; --contract validates against another contract version than the running one.