Chaos Builder: Optimizer

Authenticated asset build pipeline shared by web, embedded and CLI tools. Auto-discovers sources, uses a strict Node parser locally or a pinned PHP minifier on constrained hosts, and publishes assets atomically with SHA-256 provenance.

PHP asset pipeline with session and CSRF authorization, strict local parser validation, genuine bundled PHP minification for web hosts without Node, atomic publication and offline cache updates.

Audience: Developers and DevOps engineers

Key Features

  • Auto-discovery of source assets
  • Strict Node validation or bundled PHP minification
  • Atomic publication and SHA-256 provenance

Use Cases

  • Custom frontend build optimization
  • Constrained shared-host asset deployment
OVERVIEW
ARCHITECTURE
PIPELINE
SECURITY
FAQ

Chaos Builder

A shared PHP asset pipeline for the standalone web builder, embedded project view and CLI. It discovers readable sources, assembles CSS, publishes assets and updates the offline cache.

Source integrity first
  • Local validation: Acorn and Terser parse JavaScript; CSS Tree parses stylesheets.
  • Conservative formatting: JavaScript compression and variable mangling are disabled.
  • PHP minification: A pinned bundled library minifies JS/CSS when Node cannot run.
  • Atomic publication: A failed parser leaves the previous generated asset intact.
  • Provenance: Build records include the method, sizes and SHA-256 hashes.
3Shared entrypoints
SHA-256Build provenance
LocalParser toolchain
PHPWeb-host minifier

Hosting compatibility

Serving and building need no Node runtime. On restricted webspace the bundled PHP library performs real minification; CI parses its output against the current asset set.

Shared architecture

build.php, the embedded builder and cli-build.php call chaosconfig/build-runtime.php. They use the same source discovery and publication logic.

Discover and assembleRoot -org sources, existing JavaScript asset pairs and project stylesheets are discovered once per target. Global CSS uses its ordered source manifest.
Validate and formatA bounded local Node subprocess parses source and output. No third-party minifier response is accepted as executable code.
Publish and recordTemporary files are renamed in the target directory. Source and output hashes are persisted with the reported build method.

Sequential web requests

The web interface authenticates once, obtains a build lease, then processes one indexed asset per POST. Requests carry the session, CSRF token and lease token, not the password each time. Local validation has a 20-second execution budget per asset.

Scope of atomicity: Publication is per asset, not one transaction across the entire website. Do not upload sources while a build is running; inspect every result before release.

Build pipeline

AssetLocal methodToolchain unavailable
JavaScript and UMDAcorn + format-only Terser + AcornBundled PHP minifier
StylesheetsCSS Tree parse + generate + parseBundled PHP minifier
Global CSSManifest assembly, then CSS pipelineAssembly + PHP minifier
Service workerOffline dependencies, version update, JavaScript pipelineUpdate + PHP minifier

Offline dependency preservation

The service worker is built last. Its cache list retains the offline document, stylesheet, JavaScript, font and icon in addition to generated assets. Source preparation does not publish an unvalidated worker when the local parser reports an error.

Persistence

build-stats.json stores results by source filename. A timestamp alone cannot prove that a generated file matches its source; compare the recorded hashes. Display aliases are labels, not access controls.

Security controls

Administrative operation
Builds write server files. Keep the build password in ignored runtime configuration and use HTTPS.
  • Authentication: A short-lived server session is created after a rate-limited password check.
  • Request integrity: Mutations require same-origin POST, a session CSRF token and a live build lease.
  • Path restriction: Requests select a numeric index from the discovered mapping, never arbitrary paths.
  • Failure handling: Invalid syntax and malformed validator responses fail without publishing that output.
  • Isolation: Runtime configuration, development dependencies, internal tools and logs are denied over HTTP.

These controls reduce specific risks. They are not a guarantee of bug-free output, a full-site transaction, a browser test or a substitute for backups and hosting verification.

Frequently asked questions

