From de2c19cf53a970f6d141c5c6ebc031c759546880 Mon Sep 17 00:00:00 2001 From: Aleksei Solonskii Date: Sat, 12 Sep 2026 04:47:48 +0200 Subject: [PATCH 1/2] Prepare Grid Witness Open Innovation submission with live verification --- .../solonsky-grid-witness/RIGHTS.md | 16 + .../solonsky-grid-witness/SUBMISSION.md | 50 +++ .../solonsky-grid-witness/source/.gitignore | 4 + .../solonsky-grid-witness/source/BENCHMARK.md | 57 +++ .../solonsky-grid-witness/source/LICENSE | 21 + .../solonsky-grid-witness/source/README.md | 65 +++ .../solonsky-grid-witness/source/api.py | 61 +++ .../solonsky-grid-witness/source/app.py | 49 +++ .../solonsky-grid-witness/source/benchmark.py | 221 ++++++++++ .../solonsky-grid-witness/source/core.py | 67 +++ .../source/requirements-test.lock | 16 + .../source/requirements-test.txt | 2 + .../source/requirements.txt | 2 + .../solonsky-grid-witness/source/test_api.py | 52 +++ .../source/test_benchmark.py | 92 ++++ .../solonsky-grid-witness/submission.json | 10 + .../verification/README.md | 47 +++ .../verification/github-source-audit.json | 70 ++++ .../verification/hf-source-audit.json | 71 ++++ .../verification/live-api.json | 395 ++++++++++++++++++ .../verification/official-online-check.txt | 26 ++ .../verification/tests.txt | 23 + 22 files changed, 1417 insertions(+) create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/RIGHTS.md create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/.gitignore create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/BENCHMARK.md create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/LICENSE create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/README.md create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/api.py create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/app.py create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/benchmark.py create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/core.py create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/requirements-test.lock create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/requirements-test.txt create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/requirements.txt create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/test_api.py create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/source/test_benchmark.py create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/submission.json create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/verification/README.md create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/verification/github-source-audit.json create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/verification/hf-source-audit.json create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/verification/live-api.json create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/verification/official-online-check.txt create mode 100644 submissions/mcp-hackathon/solonsky-grid-witness/verification/tests.txt diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/RIGHTS.md b/submissions/mcp-hackathon/solonsky-grid-witness/RIGHTS.md new file mode 100644 index 0000000..8ccc686 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/RIGHTS.md @@ -0,0 +1,16 @@ +# Submission rights declaration + +Project: Grid Witness +Submission slug: solonsky-grid-witness +Submitter: Aleksei Solonskii (Alex SOLONSKY) +Date: 2026-09-12 + +The submitter confirms that they own, or have sufficient authorization for, the source code, dependencies, service, data, branding, and other materials submitted in this pull request. + +Subject to the official program terms, the submitter authorizes X-Agent to retain, reproduce, audit, test, archive, and publish the submitted program artifact for judging, fraud prevention, dispute handling, ecosystem submission, and post-award accountability. Closing the pull request, deleting a fork, or deleting an external repository does not revoke the official archive rights attached to an accepted and rewarded entry. + +The original project source is MIT-licensed. The numerical baseline is the submitter's synthetic classical demonstrator, not sponsor data or proprietary utility software. This entry adds the agent/HTTP capability and its tests. No third-party dataset, brand asset or pretrained model is included. + +Runtime dependencies: FastAPI (MIT), Starlette (BSD-3-Clause), Pydantic (MIT), Uvicorn (BSD-3-Clause), Gradio (Apache-2.0), Hugging Face spaces (Apache-2.0). HTTPX (BSD-3-Clause) is used for tests. Applicable licenses and notices remain those in each package distribution. source/requirements-test.lock lists the tested dependency set; the Hugging Face platform manages Gradio and spaces runtime packages. + +Exceptions/restrictions: this small synthetic educational example must not be represented as a real-grid engineering approval, an E.ON dataset, certified AC global optimality, or quantum advantage. No private Life CP code or personal data is part of this submission. diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md b/submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md new file mode 100644 index 0000000..d7118ca --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md @@ -0,0 +1,50 @@ +# Grid Witness + +## Capability + +- **Track:** General Challenge (Open Innovation). +- **One-line description:** Give an agent a reproducible numerical witness when a simplified grid-upgrade screen is too optimistic. +- **Who it helps:** Developers testing whether an agent can challenge a proposed plan instead of blindly accepting its optimizer output; educators demonstrating model mismatch. +- **Capability boundary:** One fixed synthetic six-line radial chain, 64 upgrade plans and three demand scales. No arbitrary network ingestion or real-world design advice. Reports AC operating-point residuals and violations; does not certify physical infeasibility or an AC global optimum. + +A cost-18 plan `111000` passes the rational lossless screen but has a minimum-voltage violation after AC power flow at high load. Budget comparison finds two cost-20 plans with accepted operating points across all three scenarios. Costs are synthetic units, not money. The capability returns the actual violation magnitude and residuals, alongside an explicit unresolved state when a check cannot be trusted. + +## Live API + +- **API base:** https://bestdeeplearning-grid-witness.hf.space/v1 +- **Health:** https://bestdeeplearning-grid-witness.hf.space/health +- **Authentication:** none, no reviewer secrets. +- **Limits:** six integer bits or integer budget 0–27, 2048-byte JSON request limit. Bounded 64-plan catalogue. No dedicated per-user rate limiter; hosting platform limits and cold starts apply; no SLA. +- **Contract:** source/README.md; `POST /v1/inspect-plan`, `POST /v1/compare-budget`, `GET /v1/benchmark`. Invalid input returns HTTP 400; unknown routes return 404. +- **Demo:** https://bestdeeplearning-grid-witness.hf.space/ + +## Source and reproducibility + +- **Repository:** https://github.com/alexsolonsky/grid-witness +- **Review commit:** `9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35` +- **Complete reviewed source:** source/ +- **Tests:** `cd source && python -m pip install -r requirements-test.txt && python -m unittest discover -v` (16 tests). +- **Run locally:** install Gradio 6.27.0 and spaces in addition to requirements.txt; set SOURCE_COMMIT to the reviewed SHA; `python app.py`. +- **Deploy:** public Hugging Face Gradio Space with README configuration, free ZeroGPU allocation; set public variable SOURCE_COMMIT and upload reviewed files. All grid work uses CPU; optional one-second scheduler diagnostics satisfy the free-hosting runtime requirement. No paid hardware or external model API. +- **Version binding:** health and same-origin proof expose the public deployment SHA. Verification additionally compares all uploaded source file SHA-256 hashes against GitHub at that commit; self-reported health alone is not proof of provenance. + +The classical benchmark predates the API packaging, and is identified in BENCHMARK.md. The full catalogue and all 512 encoded surrogate states are exhaustively checked; no quantum computation was performed. The original baseline has not been represented as a newly invented numerical method. + +## Verification + +See verification/README.md for exact commands, recorded responses and expected errors. The live API must match the declared commit before submission. + +## Security and data + +- **Collected:** only user-supplied binary upgrade decisions or a bounded budget for the fixed example. +- **Purpose/retention:** calculations in memory; no application database, input/output logs or stored run history. The hosting provider may retain platform access logs. +- **Third parties:** Hugging Face hosting and Gradio runtime/assets. Scientific computation has no outbound requests, model calls or paid API dependencies. +- **Secrets:** none needed or included. +- **Restrictions:** no real network or personal data should be sent. Numerical limitations are explicit in API output and README. HTTP API and numerical solver have validation tests; no claim of a production security audit. + +## Support + +- **Builder:** Alex SOLONSKY / Aleksei Solonskii. +- **Contact:** https://github.com/alexsolonsky/grid-witness/issues +- **License:** MIT; dependencies retain their licenses. See RIGHTS.md. +- **Registration:** Luma registration confirmed on 2026-09-12. Telegram community join requires the submitter's interactive login and is pending; not represented as completed. diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/.gitignore b/submissions/mcp-hackathon/solonsky-grid-witness/source/.gitignore new file mode 100644 index 0000000..f017b7b --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/.gitignore @@ -0,0 +1,4 @@ +__pycache__/ +.venv/ +.env +results.json diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/BENCHMARK.md b/submissions/mcp-hackathon/solonsky-grid-witness/source/BENCHMARK.md new file mode 100644 index 0000000..bb18828 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/BENCHMARK.md @@ -0,0 +1,57 @@ +# Synthetic classical grid-reinforcement protocol + +Executed local infrastructure prototype, 12 September 2026. **This is not an E.ON benchmark, contest submission, quantum algorithm or demonstration of quantum advantage.** The sponsor's full brief remains unavailable. The instance and voltage limit are deliberately crafted to make a tiny linear screening model reducible to an exactly checkable binary constraint and expose disagreement with AC validation. + +## Reproduce + +Python 3, standard library only; no packages, accounts, payment or network access required. From this directory: + +```sh +python3 -m unittest discover -s . -p 'test_*.py' -v +python3 benchmark.py +``` + +The second command overwrites `results.json` with the complete 64-plan × 3-scenario catalogue, specification, source hash, A/B/C references and runtime. `verification.json` records the validation run supplied with this version. Results are deterministic except runtime; Python version and source SHA-256 are recorded. Runtime is local bookkeeping, not a comparison with any competing algorithm. + +## Model + +Six existing edges form radial chain 0–1–2–3–4–5–6. Slack voltage is 1+0j. Every other bus consumes constant complex power 0.08+j0.04 per unit times a design load scale of 0.6, 1.0 or 1.2. Each binary investment halves its edge impedance from 0.01+j0.006 to 0.005+j0.003; ampacity remains 1 per unit. Costs `[7,6,5,4,3,2]` are arbitrary units, **not euros**. Voltage magnitude limits are the square roots of 0.966304 and 1.1025. No physical base MVA or kV is selected, so no physical grid capacity claim is possible. + +**A — exact finite lossless reference.** Rational LinDistFlow squared voltages include active and reactive flows but omit line losses. The current screening proxy is apparent power magnitude at assumed 1-per-unit voltage. Positive demand and radial-chain topology make the terminal bus and maximum scale binding for voltage. With investment bits `x`, the terminal squared voltage at scale 1.2 is exactly: + +``` +0.947584 + 0.001248 * (6*x0 + 5*x1 + 4*x2 + 3*x3 + 2*x4 + x5) +``` + +Thus the constructed limit is equivalent to weighted investment sum ≥15. Upper voltage and proxy thermal constraints do not bind on this instance. All 64 complete linear checks are compared against this reduced predicate, rather than assuming the reduction generalizes. + +**B — numerical AC acceptance catalogue.** A backward/forward sweep solves the balanced single-phase equivalent. The independent residual calculation derives branch currents from voltage differences and impedance, then checks complex nodal power balance, nodal current balance, fixed slack voltage, voltage limits and ampacity. Flat initialization, no fallback, 500-iteration cap; voltage-change tolerance `1e-12`, absolute residual tolerance `1e-9`, floating limit tolerance `1e-10` per unit. Nonconvergence, invalid voltages or failed residuals are `unresolved`; a returned solution beyond limits is `returned_operating_point_violates_limits`. Neither status proves physical infeasibility. No external power-flow implementation or uniqueness certificate was used. + +**C — complete integer QUBO reference.** Nine variables comprise six investments plus three slack bits. Enumerate all 512 states of: + +``` +C(x) + 28 * (6*x0 + 5*x1 + 4*x2 + 3*x3 + 2*x4 + x5 - 15 - s)^2 +s = y0 + 2*y1 + 4*y2 +``` + +Maximum feasible excess is 6, within the slack range 0–7. The penalty 28 exceeds total investment cost 27, and every nonzero integer residual incurs at least 28. A zero-penalty feasible solution exists. Expanded linear/quadratic energies are checked against the squared form for every state; projection over slack bits is checked for every investment vector. This encoding is valid only for A on this particular instance; it does not encode AC physics. + +## Measured result + +| Reference | Evaluated | Accepted plans | Reference cost | +|---|---:|---:|---:| +| A, exact specified lossless model | 64 plans | 14 | 18 | +| B, declared AC procedure | 192 plan/scenario checks | 10 | 20 | +| C, complete QUBO enumeration | 512 bit states | — | Minimum energy 18 | + +A's sole minimum plan is `[1,1,1,0,0,0]`. B's best accepted plans are `[1,1,0,1,1,0]` and `[1,1,1,0,0,1]`. Four A-accepted plans fail the AC limit predicate. All 192 AC checks converged and passed residual checks on this run; zero were unresolved. **Cost 20 is the lowest cost accepted by this numerical procedure, not a certified global AC optimum.** The small crafted example supports only the need to keep the three references distinct. + +## Validation evidence + +Eight tests passed. They cover a zero-load feeder; a one-edge closed-form high-voltage solution; independent complex-power conservation including losses on all 192 cases; forced nonconvergence; deliberately corrupted voltages and incorrect slack; zero/NaN/infinite voltages; exhaustive QUBO expansion and slack projection; and catalogue/reference counts. Inspection revealed the validator originally omitted fixed-slack residuals and could divide by zero on failed voltage vectors. Both were corrected before recording this result. + +## Limits and next work + +No renewable-generation, held-out stress, contingency, unbalanced, meshed, topology-changing or dispatch scenarios; no cost uncertainty, physical unit calibration or sponsor dataset. No matching optimization-package cross-check, independently implemented external AC solver, heuristic comparison, QAOA simulator, quantum hardware or resource advantage. All scenarios are design scenarios, not unseen validation data. Full enumeration is reference construction, not an efficient search method. Tuning this instance's limit to expose screening error does not estimate real-world failure frequency. + +This is only a reproducible foundation for the proposal's A/B/C protocol. Read the actual sponsor brief before adapting scope. Next technical milestones are an external electrical cross-check and fixed, separate design/stress instances, followed by equal-budget classical comparisons; only then is a quantum sampler comparison meaningful. diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/LICENSE b/submissions/mcp-hackathon/solonsky-grid-witness/source/LICENSE new file mode 100644 index 0000000..dceabf8 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Aleksei Solonskii + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/README.md b/submissions/mcp-hackathon/solonsky-grid-witness/source/README.md new file mode 100644 index 0000000..a520a32 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/README.md @@ -0,0 +1,65 @@ +--- +title: Grid Witness +emoji: 🔎 +colorFrom: indigo +colorTo: blue +sdk: gradio +sdk_version: 6.27.0 +app_file: app.py +python_version: 3.12 +license: mit +--- +# Grid Witness + +A deterministic capability for an AI agent to challenge an optimistic grid-upgrade plan with numerical evidence. It compares exact rational lossless LinDistFlow screening against a backward/forward-sweep AC operating point and independently recomputed current, power, slack and limit residuals. + +**Scope:** one fixed synthetic six-line radial chain, three load levels, 64 upgrade plans. Not real network data, not E.ON technology, not a quantum algorithm or an industrial engineering certificate. A returned operating point violating a limit is not a proof that all AC solutions are infeasible. + +## Try the counterexample + +Send `{"bits":[1,1,1,0,0,0]}` to `POST /v1/inspect-plan`. The cost-18 plan passes the lossless screen but its AC operating point violates the minimum-voltage limit at scale 1.2. `POST /v1/compare-budget` with `{"budget":20}` finds two cost-20 plans whose computed operating points pass all three scenarios. Budget 19 finds none. These are arbitrary synthetic cost units, not EUR or USD. + +## API + +- `GET /health`: versioned service health (503 if SOURCE_COMMIT not a 40-character SHA). +- `GET /.well-known/xagent-verification.json`: submission slug and same review commit. +- `GET /v1/benchmark`: full specification, summary and limitations. +- `POST /v1/inspect-plan`: exactly one `bits` field with six integer binary values. Booleans, strings, floats and extra fields are rejected. +- `POST /v1/compare-budget`: exactly one integer `budget` from 0 to 27. + +POST requests require `application/json` and at most 2048 bytes. Invalid requests return HTTP 400 and a stable `invalid_request` error. Unknown routes return 404. Calls enumerate a bounded catalogue cached in memory; no unconstrained network input, arbitrary execution or model calls. No dedicated service-level rate limit; hosting provider limits and cold starts apply. Request concurrency is handled by Gradio/FastAPI; returned data is copied to prevent cache mutation. No availability SLA. + +## Reproduce + +Python 3.12+: + +```sh +python -m venv .venv +.venv/bin/pip install -r requirements-test.txt +.venv/bin/python -m unittest discover -v +.venv/bin/python benchmark.py +``` + +`requirements-test.lock` records the locally tested dependency set. The numerical benchmark itself uses only the Python standard library. Sixteen tests cover the closed-form one-line case, power conservation, independent residual checks, nonconvergence, all 64 plan outputs and 512 encoded surrogate states, API validation and cost boundaries. + +For the Gradio demo, install `gradio==6.27.0` and `spaces` in addition to `requirements.txt`, then set `SOURCE_COMMIT` to the source commit and run `python app.py`. On Hugging Face Spaces the platform supplies Gradio and spaces; do not add conflicting pins to requirements.txt. + +## Deploy + +Create a public Gradio Space on a free ZeroGPU allocation, set its **public variable** SOURCE_COMMIT to the reviewed GitHub SHA, and upload exactly that commit's files with `hf upload NAMESPACE/SPACE . --type space`. No secrets are needed. The optional hosting diagnostics handler declares a one-second ZeroGPU scheduler probe to meet free-tier hosting requirements; **all grid calculations run on CPU** and never allocate a GPU. CPU Basic creation currently requires a paid Hugging Face plan, so no paid hardware was selected. + +The commit is provided at deployment rather than embedded in its own source. Verify the deployed files against the review commit as well as checking health/proof. Source commit changes require updating the deployment variable and archiving fresh verification evidence. + +## Mathematical model and provenance + +Adapted from a synthetic classical demonstrator prepared for Alex SOLONSKY before this hackathon API. `benchmark.py` preserves that original model. It includes an exhaustively verified QUBO encoding only to check its equivalence to the lossless surrogate; no quantum computation is performed. Grid Witness adds the HTTP/agent capability, strict validation, bounded-budget comparison, UI and API tests. + +Bus 0 is 1+0j slack; edges 0–1 through 5–6 have impedance 0.01+j0.006 p.u. Upgrade bits halve impedance without changing ampacity 1 p.u. Six constant PQ loads are 0.08+j0.04 p.u., multiplied by 0.6, 1, 1.2. Squared voltage bounds are 966304/1000000 and 11025/10000. Costs are [7,6,5,4,3,2]. No renewable uncertainty, contingencies, phase unbalance, topology control, independent external solver, AC uniqueness/global optimum proof or quantum advantage claim. + +## Privacy and third parties + +Only six binary decisions or an integer budget enter the capability. Inputs and outputs are not saved by the application; no database, uploads, analytics, LLM calls or outbound requests occur during scientific computation. Hugging Face serves the app and may keep platform access logs. Gradio assets/runtime and its optional hosting diagnostics contact the platform. Do not send personal or operational network data. + +Source: MIT. Dependencies: FastAPI MIT, Starlette BSD-3-Clause, Pydantic MIT, Uvicorn BSD-3-Clause, Gradio Apache-2.0, Hugging Face spaces Apache-2.0, HTTPX BSD-3-Clause (test only). See package distributions for complete transitive notices. No pretrained models or external datasets. + +Builder: Alex SOLONSKY (Aleksei Solonskii). Support: open an issue in this repository. No connection to the cancelled EvidenceDesk project or private Life CP code. diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/api.py b/submissions/mcp-hackathon/solonsky-grid-witness/source/api.py new file mode 100644 index 0000000..6afa1ac --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/api.py @@ -0,0 +1,61 @@ +"""Stateless HTTP capability; no input persistence or outbound API calls.""" +import json +import os +import re +from fastapi import APIRouter, Request +from fastapi.responses import JSONResponse +from core import inspect_plan, compare_budget, summary + +router = APIRouter() +SLUG = 'solonsky-grid-witness' +MAX_BODY = 2048 + +def review_commit(): + value = os.environ.get('SOURCE_COMMIT', '') + return value if re.fullmatch(r'[a-f0-9]{40}', value) else None + +@router.get('/health') +def health(): + commit = review_commit() + return JSONResponse({'status': 'ok' if commit else 'unversioned', 'commit': commit}, status_code=200 if commit else 503) + +@router.get('/.well-known/xagent-verification.json') +def proof(): + return {'schemaVersion': 1, 'slug': SLUG, 'commit': review_commit()} + +@router.get('/v1/benchmark') +def benchmark_summary(): + return summary() + +async def body(request): + if request.headers.get('content-type', '').split(';')[0].strip().lower() != 'application/json': + raise ValueError('Content-Type must be application/json') + data = bytearray() + async for chunk in request.stream(): + data.extend(chunk) + if len(data) > MAX_BODY: + raise ValueError('Request body exceeds 2048 bytes') + obj = json.loads(data, parse_constant=lambda _: (_ for _ in ()).throw(ValueError('Nonfinite JSON numbers are not allowed'))) + if not isinstance(obj, dict): + raise ValueError('JSON body must be an object') + return obj + +@router.post('/v1/inspect-plan') +async def inspect(request: Request): + try: + obj = await body(request) + if set(obj) != {'bits'}: + raise ValueError('Expected exactly one field: bits') + return inspect_plan(obj['bits']) + except (ValueError, UnicodeError): + return JSONResponse({'error': 'invalid_request', 'message': 'Use application/json with exactly {"bits":[0,0,0,0,0,0]}; six integer binary values; max 2048 bytes.'}, status_code=400) + +@router.post('/v1/compare-budget') +async def budget(request: Request): + try: + obj = await body(request) + if set(obj) != {'budget'}: + raise ValueError('Expected exactly one field: budget') + return compare_budget(obj['budget']) + except (ValueError, UnicodeError): + return JSONResponse({'error': 'invalid_request', 'message': 'Use application/json with exactly {"budget":20}; integer 0..27 in synthetic units; max 2048 bytes.'}, status_code=400) diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/app.py b/submissions/mcp-hackathon/solonsky-grid-witness/source/app.py new file mode 100644 index 0000000..ff0bc7f --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/app.py @@ -0,0 +1,49 @@ +"""Gradio demonstration plus plain JSON REST API, hosted without paid compute.""" +import os +os.environ['GRADIO_ANALYTICS_ENABLED'] = 'False' +import spaces +import gradio as gr +from api import router +from core import inspect_plan, compare_budget +from threading import Event + +@spaces.GPU(duration=1) +def hosting_probe() -> str: + """Optional free-host scheduler probe. Scientific calculations use CPU only.""" + return 'Host available. Grid calculations execute on CPU without GPU allocation.' + +def inspect_text(plan: str) -> dict: + """Inspect six binary characters in fixed edge order; returns numerical witnesses.""" + if len(plan) != 6 or any(c not in '01' for c in plan): + raise gr.Error('Enter exactly six characters: 0 or 1, such as 111000.') + return inspect_plan([int(c) for c in plan]) + +def budget_tool(budget: int) -> dict: + """Compare all 64 synthetic upgrade plans within an integer cost budget 0 to 27.""" + return compare_budget(budget) + +with gr.Blocks(title='Grid Witness') as demo: + gr.Markdown('# Grid Witness\n### A second check before an agent trusts a simplified model\nA fixed synthetic six-line grid. Compare lossless screening with AC residual and operating-limit checks. **Educational benchmark, not engineering advice or a real-grid certificate.**') + with gr.Tab('Inspect a plan'): + plan = gr.Textbox(label='Upgrade plan — six binary characters', value='111000') + result = gr.JSON(label='Evidence and decision') + gr.Button('Check operating points', variant='primary').click(inspect_text, plan, result, api_name='inspect_plan') + gr.Examples([['111000'], ['110110'], ['000000']], plan) + with gr.Tab('Compare a budget'): + budget = gr.Slider(0,27,value=20,step=1,label='Budget in arbitrary synthetic units') + comparison = gr.JSON(label='Catalogue comparison') + gr.Button('Enumerate 64 plans').click(budget_tool, budget, comparison, api_name='compare_budget') + gr.Markdown('REST: `/v1/inspect-plan`, `/v1/compare-budget`, `/v1/benchmark` · [Source](https://github.com/alexsolonsky/grid-witness) · Alex SOLONSKY\n\nNo prompts, personal information or uploads are needed. Inputs are processed in memory; the hosting provider may retain access logs. No paid API, no external model, no quantum computation.') + with gr.Accordion('Hosting diagnostics', open=False): + gr.Button('Optional scheduler probe').click(hosting_probe, outputs=gr.Textbox(), api_name=False) + +if __name__ == '__main__': + demo.launch(server_name='0.0.0.0', server_port=int(os.environ.get('PORT',7860)), + prevent_thread_lock=True, mcp_server=True, ssr_mode=False, + run_history=False) + # Add public JSON routes before Gradio's catch-all page route. + existing = list(demo.app.router.routes) + demo.app.include_router(router) + added = demo.app.router.routes[len(existing):] + demo.app.router.routes[:] = added + existing + Event().wait() diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/benchmark.py b/submissions/mcp-hackathon/solonsky-grid-witness/source/benchmark.py new file mode 100644 index 0000000..2439df1 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/benchmark.py @@ -0,0 +1,221 @@ +"""Synthetic protocol demonstrator. Standard library only; no quantum computation. + +Balanced single-phase equivalent, fixed radial chain, constant PQ loads, no shunts. +All electrical quantities are per unit. Not an E.ON dataset or industrial model. +""" +from fractions import Fraction as F +from itertools import product +from pathlib import Path +import hashlib +import json +import math +import platform +import time + +N = 6 +COST = (7, 6, 5, 4, 3, 2) # arbitrary synthetic cost units, not EUR +WEIGHTS = (6, 5, 4, 3, 2, 1) +SCALES = (F(3, 5), F(1), F(6, 5)) +VMIN2 = F(966304, 1000000) +VMAX2 = F(11025, 10000) +IMAX = F(1) +PF_TOL = 1e-12 +RESIDUAL_TOL = 1e-9 # per-unit complex power and current mismatch +LIMIT_TOL = 1e-10 # per-unit voltage/current, solely floating point comparison + + +def network(bits, scale): + """Each edge's upgrade halves both r and x; ratings remain unchanged.""" + z = [complex(.01, .006) * (1 - .5 * bit) for bit in bits] + loads = [complex(.08, .04) * float(scale)] * len(bits) + return z, loads + + +def linear_check(bits, scale): + """Lossless LinDistFlow screening, exact rational squared-voltage arithmetic. + + Thermal screening uses |S_edge| at assumed voltage 1 p.u., not AC current. + """ + v2 = F(1) + voltages = [v2] + max_i2 = F(0) + for edge, bit in enumerate(bits): + count = len(bits) - edge + p, q = F(2, 25) * scale * count, F(1, 25) * scale * count + factor = F(1) - F(bit, 2) + r, x = F(1, 100) * factor, F(3, 500) * factor + v2 -= 2 * (r * p + x * q) + voltages.append(v2) + max_i2 = max(max_i2, p * p + q * q) + return { + 'accepted': all(VMIN2 <= v <= VMAX2 for v in voltages) + and max_i2 <= IMAX * IMAX, + 'minimum_v_squared_exact': str(min(voltages)), + 'minimum_v_squared': float(min(voltages)), + 'maximum_current_proxy_squared': float(max_i2), + } + + +def power_flow(z, loads, max_iter=500): + """Backward/forward sweep. Return voltages; validation is independent.""" + v = [1 + 0j] * (len(z) + 1) + for iteration in range(1, max_iter + 1): + try: + injection = [(s / vi).conjugate() for s, vi in zip(loads, v[1:])] + except ZeroDivisionError: + return v, False, iteration + downstream, currents = 0j, [0j] * len(z) + for edge in reversed(range(len(z))): + downstream += injection[edge] + currents[edge] = downstream + new = [1 + 0j] + for impedance, current in zip(z, currents): + new.append(new[-1] - impedance * current) + if not all(math.isfinite(x.real) and math.isfinite(x.imag) for x in new): + return v, False, iteration + difference = max(abs(a - b) for a, b in zip(v, new)) + v = new + if difference <= PF_TOL: + return v, True, iteration + return v, False, max_iter + + +def validate_ac(z, loads, voltages, converged=True): + """Recompute currents from Ohm's law, not the sweep's stored currents.""" + if len(z) != len(loads) or len(voltages) != len(z) + 1: + raise ValueError('Inconsistent network/voltage dimensions') + if (not all(math.isfinite(v.real) and math.isfinite(v.imag) for v in voltages) + or any(abs(v) == 0 for v in voltages[1:])): + return dict(status='unresolved', reason='nonfinite_or_zero_voltage') + currents = [(voltages[i] - voltages[i + 1]) / zi for i, zi in enumerate(z)] + max_power, max_current = 0., 0. + for i, s in enumerate(loads): + outgoing = currents[i + 1] if i + 1 < len(currents) else 0j + net = currents[i] - outgoing + max_power = max(max_power, abs(voltages[i + 1] * net.conjugate() - s)) + demand_i = (s / voltages[i + 1]).conjugate() + max_current = max(max_current, abs(net - demand_i)) + magnitudes = [abs(v) for v in voltages] + min_v, max_v = min(magnitudes), max(magnitudes) + max_i = max(map(abs, currents), default=0.) + slack_residual = abs(voltages[0] - (1 + 0j)) + residual_ok = max(max_power, max_current, slack_residual) <= RESIDUAL_TOL + limits_ok = (min_v >= math.sqrt(float(VMIN2)) - LIMIT_TOL + and max_v <= math.sqrt(float(VMAX2)) + LIMIT_TOL + and max_i <= float(IMAX) + LIMIT_TOL) + if not converged or not residual_ok: + status = 'unresolved' + elif not limits_ok: + status = 'returned_operating_point_violates_limits' + else: + status = 'accepted' + slack = voltages[0] * currents[0].conjugate() if currents else 0j + return dict(status=status, min_voltage_pu=min_v, max_voltage_pu=max_v, + max_current_pu=max_i, max_power_residual_pu=max_power, + max_current_residual_pu=max_current, + slack_voltage_residual_pu=slack_residual, + slack_power_pu=[slack.real, slack.imag], + max_voltage_violation_pu=max(0, math.sqrt(float(VMIN2)) - min_v, + max_v - math.sqrt(float(VMAX2))), + max_thermal_violation_pu=max(0, max_i - float(IMAX))) + + +def qubo_coefficients(): + """C(x)+28*(sum(w*x)-15-s)^2, with s=y0+2*y1+4*y2.""" + coefficients = list(WEIGHTS) + [-1, -2, -4] + penalty = sum(COST) + 1 + linear = [penalty * (a * a - 30 * a) + (COST[i] if i < N else 0) + for i, a in enumerate(coefficients)] + quadratic = {(i, j): 2 * penalty * coefficients[i] * coefficients[j] + for i in range(9) for j in range(i + 1, 9)} + return penalty * 225, linear, quadratic + + +def qubo_energy(bits): + constant, h, j = qubo_coefficients() + return constant + sum(a * b for a, b in zip(h, bits)) + sum( + a * bits[i] * bits[k] for (i, k), a in j.items()) + + +def run(): + started = time.perf_counter() + records = [] + for bits in product((0, 1), repeat=N): + scenarios = [] + for scale in SCALES: + z, loads = network(bits, scale) + v, converged, iterations = power_flow(z, loads) + scenarios.append(dict(scale=str(scale), A=linear_check(bits, scale), + B=validate_ac(z, loads, v, converged), + iterations=iterations)) + accepted_a = all(s['A']['accepted'] for s in scenarios) + accepted_b = all(s['B']['status'] == 'accepted' for s in scenarios) + unresolved = any(s['B']['status'] == 'unresolved' for s in scenarios) + records.append(dict(bits=list(bits), cost=sum(c*x for c, x in zip(COST, bits)), + A_accepted=accepted_a, B_accepted=accepted_b, + B_unresolved=unresolved, scenarios=scenarios)) + a_records = [r for r in records if r['A_accepted']] + b_records = [r for r in records if r['B_accepted']] + a_min = min(r['cost'] for r in a_records) + b_min = min((r['cost'] for r in b_records), default=None) + energy_records = [dict(encoded_bits=list(bits), energy=qubo_energy(bits)) + for bits in product((0, 1), repeat=9)] + minimum_energy = min(r['energy'] for r in energy_records) + winners = [r for r in energy_records if r['energy'] == minimum_energy] + # Derivation is valid only for this monotonic fixed-topology toy instance. + a_equivalence = all(r['A_accepted'] == (sum(w*x for w, x in zip(WEIGHTS, r['bits'])) >= 15) + for r in records) + c_winners_match = all(r['encoded_bits'][:6] in + [a['bits'] for a in a_records if a['cost'] == a_min] + for r in winners) + c_expansion_matches = all( + r['energy'] == sum(c*x for c, x in zip(COST, r['encoded_bits'][:N])) + + 28 * (sum(w*x for w, x in zip(WEIGHTS, r['encoded_bits'][:N])) - 15 + - sum(w*x for w, x in zip((1, 2, 4), r['encoded_bits'][N:]))) ** 2 + for r in energy_records) + report = dict( + status='executed_synthetic_classical_protocol_demonstrator_not_submission', + quantum_computation_performed=False, sponsor_data_used=False, + implementation_sha256=hashlib.sha256(Path(__file__).read_bytes()).hexdigest(), + python_version=platform.python_version(), + specification=dict(topology='chain 0-1-2-3-4-5-6; bus 0 slack at 1+0j', + units='per unit; arbitrary synthetic capital cost units', + base_line_impedance_pu=[.01,.006], upgraded_line_impedance_pu=[.005,.003], + ampacity_pu=1, base_bus_PQ_pu=[.08,.04], scenario_scales=list(map(str,SCALES)), + voltage_min_squared_exact=str(VMIN2), voltage_max_squared_exact=str(VMAX2), + costs=list(COST), pf_voltage_tolerance_pu=PF_TOL, + residual_absolute_tolerance_pu=RESIDUAL_TOL, floating_limit_tolerance_pu=LIMIT_TOL, + initialization='flat 1+0j; no fallback', max_pf_iterations=500), + A=dict(plans=64, accepted=len(a_records), minimum_cost=a_min, + minimizing_plans=[r['bits'] for r in a_records if r['cost']==a_min], + exact_arithmetic=True, scope='specified rational lossless model only'), + B=dict(evaluations=64*len(SCALES), accepted_plans=len(b_records), + best_accepted_cost=b_min, + best_accepted_plans=[r['bits'] for r in b_records if r['cost']==b_min], + unresolved_scenarios=sum(s['B']['status']=='unresolved' for r in records for s in r['scenarios']), + unresolved_cheaper_plans=[r['bits'] for r in records if r['B_unresolved'] and (b_min is None or r['cost'] dict: + """Compare a six-bit upgrade plan across load scales 0.6, 1.0 and 1.2. + + Returns linear screening, AC residual/limit evidence and an explicit decision. + A limit violation describes the returned operating point, not a proof that + every possible AC solution is infeasible. Costs are synthetic, never money. + """ + validate_bits(bits) + row = next(r for r in _report()['catalogue'] if r['bits'] == bits) + out = deepcopy(row) + if row['B_unresolved']: + decision = 'unresolved' + elif row['B_accepted']: + decision = 'accepted_operating_points' + else: + decision = 'returned_operating_point_violates_limits' + out.update(decision=decision, linear_false_positive=row['A_accepted'] and not row['B_accepted'], scope=SCOPE, + cost_units='arbitrary synthetic units', quantum_computation_performed=False) + out['witnesses'] = [dict(scale=s['scale'], min_voltage_pu=s['B'].get('min_voltage_pu'), + voltage_limit_pu=float(benchmark.VMIN2)**0.5, + violation_pu=s['B'].get('max_voltage_violation_pu'), status=s['B']['status']) + for s in row['scenarios'] if s['B']['status'] != 'accepted'] + return out + +def compare_budget(budget: int) -> dict: + """Enumerate all 64 synthetic plans and return cheapest AC-accepted plans within budget. + + budget is an integer from 0 to 27 in arbitrary cost units. Enumeration is + exhaustive over this catalogue, but AC global optimality is not certified. + """ + if type(budget) is not int or not 0 <= budget <= 27: + raise ValueError('budget must be an integer from 0 through 27 in synthetic cost units') + report = _report() + within = [r for r in report['catalogue'] if r['cost'] <= budget] + ac = [r for r in within if r['B_accepted']] + best = min((r['cost'] for r in ac), default=None) + return dict(budget=budget, cost_units='arbitrary synthetic units', enumerated_plans=64, + plans_within_budget=len(within), ac_accepted_within_budget=len(ac), + cheapest_accepted_cost=best, + cheapest_accepted_plans=[r['bits'] for r in ac if r['cost'] == best], + linear_false_positives=[dict(bits=r['bits'], cost=r['cost']) for r in within if r['A_accepted'] and not r['B_accepted']], + verdict='accepted_operating_points_found' if ac else 'no_accepted_operating_point_found_within_budget', + global_ac_optimum_certified=False, scope=SCOPE) + +def summary() -> dict: + report = _report() + return dict(scope=SCOPE, plans=64, scenarios_per_plan=3, linear_accepted=report['A']['accepted'], + ac_accepted=report['B']['accepted_plans'], linear_min_cost=report['A']['minimum_cost'], + ac_best_accepted_cost=report['B']['best_accepted_cost'], + linear_false_positives=deepcopy(report['linear_accepted_but_ac_rejected']), + specification=deepcopy(report['specification']), limitations=deepcopy(report['limitations'][:-1]), + quantum_computation_performed=False) diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements-test.lock b/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements-test.lock new file mode 100644 index 0000000..1b41c29 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements-test.lock @@ -0,0 +1,16 @@ +annotated-doc==0.0.5 +annotated-types==0.8.0 +anyio==4.15.1 +certifi==2026.7.22 +click==8.5.0 +fastapi==0.141.1 +h11==0.16.0 +httpcore==1.0.9 +httpx==0.28.1 +idna==3.19 +pydantic==2.13.5 +pydantic_core==2.46.5 +starlette==1.6.0 +typing-inspection==0.4.4 +typing_extensions==4.16.0 +uvicorn==0.52.4 diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements-test.txt b/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements-test.txt new file mode 100644 index 0000000..f3d6397 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements-test.txt @@ -0,0 +1,2 @@ +-r requirements.txt +httpx==0.28.1 diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements.txt b/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements.txt new file mode 100644 index 0000000..521a267 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/requirements.txt @@ -0,0 +1,2 @@ +fastapi==0.141.1 +uvicorn==0.52.4 diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/test_api.py b/submissions/mcp-hackathon/solonsky-grid-witness/source/test_api.py new file mode 100644 index 0000000..3b28fb4 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/test_api.py @@ -0,0 +1,52 @@ +import os +import unittest +from fastapi import FastAPI +from fastapi.testclient import TestClient +from api import router +from core import inspect_plan, compare_budget + +app=FastAPI(); app.include_router(router) +client=TestClient(app) +class ApiTests(unittest.TestCase): + def test_optimistic_false_positive(self): + r=client.post('/v1/inspect-plan',json={'bits':[1,1,1,0,0,0]}) + self.assertEqual(r.status_code,200) + x=r.json(); self.assertTrue(x['A_accepted']); self.assertFalse(x['B_accepted']) + self.assertTrue(x['linear_false_positive']); self.assertGreater(x['witnesses'][0]['violation_pu'],0) + def test_budget_boundary(self): + self.assertIsNone(compare_budget(19)['cheapest_accepted_cost']) + self.assertEqual(compare_budget(20)['cheapest_accepted_cost'],20) + self.assertEqual(len(compare_budget(20)['cheapest_accepted_plans']),2) + def test_exhaustive_api_parity(self): + from itertools import product + import benchmark + for row in benchmark.run()['catalogue']: + got=inspect_plan(row['bits']) + for key in row: self.assertEqual(got[key],row[key]) + def test_strict_input(self): + bad=[None,[],[1]*7,[True]*6,[1.0]*6,['1']*6,[2]*6] + for v in bad: + self.assertEqual(client.post('/v1/inspect-plan',json={'bits':v}).status_code,400) + for v in [True,-1,28,1.5,'20',None]: + self.assertEqual(client.post('/v1/compare-budget',json={'budget':v}).status_code,400) + def test_malformed_and_extra(self): + for raw in ['{','NaN','[]','{"bits":[0,0,0,0,0,0],"secret":"never"}', 'x'*2049]: + self.assertEqual(client.post('/v1/inspect-plan',content=raw,headers={'content-type':'application/json'}).status_code,400) + self.assertEqual(client.post('/v1/inspect-plan',content='{}').status_code,400) + def test_no_global_result_mutation(self): + r=inspect_plan([1]*6);r['scenarios'].clear() + self.assertEqual(len(inspect_plan([1]*6)['scenarios']),3) + def test_health_binding(self): + prior=os.environ.get('SOURCE_COMMIT') + try: + os.environ['SOURCE_COMMIT']='a'*40 + self.assertEqual(client.get('/health').json(),{'status':'ok','commit':'a'*40}) + self.assertEqual(client.get('/.well-known/xagent-verification.json').json()['commit'],'a'*40) + os.environ['SOURCE_COMMIT']='invalid' + self.assertEqual(client.get('/health').status_code,503) + finally: + if prior is None: os.environ.pop('SOURCE_COMMIT',None) + else: os.environ['SOURCE_COMMIT']=prior + def test_unknown_route(self): + self.assertEqual(client.get('/v1/arbitrary-network').status_code,404) +if __name__=='__main__':unittest.main() diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/source/test_benchmark.py b/submissions/mcp-hackathon/solonsky-grid-witness/source/test_benchmark.py new file mode 100644 index 0000000..0661a34 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/source/test_benchmark.py @@ -0,0 +1,92 @@ +"""Independent analytical cases and exhaustive encoding checks; stdlib only.""" +import math +from itertools import product +import unittest + +import benchmark as b + + +class ProtocolChecks(unittest.TestCase): + def test_no_load_has_no_drop_or_losses(self): + z = [.01 + .006j] * 6 + loads = [0j] * 6 + v, converged, _ = b.power_flow(z, loads) + self.assertTrue(converged) + self.assertEqual(v, [1 + 0j] * 7) + checked = b.validate_ac(z, loads, v, converged) + self.assertEqual(checked['status'], 'accepted') + self.assertEqual(checked['slack_power_pu'], [0, 0]) + + def test_one_branch_matches_closed_form_high_voltage_root(self): + z, s = .01 + .006j, .08 + .04j + a = (z * s.conjugate()).real + discriminant = (1 - 2*a)**2 - 4 * abs(z)**2 * abs(s)**2 + w = (1 - 2*a + math.sqrt(discriminant)) / 2 + exact_voltage = w + z.conjugate() * s + v, converged, _ = b.power_flow([z], [s]) + self.assertTrue(converged) + self.assertLess(abs(v[1] - exact_voltage), 1e-11) + self.assertLess(abs(abs(v[1])**2 - w), 1e-11) + + def test_all_solved_cases_conserve_complex_power(self): + for bits in product((0, 1), repeat=b.N): + for scale in b.SCALES: + z, loads = b.network(bits, scale) + v, converged, _ = b.power_flow(z, loads) + self.assertTrue(converged) + currents = [(v[i] - v[i + 1]) / zi for i, zi in enumerate(z)] + losses = sum(zi * abs(i)**2 for zi, i in zip(z, currents)) + slack = v[0] * currents[0].conjugate() + self.assertLess(abs(slack - sum(loads) - losses), 1e-9) + + def test_nonconvergence_is_unresolved(self): + z, loads = b.network((0,) * 6, b.SCALES[-1]) + v, converged, _ = b.power_flow(z, loads, max_iter=1) + self.assertFalse(converged) + self.assertEqual(b.validate_ac(z, loads, v, converged)['status'], 'unresolved') + + def test_corrupted_solution_and_wrong_slack_rejected(self): + z, loads = b.network((1,) * 6, b.SCALES[0]) + v, converged, _ = b.power_flow(z, loads) + self.assertEqual(b.validate_ac(z, loads, v, converged)['status'], 'accepted') + corrupt = v.copy() + corrupt[3] += .001 + self.assertEqual(b.validate_ac(z, loads, corrupt)['status'], 'unresolved') + # No-load voltages satisfy every nodal equation but the wrong slack is invalid. + self.assertEqual(b.validate_ac(z, [0j]*6, [1.01+0j]*7)['status'], 'unresolved') + + def test_invalid_voltages_cannot_pass(self): + z, loads = b.network((0,) * 6, b.SCALES[0]) + for value in (0j, complex(float('nan'), 0), complex(float('inf'), 0)): + v = [1+0j] * 7 + v[1] = value + self.assertEqual(b.validate_ac(z, loads, v)['status'], 'unresolved') + + def test_each_investment_vector_has_correct_penalty_projection(self): + for x in product((0, 1), repeat=6): + cost = sum(c*v for c, v in zip(b.COST, x)) + weighted = sum(w*v for w, v in zip(b.WEIGHTS, x)) + energies = [] + for y in product((0, 1), repeat=3): + slack = y[0] + 2*y[1] + 4*y[2] + explicit = cost + 28*(weighted - 15 - slack)**2 + self.assertEqual(b.qubo_energy(x+y), explicit) + energies.append(explicit) + self.assertEqual(min(energies) == cost, weighted >= 15) + if weighted < 15: + self.assertGreater(min(energies), sum(b.COST)) + + def test_reference_catalogue_and_surrogate_ac_disagreement(self): + report = b.run() + self.assertEqual(report['A']['minimum_cost'], 18) + self.assertEqual(report['B']['best_accepted_cost'], 20) + self.assertEqual(report['C']['minimum_energy'], 18) + self.assertEqual(report['A']['accepted'], 14) + self.assertEqual(report['B']['accepted_plans'], 10) + self.assertEqual(len(report['linear_accepted_but_ac_rejected']), 4) + self.assertEqual(report['B']['unresolved_scenarios'], 0) + self.assertFalse(report['B']['global_ac_optimum_certified']) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/submission.json b/submissions/mcp-hackathon/solonsky-grid-witness/submission.json new file mode 100644 index 0000000..d50ca34 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/submission.json @@ -0,0 +1,10 @@ +{ + "schemaVersion": 1, + "name": "Grid Witness", + "slug": "solonsky-grid-witness", + "sourceRepository": "https://github.com/alexsolonsky/grid-witness", + "reviewCommit": "9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35", + "apiBaseUrl": "https://bestdeeplearning-grid-witness.hf.space/v1", + "healthCheckUrl": "https://bestdeeplearning-grid-witness.hf.space/health", + "deploymentProofUrl": "https://bestdeeplearning-grid-witness.hf.space/.well-known/xagent-verification.json" +} diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/verification/README.md b/submissions/mcp-hackathon/solonsky-grid-witness/verification/README.md new file mode 100644 index 0000000..14c0891 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/verification/README.md @@ -0,0 +1,47 @@ +# Verification evidence + +Review commit: `9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35` +API origin: https://bestdeeplearning-grid-witness.hf.space +Authentication: none. Inputs below are entirely synthetic. + +## Health and proof + +```sh +curl --fail --silent --show-error https://bestdeeplearning-grid-witness.hf.space/health +curl --fail --silent --show-error https://bestdeeplearning-grid-witness.hf.space/.well-known/xagent-verification.json +``` + +Health must return HTTP 200 JSON status ok and the review commit. The proof must return schemaVersion 1, slug solonsky-grid-witness and that same commit. HTML or a missing version is a failed check. + +## Capability call + +```sh +curl --fail --silent --show-error https://bestdeeplearning-grid-witness.hf.space/v1/inspect-plan -H 'Content-Type: application/json' -d '{"bits":[1,1,1,0,0,0]}' +``` + +Expect cost 18, A_accepted true, B_accepted false, linear_false_positive true and a positive voltage-violation witness at load scale 6/5. Values are per unit, costs synthetic. This is a computed operating-point violation, not proof of global AC infeasibility. + +```sh +curl --fail --silent --show-error https://bestdeeplearning-grid-witness.hf.space/v1/compare-budget -H 'Content-Type: application/json' -d '{"budget":19}' +curl --fail --silent --show-error https://bestdeeplearning-grid-witness.hf.space/v1/compare-budget -H 'Content-Type: application/json' -d '{"budget":20}' +``` + +19: no accepted operating point within budget. 20: cheapest accepted cost 20 and plans [1,1,0,1,1,0], [1,1,1,0,0,1]. Synthetic cost units are not monetary amounts. + +## Safe error + +```sh +curl --silent --show-error -i https://bestdeeplearning-grid-witness.hf.space/v1/inspect-plan -H 'Content-Type: application/json' -d '{"bits":[true,true,true,true,true,true]}' +``` + +Expect HTTP 400 and error invalid_request. Boolean is not an integer upgrade bit. + +## Reproducibility + +From source/: `python -m pip install -r requirements-test.txt && python -m unittest discover -v`. The source has sixteen tests including closed-form numerical reference, residual validation, all 64 catalogue plans, 512 encoded surrogate states, API errors and budget boundaries. requirements-test.lock records the local test environment; README pins platform Gradio SDK 6.27.0. + +The accompanying public JSON evidence records actual requests/responses and source hashes. The deployed HF snapshot is compared with GitHub at the reviewed SHA. Health self-reporting does not by itself prove provenance, completeness or correctness. The free host may cold start; no uptime SLA is claimed. + +## Recorded run + +Verified on 2026-09-12 at 02:46 UTC: seven live API checks passed. HF deployed snapshot `7fac9d7a378342a06c6a8c4ec9914f5efd6f35ea`; review commit above. All thirteen source files matched byte-for-byte across local copy, GitHub and the pinned HF snapshot. The online official validator passed all six reported gates. See live-api.json, github-source-audit.json, hf-source-audit.json, tests.txt and official-online-check.txt. These are receipt-free technical results, not judging approval. diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/verification/github-source-audit.json b/submissions/mcp-hackathon/solonsky-grid-witness/verification/github-source-audit.json new file mode 100644 index 0000000..9d058ca --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/verification/github-source-audit.json @@ -0,0 +1,70 @@ +{ + "commit": "9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35", + "files": [ + { + "file": "benchmark.py", + "sha256": "5b6d5f4f88ecd95ea42ec5b0633598f559c74adf553ec67ccff7a4dad83a66fc", + "matches_local": true + }, + { + "file": "LICENSE", + "sha256": "b3bfece0ce5e42178ca95cd4f8d38ac73c979e00c451baa6da5485c781ed7c54", + "matches_local": true + }, + { + "file": "requirements.txt", + "sha256": "2d6d8eb8662c42125d522e1e4abf5448a481cfd4d53c9751246263f4be9985a5", + "matches_local": true + }, + { + "file": "requirements-test.txt", + "sha256": "934fbb549ab3209320a68f549631f92ffa7dcd1372d15620c148eb5f55bd7735", + "matches_local": true + }, + { + "file": "core.py", + "sha256": "abe3a8c9afa2f53f7d48a2d6fe02f0e9cdadb5a2e62c62c2303c915dd474145e", + "matches_local": true + }, + { + "file": "requirements-test.lock", + "sha256": "0edfaf823fab428fd8cc512e013abdb9f4f9702f14c9ded9838588e53473540c", + "matches_local": true + }, + { + "file": "BENCHMARK.md", + "sha256": "a6491547fd5d179e9ee31f5a9e87653df3ecd32ca4fdf51e01e3fdb551a09932", + "matches_local": true + }, + { + "file": "README.md", + "sha256": "af8ac3b070fbb0fa8651147a003cca55e705af03f37ec5f2952a05b7bcf99cc9", + "matches_local": true + }, + { + "file": "api.py", + "sha256": "f05e113d5e7b9190611e7ffafeb3a0447c9be105dbf0107e5ae55c0087a882ad", + "matches_local": true + }, + { + "file": "test_benchmark.py", + "sha256": "a0564faf5606eb6c7e00c2e93a886710dd9136f44181478c8be1c7e98f432e30", + "matches_local": true + }, + { + "file": ".gitignore", + "sha256": "0a74a5198013d4d0d605b5071b54abc20797995995acca67472e655bbcd8d576", + "matches_local": true + }, + { + "file": "app.py", + "sha256": "ccb0cd97bda2d3ffca9d315c124238af059b2b54925f0edd1ed4cb0ce1af6725", + "matches_local": true + }, + { + "file": "test_api.py", + "sha256": "5c25dc69c394525b0d293fefdbe4acac5e0edafc097ae8bfacead8db8d8bb0ba", + "matches_local": true + } + ] +} diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/verification/hf-source-audit.json b/submissions/mcp-hackathon/solonsky-grid-witness/verification/hf-source-audit.json new file mode 100644 index 0000000..be9d7e9 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/verification/hf-source-audit.json @@ -0,0 +1,71 @@ +{ + "hf_commit": "7fac9d7a378342a06c6a8c4ec9914f5efd6f35ea", + "github_commit": "9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35", + "files": [ + { + "file": "benchmark.py", + "sha256": "5b6d5f4f88ecd95ea42ec5b0633598f559c74adf553ec67ccff7a4dad83a66fc", + "matches_local": true + }, + { + "file": "LICENSE", + "sha256": "b3bfece0ce5e42178ca95cd4f8d38ac73c979e00c451baa6da5485c781ed7c54", + "matches_local": true + }, + { + "file": "requirements.txt", + "sha256": "2d6d8eb8662c42125d522e1e4abf5448a481cfd4d53c9751246263f4be9985a5", + "matches_local": true + }, + { + "file": "requirements-test.txt", + "sha256": "934fbb549ab3209320a68f549631f92ffa7dcd1372d15620c148eb5f55bd7735", + "matches_local": true + }, + { + "file": "core.py", + "sha256": "abe3a8c9afa2f53f7d48a2d6fe02f0e9cdadb5a2e62c62c2303c915dd474145e", + "matches_local": true + }, + { + "file": "requirements-test.lock", + "sha256": "0edfaf823fab428fd8cc512e013abdb9f4f9702f14c9ded9838588e53473540c", + "matches_local": true + }, + { + "file": "BENCHMARK.md", + "sha256": "a6491547fd5d179e9ee31f5a9e87653df3ecd32ca4fdf51e01e3fdb551a09932", + "matches_local": true + }, + { + "file": "README.md", + "sha256": "af8ac3b070fbb0fa8651147a003cca55e705af03f37ec5f2952a05b7bcf99cc9", + "matches_local": true + }, + { + "file": "api.py", + "sha256": "f05e113d5e7b9190611e7ffafeb3a0447c9be105dbf0107e5ae55c0087a882ad", + "matches_local": true + }, + { + "file": "test_benchmark.py", + "sha256": "a0564faf5606eb6c7e00c2e93a886710dd9136f44181478c8be1c7e98f432e30", + "matches_local": true + }, + { + "file": ".gitignore", + "sha256": "0a74a5198013d4d0d605b5071b54abc20797995995acca67472e655bbcd8d576", + "matches_local": true + }, + { + "file": "app.py", + "sha256": "ccb0cd97bda2d3ffca9d315c124238af059b2b54925f0edd1ed4cb0ce1af6725", + "matches_local": true + }, + { + "file": "test_api.py", + "sha256": "5c25dc69c394525b0d293fefdbe4acac5e0edafc097ae8bfacead8db8d8bb0ba", + "matches_local": true + } + ] +} diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/verification/live-api.json b/submissions/mcp-hackathon/solonsky-grid-witness/verification/live-api.json new file mode 100644 index 0000000..cd2fca5 --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/verification/live-api.json @@ -0,0 +1,395 @@ +{ + "checked_at": "2026-09-12T02:46:25.014721+00:00", + "review_commit": "9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35", + "hf_commit": "7fac9d7a378342a06c6a8c4ec9914f5efd6f35ea", + "calls": [ + { + "url": "https://bestdeeplearning-grid-witness.hf.space/health", + "status": 200, + "content_type": "application/json", + "body": { + "status": "ok", + "commit": "9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35" + } + }, + { + "url": "https://bestdeeplearning-grid-witness.hf.space/.well-known/xagent-verification.json", + "status": 200, + "content_type": "application/json", + "body": { + "schemaVersion": 1, + "slug": "solonsky-grid-witness", + "commit": "9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35" + } + }, + { + "url": "https://bestdeeplearning-grid-witness.hf.space/v1/inspect-plan", + "status": 200, + "content_type": "application/json", + "body": { + "bits": [ + 1, + 1, + 1, + 0, + 0, + 0 + ], + "cost": 18, + "A_accepted": true, + "B_accepted": false, + "B_unresolved": false, + "scenarios": [ + { + "scale": "3/5", + "A": { + "accepted": true, + "minimum_v_squared_exact": "61447/62500", + "minimum_v_squared": 0.983152, + "maximum_current_proxy_squared": 0.10368 + }, + "B": { + "status": "accepted", + "min_voltage_pu": 0.9915170169220751, + "max_voltage_pu": 1.0, + "max_current_pu": 0.32377504403434093, + "max_power_residual_pu": 1.5267755731507756e-14, + "max_current_residual_pu": 1.5319476493813164e-14, + "slack_voltage_residual_pu": 0.0, + "slack_power_pu": [ + 0.2895319011733442, + 0.1449191407040087 + ], + "max_voltage_violation_pu": 0, + "max_thermal_violation_pu": 0 + }, + "iterations": 6 + }, + { + "scale": "1", + "A": { + "accepted": true, + "minimum_v_squared_exact": "12149/12500", + "minimum_v_squared": 0.97192, + "maximum_current_proxy_squared": 0.288 + }, + "B": { + "status": "accepted", + "min_voltage_pu": 0.9857945689280877, + "max_voltage_pu": 1.0, + "max_current_pu": 0.5416484131544493, + "max_power_residual_pu": 5.641849884401372e-15, + "max_current_residual_pu": 5.7144308540806496e-15, + "slack_voltage_residual_pu": 0.0, + "slack_power_pu": [ + 0.484293218213111, + 0.24257593092786658 + ], + "max_voltage_violation_pu": 0, + "max_thermal_violation_pu": 0 + }, + "iterations": 7 + }, + { + "scale": "6/5", + "A": { + "accepted": true, + "minimum_v_squared_exact": "30197/31250", + "minimum_v_squared": 0.966304, + "maximum_current_proxy_squared": 0.41472 + }, + "B": { + "status": "returned_operating_point_violates_limits", + "min_voltage_pu": 0.982912613830394, + "max_voltage_pu": 1.0, + "max_current_pu": 0.6512085669619282, + "max_power_residual_pu": 1.61617921804418e-14, + "max_current_residual_pu": 1.6227235033496425e-14, + "slack_voltage_residual_pu": 0.0, + "slack_power_pu": [ + 0.5822100359913654, + 0.29172602159481936 + ], + "max_voltage_violation_pu": 9.501584498150528e-05, + "max_thermal_violation_pu": 0 + }, + "iterations": 7 + } + ], + "decision": "returned_operating_point_violates_limits", + "linear_false_positive": true, + "scope": "Fixed synthetic six-line single-phase example; not a real-grid design or global AC feasibility certificate.", + "cost_units": "arbitrary synthetic units", + "quantum_computation_performed": false, + "witnesses": [ + { + "scale": "6/5", + "min_voltage_pu": 0.982912613830394, + "voltage_limit_pu": 0.9830076296753755, + "violation_pu": 9.501584498150528e-05, + "status": "returned_operating_point_violates_limits" + } + ] + }, + "request": { + "bits": [ + 1, + 1, + 1, + 0, + 0, + 0 + ] + } + }, + { + "url": "https://bestdeeplearning-grid-witness.hf.space/v1/compare-budget", + "status": 200, + "content_type": "application/json", + "body": { + "budget": 19, + "cost_units": "arbitrary synthetic units", + "enumerated_plans": 64, + "plans_within_budget": 53, + "ac_accepted_within_budget": 0, + "cheapest_accepted_cost": null, + "cheapest_accepted_plans": [], + "linear_false_positives": [ + { + "bits": [ + 1, + 0, + 1, + 1, + 1, + 0 + ], + "cost": 19 + }, + { + "bits": [ + 1, + 1, + 0, + 1, + 0, + 1 + ], + "cost": 19 + }, + { + "bits": [ + 1, + 1, + 1, + 0, + 0, + 0 + ], + "cost": 18 + } + ], + "verdict": "no_accepted_operating_point_found_within_budget", + "global_ac_optimum_certified": false, + "scope": "Fixed synthetic six-line single-phase example; not a real-grid design or global AC feasibility certificate." + }, + "request": { + "budget": 19 + } + }, + { + "url": "https://bestdeeplearning-grid-witness.hf.space/v1/compare-budget", + "status": 200, + "content_type": "application/json", + "body": { + "budget": 20, + "cost_units": "arbitrary synthetic units", + "enumerated_plans": 64, + "plans_within_budget": 56, + "ac_accepted_within_budget": 2, + "cheapest_accepted_cost": 20, + "cheapest_accepted_plans": [ + [ + 1, + 1, + 0, + 1, + 1, + 0 + ], + [ + 1, + 1, + 1, + 0, + 0, + 1 + ] + ], + "linear_false_positives": [ + { + "bits": [ + 0, + 1, + 1, + 1, + 1, + 1 + ], + "cost": 20 + }, + { + "bits": [ + 1, + 0, + 1, + 1, + 1, + 0 + ], + "cost": 19 + }, + { + "bits": [ + 1, + 1, + 0, + 1, + 0, + 1 + ], + "cost": 19 + }, + { + "bits": [ + 1, + 1, + 1, + 0, + 0, + 0 + ], + "cost": 18 + } + ], + "verdict": "accepted_operating_points_found", + "global_ac_optimum_certified": false, + "scope": "Fixed synthetic six-line single-phase example; not a real-grid design or global AC feasibility certificate." + }, + "request": { + "budget": 20 + } + }, + { + "url": "https://bestdeeplearning-grid-witness.hf.space/v1/inspect-plan", + "status": 400, + "content_type": "application/json", + "body": { + "error": "invalid_request", + "message": "Use application/json with exactly {\"bits\":[0,0,0,0,0,0]}; six integer binary values; max 2048 bytes." + }, + "request": { + "bits": [ + true, + true, + true, + true, + true, + true + ] + } + }, + { + "url": "https://bestdeeplearning-grid-witness.hf.space/v1/benchmark", + "status": 200, + "content_type": "application/json", + "body": { + "scope": "Fixed synthetic six-line single-phase example; not a real-grid design or global AC feasibility certificate.", + "plans": 64, + "scenarios_per_plan": 3, + "linear_accepted": 14, + "ac_accepted": 10, + "linear_min_cost": 18, + "ac_best_accepted_cost": 20, + "linear_false_positives": [ + [ + 0, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 0, + 1, + 1, + 1, + 0 + ], + [ + 1, + 1, + 0, + 1, + 0, + 1 + ], + [ + 1, + 1, + 1, + 0, + 0, + 0 + ] + ], + "specification": { + "topology": "chain 0-1-2-3-4-5-6; bus 0 slack at 1+0j", + "units": "per unit; arbitrary synthetic capital cost units", + "base_line_impedance_pu": [ + 0.01, + 0.006 + ], + "upgraded_line_impedance_pu": [ + 0.005, + 0.003 + ], + "ampacity_pu": 1, + "base_bus_PQ_pu": [ + 0.08, + 0.04 + ], + "scenario_scales": [ + "3/5", + "1", + "6/5" + ], + "voltage_min_squared_exact": "30197/31250", + "voltage_max_squared_exact": "441/400", + "costs": [ + 7, + 6, + 5, + 4, + 3, + 2 + ], + "pf_voltage_tolerance_pu": 1e-12, + "residual_absolute_tolerance_pu": 1e-09, + "floating_limit_tolerance_pu": 1e-10, + "initialization": "flat 1+0j; no fallback", + "max_pf_iterations": 500 + }, + "limitations": [ + "Synthetic single-phase equivalent with scaled positive PQ demand only.", + "No renewable scenarios, held-out evaluation, contingencies, topology changes or flexible controls.", + "No independent external power-flow package or certified AC uniqueness/global solver.", + "No QAOA, quantum hardware, speedup, heuristic comparison or industrial-scale evidence." + ], + "quantum_computation_performed": false + } + } + ] +} diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/verification/official-online-check.txt b/submissions/mcp-hackathon/solonsky-grid-witness/verification/official-online-check.txt new file mode 100644 index 0000000..c7d059e --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/verification/official-online-check.txt @@ -0,0 +1,26 @@ + +> @xagt/agent-plugin@0.5.0 validate:submission +> node scripts/validate-submission.mjs --dir submissions/mcp-hackathon/solonsky-grid-witness --online + +{ + "status": "pass", + "slug": "solonsky-grid-witness", + "checks": [ + "submission structure and manifest are valid", + "13 source files are present; all submission files passed the baseline secret scan (not a completeness or security certification)", + "verification evidence contains a health check and repeatable curl command", + "the declared source version has been verified", + "the live health check is reachable and bound to the review commit", + "the standard deployment proof confirms control of the live service" + ], + "manifest": { + "schemaVersion": 1, + "name": "Grid Witness", + "slug": "solonsky-grid-witness", + "sourceRepository": "https://github.com/alexsolonsky/grid-witness", + "reviewCommit": "9102fa95b06ec90b43d7c8dc397e2a03fbd0bf35", + "apiBaseUrl": "https://bestdeeplearning-grid-witness.hf.space/v1", + "healthCheckUrl": "https://bestdeeplearning-grid-witness.hf.space/health", + "deploymentProofUrl": "https://bestdeeplearning-grid-witness.hf.space/.well-known/xagent-verification.json" + } +} diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/verification/tests.txt b/submissions/mcp-hackathon/solonsky-grid-witness/verification/tests.txt new file mode 100644 index 0000000..07e589a --- /dev/null +++ b/submissions/mcp-hackathon/solonsky-grid-witness/verification/tests.txt @@ -0,0 +1,23 @@ +/Users/rich/Documents/Codex/2026-09-10/contest-agent/outputs/night-2026-09-12/product/batch2/grid-witness-test-env/lib/python3.14/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead. + from starlette.testclient import TestClient as TestClient # noqa +test_budget_boundary (test_api.ApiTests.test_budget_boundary) ... ok +test_exhaustive_api_parity (test_api.ApiTests.test_exhaustive_api_parity) ... ok +test_health_binding (test_api.ApiTests.test_health_binding) ... ok +test_malformed_and_extra (test_api.ApiTests.test_malformed_and_extra) ... ok +test_no_global_result_mutation (test_api.ApiTests.test_no_global_result_mutation) ... ok +test_optimistic_false_positive (test_api.ApiTests.test_optimistic_false_positive) ... ok +test_strict_input (test_api.ApiTests.test_strict_input) ... ok +test_unknown_route (test_api.ApiTests.test_unknown_route) ... ok +test_all_solved_cases_conserve_complex_power (test_benchmark.ProtocolChecks.test_all_solved_cases_conserve_complex_power) ... ok +test_corrupted_solution_and_wrong_slack_rejected (test_benchmark.ProtocolChecks.test_corrupted_solution_and_wrong_slack_rejected) ... ok +test_each_investment_vector_has_correct_penalty_projection (test_benchmark.ProtocolChecks.test_each_investment_vector_has_correct_penalty_projection) ... ok +test_invalid_voltages_cannot_pass (test_benchmark.ProtocolChecks.test_invalid_voltages_cannot_pass) ... ok +test_no_load_has_no_drop_or_losses (test_benchmark.ProtocolChecks.test_no_load_has_no_drop_or_losses) ... ok +test_nonconvergence_is_unresolved (test_benchmark.ProtocolChecks.test_nonconvergence_is_unresolved) ... ok +test_one_branch_matches_closed_form_high_voltage_root (test_benchmark.ProtocolChecks.test_one_branch_matches_closed_form_high_voltage_root) ... ok +test_reference_catalogue_and_surrogate_ac_disagreement (test_benchmark.ProtocolChecks.test_reference_catalogue_and_surrogate_ac_disagreement) ... ok + +---------------------------------------------------------------------- +Ran 16 tests in 0.078s + +OK From 69492bdcc135d18e2deccf57d5bbe14b3c117acc Mon Sep 17 00:00:00 2001 From: Aleksei Solonskii Date: Sat, 12 Sep 2026 08:50:57 +0200 Subject: [PATCH 2/2] docs: confirm X-Agent community registration for Grid Witness --- submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md b/submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md index d7118ca..6e62e1c 100644 --- a/submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md +++ b/submissions/mcp-hackathon/solonsky-grid-witness/SUBMISSION.md @@ -47,4 +47,4 @@ See verification/README.md for exact commands, recorded responses and expected e - **Builder:** Alex SOLONSKY / Aleksei Solonskii. - **Contact:** https://github.com/alexsolonsky/grid-witness/issues - **License:** MIT; dependencies retain their licenses. See RIGHTS.md. -- **Registration:** Luma registration confirmed on 2026-09-12. Telegram community join requires the submitter's interactive login and is pending; not represented as completed. +- **Registration:** Luma registration confirmed on 2026-09-12. The submitter confirmed joining the official X-Agent Telegram community on 2026-09-12.