GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Automation and CI / seed-data / .github/workflows

Test Identify Missing Evidence and 6 more files

A test in the sufficiency folder of Seed Data that checks Identify Missing Evidence, using SHA-256.

686 lines of Python and YAML from seed-data, sld, solar-electrical-topology-analysis-engine-text-based, in 7 files. Topic: Automation and CI. Section 1857 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. Seed Regressions Workflow automation · seed-data / .github/workflows/seed-regressions.yml lines 1–86
  2. Test State Compare test · seed-data / experiments/economical-seeds/next-compose/test_state_compare.py lines 1–91
  3. Test Identify Missing Evidence test · seed-data / experiments/economical-seeds/next-invention/reduction/sufficiency/test_identify_missing_evidence.py lines 1–262
  4. Single-Line Diagram (SLD) Pages Workflow automation · sld / .github/workflows/pages.yml lines 1–80
  5. Authority Bundle Sync Workflow automation · solar-electrical-topology-analysis-engine-text-based / .github/workflows/authority-bundle-sync.yml lines 1–56
  6. Build 025 Small Gates Workflow automation · solar-electrical-topology-analysis-engine-text-based / .github/workflows/build-025-small-gates.yml lines 1–77
  7. Deploy Pages Workflow automation · solar-electrical-topology-analysis-engine-text-based / .github/workflows/deploy-pages.yml lines 1–34

Seed Regressions Workflow

A GitHub Actions workflow in Seed Data. Runs on push, on pull requests and by hand.

automationseed-data / .github/workflows/seed-regressions.yml · lines 1–86 of 86 · Entry point

What it does
It runs cables. Side effects: starts processes.
Why it exists in the grid workflow
Domain terms in the code: cables.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “SEED regression gates”; runs `checked-cvaa/tools/seed-regression/seed_regression.py`, `checked-cvaa/tools/seed-regression/state_regression.py` and `checked-cvaa/tools/seed-regression/cosmic_regression.mjs`.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
seed-data · .github/workflows · workflow
Uses
Test VEDIC Candidate (workflow run), Test VEDIC Commands (workflow run), Route Screen Test (workflow run), Baseline Test (workflow run), Parity (workflow run), Rare Limb (workflow run), Test Identify Missing Evidence (workflow run)
Used by
none found
Produces
none declared
Defines here
SEED regression gates
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 .github/workflows/seed-regressions.yml:1-86 · blob 08c36a5e51863a7c553a3b6f314610365bce82cb · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: process · domain stage: unknown · users: none · canonical: supporting_data
name: SEED regression gates
on:
  push:
    branches: [main]
    paths:
      - 'experiments/economical-seeds/**'
      - '.github/workflows/seed-regressions.yml'
  pull_request:
    paths:
      - 'experiments/economical-seeds/**'
      - '.github/workflows/seed-regressions.yml'
  workflow_dispatch:

permissions:
  contents: read

jobs:
  compact-regressions:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - name: Check out SEED
        uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
        with:
          persist-credentials: false
      - name: Check out audited CVAA gates
        uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
        with:
          repository: Ventusltd/cvaa
          ref: a8eef6edc103981b4db501eeeccf194249bb394c
          path: checked-cvaa
          persist-credentials: false
      - name: Check out pinned COSMIC fixture source
        uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
        with:
          repository: Ventusltd/cosmic
          ref: dbe20b06c1ac107e902b93354f8e8a37b0462ad0
          path: checked-cosmic
          persist-credentials: false
      - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
        with:
          python-version: '3.13'
      - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
        with:
          node-version: '22'
      - name: Deterministic planning and exact selected provenance
        run: python checked-cvaa/tools/seed-regression/seed_regression.py --seed-root experiments/economical-seeds --with-planner
      - name: Recursive comparison and its refusal cases
        run: python checked-cvaa/tools/seed-regression/state_regression.py --seed-root experiments/economical-seeds
      - name: Pinned resolver and exact-target refusal
        run: node checked-cvaa/tools/seed-regression/cosmic_regression.mjs --cosmic-root checked-cosmic
      - name: Shadow VEDIC query and refusals
        working-directory: experiments/economical-seeds
        run: python -m unittest test_vedic_candidate.py

      - name: Shadow COMPOSE and VERIFY on pinned evidence
        working-directory: experiments/economical-seeds/next-invention/vedic-commands
        run: SEED_EXPERIMENT_ROOT="$GITHUB_WORKSPACE/experiments/economical-seeds" python -B -m unittest test_vedic_commands.py
      - name: Check out pinned route and electrical instruments
        uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
        with:
          repository: Ventusltd/ventus-grid-engine
          ref: 00c5df92cf0c714f3e7e9824dcd170c634ce7d76
          sparse-checkout: engine
          path: checked-engine
          persist-credentials: false
      - name: Cable route known answers and independent parity
        working-directory: experiments/economical-seeds/next-invention/cable-screen
        run: VENTUS_ENGINE_REPO="$GITHUB_WORKSPACE/checked-engine" node --test route-screen.test.mjs baseline.test.mjs
      - name: Numeric projection matches the pinned cable reference
        working-directory: experiments/economical-seeds/next-invention/reduction
        run: node parity.mjs "$GITHUB_WORKSPACE/checked-engine"
      - name: Check out pinned fixed-point arithmetic
        uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
        with:
          repository: Ventusltd/particle-physics-drawing-engine
          ref: 34153fcbd5e91e4aead765fba9e9d0cac1ebf5ec
          sparse-checkout: measurements
          path: checked-particles
          persist-credentials: false
      - name: Test exact high word against the independent oracle
        working-directory: experiments/economical-seeds/next-invention/rare
        run: node rare-limb.mjs "$GITHUB_WORKSPACE/checked-particles"
      - name: LEI-04 synthetic evidence sufficiency and refusal
        working-directory: experiments/economical-seeds/next-invention/reduction/sufficiency
        run: python -B -m unittest test_identify_missing_evidence.py

