GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Kuiper, cosmos and drawing engines / kuiper-belt / learn-the-kuiper/astra-codex/202610042233

Logic and 4 more files

A JavaScript module in the astra codex folder of Kuiper Belt that works with angular spec and floor sum and calculates planar distances. Served with the page at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.

552 lines of JavaScript and HTML and CSS from kuiper-belt, in 5 files. Topic: Kuiper, cosmos and drawing engines. Section 1541 of 2044.

Cut 2026-12-06T03:07:51+00:00. A copy for reading; the repository at the stated commit is the source.

In the State lines below, domain stage, users and canonical status are rule-based first approximations from code and path evidence (rules explore-agent-rules-v1), not observed facts: the rules.

In this section

  1. Learn the Kuiper — Astra Codex Page render · kuiper-belt / learn-the-kuiper/astra-codex/202610042233/index.html lines 1–49
  2. Logic transform · kuiper-belt / learn-the-kuiper/astra-codex/202610042233/logic.js lines 1–308
  3. Learn the Kuiper — Astra Codex Style Sheet render · kuiper-belt / learn-the-kuiper/astra-codex/202610042233/style.css lines 1–61
  4. UI interaction · kuiper-belt / learn-the-kuiper/astra-codex/202610042233/ui.js lines 1–120
  5. Kuiper Belt — Learn the Kuiper Page render · kuiper-belt / learn-the-kuiper/index.html lines 1–14

Learn the Kuiper — Astra Codex Page

A web page in Kuiper Belt that reads inputs for angle, lever power and lever count. Published at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.

renderkuiper-belt / learn-the-kuiper/astra-codex/202610042233/index.html · lines 1–49 of 49 · version 2026-10-04 22:33 · Entry point

