GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Websites and apps / reports / studio

Reports — Studio Page and 4 more files

A web page using data from the registry_of_all_content_in_repos_and_dependencies and data-federation-map-for-GlobalGrid2050-all-repos repositories. It builds menu (`buildMenu`) and applies search (`applySearch`).

590 lines of HTML and CSS and JavaScript from reports, seed-data, in 5 files. Topic: Websites and apps. Section 2008 of 2044.

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

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

In this section

  1. Reports — Studio Page render · reports / studio/index.html lines 1–231
  2. Report Evidence interaction · reports / studio/report-evidence.js lines 1–90
  3. Report Save render · reports / studio/report-save.js lines 1–25
  4. Reports — Studio Style Sheet render · reports / studio/style.css lines 1–133
  5. B Baseline storage · seed-data / experiments/economical-seeds/economy/b_baseline.py lines 1–111

Reports — Studio Page

A web page using data from the registry_of_all_content_in_repos_and_dependencies and data-federation-map-for-GlobalGrid2050-all-repos repositories. It builds menu (`buildMenu`) and applies search (`applySearch`).

renderreports / studio/index.html · lines 1–231 of 231 · Entry point · pattern applySearch (shared by 4 files)

What it does
It draws its content. Defines esc, rowHtml, buildMenu, applySearch. Side effects: changes the web page (DOM).
Inputs & outputs
In: DuckDB queries; form fields (user input). Out: web page; SVG drawing.
Downstream impact
Used directly by 38 files: GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); Homepage Versions — GlobalGrid2050 Page (globalgrid2050, https://globalgrid2050.com/homepage_versions/202608291526-globalgrid2050/); Homepage V001 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v001.html); Homepage V002 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v002.html); and 34 more. Reached from 87 other entry points, including GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage V037 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v037.html); Homepage V038 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v038.html).
What it achieves
GlobalGrid2050 Reports Dashboard. It responds to input events.
Why it matters
Loaded by the GlobalGrid2050 Historical Builds map page in GlobalGrid2050 at https://globalgrid2050.com/historical_builds.html and 37 other pages.
Application
reports · studio · page
Uses
Reports — Studio Style Sheet (stylesheet), Registry of All Content in Repos and Dependencies — Index Page (link), GlobalGrid2050 — Renewable Energy Planning Database (REPD) Grid Atlas v8 Page (link), Spider Full Po Test (link), Report Save (script src), Report Evidence (script src)
Used by
linked from GlobalGrid2050 Historical Builds (link), linked from Homepage Versions — GlobalGrid2050 Page (link), linked from Homepage V001 (link), linked from Homepage V002 (link), linked from Homepage V003 (link), linked from Homepage V004 (link), linked from Homepage V005 (link), linked from Homepage V006 (link), and 30 more
Produces
esc, rowHtml, buildMenu, applySearch
Defines here
esc, rowHtml, buildMenu, applySearch
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
reports@08aad9448481aabd2d8fd7373059bf829b29528f studio/index.html:1-231 · blob 25b08006c4a91a9daf9ced9b28c94acefa986754 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unknown
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>GlobalGrid2050 Reports Dashboard</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="shell">
    <header class="hero">
      <div class="hero-copy">
        <p class="eyebrow">root@globalgrid2050:~/reports</p>
        <h1>GlobalGrid2050 Reports</h1>
        <p class="subtitle">Evidence-first report instrumentation for the GlobalGrid2050 operating system.</p>
        <p class="lede">Create screening evidence, CSV exports, plain text notes, JSON evidence packs, HTML reports and browser print-to-PDF outputs from the same source object. Reports are projections over evidence, not the source of truth.</p>
        <div class="hero-actions">
          <button class="primary" data-format="json">Save evidence JSON</button>
          <button data-format="csv">Save evidence CSV</button>
          <button data-format="txt">Save plain text note</button>
          <button data-format="html">Save HTML report</button>
          <button onclick="window.print()">Print / Save as PDF</button>
        </div>
      </div>

      <aside class="status-panel">
        <h2>LIVE INSTRUMENT STATUS</h2>
        <table>
          <tr><td>Mode</td><td>:</td><td class="green">SCREENING</td></tr>
          <tr><td>Runtime</td><td>:</td><td>Static browser</td></tr>
          <tr><td>Save path</td><td>:</td><td id="savePath">Detecting</td></tr>
          <tr><td>Fallback</td><td>:</td><td>Blob download</td></tr>
          <tr><td>Evidence</td><td>:</td><td>Synthetic public</td></tr>
          <tr><td>Certification</td><td>:</td><td class="red">None</td></tr>
        </table>
      </aside>
    </header>

    <nav class="flagship">
      <a href="https://globalgrid2050.com/">GlobalGrid2050 Homepage</a>
      <span>Save As layer · evidence first · CSV always exists</span>
    </nav>

    <section class="dashboard-grid">
      <article class="panel wide">
        <div class="panel-head">
          <h2>Report Instrumentation Console</h2>
          <span class="badge">Synthetic prototype</span>
        </div>
        <p>This dashboard follows the GlobalGrid2050 terminal-style homepage and registry interface, but focuses on report outputs. It is designed as a full-screen user entry point for future report packs, journey files, provenance manifests and browser-side Save As workflows.</p>
        <div class="output-grid">
          <div><strong>JSON</strong><span>Evidence pack and report DNA seed</span></div>
          <div><strong>CSV</strong><span>Engineering exchange tier</span></div>
          <div><strong>TXT</strong><span>Plain text site note</span></div>
          <div><strong>HTML</strong><span>Reviewable browser report</span></div>
          <div><strong>PDF</strong><span>Browser print projection</span></div>
          <div><strong>Journey</strong><span>Future session memory</span></div>
        </div>
      </article>

      <article class="panel">
        <h2>Evidence Object</h2>
        <p class="muted">The atomic unit. Every output below is rendered from this same object.</p>
        <pre id="evidence"></pre>
      </article>
    </section>

    <section class="spider-panel">
      <div class="panel-head">
        <div>
          <h2>REPORTS STRUCTURE SPIDER</h2>
          <p class="muted">High-level report operating layer. Click external nodes to open the wider GlobalGrid2050 ecosystem.</p>
        </div>
        <div class="legend">
          <span><i class="dot bios"></i>Kernel</span>
          <span><i class="dot app"></i>Reports</span>
          <span><i class="dot data"></i>Evidence</span>
          <span><i class="dot ext"></i>External apps</span>
        </div>
      </div>
      <div class="spider-wrap">
        <svg viewBox="0 0 1100 560" role="img" aria-label="Reports instrumentation spider map">
          <path class="wire-cyan" d="M550 90 L550 250"/>
          <path class="wire" d="M550 250 L280 145"/>
          <path class="wire" d="M550 250 L820 145"/>
          <path class="wire" d="M550 250 L260 330"/>
          <path class="wire" d="M550 250 L840 330"/>
          <path class="wire-cyan" d="M550 250 L550 440"/>
          <path class="wire" d="M550 440 L380 500"/>
          <path class="wire" d="M550 440 L720 500"/>

          <a href="https://ventusltd.github.io/registry_of_all_content_in_repos_and_dependencies/" class="node bios"><circle cx="550" cy="90" r="58"/><text class="label" x="550" y="88" text-anchor="middle">KERNEL</text><text class="sub" x="550" y="111" text-anchor="middle">registry ↗</text></a>
          <g class="node app"><circle cx="550" cy="250" r="78"/><text class="label" x="550" y="244" text-anchor="middle">REPORTS</text><text class="label" x="550" y="266" text-anchor="middle">ENGINE</text><text class="sub" x="550" y="292" text-anchor="middle">Save As layer</text></g>
          <a href="https://globalgrid2050.com/repd_grid_atlasv8/" class="node ext"><circle cx="280" cy="145" r="55"/><text class="label" x="280" y="141" text-anchor="middle">GRID</text><text class="label" x="280" y="160" text-anchor="middle">ATLAS</text><text class="sub" x="280" y="181" text-anchor="middle">open ↗</text></a>
          <a href="https://globalgrid2050.com/uk_energy_tracking/" class="node ext"><circle cx="820" cy="145" r="55"/><text class="label" x="820" y="141" text-anchor="middle">ENERGY</text><text class="label" x="820" y="160" text-anchor="middle">TRACKER</text><text class="sub" x="820" y="181" text-anchor="middle">open ↗</text></a>
          <g class="node data"><circle cx="260" cy="330" r="55"/><text class="label" x="260" y="326" text-anchor="middle">EVIDENCE</text><text class="label" x="260" y="345" text-anchor="middle">OBJECTS</text><text class="sub" x="260" y="366" text-anchor="middle">JSON / hash</text></g>
          <g class="node data"><circle cx="840" cy="330" r="55"/><text class="label" x="840" y="326" text-anchor="middle">CSV</text><text class="label" x="840" y="345" text-anchor="middle">EXPORTS</text><text class="sub" x="840" y="366" text-anchor="middle">always exists</text></g>
          <g class="node app"><circle cx="550" cy="440" r="58"/><text class="label" x="550" y="437" text-anchor="middle">REPORT</text><text class="label" x="550" y="457" text-anchor="middle">DNA</text><text class="sub" x="550" y="479" text-anchor="middle">manifest</text></g>
          <a href="https://ventusltd.github.io/data-federation-map-for-globalgrid2050-all-repos/dashboard/sandbox/spider_full_po_test.html" class="node ext"><circle cx="380" cy="500" r="44"/><text class="label" x="380" y="497" text-anchor="middle">SPIDER</text><text class="sub" x="380" y="517" text-anchor="middle">open ↗</text></a>
          <a href="https://github.com/Ventusltd/reports" class="node ext"><circle cx="720" cy="500" r="44"/><text class="label" x="720" y="497" text-anchor="middle">GITHUB</text><text class="sub" x="720" y="517" text-anchor="middle">repo ↗</text></a>
        </svg>
      </div>
    </section>

    <section class="explore">
      <div>
        <h3 class="green">SAVE AS</h3>
        <ul>
          <li>File System Access API where available</li>
          <li>Blob download fallback everywhere else</li>
          <li>Object URLs revoked after use</li>
        </ul>
      </div>
      <div>
        <h3 class="cyan">EVIDENCE</h3>
        <ul>
          <li>content hash</li>
          <li>confidence state</li>
          <li>verification state</li>
        </ul>
      </div>
      <div>
        <h3 class="orange">OUTPUTS</h3>
        <ul>
          <li>JSON evidence pack</li>
          <li>CSV engineering exchange</li>
          <li>TXT and HTML views</li>
        </ul>
      </div>
      <div>
        <h3 class="purple">NEXT LAYERS</h3>
        <ul>
          <li>journey JSON</li>
          <li>report DNA audit</li>
          <li>registry graph nodes</li>
        </ul>
      </div>
    </section>

    <section class="search-panel">
      <label for="gridSearch">Search report instruments</label>
      <input type="text" id="gridSearch" placeholder="Search evidence, CSV, journey, bankability, MVT, private wire..." autocomplete="off">
      <div id="menu"></div>
    </section>

    <section class="cards">
      <div class="card"><h3>SCREENING ONLY</h3><p>Outputs are not engineering advice, certification, approval, bankability confirmation or a substitute for qualified professional review.</p></div>
      <div class="card"><h3>CSV ALWAYS EXISTS</h3><p>Rendered reports are useful, but structured data remains the trusted engineering exchange tier.</p></div>
      <div class="card"><h3>USER FILESYSTEM FIRST</h3><p>The browser creates files locally. The user decides what to save, print, archive or commit to git.</p></div>
    </section>

    <footer class="footer">
      <div><span class="green">root@globalgrid2050:~/reports#</span> Evidence captured. Reports rendered. Provenance retained.</div>
      <div><a href="https://globalgrid2050.com/">GlobalGrid2050.com ↗</a><br><a href="https://www.ventusltd.com/">Ventus Ltd ↗</a></div>
    </footer>
  </div>

  <script src="report-save.js"></script>
  <script src="report-evidence.js"></script>
  <script>
    document.getElementById('savePath').textContent = ('showSaveFilePicker' in window) ? 'File System Access API' : 'Blob fallback';

    const AREAS = [
      { name: 'Core Outputs', children: [
        { name: 'Evidence JSON', note: 'machine readable' },
        { name: 'CSV evidence export', note: 'always exists' },
        { name: 'Plain text note', note: 'Linux grade' },
        { name: 'HTML screening report', note: 'browser review' },
        { name: 'Print to PDF', note: 'browser projection' }
      ]},
      { name: 'Report Families', children: [
        { name: 'Market survey report' },
        { name: 'Private wire opportunity report' },
        { name: 'Data centre readiness report' },
        { name: 'Inverter and MVT skid comparison' },
        { name: 'Bankability evidence pack' },
        { name: 'G99 G100 SCADA cyber evidence register' }
      ]},
      { name: 'Future Instruments', children: [
        { name: 'Journey JSON' },
        { name: 'Report DNA manifest diff' },
        { name: 'DuckDB Wasm CSV and Parquet export' },
        { name: 'Registry graph report node' },
        { name: 'Template pack marketplace' }
      ]}
    ];

    const esc = (s) => String(s).replace(/[&<>"']/g, c => ({ '&':'&amp;', '<':'&lt;', '>':'&gt;', '"':'&quot;', "'":'&#39;' }[c]));
    const menu = document.getElementById('menu');

    function rowHtml(r) {
      const note = r.note ? ` <span class="dev-status">(${esc(r.note)})</span>` : '';
      const key = (r.name + ' ' + (r.note || '')).toLowerCase();
      return `<li data-name="${esc(key)}"><span>${esc(r.name)}</span>${note}</li>`;
    }

    function buildMenu() {
      let html = '';
      for (const a of AREAS) {
        const rows = a.children.map(rowHtml).join('');
        html += `<details class="area" data-name="${esc(a.name.toLowerCase())}"><summary>${esc(a.name)}</summary><ul class="drawer">${rows}</ul></details>`;
      }
      html += '<p class="noresult" id="noresult" style="display:none">No match.</p>';
      menu.innerHTML = html;
    }

    function applySearch(raw) {
      const q = raw.trim().toLowerCase();
      let anyVisible = false;
      document.querySelectorAll('details.area').forEach(d => {
        const areaMatch = !!q && d.dataset.name.includes(q);
        let childMatch = false;
        d.querySelectorAll('li').forEach(li => {
          const liMatch = li.dataset.name.includes(q);
          const show = !q || areaMatch || liMatch;
          li.style.display = show ? '' : 'none';
          if (q && liMatch) childMatch = true;
        });
        const visible = !q || areaMatch || childMatch;
        d.style.display = visible ? '' : 'none';
        d.open = q ? visible : false;
        if (visible) anyVisible = true;
      });
      document.getElementById('noresult').style.display = anyVisible ? 'none' : '';
    }

    buildMenu();
    document.getElementById('gridSearch').addEventListener('input', e => applySearch(e.target.value));
  </script>
</body>
</html>

Report Evidence

A JavaScript file in the studio folder of Reports that builds output (`buildOutput`), covering evidence pack, using SHA-256.

interactionreports / studio/report-evidence.js · lines 1–90 of 90 · Entry point · pattern csvCell (shared by 33 files)

What it does
Defines buildOutput, csvCell, escapeHtml. Side effects: changes the web page (DOM).
Inputs & outputs
In: JSON file evidence-pack.json; CSV file evidence.csv.
Downstream impact
Used directly by 2 files: Build Browser Report Studio Workflow (reports); Reports — Studio Page (reports). Reached from 125 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage V001 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v001.html).
What it achieves
It builds output (`buildOutput`) and is built from the CSV cell helper (`csvCell`) and the escape HTML helper (`escapeHtml`). Defines `buildOutput`, `csvCell` and `escapeHtml`. It responds to click events.
Why it matters
Loaded by the Studio page. Run by Build Browser Report Studio Workflow.
Application
reports · studio · script
Uses
none found
Used by
run by Build Browser Report Studio Workflow (workflow run), loaded by Reports — Studio Page (script src), mentioned in Standalone (comment link)
Produces
buildOutput, csvCell, escapeHtml
Defines here
buildOutput, csvCell, escapeHtml
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
reports@08aad9448481aabd2d8fd7373059bf829b29528f studio/report-evidence.js:1-90 · blob e42a4d3e4fd42f619e51d3ab21932413e17f50ea · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unknown
const evidence = {
  id: 'EV-SYN-001',
  evidence_class: 'synthetic',
  title: 'Synthetic site note',
  summary: 'Public synthetic example used to test report instrumentation.',
  source_application: 'reports/studio',
  source_kind: 'synthetic',
  source_uri: 'studio/index.html',
  created_at: new Date().toISOString(),
  kernel_registry_version: null,
  content_hash: 'sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
  confidence_state: 'screening',
  verification_state: 'synthetic',
  public_publishable: true,
  disclaimer_strength: 'screening',
  tags: ['synthetic', 'screening', 'example'],
  data: {
    output_tiers: ['json', 'csv', 'txt', 'html']
  }
};

const disclaimer = 'This is a synthetic screening example only. It is not engineering advice, certification, approval, bankability confirmation or a substitute for qualified professional review.';

document.getElementById('evidence').textContent = JSON.stringify(evidence, null, 2);

document.querySelectorAll('button[data-format]').forEach((button) => {
  button.addEventListener('click', async () => {
    const format = button.dataset.format;
    const output = buildOutput(format);
    await window.GlobalGrid2050Save.saveReportBlob(
      window.GlobalGrid2050Save.textBlob(output.content, output.type),
      output.filename
    );
  });
});

function buildOutput(format) {
  if (format === 'json') {
    return {
      filename: 'evidence-pack.json',
      type: 'application/json;charset=utf-8',
      content: JSON.stringify({ evidence: [evidence], disclaimer }, null, 2)
    };
  }

  if (format === 'csv') {
    const header = 'id,evidence_class,title,source_application,confidence_state,verification_state,public_publishable\n';
    const row = [
      evidence.id,
      evidence.evidence_class,
      evidence.title,
      evidence.source_application,
      evidence.confidence_state,
      evidence.verification_state,
      evidence.public_publishable
    ].map(csvCell).join(',') + '\n';
    return { filename: 'evidence.csv', type: 'text/csv;charset=utf-8', content: header + row };
  }

  if (format === 'txt') {
    return {
      filename: 'note.txt',
      type: 'text/plain;charset=utf-8',
      content: `GlobalGrid2050 Reports Note\n\n${evidence.title}\n${evidence.summary}\n\nStatus: ${evidence.confidence_state}\nSource badge: ${evidence.verification_state}\n\n${disclaimer}\n`
    };
  }

  if (format === 'html') {
    return {
      filename: 'report.html',
      type: 'text/html;charset=utf-8',
      content: `<!doctype html><html><head><meta charset="utf-8"><title>${escapeHtml(evidence.title)}</title></head><body><h1>${escapeHtml(evidence.title)}</h1><p>${escapeHtml(evidence.summary)}</p><p><strong>Status:</strong> ${escapeHtml(evidence.confidence_state)}</p><p><strong>Source badge:</strong> ${escapeHtml(evidence.verification_state)}</p><hr><p>${escapeHtml(disclaimer)}</p></body></html>  … [line shortened here: 401 characters; full line on GitHub]
    };
  }

  throw new Error(`Unsupported format: ${format}`);
}

function csvCell(value) {
  return '"' + String(value).replaceAll('"', '""') + '"';
}

function escapeHtml(value) {
  return String(value)
    .replaceAll('&', '&amp;')
    .replaceAll('<', '&lt;')
    .replaceAll('>', '&gt;')
    .replaceAll('"', '&quot;')
    .replaceAll("'", '&#039;');
}

Report Save

A JavaScript file in the studio folder of Reports that saves report blob (`saveReportBlob`). It saves report blob (`saveReportBlob`) and is built from the text blob helper (`textBlob`).

renderreports / studio/report-save.js · lines 1–25 of 25 · Entry point

What it does
It draws its content. Defines saveReportBlob, textBlob. Side effects: changes the web page (DOM).
Downstream impact
Used directly by 2 files: Build Browser Report Studio Workflow (reports); Reports — Studio Page (reports). Reached from 125 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage V001 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v001.html).
What it achieves
Defines `saveReportBlob` and `textBlob`.
Why it matters
Loaded by the Studio page. Run by Build Browser Report Studio Workflow.
Application
reports · studio · script
Uses
none found
Used by
run by Build Browser Report Studio Workflow (workflow run), loaded by Reports — Studio Page (script src)
Produces
saveReportBlob, textBlob
Defines here
saveReportBlob, textBlob
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
reports@08aad9448481aabd2d8fd7373059bf829b29528f studio/report-save.js:1-25 · blob 2966ac22a12691461a1cc51efefffe64502156bd · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unknown
async function saveReportBlob(blob, suggestedName) {
  if ('showSaveFilePicker' in window) {
    const handle = await window.showSaveFilePicker({ suggestedName });
    const writable = await handle.createWritable();
    await writable.write(blob);
    await writable.close();
    return { method: 'file-system-access-api', filename: suggestedName };
  }

  const url = URL.createObjectURL(blob);
  const a = document.createElement('a');
  a.href = url;
  a.download = suggestedName;
  document.body.appendChild(a);
  a.click();
  a.remove();
  URL.revokeObjectURL(url);
  return { method: 'blob-download-fallback', filename: suggestedName };
}

function textBlob(text, type) {
  return new Blob([text], { type: type || 'text/plain;charset=utf-8' });
}

window.GlobalGrid2050Save = { saveReportBlob, textBlob };

Reports — Studio Style Sheet

A style sheet.

renderreports / studio/style.css · lines 1–133 of 133 · Entry point

What it does
Side effects: changes the web page (DOM).
Downstream impact
Used directly by 1 file: Reports — Studio Page (reports). Reached from 125 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage V001 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v001.html).
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 Studio page.
Application
reports · studio · style sheet
Uses
none found
Used by
loaded by Reports — Studio 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
reports@08aad9448481aabd2d8fd7373059bf829b29528f studio/style.css:1-133 · blob 4041080c1e38e2c721a4e275298c040fd6793eed · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unknown
:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #000; }
body {
  color: #fff;
  font-family: Courier, monospace;
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 15% 0%, rgba(64,232,255,.10), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(189,101,255,.10), transparent 30%),
    #000;
}
a { color: #40e8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  border: 1px solid #07545b;
  padding: 10px 13px;
  background: #020909;
  color: #40e8ff;
  border-radius: 4px;
  font-family: Courier, monospace;
  font-weight: bold;
  cursor: pointer;
}
button:hover { border-color: #40e8ff; color: #fff; }
button.primary { border-color: #40e8ff; box-shadow: 0 0 18px rgba(64,232,255,.15); }
.shell { width: min(1500px, 100%); margin: 0 auto; padding: 28px; }
.hero { display: grid; grid-template-columns: 1fr 390px; gap: 18px; align-items: stretch; min-height: 38vh; }
.hero-copy, .status-panel, .panel, .spider-panel, .search-panel, .card, .footer, .flagship, .explore {
  border: 1px solid #07545b;
  background: rgba(2,9,9,.92);
  border-radius: 4px;
}
.hero-copy { padding: 26px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { color: #53ff4c; margin: 0 0 10px; }
h1 { margin: 0; font-size: clamp(38px, 7vw, 92px); line-height: .95; letter-spacing: -3px; }
h2 { color: #40e8ff; margin: 0 0 10px; font-size: 20px; letter-spacing: .4px; }
h3 { margin: 0 0 8px; }
.subtitle { color: #40e8ff; font-size: clamp(18px, 2.5vw, 30px); margin: 12px 0 14px; }
.lede { max-width: 900px; color: #ddd; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.status-panel { padding: 20px; }
.status-panel table { width: 100%; border-collapse: collapse; }
.status-panel td { padding: 5px 8px 5px 0; white-space: nowrap; }
.green { color: #53ff4c; }
.red { color: #ff3333; }
.cyan { color: #40e8ff; }
.orange { color: #ff9400; }
.purple { color: #bd65ff; }
.muted { color: #b8b8b8; }
.dev-status { color: #ff3333; font-weight: bold; font-size: 13px; }
.flagship { margin-top: 18px; padding: 14px 18px; display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.flagship a { color: #00ffff; font-size: 24px; font-weight: bold; }
.dashboard-grid { margin-top: 18px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.panel { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.badge { display: inline-block; padding: 5px 9px; border: 1px solid #07545b; color: #53ff4c; border-radius: 999px; font-size: 13px; }
.output-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.output-grid div { border: 1px solid #06383d; padding: 14px; background: #010606; min-height: 90px; }
.output-grid strong { display: block; color: #40e8ff; font-size: 20px; }
.output-grid span { display: block; color: #bbb; margin-top: 6px; }
pre { overflow: auto; max-height: 430px; background: #010606; padding: 14px; border: 1px solid #06383d; color: #d8faff; }
.spider-panel { margin-top: 18px; padding: 16px; }
.spider-wrap { overflow: auto; border-top: 1px solid #06383d; padding-top: 10px; }
svg { width: 100%; min-width: 900px; height: auto; display: block; }
.wire { stroke: #777; stroke-width: 1.4; fill: none; opacity: .85; }
.wire-cyan { stroke: #40e8ff; stroke-width: 1.8; fill: none; opacity: .95; }
.node { cursor: pointer; }
.node circle { fill: #020909; stroke-width: 2; filter: drop-shadow(0 0 4px rgba(64,232,255,.35)); }
.node text { font-family: Courier, monospace; pointer-events: none; }
.node .label { fill: #fff; font-size: 14px; font-weight: bold; }
.node .sub { fill: #b8b8b8; font-size: 11px; text-decoration: underline; }
.node.bios circle, .bios circle { stroke: #2fa7ff; }
.node.app circle, .app circle { stroke: #63d92f; }
.node.data circle, .data circle { stroke: #ff9400; }
.node.ext circle, .ext circle { stroke: #aaa; }
.legend { display: grid; grid-template-columns: repeat(4, auto); gap: 10px 18px; font-size: 14px; color: #ddd; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.bios { background: #2fa7ff; }
.dot.app { background: #63d92f; }
.dot.data { background: #ff9400; }
.dot.ext { background: #aaa; }
.explore { margin-top: 18px; padding: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.explore ul { list-style: none; padding: 0; margin: 0; color: #ddd; }
.explore li { margin: 7px 0; }
.search-panel { margin-top: 18px; padding: 16px; }
.search-panel label { color: #40e8ff; font-weight: bold; display: block; margin-bottom: 8px; }
#gridSearch {
  width: 100%;
  padding: 12px;
  background: #111;
  color: white;
  border: 1px solid #444;
  font-family: Courier, monospace;
  font-size: 17px;
  margin-bottom: 14px;
}
#gridSearch:focus { outline: none; border-color: #66ccff; }
details.area { border-bottom: 1px solid #333; }
details.area > summary { list-style: none; cursor: pointer; padding: 12px 0; color: #00ffff; font-weight: bold; }
details.area > summary::-webkit-details-marker { display: none; }
details.area > summary::before { content: "[+] "; color: #00ffff; }
details.area[open] > summary::before { content: "[\2212] "; }
ul.drawer { list-style: none; margin: 0 0 10px; padding: 0; }
ul.drawer li { padding: 9px 0 9px 28px; border-top: 1px solid #1c1c1c; color: #ddd; }
.noresult { color: #888; padding: 20px 0; }
.cards { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { padding: 16px; min-height: 130px; }
.card h3 { color: #40e8ff; }
.footer { margin-top: 18px; padding: 14px; display: flex; justify-content: space-between; gap: 20px; color: #bbb; }
@media (max-width: 980px) {
  .shell { padding: 18px; }
  .hero, .dashboard-grid { grid-template-columns: 1fr; }
  .explore, .cards { grid-template-columns: 1fr 1fr; }
  h1 { letter-spacing: -1px; }
}
@media (max-width: 620px) {
  body { font-size: 15px; }
  .shell { padding: 12px; }
  .hero-copy, .status-panel, .panel, .spider-panel, .search-panel { padding: 14px; }
  .output-grid, .explore, .cards { grid-template-columns: 1fr; }
  .legend { grid-template-columns: 1fr 1fr; }
  button { width: 100%; }
  .footer { display: block; }
}
@media print {
  body { background: #fff; color: #000; }
  .hero-actions, .search-panel, .flagship, button { display: none !important; }
  .hero, .dashboard-grid, .explore, .cards { display: block; }
  .hero-copy, .status-panel, .panel, .spider-panel, .card, .footer { border-color: #999; background: #fff; color: #000; margin-bottom: 12px; }
  h1, h2, h3, .subtitle, a { color: #000; }
}

B Baseline

A Python module in the economy folder of Seed Data that gets source (`get_source`) and counts query (`count_query`), using SHA-256. It is built from the source audit helper (`source_audit`).

storageseed-data / experiments/economical-seeds/economy/b_baseline.py · lines 1–111 of 111

What it does
It loads data. Defines get_source, source_audit, count_query. Uses libraries array, hashlib, json, mmap, re. Side effects: uses storage (browser storage, DuckDB or Parquet).
Why it exists in the grid workflow
Domain stage experimental (path word 'experiments'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: SQLite database.
Downstream impact
Used directly by 1 file: Experiment B (seed-data). Reached from 3 other entry points, including Bench State Compare (seed-data); State Compare (seed-data); Test State Compare (seed-data).
What it achieves
Standalone counterfactual for the Experiment B provenance contract.
Why it matters
Imported by Experiment B.
Application
seed-data · experiments/economical-seeds/economy · Python module
Uses
array, hashlib, json, mmap, re, sqlite3, sys, contextlib
Used by
imported by Experiment B (import)
Produces
get_source, source_audit
Defines here
get_source, source_audit, count_query
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
seed-data@e4af7ee340a38d94f21ddbba147395b569ccce11 experiments/economical-seeds/economy/b_baseline.py:1-111 · blob 75b1ce7c714e9c9d276c4ae23b04cfdfeebb2d24 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: storage · domain stage: experimental · users: none · canonical: supporting_data
"""Standalone counterfactual for the Experiment B provenance contract."""
import array
import hashlib
import json
import mmap
import re
import sqlite3
import sys
from contextlib import closing

HEADER = re.compile(rb"(?m)^={78}\nFILE: ([^\n]+)\n(\d+) chars [^\n]+\n={78}\n")
END = re.compile(rb"(?m)^={78}\nEND OF TELEPRINT\n={78}(?:\n|$)")
INDEX_COUNT = re.compile(rb"(?m)^CONTENTS -- (\d+) file\(s\), \d+ characters\n")


def get_source(capture, url, index_path):
    if index_path:
        catalog = index_path.read_bytes()
        index = json.loads(catalog)
        hits = [item for item in index["records"] if item["url"] == url]
        if len(hits) != 1:
            return None, len(catalog), "absent" if not hits else "ambiguous"
        item = hits[0]
        with capture.open("rb") as stream:
            stream.seek(item["byte_start"])
            body = stream.read(item["byte_length"])
        if hashlib.sha256(body).hexdigest() != item["text_sha256"]:
            return None, len(catalog) + len(body), "capture-drift"
        blob = hashlib.sha1(b"blob " + str(len(body)).encode() + b"\0" + body).hexdigest()
        if blob != item["git_blob"]:
            return None, len(catalog) + len(body), "index-identity-drift"
        return body, len(catalog) + len(body), None

    with capture.open("rb") as stream:
        try:
            with mmap.mmap(stream.fileno(), 0, access=mmap.ACCESS_READ) as raw:
                headers = list(HEADER.finditer(raw))
                counts = INDEX_COUNT.search(raw)
                end = END.search(raw, headers[-1].end()) if headers else None
                if not counts or len(headers) != int(counts[1]) or not end:
                    return None, len(raw), "bad-framing"
                hits = [i for i, match in enumerate(headers) if match[1].decode("utf-8") == url]
                if len(hits) != 1:
                    return None, len(raw), "absent" if not hits else "ambiguous"
                i = hits[0]
                cursor = headers[i]
                stop = headers[i + 1].start() if i + 1 < len(headers) else end.start()
                if raw[stop - 2:stop] != b"\n\n":
                    return None, len(raw), "bad-framing"
                body = raw[cursor.end():stop - 2]
                if len(body.decode("utf-8").encode("utf-16-le")) // 2 != int(cursor[2]):
                    return None, len(raw), "bad-framing"
                return body, len(raw), None
        except ValueError:
            return None, capture.stat().st_size, "bad-framing"


def source_audit(capture, url, database, index_path=None):
    body, read, failure = get_source(capture, url, index_path)
    if failure:
        return {"status": failure, "url": url}, read, 0
    size = len(body)
    digest = hashlib.sha256(body).hexdigest()
    blob_header = ("blob %d\0" % size).encode()
    git = hashlib.sha1(blob_header)
    git.update(body)
    identity = git.hexdigest()
    view = dict(status="unmatched", url=url, sha256=digest, git_blob=identity,
                tablet=None, occurrences=[])
    sql_calls = 0

    def count_query(_):
        nonlocal sql_calls
        sql_calls += 1

    uri = database.resolve().as_uri() + "?mode=ro"
    with closing(sqlite3.connect(uri, uri=True)) as db:
        db.set_trace_callback(count_query)
        row = db.execute("SELECT n, lines FROM tablet WHERE git_blob = ?", (identity,)).fetchone()
        if row is None:
            return view, read, sql_calls
        tablet, packed = row
        order = array.array("I")
        order.frombytes(packed)
        if order.itemsize != 4:
            raise RuntimeError("32-bit unsigned integers required")
        if sys.byteorder != "little":
            order.byteswap()
        unique = sorted(set(order))
        segments = {}
        for i in range(0, len(unique), 900):
            batch = unique[i:i + 900]
            marks = ",".join("?" for _ in batch)
            segments.update(db.execute("SELECT n, text FROM line WHERE n IN (" + marks + ")", batch))
        rebuilt = hashlib.sha256()
        rebuilt_git = hashlib.sha1(blob_header)
        reconstructed_length = 0
        for number in order:
            line = segments[number]
            reconstructed_length += len(line)
            rebuilt.update(line)
            rebuilt_git.update(line)
        if (reconstructed_length, rebuilt.hexdigest(), rebuilt_git.hexdigest()) != (size, digest, identity):
            raise ValueError("Historical tablet integrity mismatch")
        occurrences = list(db.execute("""
            SELECT o.repo, o.commit_sha, o.path, c.date
            FROM occurrence o LEFT JOIN commit_info c ON o.repo=c.repo AND o.commit_sha=c.sha
            WHERE o.tablet=? ORDER BY o.repo, o.commit_sha, o.path
        """, (tablet,)))
        view.update(status="byte-identical", tablet=tablet, occurrences=occurrences)
    return view, read, sql_calls