Test State Compare

A test in the next compose folder of Seed Data that checks Fixture and State Compare. It sets up (`setUp`) and is built from the composition tests class (`CompositionTests`).

testseed-data / experiments/economical-seeds/next-compose/test_state_compare.py · lines 1–91 of 91 · Entry point

What it does
It tests its inputs. Defines 12 functions or classes, including CompositionTests, setUp, replace_index, test_equal_outputs_and_verified_mechanism, test_attribution_tracks_replaced_mechanism. Uses libraries json, sqlite3, unittest, contextlib, pathlib. Side effects: reads or writes files; 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: JSON file before.json; SQLite database.
Downstream impact
It is itself an entry point (test); no other file was found loading it.
What it achieves
Defines `CompositionTests`, `setUp`, `replace_index` and 9 more.
Why it matters
Guards the behaviour of Fixture, State Compare and State Compare Baseline.
Application
seed-data · experiments/economical-seeds/next-compose · test
Uses
Fixture (import), State Compare (import), State Compare Baseline (import), json, sqlite3, unittest, contextlib, pathlib, tempfile
Used by
none found
Produces
CompositionTests
Defines here
CompositionTests, setUp, replace_index, test_equal_outputs_and_verified_mechanism, test_attribution_tracks_replaced_mechanism, test_metadata_only_zero_payload, test_duplicate_exact_url, test_database_identity_mismatch, test_selected_corrupted_bytes, test_historical_corruption_refused, test_metadata_malformed_range, test_requested_mechanism_exceeds_budget
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/next-compose/test_state_compare.py:1-91 · blob a90966fcf833475ad4aab4ee90a87b350506d43b · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: filesystem, storage · domain stage: experimental · users: none · canonical: supporting_data
import json
import sqlite3
import unittest
from contextlib import closing
from pathlib import Path
from tempfile import TemporaryDirectory

from fixture import CODE, MECHANISM, SCOPE, make_fixture
from state_compare import compare
from state_compare_baseline import compare as direct


