mm1 pattern (multi-tenant, multi-site, one controller)
Site pages drop a
<script src= ... > at the bottom; that script “takes control,” fetches content/config from the platform and SaaS providers, then mutates the page with
$('head').append() /
$('body').append().
1) What it is (in one line)
One remote script, owned by a central platform, is injected on every customer page and then performs client-side composition: it pulls add-ons/config/data from the platform and third parties and patches the current DOM.
2) ASCII sequence (happy path)
User → Origin (customer site): GET /page.html
Origin → User: HTML … <script src="https://platform/js/loader.js"></script>
Browser: Parses HTML; reaches loader.js at end of <body>
User’s Browser → Platform: GET https://platform/js/loader.js (cacheable)
Platform → Browser: loader.js
loader.js:
1) Fingerprints page (URL, lang, data- attributes)
2) Fetches config & payload plan
3) Optionally preconnect to SaaS
Browser → Platform: GET https://platform/config?site=...&page=...
Platform → Browser: JSON plan (what to inject, from where)
loader.js executes plan:
- fetch() addon bundles, JSON blocks, templates
- $('head').append(…); $('body').append(…)
- init widgets, hydrate Q→A, attach events
Browser → SaaS endpoints: GET scripts/styles/data as directed by plan
SaaS → Browser: responses (JS/CSS/JSON)
loader.js finalizes:
- mark "ready", log metrics, heartbeat
- optional A/B flags, feature gates
3) What could be injected
Not just widgets, but small, verifiable micro-apps with sources, anchors, and clear licenses.
- Content & micro-apps: short-video rail (“TikTok-in-a-box”), canvas annotator (“paint-in-a-box”), spreadsheet calc block, notebook/chart viewer, query composer.
- Proofs & navigation: exact-line citation chips (#p;s;h), proof ribbon (coverage %, verified-link rate, time-to-answer), drift badge, changefeed tile.
- Personalization & locality: local weather/conditions, inventory/ETA, currency/tax mirror, locale-true deep links.
- Commerce & conversion: one-click quote wizard, comparison composer (exports CSV/link), financing/eligibility checker with audit trail.
- Community & comms: inline Q&A (also publishes qna.json), voice-note capture → transcript + summary, live session/webinar banner with ICS.
- Governance & safety: consent/license bar (agent.json/charter.json), policy badges resolving to exact lines, agent rate-limit meter.
- UX & performance: instant-answers band (pure HTML mirror), smart summary carousel, keyboard palette with ARIA-true anchors.
- Internationalization: locale guard + self-canonical with hreflang, altref citations per language, glossary chips.
- Data & experiments: friction logger (anon aggregate), A/B flags controlled from the platform.
- Integrations: map/routing micro-app, calendar hooks (deterministic ICS), lightweight doc-sign/ack.
4) Why people would want it
- Zero-touch rollout: one tag enables many features across all customers.
- Centralized control: flip flags/platform config once; all sites update.
- Fast iteration: ship experiments without asking each origin to redeploy.
Why the web wants this
The web is moving from pages to precise, reusable units. Let specialists ship small, verifiable capabilities that any site can adopt.
Segment the work now so it can be AItomated (AI-automated) later.: once a task has a clean interface, provenance, and exact-line references,
agents and search can operate on it safely and at scale.
- Specialists, not silos — small teams build narrow, excellent add-ons (pricing calc, exact-line citations, locale guard) that any site can plug in, instead of every site rebuilding the same thing.
- Segment, then AItomate — define each task as a clear input/output unit with sources and limits; once segmented, it can be run by people today and AItomated tomorrow without changing the page.
- Deterministic interfaces — exact-line deep links and stable anchors form a contract: “open here, highlight this, verify this hash.” That makes integrations reliable for users and agents.
- Provenance and trust — every answer carries source, license, and time. Verifiable claims beat opaque widgets, and satisfy legal/compliance reviews.
- HTML-first for crawl fidelity — answers exist in server-rendered HTML (mm1 style), so search and AI index the same thing visitors read. JS enhances, not replaces, the truth.
- Global by construction — locale-true links, self-canonical pages, and hreflang parity ensure the same deep link works across languages and regions.
- Governed capability — consent and rate limits are declared up front (what agents may do, how fast, under which license). Enterprises need guardrails, not guesswork.
- Economics that compound — maintain once, serve many. Platforms get predictable costs; sites get better features at lower prices.
- Operational resilience — decouple feature rollout from the site’s release cycle. Patch once, fix everywhere. Roll back cleanly if needed.
- Agent-ready content — small, machine-readable units (Q&A, proofs, metrics) are easier for assistants to discover, verify, and act on than whole pages.
Bottom line: a modular, verifiable layer on top of existing sites lets the web evolve without rewrites.
People get faster, truer answers; search and AI get stable targets; operators get control and speed.