In this section
- Model transform · globalgrid2050 / automation/primary_note_ui/f421513f7cbd85ad45727ef236e053a6c67f92d9/model.mjs lines 1–143
- Brief render · globalgrid2050 / automation/primary_note_ui/host-202611170512/brief.mjs lines 1–85
- Ticker Crisp UI — V941 Style Sheet render · globalgrid2050 / automation/ticker_crisp_ui/20261117-v941/styles.css lines 1–4
- Header render · globalgrid2050 / automation/ticker_neon_ui/20261117-v940/header.mjs lines 1–8
- Ticker interaction · globalgrid2050 / automation/ticker_neon_ui/20261117-v940/ticker.mjs lines 1–29
- Feedback render · globalgrid2050 / automation/v923-recovery/feedback.py lines 1–115
- Repair render · globalgrid2050 / automation/v923-recovery/repair.py lines 1–233
Model
A JavaScript module in the primary note ui folder of GlobalGrid2050 that builds primary notes (`buildPrimaryNotes`), covering notes, using SHA-256.
transformglobalgrid2050 / automation/primary_note_ui/f421513f7cbd85ad45727ef236e053a6c67f92d9/model.mjs · lines 1–143 of 143 · Not reached from any entry point (candidate for review) · pattern buildPrimaryNotes (shared by 2 files)
- What it does
- It calculates notes. Defines 14 functions or classes, including requireValid, freeze, jsonCopy, serial, keys.
- Inputs & outputs
- In: JSON file notes.json.
- What it achieves
- It builds primary notes (`buildPrimaryNotes`) and is built from the require valid helper (`requireValid`) and the freeze step (`freeze`). Offline curated primary notes. Individually reviewed associations, not a matcher.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · automation/primary_note_ui/f421513f7cbd85ad45727ef236e053a6c67f92d9 · JavaScript module
- Uses
- Catalogue (import), ./notes.json
- Used by
- none found
- Produces
- utcInstant, CURATED_NOTES, buildPrimaryNotes
- Defines here
- requireValid, freeze, jsonCopy, serial, keys, same, https, utcInstant, day, canonical, field, clocks, validate, buildPrimaryNotes
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/primary_note_ui/f421513f7cbd85ad45727ef236e053a6c67f92d9/model.mjs:1-143 · blob f87162d8ec7f21cb794b1b0cd120b9a65fb093ef · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: transform · effects: none found · domain stage: unknown · users: none · canonical: duplicate_candidate
/* Offline curated primary notes. Individually reviewed associations, not a matcher. */
import data from './notes.json' with {type:'json'};
import {CATALOGUE,CATALOGUES} from './catalogue.mjs';
const SCHEMA='globalgrid2050.primary-notes.v1';
const requireValid=(ok,why)=>{if(!ok)throw Error('Primary note withheld: '+why);};
function freeze(value){if(value&&typeof value==='object'){for(const child of Object.values(value))freeze(child);Object.freeze(value);}return value;}
function jsonCopy(value,seen=new Set(),depth=0){
requireValid(depth<=20,'JSON depth');
if(value===null||typeof value==='boolean')return value;
if(typeof value==='string'){requireValid(value.length<=20000,'JSON text bound');return value;}
if(typeof value==='number'){requireValid(Number.isFinite(value),'finite JSON number');return value;}
requireValid(value&&typeof value==='object'&&!seen.has(value),'plain acyclic JSON required');
const array=Array.isArray(value),prototype=Object.getPrototypeOf(value);
requireValid(array?prototype===Array.prototype:prototype===Object.prototype||prototype===null,'plain JSON prototype');
const own=Reflect.ownKeys(value);requireValid(own.length<=1000,'JSON member bound');
seen.add(value);const result=array?[]:Object.create(null);
for(const key of own){
if(array&&key==='length')continue;
const descriptor=Object.getOwnPropertyDescriptor(value,key);
requireValid(typeof key==='string'&&descriptor.enumerable&&'value'in descriptor,'JSON accessors or hidden fields forbidden');
if(array)requireValid(/^(0|[1-9]\d*)$/.test(key)&&Number(key)<value.length,'JSON array keys');
result[key]=jsonCopy(descriptor.value,seen,depth+1);
}
if(array)requireValid(result.length===value.length&&Object.keys(result).length===value.length,'dense JSON arrays required');
seen.delete(value);return result;
}
const serial=value=>value&&typeof value==='object'?Array.isArray(value)?'['+value.map(serial).join(',')+']':'{'+Object.keys(value).sort().map(k=>JSON.stringify(k)+':'+serial(value[k])).join(',')+'}':JSON.stringify(value);
function keys(value,wanted,role){requireValid(value&&typeof value==='object'&&!Array.isArray(value)&&serial(Object.keys(value).sort())===serial([...wanted].sort()),role+' fields');}
function same(actual,expected,role){requireValid(serial(actual)===serial(expected),role+' differs from reviewed catalogue');}
function https(value){
requireValid(typeof value==='string'&&!/[\u0000-\u0020]/.test(value),'unsafe URL');let url;
try{url=new URL(value);}catch{throw Error('Primary note withheld: unsafe URL');}
requireValid(url.protocol==='https:'&&url.hostname&&!url.username&&!url.password&&!url.port&&!url.hash,'unsafe URL');return value;
}
// Compare actual UTC instants at nanosecond precision, including receipt fractions.
export function utcInstant(value){
requireValid(typeof value==='string','UTC timestamp');
const match=value.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))?(Z|\+00:00)$/);
requireValid(match,'UTC timestamp');const [year,month,day,hour,minute,second]=match.slice(1,7).map(Number);
requireValid(year>=1900&&year<=2100&&hour<24&&minute<60&&second<60,'UTC range');
const ms=Date.UTC(year,month-1,day,hour,minute,second);
requireValid(new Date(ms).toISOString().slice(0,19)===value.slice(0,19),'UTC calendar');
return BigInt(ms)*1000000n+BigInt((match[7]||'').padEnd(9,'0'));
}
function day(value){requireValid(typeof value==='string'&&/^\d{4}-\d{2}-\d{2}$/.test(value),'date');return utcInstant(value+'T00:00:00Z');}
function canonical(projects){
requireValid(Array.isArray(projects)&&Object.getPrototypeOf(projects)===Array.prototype,'plain canonical array required');
const population=CATALOGUE.canonical.expected_population,length=Object.getOwnPropertyDescriptor(projects,'length');
requireValid(length&&'value'in length&&length.value===population,'complete canonical population required');
const members=Reflect.ownKeys(projects);
requireValid(members.length===population+1&&members.every(key=>key==='length'||typeof key==='string'&&/^(0|[1-9]\d*)$/.test(key)&&Number(key)<population),'canonical array JSON members');
const refs=new Set(),ids=new Set(),matches=new Map(CATALOGUES.map(entry=>[entry.catalogue.source.planning_reference,[]]));
requireValid(matches.size===4,'reviewed catalogue identity closure');
const field=(row,name)=>{const d=Object.getOwnPropertyDescriptor(row,name);requireValid(!d||'value'in d,'canonical accessors forbidden');return d?.value;};
for(let index=0;index<population;index++){
const descriptor=Object.getOwnPropertyDescriptor(projects,String(index));
requireValid(descriptor&&descriptor.enumerable&&'value'in descriptor,'dense canonical array data required');
const row=descriptor.value;
requireValid(row&&typeof row==='object','canonical row');const ref=field(row,'repd_ref'),id=field(row,'gg_project_id');
requireValid(typeof ref==='string'&&/^[1-9]\d*$/.test(ref)&&id==='GG2050-REPD-'+ref,'canonical original IDs');
requireValid(!refs.has(ref)&&!ids.has(id),'duplicate canonical identity');refs.add(ref);ids.add(id);
const planning=field(row,'planning_application_reference');
if(matches.has(planning))matches.get(planning).push(row);
}
const accepted=new Map();
for(const entry of CATALOGUES){
const found=matches.get(entry.catalogue.source.planning_reference);
requireValid(found.length===1,'exact planning reference must be unique within browser population');
const row=jsonCopy(found[0]);
for(const [field,expected] of Object.entries(entry.catalogue.canonical.fields))same(row[field],expected,'canonical '+field);
accepted.set(entry.note_id,row);
}
return accepted;
}
function clocks(note,cutoff){
const source=note.source,review=note.evidence_review,news=note.news_metadata;
const feed=news.basis==='EXISTING_FEED_METADATA_ONLY';
const moments=[source.retrieved_at,review.independent_review_at,review.curated_at,news.read_at,news.published_at,
...(feed?[news.feed_generated_at,news.first_seen]:[news.administrative_updated_at,source.corroboration.retrieved_at]),
...note.rights.terms_receipts.map(r=>r.retrieved_at)];
requireValid(moments.every(value=>utcInstant(value)<=cutoff),'future receipt, publication or evaluation clock');
for(const value of [source.document_date,source.document_stated_publication_date,note.claim.decision_date,note.claim.source_application_submitted,
...(feed?[]:[note.claim.source_application_accepted])])requireValid(day(value)<=cutoff,'future document/event date');
if(source.headers['Last-Modified']!==null){
const modified=Date.parse(source.headers['Last-Modified']);requireValid(Number.isFinite(modified)&&BigInt(modified)*1000000n<=cutoff,'future/invalid HTTP clock');
}
requireValid(day(note.claim.decision_date)<=day(source.document_date)&&day(source.document_stated_publication_date)<=utcInstant(source.retrieved_at),'decision/publication chronology');
requireValid(utcInstant(source.retrieved_at)<=utcInstant(review.independent_review_at)&¬e.rights.terms_receipts.every(r=>utcInstant(r.retrieved_at)<=utcInstant(review.independent_review_at)),'primary review chronology');
if(feed)requireValid(utcInstant(news.published_at)<=utcInstant(news.first_seen)&&utcInstant(news.first_seen)<=utcInstant(news.feed_generated_at)&&
utcInstant(news.feed_generated_at)<=utcInstant(news.read_at),'auxiliary metadata/curation chronology');
else requireValid(utcInstant(news.published_at)<=utcInstant(news.read_at)&&
utcInstant(source.corroboration.retrieved_at)<=utcInstant(review.independent_review_at)&&
day(note.claim.source_application_submitted)<=day(note.claim.source_application_accepted)&&
day(note.claim.source_application_accepted)<=day(note.claim.decision_date),'government publication chronology');
requireValid(utcInstant(news.read_at)<=utcInstant(review.curated_at)&&
utcInstant(review.independent_review_at)<=utcInstant(review.curated_at),'auxiliary metadata/curation chronology');
}
function validate(note,row,catalogue,noteId,cutoff){
note=jsonCopy(note);
keys(note,['id','association','binding','source','rights','claim','news_metadata','evidence_review'],'note');
requireValid(note.id===noteId&¬e.association==='PROVISIONAL','only reviewed provisional association allowed');
keys(note.binding,['repd_ref','gg_project_id','planning_reference','canonical_edition','canonical_partition','canonical_partition_sha256'],'binding');
requireValid(note.binding.repd_ref===row.repd_ref&¬e.binding.gg_project_id===row.gg_project_id&&
note.binding.planning_reference===row.planning_application_reference,'exact binding mismatch');
same(note.binding,{repd_ref:row.repd_ref,gg_project_id:row.gg_project_id,planning_reference:row.planning_application_reference,
canonical_edition:catalogue.canonical.edition,canonical_partition:catalogue.canonical.partition,canonical_partition_sha256:catalogue.canonical.partition_sha256},'canonical snapshot');
requireValid(note.source&¬e.rights&¬e.claim&¬e.news_metadata&¬e.evidence_review&&
Array.isArray(note.rights.terms_receipts)&¬e.source.headers,'source/rights/claim receipts required');
for(const field of ['source','rights','claim','news_metadata'])keys(note[field],Object.keys(catalogue[field]),field);
keys(note.evidence_review,Object.keys(catalogue.review),'evidence review');
for(const receipt of note.rights.terms_receipts)keys(receipt,['url','bytes','sha256','retrieved_at'],'rights receipt');
const optionalUrls=[note.news_metadata.article_url,note.source.corroboration?.url,note.claim.development_scope?.full_identity_fixture_url,note.claim.capacity_context?.government_reported_source_url].filter(url=>url!==undefined);
for(const url of [note.source.url,note.source.project_url,note.rights.licence_url,note.news_metadata.source_url,...optionalUrls,...note.rights.terms_receipts.map(r=>r.url)])https(url);
clocks(note,cutoff);
// Exact trusted document and claim scope, not caller rights flags or a common hostname.
same(note.source,catalogue.source,'source receipt');same(note.rights,catalogue.rights,'narrow rights evidence');
same(note.claim,catalogue.claim,'bounded decision claim');same(note.news_metadata,catalogue.news_metadata,'auxiliary metadata');
same(note.evidence_review,catalogue.review,'actual review metadata');
return freeze(note);
}
export const CURATED_NOTES=freeze(data);
export function buildPrimaryNotes(projects,options={}){
options=jsonCopy(options);
requireValid(options&&typeof options==='object'&&!Array.isArray(options)&&Object.keys(options).every(k=>['asOf','records'].includes(k)),'unsupported evaluation options');
const {asOf,records=CURATED_NOTES.notes}=options;
const cutoff=utcInstant(asOf);same(CURATED_NOTES.schema,SCHEMA,'curated schema');const rows=canonical(projects);
requireValid(CURATED_NOTES.notes.length===4,'complete curated note closure');
requireValid(Array.isArray(records)&&records.length<=10,'bounded note records');const proposals=jsonCopy(records),ids=new Set(),bindings=new Set();
for(const record of proposals){
requireValid(record&&typeof record==='object','note object');const binding=record.binding?.gg_project_id;
requireValid(!ids.has(record.id)&&!bindings.has(binding),'duplicate note/binding');ids.add(record.id);bindings.add(binding);
}
requireValid(proposals.length===0||proposals.length===4,'complete four-note proposal required');
const accepted=proposals.map(record=>{
const entry=CATALOGUES.find(item=>item.note_id===record.id);
requireValid(entry,'unreviewed note identity');
return validate(record,rows.get(record.id),entry.catalogue,entry.note_id,cutoff);
});
const byRef=Object.create(null),byId=Object.create(null);
for(const note of accepted){byRef[note.binding.repd_ref]=[note];byId[note.binding.gg_project_id]=[note];}
return freeze({schema:SCHEMA,validated_as_of:asOf,association_count:accepted.length,verified_count:0,solar1000_verified_delta:0,
by_repd_ref:byRef,by_project_id:byId});
}Brief
A JavaScript module in the primary note ui folder of GlobalGrid2050 that works with decorate primary button (`decoratePrimaryButton`), covering the Renewable Energy Planning Database (REPD) register and solar, using SHA-256.
renderglobalgrid2050 / automation/primary_note_ui/host-202611170512/brief.mjs · lines 1–85 of 85 · version 2026-11-17 05:12 · Not reached from any entry point (candidate for review)
- What it does
- It draws the REPD register and solar. Defines el, date, link, decoratePrimaryButton, appendPrimaryBrief. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain terms in the code: the REPD register, solar.
- What it achieves
- It appends primary brief (`appendPrimaryBrief`) and is built from the date step (`date`) and the link step (`link`). ROOT renderer for the existing Machine Read Notes brief; no new panel.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · automation/primary_note_ui/host-202611170512 · JavaScript module
- Uses
- none found
- Used by
- none found
- Produces
- decoratePrimaryButton, appendPrimaryBrief
- Defines here
- el, date, link, decoratePrimaryButton, appendPrimaryBrief
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/primary_note_ui/host-202611170512/brief.mjs:1-85 · blob 55694a533050827ca1a7ae037506285db8bd21fc · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unreached_review
/* ROOT renderer for the existing Machine Read Notes brief; no new panel. */
const el = (tag, text, cls) => {
const node = document.createElement(tag);
if (text !== undefined) node.textContent = String(text);
if (cls) node.className = cls;
return node;
};
function date(value) {
if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return 'Unknown';
const parsed = new Date(value + 'T00:00:00Z');
return Number.isNaN(parsed.getTime()) || parsed.toISOString().slice(0,10) !== value ? 'Unknown' :
parsed.toLocaleDateString('en-GB', {day:'numeric',month:'short',year:'numeric',timeZone:'UTC'});
}
function link(label, value) {
let url;
try {url = new URL(value);} catch {return el('span', label + ' unavailable');}
if (url.protocol !== 'https:' || url.username || url.password || url.port) return el('span', label + ' unavailable');
const node = el('a', label);node.href = url.href;node.target = '_blank';node.rel = 'noopener noreferrer';return node;
}
const outcomes = Object.freeze({
DEVELOPMENT_CONSENT_REFUSED:'Development consent refused',
DEVELOPMENT_CONSENT_GRANTED:'Development consent granted',
DEVELOPMENT_CONSENT_GRANTED_WITH_MODIFICATIONS:'Development consent granted with modifications'
});
export function decoratePrimaryButton(button, note) {
button.replaceChildren(
el('span', 'PROVISIONAL \u00b7 GOVERNMENT DECISION \u00b7 ' + date(note.claim.decision_date).toUpperCase(), 'machine-note-kind'),
el('span', (outcomes[note.claim.type] || 'Government decision') + ' \u00b7 ' + note.binding.planning_reference, 'machine-note-headline')
);
button.dataset.notePrimary = 'provisional';
button.setAttribute('aria-label', 'Provisional project association. Government decision dated ' + date(note.claim.decision_date) + '. Open the source brief.');
button.title = note.source.author + ' \u00b7 provisional association; frozen REPD record retained';
}
export function appendPrimaryBrief(body, note, project) {
const section = el('section', undefined, 'machine-note-source machine-note-primary');
const letter = note.source.authorship === 'GOVERNMENT_DECISION_LETTER';
section.dataset.primaryNoteId = note.id;
section.append(el('h3', 'Primary government decision'), el('p', note.claim.statement.replace(/REPD(\d)/g,'REPD $1')));
section.append(el('p', 'Decision date: ' + date(note.claim.decision_date) + '. ' +
(letter ? 'Letter date: ' : 'Government publication date: ') + date(note.source.document_date) + '.'));
section.append(el('p', note.source.author + ' \u00b7 ' + note.source.locators.decision),
link(letter ? 'Open the government decision letter' : 'Open the government announcement', note.source.url));
const details = el('details');details.append(el('summary', 'Source receipt and qualifications'));
details.append(el('p', 'Frozen REPD status: ' + project.status + '. Record updated ' + date(project.repd_record_updated) + '.'));
details.append(el('p', 'Submission dates remain source-specific: REPD ' + date(project.planning_application_submitted) + '; ' +
(letter ? 'decision letter ' : 'government announcement ') + date(note.claim.source_application_submitted) + '.'));
if (note.claim.source_application_accepted) details.append(el('p', 'Government application acceptance: ' +
date(note.claim.source_application_accepted) + '. Submission and acceptance are separate events.'));
const capacity = note.claim.capacity_context;
if (note.claim.type === 'DEVELOPMENT_CONSENT_REFUSED') {
details.append(el('p', 'The original application and frozen REPD baseline are ' + capacity.original_application_repd_baseline_mw +
' MW. The letter describes a later reduction; the final reduced capacity is not established.'));
details.append(el('p', 'Later project status, installed capacity, electrical connection and judicial review status remain unknown.'));
} else {
details.append(el('p', 'Frozen solar-row REPD baseline: ' + capacity.frozen_solar_row_reported_mw + ' MW. Government capacity description: ' +
capacity.government_reported_mw + ' MW (' + capacity.government_reported_basis + '). Original, final and as-built project capacity are not established by this note.'));
details.append(link('Government capacity description source', capacity.government_reported_source_url));
const scope = note.claim.development_scope, battery = scope.battery_component;
details.append(el('p', 'Consent covers the whole solar-and-storage development. This solar-row association remains provisional. Battery REPD ' +
battery.repd_ref + ' retains a separate identity; its MW and MWh are unknown, with no component capacity allocation.'));
details.append(el('p', 'Government applicant: ' + note.source.government_applicant + '. Frozen REPD operator: ' + project.operator +
'. Corporate ownership equivalence is not established.'));
details.append(el('p', 'Later project status, installed capacity, electrical connection, commissioning and judicial review status remain unknown.'));
}
if (note.news_metadata.basis === 'GOVERNMENT_PUBLICATION_METADATA_ONLY') {
const precision = note.news_metadata.publication_precision;
const publication = precision === 'DAY' ? date(note.news_metadata.published_at.slice(0,10)) + ' (day precision)' :
precision === 'RECORDED_METADATA_TIMESTAMP' ? note.news_metadata.published_at + ' (recorded publication metadata)' : 'Unknown';
details.append(el('p', 'Government page published: ' + publication + '. Administrative update: ' +
note.news_metadata.administrative_updated_at + '. The decision date remains ' + date(note.claim.decision_date) + '.'));
}
details.append(el('p', 'Document retrieved: ' + note.source.retrieved_at + '. Independent review: ' + note.evidence_review.independent_review_at + '.'));
const receipt = el('p', (letter ? 'Observed PDF: ' : 'Observed government HTML: ') +
note.source.bytes.toLocaleString('en-GB') + ' bytes. SHA-256: ' + note.source.sha256);
receipt.style.overflowWrap = 'anywhere';details.append(receipt);
if (note.source.corroboration) {
details.append(link('Corroborating government publication', note.source.corroboration.url));
const observed = el('p', 'Corroborating source retrieved: ' + note.source.corroboration.retrieved_at +
'. Observed bytes: ' + note.source.corroboration.bytes + '. SHA-256: ' + note.source.corroboration.sha256);
observed.style.overflowWrap = 'anywhere';details.append(observed);
}
details.append(el('p', note.rights.attribution), link('Open Government Licence v3.0', note.rights.licence_url));
details.append(el('p', 'Reuse is limited to government-authored decision facts. Applicant and other third-party material, personal information and standalone logos are excluded. No official endorsement is implied.'));
section.append(details);body.append(section);
}Ticker Crisp UI — V941 Style Sheet
A style sheet in the automation folder of GlobalGrid2050.
renderglobalgrid2050 / automation/ticker_crisp_ui/20261117-v941/styles.css · lines 1–4 of 4 · version 2026-11-17 · Entry point
- What it does
- Side effects: changes the web page (DOM).
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/). Reached from 4 other entry points, including GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents); A4 Legal Model (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name. Described from its file name only (a candidate, not yet checked against the code).
- Why it matters
- Loaded by the UK Renewables Pipeline page at https://globalgrid2050.com/uk_renewables_pipeline/202611280922/.
- Application
- globalgrid2050 · automation/ticker_crisp_ui/20261117-v941 · style sheet
- Uses
- none found
- Used by
- loaded by GlobalGrid2050 — UK Renewables 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 automation/ticker_crisp_ui/20261117-v941/styles.css:1-4 · blob 735319190d8c28d5b698fcdabc58d1cbca5e8744 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
/* V9.41: crisp red on solid black; existing focus/touch/reduced-motion rules remain authoritative. */
#headlineTicker,#headlineTicker *{background:#000!important;color:#f33!important;text-shadow:none!important;box-shadow:none!important;filter:none!important;backdrop-filter:none!important}
#headlineTicker{border-color:#333!important}
#headlineTicker .pn-ticker-track{animation-duration:max(12s,calc(var(--pn-cycle-duration,120s)*.84))}Header
A JavaScript module in the ticker neon ui folder of GlobalGrid2050 that imports once, then relocate its real control.
renderglobalgrid2050 / automation/ticker_neon_ui/20261117-v940/header.mjs · lines 1–8 of 8 · version 2026-11-17 · Entry point
- What it does
- It draws its content. Side effects: changes the web page (DOM).
- Downstream impact
- Used directly by 3 files: News Compact (globalgrid2050); GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); Android (globalgrid2050). Reached from 5 other entry points, including GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Loaded by the UK Renewables Pipeline page at https://globalgrid2050.com/uk_renewables_pipeline/202611280922/. Also imported by News Compact. Run by Android.
- Application
- globalgrid2050 · automation/ticker_neon_ui/20261117-v940 · JavaScript module
- Uses
- View (import)
- Used by
- imported by News Compact (import), loaded by GlobalGrid2050 — UK Renewables Pipeline Page (script src), run by Android (script call)
- 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 automation/ticker_neon_ui/20261117-v940/header.mjs:1-8 · blob 8869276a3616ef830fcab0d3386bd8434ebc16ee · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
// Import once, then relocate its real control. Its existing filter closure remains authoritative.
import '../../news_quality_ui/20261117-v937/view.mjs';
const D=document,head=D.querySelector('.newspaper .masthead'),query=D.querySelector('.pn-news-filter-tools input[type="search"]');
if(head&&query&&!head.querySelector('.pn-news-header-search')){
const line=D.createElement('div');line.className='pn-news-header-line';const title=D.getElementById('headlinesHeading');if(title){title.textContent='GLOBALGRID2050 HEADLINES';line.append(title);}
const label=D.createElement('label');label.className='pn-news-header-search';const text=D.createElement('span');text.textContent='NEWS SEARCH';query.setAttribute('aria-label','Search news titles, sources or topics');query.placeholder='Search news';label.append(text,query);line.append(label);head.prepend(line);
const strap=head.querySelector('.strap'),status=D.getElementById('newsStatus');if(strap&&status){head.append(status);const notes=D.createElement('details'),summary=D.createElement('summary');summary.textContent='News scope and matching guidance';notes.className='pn-news-guidance';notes.append(summary,strap);D.querySelector('.pn-news-quality')?.append(notes);}
}Ticker
A JavaScript module in the ticker neon ui folder of GlobalGrid2050. It creates ticker renderer (`createTickerRenderer`) and is built from the listen step (`listen`) and the sync step (`sync`).
interactionglobalgrid2050 / automation/ticker_neon_ui/20261117-v940/ticker.mjs · lines 1–29 of 29 · version 2026-11-17 · pattern preference (shared by 2 files)
- What it does
- It draws its content. Defines 6 functions or classes, including createTickerRenderer, el, listen, sync, measure. Side effects: changes the web page (DOM).
- Downstream impact
- Used directly by 2 files: Ticker (globalgrid2050); Android (globalgrid2050). Reached from 7 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050).
- What it achieves
- Flowing visual strip with one semantic list. It responds to change events.
- Why it matters
- Imported by a file of the same name. Run by Android.
- Application
- globalgrid2050 · automation/ticker_neon_ui/20261117-v940 · JavaScript module
- Uses
- none found
- Used by
- imported by Ticker (import), run by Android (script call)
- Produces
- createTickerRenderer
- Defines here
- createTickerRenderer, el, listen, sync, measure, preference
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/ticker_neon_ui/20261117-v940/ticker.mjs:1-29 · blob 389e3cead27d22fb16dbd2dbac93426713e5cf2e · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
/** Flowing visual strip with one semantic list. Source selection remains owner-injected. */
export function createTickerRenderer(latestHeadlines) {
const states=new WeakMap();
return function renderTicker(host,items,{snapshotLabel='Latest available headlines'}={}) {
const rows=latestHeadlines(items),key=JSON.stringify(rows),old=states.get(host),D=host.ownerDocument,W=D.defaultView;
if(old?.key===key&&old.label.parentNode===host){old.label.textContent=snapshotLabel;return;}
old?.destroy();host.replaceChildren();host.classList.add('pn-ticker','pn-neon-ticker');host.dataset.count=String(rows.length);
const el=(tag,cls,text)=>{const n=D.createElement(tag);if(cls)n.className=cls;if(text!==undefined)n.textContent=text;return n;};
const label=el('span','pn-ticker-label',snapshotLabel),hint=el('span','pn-ticker-hint','Moving headlines pause on focus or hover. Touch to read; tap empty ticker space again to resume. All original links remain available in the static scrolling list.');
const viewport=el('div','pn-ticker-viewport'),track=el('div','pn-ticker-track'),list=el('ul','pn-ticker-cycle');
viewport.tabIndex=0;viewport.setAttribute('role','region');viewport.setAttribute('aria-label','Latest headlines; focus to pause and scroll');viewport.setAttribute('aria-live','off');
list.setAttribute('aria-label','Original headlines with publisher attribution and dates');
for(const row of rows){const li=el('li','pn-ticker-item'),a=el('a','pn-ticker-title',`${row.title} — ${row.source}`),time=el('time','',`${row.dateKind} ${row.date}`);a.href=row.link;a.target='_blank';a.rel='noopener noreferrer';time.dateTime=row.date;li.append(a,' · ',time);list.append(li);}
if(!rows.length)list.append(el('li','pn-ticker-item','Headlines unavailable'));
const copy=el('div','pn-ticker-cycle pn-ticker-copy');copy.setAttribute('aria-hidden','true');copy.setAttribute('inert','');
for(const row of rows){const item=el('div','pn-ticker-item');item.append(el('span','pn-ticker-title',`${row.title} — ${row.source}`),' · ',el('span','pn-ticker-date',`${row.dateKind} ${row.date}`));copy.append(item);}
track.append(list,copy);viewport.append(track);host.append(label,hint,viewport);
const media=W.matchMedia('(prefers-reduced-motion: reduce)'),listeners=[];let touch=false,focused=false,alive=true;
const listen=(n,t,f)=>{n.addEventListener(t,f);listeners.push(()=>n.removeEventListener(t,f));};
function sync(){host.dataset.reading=String(media.matches||focused||touch||rows.length<2);host.dataset.motion=host.dataset.reading==='true'?'static':'flowing';}
function measure(){if(!alive)return;const width=viewport.clientWidth;host.style.setProperty('--pn-viewport-width',width+'px');const cycle=list.getBoundingClientRect().width;host.style.setProperty('--pn-cycle-width',cycle+'px');host.style.setProperty('--pn-cycle-duration',Math.max(12,cycle/42)+'s');}
listen(host,'focusin',e=>{focused=true;sync();e.target.closest('a')?.scrollIntoView({block:'nearest',inline:'nearest'});});listen(host,'focusout',e=>{if(!host.contains(e.relatedTarget)){focused=false;touch=false;sync();}});
listen(host,'pointerdown',e=>{if(e.pointerType!=='touch')return;if(touch&&!e.target.closest('a')){e.preventDefault();touch=false;if(host.contains(D.activeElement))D.activeElement.blur();}else touch=true;sync();});
listen(viewport,'keydown',e=>{if(e.key==='Escape'){touch=false;viewport.blur();sync();}});
const preference=()=>{sync();measure();};media.addEventListener('change',preference);
const observer=W.ResizeObserver?new W.ResizeObserver(measure):null;observer?.observe(viewport);observer?.observe(list);if(!observer)listen(W,'resize',measure);
const state={key,label,destroy(){alive=false;observer?.disconnect();media.removeEventListener('change',preference);listeners.forEach(off=>off());}};states.set(host,state);sync();measure();D.fonts?.ready.then(()=>{if(alive)measure();});
};
}Feedback
A Python command-line tool in the automation folder of GlobalGrid2050 that reads the Renewable Energy Planning Database (REPD) register. It is built from the analyse step (`analyse`).
renderglobalgrid2050 / automation/v923-recovery/feedback.py · lines 1–115 of 115 · Entry point · pattern analyse (shared by 8 files)
- What it does
- It loads the REPD register. Defines analyse, main. Uses libraries __future__, datetime, json, os, sys. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain terms in the code: the REPD register.
- Inputs & outputs
- In: command-line arguments.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 V923 Six Hour Python Repair Workflow (globalgrid2050).
- What it achieves
- Deterministic V9.23 CI feedback: diagnose failures, never self-authorise publication.
- Why it matters
- Run by GlobalGrid2050 V923 Six Hour Python Repair Workflow.
- Application
- globalgrid2050 · automation/v923-recovery · Python CLI
- Uses
- __future__, datetime, json, os, sys, pathlib
- Used by
- run by GlobalGrid2050 V923 Six Hour Python Repair Workflow (workflow run)
- Produces
- analyse, main
- Defines here
- analyse, main
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v923-recovery/feedback.py:1-115 · blob 9510d6e2ee280ad29a672a7163282707ce50a515 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: unknown · users: none · canonical: production_core
#!/usr/bin/env python3
"""Deterministic V9.23 CI feedback: diagnose failures, never self-authorise publication.
The half-hourly workflow writes this report for an independent agent to decide
the next code patch. GitHub Actions cannot infer or fabricate a successful fix.
"""
from __future__ import annotations
import datetime as dt
import json
import os
import sys
from pathlib import Path
TARGET = "202611160020"
SUGGESTED_REPAIRS = {
"tree_unchanged": "Re-run the candidate generator and pin only the new V9.23 tree; never repin historical versions.",
"runner": "Inspect the exact failing V9.23 runner step and its pinned V9.22 parent.",
"map_contract": "Diff every generated MAP deep link against the canonical V9.22 contract; do not change GridAtlas unilaterally.",
"grid_engine_contract": "Test the actual Grid Engine parameters and nearest-result receiver; URLs alone are insufficient.",
"map_links_identical_to_parent": "Restore character-for-character V9.22 MAP href parity for all 7,775 REPD records.",
"data_unchanged_from_parent": "Reject any new candidate that silently rewrites official REPD source data.",
"features_kept": "List the exact inherited feature lost; only the owner's explicit withdrawn features may be retired.",
"feature_probes": "Inspect failed named browser probes; recreate the event in Chromium/WebKit and add a targeted negative test.",
"browser": "Inspect screenshots, JS exceptions, same-origin failures and 390/393 mobile layout independently.",
"csv_export": "Compare all 7,775 exported rows and their exact header/body hashes with the parent.",
"size_budget": "Remove unneeded duplicated assets without touching the frozen source partitions.",
}
def analyse(document: dict | None, head: str = "") -> dict:
now = dt.datetime.now(dt.timezone.utc).isoformat()
result = {
"schema": "globalgrid2050.pipeline-news.v923-ci-feedback.v1",
"generated_at_utc": now,
"candidate": TARGET,
"head": head,
"verdict": "UNVERIFIED",
"failed_checks": [],
"failed_browser_probes": [],
"next_repair_actions": [],
"release_holds": [
"Original publisher rights and independently accepted article-to-REPD binding unverified",
"GridAtlas REPD12588/REPD2470 mobile first-restore regressions remain known issues",
"Independent physical iPhone and served immutable V9.23 byte acceptance pending",
"Production homepage remains V9.22",
],
}
if not document or not isinstance(document.get("versions"), list):
result["next_repair_actions"].append("NO_VERDICT_FILE: inspect the generator and workflow that stopped before release verification.")
return result
version = next((v for v in document["versions"] if v.get("id") == TARGET), None)
if not version:
result["next_repair_actions"].append("MISSING_V923_VERDICT: verify the branch and exact candidate identity.")
return result
checks = version.get("checks") or {}
mandatory = ("tree_unchanged", "runner", "map_contract", "grid_engine_contract",
"map_links_identical_to_parent", "data_unchanged_from_parent", "features_kept")
missing = [name for name in mandatory if name not in checks]
if missing:
result["verdict"] = "INCOMPLETE_VERDICT"
result["next_repair_actions"].append("MISSING_MANDATORY_CHECKS: " + ", ".join(missing))
return result
result["browser_checked"] = version.get("browser_checked") is True
failed = sorted(name for name, value in checks.items() if not isinstance(value, dict) or value.get("pass") is not True)
result["failed_checks"] = failed
for name in failed:
result["next_repair_actions"].append(SUGGESTED_REPAIRS.get(name, "Inspect the raw verdict and add a named regression test for " + name + "."))
if name == "feature_probes":
probes = checks[name].get("results") or []
result["failed_browser_probes"] = [
{"name": p.get("name", "unnamed"), "viewport": p.get("viewport", "unknown"),
"detail": str(p.get("detail") or "")[:500]}
for p in probes if p.get("pass") is not True
][:30]
if failed:
result["verdict"] = "PRODUCT_CI_FAIL"
elif result["browser_checked"]:
result["verdict"] = "PRODUCT_BROWSER_PARITY_PASS_WITH_OPEN_EXTERNAL_HOLDS"
else:
result["verdict"] = "STATIC_PARITY_PASS_BROWSER_AND_GRIDATLAS_PENDING"
return result
def main(argv: list[str]) -> int:
if len(argv) != 4:
raise SystemExit("usage: feedback.py INPUT_VERDICTS_JSON OUTPUT_JSON OUTPUT_MARKDOWN")
incoming, out_json, out_md = map(Path, argv[1:4])
try:
doc = json.loads(incoming.read_text()) if incoming.is_file() else None
except (OSError, ValueError, TypeError):
doc = None
info = analyse(doc, os.getenv("ACTUAL_CANDIDATE_SHA") or os.getenv("GITHUB_SHA", "unverified"))
out_json.parent.mkdir(parents=True, exist_ok=True)
out_json.write_text(json.dumps(info, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
msg = [
"## V9.23 CI feedback (automated, non-publishing)",
"UTC: " + info["generated_at_utc"],
"Exact checkout/commit: " + info["head"],
"Verdict: **" + info["verdict"] + "**",
"Failed checks: " + (", ".join(info["failed_checks"]) or "none measured"),
]
if info["failed_browser_probes"]:
msg.append("Failed browser probes:")
msg.extend("- " + str(p["name"]) + " [" + str(p["viewport"]) + "] " + p["detail"]
for p in info["failed_browser_probes"])
msg.append("Next reproducible repair:")
msg.extend("- " + item for item in (info["next_repair_actions"] or ["No product regression detected; obtain independent evidence and maintain the release hold."]))
msg.append("Release limits (not waived):")
msg.extend("- " + item for item in info["release_holds"])
out_md.write_text("\n".join(msg) + "\n", encoding="utf-8")
print(info["verdict"], "failures=", len(info["failed_checks"]),
"probe failures=", len(info["failed_browser_probes"]))
return 0 # Preserve reports even when earlier validation failed.
if __name__ == "__main__":
sys.exit(main(sys.argv))Repair
A Python command-line tool in the automation folder of GlobalGrid2050 that works with require completed candidate (`require_completed_candidate`), covering the Renewable Energy Planning Database (REPD) register, interconnectors and solar.
renderglobalgrid2050 / automation/v923-recovery/repair.py · lines 1–233 of 233 · Entry point · pattern reconcile (shared by 7 files)
- What it does
- It draws the REPD register, interconnectors and solar. Defines 6 functions or classes, including swap, require_completed_candidate, repair_existing_columns, build, reconcile. Uses libraries pathlib, json, re, subprocess, sys. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain terms in the code: the REPD register, interconnectors, solar.
- Inputs & outputs
- In: JSON file registry.json; command-line arguments.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 V923 Six Hour Python Repair Workflow (globalgrid2050).
- What it achieves
- It repairs existing columns (`repair_existing_columns`) and is built from the swap step (`swap`) and the build step (`build`). One-time Python release generator, non-publishing and V9.22 immutable.
- Why it matters
- Run by GlobalGrid2050 V923 Six Hour Python Repair Workflow.
- Application
- globalgrid2050 · automation/v923-recovery · Python CLI
- Uses
- Automation — Pipeline Release (sys.path import), New Version (script call), pathlib, json, re, subprocess, sys
- Used by
- run by GlobalGrid2050 V923 Six Hour Python Repair Workflow (workflow run)
- Produces
- swap, require_completed_candidate, repair_existing_columns, build, reconcile, check
- Defines here
- swap, require_completed_candidate, repair_existing_columns, build, reconcile, check
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v923-recovery/repair.py:1-233 · blob c33a1dfe4b5bc2a154cdb0557c43698f728fa182 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: unknown · users: none · canonical: production_core
#!/usr/bin/env python3
"""One-time Python release generator, non-publishing and V9.22 immutable."""
from pathlib import Path
import json,re,subprocess,sys
ROOT=Path(__file__).resolve().parents[2]
P=ROOT/"uk_renewables_pipeline"
OLD="202611151300"; NEW="202611160020"
A=P/OLD; B=P/NEW
HERE=Path(__file__).parent
def swap(txt,old,new):
n=txt.count(old)
if n!=1:raise RuntimeError(f"Unsafe anchor count {n} for {old[:100]!r}")
return txt.replace(old,new,1)
def require_completed_candidate(directory, version):
"""CVAA-01: never treat an interrupted candidate as a successful retry."""
required = (
"index.html", "CHANGES.md", "README.md", "tests/run_v9_23.sh",
"scripts/plugins/projects-v9-8.js", "scripts/plugins/live-news.js",
"scripts/plugins/machine-notes-v923.js", "styles/v9-23.css",
"docs/V923-AUDIT.md",
)
if version.get("id") != NEW or version.get("version") != "V9.23" or version.get("parent") != OLD:
raise RuntimeError("PARTIAL_CANDIDATE: release registry has no complete V9.23 parent/identity")
for name in required:
path = directory / name
if not path.is_file() or path.stat().st_size == 0:
raise RuntimeError("PARTIAL_CANDIDATE: missing or empty " + name)
if version.get("runner") != "tests/run_v9_23.sh" or not version.get("trees"):
raise RuntimeError("PARTIAL_CANDIDATE: release runner or immutable tree receipt missing")
def repair_existing_columns():
"""Correct only the known V9.23 insertion error; refuse unrecognised row structures."""
path = B / "scripts/plugins/projects-v9-8.js"
source = path.read_text()
marker = "\nfunction projectRowHtml(project) {"
if source.count(marker) != 1:
raise RuntimeError("PARTIAL_CANDIDATE: missing unique row-function boundary")
inter, repd = source.split(marker, 1)
broken = r'</td><td class="machine-note-cell">NOT A REPD RECORD</td><td class="machine-note-cell"><button[^<>]*>CHECK NOTE</button></td><td><div class="project-actions">'
fixed = '</td><td class="machine-note-cell">NOT A REPD RECORD</td><td><div class="project-actions">'
inter, n = re.subn(broken, fixed, inter, count=1)
if inter.count('class="machine-note-cell"') != 1:
raise RuntimeError("PARTIAL_CANDIDATE: interconnector must have exactly one notes cell")
target = '</td><td><div class="project-actions">' + chr(36) + '{mapAction}'
if repd.count('class="machine-note-cell"') == 0:
if repd.count(target) != 1:
raise RuntimeError("PARTIAL_CANDIDATE: missing exact REPD notes insertion anchor")
cell = '</td><td class="machine-note-cell"><button type="button" class="machine-note-button" data-note-ref="' + chr(36) + '{escapeHtml(project.repd_ref)}" data-note-name="' + chr(36) + '{escapeHtml(project.name)}" data-note-status="' + chr(36) + '{escapeHtml(project.status)}">CHECK NOTE</button></td><td><div class="project-actions">' + chr(36) + '{mapAction}'
repd = repd.replace(target, cell, 1)
if repd.count('class="machine-note-cell"') != 1 or inter.count('data-note-ref') != 0:
raise RuntimeError("PARTIAL_CANDIDATE: REPD notes cell absent, duplicated or on wrong vertical")
cleaned = inter + marker + repd
if cleaned != source:
path.write_text(cleaned)
# Rebinding notes after all paginated table rerenders is a V9.23-only view hook.
hook = ' body.innerHTML = slice.map(projectRowHtml).join("");'
path_text = path.read_text()
if 'pipeline-projects-rendered' not in path_text:
if path_text.count(hook) != 1:
raise RuntimeError("PARTIAL_CANDIDATE: missing unique renderTable hook")
path.write_text(path_text.replace(hook,hook+'\n window.dispatchEvent(new Event("pipeline-projects-rendered"));',1))
def build():
register=ROOT/"automation/pipeline_release/registry.json"
reg=json.loads(register.read_text())
if B.exists():
require_completed_candidate(B, reg["versions"][-1])
reconcile()
check()
print("Candidate exists; completion receipt and actual contents validated")
return
if reg["versions"][-1]["id"]!=OLD:raise RuntimeError("V9.22 no longer latest parent")
subprocess.run([sys.executable,"automation/pipeline_release/new_version.py","create",NEW,"V9.23","one news feed with machine notes","BUILD"],cwd=ROOT,check=True)
path=B/"index.html"; txt=path.read_text()
txt=swap(txt,'<link rel="stylesheet" href="styles/v9-22.css?v=9.22">','<link rel="stylesheet" href="styles/v9-22.css?v=9.22">\n <link rel="stylesheet" href="styles/v9-23.css?v=9.23">')
txt=swap(txt,'<th>NEWS SIGNAL</th>\n <th>ACTIONS</th>','<th>NEWS SIGNAL</th>\n <th>MACHINE READ NOTES</th>\n <th>ACTIONS</th>')
txt=swap(txt,'<details class="news-archive" id="newsArchive">','<details class="news-archive" id="newsArchive" hidden>')
txt=swap(txt,' <script defer src="scripts/plugins/datacentre-news.js?v=1"></script>\n','')
txt=swap(txt,' <script defer src="scripts/plugins/live-news.js?v=2"></script>',
' <script defer src="scripts/plugins/live-news.js?v=2"></script>\n <script defer src="scripts/plugins/machine-notes-v923.js?v=9.23"></script>')
path.write_text(txt)
path=B/"scripts/plugins/live-news.js";txt=path.read_text()
txt,n=re.subn(r'\n function showProject\(ref, chip\) \{.*?\n \}\n\n','\n',txt,count=1,flags=re.S)
if n!=1:raise RuntimeError("show table function absent")
start=txt.index(" var chip = el('button', 'ln-match'")
end=txt.index(" box.appendChild(chip);",start)+len(" box.appendChild(chip);")
txt=txt[:start]+""" var chip = el('span', 'ln-match', 'Possible match: ' + m.site_name + ' (REPD ' + m.repd_ref + ')');
chip.title = 'Unverified name coincidence; not a confirmed link to a project event; inspect the original publisher.';
box.appendChild(chip);"""+txt[end:]
txt=swap(txt," var archive = document.getElementById('newsArchive');",
" var archive = document.getElementById('newsArchive');\n window.pipelineHeadlineDocument = ok ? doc : null;\n window.dispatchEvent(new CustomEvent('pipeline-feed-loaded', { detail: ok ? doc : null }));")
txt=swap(txt,' var items = doc.items.map(function (it, i) { return [it, i]; })',
""" var items = doc.items.filter(function (it) {
return it.category !== 'policy' && !/\\b(politics|political|election campaign)\\b/i.test(String(it.title || ''));
}).map(function (it, i) { return [it, i]; })""")
path.write_text(txt)
path=B/"scripts/plugins/projects-v9-8.js";txt=path.read_text()
target='</td><td><div class="project-actions">'+chr(36)+'{mapAction}'
boundary="\nfunction projectRowHtml(project) {"
if txt.count(boundary)!=1:raise RuntimeError("Missing unique REPD row boundary")
inter, repd = txt.split(boundary,1)
if inter.count(target)!=1 or repd.count(target)!=1:
raise RuntimeError("REPD/interconnector row anchors moved or duplicated")
inter=inter.replace(target,'</td><td class="machine-note-cell">NOT A REPD RECORD</td><td><div class="project-actions">'+chr(36)+'{mapAction}',1)
cell='</td><td class="machine-note-cell"><button type="button" class="machine-note-button" data-note-ref="'+chr(36)+'{escapeHtml(project.repd_ref)}" data-note-name="'+chr(36)+'{escapeHtml(project.name)}" data-note-status="'+chr(36)+'{escapeHtml(project.status)}">CHECK NOTE</button></td><td><div class="project-actions">'+chr(36)+'{mapAction}'
repd=repd.replace(target,cell,1)
txt=(inter+boundary+repd).replace('colspan="11"','colspan="12"')
path.write_text(txt)
(B/"scripts/plugins/machine-notes-v923.js").write_text((HERE/"templates/machine-notes.js").read_text())
(B/"styles/v9-23.css").write_text((HERE/"templates/v9-23.css").read_text())
(B/"docs/V923-AUDIT.md").write_text("V9.23 NONLIVE. Candidate notes are name-matched metadata, not verified events. Source REPD unmodified. Politics panel removed, old show-table shortcut removed; old MAP builder inherited. GridAtlas 390px card failure remains RED. No homepage promotion.\n")
subprocess.run([sys.executable,"automation/pipeline_release/new_version.py","finalize",NEW,
"one feed, Machine Read Notes, no show-table jump","--fault","Known GridAtlas 390px nearest-card failure unresolved",
"--feature","machine-notes-column:index.html:MACHINE READ NOTES"],cwd=ROOT,check=True)
reconcile()
check()
print("CREATED NONLIVE V9.23 CANDIDATE")
def reconcile():
"""Pin the NEW candidate after documenting deliberate removals; never edit the parent."""
registry=ROOT/"automation/pipeline_release/registry.json"
document=json.loads(registry.read_text())
v=document["versions"][-1]
if v["id"]!=NEW:raise RuntimeError("V9.23 is not the newest candidate")
repair_existing_columns()
withdrawn=set(v.get("removed_features",[]))
withdrawn.add("datacentre-news-panel")
v["removed_features"]=sorted(withdrawn)
# Version-scoped acceptance: old table has 11 columns; the owner explicitly
# asked for one additional native Machine Read Notes column in V9.23.
# Withdraw ONLY the obsolete assertion, replace with positive 12-col proof.
obsolete="table columns unchanged from the parent"
v["removed_probes"]=sorted(set(v.get("removed_probes",[])) | {obsolete})
labels="SITE NAME|COUNTY|OPERATOR|TECHNOLOGY|OFFICIAL REPD STATUS|OFFICIAL CAPACITY|REPD REF|GLOBALGRID REF|REPD UPDATED|NEWS SIGNAL|MACHINE READ NOTES|ACTIONS"
checks=[
{"name":"V9.23 native 12-column notes and original MAP sibling",
"selector":"body",
"js":"(function(){var headers=[...document.querySelectorAll('.tablewrap thead th')].map(function(th){return th.textContent.replace(/[^A-Z ]/g,'').trim().replace(/ +/g,' ')}).join('|');var row=document.querySelector('#tbody tr');var notes=row?.querySelector('button.machine-note-button[data-note-ref]');return headers==="+json.dumps(labels)+"&&row?.children.length===12&&!!notes&&!!row.querySel … [line shortened here: 551 characters; full line on GitHub]
{"name":"V9.23 accessible Machine Read Notes opens without altering MAP",
"selector":"body",
"js":"(function(){var b=document.querySelector('#tbody tr button.machine-note-button'),a=b?.closest('tr')?.querySelector('a.atlaslink');if(!b||!a)return false;var before=a.href;b.click();var d=document.querySelector('dialog.machine-note-dialog');var content=d?.querySelector('#machineNoteBody')?.textContent||'';var pass=d?.open&&(/CANDIDATE|INSUFFICIENT EVIDENCE/.test(content))&&content.incl … [line shortened here: 572 characters; full line on GitHub]
{"name":"V9.23 latest refusal headline visible in project row without changing official status",
"selector":"body",
"js":"(function(){var row=document.querySelector('#tbody tr[id^=repd-]'),b=row?.querySelector('.machine-note-cell .machine-note-button');if(!b)return false;var ref=b.dataset.noteRef,official=row.children[4]?.textContent;var p=window.pipelineHeadlines;if(!p?.render)return false;p.render({schema:p.schema,generated_at:'2026-11-16T00:00:00Z',status:'ok',items:[{title:'Sample solar application r … [line shortened here: 1,046 characters; full line on GitHub]
{"name":"V9.23 one live feed, no separate politics or dead show table action",
"selector":"body",
"js":"!!document.querySelector('#liveNews')&&!document.querySelector('#dcNews')&&!!document.querySelector('#newsArchive[hidden]')&&!document.querySelector('#liveNews button.ln-match')"},
{"name":"V9.23 mobile note button visible and accessible without sideways scroll",
"selector":"body",
"js":"(function(){var b=document.querySelector('#tbody tr button.mobile-machine-note');if(!b)return false;var css=getComputedStyle(b);if(innerWidth>768)return css.display==='none';var r=b.getBoundingClientRect();return css.display!=='none'&&r.height>=44&&r.left>=0&&r.right<=innerWidth&&!!b.closest('td.site')&&b.getAttribute('data-note-ref')!==null;})()"}
]
v["browser_probes"]=[p for p in v.get("browser_probes",[]) if p["name"] not in {x["name"] for x in checks}]+checks
v["state"]="nonlive_candidate"
changes=B/"CHANGES.md"
txt=changes.read_text()
if "TO BE WRITTEN" in txt:
txt=txt.replace("TO BE WRITTEN","""## Changed
- Removed the non-functional headline-to-table jump. A possible match no longer changes search or paging.
- Removed the secondary data-centre politics feed. One main infrastructure headline feed remains visible.
- Added native Machine Read Notes for candidate-only, explicitly unverified headline associations.
- Kept the complete 7,775-identity REPD source, MAP deep-link emitter, CSV and historic editions untouched.
## Outstanding
- GridAtlas receiver mobile sheet can re-minimise a calculated nearest result at 390px (REPD 12588 / 2470): **FAIL** until separate GridAtlas release.
- Publisher bytes, independent per-project binding, rights, owner iPhone and served V9.23 SHA are **UNVERIFIED**.
- Data-centre register source rights are unverified; its separate news panel was intentionally withdrawn.
""")
changes.write_text(txt)
idx=B/"index.html"
html=idx.read_text()
old='<span><b>DATA-CENTRE HEADLINES:</b> headlines and links from public news and government feeds; no article text is stored or shown. This version carries no content from the UK data-centre register.</span>'
if old in html:
html=html.replace(old,'<span><b>HEADLINES:</b> One public energy-infrastructure feed, with no content from the UK data-centre register. Machine Read Notes are candidate screening interpretations; original evidence and official REPD status remain separate.</span>')
if "One public energy-infrastructure feed. Machine Read Notes" in html:
html=html.replace("One public energy-infrastructure feed. Machine Read Notes",
"One public energy-infrastructure feed, with no content from the UK data-centre register. Machine Read Notes")
if "no content from the UK data-centre register" not in html:
raise RuntimeError("The register-exclusion statement was lost")
if html != idx.read_text():idx.write_text(html)
rowmodule=B/"scripts/plugins/projects-v9-8.js"
project_js=rowmodule.read_text()
if 'class="machine-note-button mobile-machine-note"' not in project_js:
target='<div class="mobile-extra">'+chr(36)+'{escapeHtml([location, project.operator].filter(Boolean).join(" | "))}</div><details class="project-record">'
addition='<div class="mobile-extra">'+chr(36)+'{escapeHtml([location, project.operator].filter(Boolean).join(" | "))}</div><button type="button" class="machine-note-button mobile-machine-note" data-note-ref="'+chr(36)+'{escapeHtml(project.repd_ref)}" data-note-name="'+chr(36)+'{escapeHtml(project.name)}" data-note-status="'+chr(36)+'{escapeHtml(project.status)}">NOTES · CHECK</button><deta … [line shortened here: 428 characters; full line on GitHub]
if project_js.count(target)!=1:raise RuntimeError("Cannot safely insert mobile project note action")
rowmodule.write_text(project_js.replace(target,addition,1))
style=B/"styles/v9-23.css"
css=style.read_text()
rule="\n/* Phone: note action in site cell, independent of horizontal table scroll. */\n.mobile-machine-note{display:none!important}\n@media(max-width:768px){.mobile-machine-note{display:inline-flex!important;align-items:center;margin-top:8px;font-size:11px;min-width:112px}.tablewrap th:nth-last-child(2),.tablewrap td.machine-note-cell{display:none}}\n"
if "Phone: note action in site cell" not in css:style.write_text(css+rule)
js=B/"scripts/plugins/live-news.js"
feed=js.read_text()
feed=feed.replace("Unverified headline match, not a proven project event",
"Unverified name coincidence; not a confirmed link to a project event; inspect the original publisher.")
if feed!=js.read_text():js.write_text(feed)
if "no content from the UK data-centre register" not in idx.read_text():
raise RuntimeError("The register-exclusion statement was lost")
sys.path.insert(0,str(ROOT/"automation/pipeline_release"))
from common import tree_hash
v["trees"]=[tree_hash(NEW)]
registry.write_text(json.dumps(document,indent=2,ensure_ascii=False)+"\n")
print("V9.23 metadata: datacentre-news-panel explicitly withdrawn; candidate tree pinned")
def check():
if not B.exists():raise RuntimeError("Candidate not generated")
html=(B/"index.html").read_text(); live=(B/"scripts/plugins/live-news.js").read_text()
pj=(B/"scripts/plugins/projects-v9-8.js").read_text()
assert "MACHINE READ NOTES" in html and "data-note-ref" in pj
assert "datacentre-news.js?v=1" not in html and 'id="newsArchive" hidden' in html
assert "function showProject(" not in live
assert "pipeline-feed-loaded" in live
notes_js=(B/"scripts/plugins/machine-notes-v923.js").read_text()
assert "headlineSummaryV923" in notes_js, "Machine summary missing from native notes column"
assert "shortHeadlineV923" in notes_js and "machine-note-headline" in notes_js, "Short actual headline fragment missing"
assert "pipeline-projects-rendered" in notes_js, "Note listener missing on table rerender"
assert "pipeline-projects-rendered" in pj, "Table fails to dispatch note-rebinding event"
map_test=(B/"tests/browser_real_map_to_engine_agent7.mjs").read_text()
assert "visibility_stability" in map_test and "visibilityStability.every" in map_test, "Delayed GridAtlas card-visibility test missing"
boundary="\nfunction projectRowHtml(project) {"
assert pj.count(boundary)==1, "REPD row boundary changed"
inter,repd=pj.split(boundary,1)
assert inter.count('class="machine-note-cell"')==1, "Duplicate interconnector note cell"
assert inter.count('data-note-ref')==0, "Interconnector wrongly using a REPD key"
assert repd.count('class="machine-note-cell"')==1, "Missing REPD note column"
assert repd.count('data-note-ref="')>=2, "Missing desktop or mobile REPD note button"
reg=json.loads((ROOT/"automation/pipeline_release/registry.json").read_text())
require_completed_candidate(B,reg["versions"][-1])
for n in ["scripts/core/atlas-receiver-v9-7.js","scripts/data/canonical-projects-v9-5-1.js"]:
assert (A/n).read_bytes()==(B/n).read_bytes()
print("PASS: V9.23 structural and canonical REPD/MAP source parity")
if __name__=="__main__":{"build":build,"check":check}[sys.argv[1]]()