<!-- RUBY-BACKUP · part 561 -->
*/
  (function(){
    var __triessalvageHooked=0;
    function __hooksalvageHooked(){
      __triessalvageHooked++;
      try{
        if(typeof window.runLine === 'function' && !window.runLine.__salvageHooked){
      var prevRL = window.runLine;
      window.runLine = function(line){
        try{
          var raw = String(line == null ? '' : line).trim();
          var tl = raw.toLowerCase();
          if(tl === 'salvage'){ salvageArmed = true; collectArmed = null; status('salvage armed — tap a block. it becomes the salvage block.'); return; }
          if(tl === 'inventory'){
            status('inventory: ' + invSummary());
            return invSummary();
          }
          if(tl.indexOf('inventory place ') === 0){
            var kind = raw.slice(16).trim().toLowerCase();
            if(['pulley','gear','rope','web'].indexOf(kind) < 0){ status('inventory place pulley|gear|rope|web'); return; }
            if(!inventory[kind]){ status('no '+kind+' in inventory — salvage a machine first'); return; }
            placeArmed = {kind:kind};
            status('tap the ground — place the '+kind+'.');
            return;
          }
          if(tl === 'inventory clear'){
            inventory = {pulley:0, gear:0, rope:0, web:0};
            saveInv();
            status('inventory emptied — the parts dissolve.');
            return;
          }
        }catch(e){}
        return prevRL.apply(this, arguments);
      };
      window.runLine.__salvageHooked = true;
          return;
        }
      }catch(e){}
      if(__triessalvageHooked<60) setTimeout(__hooksalvageHooked,500);
    }
    __hooksalvageHooked();
  
    window.__hooksalvageHooked = __hooksalvageHooked;})();

  hookTaps();

  window.__salvageCount = function(){ return salvageBlocks.length; };
  window.__inventory = function(){ return {pulley:inventory.pulley, gear:inventory.gear, rope:inventory.rope, web:inventory.web}; };

  try{ console.log('[salvage] the seed\'s mirror — unbuild into inventory'); }catch(e){}

})();


===== FILE: public/ruby-backup/snapshots.js =====
/* ============================================================================
   SNAPSHOTS — the ultimate reverse.
   The King: "Go for launch"

   Two laws govern this memory:

   1. "Today is all the memory holds."
      Memory is born today. memoryBorn is stamped on first run. Anything
      predating today is foreign — not trusted, not loaded. The store
      wipes itself clean and begins again.

   2. "Everything built up to now can not be reimagined by memory."
      Snapshots capture and restore ONLY dynamic system state: node modes
      and their settings, ropes, spans, portal links, network, switch
      states, counters, charges, lifts, machines, pulleys.
      Snapshots NEVER touch the built world — stones, blocks, structures,
      terrain. Those are permanent. If a snapshot references a stone that
      no longer exists, it is skipped silently. Memory reimagines nothing
      that hands have made. The world is sacred. Memory serves it.

   Codes: snapshot <name> | rewind | rewind to <name> | snapshots
          forget snapshot <name>
   Key: ruby-snapshots-v1 — {memoryBorn, snaps:{name:{t,state}}, order:[]}
   Cap: 20 snapshots, oldest auto-deleted.

   3. "Even if you want to rewind to fix previous problems that can not be
      because memory doesn't work where memory is obsolete."
      Rewind CANNOT go before the memory's birth. The earliest snapshot is
      the earliest reachable moment. What the memory never witnessed, it
      cannot restore — and no backdoor exists, for anyone. The law binds all.
   ============================================================================ */
(function(){
  if(window.__snapshots) return;
  window.__snapshots = true;

  var SKEY = 'ruby-snapshots-v1';
  var MAX_SNAPS = 20;

  function status(m){ try{ if(typeof codeStatus==='function') codeStatus(m); }catch(e){} }

  /* ---------- today is all the memory holds ---------- */
  function startOfToday(){ var d = new Date(); d.setHours(0,0,0,0); return d.getTime(); }

  function saveStore(st){
    try{ localStorage.setItem(SKEY, JSON.stringify(st)); }catch(e){}
  }

  function loadStore(){
    var st = null;
    try{ var raw = localStorage.getItem(SKEY); if(raw) st = JSON.parse(raw); }catch(e){ st = null; }
    if(!st || typeof st !== 'object'){ st = {memoryBorn:0, snaps:{}, order:[]}; }
    if(!st.snaps || typeof st.snaps !== 'object') st.snaps = {};
    if(!Array.isArray(st.order)) st.order = [];
    var today0 = startOfToday();
    /* The anchor: memory born before today is foreign. Begin again. */
    if(!st.memoryBorn || st.memoryBorn < today0){
      st = {memoryBorn: Date.now(), snaps:{}, order:[]};
      saveStore(st);
      return st;
    }
    /* Drop any snapshot predating today — quietly. */
    var changed = false;
    for(var k in st.snaps){
      if(!st.snaps[k] || !st.snaps[k].t || st.snaps[k].t < today0){ delete st.snaps[k]; 