class CompositionTests(unittest.TestCase):
    def setUp(self):
        self.temp = TemporaryDirectory()
        self.addCleanup(self.temp.cleanup)
        self.inputs = make_fixture(Path(self.temp.name))

    def replace_index(self, edit):
        index = self.inputs[1]
        document = json.loads(index.read_text(encoding="utf-8"))
        edit(document)
        index.write_text(json.dumps(document), encoding="utf-8")

    def test_equal_outputs_and_verified_mechanism(self):
        args = (*self.inputs, SCOPE, MECHANISM, 3, 500)
        result, usage = compare(*args)
        self.assertEqual((result, usage), direct(*args))
        self.assertEqual(result["counts"], dict(identical=1, changed=1, before_only=1, after_only=1, unread=1))
        self.assertEqual(result["mechanism"]["before"]["tablet"], 7740)
        self.assertTrue(result["mechanism"]["same_source"])
        self.assertTrue(result["mechanism"]["after"]["scope_literal"])
        self.assertEqual(usage["payload_bytes"], 3*len(CODE)+12)
        self.assertEqual(len(result["witnesses"]), 3)

    def test_attribution_tracks_replaced_mechanism(self):
        with TemporaryDirectory() as folder:
            inputs = make_fixture(Path(folder), alternate_mechanism=True)
            args = (*inputs, SCOPE, MECHANISM, 2, 500)
            proof, stats = compare(*args)
            self.assertEqual((proof, stats), direct(*args))
            self.assertEqual(proof["mechanism"]["before"]["tablet"], 7740)
            self.assertEqual(proof["mechanism"]["after"]["tablet"], 7741)
            self.assertFalse(proof["mechanism"]["same_source"])

    def test_metadata_only_zero_payload(self):
        result, usage = compare(*self.inputs, SCOPE, limit=0, byte_budget=0)
        self.assertEqual(usage["payload_bytes"], 0)
        self.assertEqual(usage["sqlite_queries"], 0)
        self.assertEqual(result["deferred_witnesses"], 3)

    def test_duplicate_exact_url(self):
        self.replace_index(lambda d:d["records"].append(d["records"][0]))
        with self.assertRaisesRegex(ValueError, "Ambiguous"):
            compare(*self.inputs, SCOPE)

    def test_database_identity_mismatch(self):
        self.replace_index(lambda d:d.update(database_sha256="f"*64))
        with self.assertRaisesRegex(ValueError, "database identity"):
            compare(*self.inputs, SCOPE)

    def test_selected_corrupted_bytes(self):
        before, index = self.inputs[:2]
        data = json.loads(index.read_text())
        target = next(r for r in data["records"] if r["url"]==SCOPE+"before.json")
        with before.open("r+b") as f:
            f.seek(target["byte_start"])
            f.write(b"!")
        with self.assertRaisesRegex(ValueError, "differs"):
            compare(*self.inputs, SCOPE)

    def test_historical_corruption_refused(self):
        with closing(sqlite3.connect(self.inputs[-1])) as db:
            with db:
                db.execute("update line set text=? where n=9", (b"x",))
        with self.assertRaisesRegex(ValueError, "tablet integrity"):
            compare(*self.inputs, SCOPE, MECHANISM)

    def test_metadata_malformed_range(self):
        self.replace_index(lambda d:d["records"][0].update(byte_start=d["bytes"]+1))
        with self.assertRaisesRegex(ValueError, "malformed"):
            compare(*self.inputs, SCOPE)

    def test_requested_mechanism_exceeds_budget(self):
        with self.assertRaisesRegex(ValueError, "budget"):
            compare(*self.inputs, SCOPE, MECHANISM, byte_budget=1)


if __name__ == "__main__":
    unittest.main()

Test Identify Missing Evidence

A test in the sufficiency folder of Seed Data that checks Identify Missing Evidence, using SHA-256.

testseed-data / experiments/economical-seeds/next-invention/reduction/sufficiency/test_identify_missing_evidence.py · lines 1–262 of 262 · Entry point · pattern Fixture (shared by 3 files)

What it does
It tests its inputs. Defines 28 functions or classes, including wire, Fixture, __init__, add, omit. Uses libraries functools, json, pathlib, subprocess, sys. Side effects: reads or writes files; starts processes.
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: JSON file c-source.json; JSON file changed.json; JSON file gone.json; JSON file outside.json; JSON file request.json. Out: JSON file a-corrupted.json; JSON file a-bad.json.
Downstream impact
Used directly by 1 file: Seed Regressions Workflow (seed-data).
What it achieves
It sets up (`setUp`) and is built from the wire step (`wire`) and the fixture class (`Fixture`). Independent expected outcomes for the LEI-04 engineering-only candidate.
Why it matters
Run by Seed Regressions Workflow.
Application
seed-data · experiments/economical-seeds/next-invention/reduction/sufficiency · test
Uses
Identify Missing Evidence (import), functools, json, pathlib, subprocess, sys, tempfile, unittest, unittest.mock
Used by
run by Seed Regressions Workflow (workflow run)
Produces
wire, Fixture, EvidenceTests
Defines here
wire, Fixture, __init__, add, omit, input, run, EvidenceTests, setUp, test_healthy_zero_duplicate_and_unrelated_unread, test_limit_failure_is_known_not_missing, test_omitted_evidence_remains_distinct_and_skips_unneeded_payloads, test_stale_and_future_excluded_without_reading, test_age_boundary_is_inclusive, test_fresh_evidence_suffices_even_when_retired_observation_differs, test_conflict_stops_after_two_witnesses_and_defers_third, targeted_open, test_same_length_corruption_refuses_claim_but_charges_bytes, test_unrecoverable_payload_defers_other_independent_claims, test_corrupted_replica_does_not_dismiss_verified_exact_copy, test_same_pin_different_timestamp_is_not_a_duplicate, test_valid_digest_cannot_cure_wrong_units_or_subject, test_wrong_index_digest_refuses_before_payload_open, test_byte_budget_is_hard_cap_and_zero_budget_no_payload_reads, test_declared_payload_missing_and_locator_escape_refuse, test_duplicate_evidence_id_and_noninteger_budget_refuse, test_order_independent_read_plan_after_pinning_manifest, test_cli_supported_output_and_digest_drift_refusal
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/next-invention/reduction/sufficiency/test_identify_missing_evidence.py:1-262 · blob 6036b99721da7460f75598d33e9d3bbe03a091a8 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process · domain stage: experimental · users: none · canonical: supporting_data
"""Independent expected outcomes for the LEI-04 engineering-only candidate."""

