In this section
- Single-Line Diagram (SLD) Sandbox V9 8 geodesy · globalgrid2050 / testcode/202609051152/atlas/cartridges/202609050354-sld-sandbox-v9-8.js lines 1–700
Single-Line Diagram (SLD) Sandbox V9 8
A JavaScript file in the cartridges folder of GlobalGrid2050 that maps connection points, GB transmission network, price decade rollup and grid substations, using haversine.
Set aside from the main view: 95% of its lines are the same as testcode/202609060300/atlas/cartridges/202609060300-sld-sandbox.js (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 95% of lines shared with Single-Line Diagram (SLD) Sandbox; read that one first. All set-aside files, with reasons. Nothing was deleted.
Evidence
- line-jaccard 0.9509 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609060300/atlas/cartridges/202609060300-sld-sandbox.js:1-7736 b9451a6d240116dae04211c0cc8216a75da78ad1
- sha256 7c2df5dabb0082d4cef941b98bf31e92161d1e79a7d22bd6c84e81b171507022
- target sha256 93d81bebf3d1cf8f799ccf6f117f1565777ed88110481c284713589539586605
- group of 2 (identity.json near-copy edges >= 0.9)
- canonical rule: reachable, newest stamp, core repo, most lines
geodesyglobalgrid2050 / testcode/202609051152/atlas/cartridges/202609050354-sld-sandbox-v9-8.js · lines 1–700 of 7382 · version 2026-09-05 03:54 · Not reached from any entry point (candidate for review) · pattern widerFleetBuckets (shared by 6 files)
- What it does
- It maps connection points, GB transmission network, price decade rollup and grid substations. Defines 217 functions or classes, including classOf, scope, survey, ready, worksAt. Side effects: changes the web page (DOM); reads or writes files; makes network requests; uses storage (browser storage, DuckDB or Parquet).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'sandbox'): 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: 750kV, 415kV, 400kV, 275kV, 220kV, 132kV.
- Inputs & outputs
- In: JSON file connection-points.v3.json; JSON file gb-transmission-network.v1.json; JSON file price-decade-rollup.json; GeoJSON file grid_substations.geojson; browser storage (getItem); DuckDB queries; form fields (user input). Out: browser storage (setItem); interactive map. Coordinate systems named: WGS84 / EPSG:4326. Voltage levels named: 750kV, 415kV, 400kV, 275kV, 220kV, 132kV, 110kV, 66kV.
- What it achieves
- It builds stats (`buildStats`), applies development stage defaults (`applyDevelopmentStageDefaults`) and applies mounting bifacial (`applyMountingBifacial`). ASSEMBLED by `tools/build-cartridge.mjs` from the parts below. Its code works with 400 kV, 132 kV and 33 kV. It responds to click, keydown and touchstart events.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · testcode/202609051152/atlas/cartridges · script
- VEDIC
- MEASURE (GG2050-VEDIC-000001): GridAtlas / Geodesy · Mathematics / Spherical geometry. coordinate_pair, coordinate_pair → distance_km
- VEDIC
- VOLTAGE (GG2050-VEDIC-000003): GridAtlas / Geodesy · Computer science / Data normalisation. voltage_properties → kilovolt_list
- VEDIC
- REPRESENT (GG2050-VEDIC-000002): GridAtlas / Geodesy · Computer science / Geometry processing. geojson_geometry → coordinate_pair_or_null
- Uses
- none found
- Used by
- mentioned in Standalone (comment link)
- Produces
- classOf, scope, survey, ready, worksAt, provisional, resolve, nearestTransmission, physicalInputs, buildStats, consistency, stringStats
- Defines here
- classOf, scope, survey, ready, worksAt, provisional, resolve, nearestTransmission, physicalInputs
- 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/202609051152/atlas/cartridges/202609050354-sld-sandbox-v9-8.js:1-700 · blob f66bb0bcbf98ce7cd519581375865ca92f816b61 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, network, storage · domain stage: experimental · users: none · canonical: unreached_review
/**
* sld-sandbox-v9-8, generation 202609050354 (UTC).
*
* ASSEMBLED by tools/build-cartridge.mjs from the parts below. Do not edit
* this file: edit a part and rebuild under a new generation. Each part is
* hashed in manifests/202609050354-sld-sandbox-v9-8-parts.json.
*
* module atlas/modules/202609012040-grid-scope.js
* module atlas/modules/202609012217-source-registry.js
* module atlas/modules/202609012128-declared-connections.js
* module atlas/modules/202609012205-sizing-arithmetic.js
* module atlas/modules/202609031310-technology-coverage.js
* part atlas/parts/202609041234-sld-sandbox-technology-buckets.js
*/
/**
* Module: grid-scope
*
* "When you click on a blank space, the user should be able to see grid in
* the vicinity. Call it the GRID FINDING SCOPE — analysis of what is
* there, NOT indicative of capacity." — Vikram, 2026-09-01.
*
* So this answers exactly one question: WHAT IS MAPPED HERE. It counts
* what the served payload contains around a point, by voltage class and
* by distance band, and names the nearest few. It is a census of the map,
* not a study of the network.
*
* WHAT IT WILL NOT DO, EVER
* It does not say whether a connection is available, likely, cheap or
* possible. Nothing in a payload of substation positions can support any
* of that: capacity depends on queue position, committed connections,
* thermal and fault headroom, consent and commercial terms, and none of
* those is a distance. A scope that counted substations and implied
* opportunity would be the most dangerous thing this estate could ship,
* because it would look like analysis.
*
* Pure. No DOM, no network, no state. Depends on: geodesy.
*/
(() => {
'use strict';
const NS = (window.__GRIDATLAS_MODULES__ = window.__GRIDATLAS_MODULES__ || {});
if (NS.gridScope) return;
const geodesy = NS.geodesy;
if (!geodesy) throw new Error('grid-scope requires the geodesy module');
/* Bands, not a single radius. A reader asking "what is around here"
wants the shape of the answer - is the nearest thing on top of me or
twenty kilometres away - and one number hides that. */
const DEFAULT_BANDS_KM = [2, 5, 10, 25];
const CLASSES_KV = [400, 275, 220, 132, 66, 33];
/* A voltage is classified ONLY as a class it actually is.
------------------------------------------------------------------
The first version walked the classes and returned the first one the
value exceeded, so it labelled 750 kV as 400, 110 kV as 66 and 50 kV
as 33 - a false label on anything the list does not contain, which is
exactly the sort of quiet relabelling this estate exists to avoid.
Codex caught it on the committed module before it reached a card
(stop-ship 202609012025).
Now: membership, within a tolerance for the fractions OSM carries.
Anything else is UNCLASSIFIED and counted as such, because a voltage
the standard classes do not contain is a fact about the data, not a
value to be rounded into the nearest familiar number. */
const CLASS_TOLERANCE_KV = 0.5;
function classOf(kv) {
if (!Number.isFinite(kv)) return null;
for (const known of CLASSES_KV) {
if (Math.abs(kv - known) <= CLASS_TOLERANCE_KV) return known;
}
return null;
}
/**
* @param origin [lon, lat]
* @param substations [{ at:[lon,lat], kv:[numbers], name, operator }]
* @param options { bandsKm, minimumKv, nearestCount }
*/
function scope(origin, substations, options) {
const bandsKm = (options && options.bandsKm) || DEFAULT_BANDS_KM;
const minimumKv = (options && options.minimumKv) || 0;
const nearestCount = (options && options.nearestCount) || 5;
const maximumKm = bandsKm[bandsKm.length - 1];
const within = [];
for (const substation of substations || []) {
if (!substation || !Array.isArray(substation.at)) continue;
const voltages = (Array.isArray(substation.kv) ? substation.kv : [])
.filter(Number.isFinite);
/* Non-finite voltages are dropped BEFORE the maximum.
----------------------------------------------------------------
Codex, 202609012055: Math.max over a NaN gives NaN, and NaN < floor
is false, so a substation whose voltage did not parse survived a
132 kV floor and was censused as though it qualified. A voltage
that is not a number is not a voltage above the floor. */
const top = voltages.length ? Math.max(...voltages) : 0;
if (top < minimumKv) continue;
const km = geodesy.distanceKm(origin[0], origin[1],
substation.at[0], substation.at[1]);
if (km > maximumKm) continue;
within.push({
name: substation.name || '',
operator: substation.operator || '',
kv: top,
class_kv: classOf(top),
km,
at: substation.at
});
}
within.sort((a, b) => a.km - b.km);
const bands = bandsKm.map((band) => {
const inBand = within.filter(entry => entry.km <= band);
const counts = {};
let unclassified = 0;
const unclassifiedKv = [];
for (const entry of inBand) {
if (entry.class_kv == null) {
// Counted, never folded into a class it is not.
unclassified += 1;
if (Number.isFinite(entry.kv) && !unclassifiedKv.includes(entry.kv)) {
unclassifiedKv.push(entry.kv);
}
continue;
}
counts[entry.class_kv] = (counts[entry.class_kv] || 0) + 1;
}
const highest = inBand.reduce(
(best, entry) => (entry.class_kv != null && (best == null || entry.class_kv > best)
? entry.class_kv : best), null);
return {
within_km: band,
substations: inBand.length,
by_class_kv: counts,
highest_class_kv: highest,
unclassified_voltage: unclassified,
unclassified_kv: unclassifiedKv.sort((a, b) => b - a)
};
});
/* Named first, because an unnamed OSM node is a fact about the map
rather than a place anyone can look up. Both are reported: the
nearest thing, and the nearest thing with an identity. */
const named = within.filter(entry => entry.name);
return {
schema: 'gridatlas.grid-scope.v1',
origin: [origin[0], origin[1]],
radius_km: maximumKm,
minimum_kv: minimumKv,
counted: within.length,
bands,
nearest: within.slice(0, nearestCount),
nearest_named: named.slice(0, nearestCount),
nearest_transmission: within.find(entry => entry.kv >= 275 - 0.5) || null,
/* Carried in the result itself so it cannot be separated from the
numbers by a renderer, a screenshot or a quote. */
what_this_is: 'A census of the substations in the served map payload '
+ 'around this point, by voltage class and distance band.',
what_this_is_not: 'Not a statement about capacity, headroom, '
+ 'availability or the cost of connecting here. Distance is not '
+ 'capacity: queue position, committed connections, thermal and '
+ 'fault headroom, consent and commercial terms decide that, and '
+ 'none of them is in this payload.',
method: 'haversine on a single Earth radius of '
+ geodesy.EARTH_RADIUS_KM + ' km, straight line to mapped geometry'
};
}
NS.gridScope = Object.freeze({
schema: 'gridatlas.module.grid-scope.v2',
CLASS_TOLERANCE_KV,
DEFAULT_BANDS_KM,
CLASSES_KV,
classOf,
scope
});
})();
/**
* Module: source-registry
*
* "Click anywhere on a map and the neons that already work via Pipeline News
* look for cartridges and code." — Vikram, 2026-09-01.
*
* The looking is this module. The Atlas is a composition of cartridges that
* find each other through `window.__GRIDATLAS_*` globals, and the deep scan
* of 1 Sep 2026 found fifteen such surfaces ever registered, thirteen live,
* and nothing anywhere that documents them. Every consumer therefore does
* its own `window.__GRIDATLAS_NETWORK__?.something` and quietly does less
* when the answer is undefined. That is how a click on blank space came to
* report only what OpenStreetMap has mapped, while the cartridge holding
* NESO's 886 published connection points sat loaded in the same page.
*
* So: one registry, declared once, that answers three questions.
*
* WHAT COULD ANSWER the sources this estate knows about, each with
* what it contributes and whether it is required.
* WHAT IS ANSWERING NOW probed live, by looking for the surface AND the
* specific capability, because a cartridge that
* has loaded but not yet fetched is present and
* not yet useful, and those are different states.
* WHAT DID NOT named, with the reason, in the result itself.
*
* The third is the point. A reader who is told "3 of 4 sources answered;
* NESO's published network did not, because its payload had not loaded" can
* judge the answer. A reader shown a shorter answer cannot, and will
* reasonably assume the map has told them everything it knows.
*
* It reads. It never fetches, never renders, and never decides what a
* finding means.
*
* Successor to 202609012135 at generation 202609012217: every source that
* fetches a product declares what it REQUIRES (repository, product, schema)
* and the survey carries that in every state, because a contract stated
* only once the load has succeeded is no help to the reader of a failure.
* The GB price rollup, fetched since v9.41 without a row here, is
* registered with the loader state the sandbox now publishes.
*
* Depends on: nothing.
*/
(() => {
'use strict';
const NS = (window.__GRIDATLAS_MODULES__ = window.__GRIDATLAS_MODULES__ || {});
if (NS.sourceRegistry) return;
/* The registry is DECLARED, not discovered by scanning window.
----------------------------------------------------------------------
Enumerating every __GRIDATLAS_* global would report whatever happens to
be there, including surfaces this estate has never agreed to consume,
and would silently start using a new one the day someone adds it. A
declared list is a contract: adding a source is an edit here, with a
reason, and a proof that the probe actually works. */
const SOURCES = [
{
id: 'map',
surface: '__GRIDATLAS_V9_MAP__',
contributes: 'the map itself: where the click happened, and what is drawn',
probe: (w) => (w.__GRIDATLAS_V9_MAP__ ? 'ready' : 'absent')
},
{
id: 'mapped-substations',
surface: '__GRIDATLAS_NEON_LINKS__',
contributes: 'substations as OpenStreetMap has them mapped, and the '
+ 'measurement the neon links already use',
probe: (w) => {
const links = w.__GRIDATLAS_NEON_LINKS__;
if (!links) return 'absent';
if (typeof links.measure?.distanceKm !== 'function') return 'loaded, cannot measure';
if (!links.substations_loaded) return 'loaded, no substations yet';
return 'ready';
},
detail: (w) => ({ substations: w.__GRIDATLAS_NEON_LINKS__?.substations_loaded || 0 })
},
{
id: 'neso-connection-points',
surface: '__GRIDATLAS_NETWORK__',
requires: { repository: 'Ventusltd/data-grid-gb',
product: 'derived/connection-points.v3.json',
schema: 'data-grid-gb.connection-points.v3' },
contributes: "NESO's published connection points: circuits, transformers, "
+ 'per-voltage fault current and planned changes',
probe: (w) => {
const network = w.__GRIDATLAS_NETWORK__;
if (!network) return 'absent';
if (network.failed) return 'failed to load';
if (!network.loaded) return 'loading';
return 'ready';
},
detail: (w) => ({ connection_points: w.__GRIDATLAS_NETWORK__?.count || null,
schema: w.__GRIDATLAS_NETWORK__?.schema || null })
},
{
id: 'grid-scope',
surface: '__GRIDATLAS_MODULES__.gridScope',
contributes: 'the census of what is mapped around a point, in distance bands',
probe: (w) => (w.__GRIDATLAS_MODULES__?.gridScope ? 'ready' : 'absent')
},
{
id: 'network-topology',
surface: '__GRIDATLAS_MODULES__.networkTopology + __GRIDATLAS_TOPOLOGY__',
requires: { repository: 'Ventusltd/data-grid-gb',
product: 'derived/gb-transmission-network.v1.json',
schema: 'data-grid-gb.transmission-network.v1' },
contributes: 'circuits, transformers, planned changes and neighbouring '
+ 'sites at a named substation, per voltage',
/* Generation 202609012135: the module alone is not the source. At v9.67
this probe said "ready" because the module object existed, while
the ten-megabyte product it indexes had never been fetched by any
cartridge - the module was on disk and answered nothing. Ready now
means the product is indexed; idle means it will load on the first
click that asks; the other states are what the loader says. */
probe: (w) => {
if (!w.__GRIDATLAS_MODULES__?.networkTopology) return 'absent';
const loader = w.__GRIDATLAS_TOPOLOGY__;
if (!loader) return 'module present, no loader in this composition';
if (loader.state === 'ready') return 'ready';
if (loader.state === 'loading') return 'loading';
if (loader.state === 'failed') return 'failed to load';
return 'idle, loads on first use';
},
detail: (w) => ({ sites: w.__GRIDATLAS_TOPOLOGY__?.sites || null,
bytes: w.__GRIDATLAS_TOPOLOGY__?.bytes || null,
schema: w.__GRIDATLAS_TOPOLOGY__?.schema || null })
},
{
id: 'declared-connections',
surface: '__GRIDATLAS_MODULES__.declaredConnections',
contributes: 'points of connection bound to a made Order or a published '
+ 'planning document',
probe: (w) => (w.__GRIDATLAS_MODULES__?.declaredConnections?.count > 0 ? 'ready' : 'absent'),
detail: (w) => ({ records: w.__GRIDATLAS_MODULES__?.declaredConnections?.count || null })
},
{
id: 'gb-electricity-conditions',
surface: '__GRIDATLAS_GB_CONDITIONS__',
contributes: 'the GB wholesale price context a project card carries: '
+ 'negative-price days and the record daily mean, from the owner rollup',
requires: { repository: 'Ventusltd/data-gb-electricity',
product: 'derived/price-decade-rollup.json',
schema: 'data-gb-electricity.price-decade-rollup.v2' },
/* Withheld is its own state: the product was reached and was not the
schema this consumer answers, so the panel shows nothing and says
why. That is neither a failure of the network nor a source ready. */
probe: (w) => {
const loader = w.__GRIDATLAS_GB_CONDITIONS__;
if (!loader) return 'absent';
if (loader.state === 'ready') return 'ready';
if (loader.state === 'loading') return 'loading';
if (loader.state === 'failed') return 'failed to load';
if (loader.state === 'withheld') return 'withheld: ' + String(loader.reason || 'schema not supported');
return 'idle, loads on first use';
},
detail: (w) => ({ schema: w.__GRIDATLAS_GB_CONDITIONS__?.schema || null,
renders: w.__GRIDATLAS_GB_CONDITIONS__?.renders || 0 })
}
];
const READY = 'ready';
/**
* Probe every declared source against a window.
* @param scope the window to read; defaults to this one. Passing it in is
* what lets a proof drive the probe without a browser.
*/
function survey(scope) {
const w = scope || window;
const sources = SOURCES.map((source) => {
let state = 'absent';
let detail = null;
try { state = source.probe(w) || 'absent'; }
catch (error) { state = `probe threw: ${error && error.message}`; }
if (state === READY && typeof source.detail === 'function') {
try { detail = source.detail(w); } catch (_) { detail = null; }
}
return { id: source.id, surface: source.surface,
contributes: source.contributes, requires: source.requires || null,
state, ready: state === READY, detail };
});
const ready = sources.filter(s => s.ready);
const missing = sources.filter(s => !s.ready);
return {
schema: 'gridatlas.module.source-registry.v1',
sources,
ready: ready.map(s => s.id),
missing: missing.map(s => ({ id: s.id, state: s.state })),
counts: { declared: sources.length, ready: ready.length, missing: missing.length },
/* Written as a sentence here so a card cannot compose its own and get
it wrong, and so an absence is never presented as an absence in the
world rather than in this page. */
sentence: missing.length === 0
? `All ${sources.length} sources answered.`
: `${ready.length} of ${sources.length} sources answered. Not answering: `
+ missing.map(s => `${s.id} (${s.state})`).join(', ')
+ '. What they would have added is missing from this answer, not '
+ 'absent from the world.'
};
}
/** Is one source usable right now. */
function ready(id, scope) {
const source = SOURCES.find(s => s.id === id);
if (!source) return false;
try { return source.probe(scope || window) === READY; }
catch (_) { return false; }
}
NS.sourceRegistry = Object.freeze({
schema: 'gridatlas.module.source-registry.v1',
declared: SOURCES.map(s => s.id),
survey,
ready
});
})();
/**
* Module: declared-connections
*
* The 400 kV public record: what each DCO-scale scheme has DECLARED as its
* point of connection, taken from Development Consent Orders, Planning
* Inspectorate documents and public project statements. The table binds a
* register identity (REPD ref) to a NAMED substation, and the functions
* here bind that name to the served payload and measure the distance -
* measured, never asserted.
*
* The rule this exists to keep: bind to the public record or say nothing.
* A nearest-substations list is a measurement; it was listing closer 33 and
* 132 kV points under schemes whose Order names a 400 kV connection, which
* read as connecting them to the wrong network. This table is the answer,
* and it is data with three small functions, so it lives in a module where
* a proof can read every record and a cut can hash it on its own.
*
* WHAT IT WILL NOT DO
* It does not say whether a connection is available, likely or adequate. A
* declared point of connection is a fact about a consent, not a judgement
* about the network. `poc_status` distinguishes a far end that exists from
* one not yet built or under construction, because drawing both the same
* would say something untrue.
*
* Extracted from the sld-sandbox body at generation 202609012128 (UTC),
* record for record; the parity proof reads the previously served bytes
* and asserts the table is unchanged.
*
* Pure. No DOM, no network, no state. Depends on: geodesy.
*/
(() => {
'use strict';
const NS = (window.__GRIDATLAS_MODULES__ = window.__GRIDATLAS_MODULES__ || {});
if (NS.declaredConnections) return;
const geodesy = NS.geodesy;
if (!geodesy) throw new Error('declared-connections requires the geodesy module');
const distanceKm = geodesy.distanceKm;
const RECORDS = Object.freeze({
'10914': { works: "an up to 400 kV substation collating the satellite sites at 132 kV and site generation at 33 kV (Work No. 4A)",
poc_works: "reuse of an ex-generation bay: busbars, a 400 kV 3-phase 4000 A breaker, metering and protection (Work No. 5)",
substation: 'Cottam Substation',
via: 'a new 400 kV scheme substation consented within the DCO',
source: 'Cottam Solar Project Order 2024, granted 5 Sep 2024 (EN010133)' },
'10915': { works: "an up to 400 kV substation collating the satellite sites at 132 kV and site generation at 33 kV (Work No. 4A)",
poc_works: "reuse of an ex-generation bay: busbars, a 400 kV 3-phase 4000 A breaker, metering and protection (Work No. 5)",
substation: 'Cottam Substation',
via: 'a new 400 kV scheme substation consented within the DCO',
source: 'Cottam Solar Project Order 2024, granted 5 Sep 2024 (EN010133)' },
'10916': { works: "an up to 400 kV customer substation at West Burton 3 with reactive power units; up to 132 kV site substations at WB1 and WB2 (Works 3A-3C)",
poc_works: "a new GIS bay by extension of main busbar 4 and reserve busbar 3/4 gas zones (Work No. 4)",
substation: 'West Burton Substation',
via: 'a new 400 kV customer substation at West Burton 3 and a 400 kV cable to the former generator bay',
source: 'West Burton Solar Project Order, granted 24 Jan 2025 (EN010132)' },
'10917': { works: "an up to 400 kV customer substation at West Burton 3 with reactive power units; up to 132 kV site substations at WB1 and WB2 (Works 3A-3C)",
poc_works: "a new GIS bay by extension of main busbar 4 and reserve busbar 3/4 gas zones (Work No. 4)",
substation: 'West Burton Substation',
via: 'a new 400 kV customer substation at West Burton 3 and a 400 kV cable to the former generator bay',
source: 'West Burton Solar Project Order, granted 24 Jan 2025 (EN010132)' },
'9809': { works: "a scheme substation with reactive power units and a 400 kV harmonic filter compound (Work No. 3)",
poc_works: "one new 400 kV generation bay at Cottam (Work No. 4C)",
substation: 'Cottam Substation',
via: 'a new 400 kV scheme substation and a 7.5 km 400 kV underground cable',
source: 'Gate Burton Energy Park Order, granted 2024 (EN010131)' },
'9810': { works: "a scheme substation with reactive power units and a 400 kV harmonic filter compound (Work No. 3)",
poc_works: "one new 400 kV generation bay at Cottam (Work No. 4C)",
substation: 'Cottam Substation',
via: 'a new 400 kV scheme substation and a 7.5 km 400 kV underground cable',
source: 'Gate Burton Energy Park Order, granted 2024 (EN010131)' },
'12281': { works: "two scheme substations, each 2 x 400/33 kV 150/75/75 MVA transformers with 400 kV GIS (Works 3A-3B)",
poc_works: "the standard 400 kV bay kit at a free bay at Cottam (Work No. 5)",
substation: 'Cottam Substation',
via: 'an 18.5 km 400 kV underground cable to a free bay',
source: 'Tillbridge Solar Order 2025 (EN010142)' },
'12282': { works: "two scheme substations, each 2 x 400/33 kV 150/75/75 MVA transformers with 400 kV GIS (Works 3A-3B)",
poc_works: "the standard 400 kV bay kit at a free bay at Cottam (Work No. 5)",
substation: 'Cottam Substation',
via: 'an 18.5 km 400 kV underground cable to a free bay',
source: 'Tillbridge Solar Order 2025 (EN010142)' },
'14806': { poc_status: 'not_built',
poc_status_note: 'the point of connection is NGET\u2019s new substation beside the existing High Marnham, built as Great Grid Upgrade works; the line is drawn to the existing site',
substation: 'High Marnham Substation',
via: "NGET's new substation adjacent to the existing High Marnham (Great Grid Upgrade)",
source: 'One Earth Solar Farm DCO, consented (EN010159)' },
'14807': { poc_status: 'not_built',
poc_status_note: 'the point of connection is NGET\u2019s new substation beside the existing High Marnham, built as Great Grid Upgrade works; the line is drawn to the existing site',
substation: 'High Marnham Substation',
via: "NGET's new substation adjacent to the existing High Marnham (Great Grid Upgrade)",
source: 'One Earth Solar Farm DCO, consented (EN010159)' },
'13599': { works: "up to four 33-400 kV transformers (160 t, up to 15 x 9.5 x 10.5 m each) in a compound of up to 40,000 m2 (ES Ch.2 s2.8)",
poc_works: "a National Grid-delivered extension of Bicker Fen, AIS or GIS, sited for multiple customers (s2.13)",
substation: 'Bicker Fen Substation',
via: 'a 400 kV cable and a consented extension of Bicker Fen shared with Heckington Fen',
source: 'Beacon Fen Energy Park DCO, granted Aug 2026 (EN010151)' },
'13600': { works: "up to four 33-400 kV transformers (160 t, up to 15 x 9.5 x 10.5 m each) in a compound of up to 40,000 m2 (ES Ch.2 s2.8)",
poc_works: "a National Grid-delivered extension of Bicker Fen, AIS or GIS, sited for multiple customers (s2.13)",
substation: 'Bicker Fen Substation',
via: 'a 400 kV cable and a consented extension of Bicker Fen shared with Heckington Fen',
source: 'Beacon Fen Energy Park DCO, granted Aug 2026 (EN010151)' },
'9806': { works: "transformers with bunding and blast walls, switchgear, and harmonic filtering reactive power compensation (Work No. 4)",
poc_works: "a new generation bay plus an AIS-or-GIS extension and a cable sealing end compound at Bicker Fen (Works 6A-6C)",
substation: 'Bicker Fen Substation',
via: 'the consented Bicker Fen extension shared with Beacon Fen',
source: 'Heckington Fen Solar Park DCO, granted (EN010123)' },
'9807': { works: "transformers with bunding and blast walls, switchgear, and harmonic filtering reactive power compensation (Work No. 4)",
poc_works: "a new generation bay plus an AIS-or-GIS extension and a cable sealing end compound at Bicker Fen (Works 6A-6C)",
substation: 'Bicker Fen Substation',
via: 'the consented Bicker Fen extension shared with Beacon Fen',
source: 'Heckington Fen Solar Park DCO, granted (EN010123)' },
'13644': { poc_status: 'under_construction',
poc_status_note: 'a new 400 kV four-bay substation is under construction at Thorpe Marsh',
substation: 'Thorpe Marsh Substation',
via: 'a new 400 kV four-bay substation under construction at Thorpe Marsh',
source: 'public planning and contractor records; construction under way' },
'19801': { poc_status: 'under_construction',
poc_status_note: 'a new 400 kV four-bay substation is under construction at Thorpe Marsh',
substation: 'Thorpe Marsh Substation',
via: 'a new 400 kV four-bay substation under construction at Thorpe Marsh',
source: 'public planning and contractor records; construction under way' },
/* Little Crow is the counter-archetype and belongs here precisely
because it is NOT a 400 kV story: no customer transmission
substation, no long cable, and a point of connection that is a
circuit crossing the site rather than a substation to draw a line
to. Stating that plainly is worth more than drawing nothing. */
'6557': { poc_kind: 'circuit', poc_status: 'existing',
circuit: 'the Keadby \u2013 Broughton \u2013 Teed \u2013 Scawby Brook overhead 132 kV line circuit (Northern Powergrid)',
via: 'a looped connection into an existing 132 kV circuit within the site, with 99.9 MW of export capacity secured',
kv: 132,
source: 'Little Crow Solar Park Grid Network Constraints Report, EN010101, November 2020' },
'7175': { poc_kind: 'circuit', poc_status: 'existing',
circuit: 'the Keadby \u2013 Broughton \u2013 Teed \u2013 Scawby Brook overhead 132 kV line circuit (Northern Powergrid)',
via: 'a looped connection into an existing 132 kV circuit within the site, with 99.9 MW of export capacity secured',
kv: 132,
source: 'Little Crow Solar Park Grid Network Constraints Report, EN010101, November 2020' },
'11928': { substation: 'West Burton Substation',
via: 'a 400 kV grid connection at the former power station site (West Burton C); financial close July 2026',
source: 'public project records' }
});
/* Public works at named substations, shown wherever the name is - the
"customer and NG substations that do not exist yet" half of the logic.
Descriptions of the network, never advice about a scheme. */
const SUBSTATION_WORKS = Object.freeze({
'thorpe marsh substation':
'A new 400 kV four-bay substation is under construction here (public record).',
'high marnham substation':
'NGET is building a new substation adjacent to the existing one (Great Grid Upgrade, public record).',
'bicker fen substation':
'A consented extension here will connect Beacon Fen and Heckington Fen (public record).'
});
const worksAt = (name) => SUBSTATION_WORKS[String(name || '').toLowerCase()] || null;
/* What the Order says is known the moment the identity is known: the
substation, the voltage class, the route, the consented works and the
citation need no payload, no fetch and no map. The distance is the one
part that must be measured, so it is the one part marked pending. */
function provisional(repdRef) {
const declared = RECORDS[String(repdRef || '')];
if (!declared) return null;
if (declared.poc_kind === 'circuit') {
// Nothing to measure to and nothing to draw: say what is declared.
return { poc: declared.circuit, kv: declared.kv || null, at: null,
km: null, pending: false, kind: 'circuit',
poc_status: declared.poc_status || 'existing',
via: declared.via, source: declared.source, works: null,
customer_works: declared.works || null, poc_works: declared.poc_works || null };
}
return {
poc: declared.substation, kv: 400, at: null, km: null, pending: true,
kind: 'substation', poc_status: declared.poc_status || 'existing',
poc_status_note: declared.poc_status_note || null,
via: declared.via, source: declared.source,
works: worksAt(declared.substation),
customer_works: declared.works || null,
poc_works: declared.poc_works || null
};
}
/* Bind the declared name to the served payload. Only a substation of the
declared class (>= 400 kV) with exactly that name counts; a 132 kV site
that happens to share the name is not the point of connection. */
function resolve(repdRef, origin, subs) {
const declared = RECORDS[String(repdRef || '')];
if (!declared) return null;
if (declared.poc_kind === 'circuit') return provisional(repdRef);
const wanted = declared.substation.toLowerCase();
const works = SUBSTATION_WORKS[wanted] || null;
const match = (Array.isArray(subs) ? subs : [])
.filter(s => String(s.name).toLowerCase() === wanted
&& Array.isArray(s.kv) && s.kv[0] >= 400)
.sort((a, b) => b.kv[0] - a.kv[0])[0] || null;
if (!match) {
return { poc: declared.substation, kv: 400, at: null, km: null,
kind: 'substation', poc_status: declared.poc_status || 'existing',
poc_status_note: declared.poc_status_note || null,
via: declared.via, source: declared.source, works,
customer_works: declared.works || null,
poc_works: declared.poc_works || null };
}
return { poc: match.name, kv: Math.round(match.kv[0]), at: match.at,
km: distanceKm(origin[0], origin[1], match.at[0], match.at[1]),
kind: 'substation', poc_status: declared.poc_status || 'existing',
poc_status_note: declared.poc_status_note || null,
via: declared.via, source: declared.source, works,
customer_works: declared.works || null,
poc_works: declared.poc_works || null };
}
/* The nearest transmission (>= 400 kV) substation in the payload, and
separately the nearest one WITH A NAME: an unnamed OSM node can win on
raw distance and the reader still wants an identity. Two measurements,
no judgement about either. */
function nearestTransmission(origin, subs) {
let best = null;
let bestNamed = null;
/* The size of the sample this superlative is drawn from. Counted here
rather than recounted by a caller, because the predicate below is
what decides eligibility and a second implementation of it would
drift from this one. */
let considered = 0;
for (const s of (Array.isArray(subs) ? subs : [])) {
if (!(Array.isArray(s.kv) && s.kv[0] >= 400)) continue;
considered += 1;
const km = distanceKm(origin[0], origin[1], s.at[0], s.at[1]);
if (!best || km < best.km) {
best = { name: s.name || 'Unnamed substation', km, at: s.at };
}
if (s.name && (!bestNamed || km < bestNamed.km)) {
bestNamed = { name: s.name, km, at: s.at };
}
}
if (best) {
best.considered = considered;
best.works = worksAt(best.name);
if (bestNamed && bestNamed.name !== best.name) {
best.named = bestNamed;
best.named.works = worksAt(bestNamed.name);
}
}
return best;
}
NS.declaredConnections = Object.freeze({
schema: 'gridatlas.module.declared-connections.v1',
records: RECORDS,
substationWorks: SUBSTATION_WORKS,
count: Object.keys(RECORDS).length,
isDeclared: (repdRef) => Object.prototype.hasOwnProperty.call(RECORDS, String(repdRef || '')),
worksAt,
provisional,
resolve,
nearestTransmission
});
})();
/**
* Module: sizing-arithmetic
*
* The screening arithmetic of the SLD sandbox: physical inputs to array
* statistics, the three named ratios (design, export, headroom), the
* string and central topologies with their corrected nameplates, the
* finance port of gis-sld-v5-finance.js, and the two-variable fit that
* lands a layout on the capacity the register states.
*
* Lifted out of the sld-sandbox body at generation 202609012205 (UTC),
* expression for expression. The body closed over its state object and
* its finance defaults; here both are parameters. Nothing else changed,
* and the parity proof evaluates the last inline copy beside this module
* on the same inputs and asserts identical values.
*
* WHAT IT WILL NOT DO
* It grades nothing. A ratio below one is stated with its meaning; an
* export set by the transformers is stated as the design fact it is. The
* finance figures are a screening model with the reference's own inputs
* and are labelled as such by the panel that shows them.
*
* Pure. No DOM, no network, no state of its own: fitToStatedCapacity
* mutates the state object it is handed, as the body's did, and says so.
*/
(() => {
const NS = window.__GRIDATLAS_MODULES__ = window.__GRIDATLAS_MODULES__ || {};
if (NS.sizingArithmetic) return;
function physicalInputs(inputs) {
const i = inputs;
if (i.mode === 'central') {
return {
mod_wp: i.mod_wp_c, mod_l: i.mod_l_c, mod_w: i.mod_w_c,
gcr: i.gcr_c, gross_factor: i.gross_factor_c,
};
}
return {
mod_wp: i.mod_wp, mod_l: i.mod_l, mod_w: i.mod_w,
gcr: i.gcr, gross_factor: i.gross_factor,
};