<!-- SOLID CITY · part 15 -->
ext) => (app.locals.soluvSystemPost ? app.locals.soluvSystemPost(name, text) : null) });

  require('./city-builds')(app, { requireLogin, rateLimit });
  require('./between')(app, { requireLogin, rateLimit }); // THE BETWEEN STONES (2026-10-12)
  require('./solid-orders')(app); // THE ORDERS CHANNEL + HER EYES (2026-10-13)
  require('./city-hyper-auto')(app, { requireLogin, rateLimit, brain: deps.brain });   // 🤖 auto-drive for allow-listed bot accounts

  app.post('/api/city/sable', requireLogin, rateLimit(60 * 60 * 1000, 40), (req, res, next) => {
    const msg = String((req.body && req.body.message) || '').trim().slice(0, 400);
    if (!msg) return res.status(400).json({ error: 'empty message' });
    const layer = findSableRoute();
    if (!layer) return res.status(503).json({ error: 'SABLE route unavailable' });
    const hist = Array.isArray(req.body && req.body.history) ? req.body.history.slice(-10) : [];
    req.body = { message: msg, history: hist };
    req.sableSurface = 'city'; // persona city add-on (lib/sable-persona.js); set server-side, not spoofable from the body
    req.url = '/api/sable/chat'; // share SABLE's own rate-limit bucket
    layer.handle(req, res, next);
  });
};

/* THE SEAL — SOLID CITY LOCKED DOWN (the King's word, 2026-10-14
 * ~17:49 HST: "we need a new map and lock this one down — this was
 * learning, this has to happen"). The world rests, preserved exactly
 * as it stands: no rebuilds, no more fixes. The door answers to the
 * King's account alone (session user id 6 — the immutable row, the
 * Royal Rights standard of lib/royal.js); every other visitor is met
 * by the sealed notice. Reversible by his word alone: set
 * CITY_SEALED to false here and restart the server. */
var CITY_SEALED = true;
var KING_UID = 6;
var SEALED_PAGE = '<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">'
  + '<title>Solid City — Sealed</title>'
  + '<body style="margin:0;background:#070405;color:#f1e4c3;font:17px Georgia,serif;display:flex;min-height:100vh;align-items:center;justify-content:center;padding:24px;box-sizing:border-box">'
  + '<main style="max-width:520px;text-align:center;border:1px solid #8a6d2f;border-radius:16px;padding:36px 28px;background:#0d080a">'
  + '<div style="font-size:15px;letter-spacing:4px;color:#d8a833">SOLID CITY</div>'
  + '<h1 style="margin:14px 0 10px;font-size:30px;font-weight:normal;letter-spacing:2px">Sealed by the King\u2019s word</h1>'
  + '<p style="line-height:1.65;color:#d9c9a8">This world was learning. It rests now — locked, and preserved exactly as it stands.</p>'
  + '<p style="line-height:1.65;color:#9d8d6d;font-size:15px">King: this door knows your account. If you are signed out, <a href="/login" style="color:#ffd98a">sign in</a> and return.</p>'
  + '</main></body>';

// Registered in server.js BEFORE express.static: send/serve-static keep a
// Cache-Control header that is already set, so this only changes caching.
module.exports.mediaCache = function cityMediaCache(req, res, next) {
  if (CITY_SEALED && (req.method === 'GET' || req.method === 'HEAD') && (req.path === '/city' || req.path.indexOf('/city/') === 0)) {
    var sealUid = req.session && req.session.userId;
    if (Number(sealUid) !== KING_UID) {
      res.set('Cache-Control', 'no-store');
      if (req.path === '/city' || req.path === '/city/' || req.path === '/city/index.html') {
        return res.status(403).type('html').send(SEALED_PAGE);
      }
      return res.status(403).type('text').send('Solid City is sealed by the King\u2019s word.\n');
    }
  }
  // TWO-TIER CACHE FOR THE CITY (2026-10-12, the King's ruling): what is
  // PUBLISHED may be kept by browsers (fast); what is UNDER CONSTRUCTION
  // is never stored (always fresh) until the King publishes it. The entry
  // page is always fresh — it is the table of contents. New builds join
  // the under-construction list at birth and leave it when published.
  var UNDER_CONSTRUCTION = [
    '/city', '/city/', '/city/index.html',
    '/city/city.js', '/city/hyper.js', '/city/city.css',
    '/city/octa-pool.js', '/city/octa-pool-place.js',
    '/city/between-stones.js', '/city/between-stones-place.js',
    '/city/hyper-city.js', '/city/hyper-city-place.js',
    '/city/hyper-city-annex.js', '/city/hyper-city-annex-place.js',
    '/city/hyper-city-first.js', '/city/hyper-city-first-place.js',
    '/city/first-city-parking.js', '/city/first-city-parking-place.js',
    '/city/first-ward-sign.js', '/city/first-ward-sign-place.js',
    '/city/wards.js', '/city/wards-place.js',
    '/city/skyward-branch.js', '/city/skyward-branch-place.js',
    '/city/jubilee-passage.js', '/city/jubilee-passage-place.js',
    '/city/ward-houses.js', '/city/ward-joins.js', '/city/ward-houses-place.js',
    '/city/quadrant-crown.js', '/city/quadrant-crown-place.js', '/city/quadrant-crown-shops.json',
    '/city/mountain-homes.js', '/city/mountain-homes-place.js',
 