from functools import partial
import json
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest
from unittest.mock import patch

from identify_missing_evidence import QUESTION, assess, sha256

OBSERVED = "2026-11-27T23:20:00Z"
OLD = "2026-11-26T08:20:00Z"
AS_OF = "2026-11-27T23:40:00Z"
FUTURE = "2026-11-28T00:10:00Z"


def wire(value):
    return json.dumps(value, sort_keys=True, separators=(",", ":")).encode()


class Fixture:
    def __init__(self, root):
        self.root = root
        self.rows = []

    def add(self, metric, tag, value, *, observed=OBSERVED, unit=None, subject="offline-bench"):
        unit = unit if unit is not None else {"peak_force": "N", "leak_volume": "mL"}.get(metric, "s")
        raw = wire(dict(subject=subject, metric=metric, observed_at=observed, value=value, unit=unit))
        (self.root / (tag + ".json")).write_bytes(raw)
        self.rows.append(dict(id=tag, metric=metric, source="fixture:" + tag,
                              state="observed", observed_at=observed, path=tag + ".json",
                              sha256=sha256(raw), bytes=len(raw)))
        return len(raw)

    def omit(self, metric, tag, state):
        self.rows.append(dict(id=tag, metric=metric, source="fixture:" + tag, state=state))

    def input(self, **overrides):
        manifest = wire({"schema": "seed.synthetic-bench-evidence.v1", "subject": "offline-bench",
                         "evidence": self.rows})
        request = dict(question=QUESTION, subject="offline-bench", as_of=AS_OF, max_age_seconds=3600,
                       max_payload_bytes=1024, manifest_sha256=sha256(manifest))
        request.update(overrides)
        return request, manifest

    def run(self, **overrides):
        request, manifest = self.input(**overrides)
        return assess(request, manifest, self.root)


