<!-- SOLIDABILITY-WORLD · part 35 -->
,
    showGlossary, hideGlossary,
  };
})();


===== FILE: public/solidability-world/js/sw-guide.js.bak2-20261008 =====
// Solidability World — Human Guide
// Layer 1: Help humans understand their website in plain language.
// No jargon. No complexity scores. No evidence states.
// Just: what is this, what does it do, why does it matter to you.

const SWGuide = (() => {
  let guiding = false;
  let tourStops = [];
  let currentStop = 0;

  // Shared language: human-meaningful names for key components
  // The world speaks in these terms, not filenames
  function humanName(filePath, label) {
    const f = (filePath || '').toLowerCase();

    if (f === 'server.js') return { icon: '❤️', name: 'The Heart' };
    if (/auth|login|session/.test(f)) return { icon: '🔑', name: 'The Gatekeeper' };
    if (/thread|forum/.test(f)) return { icon: '💬', name: 'The Forum' };
    if (/chat/.test(f) && !/chatlog/.test(f)) return { icon: '💭', name: 'Live Chat' };
    if (/sable|ai\.js/.test(f)) return { icon: '🧠', name: 'The Mind' };
    if (/views/.test(f)) return { icon: '🎨', name: 'What You See' };
    if (/(^|\/)db/.test(f)) return { icon: '💾', name: 'The Memory' };
    if (/upload|media|image/.test(f)) return { icon: '🖼️', name: 'The Gallery' };
    if (/revenue|econom/.test(f)) return { icon: '💰', name: 'The Treasury' };
    if (/admin/.test(f)) return { icon: '⚙️', name: 'The Controls' };
    if (/email|mail/.test(f)) return { icon: '📧', name: 'The Messenger' };

    return null;
  }

  // Plain-language descriptions of what components do FOR THE HUMAN
  // Not what the code does — what it means for the site owner
  function humanDescription(room) {
    const file = room.filePath || '';
    const label = room.label || '';

    // Server
    if (file === 'server.js' || label === 'server.js') {
      return {
        what: 'This is the heart of your website.',
        does: 'Every page, every login, every message — it all flows through here.',
        matters: 'If this stops, your entire site stops. It\'s the most important file you own.',
      };
    }

    // Auth/login
    if (/auth|login|session/i.test(file)) {
      return {
        what: 'This handles who gets in.',
        does: 'When someone types their password, this checks if they\'re allowed.',
        matters: 'This protects your members\' accounts. If it breaks, nobody can sign in.',
      };
    }

    // Forum/threads
    if (/thread|forum|post/i.test(file)) {
      return {
        what: 'This is where conversations happen.',
        does: 'Every forum post, every reply, every thread — this makes it work.',
        matters: 'This is your community. It\'s why people come to your site.',
      };
    }

    // Chat
    if (/chat/i.test(file)) {
      return {
        what: 'This is your live chat.',
        does: 'Messages appear instantly because of this code.',
        matters: 'This is where your members talk in real time — including PROVOLTA\'s chamber.',
      };
    }

    // AI
    if (/sable|ai\.js/i.test(file)) {
      return {
        what: 'This is your AI assistant.',
        does: 'When someone talks to SABLE, this figures out what to say back.',
        matters: 'This is the brain of your site\'s AI. It remembers conversations.',
      };
    }

    // Views/templates
    if (/views/i.test(file)) {
      return {
        what: 'This draws what people see.',
        does: 'Every page layout, every button, every color — this creates it.',
        matters: 'This is what your site looks like. It also holds a lesson: once an automated check ' +
          'flagged a line here as risky, but testing proved the original was correct. ' +
          'Sometimes the right fix is no fix.',
      };
    }

    // Database
    if (/db/i.test(file)) {
      return {
        what: 'This remembers everything.',
        does: 'User accounts, messages, settings — this stores it all safely.',
        matters: 'Without this, your site would forget everything when it restarts.',
      };
    }

    // Media/upload
    if (/upload|media|image/i.test(file)) {
      return {
        what: 'This handles pictures and files.',
        does: 'When someone uploads a photo, this saves it and makes it viewable.',
        matters: 'This is how your site handles images, videos, and attachments.',
      };
    }

    // Game/saga
    if (/saga|game|play/i.test(file)) {
      return {
        what: 'This is your game world.',
        does: 'The 3D environments, the characters, the gameplay — this powers it.',
        matters: 'This is what makes your site more than just a forum — it\'s a world.',
      };
    }

    // Default: describe by size and activity
    const routes = (room.routes || []).length;
    if (routes > 20) {
      return {
        what: `This handles ${routes} different web addresses on your site.`,
        does: 'When someone visits a page, this decides what to show them.',
        matters: 'It\'s a busy part of y