Why does a result say PHP minifier?The host cannot run the optional Node parser, so it used the bundled, version-pinned PHP implementation.
Why is the file larger than a previous build?Format-only minification avoids aggressive optimization. Fallback does not minify at all. Compression savings depend on the source.
How do I enable local validation?Install Node and run npm ci --ignore-scripts in the project. An optional BUILD_NODE_BINARY configuration value selects the executable. Node is optional because vendor/ supplies the PHP path.
The page still looks old after a build.Confirm all assets succeeded, the final service worker was built, and the requested files match the new hashes. Then check CDN invalidation and service-worker activation.

© 2026 Dr. Felix Sébastien Bourier • Senior Data Scientist & AI Engineer • Computational Physics • Hamburg • All rights reserved

Chaos Builder: Optimizer

Active / Live
PHP OrchestrationAcorn and TerserCSS TreePinned PHP MinifierAuto-Discovery EngineAlias MappingDevOps

PHP asset pipeline with session and CSRF authorization, strict local parser validation, genuine bundled PHP minification for web hosts without Node, atomic publication and offline cache updates.

Audience
  • Developers and DevOps engineers
Key Features
  • Auto-discovery of source assets
  • Strict Node validation or bundled PHP minification
  • Atomic publication and SHA-256 provenance
Use Cases
  • Custom frontend build optimization
  • Constrained shared-host asset deployment

Extreme mode Auto-discovery 25 assets No remote API

Minification Orchestrator

Standby Mode: Last optimization log ready.
  • Chemistry Simulation Logic JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 25.0 KB → 11.5 KB −53.9%
  • Chaos Database JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 42.3 KB → 24.8 KB −41.3%
  • Physics Engine Core JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 334.2 KB → 170.5 KB −49.0%
  • GPU Acceleration Layer JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 15.8 KB → 8.5 KB −45.9%
  • Chaos Engine Loader JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 10.8 KB → 7.5 KB −30.1%
  • Simulation UI Layer JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 67.9 KB → 50.7 KB −25.3%
  • Mathematical Utilities JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 7.0 KB → 3.4 KB −51.1%
  • Orbital Visualizer JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 20.8 KB → 12.9 KB −38.2%
  • Organic Reaction Model JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 196.5 KB → 89.0 KB −54.7%
  • Molecule Spawner JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 16.4 KB → 9.8 KB −40.2%
  • Shared Loading Skeletons JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 4.6 KB → 4.2 KB −8.2%
  • Interface Controller JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 85.9 KB → 54.4 KB −36.7%
  • Lightbox Styles JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 137.0 KB → 137.0 KB −0.0%
  • Critical Path Styles Stylesheet source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 26.2 KB → 18.1 KB −30.9%
  • Lightbox Styles Stylesheet source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 24.7 KB → 24.4 KB −1.3%
  • Global Design System Stylesheet source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 114.0 KB → 73.2 KB −35.7%
  • Chaos Events Complete JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 120.9 KB → 72.0 KB −40.4%
  • Chaos Molecules JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 129.5 KB → 91.6 KB −29.3%
  • Chem Showcase Logic JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 74.3 KB → 41.6 KB −44.1%
  • Navigation JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 3.8 KB → 1.9 KB −49.7%
  • Project Ajax Loader JavaScript source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 57.5 KB → 33.3 KB −42.1%
  • Universal Documentation Styles Stylesheet source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 37.3 KB → 28.8 KB −22.6%
  • Project Page Layout Styles Stylesheet source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 12.3 KB → 8.4 KB −31.8%
  • SEO Audit Administration Styles Stylesheet source · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 8.9 KB → 7.4 KB −17.1%
  • Service Worker Cache Service worker · Bundled PHP minifier (release-pinned) · persisted
    ✓ Optimized 8.0 KB → 4.4 KB −44.6%

Last Optimization Run

Total Source: 1,581.5 KB → Minified Payload: 989.6 KB (-37.4%)