GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Electricity markets and data pipelines / globalgrid2050 / testcode/202609060349/pipeline/assets

Hundred and 14 more files

A JavaScript module in the pipeline folder of GlobalGrid2050 that fetches route GridAtlas, entangle, routes and engine route.

500 lines of JavaScript and Python and CSS from globalgrid2050, in 15 files. Topic: Electricity markets and data pipelines. Section 914 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. Wider Mobile Actions render · globalgrid2050 / testcode/202609060349/pipeline/assets/202609060318-wider-mobile-actions.css lines 1–20
  2. Metric Details render · globalgrid2050 / testcode/202609060349/pipeline/assets/202609060333-metric-details.mjs lines 1–22
  3. Apps storage · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/apps.py lines 1–32
  4. Describe render · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/describe.py lines 1–41
  5. Entangle storage · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/entangle.py lines 1–36
  6. Hundred render · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/hundred.mjs lines 1–84
  7. Journey render · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/journey.mjs lines 1–17
  8. Keys storage · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/keys.py lines 1–14
  9. Label storage · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/label.py lines 1–58
  10. Probe render · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/probe.mjs lines 1–27
  11. Qubit storage · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/qubit.py lines 1–28
  12. Snapshot storage · globalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/snapshot.mjs lines 1–35
  13. Dna storage · globalgrid2050 / testcode/202609170041-quantum-twin-flights/pipeline/dna.py lines 1–30
  14. Users render · globalgrid2050 / testcode/202609170041-quantum-twin-flights/pipeline/users.mjs lines 1–48
  15. Price History Fullscreen energy-data · globalgrid2050 / uk_energy_tracking_v3/price-history-fullscreen.js lines 1–8

Wider Mobile Actions

A style sheet in the assets folder of GlobalGrid2050.

renderglobalgrid2050 / testcode/202609060349/pipeline/assets/202609060318-wider-mobile-actions.css · lines 1–20 of 20 · version 2026-09-06 03:18 · Entry point

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Downstream impact
Used directly by 1 file: Testcode — Pipeline Page (globalgrid2050, https://globalgrid2050.com/testcode/202609060345/pipeline/). Reached from 20 other entry points, including Homepage V073 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v073.html); Homepage V074 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v074.html); Homepage V075 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v075.html).
What it achieves
The wider-fleet row keeps its existing data and actions, within the phone viewport.
Why it matters
Loaded by the Pipeline page at https://globalgrid2050.com/testcode/202609060345/pipeline/.
Application
globalgrid2050 · testcode/202609060349/pipeline/assets · style sheet
Uses
none found
Used by
loaded by Testcode — Pipeline 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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609060349/pipeline/assets/202609060318-wider-mobile-actions.css:1-20 · blob 0744074f3b521647bf5a211f5d20276f51857a52 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
/* The wider-fleet row keeps its existing data and actions, within the phone viewport. */
@media (max-width: 700px) {
  .tablewrap:has(:is(.wider-fleet-row,[data-project-index])) { overflow-x: hidden; }
  .tablewrap table:has(:is(.wider-fleet-row,[data-project-index])) { display: block; width: 100%; min-width: 0; }
  .tablewrap table:has(:is(.wider-fleet-row,[data-project-index])) thead { display: none; }
  .tablewrap tbody:has(:is(.wider-fleet-row,[data-project-index])) { display: block; width: 100%; }
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; box-sizing: border-box; border-bottom: 1px solid #37404a; padding: 10px 0; }
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) td { display: block; min-width: 0; width: auto; max-width: 100%; box-sizing: border-box; white-space: normal; overflow-wrap: anywhere; border: 0; padding: 5px 8px; }
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) td.hide-mobile { display: none !important; }
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) td.site,
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) td:nth-child(6),
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) td:nth-child(12),
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) td:last-child { grid-column: 1 / -1; }
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) .mobile-extra { display: block !important; }
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) .project-actions { display: flex; flex-wrap: wrap; width: 100%; gap: 8px; }
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) .action-link { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; }
  .tablewrap tr:is(.wider-fleet-row,[data-project-index]) .action-metric { max-width: 100%; white-space: normal; }
}

@media(max-width:700px){.tablewrap .copy-id{min-height:44px}}

Metric Details

A JavaScript module in the assets folder of GlobalGrid2050 covering the Renewable Energy Planning Database (REPD) register. It is built from the install metric details helper (`installMetricDetails`).

renderglobalgrid2050 / testcode/202609060349/pipeline/assets/202609060333-metric-details.mjs · lines 1–22 of 22 · version 2026-09-06 03:33

What it does
It draws the REPD register. Defines installMetricDetails. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: the REPD register.
Downstream impact
Used directly by 1 file: Testcode — Pipeline (globalgrid2050). Reached from 21 other entry points, including Homepage V073 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v073.html); Homepage V074 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v074.html); Homepage V075 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v075.html).
What it achieves
A distance's source and limits must be accessible to touch and keyboard users. It responds to click events.
Why it matters
Imported by Testcode — Pipeline.
Application
globalgrid2050 · testcode/202609060349/pipeline/assets · JavaScript module
Uses
none found
Used by
imported by Testcode — Pipeline (import)
Produces
installMetricDetails
Defines here
installMetricDetails
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609060349/pipeline/assets/202609060333-metric-details.mjs:1-22 · blob 053ec336f709cd80caf030edc1ee7f7f2578a154 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
// A distance's source and limits must be accessible to touch and keyboard users.
export function installMetricDetails() {
  if (document.documentElement.dataset.metricDetailsInstalled) return;
  document.documentElement.dataset.metricDetailsInstalled='true';
  document.addEventListener('click',event=>{
    const trigger=event.target.closest('button[data-repd-metric]');
    if(!trigger)return;
    let dialog=document.getElementById('wider-metric-dialog');
    if(!dialog){
      dialog=document.createElement('dialog');dialog.id='wider-metric-dialog';
      dialog.setAttribute('aria-labelledby','wider-metric-heading');
      dialog.style.cssText='box-sizing:border-box;max-width:92vw;width:480px;max-height:80dvh;overflow:auto;background:#080d13;color:#d8e4ed;border:1px solid #66ccff;padding:20px;font:14px/1.6 monospace';
      const heading=document.createElement('h2');heading.id='wider-metric-heading';heading.style.fontSize='16px';
      const text=document.createElement('p');text.id='wider-metric-explanation';
      const close=document.createElement('button');close.type='button';close.textContent='Close';close.style.cssText='min-width:80px;min-height:44px;background:#111;color:#fff;border:1px solid #777';close.addEventListener('click',()=>dialog.close());
      dialog.append(heading,text,close);document.body.append(dialog);
    }
    dialog.querySelector('h2').textContent=(trigger.dataset.metricKind||trigger.textContent.split(/\s/)[0])+' observation \u00b7 REPD '+trigger.dataset.repdMetric;
    dialog.querySelector('p').textContent=trigger.title;
    dialog.showModal();
  });
}

Apps

A Python module in the pipeline folder of GlobalGrid2050.

storageglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/apps.py · lines 1–32 of 32 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review)

