GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Websites and apps / globalgrid2050 / grid_engine/202609060236-published-fault-level

Grid Engine — Published Fault Level Page and 1 more file

A web page in GlobalGrid2050 that uses SHA-256 using data from National Energy System Operator (NESO) data portal and the ventus-grid-engine repository. Published at https://globalgrid2050.com/grid_engine/202609060236-published-fault-level/.

534 lines of HTML from globalgrid2050, in 2 files. Topic: Websites and apps. Section 1889 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. Grid Engine — Published Fault Level Page render · globalgrid2050 / grid_engine/202609060236-published-fault-level/index.html lines 1–290
  2. Grid Engine — Corridor Estimate Page render · globalgrid2050 / grid_engine/202609060237-corridor-estimate/index.html lines 1–244

Grid Engine — Published Fault Level Page

A web page in GlobalGrid2050 that uses SHA-256 using data from National Energy System Operator (NESO) data portal and the ventus-grid-engine repository. Published at https://globalgrid2050.com/grid_engine/202609060236-published-fault-level/.

renderglobalgrid2050 / grid_engine/202609060236-published-fault-level/index.html · lines 1–290 of 290 · version 2026-09-06 02:36 · Entry point · pattern refuse (shared by 54 files)

What it does
It draws its content. Defines 6 functions or classes, including el, num, fig, refuse, bind. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage upstream_foresight (voltage levels 400kV (all 132kV or above)): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: 400kV.
Inputs & outputs
In: form fields (user input). Out: web page. Voltage levels named: 400kV.
Downstream impact
Used directly by 3 files: Homepage V090 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v090.html); Homepage V091 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v091.html); Homepage V093 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v093.html). It is itself an entry point, published at https://globalgrid2050.com/grid_engine/202609060236-published-fault-level/.
What it achieves
It is built from the num step (`num`), the fig step (`fig`) and the refuse step (`refuse`). Published Fault Level Workbench — Ventus Grid Engine. Its code works with 400 kV. It responds to input events.
Why it matters
Loaded by the Homepage V090 page at https://globalgrid2050.com/homepage_versions/homepage_v090.html and 2 other pages.
Application
globalgrid2050 · grid_engine/202609060236-published-fault-level · page
Uses
Published Fault Level (link), GlobalGrid2050 — Grid Engine Page (link), Papers — Published Fault Level Page (link)
Used by
linked from Homepage V090 (link), linked from Homepage V091 (link), linked from Homepage V093 (link)
Produces
el, num, fig, refuse, bind, render
Defines here
el, num, fig, refuse, bind, render
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 grid_engine/202609060236-published-fault-level/index.html:1-290 · blob 277f10e0c57efcadb066ab8f41a9a3e40dd07c13 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Published Fault Level Workbench — Ventus Grid Engine</title>
<style>
:root{--bg:#000;--panel:#0b0e14;--line:#2f343d;--soft:#222;--text:#fff;
  --muted:#a6adbb;--accent:#00ffff;--ok:#00ff88;--warn:#ffae00;--no:#ff5c5c}
*{box-sizing:border-box;margin:0;padding:0;font-family:'Courier New',ui-monospace,monospace}
html,body{background:var(--bg);color:var(--text)}
body{font-size:14px;line-height:1.55;padding:0 0 48px}
.wrap{max-width:960px;margin:0 auto;padding:0 14px}
header{border-bottom:1px solid var(--soft);padding:18px 0 14px;margin-bottom:16px}
h1{font-size:17px;letter-spacing:2px;color:var(--accent)}
.sub{color:var(--muted);font-size:11px;margin-top:6px}
.stamp{color:#7f8996;font-size:10px;margin-top:8px;overflow-wrap:anywhere}
.status{border:1px solid var(--line);background:var(--panel);padding:9px 11px;
  margin-bottom:16px;font-size:11px}
.status.live{border-color:#167d4d;color:var(--ok)}
.status.dead{border-color:#7d1616;color:var(--no)}
section{border:1px solid var(--soft);background:var(--panel);margin-bottom:16px}
h2{font-size:12px;letter-spacing:1.4px;color:var(--accent);padding:11px 13px;
  border-bottom:1px solid var(--soft)}
.body{padding:13px}
.lede{color:var(--muted);font-size:11.5px;line-height:1.65;margin-bottom:13px}
label{display:block;color:var(--muted);font-size:10px;letter-spacing:.6px;
  text-transform:uppercase;margin:0 0 5px}
.field{margin-bottom:13px}
input[type=number],input[type=text]{width:100%;background:#000;border:1px solid var(--line);
  color:var(--text);padding:11px 10px;font-size:16px;font-weight:700}
input:focus{outline:none;border-color:var(--accent)}
input[type=range]{width:100%;accent-color:var(--accent);height:32px}
.rangerow{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.rangeval{color:var(--accent);font-weight:700;font-size:15px;white-space:nowrap}
.out{border:1px solid var(--line);background:#06080b;padding:11px;margin-top:11px}
.figure{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.figure .n{font-size:26px;font-weight:700;color:var(--ok);line-height:1.1}
.figure .n.over{color:var(--no)}
.figure .u{font-size:12px;color:var(--muted)}
.figure .q{font-size:10px;color:#7f8996;text-transform:uppercase;letter-spacing:.8px;
  flex:1 0 100%;margin-bottom:3px}
.basis{color:#8e98a5;font-size:10.5px;line-height:1.65;margin-top:9px;
  border-top:1px dashed #252a31;padding-top:8px}
.scroller{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:11px}
th{color:var(--accent);text-align:left;padding:7px 6px;border-bottom:1px solid var(--line);
  font-size:10px;letter-spacing:.5px}
td{padding:7px 6px;border-bottom:1px solid #1a1e25;color:var(--muted)}
td.n{color:var(--text);font-weight:700;text-align:right;white-space:nowrap}
.refuse{border:1px solid #5c2020;background:#120708}
.refuse h2{color:#ff8f8f;border-bottom-color:#5c2020}
.refuse dt{color:#ff8f8f;font-size:11px;font-weight:700;margin-top:11px}
.refuse dt:first-child{margin-top:0}
.refuse dd{color:#c9a9a9;font-size:10.5px;line-height:1.65;margin-top:3px}
footer{color:#69727d;font-size:10.5px;line-height:1.9;padding-top:14px;
  border-top:1px solid var(--soft);margin-top:20px}
/* Touch targets. Measured at 393px on 2026-09-06: footer links were 11.3px
   tall, below the 24px WCAG 2.2 minimum. Inline links keep their flow but are
   given real height through padding and line-height. */
footer a,.basis a{color:#66ccff;display:inline-block;padding:5px 2px;line-height:1.5}
.nav{margin-top:14px;font-size:11px}
.nav a{color:#66ccff;display:inline-block;padding:8px 10px 8px 0}
</style>
</head>
<body>
<div class="wrap">
<header>
  <h1>PUBLISHED FAULT LEVEL WORKBENCH</h1>
  <p class="sub">A figure may be carried only if it is published, dated and named by exact metric</p>
  <p class="stamp">Generation 202609060236 · engine published-fault-level.js at 7d40365</p>
</header>
<div class="status" id="engine-status">Loading the engine module…</div>
<section>
  <h2>1 · THE RECORD</h2>
  <div class="body">
    <p class="lede">A fault level is not one number. Make against break, three-phase against
                   single-phase, and a DC offset set by X/R — NESO's ETYS Appendix D publishes
                   <em>eight</em> separately named currents for one busbar, and collapsing them into
                   a generic "fault level" is the error this contract exists to prevent. Edit the
                   record below and watch it be accepted or refused. <strong>It opens refused on
                   purpose:</strong> the study basis is empty, because the estate's pinned ETYS
                   artefact genuinely records no basis today. That is a real open item, not a
                   contrived demonstration.</p>
    <div class="field">
      <label for="rec">Study basis (fill this to see the record accepted)</label>
      <input type="text" id="rec" value="" inputmode="text">
    </div>
    <div class="out" id="out-record"></div>
    
    
  </div>
</section>
<section>
  <h2>2 · QUOTING ONE NAMED METRIC</h2>
  <div class="body">
    <p class="lede">Once a record is accepted, a figure may be quoted — but only one named metric
                   at a time, with its unit, site, busbar, voltage, publisher, basis and date attached.
                   Nothing here will ever print the bare words "fault level".</p>
    <div class="field">
      <label for="metric">Metric name</label>
      <input type="text" id="metric" value="three_phase_rms_break_current_ka" inputmode="text">
    </div>
    <div class="out" id="out-quote"></div>
    <div class="scroller"><table id="metric-table"><thead><tr><th>Metric ETYS publishes</th><th style="text-align:right">Unit</th></tr></thead><tbody></tbody></table></div>
    <p class="basis">The eight ETYS metric names are listed above exactly as data-grid-gb
                   normalises them. A generic name — <code>fault_level</code>, <code>scl</code>,
                   <code>maximum_fault_level</code> — is refused outright, because a reader cannot
                   tell which current it is and the wrong one against the wrong switchgear rating is
                   how a screening tool becomes a false connection assessment.</p>
  </div>
</section>
<section class="refuse">
  <h2>WHAT THIS WORKBENCH WILL NOT COMPUTE</h2>
  <div class="body">
    <p class="lede" style="color:#c9a9a9">These are not features missing from a later
      version. The engine proof asserts that no function of these names exists, so
      their absence is a tested property rather than an oversight.</p>
    <dl id="refusals"></dl>
  </div>
</section>
<footer>
  <p>Every figure above is computed by
     <a href="https://ventusltd.github.io/ventus-grid-engine/engine/published-fault-level.js">published-fault-level.js</a>
     in the Ventus Grid Engine, imported at runtime and proven by 41 checks.
     This page holds no copy of the mathematics: if the engine cannot be reached it
     shows no numbers rather than a stale answer.</p>
  <p class="nav">
     <a href="../">All workbenches</a>
     <a href="/papers/202609060203-electrification/">Electrification paper</a>
     <a href="/papers/202609060045-published-fault-level/">Fault-level paper</a>
     <a href="/">GlobalGrid2050</a></p>
  <p style="margin-top:6px">Scenario arithmetic is not evidence of connection headroom.
     A national load factor cannot establish utilisation at any particular transformer.</p>
</footer>
</div>
<script type="module">
const ENGINE_MODULES = ["https://ventusltd.github.io/ventus-grid-engine/engine/published-fault-level.js"];
const ENGINE_SCHEMAS = ["ventus-grid-engine.published-fault-level.v1"];
const statusEl = document.getElementById('engine-status');
let E = null;

const el = id => document.getElementById(id);
const num = id => Number(el(id).value);

function fig(target, r, decimals = 1, over = false) {
  el(target).innerHTML =
    '<div class="figure">' +
      '<span class="q">' + r.quantity.replace(/_/g, ' ') + '</span>' +
      '<span class="n' + (over ? ' over' : '') + '">' +
        r.value.toLocaleString('en-GB', { minimumFractionDigits: decimals, maximumFractionDigits: decimals }) +
      '</span><span class="u">' + r.unit + '</span></div>' +
    '<p class="basis">' + r.basis + '</p>';
}

function refuse(target, message) {
  el(target).innerHTML = '<p class="basis" style="color:#ffae00;border:0;padding:0;margin:0">'
    + 'Engine refused this input: ' + message + '</p>';
}


// The real pinned artefact: NESO ETYS 2025 Appendix D peak-demand workbook, with
// the byte count and SHA-256 recorded in data-grid-gb chatgpt/sources.json, and
// the publication date verified against NESO's documents page on 2026-09-06.
// study_basis is deliberately EMPTY: the estate does not record one, so the page
// opens refused rather than inventing a plausible string.
const BASE = {
  provenance: {
    publisher: 'NESO',
    publication: 'ETYS 2025 Appendix D — peak demand fault current scenarios',
    source_url: 'https://www.neso.energy/document/383951/download',
    sha256: 'ad8b54fa0b0562c34295514c150f33913a92fc756ff140e0154d53c181363440',
    published_date: '2026-06-30',
    study_basis: ''
  },
  site: { name: 'EXAMPLE 400 kV substation', voltage_kv: 400, busbar: 'A' },
  metrics: {
    three_phase_rms_break_current_ka: { min: 31.2, max: 34.8 },
    three_phase_initial_peak_current_ka: { min: 78.4, max: 88.1 }
  }
};

function bind() { ['rec','metric'].forEach(id => el(id).addEventListener('input', render)); }

function render() {
  const input = JSON.parse(JSON.stringify(BASE));
  input.provenance.study_basis = el('rec').value.trim();

  // record() returns { ok, record, refused }. quote() takes the INNER record,
  // not the envelope -- passing the envelope returns null, silently, which is
  // exactly what the first version of this page did.
  const r = E.record(input);
  const ok = r && r.ok === true && r.record;
  el('out-record').innerHTML =
    '<div class="figure"><span class="q">record()</span><span class="n' + (ok ? '' : ' over') + '">' +
    (ok ? 'ACCEPTED' : 'REFUSED') + '</span></div>' +
    '<p class="basis">' + (ok
      ? 'Every required field is present: publisher, publication, source URL, SHA-256, an ISO date, a study basis, a named site and voltage, and metrics named by exact metric. ' + (E.CAVEAT || '')
      : 'Refused: <b>' + ((r && r.refused) || 'unknown reason') + '</b>. ' +
        'This is the contract working. A figure without its basis is not a measurement, it is a rumour.') +
    '</p>';

  const tb = document.querySelector('#metric-table tbody');
  tb.innerHTML = E.ETYS_METRICS.map(n => {
    const m = E.METRIC_LABELS[n];
    return '<tr><td style="font-size:10px">' + n + '<div style="color:#7f8996">' +
      (m ? m.label : '') + '</div></td><td class="n">' + (m ? m.unit : '?') + '</td></tr>';
  }).join('');

  if (!ok) {
    el('out-quote').innerHTML = '<p class="basis" style="border:0;padding:0;margin:0">' +
      'No quotation: the record was refused, so there is nothing here that may be printed.</p>';
    return;
  }
  try {
    const name = el('metric').value.trim();
    const q = E.quote(r.record, name);
    el('out-quote').innerHTML = q === null || q === undefined
      ? '<div class="figure"><span class="q">quote()</span><span class="n over">NOT QUOTED</span></div>' +
        '<p class="basis">The engine will not quote <b>' + name + '</b> from this record. Either the ' +
        'record does not carry that metric, or the name is a generic one the contract refuses. ' +
        'Try one of the exact names in the table below.</p>'
      : '<div class="figure"><span class="q">quote()</span><span class="n" style="font-size:14px;line-height:1.4">' +
        (typeof q === 'string' ? q : JSON.stringify(q)) + '</span></div>' +
        '<p class="basis">' + (E.NO_HEADROOM || '') + '</p>';
  } catch (err) {
    el('out-quote').innerHTML = '<p class="basis" style="color:#ffae00;border:0;padding:0;margin:0">' +
      'Engine refused this metric: ' + err.message + '</p>';
  }
}

try {
  const loaded = [];
  for (const url of ENGINE_MODULES) loaded.push(await import(url));
  // Some engine modules predate the schema convention and declare none. A spec
  // says so by passing null, and the check is skipped rather than faked -- an
  // asserted schema that does not exist would fail every load for a module that
  // is perfectly good.
  loaded.forEach((m, i) => {
    const expected = ENGINE_SCHEMAS[i];
    if (expected && m.schema !== expected) {
      throw new Error('unexpected schema ' + m.schema + ' from ' + ENGINE_MODULES[i]);
    }
  });
  // Merge the modules into one namespace. A name collision would silently
  // shadow one module's function with another's, so it is refused loudly.
  E = {};
  const NOT_COMPUTED = {};
  // Refusals are not all shaped the same. The newer modules export
  // NOT_COMPUTED as an object of named reasons; the older ones export a single
  // string, or name their boundaries individually as NOT_A_CAPACITY,
  // NO_HEADROOM, NEVER_SUMMED, CAVEAT and so on. Spreading a string into an
  // object would render one character per letter, so each shape is handled.
  const REFUSAL_NAME = /^(NOT_|NO_|NEVER_|CAVEAT|IMPEDANCE_)/;
  for (const m of loaded) {
    for (const [k, v] of Object.entries(m)) {
      if (k === 'schema' || k === 'requires') continue;
      if (k === 'NOT_COMPUTED') {
        if (typeof v === 'string') NOT_COMPUTED.notComputed = v;
        else Object.assign(NOT_COMPUTED, v);
        continue;
      }
      if (REFUSAL_NAME.test(k) && typeof v === 'string') {
        NOT_COMPUTED[k.toLowerCase().replace(/_(.)/g, (_, c) => c.toUpperCase())] = v;
        continue;
      }
      if (k in E) throw new Error('two engine modules both export "' + k + '"');
      E[k] = v;
    }
  }
  E.NOT_COMPUTED = NOT_COMPUTED;
  statusEl.className = 'status live';
  statusEl.textContent = 'ENGINE LIVE — ' +
    ENGINE_SCHEMAS.map((sc, i) => sc || ENGINE_MODULES[i].split('/').pop()).join(' + ') +
    ' · every figure below is computed by the engine module' + (loaded.length > 1 ? 's' : '') + ', not by this page.';
  el('refusals').innerHTML = Object.entries(E.NOT_COMPUTED).map(([k, v]) =>
    '<dt>' + k.replace(/([A-Z])/g, ' $1').toUpperCase() + '</dt><dd>' + v + '</dd>').join('');
  bind();
  render();
} catch (err) {
  statusEl.className = 'status dead';
  statusEl.textContent = 'ENGINE UNREACHABLE — ' + err.message +
    '. Nothing on this page is computed; there is deliberately no local copy to fall back to.';
  document.querySelectorAll('.out').forEach(o => {
    o.innerHTML = '<p class="basis" style="color:#ff8f8f;border:0;padding:0;margin:0">'
      + 'No figure: the engine did not load.</p>'; });
}
</script>
</body>
</html>

Grid Engine — Corridor Estimate Page

A web page in GlobalGrid2050 covering cables and uses data from the ventus-grid-engine repository. Published at https://globalgrid2050.com/grid_engine/202609060237-corridor-estimate/.

renderglobalgrid2050 / grid_engine/202609060237-corridor-estimate/index.html · lines 1–244 of 244 · version 2026-09-06 02:37 · Entry point · pattern refuse (shared by 54 files)

What it does
It draws cables. Defines 6 functions or classes, including el, num, fig, refuse, bind. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage hv_procurement (path word 'estimate'): HV materials procurement, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: cables.
Inputs & outputs
In: form fields (user input). Out: web page.
Downstream impact
Used directly by 3 files: Homepage V090 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v090.html); Homepage V091 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v091.html); Homepage V093 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v093.html). It is itself an entry point, published at https://globalgrid2050.com/grid_engine/202609060237-corridor-estimate/.
What it achieves
It is built from the num step (`num`), the fig step (`fig`) and the refuse step (`refuse`). Corridor Estimate Workbench — Ventus Grid Engine. It responds to input events.
Why it matters
Loaded by the Homepage V090 page at https://globalgrid2050.com/homepage_versions/homepage_v090.html and 2 other pages.
Application
globalgrid2050 · grid_engine/202609060237-corridor-estimate · page
Uses
Corridor Estimate (link), GlobalGrid2050 — Grid Engine Page (link), Papers — Published Fault Level Page (link)
Used by
linked from Homepage V090 (link), linked from Homepage V091 (link), linked from Homepage V093 (link)
Produces
el, num, fig, refuse, bind, render
Defines here
el, num, fig, refuse, bind, render
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 grid_engine/202609060237-corridor-estimate/index.html:1-244 · blob b73acc36569194a5a38f20f7ae959ee50d6a1b13 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: hv_procurement · users: EPC_contractor, procurement_buyer · canonical: production_core
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Corridor Estimate Workbench — Ventus Grid Engine</title>
<style>
:root{--bg:#000;--panel:#0b0e14;--line:#2f343d;--soft:#222;--text:#fff;
  --muted:#a6adbb;--accent:#00ffff;--ok:#00ff88;--warn:#ffae00;--no:#ff5c5c}
*{box-sizing:border-box;margin:0;padding:0;font-family:'Courier New',ui-monospace,monospace}
html,body{background:var(--bg);color:var(--text)}
body{font-size:14px;line-height:1.55;padding:0 0 48px}
.wrap{max-width:960px;margin:0 auto;padding:0 14px}
header{border-bottom:1px solid var(--soft);padding:18px 0 14px;margin-bottom:16px}
h1{font-size:17px;letter-spacing:2px;color:var(--accent)}
.sub{color:var(--muted);font-size:11px;margin-top:6px}
.stamp{color:#7f8996;font-size:10px;margin-top:8px;overflow-wrap:anywhere}
.status{border:1px solid var(--line);background:var(--panel);padding:9px 11px;
  margin-bottom:16px;font-size:11px}
.status.live{border-color:#167d4d;color:var(--ok)}
.status.dead{border-color:#7d1616;color:var(--no)}
section{border:1px solid var(--soft);background:var(--panel);margin-bottom:16px}
h2{font-size:12px;letter-spacing:1.4px;color:var(--accent);padding:11px 13px;
  border-bottom:1px solid var(--soft)}
.body{padding:13px}
.lede{color:var(--muted);font-size:11.5px;line-height:1.65;margin-bottom:13px}
label{display:block;color:var(--muted);font-size:10px;letter-spacing:.6px;
  text-transform:uppercase;margin:0 0 5px}
.field{margin-bottom:13px}
input[type=number],input[type=text]{width:100%;background:#000;border:1px solid var(--line);
  color:var(--text);padding:11px 10px;font-size:16px;font-weight:700}
input:focus{outline:none;border-color:var(--accent)}
input[type=range]{width:100%;accent-color:var(--accent);height:32px}
.rangerow{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.rangeval{color:var(--accent);font-weight:700;font-size:15px;white-space:nowrap}
.out{border:1px solid var(--line);background:#06080b;padding:11px;margin-top:11px}
.figure{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.figure .n{font-size:26px;font-weight:700;color:var(--ok);line-height:1.1}
.figure .n.over{color:var(--no)}
.figure .u{font-size:12px;color:var(--muted)}
.figure .q{font-size:10px;color:#7f8996;text-transform:uppercase;letter-spacing:.8px;
  flex:1 0 100%;margin-bottom:3px}
.basis{color:#8e98a5;font-size:10.5px;line-height:1.65;margin-top:9px;
  border-top:1px dashed #252a31;padding-top:8px}
.scroller{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:11px}
th{color:var(--accent);text-align:left;padding:7px 6px;border-bottom:1px solid var(--line);
  font-size:10px;letter-spacing:.5px}
td{padding:7px 6px;border-bottom:1px solid #1a1e25;color:var(--muted)}
td.n{color:var(--text);font-weight:700;text-align:right;white-space:nowrap}
.refuse{border:1px solid #5c2020;background:#120708}
.refuse h2{color:#ff8f8f;border-bottom-color:#5c2020}
.refuse dt{color:#ff8f8f;font-size:11px;font-weight:700;margin-top:11px}
.refuse dt:first-child{margin-top:0}
.refuse dd{color:#c9a9a9;font-size:10.5px;line-height:1.65;margin-top:3px}
footer{color:#69727d;font-size:10.5px;line-height:1.9;padding-top:14px;
  border-top:1px solid var(--soft);margin-top:20px}
/* Touch targets. Measured at 393px on 2026-09-06: footer links were 11.3px
   tall, below the 24px WCAG 2.2 minimum. Inline links keep their flow but are
   given real height through padding and line-height. */
footer a,.basis a{color:#66ccff;display:inline-block;padding:5px 2px;line-height:1.5}
.nav{margin-top:14px;font-size:11px}
.nav a{color:#66ccff;display:inline-block;padding:8px 10px 8px 0}
</style>
</head>
<body>
<div class="wrap">
<header>
  <h1>CORRIDOR ESTIMATE WORKBENCH</h1>
  <p class="sub">The straight-line first pass, and the one multiplier that is allowed to touch it</p>
  <p class="stamp">Generation 202609060237 · engine corridor-estimate.js at 7d40365</p>
</header>
<div class="status" id="engine-status">Loading the engine module…</div>
<section>
  <h2>1 · STRAIGHT LINE TO CORRIDOR</h2>
  <div class="body">
    <p class="lede">A straight line is not a route. Buried cable circuits follow the highway
                   network, and across 95 published GB transmission cable circuits that detour
                   measures a factor of <strong>1.245</strong>. This is the estate's first pass and it
                   stays exactly as it is — everything else built tonight is additive to it.</p>
    <div class="field">
      <label for="km">Straight-line distance (km)</label>
      <input type="number" id="km" value="10" min="0" max="2000" step="0.01" inputmode="decimal">
    </div>
    <div class="out" id="out-corridor"></div>
    
    
  </div>
</section>
<section>
  <h2>2 · WHERE IT REFUSES, AND WHY THAT MATTERS MORE</h2>
  <div class="body">
    <p class="lede">Below about a kilometre the factor is not measuring route detour at all — it is
                   measuring the distance between two site centroids, and the median error rises to
                   52.5%. So it returns <em>null</em>, not zero and not a small number. A tool that
                   answers everything cannot be trusted on anything.</p>

    
    <div class="scroller"><table id="basis-table"><thead><tr><th>Calibration</th><th style="text-align:right">Value</th></tr></thead><tbody></tbody></table></div>
    <p class="basis">The factor is calibrated on cable, which follows roads. Overhead line crosses
                   open country and measures 1.13 — published here only so a reader can see why the
                   cable factor is the wrong model for an overhead question. There is deliberately no
                   forOverhead().</p>
  </div>
</section>
<section class="refuse">
  <h2>WHAT THIS WORKBENCH WILL NOT COMPUTE</h2>
  <div class="body">
    <p class="lede" style="color:#c9a9a9">These are not features missing from a later
      version. The engine proof asserts that no function of these names exists, so
      their absence is a tested property rather than an oversight.</p>
    <dl id="refusals"></dl>
  </div>
</section>
<footer>
  <p>Every figure above is computed by
     <a href="https://ventusltd.github.io/ventus-grid-engine/engine/corridor-estimate.js">corridor-estimate.js</a>
     in the Ventus Grid Engine, imported at runtime and proven by 15 checks.
     This page holds no copy of the mathematics: if the engine cannot be reached it
     shows no numbers rather than a stale answer.</p>
  <p class="nav">
     <a href="../">All workbenches</a>
     <a href="/papers/202609060203-electrification/">Electrification paper</a>
     <a href="/papers/202609060045-published-fault-level/">Fault-level paper</a>
     <a href="/">GlobalGrid2050</a></p>
  <p style="margin-top:6px">Scenario arithmetic is not evidence of connection headroom.
     A national load factor cannot establish utilisation at any particular transformer.</p>
</footer>
</div>
<script type="module">
const ENGINE_MODULES = ["https://ventusltd.github.io/ventus-grid-engine/engine/corridor-estimate.js"];
const ENGINE_SCHEMAS = ["gridatlas.module.corridor-estimate.v1"];
const statusEl = document.getElementById('engine-status');
let E = null;

const el = id => document.getElementById(id);
const num = id => Number(el(id).value);

function fig(target, r, decimals = 1, over = false) {
  el(target).innerHTML =
    '<div class="figure">' +
      '<span class="q">' + r.quantity.replace(/_/g, ' ') + '</span>' +
      '<span class="n' + (over ? ' over' : '') + '">' +
        r.value.toLocaleString('en-GB', { minimumFractionDigits: decimals, maximumFractionDigits: decimals }) +
      '</span><span class="u">' + r.unit + '</span></div>' +
    '<p class="basis">' + r.basis + '</p>';
}

function refuse(target, message) {
  el(target).innerHTML = '<p class="basis" style="color:#ffae00;border:0;padding:0;margin:0">'
    + 'Engine refused this input: ' + message + '</p>';
}


function bind() { el('km').addEventListener('input', render); }

function render() {
  const km = num('km');
  // forCable returns { km, factor, straight_km, withheld }. Below the minimum
  // separation it returns an OBJECT whose km is null and whose withheld says
  // why; only a zero distance returns null outright. Calling toFixed on that
  // null is what left this page showing a stale figure.
  const r = E.forCable(km);
  const value = r && r.km;
  el('out-corridor').innerHTML = (value === null || value === undefined)
    ? '<div class="figure"><span class="q">corridor estimate</span><span class="n over">NO ESTIMATE</span></div>' +
      '<p class="basis">' + ((r && r.withheld) || 'No distance given, so there is nothing to estimate.') + '</p>'
    : '<div class="figure"><span class="q">corridor estimate</span><span class="n">' +
      value.toFixed(2) + '</span><span class="u">km</span></div><p class="basis">' +
      'A straight line of ' + r.straight_km + ' km, multiplied by the calibrated cable factor of ' +
      r.factor + '. ' + E.CAVEAT + '</p>';

  const b = E.BASIS;
  document.querySelector('#basis-table tbody').innerHTML = [
    ['Cable factor', E.CABLE_FACTOR],
    ['Overhead factor (not applied here)', E.OHL_FACTOR],
    ['Circuits in the sample', b.circuits],
    ['Distinct site pairs', b.distinct_site_pairs],
    ['Median absolute error', b.median_absolute_error_pct + '%'],
    ['Within 15%', b.within_15_pct + '%'],
    ['Minimum separation', b.minimum_separation_km + ' km']
  ].map(r2 => '<tr><td>' + r2[0] + '</td><td class="n">' + r2[1] + '</td></tr>').join('') +
    '<tr><td colspan="2" style="font-size:10px;color:#7f8996">' + b.sample_note + '</td></tr>';
}

try {
  const loaded = [];
  for (const url of ENGINE_MODULES) loaded.push(await import(url));
  // Some engine modules predate the schema convention and declare none. A spec
  // says so by passing null, and the check is skipped rather than faked -- an
  // asserted schema that does not exist would fail every load for a module that
  // is perfectly good.
  loaded.forEach((m, i) => {
    const expected = ENGINE_SCHEMAS[i];
    if (expected && m.schema !== expected) {
      throw new Error('unexpected schema ' + m.schema + ' from ' + ENGINE_MODULES[i]);
    }
  });
  // Merge the modules into one namespace. A name collision would silently
  // shadow one module's function with another's, so it is refused loudly.
  E = {};
  const NOT_COMPUTED = {};
  // Refusals are not all shaped the same. The newer modules export
  // NOT_COMPUTED as an object of named reasons; the older ones export a single
  // string, or name their boundaries individually as NOT_A_CAPACITY,
  // NO_HEADROOM, NEVER_SUMMED, CAVEAT and so on. Spreading a string into an
  // object would render one character per letter, so each shape is handled.
  const REFUSAL_NAME = /^(NOT_|NO_|NEVER_|CAVEAT|IMPEDANCE_)/;
  for (const m of loaded) {
    for (const [k, v] of Object.entries(m)) {
      if (k === 'schema' || k === 'requires') continue;
      if (k === 'NOT_COMPUTED') {
        if (typeof v === 'string') NOT_COMPUTED.notComputed = v;
        else Object.assign(NOT_COMPUTED, v);
        continue;
      }
      if (REFUSAL_NAME.test(k) && typeof v === 'string') {
        NOT_COMPUTED[k.toLowerCase().replace(/_(.)/g, (_, c) => c.toUpperCase())] = v;
        continue;
      }
      if (k in E) throw new Error('two engine modules both export "' + k + '"');
      E[k] = v;
    }
  }
  E.NOT_COMPUTED = NOT_COMPUTED;
  statusEl.className = 'status live';
  statusEl.textContent = 'ENGINE LIVE — ' +
    ENGINE_SCHEMAS.map((sc, i) => sc || ENGINE_MODULES[i].split('/').pop()).join(' + ') +
    ' · every figure below is computed by the engine module' + (loaded.length > 1 ? 's' : '') + ', not by this page.';
  el('refusals').innerHTML = Object.entries(E.NOT_COMPUTED).map(([k, v]) =>
    '<dt>' + k.replace(/([A-Z])/g, ' $1').toUpperCase() + '</dt><dd>' + v + '</dd>').join('');
  bind();
  render();
} catch (err) {
  statusEl.className = 'status dead';
  statusEl.textContent = 'ENGINE UNREACHABLE — ' + err.message +
    '. Nothing on this page is computed; there is deliberately no local copy to fall back to.';
  document.querySelectorAll('.out').forEach(o => {
    o.innerHTML = '<p class="basis" style="color:#ff8f8f;border:0;padding:0;margin:0">'
      + 'No figure: the engine did not load.</p>'; });
}
</script>
</body>
</html>