class EvidenceTests(unittest.TestCase):
    def setUp(self):
        directory = tempfile.TemporaryDirectory()
        self.addCleanup(directory.cleanup)
        self.fixture = Fixture(Path(directory.name))

    def test_healthy_zero_duplicate_and_unrelated_unread(self):
        f = self.fixture
        first = f.add("peak_force", "a-force", 13)
        f.add("peak_force", "b-duplicate", 13)
        second = f.add("leak_volume", "c-zero", 0)
        f.add("unrelated_cycle", "d-unneeded", 80)
        for ignored in ("b-duplicate", "d-unneeded"):
            (f.root / (ignored + ".json")).unlink()
        result = f.run()
        self.assertEqual(result["status"], "evidence_sufficient")
        self.assertEqual([row["status"] for row in result["predicates"]], ["supported", "supported"])
        self.assertEqual(result["predicates"][1]["measured_value"], 0)
        self.assertEqual(result["resources"]["payload_reads"], 2)
        self.assertEqual(result["resources"]["payload_bytes"], first + second)
        self.assertEqual(result["resources"]["ignored_index_rows"], 1)
        self.assertEqual(result["predicates"][0]["witnesses"][1]["state"], "duplicate_unread")

    def test_limit_failure_is_known_not_missing(self):
        f = self.fixture
        f.add("peak_force", "valid-force", 11)
        f.add("leak_volume", "wet", 4)
        result = f.run()
        self.assertEqual(result["status"], "evidence_sufficient")
        self.assertEqual([r["status"] for r in result["predicates"]], ["contradicted", "contradicted"])

    def test_omitted_evidence_remains_distinct_and_skips_unneeded_payloads(self):
        f = self.fixture
        f.add("peak_force", "verified-if-needed", 13)
        for state in ("missing", "unsearched", "withheld"):
            f.omit("peak_force", state, state)
        f.omit("leak_volume", "no-leak-note", "missing")
        with patch("pathlib.Path.open", side_effect=AssertionError("Unnecessary payload open")):
            result = f.run()
        self.assertEqual(result["status"], "additional_evidence_required")
        first = result["predicates"][0]
        self.assertEqual({row["state"] for row in first["unresolved"]}, {"missing", "unsearched", "withheld"})
        self.assertEqual(first["deferred_ids"], ["verified-if-needed"])
        self.assertEqual(result["resources"]["payload_reads"], 0)

    def test_stale_and_future_excluded_without_reading(self):
        f = self.fixture
        f.add("peak_force", "old", 15, observed=OLD)
        f.add("leak_volume", "future", 0, observed=FUTURE)
        with patch("pathlib.Path.open", side_effect=AssertionError("Opened ineligible bytes")):
            result = f.run()
        self.assertEqual([r["witnesses"][0]["state"] for r in result["predicates"]], ["stale", "future"])
        self.assertEqual([r["status"] for r in result["predicates"]], ["unknown", "unknown"])

    def test_age_boundary_is_inclusive(self):
        f = self.fixture
        f.add("peak_force", "one", 12)
        f.add("leak_volume", "two", 3)
        self.assertEqual(f.run(max_age_seconds=1200)["status"], "evidence_sufficient")
        self.assertEqual(f.run(max_age_seconds=1199)["status"], "additional_evidence_required")

    def test_fresh_evidence_suffices_even_when_retired_observation_differs(self):
        f = self.fixture
        f.add("peak_force", "a-retired", 11, observed=OLD)
        f.add("peak_force", "b-current", 12)
        f.add("leak_volume", "c-current", 3)
        result = f.run()
        self.assertEqual(result["status"], "evidence_sufficient")
        self.assertEqual(result["resources"]["payload_reads"], 2)

    def test_conflict_stops_after_two_witnesses_and_defers_third(self):
        f = self.fixture
        f.add("peak_force", "a-source", 12)
        f.add("peak_force", "b-source", 14)
        f.add("peak_force", "c-source", 11)
        f.add("leak_volume", "d-leak", 0)
        real_open = Path.open
        def targeted_open(path, *args, **kwargs):
            if path.name == "c-source.json":
                raise AssertionError("Read after conflict already established")
            return real_open(path, *args, **kwargs)
        with patch("pathlib.Path.open", targeted_open):
            result = f.run()
        first = result["predicates"][0]
        self.assertEqual(first["status"], "unknown")
        self.assertEqual(first["unresolved"], [{"state": "conflicting", "ids": ["a-source", "b-source"]}])
        self.assertEqual(first["deferred_ids"], ["c-source"])
        self.assertEqual(result["resources"]["payload_reads"], 3)

    def test_same_length_corruption_refuses_claim_but_charges_bytes(self):
        f = self.fixture
        size = f.add("peak_force", "changed", 13)
        path = f.root / "changed.json"
        path.write_bytes(path.read_bytes().replace(b"13", b"18"))
        result = f.run()
        row = result["predicates"][0]
        self.assertEqual(row["status"], "unknown")
        self.assertEqual(row["unresolved"][0]["state"], "corrupted")
        self.assertEqual(result["resources"]["payload_bytes"], size)

    def test_unrecoverable_payload_defers_other_independent_claims(self):
        f = self.fixture
        f.add("peak_force", "a-corrupted", 13)
        f.add("peak_force", "b-deferred", 14)
        (f.root / "a-corrupted.json").write_bytes(b"truncated")
        with patch("pathlib.Path.open", side_effect=AssertionError("Opened a deferred payload")):
            result = f.run()
        row = result["predicates"][0]
        self.assertEqual(row["stop"], "resolve_required_payloads")
        self.assertEqual(row["deferred_ids"], ["b-deferred"])
        self.assertEqual(result["resources"]["payload_reads"], 0)

    def test_corrupted_replica_does_not_dismiss_verified_exact_copy(self):
        f = self.fixture
        f.add("peak_force", "a-bad", 13)
        f.add("peak_force", "b-good", 13)
        (f.root / "a-bad.json").write_bytes(b"truncated")
        result = f.run()
        first = result["predicates"][0]
        self.assertEqual(first["status"], "supported")
        self.assertEqual([w["state"] for w in first["witnesses"]], ["corrupted", "verified"])
        self.assertEqual(result["resources"]["payload_reads"], 1)

    def test_same_pin_different_timestamp_is_not_a_duplicate(self):
        f = self.fixture
        f.add("peak_force", "a-first", 13)
        f.add("peak_force", "b-timestamp-drift", 13)
        f.rows[-1]["observed_at"] = "2026-11-27T23:21:00Z"
        result = f.run()
        self.assertEqual(result["predicates"][0]["status"], "unknown")
        self.assertEqual(result["predicates"][0]["unresolved"][0]["state"], "invalid_payload")

    def test_valid_digest_cannot_cure_wrong_units_or_subject(self):
        f = self.fixture
        f.add("peak_force", "force-kg", 13, unit="kg")
        f.add("leak_volume", "other-bench", 0, subject="different")
        result = f.run()
        self.assertEqual([row["unresolved"][0]["state"] for row in result["predicates"]],
                         ["invalid_payload", "invalid_payload"])

    def test_wrong_index_digest_refuses_before_payload_open(self):
        f = self.fixture
        f.add("peak_force", "valid", 13)
        request, manifest = f.input()
        with patch("pathlib.Path.open", side_effect=AssertionError("Read a corrupt index witness")):
            with self.assertRaisesRegex(ValueError, "differs from the declared pin"):
                assess(request, manifest+b" ", f.root)

    def test_byte_budget_is_hard_cap_and_zero_budget_no_payload_reads(self):
        f = self.fixture
        size = f.add("peak_force", "valid", 13)
        f.add("leak_volume", "zero", 0)
        self.assertEqual(f.run(max_payload_bytes=0)["resources"]["payload_reads"], 0)
        result = f.run(max_payload_bytes=size)
        self.assertEqual(result["resources"]["payload_bytes"], size)
        self.assertEqual(result["predicates"][0]["status"], "supported")
        self.assertEqual(result["predicates"][1]["unresolved"][0]["state"], "budget_exhausted")

    def test_declared_payload_missing_and_locator_escape_refuse(self):
        f = self.fixture
        f.add("peak_force", "gone", 13)
        f.add("leak_volume", "outside", 0)
        (f.root / "gone.json").unlink()
        f.rows[-1]["path"] = "../outside.json"
        result = f.run()
        self.assertEqual([row["unresolved"][0]["state"] for row in result["predicates"]],
                         ["missing", "invalid_locator"])
        self.assertEqual(result["resources"]["payload_reads"], 0)

    def test_duplicate_evidence_id_and_noninteger_budget_refuse(self):
        f = self.fixture
        f.add("peak_force", "force", 13)
        with self.assertRaisesRegex(ValueError, "invalid evidence budget"):
            f.run(max_payload_bytes=True)
        f.rows.append(f.rows[0])
        with self.assertRaisesRegex(ValueError, "Duplicate evidence identity"):
            f.run()

    def test_order_independent_read_plan_after_pinning_manifest(self):
        f = self.fixture
        f.add("peak_force", "force", 13)
        f.add("leak_volume", "leak", 2)
        first = f.run()
        f.rows.reverse()
        second = f.run()
        self.assertNotEqual(first.pop("manifest_sha256"), second.pop("manifest_sha256"))
        self.assertEqual(first, second)

    def test_cli_supported_output_and_digest_drift_refusal(self):
        f = self.fixture
        f.add("peak_force", "force", 13)
        f.add("leak_volume", "leak", 0)
        request, manifest = f.input()
        request_file = f.root / "request.json"
        manifest_file = f.root / "manifest.json"
        request_file.write_bytes(wire(request))
        manifest_file.write_bytes(manifest)
        command = [sys.executable, "-B", str(Path(__file__).with_name("identify_missing_evidence.py")),
                   "--request", str(request_file), "--manifest", str(manifest_file), "--bundle", str(f.root)]
        run = partial(subprocess.run, command, capture_output=True, encoding="utf-8")
        self.assertEqual(json.loads(run(check=True).stdout)["status"], "evidence_sufficient")
        manifest_file.write_bytes(manifest + b" ")
        result = run()
        self.assertEqual(result.returncode, 2)
        self.assertEqual(json.loads(result.stdout)["status"], "refused")