What it does
It loads data. Uses libraries json, glob, os, sys, collections. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
Out: JSON file apps.json.
What it achieves
Step APPS: every app in the estate as a scope on the wafer.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · Python module
Uses
json, glob, os, sys, collections
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/apps.py:1-32 · blob dc971a180a4beab443618086d5ab853c24582b0a · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
"""Step APPS: every app in the estate as a scope on the wafer. An app = a repo with a working index.html
(root or any published folder) and more than 20 numbered lines. Keys come from family places by repo.
Writes apps.json. Deterministic. Counts are memberships (a key may sit in several families and apps)."""
import json, glob, os, sys, collections
STARS = os.environ.get('STARS_CODE', os.path.join(os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub')), r'stars\code'))
GITHUB = os.environ.get('GITHUB_DIR', os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub')))
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
keys = collections.defaultdict(set); fams = collections.Counter(); paths = collections.defaultdict(set)
for f in glob.glob(os.path.join(STARS, 'f', '*.json')):
    for fid, v in json.load(open(f, encoding='utf-8')).items():
        seen = set()
        for pl in v.get('places', []):
            repo = pl.get('repo', '')
            if not repo or repo in seen: continue
            seen.add(repo); keys[repo].update(v.get('lines', [])); fams[repo] += 1; paths[repo].add(pl.get('path', ''))
apps = []
for repo in sorted(keys):
    name = repo.split('/')[-1]; clone = os.path.join(GITHUB, name)
    index = None
    if os.path.isdir(clone):
        for cand in ('index.html', 'atlas/index.html', 'docs/index.html'):
            if os.path.exists(os.path.join(clone, cand)): index = cand; break
        if not index:
            hits = [p for p in paths[repo] if p.endswith('index.html')]
            if hits: index = sorted(hits)[0] + ' (published folder)'
    n = len(keys[repo])
    apps.append({'repo': repo, 'name': name, 'keys': n, 'families': fams[repo], 'index': index, 'cloned': os.path.isdir(clone), 'app': bool(index) and n > 20})
out = {'generated': '2026-09-16', 'rule': 'app = repo with a working index.html and more than 20 numbered lines', 'apps': apps, 'keys': {a['repo']: sorted(keys[a['repo']]) for a in apps if a['app']}}
qualifying = [a for a in apps if a['app']]
if not qualifying: sys.exit('FAIL: no repo qualifies as an app')
json.dump(out, open(os.path.join(ROOT, 'apps.json'), 'w'), separators=(',', ':'))
print(json.dumps({'step': 'apps', 'repos': len(apps), 'apps': len(qualifying), 'largest': max(qualifying, key=lambda a: a['keys'])['name'], 'largest_keys': max(a['keys'] for a in qualifying), 'no_index': [a['name'] for a in apps if not a['app']]}))

Describe

A Python command-line tool in the pipeline folder of GlobalGrid2050 that draws route GridAtlas. It is built from the describe step (`describe`).

renderglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/describe.py · lines 1–41 of 41 · version 2026-09-16 22:00 · Entry point · pattern describe (shared by 57 files)

What it does
It draws route GridAtlas. Defines describe. Uses libraries json, os, re, sys, subprocess. Side effects: changes the web page (DOM); reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: JSON file keys.json; JSON file route-gridatlas.json. Out: JSON file describe.json.
Downstream impact
It is itself an entry point (Python CLI); no other file was found loading it.
What it achieves
Step DESCRIBE: a plain-English note for every atlas line, by fixed rules (no model).
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · Python CLI
Uses
json, os, re, sys, subprocess
Used by
none found
Produces
describe
Defines here
describe
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/describe.py:1-41 · blob f1b2f666616b9a28d66063012d28309298cdcea8 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: experimental · users: none · canonical: production_core
"""Step DESCRIBE: a plain-English note for every atlas line, by fixed rules (no model). Writes describe.json
{key: note}. The same rules live in the pilot (describeLine) so the card and the record agree. Deterministic."""
import json, os, re, sys, subprocess
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
GH = os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub'))
RULES = [
 (r'^\s*$', 'blank line'), (r'^\s*//', 'a comment'), (r'^\s*/\*|^\s*\*', 'a comment block'),
 (r'^\s*(import|export)\b', 'brings code in or out of this file'), (r'^\s*(async\s+)?function\s+(\w+)', 'defines the function {2}'),
 (r'^\s*(const|let|var)\s+(\w+)\s*=\s*(async\s*)?\(?[^=]*=>', 'defines the function {2}'), (r'^\s*(const|let|var)\s+(\w+)\s*=', 'sets {2}'),
 (r'\.addEventListener\(\s*[\'"](\w+)', 'listens for a {1} on the page'), (r'^\s*return\b', 'hands a result back'), (r'^\s*if\b', 'decides: only when the condition holds'),
 (r'^\s*(else|\} else)', 'otherwise'), (r'^\s*for\b|^\s*while\b', 'repeats for each item'), (r'^\s*try\b', 'tries, ready to catch a failure'), (r'^\s*catch\b|\} catch', 'handles a failure'),
 (r'\.(querySelector|getElementById)\(', 'finds a part of the page'), (r'\.innerHTML\s*=|\.textContent\s*=', 'writes text onto the page'), (r'\bfetch\(', 'asks a server for data'),
 (r'\bclassList\.', 'changes how a part of the page looks'), (r'\bconsole\.', 'writes to the developer console'), (r'\bthrow\b', 'stops with an error'),
 (r'^\s*\}\s*\)?;?\s*$|^\s*\]\s*;?\s*$', 'closes a block'), (r'^\s*(\w+)\s*\(.*\)\s*;?\s*$', 'calls {1}'), (r'\bawait\b', 'waits for a result'), (r'=', 'sets a value'),
]
def describe(line):
    for pat, note in RULES:
        m = re.search(pat, line)
        if m:
            try: return note.format(*m.groups())
            except Exception: return note
    return 'a line of code'
if __name__ == '__main__':
    K = json.load(open(os.path.join(ROOT, 'keys.json'), encoding='utf-8'))
    R = json.load(open(os.path.join(ROOT, 'route-gridatlas.json'), encoding='utf-8'))
    want = set(R['keys']); out = {}; cache = {}; missing = 0
    for i, k in enumerate(K['keys']):
        if k not in want: continue
        pl = K['places'][K['place'][i]]; repo, commit, path = pl; ln = K['line'][i]; clone = os.path.join(GH, repo.split('/')[1])
        ck = (repo, commit, path)
        if ck not in cache:
            r = subprocess.run(['git', '-C', clone, 'show', f'{commit}:{path}'], capture_output=True)
            cache[ck] = r.stdout.decode('utf-8', 'replace').split('\n') if r.returncode == 0 else None
        lines = cache[ck]
        if not lines or ln > len(lines): missing += 1; continue
        out[str(k)] = describe(lines[ln - 1])
    if not out: sys.exit('FAIL: nothing described')
    json.dump({'rule_count': len(RULES), 'described': len(out), 'missing': missing, 'notes': out}, open(os.path.join(ROOT, 'describe.json'), 'w'), separators=(',', ':'))
    kinds = {}
    for v in out.values(): kinds[v.split(' ')[0]] = kinds.get(v.split(' ')[0], 0) + 1
    print(json.dumps({'step': 'describe', 'described': len(out), 'missing': missing, 'top': sorted(kinds.items(), key=lambda x: -x[1])[:6]}))

Entangle

A Python module in the pipeline folder of GlobalGrid2050.

storageglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/entangle.py · lines 1–36 of 36 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review)

What it does
It loads data. Uses libraries json, os, sys, subprocess, hashlib. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: JSON file keys.json. Out: JSON file entangle.json.
What it achieves
Step ENTANGLE: is every code block on the wafer still coupled to its twin?
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · Python module
Uses
json, os, sys, subprocess, hashlib, collections, time, re
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/entangle.py:1-36 · blob 9c1b51f4ad621d7920152cac6454f19f9543fb61 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
"""Step ENTANGLE: is every code block on the wafer still coupled to its twin?
For each key: twin = (repo, commit, path, line). Fetch that exact line from the local clone at that commit,
hash it, and record whether the pair holds. A pair is BROKEN if the clone lacks the commit/path or the line
does not exist. Deterministic; writes entangle.json. Reads nothing but git objects and keys.json."""
import json, os, sys, subprocess, hashlib, collections, time, re
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
GITHUB = os.environ.get('GITHUB_DIR', os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub')))
K = json.load(open(os.path.join(ROOT, 'keys.json'), encoding='utf-8'))
by_place = collections.defaultdict(list)
for i, pi in enumerate(K['place']):
    if pi is not None and pi >= 0: by_place[pi].append(i)
t0 = time.time(); hashes = [None] * len(K['keys']); broken = []; reasons = collections.Counter(); per_repo = collections.defaultdict(lambda: [0, 0])
for pi, idxs in by_place.items():
    repo, commit, path = K['places'][pi]; clone = os.path.join(GITHUB, repo.split('/')[1])
    text = None; reason = None
    if not os.path.isdir(clone): reason = 'no local clone'
    else:
        if not re.fullmatch(r'[0-9a-f]{7,40}', str(commit)) or str(path).startswith('-'): r = None
        else: r = subprocess.run(['git', '-C', clone, 'show', f'{commit}:{path}'], capture_output=True)
        if r is not None and r.returncode == 0:
            text = r.stdout.decode('utf-8', 'replace').split('\n')
            if text and text[-1] == '': text.pop()
        else: reason = 'commit or path missing in clone'
    for i in idxs:
        per_repo[repo][0] += 1; ln = K['line'][i]
        if text is None: broken.append(K['keys'][i]); reasons[reason] += 1; continue
        if not ln or ln > len(text): broken.append(K['keys'][i]); reasons['line beyond file end'] += 1; continue
        hashes[i] = hashlib.sha1(text[ln - 1].strip().encode('utf-8')).hexdigest()[:10]; per_repo[repo][1] += 1
resolved = sum(1 for h in hashes if h)
out = {'generated_utc': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()), 'keys': len(K['keys']), 'places': len(by_place), 'resolved': resolved, 'broken': len(broken),
       'rate': round(resolved / len(K['keys']), 5), 'reasons': dict(reasons), 'per_repo': {r: {'keys': v[0], 'resolved': v[1]} for r, v in sorted(per_repo.items())},
       'broken_keys': broken, 'hash': hashes}
if out['rate'] < 0.95: print(json.dumps({'step': 'entangle', 'rate': out['rate'], 'broken': len(broken), 'reasons': dict(reasons)})); sys.exit('FAIL: fewer than 95% of pairs hold; entangle.json not written')
json.dump(out, open(os.path.join(ROOT, 'entangle.json'), 'w'), separators=(',', ':'))
print(json.dumps({'step': 'entangle', 'keys': len(K['keys']), 'places': len(by_place), 'resolved': resolved, 'broken': len(broken), 'rate': out['rate'], 'reasons': dict(reasons), 'seconds': round(time.time() - t0, 1)}))
if resolved == 0: sys.exit('FAIL: no twin could be reached')

Hundred

A JavaScript module in the pipeline folder of GlobalGrid2050 that fetches route GridAtlas, entangle, routes and engine route.

renderglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/hundred.mjs · lines 1–84 of 84 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review)

What it does
It fetches route GridAtlas, entangle, routes and engine route. Defines near, post, engine, P. Uses libraries node:fs, node:http. Side effects: changes the web page (DOM); reads or writes files; makes network requests; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: 400V.
Inputs & outputs
In: JSON file keys.json; JSON file route-gridatlas.json; JSON file entangle.json; JSON file routes.json; JSON file engine-route.json; JSON file apps.json; JSON file qubit.json; JSON file all-lines.meta.json. Voltage levels named: 400V.
What it achieves
It is built from the near step (`near`), the post step (`post`) and the engine step (`engine`). 7–10 run in Chrome in front of Vikram through window.__probe / window.__pilot (see hundred-browser list at the end). Its code works with 10 MW and 100 kVA.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · JavaScript module
Uses
node:fs, node:http
Used by
none found
Produces
near, post, engine, P
Defines here
near, post, engine, P
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/hundred.mjs:1-84 · blob c4bb9ce5e50810362d124a9c0774d2db4e27856c · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, network, process · domain stage: experimental · users: none · canonical: unreached_review
// THE HUNDRED: ten families of ten, fastest first, all against real app code. Families 1–6 run here (machine);
// 7–10 run in Chrome in front of Vikram through window.__probe / window.__pilot (see hundred-browser list at the end).
// Every test can fail. None reads its own comments. One line per test. usage: node pipeline/hundred.mjs
import fs from 'node:fs'; import path from 'node:path'; import { spawnSync } from 'node:child_process'; import { fileURLToPath } from 'node:url';
const HERE = path.dirname(path.dirname(fileURLToPath(import.meta.url))); const J = f => JSON.parse(fs.readFileSync(path.join(HERE, f), 'utf8'));
const SRV = 'http://127.0.0.1:8791'; const results = []; let n = 0;
async function t(family, name, fn) { n++; const t0 = performance.now(); let ok = false, note = ''; try { const r = await fn(); ok = r === true || (r && r.ok === true); note = (r && r.note) || ''; } catch (e) { note = e.message; } const ms = (performance.now() - t0).toFixed(0); const line = `${String(n).padStart(3)} ${ok ? 'PASS' : 'FAIL'} ${String(ms).padStart(5)}ms ${family} · ${name}${note ? ' ·  … [line shortened here: 492 characters; full line on GitHub]
const near = (a, b, tol) => Math.abs(a - b) <= tol;
const post = async (p, body) => { const r = await fetch(SRV + p, { method: 'POST', body: JSON.stringify(body) }); return { status: r.status, json: await r.json().catch(() => null) }; };
const engine = async (module, fn, args) => post('/engine/run', { module, fn, args });

// 1 · keys
const K = J('keys.json'); const fam = J('route-gridatlas.json'); const E = J('entangle.json'); const R = J('routes.json'); const ER = J('engine-route.json'); const A = J('apps.json'); const Q = J('qubit.json');
await t('keys', 'count is 128,369', () => K.count === 128369 && K.keys.length === 128369);
await t('keys', 'no duplicate key', () => new Set(K.keys).size === K.keys.length);
await t('keys', 'max key ≤ 342,795', () => K.max_key <= 342795);
await t('keys', 'every key is a positive integer', () => K.keys.every(k => Number.isInteger(k) && k > 0));
await t('keys', 'every place index valid', () => K.place.every(p => p >= 0 && p < K.places.length));
await t('keys', 'every line ≥ 1', () => K.line.every(l => l >= 1));
await t('keys', 'every name index valid or -1', () => K.name.every(i => i === -1 || (i >= 0 && i < K.names.length)));
await t('keys', 'every family id has an atom', () => { const miss = K.family.filter(f => !Q.atoms[String(f)]).length; return { ok: miss === 0, note: `${miss} keys without atom` }; });
await t('keys', 'keys.json under 12 MB', () => fs.statSync(path.join(HERE, 'keys.json')).size < 12e6);
await t('keys', 'places count 1,736', () => K.places.length === 1736);
// 2 · engine
await t('engine', 'voltageDropVolts 120A 250m 0.32 pf0.95 = 15.796', async () => { const r = await engine('voltage-drop', 'voltageDropVolts', { currentA: 120, lengthM: 250, resistanceOhmPerKm: 0.32, powerFactor: 0.95, phases: 'three' }); return near(r.json?.result?.value, 15.796, 0.001); });
await t('engine', 'missing powerFactor is refused', async () => (await engine('voltage-drop', 'voltageDropVolts', { currentA: 120, lengthM: 250, resistanceOhmPerKm: 0.32 })).status === 422);
await t('engine', 'powerFactor 1.2 is refused', async () => (await engine('voltage-drop', 'voltageDropVolts', { currentA: 120, lengthM: 250, resistanceOhmPerKm: 0.32, powerFactor: 1.2 })).status === 422);
await t('engine', 'negative length is refused', async () => (await engine('voltage-drop', 'voltageDropVolts', { currentA: 120, lengthM: -5, resistanceOhmPerKm: 0.32, powerFactor: 0.9 })).status === 422);
await t('engine', 'dropPercent(15.796, 400) = 3.95', async () => { const r = await engine('voltage-drop', 'dropPercent', { dropVolts: 15.796, nominalVolts: 400 }); const v = r.json?.result?.value ?? r.json?.result?.percent ?? r.json?.result; return { ok: near(+v, 3.949, 0.01), note: String(JSON.stringify(r.json?.result)).slice(0, 60) }; });
await t('engine', 'lossesWatts finite', async () => { const r = await engine('voltage-drop', 'lossesWatts', { currentA: 120, lengthM: 250, resistanceOhmPerKm: 0.32, phases: 'three' }); return Number.isFinite(r.json?.result?.value); });
await t('engine', 'diversifiedDemandKw(900, 3, 0.4) = 1080', async () => near((await engine('diversified-demand', 'diversifiedDemandKw', { unitCount: 900, perUnitKw: 3, coincidenceFactor: 0.4 })).json?.result?.value, 1080, 0.001));
await t('engine', 'currentA(100 kVA, 400 V, three) ≈ 144.3', async () => { const r = await engine('current-from-power', 'currentA', { apparentPowerVa: 100000, voltageV: 400, phases: 'three' }); return near(r.json?.result?.value, 144.34, 0.1); });
await t('engine', 'apparentPowerMva(10 MW, 0.9) ≈ 11.11', async () => near((await engine('firm-capacity', 'apparentPowerMva', { mw: 10, powerFactor: 0.9 })).json?.result?.value, 11.111, 0.01));
await t('engine', 'unknown function returns the list', async () => { const r = await engine('voltage-drop', 'nope', {}); return r.status === 404 && Array.isArray(r.json?.functions); });
// 3 · routes
await t('routes', 'atlas unique keys 10,415', () => fam.keys.length === 10415);
await t('routes', 'atlas families 357', () => fam.families.length === 357);
await t('routes', 'five atlas files carry keys (4 cartridges + atlas index.html)', () => Object.keys(fam.files).length === 5 && Object.values(fam.files).every(f => f.keys.length > 0));
await t('routes', 'every atlas key is on the wafer', () => { const s = new Set(K.keys); return fam.keys.every(k => s.has(k)); });
await t('routes', 'per-file sums exceed unique by 207 (shared)', () => Object.values(fam.files).reduce((a, f) => a + f.keys.length, 0) - fam.keys.length === 207);
await t('routes', 'engine modules on wafer 15 of 22', () => Object.keys(ER.modules).length === 22 && Object.values(ER.modules).filter(m => m.keys.length).length === 15);
await t('routes', 'the 7 missing are named', () => Object.entries(ER.modules).filter(([, m]) => !m.keys.length).map(([k]) => k).sort().join() === ['compute-observer', 'corridor-estimate', 'current-from-power', 'electrical-distance', 'electrification-model', 'rating-envelope', 'v9-geodesy'].join());
await t('routes', '84 versions, all with keys', () => R.versions.length === 84 && R.versions.every(v => v.keys > 0));
await t('routes', '19 apps qualify', () => A.apps.filter(a => a.app).length === 19);
await t('routes', 'pipelinenews flagged as no index', () => A.apps.find(a => a.name === 'pipelinenews')?.app === false);
// 4 · twin
await t('twin', 'entangle rate 1.0', () => E.rate === 1);
await t('twin', '1,736 places', () => E.places === 1736);
await t('twin', 'zero broken', () => E.broken === 0 && E.broken_keys.length === 0);
await t('twin', 'per-repo resolved = keys', () => Object.values(E.per_repo).every(r => r.keys === r.resolved));
await t('twin', 'every hash is 10 hex', () => E.hash.every(h => /^[0-9a-f]{10}$/.test(h)));
await t('twin', 'key 39885 reads event.stopPropagation();', async () => { const r = await (await fetch(SRV + '/line?key=39885')).json(); return { ok: (r.text || '').trim() === 'event.stopPropagation();', note: (r.text || '').trim().slice(0, 40) }; });
await t('twin', 'lowest key (2) reads a real line', async () => { const lowest = K.keys.reduce((a, b) => a < b ? a : b); const r = await (await fetch(SRV + '/line?key=' + lowest)).json(); return { ok: typeof r.text === 'string', note: r.text === '' ? 'line 130 is an empty line, which is a real line' : '' }; });
await t('twin', 'commit hashes are hex', () => K.places.every(p => /^[0-9a-f]{7,40}$/.test(String(p[1]))));
await t('twin', 'no path starts with "-"', () => K.places.every(p => !String(p[2]).startsWith('-')));
await t('twin', 'unknown key → 404', async () => (await fetch(SRV + '/line?key=999999999')).status === 404);
// 5 · server
await t('server', 'foreign Origin → 403', async () => (await fetch(SRV + '/gpu', { headers: { origin: 'https://evil.example' } })).status === 403);
await t('server', 'wrong Host → 403', () => new Promise(res => { import('node:http').then(h => { const q = h.request({ host: '127.0.0.1', port: 8791, path: '/gpu', headers: { Host: 'evil.example' } }, r => res(r.statusCode === 403)); q.on('error', () => res(false)); q.end(); }); }));
await t('server', '70 KB body refused', async () => { const r = await post('/signal', { pad: 'x'.repeat(70000) }); return r.status >= 400; });
await t('server', 'bad JSON body refused', async () => (await fetch(SRV + '/engine/run', { method: 'POST', body: '{nope' })).status >= 400);
await t('server', 'unknown module → 404', async () => (await engine('no-such', 'f', {})).status === 404);
await t('server', 'module name with path chars refused', async () => (await engine('../serve', 'f', {})).status === 400);
await t('server', '/engine/list has 22', async () => Object.keys(await (await fetch(SRV + '/engine/list')).json()).length === 22);
await t('server', '/gpu names the card', async () => /RTX/.test((await (await fetch(SRV + '/gpu')).json()).name || ''));
await t('server', '/wafer/ serves the Line Wafer', async () => /THE LINE WAFER/.test(await (await fetch(SRV + '/wafer/')).text()));
await t('server', 'wafer database reachable', async () => (await fetch(SRV + '/testcode/202609142202/data/all-lines.meta.json')).status === 200);
// 6 · planner
const { plan } = await import('file://' + path.join(HERE, 'pilot-rules.js')); const ctx = { appNames: A.apps.filter(a => a.app).map(a => a.name), dies: ['sld-sandbox', 'substation-intelligence', 'place-global-search', 'streaming-parquet-bridge'] };
const P = s => plan(s, ctx).commands;
await t('planner', 'voltage drop sentence → engine call', () => P('voltage drop for 120 amps over 250 metres at 0.32 ohm per km pf 0.95 three phase')[0]?.startsWith('run voltage-drop.voltageDropVolts'));
await t('planner', 'missing pf → refused with names', () => plan('voltage drop for 120 amps over 250 metres at 0.32 ohm', ctx).commands.length === 0);
await t('planner', 'houses sentence → diversified demand', () => P('diversified demand for 900 houses at 3 kw each coincidence 0.4')[0]?.startsWith('run diversified-demand'));
await t('planner', 'substation + floorplan', () => P('show me the substation die arranged as a cpu floorplan').join() === 'die substation,arrange floorplan');
await t('planner', 'plasma', () => P('send a plasma through my apps').includes('plasma'));
await t('planner', 'lightning gridatlas', () => P('lightning through gridatlas')[0] === 'lightning gridatlas');
await t('planner', 'read 39885', () => P('read 39885').includes('read 39885'));
await t('planner', 'versions', () => P('show me the versions').includes('versions'));
await t('planner', 'seed keeps the words', () => P('seed milky way')[0] === 'seed milky way');
await t('planner', 'nonsense → no command', () => P('purple monkey dishwasher').length === 0);

const pass = results.filter(r => r.ok).length; const out = path.join(HERE, 'probe', `HUNDRED-${new Date().toISOString().replace(/[-:]/g, '').slice(0, 15)}.json`); fs.mkdirSync(path.dirname(out), { recursive: true });
fs.writeFileSync(out, JSON.stringify({ machine: results, pass, total: results.length, browser_pending: 40 }, null, 1));
console.log(`\nmachine families 1–6: ${pass}/${results.length} pass · ${out}`); if (pass !== results.length) process.exitCode = 1;

Journey

A JavaScript module in the pipeline folder of GlobalGrid2050 that reads inputs for pin. It is built from the type step (`type`).

renderglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/journey.mjs · lines 1–17 of 17 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review)

What it does
Defines type. Uses libraries puppeteer-core. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: command-line arguments.
What it achieves
Space → earth → space, four times, in a full-screen Chrome a person can watch.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · JavaScript module
Uses
puppeteer-core
Used by
none found
Produces
type
Defines here
type
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/journey.mjs:1-17 · blob 144fc8edb372a6567c0412ba38525e3c840b6d64 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: unreached_review
// JOURNEY: space → earth → space, four times, in a full-screen Chrome a person can watch. usage: node pipeline/journey.mjs [url]
import puppeteer from 'puppeteer-core';
const URL = process.argv[2] || 'http://127.0.0.1:8791/wafer/'; const CHROME = process.env.CHROME || 'C:/Program Files/Google/Chrome/Application/chrome.exe';
const STOPS = [['land gridatlas', 'gridatlas'], ['land pipelinenews', 'pipelinenews'], ['land spider sandbox', 'spider sandbox'], ['land periodic table', 'periodic table']];
const browser = await puppeteer.launch({ executablePath: CHROME, headless: false, defaultViewport: null, args: ['--start-maximized', '--ignore-gpu-blocklist'] });
let pass = 0, n = 0;
try {
  const page = await browser.newPage(); await page.goto(URL, { waitUntil: 'networkidle0', timeout: 90000 }); await page.waitForSelector('#pin'); await new Promise(r => setTimeout(r, 2500));
  const type = async s => { await page.click('#pin'); await page.evaluate(() => { document.getElementById('pin').value = ''; }); await page.type('#pin', s, { delay: 35 }); await page.keyboard.press('Enter'); };
  for (const [cmd, name] of STOPS) {
    await type(cmd); await new Promise(r => setTimeout(r, 6000)); const e = await page.evaluate(() => window.__earth()); n++;
    const ok1 = e.open && e.name.includes(name) && e.src.startsWith('http'); if (ok1) pass++; console.log(`${ok1 ? 'PASS' : 'FAIL'} ${cmd} → earth open=${e.open} ${e.name}`);
    await type('space'); await new Promise(r => setTimeout(r, 2500)); const e2 = await page.evaluate(() => window.__earth()); n++;
    const ok2 = !e2.open; if (ok2) pass++; console.log(`${ok2 ? 'PASS' : 'FAIL'} back to space → earth open=${e2.open}`);
  }
} finally { await browser.close(); }
console.log(`journey: ${pass}/${n} · ${URL}`); if (pass !== n) process.exitCode = 1;

Keys

A Python module in the pipeline folder of GlobalGrid2050 that reads particles.

storageglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/keys.py · lines 1–14 of 14 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review)

What it does
It loads particles. Uses libraries json, glob, os, sys. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: JSON file keys.json; JSON file particles.json. Out: JSON file.
What it achieves
Step KEYS: export the wafer's resolvable particles (key, place, name, line) to `keys.json`.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · Python module
Uses
json, glob, os, sys
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/keys.py:1-14 · blob 5abc3e00a5076cc9ef3a9baa2353ffd32a9a4ccc · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
"""Step KEYS: export the wafer's resolvable particles (key, place, name, line) to keys.json. Deterministic."""
import json, glob, os, sys
WAFER = os.environ.get('WAFER_DIR', os.path.join(os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub')), r'globalgrid2050\testcode\202609160224'))
OUT = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'keys.json')
keys, place, name, line, family = [], [], [], [], []
files = sorted(glob.glob(os.path.join(WAFER, 'p', '*.json')), key=lambda s: int(os.path.basename(s)[:-5]))
if not files: sys.exit(f'FAIL: no particle buckets under {WAFER}')
for f in files:
    d = json.load(open(f, encoding='utf-8')); keys += d['key']; place += d['place']; name += d['name_of']; line += d['line']; family += d['family']
top = json.load(open(os.path.join(WAFER, 'particles.json'), encoding='utf-8'))
if len(keys) != len(set(keys)): sys.exit('FAIL: duplicate keys on the wafer')
json.dump({'law': top['law'], 'max_key': max(keys), 'count': len(keys), 'keys': keys, 'place': place, 'name': name, 'line': line, 'family': family,
           'places': top['places'], 'names': top['names']}, open(OUT, 'w'), separators=(',', ':'))
print(json.dumps({'step': 'keys', 'particles': len(keys), 'max_key': max(keys)}))

Label

A Python module in the pipeline folder of GlobalGrid2050 that reads labels, cables, solar and interconnectors. It is built from the evidence step (`evidence`).

storageglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/label.py · lines 1–58 of 58 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review) · pattern evidence (shared by 6 files)

What it does
It loads labels, cables, solar and interconnectors. Defines evidence. Uses libraries json, os, sys. Side effects: reads or writes files; starts processes; uses storage (browser storage, DuckDB or Parquet).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: cables, solar, interconnectors.
Inputs & outputs
In: JSON file apps.json. Out: JSON file labels.json.
What it achieves
Step LABEL: what each app IS, in plain British English, so a person learns the kinds by looking: an engine (pure calculations, no screen), a website, an API (data for other programs), a calculator, a dictionary, a catalogue, rules.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · Python module
Uses
json, os, sys
Used by
none found
Produces
evidence
Defines here
evidence
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/label.py:1-58 · blob 4bea45dd9737fd9a77caaee350f912924b39d8c6 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process, storage · domain stage: experimental · users: none · canonical: unreached_review
"""Step LABEL: what each app IS, in plain British English, so a person learns the kinds by looking:
an engine (pure calculations, no screen), a website, an API (data for other programs), a calculator, a dictionary,
a catalogue, rules, reports, notes, or just HTML with nothing to see. Known apps are labelled by hand; unknown ones
by simple evidence (what files the clone holds). Writes labels.json. Deterministic."""
import json, os, sys
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
GH = os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub'))
KNOWN = {
 'gridatlas': ('website', 'the map of the GB grid: substations, lines, projects, with tools on top'),
 'globalgrid2050': ('website', 'the home page: mission, atlas, engine, test pages, all in one place'),
 'pipelinenews': ('website', 'news on grid and renewable projects, updated as they move'),
 'ventus-grid-engine': ('engine', 'pure calculations for connections, cables and demand; no screen of its own'),
 'cable-trench-or-drill': ('calculator', 'works out whether a cable route should be trenched or drilled'),
 'grid-distance-maths': ('engine', 'the maths of distance on the earth, used by the atlas'),
 'cvaa': ('rules', 'checks that other code must pass before it is trusted; a vaccine against old mistakes'),
 'stars': ('reports', 'daily summaries of test results across the estate'),
 'star-solar-star': ('reports', 'a daily record of GB solar output and projects'),
 'star-sector-star': ('reports', 'market sizing by sector, aggregates only'),
 'star-electron-star': ('website', 'this page: the wafer with a command box on top'),
 'star-quantum-twin': ('website', 'the quantum twin star: every block as a two-state atom'),
 'elements': ('catalogue', 'every element, app, surface and function with a permanent key'),
 'grid-dictionary': ('dictionary', 'grid terms A to Z, tied to the code that uses them'),
 'code-generator': ('tool', 'writes new apps from work orders'),
 'testcode': ('laboratory', 'test pages, one folder per experiment'),
 'galaxies-wafers': ('website', 'maps of all our code, drawn as galaxies and wafers'),
 'spiders': ('maps', 'dead ends in the code, hunted and explained'),
 'control-pad': ('tool', 'a control surface for the estate'),
 'data-grid-gb': ('data', 'connection points and grid data for GB; an API of files'),
 'data-gridatlas': ('data', 'the atlas\'s own data files'), 'data-interconnectors': ('data', 'interconnector records'),
 'data-gb-electricity': ('data', 'GB electricity records'), 'data-centres-gb': ('data', 'data centres in GB'),
 'companies': ('data', 'company records used for market sizing'), 'claude': ('notes', 'working notes from the AI sessions'),
 'registry_of_all_content_in_repos_and_dependencies': ('catalogue', 'what every repository contains and depends on'),
 'reports': ('reports', 'written reports'), 'teleprinter': ('tool', 'prints a page\'s source as one record'),
 'layout-tool': ('calculator', 'lays out equipment on a site'), 'gpu-drivers-for-global-grid': ('notes', 'graphics driver notes for the machines'),
 'linux-for-the-power-grid': ('notes', 'operating system notes for grid machines'), 'gridmachine1': ('notes', 'a machine\'s own notes'), 'gemini': ('notes', 'transcripts with another AI'),
 'chatgpt-audits': ('notes', 'audits written by another AI'),
}
def evidence(name):
    clone = os.path.join(GH, name)
    if not os.path.isdir(clone): return ('unknown', 'no local copy to look at')
    files = set(os.listdir(clone)); js = any(f.endswith(('.js', '.mjs')) for f in files); html = 'index.html' in files; data = any(f.endswith(('.json', '.csv', '.parquet')) for f in files)
    if html and js: return ('website', 'a page with code behind it')
    if html: return ('html', 'just HTML: nothing to see here beyond the page itself')
    if js: return ('engine', 'code with no page of its own')
    if data: return ('data', 'files of data, no page')
    return ('notes', 'text only')
A = json.load(open(os.path.join(ROOT, 'apps.json'), encoding='utf-8'))
labels = {}
for a in A['apps']:
    kind, what = KNOWN.get(a['name'], evidence(a['name']))
    labels[a['name']] = {'kind': kind, 'what': what, 'blocks': a['keys'], 'app': a['app']}
KINDS = {'engine': 'an engine: calculations with no screen', 'website': 'a website: pages people open', 'api': 'an API: data for other programs', 'calculator': 'a calculator: numbers in, an answer out', 'dictionary': 'a dictionary', 'catalogue': 'a catalogue', 'rules': 'rules that code must pass', 'reports': 'reports built on a schedule', 'notes': 'notes: words, not code', 'html': 'just HTML: noth  … [line shortened here: 548 characters; full line on GitHub]
out = {'kinds': KINDS, 'labels': labels, 'english': 'British'}
if not labels: sys.exit('FAIL: no apps to label')
json.dump(out, open(os.path.join(ROOT, 'labels.json'), 'w'), separators=(',', ':'))
counts = {}
for v in labels.values(): counts[v['kind']] = counts.get(v['kind'], 0) + 1
print(json.dumps({'step': 'label', 'apps': len(labels), 'kinds': counts}))

Probe

A JavaScript module in the pipeline folder of GlobalGrid2050.

renderglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/probe.mjs · lines 1–27 of 27 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review)

What it does
Uses libraries puppeteer-core, node:fs, node:url. Side effects: changes the web page (DOM); reads or writes files.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: command-line arguments.
What it achieves
Step PROBE: open the supernova in a real, visible Chrome on this machine's GPU, run a pilot command, read the pixels back, and FAIL unless GridAtlas particles were actually drawn.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · JavaScript module
Uses
puppeteer-core, node:fs, node:url
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/probe.mjs:1-27 · blob 9aaaa0778dbe80d130b431cf51a020d690bbbc5e · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: experimental · users: none · canonical: unreached_review
// Step PROBE: open the supernova in a real, visible Chrome on this machine's GPU, run a pilot command,
// read the pixels back, and FAIL unless GridAtlas particles were actually drawn.
// usage: node pipeline/probe.mjs "light atlas"
import puppeteer from 'puppeteer-core';
import fs from 'node:fs'; import path from 'node:path';
import { fileURLToPath } from 'node:url';
const HERE = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
const command = process.argv[2] || 'light atlas';
const CHROME = process.env.CHROME || '<chrome.exe>';
const URL = process.env.CONSOLE || 'http://127.0.0.1:8791';
const outDir = path.join(HERE, 'probe'); fs.mkdirSync(outDir, { recursive: true });
const stamp = new Date().toISOString().replace(/[-:]/g, '').slice(0, 15);

const browser = await puppeteer.launch({ executablePath: CHROME, headless: false, args: ['--window-size=1200,900', '--ignore-gpu-blocklist'] });
try {
  const page = await browser.newPage(); await page.setViewport({ width: 1200, height: 850 });
  const gpu = await (await browser.newPage()).goto('chrome://gpu').then(async p => { const t = await p.evaluate(() => document.body.innerText); return /WebGL2?:\s*(\S+)/.exec(t)?.[1] || 'unknown'; }).catch(() => 'unknown');
  await page.goto(`${URL}/supernova.html`, { waitUntil: 'networkidle0', timeout: 60000 });
  await page.waitForFunction(() => typeof window.__probe === 'function');
  const r = await page.evaluate(c => window.__probe(c), command);
  const shot = path.join(outDir, `${stamp}-${command.replace(/\W+/g, '_')}.png`);
  await page.screenshot({ path: shot });
  const result = { step: 'probe', command, webgl: gpu, ...r, screenshot: shot, pass: r.amber_pixels > 500 && r.lit_keys > 0 };
  fs.writeFileSync(path.join(outDir, `${stamp}-result.json`), JSON.stringify(result, null, 1));
  console.log(JSON.stringify(result));
  if (!result.pass) { console.error('FAIL: nothing lit — the picture is blank or the route is empty'); process.exitCode = 1; }
} finally { await browser.close(); }

Qubit

A Python module in the pipeline folder of GlobalGrid2050 that reads electron.

storageglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/qubit.py · lines 1–28 of 28 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review)

What it does
It loads electron. Uses libraries json, glob, os, sys, collections. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: JSON file electron.json. Out: JSON file qubit.json.
What it achieves
Step QUBIT: every family as an atom with shells K (same file), L (same repository), M (other repositories), so every key can be a qubit: sin^2(theta/2) = `M/`(K+L+M) = P(AWAY), the chance the next caller sits in another repository.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · Python module
Uses
json, glob, os, sys, collections
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/qubit.py:1-28 · blob a5a21783add254796f005a599843310f8a5ecaf0 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
"""Step QUBIT: every family as an atom with shells K (same file), L (same repository), M (other repositories),
so every key can be a qubit: sin^2(theta/2) = M/(K+L+M) = P(AWAY), the chance the next caller sits in another repository.
Shipped atoms (testcode/202609142202/data/electron.json, 500 of 7,607) are used verbatim; the rest are derived from
family places by the same rule and marked derived. Deterministic; writes qubit.json."""
import json, glob, os, sys, collections
STARS = os.environ.get('STARS_CODE', os.path.join(os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub')), r'stars\code'))
QT = os.environ.get('QT_DIR', os.path.join(os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub')), r'globalgrid2050\testcode\202609142202\data'))
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
shipped = {}
try:
    for a in json.load(open(os.path.join(QT, 'electron.json'), encoding='utf-8'))['atoms']:
        shipped[str(a['n'])] = {'K': a['shells']['K'], 'L': a['shells']['L'], 'M': a['shells']['M'], 'name': a['name'], 'class': a.get('class'), 'spin': a.get('spin'), 'valence': a.get('valence'), 'homes': a.get('homes'), 'source': 'electron.json'}
except Exception as e: print('no electron.json:', e)
atoms = {}; n_derived = 0
for f in glob.glob(os.path.join(STARS, 'f', '*.json')):
    for fid, v in json.load(open(f, encoding='utf-8')).items():
        if fid in shipped: atoms[fid] = shipped[fid]; continue
        places = v.get('places', [])
        if not places: continue
        home_repo = places[0].get('repo', ''); home_file = os.path.basename(places[0].get('path', ''))
        K = sum(1 for p in places if p.get('repo') == home_repo and os.path.basename(p.get('path', '')) == home_file)
        L = sum(1 for p in places if p.get('repo') == home_repo and os.path.basename(p.get('path', '')) != home_file)
        M = sum(1 for p in places if p.get('repo') != home_repo)
        atoms[fid] = {'K': K, 'L': L, 'M': M, 'name': (v.get('names') or [''])[0], 'homes': sorted({p.get('repo', '').split('/')[-1] for p in places}), 'source': 'derived from places'}; n_derived += 1
out = {'rule': 'P(AWAY) = M/(K+L+M): K same file, L same repository, M other repositories', 'shipped': len([a for a in atoms.values() if a['source'] == 'electron.json']), 'derived': n_derived, 'atoms': atoms}
if not atoms: sys.exit('FAIL: no atoms')
json.dump(out, open(os.path.join(ROOT, 'qubit.json'), 'w'), separators=(',', ':'))
print(json.dumps({'step': 'qubit', 'atoms': len(atoms), 'shipped': out['shipped'], 'derived': n_derived}))

Snapshot

A JavaScript module in the pipeline folder of GlobalGrid2050 that reads route GridAtlas and routes, using SHA-256.

storageglobalgrid2050 / testcode/202609162200-quantum-twin-flights/pipeline/snapshot.mjs · lines 1–35 of 35 · version 2026-09-16 22:00 · Not reached from any entry point (candidate for review) · pattern stamp (shared by 31 files)

What it does
It loads route GridAtlas and routes. Defines stamp, sha, walk, git. Uses libraries node:fs, node:child_process. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: JSON file route-gridatlas.json; JSON file routes.json; JSON file keys.json; JSON file index.json; command-line arguments.
What it achieves
It is built from the stamp step (`stamp`), the sha step (`sha`) and the walk step (`walk`). Version control for CPU WORLD, two layers: 1. git: every snapshot is a local commit (never pushed from here).
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609162200-quantum-twin-flights/pipeline · JavaScript module
Uses
node:fs, node:child_process
Used by
none found
Produces
stamp, sha, walk, git
Defines here
stamp, sha, walk, git
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609162200-quantum-twin-flights/pipeline/snapshot.mjs:1-35 · blob 069686089b13fd99f798eddd1b5a0825d2a303a0 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
// Version control for CPU WORLD, two layers:
//  1. git: every snapshot is a local commit (never pushed from here).
//  2. versions/<UTC stamp>/ : a stamped copy of the state files with SHA-256 of each, restorable.
// usage: node pipeline/snapshot.mjs snapshot "what changed"   |   node pipeline/snapshot.mjs list   |   node pipeline/snapshot.mjs restore 20260916T2045
import fs from 'node:fs'; import path from 'node:path'; import crypto from 'node:crypto';
import { execFileSync } from 'node:child_process'; import { fileURLToPath } from 'node:url';
const HERE = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
const STATE = ['console.html', 'supernova.html', 'serve.mjs', 'route-gridatlas.json', 'routes.json', 'keys.json', 'files/index.json', 'pipeline', 'reviews', 'probe', 'harness'];
const [cmd = 'list', ...rest] = process.argv.slice(2);
const stamp = () => new Date().toISOString().replace(/[-:]/g, '').replace(/\.\d+Z$/, 'Z');
const sha = f => crypto.createHash('sha256').update(fs.readFileSync(f)).digest('hex');
const walk = (p, out = []) => { const s = fs.statSync(p); if (s.isDirectory()) fs.readdirSync(p).forEach(n => walk(path.join(p, n), out)); else out.push(p); return out; };
const git = (...a) => { try { return execFileSync('git', a, { cwd: HERE, encoding: 'utf8', windowsHide: true }).trim(); } catch (e) { return ''; } };

if (cmd === 'snapshot') {
  const note = rest.join(' ') || 'snapshot'; const s = stamp(); const dir = path.join(HERE, 'versions', s); fs.mkdirSync(dir, { recursive: true });
  const manifest = { stamp: s, note, files: {} };
  for (const rel of STATE) { const src = path.join(HERE, rel); if (!fs.existsSync(src)) continue;
    for (const f of walk(src)) { if (f.includes(`${path.sep}node_modules${path.sep}`) || f.endsWith('.png')) continue; const r = path.relative(HERE, f); const dst = path.join(dir, r); fs.mkdirSync(path.dirname(dst), { recursive: true }); fs.copyFileSync(f, dst); manifest.files[r.replace(/\\/g, '/')] = sha(f); } }
  fs.writeFileSync(path.join(dir, 'MANIFEST.json'), JSON.stringify(manifest, null, 1));
  if (!fs.existsSync(path.join(HERE, '.git'))) { git('init'); fs.writeFileSync(path.join(HERE, '.gitignore'), 'node_modules/\nkeys.json\nprobe/*.png\nfiles/*.txt\nserve.log\n'); }
  git('add', '-A'); const out = git('commit', '-q', '-m', `${s} ${note}`); const head = git('rev-parse', '--short', 'HEAD');
  console.log(JSON.stringify({ step: 'snapshot', stamp: s, files: Object.keys(manifest.files).length, commit: head, note }));
} else if (cmd === 'list') {
  const vdir = path.join(HERE, 'versions'); const vs = fs.existsSync(vdir) ? fs.readdirSync(vdir).sort() : [];
  for (const v of vs) { const m = JSON.parse(fs.readFileSync(path.join(vdir, v, 'MANIFEST.json'), 'utf8')); console.log(`${v}  ${Object.keys(m.files).length} files  ${m.note}`); }
  console.log(git('log', '--oneline', '-10') || '(no git history yet)');
} else if (cmd === 'restore') {
  const want = rest[0]; const vdir = path.join(HERE, 'versions'); const v = fs.readdirSync(vdir).sort().find(x => x.startsWith(want || ''));
  if (!v) { console.error('FAIL: no such version'); process.exit(1); }
  const m = JSON.parse(fs.readFileSync(path.join(vdir, v, 'MANIFEST.json'), 'utf8')); let n = 0, bad = 0;
  for (const [rel, h] of Object.entries(m.files)) { const src = path.join(vdir, v, rel); if (sha(src) !== h) { bad++; continue; } const dst = path.join(HERE, rel); fs.mkdirSync(path.dirname(dst), { recursive: true }); fs.copyFileSync(src, dst); n++; }
  console.log(JSON.stringify({ step: 'restore', version: v, restored: n, hash_mismatch: bad }));
  if (bad) process.exit(1);
} else { console.error('usage: snapshot <note> | list | restore <stamp>'); process.exit(1); }

Dna

A Python module in the pipeline folder of GlobalGrid2050.

storageglobalgrid2050 / testcode/202609170041-quantum-twin-flights/pipeline/dna.py · lines 1–30 of 30 · version 2026-09-17 00:41 · Not reached from any entry point (candidate for review)

What it does
It loads data. Uses libraries json, os, sys, subprocess, hashlib. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: JSON file apps.json; JSON file keys.json; command-line arguments. Out: JSON file.
What it achieves
DNA TEST: does a planet's code exist, line by line, where its keys say it does?
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609170041-quantum-twin-flights/pipeline · Python module
Uses
json, os, sys, subprocess, hashlib, collections, time, re
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609170041-quantum-twin-flights/pipeline/dna.py:1-30 · blob d627e3c5ed390864a8984d698b42c8a786ae81c8 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
"""DNA TEST: does a planet's code exist, line by line, where its keys say it does?
For one app, every key it carries is fetched from its recorded repository at its recorded commit and line, and hashed.
Result: found of total, with every miss named. A planet passes its DNA test or it does not. usage: python pipeline/dna.py gridatlas"""
import json, os, sys, subprocess, hashlib, collections, time, re
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
GH = os.environ.get('GITHUB_DIR', os.path.expanduser('~/Documents/GitHub'))
name = (sys.argv[1] if len(sys.argv) > 1 else 'gridatlas').lower()
A = json.load(open(os.path.join(ROOT, 'apps.json'), encoding='utf-8')); K = json.load(open(os.path.join(ROOT, 'keys.json'), encoding='utf-8'))
app = next((a for a in A['apps'] if a['app'] and a['name'] == name), None) or next((a for a in A['apps'] if a['app'] and name in a['name']), None)
if not app: sys.exit(f'FAIL: no app "{name}"')
want = set(A['keys'][app['repo']]); idx = {k: i for i, k in enumerate(K['keys'])}
by_place = collections.defaultdict(list)
for k in want:
    i = idx.get(k)
    if i is not None: by_place[K['place'][i]].append((k, K['line'][i]))
t0 = time.time(); found = 0; misses = []; cache = {}
for pi, items in by_place.items():
    repo, commit, path = K['places'][pi]; clone = os.path.join(GH, repo.split('/')[1])
    if not os.path.isdir(clone) or not re.fullmatch(r'[0-9a-f]{7,40}', str(commit)): text = None
    else:
        r = subprocess.run(['git', '-C', clone, 'show', f'{commit}:{path}'], capture_output=True); text = r.stdout.decode('utf-8', 'replace').split('\n') if r.returncode == 0 else None
        if text and text[-1] == '': text.pop()
    for k, ln in items:
        if text is None or not ln or ln > len(text): misses.append({'key': k, 'repo': repo, 'commit': commit[:10], 'path': path, 'line': ln, 'why': 'no clone or commit' if text is None else 'line beyond file end'})
        else: found += 1
total = found + len(misses); passed = total > 0 and not misses
out = {'app': app['name'], 'repo': app['repo'], 'keys': total, 'found': found, 'missing': len(misses), 'passed': passed, 'places': len(by_place), 'seconds': round(time.time() - t0, 1), 'misses': misses[:50]}
os.makedirs(os.path.join(ROOT, 'probe'), exist_ok=True); json.dump(out, open(os.path.join(ROOT, 'probe', f'DNA-{app["name"]}.json'), 'w'), indent=1)
print(json.dumps({k: out[k] for k in ['app', 'keys', 'found', 'missing', 'passed', 'places', 'seconds']}))
if not passed: sys.exit(f'FAIL: {len(misses)} of {total} lines not found')

Users

A JavaScript module in the pipeline folder of GlobalGrid2050 using data from the star-electron-star repository. It is built from the mulberry32 step (`mulberry32`).

renderglobalgrid2050 / testcode/202609170041-quantum-twin-flights/pipeline/users.mjs · lines 1–48 of 48 · version 2026-09-17 00:41 · Not reached from any entry point (candidate for review) · pattern mulberry (shared by 65 files)

What it does
It draws its content. Defines mulberry32. Uses libraries puppeteer-core. Side effects: changes the web page (DOM); reads or writes files.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: data source: star-electron-star data; command-line arguments.
What it achieves
A real Chrome on this machine opens the live page and types fifty lines, one after another, as a person would (into the box, Enter).
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · testcode/202609170041-quantum-twin-flights/pipeline · JavaScript module
Uses
puppeteer-core
Used by
none found
Produces
mulberry32
Defines here
mulberry32
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609170041-quantum-twin-flights/pipeline/users.mjs:1-48 · blob 2bef6d67b8a52d91d05dc5f29a131a76650d1e42 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: experimental · users: none · canonical: unreached_review
// USERS: a real Chrome on this machine opens the live page and types fifty lines, one after another,
// as a person would (into the box, Enter). After each line the card or log must show what a person
// would expect. One line per test; a screenshot every ten. Fails if any expectation is not met.
// usage: node pipeline/users.mjs [url]     default: https://ventusltd.github.io/star-electron-star/
import puppeteer from 'puppeteer-core'; import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url';
const HERE = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
const URL = process.argv[2] || 'https://ventusltd.github.io/star-electron-star/';
const SEED = +(process.argv[3] || 0), COUNT = +(process.argv[4] || 0); // seed > 0: deterministic shuffle; count > 0: only that many
const CHROME = process.env.CHROME || '<chrome.exe>';
const out = path.join(HERE, 'probe'); fs.mkdirSync(out, { recursive: true }); const stamp = new Date().toISOString().replace(/[-:]/g, '').slice(0, 15);
const T = [ // [what a user types, what must appear (regex) in the card or the log]
  ['help', /commands/i], ['block 39885', /beam is on line 39885/], ["twin 39885", /line 3672/], ['state 39885', /HOME P = /], ['measure 39885', /result: <?b?>?(HOME|AWAY)/],
  ['measure 39885', /Draw [0-9]+/], ['connect 39885 1217', /connect 39885 → 1217/], ['apps', /19 apps/], ['app gridatlas', /app gridatlas/], ['app globalgrid2050', /app globalgrid2050/],
  ['entangle', /128,369 of 128,369/], ['run voltage-drop.voltageDropVolts {"currentA":120,"lengthM":250,"resistanceOhmPerKm":0.32,"powerFactor":0.95,"phases":"three"}', /15\.796/],
  ['run voltage-drop.voltageDropVolts {"currentA":120,"lengthM":250,"resistanceOhmPerKm":0.32}', /refused/], ['run diversified-demand.diversifiedDemandKw {"unitCount":900,"perUnitKw":3,"coincidenceFactor":0.4}', /1080/],
  ['run diversified-demand.diversifiedDemandKw {"unitCount":900,"perUnitKw":3,"coincidenceFactor":0.4}', /chartered electrical engineer/], ['run current-from-power.currentA {"apparentPowerVa":100000,"voltageV":400,"phases":"three"}', /144\.3/],
  ['run firm-capacity.apparentPowerMva {"mw":10,"powerFactor":0.9}', /11\.11/], ['run voltage-drop.nope {}', /refused/], ['engine', /voltage-drop:/],
  ['what is the voltage drop for 120 amps over 250 metres at 0.32 ohm per km, power factor 0.95, three phase', /15\.796/],
  ['voltage drop for 120 A over 250 m at 0.32 Ω per km pf 1 three phase', /"powerFactor":1/], ['voltage drop for 120 amps over 250 metres at 0.32 ohm', /needs:/],
  ['diversified demand for 900 houses at 3 kw each coincidence 0.4', /1080/], ['show me gridatlas', /app gridatlas/], ['fly to 39885', /beam is on line 39885/],
  ['read 39885', /line 3672/], ["twin 2", /cable-trench-or-drill/], ['state 2', /HOME P = /], ['measure 2', /result:/], ['block 999999999', /block 999999999/],
  ['state 999999999', /no family record/], ['purple monkey dishwasher', /no command matched/], ['reset', /reset/], ['block 1217', /beam is on line 1217/], ["twin 1217", /line [0-9]+/],
  ['apps', /working index/], ['app testcode', /app testcode/], ['app elements', /app elements/], ['app stars', /app stars/], ['app cvaa', /no app|app cvaa/],
  ['state 39885', /K 1 same directory/], ['measure 39885 alpha', /seed "alpha"/], ['measure 39885', /Draw [0-9]+/], ['connect 2 39885', /connect 2 → 39885/], ['help', /block/],
  ['run voltage-drop.voltageDropVolts {"currentA":-5,"lengthM":250,"resistanceOhmPerKm":0.32,"powerFactor":0.9}', /refused/], ['run voltage-drop.dropPercent {"dropVolts":15.796,"nominalVolts":400}', /3\.9/],
  ['land gridatlas', /landed on gridatlas/], ['space', /back in space/], ['take me to pipeline news', /landed on pipelinenews/], ['back to space', /back in space/], ['show me the versions', /no command matched|versions/], ['block 39885', /beam/], ['reset', /reset/],
];
function mulberry32(a){ return function(){ a |= 0; a = a + 0x6D2B79F5 | 0; let t = Math.imul(a ^ a >>> 15, 1 | a); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }
if (SEED > 0) { const rnd = mulberry32(SEED); for (let i = T.length - 1; i > 0; i--) { const j = Math.floor(rnd() * (i + 1)); [T[i], T[j]] = [T[j], T[i]]; } }
if (COUNT > 0) T.length = Math.min(T.length, COUNT);
console.log(`users: ${T.length} actions · seed ${SEED} · ${URL}`);
const SLOW = +(process.env.SLOW || 0); // ms to hold after each action so a person can read it
const browser = await puppeteer.launch({ executablePath: CHROME, headless: false, defaultViewport: null, args: ['--start-maximized', '--ignore-gpu-blocklist'] });
const lines = []; let pass = 0;
try {
  const page = await browser.newPage();
  await page.goto(URL, { waitUntil: 'networkidle0', timeout: 90000 }); await page.waitForSelector('#pin', { timeout: 60000 }); await new Promise(r => setTimeout(r, 2500));
  for (let i = 0; i < T.length; i++) {
    const [typed, expect] = T[i]; const t0 = Date.now();
    await page.click('#pin'); await page.evaluate(() => { document.getElementById('pin').value = ''; }); await page.type('#pin', typed, { delay: SLOW ? 30 : 4 }); await page.keyboard.press('Enter');
    let ok = false, seen = ''; for (let w = 0; w < 30 && !ok; w++) { await new Promise(r => setTimeout(r, 200)); seen = await page.evaluate(() => (document.getElementById('say')?.innerHTML || '') + '\n' + (document.getElementById('plog')?.innerText || '')); ok = expect.test(seen); }
    if (ok) pass++; const line = `${String(i + 1).padStart(2)} ${ok ? 'PASS' : 'FAIL'} ${String(Date.now() - t0).padStart(5)}ms · ${typed.slice(0, 70)}${ok ? '' : ' · saw: ' + seen.replace(/\s+/g, ' ').slice(0, 120)}`;
    lines.push(line); console.log(line); if (SLOW) await new Promise(r => setTimeout(r, SLOW));
    if ((i + 1) % 10 === 0) await page.screenshot({ path: path.join(out, `USERS-${stamp}-${i + 1}.png`) });
  }
} finally { await browser.close(); }
fs.writeFileSync(path.join(out, `USERS-${stamp}.txt`), lines.join('\n') + `\n${pass}/${T.length} pass · ${URL}\n`);
console.log(`\nusers: ${pass}/${T.length} pass · ${URL}`); if (pass !== T.length) process.exitCode = 1;

Price History Fullscreen

A JavaScript file in GlobalGrid2050 that draws on a canvas.

energy-dataglobalgrid2050 / uk_energy_tracking_v3/price-history-fullscreen.js · lines 1–8 of 8 · Not reached from any entry point (candidate for review)

What it does
It draws its content. Defines mm, close. Side effects: changes the web page (DOM); reads or writes files.
Why it exists in the grid workflow
Domain stage hv_procurement (path word 'price'): HV materials procurement, which Ventus Ltd states is within its commercial execution boundary.
Inputs & outputs
Out: canvas drawing.
What it achieves
Defines `close`. It responds to DOMContentLoaded, keydown and resize events.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · uk_energy_tracking_v3 · script
Uses
none found
Used by
none found
Produces
mm, close
Defines here
mm, close
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_energy_tracking_v3/price-history-fullscreen.js:1-8 · blob 47e1abe27daa249f63adfabc0cb8164d69296507 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: hv_procurement · users: EPC_contractor, procurement_buyer · canonical: unreached_review
(function(){
var S={rows:[],meta:null};function $(id){return document.getElementById(id)}function dlab(t){return new Date(t).toLocaleDateString('en-GB',{day:'2-digit',month:'short',year:'numeric'})}function fmt(n,d){return Number(n).toLocaleString('en-GB',{minimumFractionDigits:d,maximumFractionDigits:d})}
function mm(v){var lo=v[0],hi=v[0];v.forEach(x=>{if(x<lo)lo=x;if(x>hi)hi=x});if(lo===hi)hi=lo+1;var m=(hi-lo)*.1;return{lo:lo-m,hi:hi+m}}
function draw(){var c=$('price-history-fullscreen-canvas');if(!c)return;var q=devicePixelRatio||1,r=c.getBoundingClientRect();c.width=Math.max(400,Math.floor(r.width*q));c.height=Math.max(260,Math.floor(r.height*q));var g=c.getContext('2d'),w=c.width,h=c.height,p=74*q,rp=28*q;g.fillStyle='#05070c';g.fillRect(0,0,w,h);g.font=12*q+'px Courier New';var rows=S.rows,meta=S.meta;if(!meta){meta={start:ne  … [line shortened here: 1,513 characters; full line on GitHub]
function open(){var o=$('price-history-fullscreen-overlay'),st=window.__v3PriceHistoryState;if(!o)return;o.classList.add('open');S.rows=(st&&st.visible)||[];S.meta=(st&&st.meta)||null;var m=$('price-history-fullscreen-meta');if(m&&S.meta)m.textContent='Selected range: '+dlab(S.meta.start)+' to '+dlab(S.meta.end)+' | visible records: '+S.rows.length+' of '+((st&&st.all&&st.all.length)||S.rows.lengt  … [line shortened here: 428 characters; full line on GitHub]
function close(){var o=$('price-history-fullscreen-overlay');if(o)o.classList.remove('open')}
document.addEventListener('DOMContentLoaded',function(){var b=$('price-history-fullscreen-btn'),c=$('price-history-fullscreen-close'),r=$('price-history-zoom-reset');if(b)b.onclick=open;if(c)c.onclick=close;if(r)r.onclick=draw;document.addEventListener('keydown',e=>{if(e.key==='Escape')close()});window.addEventListener('resize',draw)});
})();