What it does
It draws its content. Uses libraries code-data.js, sound.js. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage agent_infra (path word 'codex'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
Inputs & outputs
In: form fields (user input). Out: web page.
Downstream impact
It is itself an entry point, published at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
kuiper-belt · learn-the-kuiper/astra-codex/202610042233 · page
Uses
Learn the Kuiper — Astra Codex Style Sheet (stylesheet), Kuiper Belt — Index Page (link), Kuiper Law (script src), Logic (script src), UI (script src), code-data.js, sound.js
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
kuiper-belt@26fba12ab1b5bab8e71934ab86c58273e5f32682 learn-the-kuiper/astra-codex/202610042233/index.html:1-49 · blob f813438c4f8e202f692f463e40ce495521ce04a0 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: agent_infra · users: ai_agent · canonical: unknown
<!doctype html>
<html lang="en-GB">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
  <meta name="theme-color" content="#000000">
  <title>Learn the Kuiper</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main id="sheet">
    <header class="heading">
      <div class="brand">LEARN THE <strong>KUIPER</strong><span id="header-layer">YOUR SPIRAL</span></div>
      <div class="counter"><span id="count-label">1 particle addressed</span><span>Coordinates stored: 0</span></div>
      <button id="reset" class="quiet" title="Reset to the real Kuiper">Real Kuiper</button>
    </header>
    <section id="drawing" aria-label="Interactive Kuiper engineering drawing">
      <canvas id="canvas" tabindex="0" aria-label="Drag the selected particle, or tap anywhere to explore a place. Arrow keys move the practice dot."></canvas>
      <div id="status" role="status">One number gives this particle its place.</div>
      <div id="wonder" hidden><span id="wonder-label"></span><button id="skip">Skip wonder</button></div>
      <div id="selection">
        <p id="layer-label">YOUR SPIRAL</p>
        <div class="selection-title"><button id="inspect">Key <span id="key-label">1</span> ↗</button><button id="magnify" aria-pressed="false">Magnify</button></div>
        <div id="lever-strip">
          <label class="lever" data-level="0">Turn per key · degrees<input id="angle" inputmode="decimal" type="text" aria-label="Degrees per key"></label>
          <label class="lever" data-level="1" hidden>Spread · power<input id="lever-power" inputmode="decimal" type="text" value="0.5"></label>
          <label class="lever" data-level="2" hidden>How many · try 1 to 20<input id="lever-count" inputmode="decimal" type="text" value="1"></label>
          <div class="lever" data-level="3" hidden><p>X is across. Y is up.</p><button id="shadows">Show X / Y shadows</button></div>
          <label class="lever" data-level="4" hidden>Quiet time · seconds<input id="lever-quiet" inputmode="decimal" type="text" value="0"></label>
          <div class="lever" data-level="5" hidden><p>Compare the two laws.</p><button id="switch-real">THE REAL KUIPER</button></div>
        </div>
        <p id="source-line"></p>
        <p id="source-caption"></p>
      </div>
      <div id="title-block"><p id="formula-radius">DISTANCE = √(KEY + 0.5)</p><p id="formula-turn">TURN = KEY × 222.49°, FULL LAPS REMOVED</p><p id="sample-label">One particle. Drag it and see.</p></div>
      <div id="hint" role="status" hidden></div>
    </section>
    <footer id="dock">
      <div id="command-log" aria-live="polite"><p>KUIPER: move the dot.</p><p id="proof-line">Live law loaded. Say “Measure this against the real Kuiper code”.</p></div>
      <form id="command-form"><label class="sr-only" for="command">Tell Kuiper what to do</label><input id="command" placeholder="Try turn 360" autocomplete="off" spellcheck="false"><button type="submit" aria-label="Run command">↵</button></form>
      <div class="actions"><button id="commands">Commands /</button><button id="next-lever">+ NEXT LEVER</button><button id="numbers" hidden>Numbers</button><button id="play" aria-label="Play code particles" hidden>Play</button></div>
    </footer>
  </main>
  <dialog id="commands-dialog" aria-labelledby="commands-title"><div class="dialog-heading"><h1 id="commands-title">Say what you want to see.</h1><button data-close="commands-dialog" aria-label="Close commands">×</button></div><div id="sentences"></div></dialog>
  <dialog id="numbers-dialog" aria-labelledby="numbers-title"><div class="dialog-heading"><h1 id="numbers-title">Every number is yours.</h1><button data-close="numbers-dialog" aria-label="Close number controls">×</button></div><p>Changes act on the same drawing. Real Kuiper restores the original rule.</p><div id="parameter-fields" class="field-grid"></div><div class="extra-controls"><label>Colour   … [line shortened here: 1,318 characters; full line on GitHub]
  <dialog id="particle-dialog" aria-labelledby="particle-title"><div class="dialog-heading"><h1 id="particle-title">This particle</h1><button data-close="particle-dialog" aria-label="Close particle details">×</button></div><p>Move the example. Its true place remains marked on the drawing.</p><div id="particle-fields" class="field-grid"></div><p id="nearest-label"></p><button id="restore-dot">Retur  … [line shortened here: 681 characters; full line on GitHub]
  <script src="kuiper-law.js"></script><script src="code-data.js"></script><script src="logic.js"></script><script src="sound.js"></script><script src="ui.js"></script>
</body>
</html>

Logic

A JavaScript module in the astra codex folder of Kuiper Belt that works with angular spec and floor sum and calculates planar distances. Served with the page at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.

transformkuiper-belt / learn-the-kuiper/astra-codex/202610042233/logic.js · lines 1–308 of 308 · version 2026-10-04 22:33 · Entry point · pattern defaults (shared by 2 files)

What it does
It calculates its inputs. Defines 33 functions or classes, including defaults, number, normalize, P, integer.
Why it exists in the grid workflow
Domain stage agent_infra (path word 'codex'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
Downstream impact
Used directly by 1 file: Learn the Kuiper — Astra Codex Page (kuiper-belt, https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/). It is itself an entry point, published at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.
What it achieves
It indexes address (`indexForAddress`) and is built from the defaults step (`defaults`) and the number step (`number`). Kuiper Codex: pure addressing, sampling and bounded inverse queries.
Why it matters
Loaded by the Astra Codex page at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.
Application
kuiper-belt · learn-the-kuiper/astra-codex/202610042233 · JavaScript module
VEDIC
EXPLAIN (GG2050-VEDIC-000040): Kuiper / Code navigation · Computer science / Interactive visualisation. resolved_address, repository_metadata → human_readable_address_description
Uses
Kuiper Law (require)
Used by
loaded by Learn the Kuiper — Astra Codex Page (script src)
Produces
defaults, number, normalize, P, integer, keyOK, mod, modB, isReal, bad, rational, fractionNumber
Defines here
defaults, number, normalize, P, integer, keyOK, mod, modB, isReal, bad, rational, fractionNumber, angularSpec, place, pattern, addressForIndex, indexForAddress, bounds, budgetOf, sample, add, floorSum, lessCount, rangeCount, angularIntervals, bound, push, radialRange, emptyNeighbours, neighbours
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
kuiper-belt@26fba12ab1b5bab8e71934ab86c58273e5f32682 learn-the-kuiper/astra-codex/202610042233/logic.js:1-308 · blob 20b958e196d591988bb139437a560471cd900246 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: transform · effects: none found · domain stage: agent_infra · users: ai_agent · canonical: unknown
/* Kuiper Codex: pure addressing, sampling and bounded inverse queries.
 * Real placements ALWAYS call the unchanged KuiperLaw.place.
 * No coordinates are cached. A rendered sample is temporary, not an address table.
 * Neighbour certificates concern the computed Float64 positions, not exact reals.
 */
(function (root, factory) {
  'use strict';
  var law = root.KuiperLaw;
  if (typeof module === 'object' && module.exports) law = require('./kuiper-law.js');
  var api = factory(law);
  root.KuiperCodexLogic = api;
  if (typeof module === 'object' && module.exports) module.exports = api;
})(typeof globalThis !== 'undefined' ? globalThis : this, function (KuiperLaw) {
  'use strict';
  var MAX = 9007199254740992, MAXB = 9007199254740992n;
  var TAU = 2 * Math.PI, EPS = Number.EPSILON;
  var names = ['first','count','turnNumber','wrap','degreesPerKey','power','offset',
    'skipPerSecond','capSeconds','workLines','restSeconds','dotSize','scale'];
  function defaults() {
    return { first:0,count:1,turnNumber:2654435769,wrap:4294967296,degreesPerKey:null,
      power:0.5,offset:0.5,skipPerSecond:600,capSeconds:1209600,
      workLines:100,restSeconds:0,dotSize:3,scale:1 };
  }
  function number(v) { try { return Number(v); } catch (_) { return NaN; } }
  function normalize(raw) {
    var d=defaults(), p={}, r=raw && typeof raw==='object' ? raw : {};
    names.forEach(function(n) {
      var v = Object.prototype.hasOwnProperty.call(r,n) ? r[n] : d[n];
      p[n] = n==='degreesPerKey' && (v===null || v==='' || v===undefined) ? null : number(v);
    });
    p._raw = {};
    names.forEach(function(n){p._raw[n] = r._raw && Object.prototype.hasOwnProperty.call(r._raw,n) ? r._raw[n] : Object.prototype.hasOwnProperty.call(r,n) ? r[n] : d[n];});
    return p;
  }
  function P(p) { return p && p._raw ? p : normalize(p); }
  function integer(n) { return Number.isFinite(n) && Math.floor(n)===n; }
  function keyOK(k) { return integer(k) && k>=0 && k<=MAX; }
  function mod(a,m) { return ((a%m)+m)%m; }
  function modB(a,m) { var r=a%m; return r<0n?r+m:r; }
  function isReal(p) {
    p=P(p); return p.degreesPerKey===null && p.turnNumber===2654435769 && p.wrap===4294967296 && p.power===0.5 && p.offset===0.5;
  }
  function bad(key,reason,p) { return {key:key,x:NaN,y:NaN,r:NaN,deg:NaN,theta:NaN,valid:false,exactKey:keyOK(key),real:isReal(p),reason:reason}; }

  // Interpret a finite typed decimal as a rational. No huge floating product k*turn.
  function rational(v) {
    if (!Number.isFinite(v)) return null;
    var s=String(v), sign=1n;
    if(s[0]==='-'){sign=-1n;s=s.slice(1);}
    var ep=s.split(/e/i), exp=ep.length>1?Number(ep[1]):0, bits=ep[0].split('.');
    var ds=bits.join(''), places=(bits[1]||'').length-exp;
    var n=BigInt(ds)*sign,d=1n;
    if(places>0)d=10n**BigInt(places); else if(places<0)n*=10n**BigInt(-places);
    return {n:n,d:d};
  }
  function fractionNumber(n,d) {
    if(n===0n)return 0;
    var nn=Number(n),dd=Number(d);
    if(Number.isFinite(nn)&&Number.isFinite(dd))return nn/dd;
    // Preserve tiny, finite turns as well as ordinary fractions. Scale numerator
    // and denominator independently so enormous rationals never form Inf/Inf.
    var bn=n.toString(2).length,bd=d.toString(2).length;
    var sn=Math.max(0,bn-54),sd=Math.max(0,bd-54);
    var ratio=Number(n>>BigInt(sn))/Number(d>>BigInt(sd)),exp=sn-sd;
    if(exp < -1074)return ratio*Math.pow(2,exp+1074)*Number.MIN_VALUE;
    return ratio*Math.pow(2,exp);
  }
  function angularSpec(p) {
    if(p.degreesPerKey!==null){
      var q=rational(p.degreesPerKey); if(!q)return null;
      var mm=360n*q.d; return {a:modB(q.n,mm),m:mm};
    }
    if(!Number.isFinite(p.turnNumber)||!Number.isFinite(p.wrap)||p.wrap<=0)return null;
    var a=rational(p.turnNumber), w=rational(p.wrap), m=w.n*a.d;
    if(m<=0n)return null;
    return {a:modB(a.n*w.d,m),m:m};
  }
  function place(key,params) {
    var p=P(params), k=number(key);
    if(!keyOK(k))return bad(k, !Number.isFinite(k)?'The key is not a finite number.':k<0?'Keys start at zero.':k>MAX?'Above 2^53 the computer cannot count every key exactly.':'A key must be a whole number.',p);
    if(!Number.isFinite(p.power)||!Number.isFinite(p.offset))return bad(k,'Power and offset must be finite numbers.',p);
    if(isReal(p)) {
      if(!KuiperLaw || typeof KuiperLaw.place!=='function')return bad(k,'The shared Kuiper law has not loaded.',p);
      var out=KuiperLaw.place(k);
      return Object.assign({},out,{valid:true,exactKey:true,real:true,reason:'',precisionLimited:k>=4503599627370496});
    }
    var base=k+p.offset, r=Math.pow(base,p.power);
    if(!Number.isFinite(r)||r<0)return bad(k,base<0?'This power of a negative distance is not a drawable real radius.':'This radius is infinite or outside the drawing domain.',p);
    var spec=angularSpec(p);
    if(!spec)return bad(k,'The turn must be finite and the wrap size positive.',p);
    var m=modB(BigInt(k)*spec.a,spec.m), turns=fractionNumber(m,spec.m), theta=TAU*turns;
    var x=r*Math.cos(theta), y=r*Math.sin(theta);
    if(!Number.isFinite(x)||!Number.isFinite(y))return bad(k,'This position exceeds finite coordinate precision.',p);
    return {key:k,r:r,turns:turns,deg:turns*360,theta:theta,x:x,y:y,valid:true,exactKey:true,
      real:false,reason:'',precisionLimited:k>=4503599627370496};
  }
  function pattern(p) {
    if(!Number.isFinite(p.restSeconds)||!Number.isFinite(p.skipPerSecond)||!Number.isFinite(p.capSeconds) || p.restSeconds<0||p.skipPerSecond<0||p.capSeconds<0)
      return {valid:false,reason:'Quiet time, its cap and skipped keys per second must be finite and nonnegative.'};
    var v=p.skipPerSecond*Math.min(p.restSeconds,p.capSeconds);
    if(!Number.isFinite(v)||v>MAX)return {valid:false,reason:'This quiet interval skips more keys than can be counted exactly.'};
    var gap=Math.floor(v);
    if(gap===0)return {valid:true,gap:0,work:1,gapB:0n,workB:1n};
    if(!keyOK(p.workLines)||p.workLines<1)return {valid:false,reason:'Lines per work burst must be a positive whole number up to 2^53.'};
    return {valid:true,gap:gap,work:p.workLines,gapB:BigInt(gap),workB:BigInt(p.workLines)};
  }
  function addressForIndex(index,params) {
    var p=P(params), i=number(index), pat=pattern(p);
    if(!keyOK(i)||!keyOK(p.first)||!pat.valid)return NaN;
    return Number(BigInt(p.first)+BigInt(i)+(BigInt(i)/pat.workB)*pat.gapB);
  }
  function indexForAddress(key,p,pat) {
    if(!keyOK(key)||key<p.first)return -1;
    var d=BigInt(key)-BigInt(p.first), cycle=pat.workB+pat.gapB;
    var block=d/cycle, within=d%cycle;
    if(within>=pat.workB)return -1;
    var ix=block*pat.workB+within;
    return ix<BigInt(p.count)?Number(ix):-1;
  }
  function bounds(params) {
    var p=P(params), pat=pattern(p), b={first:p.first,last:NaN,count:p.count,radius:NaN,minRadius:NaN,valid:false,exactKeys:false,reason:''};
    if(!keyOK(p.first)){b.reason='First key must be a whole number from 0 through 2^53.';return b;}
    if(!keyOK(p.count)||p.count<1){b.reason=p.count>MAX?'Above 9 quadrillion the computer cannot count every key exactly.':'How many must be a positive whole number.';return b;}
    if(!pat.valid){b.reason=pat.reason;return b;}
    var end=BigInt(p.first)+BigInt(p.count-1)+(BigInt(p.count-1)/pat.workB)*pat.gapB;
    b.last=Number(end); b.exactKeys=end<=MAXB;
    if(!b.exactKeys){b.reason='The final address exceeds 2^53 after work and quiet time.';return b;}
    var a=place(p.first,p), z=place(b.last,p), rs=[];
    if(a.valid)rs.push(a.r); if(z.valid)rs.push(z.r);
    // Negative offsets can leave an invalid prefix, yet later addresses can draw.
    var crossing=Math.ceil(-p.offset);
    if(crossing>=p.first&&crossing<=b.last){var c=place(crossing,p);if(c.valid)rs.push(c.r);var d=place(crossing+1,p);if(d.valid&&crossing+1<=b.last)rs.push(d.r);}
    if(!rs.length){b.reason=a.reason||z.reason||'No finite radius at the address boundaries.';return b;}
    b.radius=Math.max.apply(null,rs);b.minRadius=Math.min.apply(null,rs);b.valid=true;
    if(!a.valid||!z.valid)b.reason='Some keys have no finite real position with these numbers.';
    return b;
  }
  function budgetOf(value,fallback,max) { var n=number(value); return Number.isFinite(n)&&n>0?Math.max(1,Math.min(max,Math.floor(n))):fallback; }
  function sample(params,budget) {
    var p=P(params), b=bounds(p), out=[]; out.valid=b.valid;out.reason=b.reason;out.total=p.count;
    if(!b.valid)return out;
    var n=Math.min(p.count,budgetOf(budget,1800,20000)), used=new Set();
    function add(i){ if(used.has(i))return;used.add(i);var k=addressForIndex(i,p),q=place(k,p);q.index=i;out.push(q); }
    if(p.count<=n){for(var j=0;j<p.count;j++)add(j);}
    else {
      // One address from each equal-population stratum. With the real square-root
      // law these are equal-area radial strata, without favouring the centre.
      var cnt=BigInt(p.count), nb=BigInt(n);
      for(var t=0;t<n;t++) {
        var lo=BigInt(t)*cnt/nb, hi=BigInt(t+1)*cnt/nb;
        var span=hi-lo, hash=BigInt((Math.imul(t+1,2654435761)>>>0));
        add(Number(lo+(span*hash)/4294967296n));
      }
    }
    out.sampled=p.count>out.length; out.stratification='equal address population; equal area under the real radius law';
    return out;
  }

  // Euclidean floor sum: sum floor((a*i+b)/m), i=0..n-1, exactly in BigInt.
  function floorSum(n,m,a,b) {
    var ans=0n;
    while(true){
      if(a>=m){ans+=(n-1n)*n*(a/m)/2n;a%=m;}
      if(b>=m){ans+=n*(b/m);b%=m;}
      var top=a*n+b;if(top<m)return ans;
      n=top/m;b=top%m;var swap=m;m=a;a=swap;
    }
  }
  function lessCount(lo,hi,a,m,c) {
    if(hi<lo||c<=0n)return 0n;
    var n=hi-lo+1n;if(c>=m)return n;
    var b=modB(a*lo,m);
    return n-(floorSum(n,m,a,b+m-c)-floorSum(n,m,a,b));
  }
  function rangeCount(lo,hi,spec,intervals) {
    var n=0n;
    for(var j=0;j<intervals.length;j++)n+=lessCount(lo,hi,spec.a,spec.m,intervals[j][1]+1n)-lessCount(lo,hi,spec.a,spec.m,intervals[j][0]);
    return n;
  }
  function angularIntervals(x,y,R,spec) {
    var rho=Math.hypot(x,y);
    if(R>=rho||rho===0)return [[0n,spec.m-1n]];
    // Every point in a disk has angular deviation at most asin(R/rho).
    // Inflate for Float64 direction error before converting to integer residues.
    var mid=mod(Math.atan2(y,x)/TAU,1), half=Math.asin(Math.min(1,R/rho))/TAU+64*EPS;
    if(half>=0.5)return [[0n,spec.m-1n]];
    function bound(v,upper) {
      var q=rational(v), prod=q.n*spec.m, v0=prod/q.d;
      if(upper&&prod%q.d!==0n)v0+=1n;
      return v0;
    }
    var pieces=[];
    function push(l,h){var a=bound(l,false)-2n,b=bound(h,true)+2n;if(a<0n)a=0n;if(b>=spec.m)b=spec.m-1n;if(a<=b)pieces.push([a,b]);}
    if(mid-half<0){push(0,mid+half);push(1+mid-half,1);}
    else if(mid+half>=1){push(0,mid+half-1);push(mid-half,1);}
    else push(mid-half,mid+half);
    pieces.sort(function(a,b){return a[0]<b[0]?-1:1;});
    if(pieces.length===2&&pieces[0][1]+1n>=pieces[1][0])return [[pieces[0][0],pieces[1][1]]];
    return pieces;
  }
  function radialRange(x,y,R,p,b) {
    // Certified monotonic inverse for nonnegative bases and positive powers.
    // Other shapes remain drawable but inversion is labelled incomplete.
    if(!(p.power>0)||!Number.isFinite(p.power))return null;
    var rho=Math.hypot(x,y), low=Math.max(0,rho-R), high=rho+R;
    var aa=Math.pow(low,1/p.power)-p.offset, zz=Math.pow(high,1/p.power)-p.offset;
    if(!Number.isFinite(aa)||!Number.isFinite(zz))return null;
    var pad=Math.max(8,64*EPS*Math.max(1,Math.abs(aa),Math.abs(zz)));
    var l=Math.max(b.first,0,Math.ceil(aa-pad)), h=Math.min(b.last,MAX,Math.floor(zz+pad));
    if(l>h)return {lo:1n,hi:0n,certified:true};
    // Integer even powers also have a negative-base branch, not covered here.
    return {lo:BigInt(l),hi:BigInt(h),certified:p.first+p.offset>=0 || !integer(p.power)};
  }
  function emptyNeighbours(reason) {var a=[];a.certified=false;a.truncated=false;a.reason=reason||'';a.candidateCount=0;a.examined=0;return a;}
  function neighbours(x,y,worldRadius,params,budget,options) {
    var p=P(params), b=bounds(p), out=emptyNeighbours(), R=number(worldRadius);
    x=number(x);y=number(y);
    if(!b.valid||!Number.isFinite(x)||!Number.isFinite(y)||!Number.isFinite(R)||R<0){out.reason=b.reason||'The query needs finite coordinates and a nonnegative radius.';return out;}
    var cap=budgetOf(budget,256,10000), opts=options||{}, maxCandidates=budgetOf(opts.maxCandidates,Math.max(4096,cap*32),100000);
    var pat=pattern(p), spec=angularSpec(p), rr=radialRange(x,y,R,p,b);
    if(!spec||!rr){
      out.reason='This shape has no certified radial inverse; showing a bounded address sample.';
      var sparse=sample(p,Math.min(2048,maxCandidates));
      sparse.forEach(function(q){if(q.valid){var d=Math.hypot(q.x-x,q.y-y);if(d<=R&&out.length<cap)out.push(Object.assign({},q,{distance:d}));}});
      out.truncated=p.count>sparse.length;out.examined=sparse.length;return out;
    }
    out.certified=rr.certified;out.reason=rr.certified?'All computed positions in this window were enumerated.':'The negative-base branch is not certified.';
    if(rr.hi<rr.lo)return out;
    var intervals=angularIntervals(x,y,R,spec), total=rangeCount(rr.lo,rr.hi,spec,intervals);
    out.candidateCount=Number(total); var stack=[[rr.lo,rr.hi,total]], examined=0;
    while(stack.length){
      if(examined>=maxCandidates||out.length>=cap){out.truncated=true;out.certified=false;break;}
      var part=stack.pop(), lo=part[0],hi=part[1],n=part[2];if(n===0n)continue;
      if(lo===hi){
        examined++;var key=Number(lo), ix=indexForAddress(key,p,pat);if(ix<0)continue;
        var q=place(key,p);if(!q.valid)continue;
        var dist=Math.hypot(q.x-x,q.y-y);if(dist<=R)out.push(Object.assign({},q,{index:ix,distance:dist}));
      } else {
        var mid=(lo+hi)/2n, nl=rangeCount(lo,mid,spec,intervals);
        if(n-nl>0n)stack.push([mid+1n,hi,n-nl]);if(nl>0n)stack.push([lo,mid,nl]);
      }
    }
    out.examined=examined;
    if(out.truncated)out.reason='The window contains too many candidates to finish within the drawing budget. Zoom closer.';
    out.sort(function(a,b){return a.distance-b.distance||a.key-b.key;});
    return out;
  }
  function pick(x,y,params,options) {
    var p=P(params), opts=options||{}, b=bounds(p);x=number(x);y=number(y);
    if(!b.valid||!Number.isFinite(x)||!Number.isFinite(y))return null;
    var pat=pattern(p), rho=Math.hypot(x,y), best=null, candidate;
    function consider(k){
      if(!keyOK(k)||k<b.first||k>b.last)return;
      var ix=indexForAddress(k,p,pat);if(ix<0)return;
      var q=place(k,p);if(!q.valid)return;
      var d=Math.hypot(q.x-x,q.y-y);
      if(!best||d<best.distance)best=Object.assign({},q,{index:ix,distance:d,exact:d===0,certified:d===0});
    }
    // Exact dot taps first: radial rounding error is bounded by a handful of ulps.
    // This is independent of the rendered sample and stores no point table.
    if(p.power!==0 && Number.isFinite(p.power)){
      candidate=Math.pow(rho,1/p.power)-p.offset;
      if(Number.isFinite(candidate)){
        var center=Math.round(candidate), pad=Math.min(256,Math.max(4,Math.ceil(64*EPS*Math.max(1,Math.abs(candidate)))));
        for(var j=-pad;j<=pad;j++)consider(center+j);
      }
    }
    if(best&&best.distance===0){best.reason='Recovered directly from the address law; exact computed coordinate match.';return best;}
    var R=Number.isFinite(opts.worldRadius)&&opts.worldRadius>=0?opts.worldRadius:2;
    if(best)R=Math.min(R||best.distance,best.distance*(1+64*EPS)+Number.MIN_VALUE);
    R=Math.max(R,Math.max(1,rho)*32*EPS);
    var rounds=budgetOf(opts.maxRounds,3,8), cap=budgetOf(opts.budget,128,4096);
    for(var t=0;t<rounds;t++){
      var near=neighbours(x,y,R,p,cap,{maxCandidates:opts.maxCandidates});
      if(near.length){var q0=near[0];if(!best||q0.distance<best.distance)best=Object.assign({},q0);}
      if(best&&best.distance<=R&&near.certified){best.certified=true;best.exact=best.distance===0;best.reason='Nearest among all computed positions inside a disk containing this point.';return best;}
      if(near.truncated)break;
      R*=4;
    }
    // A free point may be far outside the addressed region. Return a useful,
    // explicitly approximate nearest sample instead of pretending it is exact.
    sample(p,Math.min(128,cap)).forEach(function(q){if(q.valid)consider(q.key);});
    consider(b.first);consider(b.last);
    if(best){best.exact=best.distance===0;best.certified=best.exact;best.reason=best.exact?'Exact computed coordinate match.':'Closest candidate found within the query budget; zoom in to refine.';}
    return best;
  }
  function describe(params) {
    var p=P(params), b=bounds(p), lines=[];
    if(!b.valid)lines.push(b.reason);
    if(isReal(p))lines.push('Real Kuiper: each distance and turn comes from the shared law.');
    else lines.push('Practice rule: these positions use your numbers.');
    if(p.degreesPerKey!==null&&Number.isFinite(p.degreesPerKey)){
      if(mod(p.degreesPerKey,360)===0)lines.push('Every dot points along one line.');
      else if(integer(360/Math.abs(p.degreesPerKey)))lines.push((360/Math.abs(p.degreesPerKey))+' repeated directions.');
    } else if(p.wrap>0&&integer(p.wrap)&&p.wrap<=1000)lines.push('The wrap permits at most '+p.wrap+' directions.');
    if(p.power===1)lines.push('Equal distance steps crowd the centre and leave the rim sparse.');
    if(p.power===0.5)lines.push('Square-root distance keeps area growth in step with address count.');
    if(p.power<0)lines.push('Later keys move inward; key plus offset must stay in the radius domain.');
    if(p.offset<0)lines.push('A negative offset can leave early keys without a real distance.');
    var pat=pattern(p);if(pat.valid&&pat.gap>0)lines.push('After each '+pat.work+' lines, '+pat.gap+' addresses stay empty.');
    if(b.last>=1e14)lines.push('At this scale floating-point coordinates lose fine detail; spacing is not literally constant.');
    if(isReal(p))lines.push('Angles repeat every 4,294,967,296 keys; radius continues to grow.');
    return lines;
  }
  return {defaults:defaults,normalize:normalize,isReal:isReal,place:place,sample:sample,bounds:bounds,
    pick:pick,neighbours:neighbours,addressForIndex:addressForIndex,describe:describe,
    limits:{maxExactKey:MAX,maxCount:MAX,angularPeriod:4294967296},version:'1.0.0'};
});

Learn the Kuiper — Astra Codex Style Sheet

A style sheet in Kuiper Belt. Served with the page at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.

renderkuiper-belt / learn-the-kuiper/astra-codex/202610042233/style.css · lines 1–61 of 61 · version 2026-10-04 22:33 · Entry point

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage agent_infra (path word 'codex'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
Downstream impact
Used directly by 1 file: Learn the Kuiper — Astra Codex Page (kuiper-belt, https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/). It is itself an entry point, published at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
Loaded by the Astra Codex page at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.
Application
kuiper-belt · learn-the-kuiper/astra-codex/202610042233 · style sheet
Uses
none found
Used by
loaded by Learn the Kuiper — Astra Codex Page (stylesheet)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
kuiper-belt@26fba12ab1b5bab8e71934ab86c58273e5f32682 learn-the-kuiper/astra-codex/202610042233/style.css:1-61 · blob fb50a0c48684d27703039b4c1c6ec9d7b862e60b · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: agent_infra · users: ai_agent · canonical: unknown
:root{color-scheme:dark;--bg:#000;--ink:#fff;--cyan:#00ffff;--blue:#66ccff;--amber:#ffb000;--green:#22ee77;--line:#12414a;--text:24px;--caption:40px;font-family:ui-monospace,"Cascadia Mono","Consolas",monospace;font-weight:700;background:var(--bg);color:var(--ink)}
*{box-sizing:border-box}html,body{margin:0;height:100%;width:100%;overflow:hidden}body,input,button,select{font:inherit;font-size:var(--text)}button,input,select,a{touch-action:manipulation}button,.button{min-height:72px;padding:12px 18px;border:1px solid var(--line);border-radius:4px;background:#000;color:var(--cyan);font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-co  … [line shortened here: 4,968 characters; full line on GitHub]
@media(max-width:700px){:root{--caption:28px}#sheet{padding:0 10px max(8px,env(safe-area-inset-bottom));grid-template-rows:102px minmax(0,1fr) 224px}.heading{gap:8px}.brand{font-size:24px}.brand strong{font-size:28px}.counter{position:absolute;top:108px;left:22px;z-index:1;gap:0;pointer-events:none}.counter span:first-child{font-size:24px}.counter span:last-child{font-size:24px}#reset{font-size:24  … [line shortened here: 1,733 characters; full line on GitHub]
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* The drawing stays in place while one more lever is revealed. */
#sheet{height:100vh;height:100dvh;grid-template-rows:106px minmax(0,1fr) 224px}
.counter{min-width:0}.counter span{overflow-wrap:anywhere}.counter span:first-child{font-size:28px}
#status{right:350px;max-height:64px;overflow:auto;line-height:1.25}
#selection{width:330px;top:12px;bottom:12px;overflow:auto;padding:0 0 8px 16px}
#layer-label{color:var(--cyan);font-size:var(--text);margin-bottom:12px}
.selection-title{margin-bottom:12px}.selection-title button{font-size:var(--text)}
#lever-strip{display:flex;flex-direction:column;gap:16px}
.lever{flex-shrink:0;min-width:0;font-size:var(--text)}.lever input{font-size:32px}
.lever button{width:100%;margin-top:8px}
#source-line{max-height:66px;font-size:var(--text);margin-top:12px}
#source-caption{font-size:var(--text);white-space:nowrap;overflow:auto}
#title-block{right:350px;bottom:8px;padding:4px 10px;background:#000}
#title-block p{font-size:var(--text)}#formula-turn{white-space:nowrap;overflow:auto}
#wonder{right:350px;top:72px}
#next-lever{color:var(--amber)}
#numbers-dialog label,#numbers-dialog p,#particle-dialog p,#sentences button,#command-log p{font-size:var(--text)}
@media(max-width:700px){
 #sheet{grid-template-rows:106px minmax(0,1fr) 224px}
 .heading{display:grid;grid-template-columns:1fr auto;gap:0;align-content:center;position:relative}
 .brand{font-size:24px;display:flex;gap:10px;align-items:center;grid-column:1/-1}.brand strong{font-size:28px;letter-spacing:0}
 .counter{position:static;grid-column:1/-1;gap:0;z-index:auto;pointer-events:auto}.counter span{font-size:24px!important;line-height:1.2}
 #reset{position:absolute;right:0;top:4px;min-height:72px;max-width:108px;font-size:24px;padding:6px}
 .heading:has(#reset:not([hidden])) .brand{font-size:0}.heading:has(#reset:not([hidden])) .brand strong{font-size:28px}
 .heading:has(#reset:not([hidden])) .counter{padding-right:106px}
 #status{left:4px;right:4px;top:8px;height:60px;font-size:var(--text);overflow:auto;max-height:60px;background:#000}
 #selection{top:auto;bottom:2px;left:0;right:0;width:100%;height:174px;padding:0;border:0;overflow:visible;background:#000}
 #layer-label{display:none}.selection-title{position:absolute;right:0;bottom:174px;margin:0}.selection-title button{min-height:72px;max-width:145px;padding:6px}
 .selection-title #magnify{display:none}
 #lever-strip{flex-direction:row;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:4px;width:100%;height:110px}
 .lever{width:100%;min-width:100%;scroll-snap-align:start;display:flex;flex-direction:column;font-size:var(--text);line-height:1.1}
 .lever input{font-size:28px;margin-top:6px;height:72px;padding:8px}
 .lever button{margin-top:6px;min-height:72px}
 #source-line{max-height:30px;margin-top:2px;white-space:nowrap;overflow:auto;font-size:24px;line-height:1.2}
 #source-caption{font-size:24px;line-height:1.2;margin:0}
 #title-block{display:block;left:4px;right:4px;top:70px;bottom:auto;padding:0 0 0 8px;border-left:2px solid var(--cyan);height:64px;overflow:auto}
 #title-block p{font-size:24px;line-height:1.3;white-space:nowrap}
 #formula-turn{display:none}#sample-label{display:block}
 .actions #commands{flex:1.05}.actions #next-lever,.actions #numbers{flex:1.2;min-width:0;font-size:24px;padding:6px;line-height:1.05}
 .actions #play{flex:0 0 72px;min-width:72px;max-width:72px}
 #hint{bottom:182px;left:4px;right:4px}
 #wonder{left:4px;right:4px;top:112px;background:#000e}#wonder span{font-size:28px}
}

/* Keep the law and whole controls legible in the fixed-height sheet. */
#sheet{grid-template-rows:106px minmax(0,1fr) 234px}
#header-layer{display:none}
#formula-turn{white-space:normal;overflow-wrap:anywhere}
#source-caption{white-space:normal;overflow-wrap:anywhere}
@media(max-width:700px){
 .brand{font-size:0}.brand strong{font-size:28px}.brand #header-layer{display:inline;font-size:24px;color:var(--cyan)}
 #reset{display:none}.heading:has(#reset:not([hidden])) .counter{padding-right:0}
 .counter span{white-space:nowrap}
 #source-caption{white-space:nowrap}
 #title-block{pointer-events:auto}
}

UI

A JavaScript file in the astra codex folder of Kuiper Belt that stops wonder, finds interval, opens dialog and calculates planar distances and angles. Served with the page at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.

interactionkuiper-belt / learn-the-kuiper/astra-codex/202610042233/ui.js · lines 1–120 of 120 · version 2026-10-04 22:33 · Entry point · pattern openDialog (shared by 2 files)

What it does
It draws its content. Defines 31 functions or classes, including $, number, editNumber, numeric, unsafeIntegerText. Side effects: changes the web page (DOM); uses storage (browser storage, DuckDB or Parquet).
Why it exists in the grid workflow
Domain stage agent_infra (path word 'codex'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
Inputs & outputs
In: browser storage (getItem). Out: browser storage (setItem); canvas drawing.
Downstream impact
Used directly by 1 file: Learn the Kuiper — Astra Codex Page (kuiper-belt, https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/). It is itself an entry point, published at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.
What it achieves
It stops wonder (`stopWonder`), selects key (`selectKey`) and finds interval (`findInterval`). Defines `number`, `editNumber`, `numeric` and 27 more. It responds to pointerdown, keydown and input events.
Why it matters
Loaded by the Astra Codex page at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/astra-codex/202610042233/.
Application
kuiper-belt · learn-the-kuiper/astra-codex/202610042233 · script
Uses
none found
Used by
loaded by Learn the Kuiper — Astra Codex Page (script src)
Produces
$, number, editNumber, numeric, unsafeIntegerText, params, truePoint, currentPoint, log, status, invalidate, stopWonder
Defines here
$, number, editNumber, numeric, unsafeIntegerText, params, truePoint, currentPoint, log, status, invalidate, stopWonder, gesture, inputValue, selectKey, movePolar, directionOf, findInterval, openDialog, grow, executeCommand, playToggle, step, startWonder, endWonder, milestone, project, world, resize, wrapCanvas
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
kuiper-belt@26fba12ab1b5bab8e71934ab86c58273e5f32682 learn-the-kuiper/astra-codex/202610042233/ui.js:1-120 · blob 775bed62e5060f317fdf50c8edd0638468354e5b · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, storage · domain stage: agent_infra · users: ai_agent · canonical: unknown
(function(){'use strict';
const $=id=>document.getElementById(id), L=window.KuiperCodexLogic, DATA=window.KuiperCodeData, SOUND=window.KuiperSound;
const canvas=$('canvas'),g=canvas.getContext('2d'), TAU=Math.PI*2;
const palettes={kuiper:['#00ffff','#66ccff','#ffb000','#22ee77','#ffffff'],paper:['#ffffff','#00ffff','#ffb000','#ffffff','#66ccff'],ember:['#ffb000','#ff8d65','#ffffc0','#ffffff','#00ffff'],ocean:['#66ccff','#00ffff','#22ee77','#ffffff','#aabfff'],orchid:['#ebadff','#00ffff','#ffd0e5','#ffffff','#ffb000']};
const state={params:L.normalize({...L.defaults(),first:1,offset:0,degreesPerKey:137.5}),lever:0,shadows:false,selected:1,practice:null,free:false,nearest:null,code:false,colour:'age',palette:'kuiper',magnifier:false,playing:false,speed:2,revealed:1,wonder:false,wonderStart:0,wonderIndex:-1,morph:null,text:24,proof:null,proving:false,realEstate:false,unsafeInput:false};
let width=0,height=0,cam={cx:0,cy:0,s:1,x:0,y:0},frame=0,lastPlay=0,lastHint=0,hintTimer=0,drag=null,hit=[],sample=[],dirty=true;
const number=n=>Number.isFinite(n)?(Number.isInteger(n)?n.toLocaleString('en-GB',{maximumFractionDigits:0}):n.toLocaleString('en-GB',{maximumFractionDigits:5})):String(n);
const editNumber=n=>Number.isFinite(n)?(Number.isInteger(n)?String(n):String(Number(n.toPrecision(12)))):String(n);
const compact=n=>!Number.isFinite(n)?String(n):Math.abs(n)>=1e15?(n/1e15).toLocaleString('en-GB',{maximumFractionDigits:2})+' quadrillion':Math.abs(n)>=1e12?(n/1e12).toLocaleString('en-GB',{maximumFractionDigits:2})+' trillion':Math.abs(n)>=1e9?(n/1e9).toLocaleString('en-GB',{maximumFractionDigits:2})+' billion':Math.abs(n)>=1e6?(n/1e6).toLocaleString('en-GB',{maximumFractionDigits:2})+' million':  … [line shortened here: 410 characters; full line on GitHub]
const numeric=s=>Number(String(s).replaceAll(',','').trim());
function unsafeIntegerText(s){const t=String(s).replaceAll(',','').trim();if(!/^[+\-]?\d+$/.test(t))return false;try{return BigInt(t)>9007199254740992n||BigInt(t)<-9007199254740992n;}catch(e){return false;}}
function params(){return state.params;}
function truePoint(){return L.place(state.selected,params());}
function currentPoint(){return state.practice||truePoint();}
function log(command,result){const rows=$('command-log').children;rows[0].textContent='> '+command;rows[1].textContent=result;}
function status(text){const full=String(text);$('status').textContent=innerWidth<700&&full.startsWith('ALL OF THIS')?'ONE NUMBER. ONE RULE. NO COORDINATES STORED.':full.length>95?full.split('. ')[0]+'.':full;$('status').title=full;}
function invalidate(){dirty=true;}
function stopWonder(){if(state.wonder){state.wonder=false;$('wonder').hidden=true;try{localStorage.setItem('kuiper-codex-wonder','seen');}catch(e){}}}
let firstGesture=true;
function gesture(e){SOUND.awaken();if(firstGesture){firstGesture=false;SOUND.tone(1,1);}$('mute').textContent=SOUND.muted?'Sound off':'Sound on';if(state.wonder&&e&&e.target.id!=='skip')stopWonder();}
document.addEventListener('pointerdown',gesture,{capture:true});document.addEventListener('keydown',e=>{if(e.isTrusted)gesture(e);},{capture:true});
function inputValue(id,value){if($(id)&&document.activeElement!==$(id))$(id).value=value;}
function sourceForKey(key){if(!DATA||!DATA.lines.length)return null;let index=1;if(state.code){const p=params(),gap=Math.floor(p.skipPerSecond*Math.min(p.restSeconds,p.capSeconds)),work=gap>0?p.workLines:1,delta=key-p.first,cycle=work+gap;index=gap>0?Math.floor(delta/cycle)*work+delta%cycle:delta;if(!Number.isSafeInteger(index)||index<0||index>=DATA.lines.length)return null;}return DATA.lines[inde  … [line shortened here: 404 characters; full line on GitHub]
function setParams(change,{smooth=true,quiet=false}={}){const before=params();state.params=L.normalize({...before,...change,_raw:{...before._raw,...change}});state.practice=null;state.free=false;state.nearest=null;state.realEstate=false;if(smooth&&!matchMedia('(prefers-reduced-motion: reduce)').matches)state.morph={from:before,t:performance.now()};state.revealed=Math.min(Math.max(1,state.revealed)  … [line shortened here: 707 characters; full line on GitHub]
function selectKey(key){key=numeric(key);state.selected=key;state.practice=null;state.free=false;state.nearest=null;sync();invalidate();return truePoint();}
function moveSelected(x,y){x=numeric(x);y=numeric(y);if(!Number.isFinite(x)||!Number.isFinite(y)){status('That is not a finite place. The numbers stay yours to change.');return;}state.practice={key:state.selected,x,y,r:Math.hypot(x,y),deg:((Math.atan2(y,x)*180/Math.PI)%360+360)%360,valid:true};state.practice.theta=state.practice.deg*Math.PI/180;state.free=true;try{state.nearest=L.pick(x,y,params()  … [line shortened here: 561 characters; full line on GitHub]
function movePolar(r,deg){r=numeric(r);deg=numeric(deg);if(!Number.isFinite(r)||!Number.isFinite(deg)||r<0){status('A drawable distance is finite and nonnegative. Your entry has not been clamped.');return;}const a=deg*Math.PI/180;moveSelected(r*Math.cos(a),r*Math.sin(a));}
function sync(){const p=currentPoint(),lawPoint=truePoint(),count=params().count,phone=innerWidth<700; $('count-label').textContent=compact(count)+(count===1?' particle addressed':' addressed');$('key-label').textContent=compact(state.selected);inputValue('angle',params().degreesPerKey===null?Number((360*params().turnNumber/params().wrap).toFixed(4)):editNumber(params().degreesPerKey));inputValue(  … [line shortened here: 816 characters; full line on GitHub]
 $('layer-label').textContent=L.isReal(params())?'THE REAL KUIPER':'YOUR SPIRAL · PRACTICE';$('header-layer').textContent=L.isReal(params())?'REAL KUIPER':'YOUR SPIRAL';$('next-lever').hidden=state.lever>=5;$('numbers').hidden=state.lever<5;$('play').hidden=state.lever<2;$('reset').hidden=state.lever<5;
 document.querySelectorAll('[data-level]').forEach(el=>el.hidden=Number(el.dataset.level)>state.lever);$('magnify').hidden=state.lever<2;
 $('formula-radius').textContent=phone?(params().power===.5?'R=√('+number(state.selected)+(params().offset===0?'':(params().offset<0?'':'+')+number(params().offset))+')='+number(lawPoint.r):'R=('+number(state.selected)+'+'+number(params().offset)+')^'+number(params().power)+'='+number(lawPoint.r)):(params().power===.5?'DISTANCE = √('+number(state.selected)+(params().offset===0?'':' + '+number(para  … [line shortened here: 564 characters; full line on GitHub]
 $('formula-turn').textContent=params().degreesPerKey===null?'TURN = MOD(KEY × '+params().turnNumber+' / '+params().wrap+', 1) TURNS':'TURN = KEY × '+number(params().degreesPerKey)+'°; FULL LAPS REMOVED';
 const degrees=params().degreesPerKey===null?params().turnNumber/params().wrap*360:params().degreesPerKey;const raw=state.selected*degrees;const laps=Math.floor(raw/360);const left=number(lawPoint.deg);$('sample-label').textContent=state.practice?(phone?'MOVED R=':'PRACTICE DISTANCE ')+(phone?Number(p.r.toFixed(2)):number(p.r))+' / '+(phone?Number(p.deg.toFixed(2)):number(p.deg))+'°':state.code?(p  … [line shortened here: 809 characters; full line on GitHub]
 $('play').textContent=state.playing?'Pause':'Play';$('magnify').setAttribute('aria-pressed',String(state.magnifier));
 for(const [name] of fieldSpecs){const input=$('param-'+name);if(input&&document.activeElement!==input)input.value=params()[name]===null?'':String(params()._raw[name]??params()[name]);}
 const real=L.place(state.selected,L.defaults());const direction=directionOf(real.deg);$('real-instructions').textContent='Press / on the live site, type '+number(state.selected)+', then Enter. Ring '+number(Math.floor(real.r))+'. Look '+direction+' from the centre. Distance '+number(real.r)+'.';
 const interval=findInterval(state.selected);$('real-provenance').textContent=interval?'This historical address is issued. The code shown here is a separately labelled Kuiper source example.':'This historical address is in a quiet gap. The live site may show its marker, but there is no issued particle here.';
 $('nearest-label').textContent=state.nearest&&Number.isFinite(state.nearest.key)?'Nearest '+(state.nearest.certified?'certified':'candidate')+' key: '+number(state.nearest.key)+(state.nearest.reason?' · '+state.nearest.reason:''):state.practice?'Free placement. Select a finite address range to find its nearest key.':'This is the rule’s own position.';
 for(const [name,value] of [['key',state.selected],['x',p.x],['y',p.y],['r',p.r],['deg',p.deg]]){const el=$('particle-'+name);if(el&&document.activeElement!==el)el.value=editNumber(value);}
 $('parameter-note').textContent=(state.unsafeInput?'ABOVE 2^53: THE COMPUTER CANNOT COUNT EVERY KEY EXACTLY. Your typed value is preserved. ':'')+L.describe(params()).join(' ')+' Quiet time: '+number(params().skipPerSecond)+' keys per second, at most '+number(params().capSeconds)+' seconds. No per-particle coordinate table is saved.';
 const fm=$('mobile-formula');if(fm)fm.textContent=$('formula-radius').textContent;
}
function directionOf(deg){return ['right','up and right','up','up and left','left','down and left','down','down and right'][Math.round(deg/45)%8]||'at the centre';}
function findInterval(k){const a=DATA?.intervals||[];let lo=0,hi=a.length-1;while(lo<=hi){const m=(lo+hi)>>1,v=a[m];if(k<v.start)hi=m-1;else if(k>=v.end)lo=m+1;else return v;}return null;}
const fieldSpecs=[['first','First key'],['count','How many particles'],['turnNumber','Turn number'],['wrap','Wrap size'],['degreesPerKey','Degrees per key (blank uses turn / wrap)'],['power','How fast it spreads out (power)'],['offset','Start offset'],['skipPerSecond','Keys skipped per second'],['capSeconds','Longest quiet counted (seconds; 14 days = 1209600)'],['workLines','Lines per work burst']  … [line shortened here: 510 characters; full line on GitHub]
function fieldChange(name,text){stopWonder();state.unsafeInput=unsafeIntegerText(text);const value=name==='degreesPerKey'&&String(text).trim()===''?null:numeric(text);setParams({[name]:value},{smooth:false});params()._raw[name]=text;if(state.unsafeInput){status('ABOVE 2^53: THE COMPUTER CANNOT COUNT EVERY KEY EXACTLY.');log('Set '+name+' = '+text,'Value preserved. Whole-number precision is exhaust  … [line shortened here: 415 characters; full line on GitHub]
for(const [name,label] of fieldSpecs){const lab=document.createElement('label');lab.textContent=label;const input=document.createElement('input');input.type='text';input.inputMode='decimal';input.id='param-'+name;input.dataset.param=name;input.autocomplete='off';input.addEventListener('input',()=>fieldChange(name,input.value));lab.append(input);$('parameter-fields').append(lab);}
for(const [name,label] of [['key','Key'],['x','X: how far across'],['y','Y: how far up'],['r','Distance from centre'],['deg','Degrees from 3 o’clock, anticlockwise']]){const lab=document.createElement('label');lab.textContent=label;const input=document.createElement('input');input.id='particle-'+name;input.type='text';input.inputMode='decimal';input.addEventListener('input',()=>{const p=currentPoi  … [line shortened here: 762 characters; full line on GitHub]
const sentences=["Place the first 100 lines of Kuiper's own code","Show every repeated line in the same colour","Take a night off","Go to key 12","Try turn 360","Show the circle with 1 trillion dots","Show me the wonder","Measure this against the real Kuiper code","Reset to the real Kuiper","Show a sunflower","Show 4 spokes","Show 3 spokes","Show 5 spokes","Show spiral arms","Show a crowded centre  … [line shortened here: 533 characters; full line on GitHub]
for(const sentence of sentences){const b=document.createElement('button');b.textContent=sentence;b.addEventListener('click',()=>{$('commands-dialog').close();executeCommand(sentence);});$('sentences').append(b);}
function openDialog(id){stopWonder();const el=$(id);if(!el.open)el.showModal();sync();}
document.querySelectorAll('[data-close]').forEach(b=>b.addEventListener('click',()=>$(b.dataset.close).close()));
function reset(){stopWonder();state.playing=false;state.code=false;state.colour='age';state.magnifier=false;state.realEstate=false;state.selected=0;state.revealed=1;state.lever=5;state.unsafeInput=false;setParams({...L.defaults(),first:0},{smooth:true});status('THE REAL KUIPER. Keys start at 0. The live radius includes 0.5.');log('Reset to the real Kuiper','Every field restored. Shared live placem  … [line shortened here: 412 characters; full line on GitHub]
function nextLever(){stopWonder();state.lever=Math.min(5,state.lever+1);state.shadows=state.lever>=3;const messages=['Turn it. Full laps are thrown away.','Key 2: change its distance with the spread control.','Press Play. Keys 1 to 20 arrive one at a time.','X is across. Y is up. The shadows show both.','Take a rest. Skipped addresses become a dark ring.','Compare YOUR SPIRAL with THE REAL KUIPER.  … [line shortened here: 753 characters; full line on GitHub]
function grow(n){state.code=false;state.playing=false;state.magnifier=false;state.revealed=n;setParams({first:0,count:n,restSeconds:0});state.selected=n===1?0:Math.min(20,n-1);sync();}
function preset(kind){const shapes={sunflower:{...L.defaults(),first:0,count:1000},'4 spokes':{degreesPerKey:90},'3 spokes':{degreesPerKey:120},'5 spokes':{degreesPerKey:72},'spiral arms':{degreesPerKey:91},'crowded centre':{power:1},'dark rings':{workLines:100,restSeconds:4,skipPerSecond:600,capSeconds:1209600}};state.playing=false;state.code=false;setParams({...L.defaults(),first:0,count:1000,..  … [line shortened here: 428 characters; full line on GitHub]
async function measure(){if(state.proving)return;state.proving=true;status('Measuring the shared live law across 1,000,000 keys.');let photons=0,max=0;const started=performance.now(),p=L.defaults();for(let base=0;base<1000000;base+=20000){for(let k=base;k<base+20000;k++){const a=KuiperLaw.keyPlace(k),b=L.place(k,p);const d=Math.max(Math.abs(a[0]-b.x),Math.abs(a[1]-b.y));max=Math.max(max,d);if(d!==  … [line shortened here: 829 characters; full line on GitHub]
function executeCommand(text){stopWonder();const original=String(text).trim(),s=original.toLowerCase().replaceAll('’',"'").replace(/[,.](?=\d{3}(\D|$))/g,'');let result='';
 if(/measure.*real kuiper|^prove$/.test(s)){measure();return 'Measuring';}
 if(/reset|^real kuiper$/.test(s)){reset();return 'Reset';}
 if(/wonder/.test(s)){startWonder();return 'Wonder';}
 if(/first\s+\d+\s+lines|own code|^code$/.test(s)){const n=Number(s.match(/first\s+(\d+)/)?.[1]||100);state.code=true;state.colour='duplicate';state.playing=false;state.revealed=n;setParams({first:0,count:n,restSeconds:0});state.selected=Math.min(1,n-1);result='Real source lines in order. These are example addresses, not historical estate keys.';}
 else if(/repeated|duplicate/.test(s)){state.code=true;state.colour='duplicate';state.revealed=Math.max(100,Math.min(DATA.lines.length,params().count));setParams({first:0,count:state.revealed,restSeconds:0});result='Identical source text has the same colour. Every copy keeps its own address.';}
 else if(/night off/.test(s)){setParams({restSeconds:8*3600,workLines:Math.max(1,Math.min(20,params().count)),count:Math.max(60,params().count)});result='Eight hours of quiet: '+number(8*3600*params().skipPerSecond)+' addresses skipped between bursts.';hint('quiet');}
 else if(/go to key|^key /.test(s)){const k=numeric(s.match(/(?:go to key|key)\s+(.+)/)?.[1]||'');selectKey(k);const b=L.bounds(params());if(b.valid&&(k<b.first||k>b.last))setParams({first:k,count:1});state.magnifier=true;result='Key '+number(k)+'. Its true place is computed directly.';}
 else if(/turn\s+[-+\d.]/.test(s)){const n=numeric(s.match(/turn\s+([^\s]+)/)?.[1]);setParams({degreesPerKey:n,count:params().count===1?100:params().count});result=n%360===0?'Every dot lands on one line. Full laps change no direction.':'Each successive key turns '+number(n)+' degrees.';hint('turn');}
 else if(/2\^53|2\*\*53/.test(s)){setParams({...L.defaults()},{smooth:false,quiet:true});grow(2**53);state.lever=5;result='2^53 ADDRESSED. Zoom in for detail; whole-number precision ends here.';}
 else if(/circle with|^count /.test(s)){const m=s.match(/(?:with|count)\s+([\d.e+\-]+)\s*(quadrillion|trillion|billion|million|thousand)?/);if(m){let n=Number(m[1])*({quadrillion:1e15,trillion:1e12,billion:1e9,million:1e6,thousand:1e3}[m[2]]||1);grow(n);result=L.describe(params()).join(' ');if(n>=1e12)milestone(n);}else result='Say: Show the circle with 1 trillion dots.';}
 else if(/sunflower/.test(s)){preset('sunflower');result='The real Kuiper placement law.';}
 else if(/(4|3|5) spokes/.test(s)){const k=s.match(/(4|3|5) spokes/)[0];preset(k);result=k.toUpperCase()+': THE TURN DIVIDES A FULL CIRCLE.';}
 else if(/spiral arms|crowded centre|dark rings/.test(s)){const k=s.match(/spiral arms|crowded centre|dark rings/)[0];preset(k);result=k==='crowded centre'?'Linear radius: the centre is denser; the outer region is sparser.':k==='dark rings'?'Quiet addresses stay empty. The next work starts further out.':'91 degrees twists four spokes into arms.';}
 else if(/magnif/.test(s)){state.magnifier=!state.magnifier;result=state.magnifier?'A local window: true neighbours are calculated, not sampled.':'Back to the whole address range.';}
 else if(s==='play'){playToggle(true);result='New real source lines land one by one.';}
 else if(s==='pause'){playToggle(false);result='Paused.';}
 else if(s==='step'){step();result='One more line.';}
 else if(s==='faster'||s==='slower'){state.speed=s==='faster'?Math.min(100,state.speed*2):Math.max(.25,state.speed/2);result=number(state.speed)+' lines per second.';}
 else if(/formulas|numbers/.test(s)){openDialog('numbers-dialog');result='Every field is editable. Changes act live.';}
 else if(s==='help'||s==='/'){openDialog('commands-dialog');result='Pick one plain sentence.';}
 else result='Try a sentence from Commands, such as “Try turn 360”.';
 log(original,result);status(result);sync();invalidate();return result;
}
function playToggle(force){state.playing=force===undefined?!state.playing:force;if(state.playing&&!state.code)state.playLimit=params().count<20?20:params().count+20;if(state.playing&&state.code&&state.revealed>=params().count)state.revealed=1;lastPlay=performance.now();sync();invalidate();}
function step(){if(!state.code){setParams({count:params().count+1},{smooth:false,quiet:true});state.revealed=params().count;selectKey(L.addressForIndex(params().count-1,params()));}else{state.revealed=Math.min(params().count,state.revealed+1);selectKey(L.addressForIndex(state.revealed-1,params()));}SOUND.tone(state.selected,truePoint().r);invalidate();}
const wonderCounts=[1,10,100,1000000,43486619138,1e12];
function startWonder(){setParams({...L.defaults(),first:1},{smooth:false,quiet:true});state.playing=false;state.code=false;state.magnifier=false;state.shadows=false;state.lever=5;state.wonder=true;state.wonderStart=performance.now();state.wonderIndex=-1;$('wonder').hidden=false;sync();invalidate();}
function endWonder(){state.wonder=false;$('wonder').hidden=true;setParams({...L.defaults()},{smooth:false,quiet:true});grow(1e12);status('ALL OF THIS FROM ONE NUMBER AND ONE RULE. NO COORDINATES STORED.');log('Show me the wonder','1 trillion addressed. No per-particle coordinate table.');try{localStorage.setItem('kuiper-codex-wonder','seen');}catch(e){}}
function milestone(n){status(compact(n).toUpperCase()+' ADDRESSED. NO COORDINATE TABLE.');SOUND.tone(n,Math.sqrt(n));}
const hints=['Drag the dot. Its true place stays marked.','Distance means how far from the centre.','Angles start at 3 o’clock and increase anticlockwise.','One full turn is 360 degrees.','90 degrees makes four spokes.','120 degrees makes three spokes.','72 degrees makes five spokes.','91 degrees bends four spokes into arms.','A square root lets area grow with the address count.','Linear radius cr  … [line shortened here: 929 characters; full line on GitHub]
function hint(action){const now=Date.now();let index=0;try{lastHint=Math.max(lastHint,Number(localStorage.getItem('kuiper-codex-hint-time')||0));index=Number(localStorage.getItem('kuiper-codex-hint')||0)%hints.length;}catch(e){}if(now-lastHint<20000)return;lastHint=now;try{localStorage.setItem('kuiper-codex-hint',String(index+1));localStorage.setItem('kuiper-codex-hint-time',String(now));}catch(e)  … [line shortened here: 677 characters; full line on GitHub]
function pointColour(pt,i,n){const pal=palettes[state.palette];if(state.colour==='duplicate'&&state.code){const line=DATA.lines[Math.max(0,Math.min(DATA.lines.length-1,pt.index??Math.round(pt.key-params().first)))];const group=line?.duplicateGroup;let h=0;for(const c of String(group??line?.text??''))h=(Math.imul(h,31)+c.charCodeAt(0))>>>0;return pal[h%pal.length];}if(state.colour==='turn')return p  … [line shortened here: 493 characters; full line on GitHub]
function project(p){return {x:cam.cx+(p.x-cam.x)*cam.s,y:cam.cy-(p.y-cam.y)*cam.s};}
function world(x,y){return {x:(x-cam.cx)/cam.s+cam.x,y:(cam.cy-y)/cam.s+cam.y};}
function resize(){const r=$('drawing').getBoundingClientRect();width=r.width;height=r.height;const dpr=Math.min(devicePixelRatio||1,2.5);canvas.width=Math.round(width*dpr);canvas.height=Math.round(height*dpr);g.setTransform(dpr,0,0,dpr,0,0);invalidate();}
function draw(t){g.clearRect(0,0,width,height);g.fillStyle='#000';g.fillRect(0,0,width,height);const phone=width<700,p=params(),b=L.bounds(p),pal=palettes[state.palette];const viewW=phone?width:width-350;const top=phone?122:60,bottom=phone?174:94;const usable=Math.max(80,height-top-bottom);cam.cx=viewW/2;cam.cy=top+usable/2;const R=Math.max(24,Math.min(viewW*.37,usable*.42));const bound=Math.max(2  … [line shortened here: 491 characters; full line on GitHub]
 const selected=currentPoint();let neighbourInfo=null;if(state.magnifier&&selected.valid){cam.x=selected.x;cam.y=selected.y;cam.s=R/3*Math.abs(scale||1);try{neighbourInfo=L.neighbours(selected.x,selected.y,3,p,350);sample=neighbourInfo;}catch(e){sample=[];} }else{const cp=state.playing||state.code?L.normalize({...p,count:Math.min(p.count,state.revealed)}):p;sample=L.sample(cp,phone?1200:2400);}
 g.strokeStyle='#12414a';g.lineWidth=1;g.setLineDash([]);g.beginPath();g.moveTo(cam.cx-R-16,cam.cy);g.lineTo(cam.cx+R+16,cam.cy);g.moveTo(cam.cx,cam.cy-R-16);g.lineTo(cam.cx,cam.cy+R+16);g.stroke();for(const fraction of [.5,1]){g.beginPath();g.arc(cam.cx,cam.cy,R*fraction,0,TAU);g.stroke();}g.fillStyle='#66ccff';g.font='700 '+(phone?24:24)+'px monospace';g.textAlign='center';g.fillText('0°',Math.m  … [line shortened here: 490 characters; full line on GitHub]
 hit=[];let drawn=0;const morph=state.morph?Math.min(1,(t-state.morph.t)/700):1;const size=Number.isFinite(p.dotSize)&&p.dotSize>0?Math.min(p.dotSize,Math.max(width,height)*2):0;
 for(let i=0;i<sample.length;i++){let pt=sample[i];if(!pt.valid)continue;let displayed=pt;if(morph<1&&!state.magnifier){const old=L.place(pt.key,state.morph.from);if(old.valid){const u=morph*morph*(3-2*morph);displayed={x:old.x+(pt.x-old.x)*u,y:old.y+(pt.y-old.y)*u};}}const pos=project(displayed);if(!Number.isFinite(pos.x)||!Number.isFinite(pos.y)||pos.x<-size||pos.y<-size||pos.x>viewW+size||pos.y  … [line shortened here: 569 characters; full line on GitHub]
 if(morph>=1)state.morph=null;
 const truth=truePoint();if(truth.valid){const q=project(truth);if(state.practice){g.strokeStyle=pal[1];g.beginPath();g.moveTo(q.x-7,q.y);g.lineTo(q.x+7,q.y);g.moveTo(q.x,q.y-7);g.lineTo(q.x,q.y+7);g.stroke();const moved=project(selected);g.setLineDash([6,6]);g.beginPath();g.moveTo(q.x,q.y);g.lineTo(moved.x,moved.y);g.stroke();g.setLineDash([]);}}
 if(selected.valid){const q=project(selected);if(q.x>-100&&q.x<viewW+100&&q.y>-100&&q.y<height+100){g.strokeStyle=pal[2];g.lineWidth=2;g.beginPath();g.moveTo(cam.cx,cam.cy);g.lineTo(q.x,q.y);g.stroke();if(state.shadows){g.setLineDash([5,5]);g.strokeStyle=pal[1];g.beginPath();g.moveTo(q.x,cam.cy);g.lineTo(q.x,q.y);g.lineTo(cam.cx,q.y);g.stroke();g.setLineDash([]);g.fillStyle='#fff';g.font='700 24px  … [line shortened here: 993 characters; full line on GitHub]
 if(!b.valid){g.fillStyle=pal[2];g.textAlign='center';g.font='700 24px monospace';wrapCanvas(b.reason||'No finite drawing for these numbers.',cam.cx,cam.cy,Math.max(120,viewW-30),30);}
 if(state.magnifier){$('sample-label').textContent=sample.certified&&!sample.truncated?'ALL '+sample.length+' TRUE NEIGHBOURS IN THIS WINDOW.':(sample.reason||'Local search is incomplete for these settings.');status(sample.certified&&!sample.truncated?'The circle grows. This local window is calculated at full detail.':'Local search: '+(sample.reason||'uncertified'));}
 if(!state.magnifier&&p.count>sample.length&&b.valid&&!state.wonder)$('sample-label').textContent=phone?number(drawn)+' DOTS / SAMPLED':number(drawn)+' SCREEN DOTS / '+compact(p.count)+' ADDRESSED.';
}
function wrapCanvas(text,x,y,w,lineHeight){const words=text.split(' ');let line='',row=0;for(const word of words){const test=line+word+' ';if(g.measureText(test).width>w&&line){g.fillText(line,x,y+row++*lineHeight);line=word+' ';}else line=test;}g.fillText(line,x,y+row*lineHeight);}
function tick(t){if(state.wonder){const elapsed=t-state.wonderStart,index=Math.min(wonderCounts.length-1,Math.floor(elapsed/3300));if(index!==state.wonderIndex){state.wonderIndex=index;const n=wonderCounts[index];state.revealed=n;setParams({first:index===0?1:0,count:n,restSeconds:0},{quiet:true});state.selected=index===0?1:Math.min(20,n-1);$('wonder-label').textContent=compact(n).toUpperCase()+' P  … [line shortened here: 872 characters; full line on GitHub]
function canvasPosition(e){const r=canvas.getBoundingClientRect();return{x:e.clientX-r.left,y:e.clientY-r.top};}
canvas.addEventListener('pointerdown',e=>{const p=canvasPosition(e);let nearest=null,d=28;for(const h of hit){const n=Math.hypot(h.x-p.x,h.y-p.y);if(n<d){d=n;nearest=h;}}const active=project(currentPoint());if(Math.hypot(active.x-p.x,active.y-p.y)<30)nearest={key:state.selected};if(nearest)selectKey(nearest.key);else{const w=world(p.x,p.y);moveSelected(w.x,w.y);}drag={x:p.x,y:p.y,moved:false,selec  … [line shortened here: 456 characters; full line on GitHub]
canvas.addEventListener('pointermove',e=>{if(!drag)return;const p=canvasPosition(e);if(Math.hypot(p.x-drag.x,p.y-drag.y)>3)drag.moved=true;if(drag.moved){const w=world(p.x,p.y);moveSelected(w.x,w.y);}});
canvas.addEventListener('pointerup',e=>{if(drag&&!drag.moved&&drag.selected)openDialog('particle-dialog');drag=null;});canvas.addEventListener('pointercancel',()=>drag=null);
canvas.addEventListener('keydown',e=>{if(['ArrowUp','ArrowDown','ArrowLeft','ArrowRight'].includes(e.key)){e.preventDefault();const p=currentPoint(),v=10/Math.max(Math.abs(cam.s),1e-20);moveSelected(p.x+(e.key==='ArrowRight'?v:e.key==='ArrowLeft'?-v:0),p.y+(e.key==='ArrowUp'?v:e.key==='ArrowDown'?-v:0));}if(e.key==='Enter')openDialog('particle-dialog');});
document.addEventListener('keydown',e=>{const editing=/INPUT|TEXTAREA|SELECT/.test(document.activeElement.tagName);if(e.key==='/'&&!editing){e.preventDefault();openDialog('commands-dialog');}if(e.key==='Escape')stopWonder();});
$('angle').addEventListener('input',()=>fieldChange('degreesPerKey',$('angle').value));$('lever-power').addEventListener('input',()=>fieldChange('power',$('lever-power').value));$('lever-count').addEventListener('input',()=>{fieldChange('count',$('lever-count').value);state.revealed=params().count;invalidate();});$('lever-quiet').addEventListener('input',()=>{state.revealed=Math.max(100,params().c  … [line shortened here: 718 characters; full line on GitHub]
$('reset').onclick=reset;$('reset-numbers').onclick=reset;$('commands').onclick=()=>openDialog('commands-dialog');$('numbers').onclick=()=>openDialog('numbers-dialog');$('inspect').onclick=()=>openDialog('particle-dialog');$('restore-dot').onclick=()=>{state.practice=null;state.nearest=null;sync();invalidate();};$('magnify').onclick=()=>executeCommand('Magnify this particle');$('play').onclick=()=  … [line shortened here: 747 characters; full line on GitHub]
$('palette').onchange=e=>{state.palette=e.target.value;invalidate();};$('colour').onchange=e=>{state.colour=e.target.value;invalidate();};$('mood').onchange=e=>SOUND.setMood(e.target.value);$('mute').onclick=()=>{$('mute').textContent=SOUND.setMuted(!SOUND.muted)?'Sound off':'Sound on';};function textSize(v){state.text=Math.max(24,Math.min(40,v));document.documentElement.style.setProperty('--text'  … [line shortened here: 630 characters; full line on GitHub]
function setScene(name){document.querySelectorAll('dialog[open]').forEach(d=>d.close());stopWonder();reset();state.lever=0;setParams({...L.defaults(),first:1,offset:0,degreesPerKey:137.5},{smooth:false});state.selected=1;state.morph=null;log('Move the dot.','1,100,009 KEYS: 0 DIFFS');$('hint').hidden=true;switch(name){case'moved-particle':moveSelected(.8,1.1);break;case'one-trillion':state.lever=5  … [line shortened here: 1,514 characters; full line on GitHub]
window.KuiperApp={state,getState:()=>state,setParams,selectKey,moveSelected,executeCommand,startWonder,endWonder,setScene,nextLever,measure,draw:()=>{draw(performance.now());return hit;},screenPoint:()=>project(currentPoint())};
new ResizeObserver(resize).observe($('drawing'));sync();resize();status("0 IS AT 3 O'CLOCK. ANGLES TURN ANTICLOCKWISE.");$('proof-line').textContent=innerWidth<700?'1,100,009 KEYS: 0 DIFFS':'REAL LAW: 1,100,009 keys checked. 0 differences.';frame=requestAnimationFrame(tick);
})();

Kuiper Belt — Learn the Kuiper Page

A web page. Published at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/.

renderkuiper-belt / learn-the-kuiper/index.html · lines 1–14 of 14 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage agent_infra (path word 'kuiper'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
Inputs & outputs
Out: web page.
Downstream impact
Used directly by 2 files: Apps Registry (kuiper-belt); Kuiper Belt — Diary Page (kuiper-belt, https://ventusltd.github.io/kuiper-belt/diary/20261005.html). It is itself an entry point, published at https://ventusltd.github.io/kuiper-belt/learn-the-kuiper/.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
Loaded by the Diary page at https://ventusltd.github.io/kuiper-belt/diary/20261005.html. Also imported by Apps Registry.
Application
kuiper-belt · learn-the-kuiper · page
Uses
none found
Used by
named by URL in Apps Registry (estate URL), linked from Kuiper Belt — Diary Page (link)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
kuiper-belt@26fba12ab1b5bab8e71934ab86c58273e5f32682 learn-the-kuiper/index.html:1-14 · blob e77e2d704a85d2991f52047c49f97ea1bb422413 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: agent_infra · users: ai_agent · canonical: unknown
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Learn the Kuiper</title>
<meta http-equiv="refresh" content="0; url=202610050609/">
<style>html,body{margin:0;height:100%;background:#000;color:#fff;font:700 24px/1.4 "Segoe UI",Arial,sans-serif}a{color:#00ffff}main{padding:32px 20px}</style>
</head>
<body>
<main>Opening the latest Learn the Kuiper. <a href="202610050609/">Tap here if it does not open.</a></main>
<script>location.replace('202610050609/' + location.hash);</script>
</body>
</html>