if __name__ == "__main__":
    unittest.main()

Single-Line Diagram (SLD) Pages Workflow

A GitHub Actions workflow that builds and publishes the site. Runs on push, on pull requests and by hand.

automationsld / .github/workflows/pages.yml · lines 1–80 of 80 · Entry point

What it does
It builds and publishes its content. Side effects: makes network requests; starts processes.
Why it exists in the grid workflow
Domain stage sub33kv_design (repository name word 'sld'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
Inputs & outputs
Out: GitHub Pages deployment.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Verify and publish SLD library”; runs Single-Line Diagram (SLD) Fetch Sources (`scripts/fetch_sources.py`), Single-Line Diagram (SLD) Build Catalogue (`scripts/build_catalogue.py`) and Single-Line Diagram (SLD) Verify Furnace (`scripts/verify_furnace.py`); publishes to GitHub Pages.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
sld · .github/workflows · workflow
Uses
Single-Line Diagram (SLD) Fetch Sources (workflow run), Single-Line Diagram (SLD) Build Catalogue (workflow run), Test Furnace Gate (workflow run), Test Sources (workflow run), Single-Line Diagram (SLD) Verify Furnace (workflow run), Single-Line Diagram (SLD) Build Site (workflow run), Browser (workflow run)
Used by
none found
Produces
none declared
Defines here
Verify and publish SLD library
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
sld@1205aa0d1f80d8e05a2cbb19f363939174b50002 .github/workflows/pages.yml:1-80 · blob 95dffa6174d0c12157ad2623d546e1d9ed1178bf · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: network, process · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unknown
name: Verify and publish SLD library
on:
  push:
    branches: [main]
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: sld-pages-${{ github.ref }}
  cancel-in-progress: false

jobs:
  verify:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: '3.12'
      - uses: actions/setup-node@v6
        with:
          node-version: '22'
      - name: Verify pinned local sources and deterministic catalogue
        run: |
          python scripts/fetch_sources.py --check-offline
          python scripts/build_catalogue.py
          git diff --exit-code -- data/library.json data/source-lock.json
          python -m unittest discover -s tests -p 'test_*.py'
      - name: Verify exact GPU furnace acceptance
        run: python scripts/verify_furnace.py
      - name: Build allowlisted static site
        run: python scripts/build_site.py --out dist
      - name: Install browser test dependencies
        run: |
          npm ci
          npx playwright install --with-deps chromium
      - name: Test published artifact in Chromium
        env:
          BASE_URL: http://127.0.0.1:8765
        run: |
          python -m http.server 8765 --bind 127.0.0.1 --directory dist > /tmp/sld-http.log 2>&1 &
          server_pid=$!
          trap 'kill "$server_pid"' EXIT
          for attempt in $(seq 1 30); do
            if curl --fail --silent http://127.0.0.1:8765/ > /dev/null; then break; fi
            sleep 1
          done
          node tests/browser.cjs
      - name: Retain browser evidence
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: sld-browser-evidence
          path: artifacts
          if-no-files-found: ignore
      - name: Upload verified Pages artifact
        if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
        uses: actions/upload-pages-artifact@v4
        with:
          path: dist

  deploy:
    if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
    needs: verify
    runs-on: ubuntu-latest
    timeout-minutes: 10
    permissions:
      pages: write
      id-token: write
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Publish the verified artifact
        id: deployment
        uses: actions/deploy-pages@v4

Authority Bundle Sync Workflow

A GitHub Actions workflow in Solar Electrical Topology Analysis Engine Text Based. Runs on push and by hand.

automationsolar-electrical-topology-analysis-engine-text-based / .github/workflows/authority-bundle-sync.yml · lines 1–56 of 56 · Entry point

What it does
It runs automated jobs on GitHub Actions. Side effects: starts processes.
Why it exists in the grid workflow
Domain stage sub33kv_design (repository name word 'solar'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
Inputs & outputs
Out: commits pushed to the repository.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Runs Build Authority Bundle (`scripts/build_authority_bundle.py`).
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
solar-electrical-topology-analysis-engine-text-based · .github/workflows · workflow
Uses
Build Authority Bundle (workflow run)
Used by
none found
Produces
none declared
Defines here
Authority Bundle Projection
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
solar-electrical-topology-analysis-engine-text-based@d3b4c497144c2c9b3e8f0e82117e7e9abe4672b9 .github/workflows/authority-bundle-sync.yml:1-56 · blob cc98cc0e77eee7597855a4283e016163ebd08e91 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: process · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
name: Authority Bundle Projection

on:
  push:
    branches:
      - main
    paths:
      - "scripts/build_authority_bundle.py"
      - "scripts/reference_block_command.py"
      - "src/solar_topology/**"
      - ".github/workflows/authority-bundle-sync.yml"
  workflow_dispatch:

permissions:
  contents: write

concurrency:
  group: authority-bundle-projection-main
  cancel-in-progress: false

jobs:
  project:
    if: github.actor != 'github-actions[bot]' || github.event_name == 'workflow_dispatch'
    runs-on: ubuntu-latest
    timeout-minutes: 10

    steps:
      - name: Check out main
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ref: main

      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip

      - name: Install package
        run: python -m pip install -e .

      - name: Generate authority bundle
        run: python scripts/build_authority_bundle.py --write

      - name: Commit generated bundle
        run: |
          if [ -z "$(git status --porcelain -- authority-bundles/reference-inverter-block.json)" ]; then
            echo "Authority bundle already current"
            exit 0
          fi
          git config user.name "github-actions[bot]"
          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git add authority-bundles/reference-inverter-block.json
          git commit -m "data: project reference authority bundle"
          git push origin HEAD:main

Build 025 Small Gates Workflow

A GitHub Actions workflow in Solar Electrical Topology Analysis Engine Text Based. Runs on pull requests.

automationsolar-electrical-topology-analysis-engine-text-based / .github/workflows/build-025-small-gates.yml · lines 1–77 of 77 · Entry point

What it does
It runs automated jobs on GitHub Actions. Side effects: starts processes.
Why it exists in the grid workflow
Domain stage field_execution (path word 'gates'): on-road and off-road field navigation to the farm gate (access gates, terrain slope, ground-bearing limits, electrical hazards), as Ventus Ltd describes its SatNav work.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Its name says it builds small gates.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
solar-electrical-topology-analysis-engine-text-based · .github/workflows · workflow
Uses
Test Array Engine (workflow run), Test Array Authority Receipts (workflow run), Test Array Topology (workflow run), Test Authority Bundle (workflow run), Test Batch 011 013 (workflow run), Test Build023 Topology Invariants (workflow run), Test Build023 Topology Receipt (workflow run), Test Build024 Kernel Authority (workflow run), and 44 more
Used by
none found
Produces
none declared
Defines here
Build 025 small gates
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
solar-electrical-topology-analysis-engine-text-based@d3b4c497144c2c9b3e8f0e82117e7e9abe4672b9 .github/workflows/build-025-small-gates.yml:1-77 · blob 44db332eb4470a1eeb16202c1203ac25e3a5c6f7 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: process · domain stage: field_execution · users: EPC_contractor, landowner_planner · canonical: production_core
name: Build 025 small gates

on:
  pull_request:
    paths:
      - "geometry_authority.py"
      - "array_*.py"
      - "tests/test_geometry_authority.py"
      - "tests/test_array_*.py"
      - ".github/workflows/build-025-small-gates.yml"

permissions:
  contents: read

jobs:
  syntax:
    name: 01 syntax only
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Compile Build 025 modules
        run: |
          python -m py_compile \
            geometry_authority.py \
            array_topology.py \
            array_route_types.py \
            array_route_geometry.py \
            array_routing.py \
            array_engine.py

  topology:
    name: 02 topology contracts
    runs-on: ubuntu-latest
    needs: syntax
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install pytest only
        run: python -m pip install pytest>=8
      - name: Run geometry and topology tests
        run: |
          python -m pytest -q \
            tests/test_geometry_authority.py \
            tests/test_array_topology.py

  routing:
    name: 03 routing and receipts
    runs-on: ubuntu-latest
    needs: topology
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install pytest only
        run: python -m pip install pytest>=8
      - name: Run route-authority tests
        run: python -m pytest -q tests/test_array_engine.py

  regression:
    name: 04 repository regression
    runs-on: ubuntu-latest
    needs: routing
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install repository test dependencies
        run: python -m pip install -e ".[test]"
      - name: Run Python regression suite
        run: python -m pytest -q

Deploy Pages Workflow

A GitHub Actions workflow in Solar Electrical Topology Analysis Engine Text Based that builds and publishes the site. Runs on push and by hand.

automationsolar-electrical-topology-analysis-engine-text-based / .github/workflows/deploy-pages.yml · lines 1–34 of 34 · Entry point

What it does
It builds and publishes its content. Side effects: starts processes.
Why it exists in the grid workflow
Domain stage sub33kv_design (repository name word 'solar'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
Inputs & outputs
Out: GitHub Pages deployment.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Deploy static topology workbench to GitHub Pages”; publishes to GitHub Pages.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
solar-electrical-topology-analysis-engine-text-based · .github/workflows · workflow
Uses
none found
Used by
none found
Produces
none declared
Defines here
Deploy static topology workbench to GitHub Pages
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
solar-electrical-topology-analysis-engine-text-based@d3b4c497144c2c9b3e8f0e82117e7e9abe4672b9 .github/workflows/deploy-pages.yml:1-34 · blob 42c9663b9e3d66de3a6326864a8777de324be5d4 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: process · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
name: Deploy static topology workbench to GitHub Pages

on:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: pages
  cancel-in-progress: true

jobs:
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Configure Pages
        uses: actions/configure-pages@v5
      - name: Upload static site
        uses: actions/upload-pages-artifact@v3
        with:
          path: .
      - name: Deploy
        id: deployment
        uses: actions/deploy-pages@v4