diff --git a/.github/workflows/bar.yml b/.github/workflows/bar.yml new file mode 100644 index 0000000..cafeba7 --- /dev/null +++ b/.github/workflows/bar.yml @@ -0,0 +1,23 @@ +name: verified bar + +# Runs the Proven Commons bar check on the Lean project in formal/. +# The workflow and the checker are both pinned to one commit of +# Proven-Commons/mission. + +on: + push: + pull_request: + # Rerun when a spec reviewer approves, or an approval is dismissed. + pull_request_review: + types: [submitted, dismissed] + +jobs: + bar: + # pull-requests: read lets the check confirm a spec approval on GitHub. + permissions: + contents: read + pull-requests: read + uses: Proven-Commons/mission/.github/workflows/verified-bar.yml@7b22e542f0db0f3013ab1439cf5d1947676a5083 + with: + project-dir: formal + bar-ref: 7b22e542f0db0f3013ab1439cf5d1947676a5083 diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..50b34ec --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,28 @@ +name: verify + +# Reruns the verifier and fails if the committed certificate differs. +# A green run shows that the certificate follows from the pinned inputs. +# It does not show that the upstream models describe a real building. + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-24.04 + timeout-minutes: 20 + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + - run: pip install sympy==1.14.0 + - run: python3 verify.py + - name: The generated documents are up to date + run: | + python3 tools/render_map.py + git diff --exit-code -- docs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a60b85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__/ +*.pyc diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1d118f2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,60 @@ +# Changelog + +Machine-checked milestones for `aska-physical/optifab`. + +## [0.2.0] - 2026-11-17 + +Status: claimed. Prepared by an AI agent; not reviewed by a person. Nothing is called verified. + +### Added + +- **`formal/`**: a Lean 4 project with no dependencies, in the Proven Commons layout. An exact integer gate, + the generation step and the loop over any list of proposals, with eight theorems. `lake comparator + --paranoid` accepts them under six kernels. 300,000 differential tests against the Python oracle agree. The + Proven Commons bar check reports items 2 to 6 PASS and item 1 OPEN (`formal/BAR-REPORT.md`). +- **`loop.py`**: the improvement loop. Three hardware genes, two software genes and the proposer's own step + scale, changed one gated step at a time. On the scenario in the file: 50 proposals, 45 admitted (30 + hardware, 15 software), objective 0.914228 to 0.919009. +- **`results/ledger.json`** and **`results/formal.json`**: the hash-chained record of every decision, and the + record of the last formal run. `verify.py --formal` rebuilds the proofs and replays the ledger in Lean + (50 decisions, 0 mismatches). The plain verifier fails if that record does not match the current Lean + sources and ledger. +- **`docs/VISION.md`**: how close this is to a formally verified system that improves its own hardware and + software, part by part. **`docs/PROPOSALS.md`**: eight systems for the open gaps. +- **Licences**: PolyForm Noncommercial 1.0.0 for code, CC BY-NC 4.0 for text and data. +- **Two workflows**: the Proven Commons bar check on `formal/`, and a rerun of `verify.py`. +- Five must-fail controls (24 in all). The unit now has 30 elements and 10 loop interfaces, 4 of them checked. + +## [0.1.0] - 2026-11-17 + +First version. Status: claimed. Prepared by an AI agent; not reviewed by a person. + +### Added + +- **`verify.py` and `results/certificate.json`.** One command recomputes every figure from pinned inputs and + runs 19 must-fail controls. Five identities are checked symbolically with SymPy. +- **`docs/STRUCTURE.md` and `data/unit.json`**: one structure. Every repository on the map is placed in the + physical unit or listed as having no place: 32 placed, 9 not. The loop between structure and intelligence has + 9 interfaces, of which 3 are checked. The idea comes from the Terrafab documents named in issue 1. +- **Plant frame**: the contract's state in the 64-byte layout of Weft's telemetry frame, with a contract check + that reads one frame. +- **Loop timing**: the two latencies quoted in the Terrafab documents, tried on the four plant vibration tones + in funi-frame's isolation model. +- **Plant envelope**, from the funi-frame certificate and the literals in its verifier: + - extra IT load at a fixed utility supply: 2.854 to 2.959 MW, against 3.06 MW of freed utility power; + - recooling limit of the sorption stage: 41.5 °C at 18 °C chilled water, 40.1 °C at 15 °C; + - load floor for self-cooling: 0.564 MW with the certified wall, 0.850 MW with a steel-pinned wall; + - thermal budget: 2,500 kWh_th, with the load to shed for outages of 10 to 60 minutes. +- **Margin vector** of 12 limit states from funi-frame, funi-floors and venturi-collars (11 certified upstream, + 1 derived here), and the plant radius 0.1989 set by the floor punching collar. +- **`plant_gate`**, a re-implementation of the Weft I3 predicate. It passes Weft's 15 weight-update vectors, + agrees with Weft's own function on 100,000 generated cases, and is run on five plant cases. +- **Interface checks** on six values repeated by hand across repositories. +- **`data/graph.json`**: 41 repositories and 43 cited links across aska-physical, Foundation-0, + Moissanite-Labs and Proven-Commons, with lineage checked to be acyclic and within Weft's depth bound of 12. + The first links in repository contents between aska-physical and Moissanite-Labs. +- **`data/pins.json` and `data/sources.json`**: 48 pins and the commits of 36 repositories with the hashes of + every cited file. + `verify.py --upstream ROOT` re-reads every cited line. +- **`docs/MODEL.md`**, **`docs/CONVERGENCE.md`** (generated), **`HANDOFF.md`**, **`NOTICE`**, and the tools + `fetch_upstream.py` and `render_map.py`. diff --git a/HANDOFF.md b/HANDOFF.md new file mode 100644 index 0000000..e9bc635 --- /dev/null +++ b/HANDOFF.md @@ -0,0 +1,227 @@ +# Handoff: aska-physical/optifab v0.2.0 + +Written under the group ethos: leave everything the next agent needs so nothing has to be derived twice. + +optifab v0.1.0 and v0.2.0 were prepared by an AI agent on 2026-11-17. They are claimed work. No person has +reviewed them. + +## 1. What was learned and checked + +The aim, stated by the owner and in [issue 1](https://github.com/aska-physical/optifab/issues/1), is one +physical structure that holds all four organisations' work, with digital and physical infrastructure as a +single unit. [docs/STRUCTURE.md](docs/STRUCTURE.md) is the design of that unit as far as it can be checked today. + +The fifteen findings are in [README.md](README.md) and derived in [docs/MODEL.md](docs/MODEL.md). In one line each: + +1. The 3.06 MW of utility power that funi-frame's plant frees carries 2.85 to 2.96 MW of IT load, depending on + how much of the overhead grows with load. +2. The sorption stage needs a heat sink below 41.5 °C at best to reach its claimed COP. The plant model has no + recooling temperature. +3. The campus stops cooling itself below about 0.56 MW of IT load. A worse wall raises that floor. +4. The PCM skid is a budget of 2,500 kWh_th that outages and bursts draw on. +5. The tightest certified margin in the building is the floor punching collar, at 80.1%. +6. Weft's gate predicate, rewritten here, passes Weft's 15 weight-update vectors, agrees with Weft's own + function on 100,000 generated cases, and can take the plant's budget and margin radius as its inputs. +7. Six hand-copied values across three repositories agree and are now under test. +8. The four organisations' relevant work is one cited graph of 41 repositories and 43 links. +9. The physical stack is at "claimed" on the Ledger scale, with one preprint. +10. The contract's whole state fits the 64-byte frame Weft uses for telemetry. +11. The Terrafab latency figures hold in direction for the plant's vibration tones, and the campus as designed + does not need a fast loop. +12. 32 of 41 repositories have a place in the structure. Of the 10 interfaces that would close the loop between + structure and intelligence, 4 are checked, and the loop is open in three places. +13. An exact integer gate and the loop built on it are proved in Lean (eight theorems, six kernels, standard + axioms). The Proven Commons bar check passes items 2 to 6. Item 1, a reviewer's approval, is open. +14. A loop changed three hardware and two software parameters together under that gate: 45 of 50 proposals + admitted, the objective up from 0.914228 to 0.919009, every decision replayed in Lean. +15. A design that sits exactly on a limit cannot change under this gate, and a proposer with no reserve slows + itself. + +[docs/VISION.md](docs/VISION.md) sets these against the vision, part by part. + +## 2. Negative findings. Do not re-derive. + +1. **There is no energy data on the digital side.** A search of Weft's runtime, documents and papers, and of + weft-loom's experiments and notes, finds no figure in watts, joules or kWh and no PUE. Weft's only + temperature is a formula of CPU load (`weft/runtime/telemetry/host_metrics.py:45`). weft-loom lists "energy + per adapter write" as a measurement still to make. exo-os quotes small-device power figures from outside + sources under the line "Do not trust any mW number without a test." So tokens per joule, or energy per model + update, cannot be computed from anything the four organisations hold today. It has to be measured. +2. **One lattice link is closed, and the others are only proposals.** incentre-lattices, fibral-rigidity and + siliquant all work with lattices, which suggests a shared result. siliquant checked whether the certificate + coefficients of incentre-lattices bear on weight rounding and recorded "Real, unrelated" + (`siliquant/notes/brief-check.md:39`). The graph keeps that link with type `checked_unrelated`. The same + note lists its other links to the lattice tracks as proposals that were not evaluated. Do not present any of + them as a result without a construction. +3. **Two upstreams of venturi-collars hold no results.** Foundation-0/ductricity is a project definition and + Foundation-0/thermal-capture is a research direction. Both say so. venturi-collars inherits a question from + them, not evidence. The graph marks these links `direction`. +4. **The liquid capture fraction has no optimum to find.** In funi-frame's model more capture is always better: + the drive heat needed falls and the surplus rises. There is nothing to optimise there. +5. **The second-law bound cannot confirm the COP, only limit it.** It says where 0.62 is impossible. Whether a + real machine reaches 0.62 at a 58 °C drive needs a manufacturer's curve. +6. **The Ledger scale does not fit runtime code.** Weft, abios, synbios and the like are tested software, not + research claims. They are left unrated here. +7. **Lineage by repository over-reaches.** Weft builds on Foundation-0/project-asma in its identifiability gate, + a different module from the one optifab uses. For that reason the evidence table covers only the physical + layers, L0 to L3. +8. **Only the gate predicate carries over from Weft.** Weft's default radius of 120, its tension bound and its + royalty split have no meaning for a plant. The 12 vectors that test them are out of scope. + +9. **The Terrafab documents are not evidence, and Weft has already audited them.** Do not audit them again. + Weft's digest (`weft/docs/corpus/sources/B-top1.md`) records that the latency figures are asserted (line + 220), that the benchmark is rigged (line 142), that the Lean proofs they cite do not exist, and that the + gate header neither keeps its own invariant nor bounds a physical quantity (line 227). Weft repaired that + header into the gate it ships (`invariants.py:11`). optifab uses the idea of one structure and the repaired + gate, and nothing else from those documents. +10. **This campus has no job for a sub-millisecond loop.** Passive isolation holds rack vibration at 17.9% of the + limit and every term of the contract moves over seconds to minutes. A fast loop matters only for active + vibration control or a fabrication machine, and neither exists. +11. **No fabrication machine exists anywhere.** The "hands" of the Terrafab loop are an idea. The nearest real + inputs are process limits already in the certificates, such as the Fe-SMA activation energy in funi-floors + (0.3227 against a cap of 0.5 kWh/m²). + +12. **The loop's proposer is not an intelligence, and its gains are not predictions.** It is a seeded search on + a three-parameter thermal model, scored on a scenario chosen here. What carries over is the mechanism and + the behaviours in finding 15, not the 0.5%. +13. **Do not name the gate function `admit` in Lean.** `admit` is Lean's keyword for an unfinished proof, and + the Proven Commons checker rightly flags every use. The function is `gate`. +14. **The comparator needs bubblewrap, and the bar check needs every definition a statement uses to be listed** + in `bar.toml`, constructors and projections included (`Verdict.ok`, `Outcome.verdict`, `Outcome.remaining`). + +## 3. Notes for upstream maintainers + +These concern other repositories. Nothing was changed there except the profile fix in item 4. + +These three funi-frame notes are implemented in aska-physical/funi-frame#4 (draft). When it merges, +optifab's verifier fails on purpose (must-fail control 1 and the recooling-field check), because findings 1 and +2 will then be out of date: refresh the vendored certificate, run `--repin`, and restate them. + +1. **funi-frame, compute revenue.** `results/certificate.json` reports `freed_substation_power_MW` of 3.06 and + `unlocked_annual_revenue_low_M_usd` of 76.62, the product of that power and $25M per MW-year + (`verify.py:162-163`). The power is utility power. The IT load it supports is 2.854 MW if every overhead + grows with load and 2.959 MW if only the aquifer loop does, which is how the verifier models it. The low-end + revenue on that is $71.35M to $73.97M. Suggested change: report the extra IT power, say which kind of MW the + dollar value refers to, and compute the revenue from the matching figure. +2. **funi-frame, recooling temperature.** The sorption COP of 0.62 is a literal (`verify.py:144`) with no + temperature attached. Suggested change: carry the drive, recooling and chilled-water temperatures in the + certificate, make the COP depend on them, and add a must-fail control for dry recooling on a hot day. +3. **funi-frame, controls that compare constants.** Must-fail control 10 (`verify.py:181`) compares 0.068 with + 0.050 and 0.014 with 0.020, and both left-hand values are constants written 25 lines above it + (`verify.py:156`). It cannot fail. Parts of three others are the same: control 5 tests the literal 0.72 + (`:99`, `:176`), control 11 tests the literal 0.0 and a ratio of two literals (`:152`, `:182`), and control + 12 tests the literal 0.0 for water use (`:161`, `:183`). The claims may well be right. The verifier does not + test them. +4. **aska-physical profile.** The fibral-rigidity row says pull request 1 awaits human sign-off. That pull + request is merged (`0652052`, 2026-11-16). The cfrp-truss row is missing a column separator, which breaks the + table. Both are fixed in the profile change that indexes optifab. That change adds a row, so the profile + lines pinned here move down by one when it merges: run `--repin` afterwards. +5. **fibral-rigidity certificate.** Its `repository` field reads `Foundation-0/fibral-rigidity`. The repository + is at aska-physical/fibral-rigidity. +6. **Weft.** Its telemetry has no physical input, and its telemetry line carries an unkeyed hash that its + roadmap describes as "integrity against accidents, not authentication". A plant that takes commands from a + scheduler needs signed messages. Moissanite-Labs/synmerit already defines signed records. +7. **Weft, one edge case in the gate.** With a locked mask, a locked value beyond the float32 range makes + `verify_weight_update_safety_ex` raise `OverflowError` instead of returning a rejection + (`invariants.py:52-54`, reached from the locked-mask check at `:69-71`). The differential test here found it. `plant_gate` copies the behaviour + so that the two agree. +8. **venturi-collars.** Its certificate names a 0.150 mW sensor node. At low airflow (1.8 m/s) the collar + harvests 0.104 mW, so that node would need 144% of the harvest. Only the 0.080 mW node is powered there. + +## 4. Artifacts + +- [verify.py](verify.py): the derivations, both gates, the plant frame, the loop, the graph and unit checks, 24 + must-fail controls. `--formal` rebuilds the proofs and replays the ledger in Lean. +- [loop.py](loop.py): the improvement loop. [formal/](formal/README.md): the Lean project. +- [results/ledger.json](results/ledger.json) and [results/formal.json](results/formal.json): every decision of + the loop, and the record of the last formal run. +- [results/certificate.json](results/certificate.json): the outputs `verify.py` must reproduce. +- [data/](data/): vendored inputs with hashes, 48 pins, the graph, the unit, and the commit of each of 36 + repositories. +- [docs/VISION.md](docs/VISION.md), [docs/PROPOSALS.md](docs/PROPOSALS.md), [docs/STRUCTURE.md](docs/STRUCTURE.md), + [docs/MODEL.md](docs/MODEL.md) and [docs/CONVERGENCE.md](docs/CONVERGENCE.md). The tables in STRUCTURE.md and + all of CONVERGENCE.md are generated. +- [tools/fetch_upstream.py](tools/fetch_upstream.py) and [tools/render_map.py](tools/render_map.py). + +To move an element of the unit forward, change its status in `data/unit.json`. `verify.py` refuses to report the +loop closed unless every interface is marked checked, and it fails if a repository on the map is neither placed +nor listed as not placed. + +To change a pin: edit `data/pins.json` or `data/graph.json`, then run +`python3 verify.py --upstream ROOT --repin`, `python3 verify.py --write` and `python3 tools/render_map.py`. +`--repin` finds each cited text again and records the new commit, file hash and line. It fails if the text is +gone, which is the signal that an upstream claim changed. + +## 5. Next-agent build queue + +The larger pieces are written up as eight proposals in [docs/PROPOSALS.md](docs/PROPOSALS.md), each with an +issue on GitHub. The list below is the working queue, and its first four items are proposals 1, 2 and 7. +Items 1 to 4 close the open places in the loop ([docs/STRUCTURE.md](docs/STRUCTURE.md), interfaces L1, L2, L5 +and L8). + +To change the formal project: edit `formal/`, then run `python3 verify.py --formal --write`. Any change to a +Lean source, the oracle or the ledger makes must-fail control 24 fail until the formal run is repeated. + +1. **Agree the plant frame with Weft (interface L2, element W1).** The 16 slots are defined and tested here. + Weft's owners decide whether the frame shares their telemetry bus or travels as an abios line. Done when one + fixture file is parsed by both sides. This gives Weft a real temperature in place of its estimate. +2. **Design the two missing sensors (interface L1, elements N3 and N4).** Rack vibration and recooling + temperature each have a certified limit and nothing that measures them. +3. **A way to shed load, with an energy reading (interface L5).** Neither Weft nor Exo can defer or shed compute + on request, and neither measures energy. Until one does, the scheduler side of the contract has nothing to + act on. +4. **A first fabrication element (interface L8, element F1).** Pick one aska-physical process that already has + certified limits, state its gate inputs, and run the gate on them. Fe-SMA activation in funi-floors is the + obvious candidate. +5. **Apply notes 1 and 2 of section 3 in funi-frame.** Done when its certificate carries the extra IT power + and a recooling temperature, and optifab's pins are refreshed. +6. **A year at part load (optifab, with funi-frame issue 2).** Run an hourly utilisation trace against the load + floor and the thermal budget. Report hours below the floor and the budget drawn. Share the trace with + funi-frame's aquifer balance, which injects 84.3 GWh_th a year in one direction. +7. **Carry the proof over to Weft's floating-point gate (Weft, Proven-Commons; element R2).** The exact gate is + proved in `formal/`. What remains is Weft's open Milestone I.3: a statement relating its float gate to the + exact one, and a reviewer for the specification (proposal 5). The Proven-Commons reviewer list is empty + today, so no project can yet pass bar item 1. +8. **A second verifier that shares no code (optifab).** The Foundation-0 physics rule asks for two. A different + agent, or a different language, should recompute sections 1 to 5 of the model note from the same pins. +9. **A network of campuses (optifab).** v0.1.0 models one. With N campuses, each with a load floor, a thermal + budget and a margin radius, placing work becomes an optimisation: most compute per unit of utility energy, + subject to every gate. State that problem and solve a small case exactly. +10. **Replicate the top of the stack (Foundation-0, aska-physical).** incentre-lattices' results sit under 6 + repositories of the stack and nhanes-bioimpedance under 5. An independent replication there lifts the most + work. See the evidence table in [docs/CONVERGENCE.md](docs/CONVERGENCE.md). +11. **Choose a telemetry transport with a parser near the bar (Proven-Commons, element W3).** MQTT, CBOR, NTP and + protobuf are all candidates in progress and none is verified. If item 1 picks a transport, prefer one whose + parser is closest to the verified bar. + +## 6. Decisions for a person + +- **Licence.** Added at the owner's request: PolyForm Noncommercial 1.0.0 for code and CC BY-NC 4.0 for text + and data, so noncommercial use is open and commercial use is reserved. The owner should confirm the + copyright line in NOTICE ("Aska Physical and the optifab contributors"). The sibling aska-physical + repositories still have no licence. Weft's files are redistributed under Apache-2.0. +- **Whether funi-frame should adopt notes 1 to 3.** They change published figures. +- **Whether the plant gate is a direction worth pursuing.** Its arithmetic is now proved, and it has been run + on a model. It has never seen a sensor or a machine. +- **Who reviews `formal/SPEC.md`.** Until a person who did not write it approves it, nothing here may be + called verified. +- **Sign-off.** Nothing here counts until a named person reviews it. + +## 7. How this session worked + +- Read: every repository listed in [docs/CONVERGENCE.md](docs/CONVERGENCE.md), at the commits listed there, plus + the twelve under "Surveyed and not connected". The three Terrafab documents named in issue 1 were read in + full, with Weft's digest of them. Two read-only survey agents located data files and status + lines; every value used here was then re-read directly and is pinned. +- Ran: funi-frame's `verify.py`, which reproduces its certificate (12/12 controls). optifab's own verifier, + offline and against the clones. +- Ran: Weft's `invariants.py`, as the oracle of the differential test. Lean 4.35.0, `lake comparator --paranoid` + and the Proven Commons bar checker (`bar/check.py` at mission `7b22e54`) on `formal/`. +- Did not run: the verifiers of the other aska-physical repositories. Their certificates were read as data. +- Reviewed: a second AI agent, given the code and not the conclusions, re-derived the results and tested the + gate against Weft's. It found that the gate disagreed with Weft's at floating-point boundaries, that the + compute figure should be a range, that the recooling limit was stated too tightly, that one margin was not + certified upstream, that the lineage depth rule was off by one, and that several controls could not fail. + All of these are fixed in this version. No person has reviewed it. +- Did not read: Moissanite-Labs/exo and the four Proven-Commons protocol repositories. They appear in the graph + as "named only". Private repositories were not touched. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5ecc88c --- /dev/null +++ b/LICENSE @@ -0,0 +1,73 @@ +# PolyForm Noncommercial License 1.0.0 + + + +## Acceptance + +In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses. + +## Copyright License + +The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license). + +## Distribution License + +The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license). + +## Notices + +You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example: + +> Required Notice: Copyright Yoyodyne, Inc. (http://example.com) + +## Changes and New Works License + +The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose. + +## Patent License + +The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software. + +## Noncommercial Purposes + +Any noncommercial purpose is a permitted purpose. + +## Personal Uses + +Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose. + +## Noncommercial Organizations + +Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding. + +## Fair Use + +You may have "fair use" rights for the software under the law. These terms do not limit them. + +## No Other Rights + +These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses. + +## Patent Defense + +If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company. + +## Violations + +The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately. + +## No Liability + +***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.*** + +## Definitions + +The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms. + +**You** refers to the individual or entity agreeing to these terms. + +**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect. + +**Your licenses** are all the licenses granted to you for the software under these terms. + +**Use** means anything you do with the software requiring one of your licenses. diff --git a/LICENSE-docs b/LICENSE-docs new file mode 100644 index 0000000..fe463e0 --- /dev/null +++ b/LICENSE-docs @@ -0,0 +1,408 @@ +Attribution-NonCommercial 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-NonCommercial 4.0 International Public +License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-NonCommercial 4.0 International Public License ("Public +License"). To the extent this Public License may be interpreted as a +contract, You are granted the Licensed Rights in consideration of Your +acceptance of these terms and conditions, and the Licensor grants You +such rights in consideration of benefits the Licensor receives from +making the Licensed Material available under these terms and +conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. NonCommercial means not primarily intended for or directed towards + commercial advantage or monetary compensation. For purposes of + this Public License, the exchange of the Licensed Material for + other material subject to Copyright and Similar Rights by digital + file-sharing or similar means is NonCommercial provided there is + no payment of monetary compensation in connection with the + exchange. + + j. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + k. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + l. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part, for NonCommercial purposes only; and + + b. produce, reproduce, and Share Adapted Material for + NonCommercial purposes only. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties, including when + the Licensed Material is used other than for NonCommercial + purposes. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database for NonCommercial purposes + only; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..730a06e --- /dev/null +++ b/NOTICE @@ -0,0 +1,48 @@ +optifab +Copyright 2026 Aska Physical and the optifab contributors. +https://github.com/aska-physical/optifab + +This repository is licensed by content type. Noncommercial use is permitted under both licences. +Commercial use needs the written permission of the copyright holder. + + * Source code (verify.py, loop.py, tools/, formal/, the workflow files) is licensed under the PolyForm + Noncommercial License 1.0.0 (LICENSE). + Required Notice: Copyright 2026 Aska Physical and the optifab contributors + (https://github.com/aska-physical/optifab) + + * Text and data (README.md, HANDOFF.md, CHANGELOG.md, docs/, results/, and the files under data/ + other than data/upstream/) are licensed under the Creative Commons Attribution-NonCommercial 4.0 + International License (LICENSE-docs). + Attribution: "optifab, Aska Physical, https://github.com/aska-physical/optifab". + +The files below belong to others and keep their own terms. + +This repository redistributes two third-party files, unmodified: + + data/upstream/Moissanite-Labs/weft/vectors.json + data/upstream/Moissanite-Labs/weft/invariants.py + from Moissanite-Labs/weft, weft/runtime/invariants/, + commit df4f9fa45640d7ee840f4529025a9a556d98684c. + Copyright 2026 Moissanite Labs and the Weft contributors. + Licensed under the Apache License, Version 2.0: + https://www.apache.org/licenses/LICENSE-2.0 + "ML Weft", "Weft" and "Moissanite Labs" are names of Moissanite Labs. They are used here only to + say where the file comes from. + +The function plant_gate in verify.py implements the predicate of Weft interface I3. It was written from +Weft's interface note, its conformance vectors and its reference implementation, and its arithmetic +follows the reference so that the two agree exactly. No Weft code is imported or copied into it. The +vendored invariants.py is run only as the oracle of a differential test. + +The other files under data/upstream/ are certificates from aska-physical repositories +(funi-frame, funi-floors, venturi-collars), copied unmodified. data/upstream/MANIFEST.json records the +source commit and SHA-256 of each file. + +Short quotations from other repositories appear in data/pins.json, data/graph.json and the documents as +the text of citations. Each names its repository, commit, file and line. + +Passages quoted from the Weft corpus (Moissanite-Labs/weft-corpus, commit +5cf1e447102bba55d7d1d8010ea2bdda1f2eddf1) are used under the Creative Commons Attribution 4.0 +International License. Attribution: "Weft corpus, Moissanite Labs, +https://github.com/Moissanite-Labs/weft-corpus". The corpus is source material: it narrates actions that +did not happen, and nothing quoted from it is used here as evidence. diff --git a/README.md b/README.md index 723a25a..f14f89c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,148 @@ # optifab -modelling the ideal datacenter + +Modelling the ideal datacenter. + +**Status: v0.2.0, claimed.** An AI agent wrote this version and no person has reviewed it. Nothing in it is +measured. Every number is derived from the certificates of other repositories, which are themselves models. + +optifab is the design of one physical structure that holds the work of four organisations, so that the digital +and the physical infrastructure are a single unit. It treats a data-centre campus as one checked stack, from the +mathematics under its structure to the rule that governs the software running in it. The idea of one structure +comes from the Terrafab documents named in [issue 1](https://github.com/aska-physical/optifab/issues/1); +[docs/STRUCTURE.md](docs/STRUCTURE.md) gives every repository its place in the structure and shows which parts +of the loop are checked. [docs/VISION.md](docs/VISION.md) says how close this is to a formally verified system +that improves its own hardware and software, part by part. The work it joins: + +- **aska-physical** designed the building, its thermal plant and its sensors + ([funi-frame](https://github.com/aska-physical/funi-frame), + [funi-floors](https://github.com/aska-physical/funi-floors), + [venturi-collars](https://github.com/aska-physical/venturi-collars), + [impedence-analyzers](https://github.com/aska-physical/impedence-analyzers)). +- **Foundation-0** holds the mathematics and physics those designs build on, and the scale that says how far a + claim has been checked. +- **Moissanite-Labs** wrote the gate that decides whether an adaptive model may change itself + ([weft](https://github.com/Moissanite-Labs/weft)). +- **Proven-Commons** sets the bar for calling software verified. + +The reference campus is funi-frame's: 10 MW of IT load on a 2,500 m² plan, two storeys. + +## What v0.1.0 finds + +Each line is derived in [docs/MODEL.md](docs/MODEL.md) and recomputed by `verify.py`. Labels follow the +Foundation-0 standard: PROVEN (written proof, checked symbolically), VERIFIED (finite check). + +| # | Finding | Label | +|---|---|---| +| 1 | **Less compute is unlocked than the plant certificate implies.** funi-frame multiplies 3.06 MW of freed utility power by a value per MW of compute. The IT load that power can carry is 2.85 to 2.96 MW, depending on how much of the overhead grows with load. If the value is per MW of IT load, its revenue figures are 3.6% to 7.4% high. | PROVEN, VERIFIED | +| 2 | **The plant model leaves out a temperature that decides whether it works.** A sorption chiller with the claimed COP of 0.62, driven at 58 °C and making water at 15 to 18 °C, must reject heat below 41.5 °C at best (40.1 °C if the water is 15 °C). No recooling temperature appears in the certificate. | PROVEN, VERIFIED | +| 3 | **The workload has a load floor.** Below about 0.56 MW of IT load (5.6% of nameplate) the captured heat can no longer drive the chiller, and the campus stops cooling itself. With the steel-pinned wall that funi-frame rejects, the floor is 51% higher. | PROVEN under two stated assumptions | +| 4 | **Thermal storage is a budget.** The PCM skid holds 2,500 kWh_th: 15 minutes at full load, 30 minutes if half the load is shed, or a 10% burst for 2.5 hours. | VERIFIED | +| 5 | **The tightest margin in the building is in the floor.** Of 11 certified limit states, the floor punching collar sits at 80.1% of capacity. A twelfth margin derived here, sensor power at low airflow, is at 77.0%. A change that moves the margin vector by no more than 0.1989 stays inside every limit. | PROVEN, VERIFIED | +| 6 | **One gate can guard weights and plant.** Weft's gate predicate, rewritten here, passes all 15 of Weft's weight-update vectors and agrees with Weft's own function on 100,000 generated cases. Until now its budget had no physical unit. Here the budget is finding 4 and the radius is finding 5. | VERIFIED. Its use on a plant is a proposal. | +| 7 | **Hand-copied numbers are now checked.** Six values are repeated by hand across funi-frame, funi-floors and venturi-collars. All six agree today, and a change upstream now fails a test. | VERIFIED | +| 8 | **The organisations' work is mapped, link by link.** 41 repositories and 43 links, each cited to a line at a pinned commit. Before this version the only thing joining aska-physical and Moissanite-Labs was issue 1 of this repository. | VERIFIED against pinned clones | +| 9 | **The physical stack is unreviewed.** Of its 13 repositories, 10 are claimed, 1 is a preprint and 2 claim no result. None is peer reviewed, replicated, deployed or formally verified. | VERIFIED. Levels for aska-physical repositories were assigned here. | +| 10 | **The contract fits in one 64-byte frame.** The 12 margins, the budget, the load, the recooling temperature and the time fill the 16 floats of the frame Weft already uses for telemetry. The design point as certified cannot fill the recooling slot. | VERIFIED. The slot meanings are a proposal. | +| 11 | **The Terrafab latency figures hold in direction, and this campus does not need them.** A 15 ms loop can counter none of the four plant vibration tones within its cycle; a 0.5 ms loop can counter all four. Passive isolation already holds rack vibration at 17.9% of its limit, and every term of the contract moves over seconds to minutes. | PROVEN (identity), VERIFIED | +| 12 | **Every repository has a place, and the loop is open.** 32 of 41 repositories are placed in the structure and 9 are listed as having no place. Of the 10 interfaces that would close the loop between structure and intelligence, 4 are checked. | VERIFIED (the accounting). Statuses were assigned here. | +| 13 | **The gate and the loop built on it are proved in Lean.** Eight theorems about an exact integer gate, accepted by `lake comparator --paranoid` under six kernels. Whatever is proposed, no margin passes its limit and the budget is never overdrawn; the number of changes is at most the budget a person set. The Proven Commons bar check passes items 2 to 6. It is not verified: no reviewer has approved the specification. | Machine-checked proof. Bar item 1 open. | +| 14 | **Hardware and software improve together under that gate.** A loop proposed 50 changes to three hardware and two software parameters. 45 were admitted (30 hardware, 15 software) and 5 refused. The objective rose from 0.914228 to 0.919009 and never fell, and every decision was replayed in Lean with no mismatch. It runs on a model: no sensor, load or machine is involved. | VERIFIED on a model. The scenario is a choice, so the figures are illustrations. | +| 15 | **A design that sits exactly on a limit cannot change.** Started with one margin at its limit, the loop admitted nothing. A proposer with no reserve had 126 of 186 proposals refused and finished lower. Headroom is what makes change possible. | VERIFIED on a model | + +Findings 1 and 2 concern funi-frame and are written up for its maintainers in [HANDOFF.md](HANDOFF.md). + +## The contract between plant and workload + +The findings add up to an interface. A scheduler that places work on this campus should respect four things, +and can rely on four in return. + +| The workload must | The plant offers, per its certificates | +|---|---| +| keep IT load above the load floor, or ask for the air-side load to move to the aquifer loop | PUE 1.074 and no water use, if recooling stays below about 41 °C | +| charge every cooling outage and every burst above cooling capacity to the thermal budget | 15 minutes of ride-through at full load | +| keep the margin vector within 0.1989 of the certified design point | rack vibration at 17.9% of the switch limit | +| plan capacity in IT power, not in utility power | 2.85 to 2.96 MW more IT load than a conventional plant on the same supply | + +The left column is what `plant_gate` checks. All of the right column is claimed, not measured. + +## Check it + +Needs Python 3.10 or newer and SymPy. Tested with Python 3.13 and SymPy 1.14 only. + +```bash +pip install sympy +python3 verify.py +``` + +This recomputes every figure from the pinned inputs, runs the improvement loop, runs 24 must-fail controls, and +compares the result with [results/certificate.json](results/certificate.json) and +[results/ledger.json](results/ledger.json). It reads no network and needs no Lean. It checks that the committed +formal record matches the current Lean sources and ledger. + +To rebuild the proofs and replay the ledger in Lean (needs Linux, [elan](https://github.com/leanprover/elan) +and bubblewrap): + +```bash +python3 verify.py --formal +# [FORMAL] comparator accepts 8 theorems under 6 kernels; 300000 differential tests, 0 failures; +# ledger replay 50 decisions, 0 mismatches +``` + +To re-read every cited line from the source repositories: + +```bash +python3 tools/fetch_upstream.py ../upstream # clones 36 public repositories at their pinned commits +python3 verify.py --upstream ../upstream +``` + +## What a pass does not show + +- That the building would behave as modelled. No input is a measurement. +- That the upstream certificates are right. funi-frame's verifier was re-run here and reproduces its + certificate. The verifiers of funi-floors and venturi-collars were not re-run. Weft's gate module is run, as + the oracle of the differential test. +- Anything about more than one campus. A network of campuses is the next step, not this one. +- That the gate is safe to put in control of a plant. Its arithmetic is proved. The margins it is fed are not, + and it can only refuse a step. Nothing here commands anything. +- That the loop's gains are real. Its plant model, objective and scenario are unproved choices. +- Anything the Terrafab documents claim. They are the source of the idea and are not used as evidence. + +## Layout + +``` +verify.py the verifier: derivations, the gates, the frame, the loop, graph and unit checks, 24 must-fail controls +loop.py the improvement loop: genome, plant model, proposer, ledger +formal/ the exact gate and the loop, proved in Lean, in the Proven Commons layout +results/certificate.json what verify.py must reproduce +results/ledger.json every decision of the loop, hash-chained +results/formal.json the record of the last formal run: comparator, differential tests, Lean replay +data/upstream/ byte-exact copies of three certificates, Weft's vectors and Weft's gate (the test oracle) +data/pins.json every literal and line read from another repository +data/graph.json the cross-organisation map: repositories, links, citations +data/unit.json the structure: each element, where it sits, whose work it rests on, and its status +data/sources.json pinned commit and file hashes for each repository +docs/VISION.md how close this is to the vision, part by part +docs/PROPOSALS.md eight systems proposed for the open gaps +docs/STRUCTURE.md one structure: the unit, the loop, the plant frame, and the Terrafab claims one by one +docs/MODEL.md each result, its derivation and its assumptions +docs/CONVERGENCE.md the map as tables, generated from data/graph.json +tools/ fetch_upstream.py and render_map.py +HANDOFF.md what was learned, what failed, and what to do next +``` + +## Licence + +Noncommercial use is allowed. Commercial use needs the owner's written permission. + +- Code: [PolyForm Noncommercial License 1.0.0](LICENSE). +- Text and data: [Creative Commons Attribution-NonCommercial 4.0 International](LICENSE-docs). +- Files from other projects keep their own licences. [NOTICE](NOTICE) lists them. + +## Credit and disclosure + +- The certificates, designs and theorems used here belong to the repositories named above and their authors. + [docs/CONVERGENCE.md](docs/CONVERGENCE.md) lists each one with its commit. +- Weft's conformance vectors and gate module are copied under the Apache License 2.0, and short passages of the Weft corpus are + quoted under CC BY 4.0. See [NOTICE](NOTICE). +- This version was prepared by an AI agent (Claude, Anthropic) working for the owner of aska-physical. Under the + Foundation-0 rule that a person signs, nothing here counts until a named person has reviewed it. diff --git a/data/graph.json b/data/graph.json new file mode 100644 index 0000000..f3da082 --- /dev/null +++ b/data/graph.json @@ -0,0 +1,1168 @@ +{ + "schema": "optifab-graph/1", + "layers": { + "L0": "Mathematics and physics results", + "L1": "Materials and structure", + "L2": "Shell and thermal plant", + "L3": "Sensing", + "L4": "Compute and adaptive models", + "L5": "Messages and protocols", + "L6": "Provenance, rules and hubs" + }, + "edge_types": { + "builds_on": "The downstream work uses results, certificates or code of the upstream work, and the use was traced. Lineage.", + "stated": "The downstream repository says it builds on the upstream one. No specific value was traced here. Lineage.", + "direction": "The downstream work follows a question or direction of the upstream work, which has no results. Lineage.", + "consumes": "The downstream work reads a specific value or file of the upstream work. Lineage.", + "governs": "The upstream work sets rules or a scale that the downstream work follows. Not lineage.", + "mentions": "One names the other in text. No data flows. Not lineage.", + "indexes": "A hub lists the repository. Not lineage.", + "checked_unrelated": "One specific proposed link that was checked and found not to hold. Kept so it is not proposed again." + }, + "lineage_types": [ + "builds_on", + "stated", + "direction", + "consumes" + ], + "physical_layers": [ + "L0", + "L1", + "L2", + "L3" + ], + "nodes": [ + { + "id": "aska-physical/optifab", + "layer": "L2", + "kind": "model", + "role": "This repository. One reference campus as a checked stack, with a contract between the plant and the workload.", + "status": "v0.1.0, claimed. Written by an AI agent. No person has reviewed it.", + "evidence": "claimed", + "evidence_by": "optifab" + }, + { + "id": "aska-physical/funi-frame", + "layer": "L2", + "kind": "product", + "role": "Data-centre shell and thermal plant for a 10 MW reference campus: roof, walls, vibration isolation, seismic frame, heat storage, sorption cooling.", + "status": "v0.1.0. verify.py reproduces the certificate, 12/12 must-fail controls. No review or built plant is recorded.", + "evidence": "claimed", + "evidence_by": "optifab", + "status_cite": { + "repo": "aska-physical/funi-frame", + "path": "README.md", + "find": "Verifies four SymPy symbolic theorems and **12/12 must-fail controls**", + "line": 33 + } + }, + { + "id": "aska-physical/funi-floors", + "layer": "L1", + "kind": "product", + "role": "Funicular floor cassette for 313 psf rack loads, with an impedance leak sensor in the ribs.", + "status": "v0.1.0. Certificate with 10 must-fail controls. No review is recorded.", + "evidence": "claimed", + "evidence_by": "optifab", + "status_cite": { + "repo": "aska-physical/funi-floors", + "path": "README.md", + "find": "**10/10 must-fail controls**", + "line": 34 + } + }, + { + "id": "aska-physical/cfrp-truss", + "layer": "L1", + "kind": "product", + "role": "Truss-anchored CFRP strengthening of concrete beams.", + "status": "v0.3.0. Certificate with 12 must-fail controls.", + "evidence": "claimed", + "evidence_by": "optifab", + "status_cite": { + "repo": "aska-physical/cfrp-truss", + "path": "README.md", + "find": "*12 must-fail controls*", + "line": 37 + } + }, + { + "id": "aska-physical/cfrp-masts", + "layer": "L1", + "kind": "product", + "role": "Deployable CFRP booms and masts.", + "status": "Certificate version 1.0.0 with 5 must-fail controls. The organisation profile lists it as v0.1.0.", + "evidence": "claimed", + "evidence_by": "optifab", + "status_cite": { + "repo": "aska-physical/cfrp-masts", + "path": "results/certificate.json", + "find": "\"certificate_version\": \"1.0.0\"", + "line": 2 + } + }, + { + "id": "aska-physical/fibral-rigidity", + "layer": "L1", + "kind": "theory", + "role": "Stiffness limits of carbon-fibre truss lattices built on the incentre framework.", + "status": "Claims labelled PROVEN and VERIFIED in the repository. Pull request 1 is merged; the org profile still lists it as awaiting sign-off.", + "evidence": "claimed", + "evidence_by": "optifab", + "status_cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`fibral-rigidity`](https://github.com/aska-physical/fibral-rigidity)**", + "line": 17 + } + }, + { + "id": "aska-physical/cfrp-strengthening", + "layer": "L1", + "kind": "baseline", + "role": "Re-runnable ACI 440.2R beam strengthening example, the baseline cfrp-truss improves on. It was Foundation-0/cfrp-strengthening, and that address now leads here.", + "status": "v1.0.0. Agent review recorded. No outside human engineering review.", + "evidence": "claimed", + "evidence_by": "optifab", + "status_cite": { + "repo": "aska-physical/cfrp-strengthening", + "path": "docs/review-ledger.md", + "find": "No outside human engineering review of the Track 1 numbers has happened", + "line": 12 + } + }, + { + "id": "aska-physical/venturi-collars", + "layer": "L3", + "kind": "product", + "role": "Battery-free airflow harvester that powers a duct sensor node.", + "status": "v0.1.0. Certificate with 5 must-fail controls. No device built.", + "evidence": "claimed", + "evidence_by": "optifab", + "status_cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`venturi-collars`](https://github.com/aska-physical/venturi-collars)**", + "line": 15 + } + }, + { + "id": "aska-physical/impedence-analyzers", + "layer": "L3", + "kind": "product", + "role": "Seven-frequency impedance analyser for structural and leak sensing.", + "status": "v0.1.0. Certificate with 5 must-fail controls.", + "evidence": "claimed", + "evidence_by": "optifab", + "status_cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`impedence-analyzers`](https://github.com/aska-physical/impedence-analyzers)**", + "line": 16 + } + }, + { + "id": "aska-physical/graph-fab", + "layer": "L1", + "kind": "idea", + "role": "Research into graphene materials.", + "status": "README only.", + "evidence": null, + "status_cite": { + "repo": "aska-physical/graph-fab", + "path": "README.md", + "find": "Research into graphene materials", + "line": 2 + } + }, + { + "id": "aska-physical/dock", + "layer": "L6", + "kind": "hub", + "role": "The organisation's public hub page. It lists the org's repositories live from the GitHub API.", + "status": "Published site.", + "evidence": null, + "status_cite": { + "repo": "aska-physical/dock", + "path": "index.html", + "find": "api.github.com/orgs/aska-physical/repos", + "line": 789 + } + }, + { + "id": "aska-physical/.github", + "layer": "L6", + "kind": "governance", + "role": "The group ethos and the organisation profile that indexes every repository.", + "status": "Standing directive, recorded 2026-11-10.", + "evidence": null, + "status_cite": { + "repo": "aska-physical/.github", + "path": "ETHOS.md", + "find": "Recorded 2026-11-10", + "line": 3 + } + }, + { + "id": "Foundation-0/f0", + "layer": "L6", + "kind": "hub", + "role": "The Ledger of AI-assisted advances, the charter, and the rules for agents. Source of the evidence scale used here.", + "status": "Active. 343 Ledger entries.", + "evidence": null, + "status_cite": { + "repo": "Foundation-0/f0", + "path": "README.md", + "find": "Every advance in science, maths and technology that AI caused or contributed to", + "line": 27 + } + }, + { + "id": "Foundation-0/.github", + "layer": "L6", + "kind": "governance", + "role": "Repository standard and label standard: PROVEN, VERIFIED, KNOWN, CONJECTURE.", + "status": "Standard in force for Foundation-0 repositories.", + "evidence": null, + "status_cite": { + "repo": "Foundation-0/.github", + "path": "REPO-STANDARD.md", + "find": "Claim labels: **PROVEN** (written proof)", + "line": 64 + } + }, + { + "id": "Foundation-0/math0", + "layer": "L0", + "kind": "hub", + "role": "Mathematics hub. Holds the integer-multiplication studies and the code-table census.", + "status": "Active hub.", + "evidence": null, + "status_cite": { + "repo": "Foundation-0/math0", + "path": "README.md", + "find": "The hub for Foundation0's mathematics work", + "line": 3 + } + }, + { + "id": "Foundation-0/physics0", + "layer": "L0", + "kind": "hub", + "role": "Physics hub. Lists open areas, including statistical physics on the incentre lattice and archived seismic networks.", + "status": "Active hub.", + "evidence": null, + "status_cite": { + "repo": "Foundation-0/physics0", + "path": "AREAS.md", + "find": "Statistical physics on the incentre lattice", + "line": 74 + } + }, + { + "id": "Foundation-0/incentre-lattices", + "layer": "L0", + "kind": "research", + "role": "The incentre construction: rigidity, elastic constants, packing and folding results, with a locked verifier.", + "status": "Preprint, version 3, not peer reviewed.", + "evidence": "preprint", + "evidence_by": "source", + "status_cite": { + "repo": "Foundation-0/incentre-lattices", + "path": "README.md", + "find": "Preprint, version 3 (not peer reviewed;", + "line": 48 + } + }, + { + "id": "Foundation-0/point-charges", + "layer": "L0", + "kind": "research", + "role": "Certified counts of equilibria of point charges (Maxwell's problem).", + "status": "Claimed. Reviewed by an independent AI agent; not yet reviewed by a person.", + "evidence": "claimed", + "evidence_by": "source", + "status_cite": { + "repo": "Foundation-0/point-charges", + "path": "NOTE.md", + "find": "not yet reviewed by a person.", + "line": 4 + } + }, + { + "id": "Foundation-0/rigid-realizations", + "layer": "L0", + "kind": "research", + "role": "Real realisation counts of minimally rigid frameworks.", + "status": "Its headline counts are claimed, pending independent verification.", + "evidence": "claimed", + "evidence_by": "source", + "status_cite": { + "repo": "Foundation-0/rigid-realizations", + "path": "README.md", + "find": "claimed (pending independent verification)", + "line": 20 + } + }, + { + "id": "Foundation-0/nhanes-bioimpedance", + "layer": "L0", + "kind": "research", + "role": "Refit of 13,276 public bioimpedance spectra; the source of the analyser's failure modes.", + "status": "Pilot, claimed, not peer reviewed.", + "evidence": "claimed", + "evidence_by": "source", + "status_cite": { + "repo": "Foundation-0/nhanes-bioimpedance", + "path": "README.md", + "find": "**Status: pilot, claimed, not peer reviewed.**", + "line": 18 + } + }, + { + "id": "Foundation-0/ductricity", + "layer": "L0", + "kind": "direction", + "role": "Project definition for harvesting energy at a duct wall.", + "status": "Project definition only. No performance figure is claimed.", + "evidence": null, + "status_cite": { + "repo": "Foundation-0/ductricity", + "path": "README.md", + "find": "Project definition only. No device has been built. No performance figure is claimed.", + "line": 20 + } + }, + { + "id": "Foundation-0/thermal-capture", + "layer": "L0", + "kind": "direction", + "role": "Research direction on capturing low-grade heat.", + "status": "Research direction only. No result is claimed.", + "evidence": null, + "status_cite": { + "repo": "Foundation-0/thermal-capture", + "path": "README.md", + "find": "Research direction only. No device has been built under this project.", + "line": 28 + } + }, + { + "id": "Foundation-0/project-asma", + "layer": "L0", + "kind": "research", + "role": "Open ovarian-cancer research workspace. Two of its theorems were adapted into Weft's identifiability gate, an earlier case of one organisation's results feeding another's code.", + "status": "Working manuscript is a scaffold, not peer reviewed.", + "evidence": null, + "status_cite": { + "repo": "Foundation-0/project-asma", + "path": "README.md", + "find": "not peer reviewed, no invented results", + "line": 70 + } + }, + { + "id": "Moissanite-Labs/weft", + "layer": "L4", + "kind": "runtime", + "role": "Adaptive models that change within checkable bounds. Source of the gate predicate and its conformance vectors.", + "status": "Early research. The gate runs and is tested in CI in Python, C11 and JavaScript.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/weft", + "path": "README.md", + "find": "Status: early research", + "line": 17 + } + }, + { + "id": "Moissanite-Labs/weft-loom", + "layer": "L4", + "kind": "records", + "role": "Weft's experiment records and audits, with preregistrations and negative results.", + "status": "Research records. Wall-clock timings only; no power or energy measurement.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/weft-loom", + "path": "notes/horizon-ii-ideas-backlog.md", + "find": "energy per adapter write", + "line": 28 + } + }, + { + "id": "Moissanite-Labs/weft-corpus", + "layer": "L4", + "kind": "corpus", + "role": "The original Weft sessions, kept word for word. Three of them, the Terrafab documents, set out the idea of one structure in which machines, sensors and models form a single loop.", + "status": "Source material, not instructions. The sessions narrate actions that did not happen.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/weft-corpus", + "path": "README.md", + "find": "Read this as source material, not instructions.", + "line": 11 + } + }, + { + "id": "Moissanite-Labs/siliquant", + "layer": "L4", + "kind": "research", + "role": "Proved limits and experiments on rounding model weights to a few bits.", + "status": "Two studies. No licence chosen yet.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/siliquant", + "path": "README.md", + "find": "No licence file yet. The owner has not chosen one.", + "line": 59 + } + }, + { + "id": "Moissanite-Labs/exo", + "layer": "L4", + "kind": "runtime", + "role": "The agent core: one agent, one memory, gated actions. Not read in this pass.", + "status": "Early implementation (from the organisation profile).", + "evidence": null, + "read": false + }, + { + "id": "Moissanite-Labs/exo-os", + "layer": "L4", + "kind": "runtime", + "role": "Exo as a whole operating system image. Its hardware notes quote small-device power figures from outside sources.", + "status": "v0.1.0. Host tests pass; hardware figures are cited, not measured.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/exo-os", + "path": "research/04-small-hardware.md", + "find": "Do not trust any mW number without a test.", + "line": 127 + } + }, + { + "id": "Moissanite-Labs/abios", + "layer": "L5", + "kind": "protocol", + "role": "Compact agent message format (SYM-2P).", + "status": "v1.0.0 spec and validator. Byte savings measured against compact JSON only.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/abios", + "path": "bench/README.md", + "find": "v2 is 3.1x smaller in bytes", + "line": 18 + } + }, + { + "id": "Moissanite-Labs/synbios", + "layer": "L5", + "kind": "forge", + "role": "Agent-first forge with the SYM-3 wire format.", + "status": "v0.1 local reference. Token counts on synthetic transcripts.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/synbios", + "path": "README.md", + "find": "**Status: working local reference implementation, version 0.1.**", + "line": 5 + } + }, + { + "id": "Moissanite-Labs/synmerit", + "layer": "L6", + "kind": "protocol", + "role": "Signed records of contribution, consent and delegated authority.", + "status": "v0.1.0 experimental reference.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/synmerit", + "path": "package.json", + "find": "\"version\": \"0.1.0\"", + "line": 3 + } + }, + { + "id": "Moissanite-Labs/ethos", + "layer": "L6", + "kind": "protocol", + "role": "Portable user preferences across agent harnesses.", + "status": "v0.1.0 spec, schema and fixtures.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/ethos", + "path": "pyproject.toml", + "find": "version = \"0.1.0\"", + "line": 7 + } + }, + { + "id": "Moissanite-Labs/exofab", + "layer": "L6", + "kind": "hub", + "role": "Human-first hub for forming projects and ventures.", + "status": "Design and proposals. Nothing runnable.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/exofab", + "path": "README.md", + "find": "This repository currently contains project orientation and proposals, not a runnable product.", + "line": 5 + } + }, + { + "id": "Moissanite-Labs/siliconcordat", + "layer": "L6", + "kind": "governance", + "role": "The lab's working manifesto and its dated ecosystem map.", + "status": "Working proposal, not adopted policy.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/siliconcordat", + "path": "README.md", + "find": "**Working proposal.**", + "line": 3 + } + }, + { + "id": "Moissanite-Labs/.github", + "layer": "L6", + "kind": "governance", + "role": "Organisation profile and site. Names Foundation-0, Proven Commons and ASKA Digital as connected efforts.", + "status": "Published.", + "evidence": null, + "status_cite": { + "repo": "Moissanite-Labs/.github", + "path": "profile/README.md", + "find": "The wider practice connects applied work at", + "line": 30 + } + }, + { + "id": "Proven-Commons/mission", + "layer": "L6", + "kind": "programme", + "role": "The verified bar and the candidate list for Lean rewrites of widely used libraries.", + "status": "Bar version 2. No project is verified yet; the reviewer list is empty.", + "evidence": null, + "status_cite": { + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "so none is verified", + "line": 44 + } + }, + { + "id": "Proven-Commons/mqtt", + "layer": "L5", + "kind": "target", + "role": "MQTT 5.0 packet framing, a common sensor telemetry transport.", + "status": "Open pull request; nothing verified.", + "evidence": null, + "read": false, + "status_cite": { + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "| MQTT 5.0 packet framing |", + "line": 78 + } + }, + { + "id": "Proven-Commons/cbor", + "layer": "L5", + "kind": "target", + "role": "CBOR codec, a compact binary encoding for sensor records.", + "status": "Draft pull request; nothing verified.", + "evidence": null, + "read": false, + "status_cite": { + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "| CBOR codec (RFC 8949) |", + "line": 74 + } + }, + { + "id": "Proven-Commons/ntp", + "layer": "L5", + "kind": "target", + "role": "NTP wire packet, time synchronisation for telemetry.", + "status": "Open pull request; nothing verified.", + "evidence": null, + "read": false, + "status_cite": { + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "| NTP wire packet |", + "line": 82 + } + }, + { + "id": "Proven-Commons/protobuf", + "layer": "L5", + "kind": "target", + "role": "Protobuf wire format codec.", + "status": "First slice merged; nothing verified.", + "evidence": null, + "read": false, + "status_cite": { + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "| Protobuf wire format codec |", + "line": 52 + } + } + ], + "edges": [ + { + "src": "Foundation-0/incentre-lattices", + "dst": "aska-physical/fibral-rigidity", + "type": "builds_on", + "cite": { + "repo": "aska-physical/fibral-rigidity", + "path": "README.md", + "find": "extending the unit-spring rigidity theory of [Foundation-0/incentre-lattices]", + "line": 5 + } + }, + { + "src": "aska-physical/cfrp-strengthening", + "dst": "aska-physical/cfrp-truss", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`cfrp-truss`](https://github.com/aska-physical/cfrp-truss)**", + "line": 13 + } + }, + { + "src": "aska-physical/fibral-rigidity", + "dst": "aska-physical/cfrp-truss", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`cfrp-truss`](https://github.com/aska-physical/cfrp-truss)**", + "line": 13 + } + }, + { + "src": "Foundation-0/nhanes-bioimpedance", + "dst": "aska-physical/cfrp-truss", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`cfrp-truss`](https://github.com/aska-physical/cfrp-truss)**", + "line": 13 + } + }, + { + "src": "Foundation-0/incentre-lattices", + "dst": "aska-physical/cfrp-masts", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`cfrp-masts`](https://github.com/aska-physical/cfrp-masts)**", + "line": 14 + } + }, + { + "src": "aska-physical/fibral-rigidity", + "dst": "aska-physical/cfrp-masts", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`cfrp-masts`](https://github.com/aska-physical/cfrp-masts)**", + "line": 14 + } + }, + { + "src": "Foundation-0/rigid-realizations", + "dst": "aska-physical/cfrp-masts", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`cfrp-masts`](https://github.com/aska-physical/cfrp-masts)**", + "line": 14 + } + }, + { + "src": "Foundation-0/ductricity", + "dst": "aska-physical/venturi-collars", + "type": "direction", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`venturi-collars`](https://github.com/aska-physical/venturi-collars)**", + "line": 15 + }, + "note": "The upstream is a project definition with no results, so nothing is inherited but the question." + }, + { + "src": "Foundation-0/thermal-capture", + "dst": "aska-physical/venturi-collars", + "type": "direction", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`venturi-collars`](https://github.com/aska-physical/venturi-collars)**", + "line": 15 + }, + "note": "The upstream is a research direction with no results." + }, + { + "src": "Foundation-0/nhanes-bioimpedance", + "dst": "aska-physical/impedence-analyzers", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`impedence-analyzers`](https://github.com/aska-physical/impedence-analyzers)**", + "line": 16 + } + }, + { + "src": "Foundation-0/point-charges", + "dst": "aska-physical/impedence-analyzers", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`impedence-analyzers`](https://github.com/aska-physical/impedence-analyzers)**", + "line": 16 + } + }, + { + "src": "Foundation-0/incentre-lattices", + "dst": "aska-physical/impedence-analyzers", + "type": "builds_on", + "cite": { + "repo": "aska-physical/impedence-analyzers", + "path": "README.md", + "find": "is the exact incentre constant of", + "line": 23 + } + }, + { + "src": "aska-physical/fibral-rigidity", + "dst": "aska-physical/funi-floors", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`funi-floors`](/aska-physical/funi-floors)**", + "line": 12 + } + }, + { + "src": "aska-physical/cfrp-truss", + "dst": "aska-physical/funi-floors", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`funi-floors`](/aska-physical/funi-floors)**", + "line": 12 + } + }, + { + "src": "aska-physical/venturi-collars", + "dst": "aska-physical/funi-floors", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`funi-floors`](/aska-physical/funi-floors)**", + "line": 12 + } + }, + { + "src": "aska-physical/impedence-analyzers", + "dst": "aska-physical/funi-floors", + "type": "stated", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "| **[`funi-floors`](/aska-physical/funi-floors)**", + "line": 12 + } + }, + { + "src": "aska-physical/funi-floors", + "dst": "aska-physical/funi-frame", + "type": "builds_on", + "cite": { + "repo": "aska-physical/funi-frame", + "path": "README.md", + "find": "`funi-frame` unifies the", + "line": 5 + } + }, + { + "src": "aska-physical/cfrp-truss", + "dst": "aska-physical/funi-frame", + "type": "stated", + "cite": { + "repo": "aska-physical/funi-frame", + "path": "README.md", + "find": "`funi-frame` unifies the", + "line": 5 + } + }, + { + "src": "aska-physical/fibral-rigidity", + "dst": "aska-physical/funi-frame", + "type": "stated", + "cite": { + "repo": "aska-physical/funi-frame", + "path": "README.md", + "find": "`funi-frame` unifies the", + "line": 5 + } + }, + { + "src": "aska-physical/venturi-collars", + "dst": "aska-physical/funi-frame", + "type": "stated", + "cite": { + "repo": "aska-physical/funi-frame", + "path": "README.md", + "find": "`funi-frame` unifies the", + "line": 5 + } + }, + { + "src": "aska-physical/impedence-analyzers", + "dst": "aska-physical/funi-frame", + "type": "stated", + "cite": { + "repo": "aska-physical/funi-frame", + "path": "README.md", + "find": "`funi-frame` unifies the", + "line": 5 + } + }, + { + "src": "aska-physical/funi-floors", + "dst": "aska-physical/funi-frame", + "type": "consumes", + "cite": { + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "m_a = (2500.0 * (195.12 + roof_m) + p_m * h_a * wall_m) / 1000.0", + "line": 125 + }, + "note": "A value copied by hand into the downstream verifier. optifab now checks it against the upstream certificate." + }, + { + "src": "aska-physical/funi-frame", + "dst": "aska-physical/optifab", + "type": "consumes", + "cite": { + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "Q_drv = Q_air / 0.62", + "line": 144 + }, + "note": "Certificate vendored; verifier literals pinned.", + "new": true + }, + { + "src": "aska-physical/funi-floors", + "dst": "aska-physical/optifab", + "type": "consumes", + "cite": { + "repo": "aska-physical/funi-floors", + "path": "results/certificate.json", + "find": "\"dead_mass_kg_m2\": 195.12", + "line": 61 + }, + "note": "Certificate vendored for the margin vector and the interface checks.", + "new": true + }, + { + "src": "aska-physical/venturi-collars", + "dst": "aska-physical/optifab", + "type": "consumes", + "cite": { + "repo": "aska-physical/venturi-collars", + "path": "README.md", + "find": "`> 80 uW` node", + "line": 21 + }, + "note": "Certificate vendored for the sensing-power margin.", + "new": true + }, + { + "src": "Moissanite-Labs/weft", + "dst": "aska-physical/optifab", + "type": "consumes", + "cite": { + "repo": "Moissanite-Labs/weft", + "path": "weft/runtime/invariants/invariants.py", + "find": "def verify_weight_update_safety_ex(", + "line": 95 + }, + "note": "The gate predicate is re-implemented here, tested on Weft's vectors and checked against Weft's own function on generated inputs.", + "new": true + }, + { + "src": "Foundation-0/f0", + "dst": "aska-physical/optifab", + "type": "governs", + "cite": { + "repo": "Foundation-0/f0", + "path": "docs/charter/page.js", + "find": "var EVID = { 'formally-verified': ['v', 5, 'Formally verified']", + "line": 317 + }, + "note": "Evidence scale and the rules for agents.", + "new": true + }, + { + "src": "Moissanite-Labs/weft-corpus", + "dst": "aska-physical/optifab", + "type": "direction", + "cite": { + "repo": "Moissanite-Labs/weft-corpus", + "path": "weft/terrafab.md", + "find": "the other part of the loop is what the facility enables for the weft by providing a full end to end control loop for iteration, adaptation and evolution", + "line": 86 + }, + "note": "The idea of one structure, named in optifab issue 1. No figure from these documents is used as evidence.", + "new": true + }, + { + "src": "Foundation-0/f0", + "dst": "aska-physical/.github", + "type": "mentions", + "cite": { + "repo": "aska-physical/.github", + "path": "profile/README.md", + "find": "theorems from `Foundation-0` into commercially manufacturable physical products", + "line": 5 + }, + "note": "The aska-physical profile says the organisation turns Foundation-0 results into products." + }, + { + "src": "Foundation-0/.github", + "dst": "aska-physical/fibral-rigidity", + "type": "governs", + "cite": { + "repo": "aska-physical/fibral-rigidity", + "path": "README.md", + "find": "Every claim is labelled strictly per the", + "line": 17 + }, + "note": "fibral-rigidity labels its claims by the Foundation-0 repository standard." + }, + { + "src": "Foundation-0/f0", + "dst": "Proven-Commons/mission", + "type": "governs", + "cite": { + "repo": "Proven-Commons/mission", + "path": "README.md", + "find": "It is a programme of Foundation-0", + "line": 5 + } + }, + { + "src": "Foundation-0/project-asma", + "dst": "Moissanite-Labs/weft", + "type": "builds_on", + "cite": { + "repo": "Moissanite-Labs/weft", + "path": "weft/runtime/plasm/identifiability_gate.py", + "find": "Foundation-0/project-asma", + "line": 7 + }, + "note": "Weft adapted two theorems into its identifiability gate. That module is separate from the gate optifab uses." + }, + { + "src": "Foundation-0/rigid-realizations", + "dst": "Moissanite-Labs/weft", + "type": "mentions", + "cite": { + "repo": "Moissanite-Labs/weft", + "path": "tools/flex_burn_hardened/run_all_55_flex_burn_v2.py", + "find": "Foundation-0/rigid-realizations", + "line": 23 + }, + "note": "Named as a track in a budget tool. No data flows." + }, + { + "src": "Moissanite-Labs/weft", + "dst": "Foundation-0/math0", + "type": "mentions", + "cite": { + "repo": "Foundation-0/math0", + "path": "studies/integer-mult/carbon-2026-11-13/base-math-convergence/research/conservation-quotient-bounds/PROOF.md", + "find": "certified neural morphogenesis in [`Moissanite-Labs/weft`]", + "line": 10 + }, + "note": "A math0 study names Weft as one instance of a shared structure. The study is claimed, pending review, and its Lean file does not compile." + }, + { + "src": "Foundation-0/incentre-lattices", + "dst": "Moissanite-Labs/siliquant", + "type": "checked_unrelated", + "cite": { + "repo": "Moissanite-Labs/siliquant", + "path": "notes/brief-check.md", + "find": "| 17 | The 16,240 exact certificate coefficients | Real, unrelated |", + "line": 39 + }, + "note": "siliquant checked whether the certificate coefficients of incentre-lattices bear on weight rounding and found them unrelated. Its other proposed links to the lattice tracks are recorded there as proposals, not evaluated." + }, + { + "src": "Foundation-0/incentre-lattices", + "dst": "Moissanite-Labs/exo-os", + "type": "mentions", + "cite": { + "repo": "Moissanite-Labs/exo-os", + "path": "docs/BANKAI.md", + "find": "incentre lattice (D-049)", + "line": 405 + }, + "note": "The lattice supplies the geometry of a visual figure. No result is used." + }, + { + "src": "Foundation-0/f0", + "dst": "Moissanite-Labs/exo", + "type": "indexes", + "cite": { + "repo": "Foundation-0/f0", + "path": "docs/data/projects.json", + "find": "\"slug\": \"exo\"", + "line": 331 + }, + "note": "f0 lists Exo as an instrument, with Aska Digital as its owner." + }, + { + "src": "Foundation-0/f0", + "dst": "Moissanite-Labs/.github", + "type": "mentions", + "cite": { + "repo": "Moissanite-Labs/.github", + "path": "profile/README.md", + "find": "The wider practice connects applied work at", + "line": 30 + }, + "note": "The lab profile names Foundation-0 and Proven Commons as connected efforts." + }, + { + "src": "Moissanite-Labs/weft-corpus", + "dst": "Moissanite-Labs/weft", + "type": "builds_on", + "cite": { + "repo": "Moissanite-Labs/weft", + "path": "weft/runtime/invariants/invariants.py", + "find": "Repaired from `weft/terrafab-calc.md:50-100` (C header)", + "line": 11 + }, + "note": "Weft's gate was repaired from a header first written, in the Terrafab documents, as a fence for physical machines." + }, + { + "src": "Moissanite-Labs/weft", + "dst": "Moissanite-Labs/weft-loom", + "type": "builds_on", + "cite": { + "repo": "Moissanite-Labs/weft", + "path": "README.md", + "find": "Experiment records, audits", + "line": 35 + } + }, + { + "src": "Moissanite-Labs/weft", + "dst": "Moissanite-Labs/siliquant", + "type": "mentions", + "cite": { + "repo": "Moissanite-Labs/siliquant", + "path": "README.md", + "find": "It sits beside [weft]", + "line": 3 + } + }, + { + "src": "Moissanite-Labs/abios", + "dst": "Moissanite-Labs/weft", + "type": "mentions", + "cite": { + "repo": "Moissanite-Labs/weft", + "path": "README.md", + "find": "The telemetry line here is an earlier dialect", + "line": 136 + }, + "note": "Weft's telemetry line predates the abios format; the move is an open Weft issue." + }, + { + "src": "aska-physical/dock", + "dst": "aska-physical/optifab", + "type": "indexes", + "cite": { + "repo": "aska-physical/dock", + "path": "index.html", + "find": "api.github.com/orgs/aska-physical/repos", + "line": 789 + }, + "note": "The hub page lists every repository of the organisation, so optifab appears without a change to dock." + } + ], + "surveyed_not_connected": [ + { + "repo": "Foundation-0/astr0", + "why": "Astronomy hub. Nothing in it bears on a data centre." + }, + { + "repo": "Foundation-0/plate-eclipses", + "why": "Astronomy result, claimed. Not connected." + }, + { + "repo": "Foundation-0/fractals", + "why": "Exploration with no new result claimed. Not connected." + }, + { + "repo": "Moissanite-Labs/weft-eido", + "why": "Design language for interfaces. A later dashboard for the plant could use it; nothing to check today." + }, + { + "repo": "Moissanite-Labs/exoframe", + "why": "Public intake pages for Exofab. Not connected." + }, + { + "repo": "Moissanite-Labs/exorien", + "why": "Direction for shared physical and digital spaces. Its own notes say hardware is not implemented." + }, + { + "repo": "Moissanite-Labs/tokenpage", + "why": "Charter only. No measurement to combine yet." + }, + { + "repo": "Moissanite-Labs/scry", + "why": "Charter only. No measurement to combine yet." + }, + { + "repo": "Moissanite-Labs/nullmodem", + "why": "Charter only. No measurement to combine yet." + }, + { + "repo": "Proven-Commons/tar", + "why": "Pilot, built, not yet verified. Not on the telemetry path." + }, + { + "repo": "Proven-Commons/redis", + "why": "Proofs done, specification review pending. Not on the telemetry path." + }, + { + "repo": "Proven-Commons/site", + "why": "Alternative build of the programme site." + } + ] +} diff --git a/data/pins.json b/data/pins.json new file mode 100644 index 0000000..9bc26c1 --- /dev/null +++ b/data/pins.json @@ -0,0 +1,590 @@ +{ + "schema": "optifab-pins/1", + "pins": [ + { + "id": "ff.cop_ads", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "Q_drv = Q_air / 0.62", + "line": 144, + "value": { + "cop_ads": 0.62 + }, + "note": "Silica-gel adsorption COP, a literal in the upstream verifier." + }, + { + "id": "ff.cooling_power", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "P_c_conv, P_c_funi = P_it / 3.0 + 0.27, Q_ates / 28.0 + 0.195", + "line": 147, + "value": { + "conv_chiller_cop": 3.0, + "conv_aux_MW": 0.27, + "ates_cop": 28.0, + "funi_aux_MW": 0.195 + }, + "note": "Cooling electricity model: conventional chiller COP and auxiliaries, ATES COP and auxiliaries." + }, + { + "id": "ff.q_ates", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "Q_ates = (Q_liq - Q_drv) + (Q_air + Q_drv) - (Q_pil + 0.55 * Q_sky)", + "line": 146, + "value": { + "sky_fraction": 0.55 + }, + "note": "Heat sent to the aquifer store. The drive heat cancels, so Q_ates = P_it - Q_pil - 0.55 Q_sky." + }, + { + "id": "ff.pue_overhead", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "\"PUE_funi_frame\": round((P_it + P_c_funi + 0.2) / P_it, 3)", + "line": 159, + "value": { + "other_overhead_MW": 0.2 + }, + "note": "Non-cooling overhead in the PUE numerator." + }, + { + "id": "ff.pcm_energy", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "v_pcm, v_wat = 2500.0 / 30.0, 2500.0 / 11.5", + "line": 143, + "value": { + "pcm_energy_kWh_th": 2500.0, + "pcm_density_kWh_m3": 30.0, + "water_density_kWh_m3": 11.5 + }, + "note": "Ride-through energy of the PCM skid and the two storage densities." + }, + { + "id": "ff.heat_leak", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "\"passive_ride_through_with_mpcm_min\": round((E_air + E_pcm) / (750.0 * 60.0), 2)", + "line": 102, + "value": { + "heat_leak_kW": 750.0 + }, + "note": "Air-side heat load used for the wall-liner ride-through." + }, + { + "id": "ff.floor_mass", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "m_a = (2500.0 * (195.12 + roof_m) + p_m * h_a * wall_m) / 1000.0", + "line": 125, + "value": { + "floor_mass_kg_m2": 195.12, + "floor_area_m2": 2500.0 + }, + "note": "Floor dead mass copied by hand from funi-floors." + }, + { + "id": "ff.conv_floor_mass", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "m_c = (2500.0 * (744.0 + 460.0) + p_m * h_c * 368.0) / 1000.0", + "line": 124, + "value": { + "conv_floor_mass_kg_m2": 744.0 + }, + "note": "Conventional post-tensioned floor mass, the funi-floors baseline." + }, + { + "id": "ff.geometry", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "h_c, h_a, p_m = 2 * 6.0 + 2.40, 2 * 5.45 + 1.48, 4.0 * math.sqrt(2500.0)", + "line": 123, + "value": { + "perimeter_m": 200.0 + }, + "note": "Square 2,500 m2 plan, so the perimeter is 200 m." + }, + { + "id": "ff.fesma", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "P_sma = n_r * Asma * (435.0 * math.tanh((175.0 - 50.0) / 58.0)) * 1e-3", + "line": 47, + "value": { + "sigma0_MPa": 435.0, + "T_act_C": 175.0, + "T0_C": 50.0, + "T_scale_C": 58.0 + }, + "note": "Fe-SMA recovery stress law, shared with funi-floors." + }, + { + "id": "ff.rack_live", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "m_live = (2500.0 * (0.25 * 15.0 * 101.97 + 7.5 * 101.97)) / 1000.0", + "line": 126, + "value": { + "rack_live_kPa": 15.0 + }, + "note": "Rack floor live load, the funi-floors 313 psf case." + }, + { + "id": "ff.uplift_factor", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": ">= 1.5 * rf[\"tornado_net_uplift_kN\"]", + "line": 174, + "value": { + "uplift_factor": 1.5 + }, + "note": "Factor on tornado uplift in must-fail control 3." + }, + { + "id": "ff.deflection_limit", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "rf[\"span_over_delta_ipe600_rafter\"] < 360.0 <= rf[\"span_over_delta_vault\"]", + "line": 172, + "value": { + "span_over_delta_limit": 360.0 + }, + "note": "L/360 serviceability limit in must-fail control 1." + }, + { + "id": "ff.revenue_low", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "\"unlocked_annual_revenue_low_M_usd\": round((P_c_conv - P_c_funi) * 25.0, 2)", + "line": 163, + "value": { + "revenue_low_M_usd_per_MW_yr": 25.0 + }, + "note": "Low end of the compute revenue per MW-year." + }, + { + "id": "ff.temps", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "HANDOFF.md", + "find": "Capturing `85%` of IT heat at `58 °C` (`ASHRAE W45`) self-generates `100%` of the `15–18 °C` chilled water", + "line": 14, + "value": { + "T_drive_C": 58.0, + "T_chilled_C": [ + 15.0, + 18.0 + ] + }, + "note": "Drive and chilled-water temperatures. Stated in prose only; the certificate has no temperature fields." + }, + { + "id": "ff.eis_text", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "docs/ENGINEERING_STUDIES.md", + "find": "`+46.16%` reactance shift", + "line": 52, + "value": { + "eis_shift_pct": 46.16 + }, + "note": "Leak-sensing figure quoted from funi-floors." + }, + { + "id": "vc.node_power", + "kind": "line", + "repo": "aska-physical/venturi-collars", + "path": "README.md", + "find": "`> 80 uW` node", + "line": 21, + "value": { + "node_power_mW": 0.08 + }, + "note": "Power of the wireless sensor node the collar must supply." + }, + { + "id": "weft.max_lineage_depth", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "weft/runtime/ledger/ProvenanceRegistry.sol", + "find": "uint256 public constant MAX_LINEAGE_DEPTH = 12;", + "line": 7, + "value": { + "max_lineage_depth": 12 + }, + "note": "Depth bound of the Weft provenance DAG, applied here to the cross-org lineage graph." + }, + { + "id": "weft.thermal_estimate", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "weft/runtime/telemetry/host_metrics.py", + "find": "est_temp = round(38.5 + strain * 35.0, 2)", + "line": 45, + "note": "Weft's only temperature is this formula of CPU load. No sensor is read." + }, + { + "id": "weft.lean_milestone", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "docs/roadmap.md", + "find": "Lean 4 formal mechanization of the `C2` Frobenius and budget predicates", + "line": 48, + "note": "Weft Milestone I.3, still open. The plant gate here would share that proof." + }, + { + "id": "weft.telemetry_dialect", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "README.md", + "find": "The telemetry line here is an earlier dialect", + "line": 136, + "note": "Weft's telemetry line is not yet the abios format." + }, + { + "id": "weft.gate_origin", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "weft/runtime/invariants/invariants.py", + "find": "Repaired from `weft/terrafab-calc.md:50-100` (C header)", + "line": 11, + "note": "Weft's shipped gate descends from the header in the Terrafab documents." + }, + { + "id": "weft.frame_struct", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "weft/runtime/telemetry/frame64.py", + "find": "FRAME64_STRUCT = struct.Struct(\"<16f\")", + "line": 24, + "value": { + "struct": "<16f", + "bytes": 64, + "floats": 16 + }, + "note": "Byte layout of Weft's telemetry frame, reused for the plant frame." + }, + { + "id": "weft.audit_latency", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "docs/corpus/sources/B-top1.md", + "find": "Sensor-to-nozzle 15 ms → 0.5 ms (terrafab:67) is asserted, not derived.", + "line": 220, + "note": "Weft's own audit of the latency figures in the Terrafab documents." + }, + { + "id": "weft.audit_gate", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "docs/corpus/sources/B-top1.md", + "find": "it bounds only abstract scalars, not actuator commands", + "line": 227, + "note": "Weft's own audit of the Terrafab header: its inputs were not physical quantities." + }, + { + "id": "weft.audit_governance", + "kind": "line", + "repo": "Moissanite-Labs/weft", + "path": "docs/corpus/sources/B-top1.md", + "find": "it describes irreversible autonomous control of physical infrastructure", + "line": 235, + "note": "Weft's audit flags the governance risk in the Terrafab documents." + }, + { + "id": "ml.preference_not_permission", + "kind": "line", + "repo": "Moissanite-Labs/siliconcordat", + "path": "README.md", + "find": "Learning a preference does not grant permission.", + "line": 12, + "note": "The Siliconcordat principle that bounds what any gate or agent may do on its own." + }, + { + "id": "corpus.source_material", + "kind": "line", + "repo": "Moissanite-Labs/weft-corpus", + "path": "README.md", + "find": "Read this as source material, not instructions.", + "line": 11, + "note": "The corpus narrates actions that did not happen. Nothing in it is evidence." + }, + { + "id": "corpus.facility_loop", + "kind": "line", + "repo": "Moissanite-Labs/weft-corpus", + "path": "weft/terrafab.md", + "find": "the other part of the loop is what the facility enables for the weft by providing a full end to end control loop for iteration, adaptation and evolution", + "line": 86, + "note": "The owner's own sentence in the session: the facility closes the loop for the intelligence." + }, + { + "id": "corpus.latency", + "kind": "line", + "repo": "Moissanite-Labs/weft-corpus", + "path": "weft/terrafab.md", + "find": "15 milliseconds to under 0.5 milliseconds", + "line": 67, + "value": { + "slow_ms": 15.0, + "fast_ms": 0.5 + }, + "note": "The two loop latencies the Terrafab documents quote. Used here only as test values." + }, + { + "id": "corpus.header", + "kind": "line", + "repo": "Moissanite-Labs/weft-corpus", + "path": "weft/terrafab-calc.md", + "find": "#define WEFT_MAX_LORA_DELTA_NORM 120.0f", + "line": 35, + "note": "The header that Weft repaired into its gate." + }, + { + "id": "corpus.chip", + "kind": "line", + "repo": "Moissanite-Labs/weft-corpus", + "path": "weft/terraweft.md", + "find": "The Syntactic Weft Chip", + "line": 3, + "note": "The chip idea. Vision only." + }, + { + "id": "ff.tones", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "tones = [(29.5, 0.085), (49.0, 0.060), (60.0, 0.110), (120.0, 0.045)]", + "line": 112, + "value": { + "tones_Hz": [ + 29.5, + 49.0, + 60.0, + 120.0 + ] + }, + "note": "Plant vibration tones in the upstream isolation model." + }, + { + "id": "ff.stages", + "kind": "line", + "repo": "aska-physical/funi-frame", + "path": "verify.py", + "find": "_th(f, 4.5, 0.16) * _th(f, 9.2, 0.12) * 0.40", + "line": 113, + "value": { + "stage_Hz": [ + 4.5, + 9.2 + ] + }, + "note": "Natural frequencies of the two isolation stages." + }, + { + "id": "f0.evidence_rank", + "kind": "line", + "repo": "Foundation-0/f0", + "path": "docs/charter/page.js", + "find": "var EVID = { 'formally-verified': ['v', 5, 'Formally verified'], 'independently-replicated': ['v', 4, 'Replicated'], 'peer-reviewed': ['r', 3, 'Peer reviewed'], deployed: ['d', 3, 'Deployed'], preprint: ['p', 2, 'Preprint'], claimed: ['c', 1, 'Claimed'] };", + "line": 317, + "value": { + "formally-verified": 5, + "independently-replicated": 4, + "peer-reviewed": 3, + "deployed": 3, + "preprint": 2, + "claimed": 1 + }, + "note": "The Ledger's ranking of evidence, reused here as the common scale." + }, + { + "id": "f0.ledger_dc_cooling", + "kind": "json", + "repo": "Foundation-0/f0", + "path": "docs/data/ledger.json", + "pointer": [ + "milestones", + { + "id": "deepmind-datacenter-cooling-40pct" + }, + "before_after", + "after" + ], + "equals": "up to 40% lower (15% lower PUE overhead)", + "note": "The Ledger's deployed data-centre cooling entry (2016)." + }, + { + "id": "f0.ledger_dc_cooling_evidence", + "kind": "json", + "repo": "Foundation-0/f0", + "path": "docs/data/ledger.json", + "pointer": [ + "milestones", + { + "id": "deepmind-datacenter-cooling-40pct" + }, + "evidence" + ], + "equals": "deployed", + "note": "Evidence level of that entry." + }, + { + "id": "pc.none_verified", + "kind": "line", + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "so none is verified", + "line": 44, + "note": "No Proven Commons project has passed the verified bar." + }, + { + "id": "pc.reviewers_empty", + "kind": "line", + "repo": "Proven-Commons/mission", + "path": "bar/reviewers.toml", + "find": "The list is empty until the first reviewers are named", + "line": 6, + "note": "Bar item 1 cannot be met by any project until reviewers are named." + }, + { + "id": "pc.mqtt", + "kind": "line", + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "| MQTT 5.0 packet framing |", + "line": 78, + "note": "Candidate row." + }, + { + "id": "pc.cbor", + "kind": "line", + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "| CBOR codec (RFC 8949) |", + "line": 74, + "note": "Candidate row." + }, + { + "id": "pc.ntp", + "kind": "line", + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "| NTP wire packet |", + "line": 82, + "note": "Candidate row." + }, + { + "id": "pc.protobuf", + "kind": "line", + "repo": "Proven-Commons/mission", + "path": "CANDIDATES.md", + "find": "| Protobuf wire format codec |", + "line": 52, + "note": "Candidate row." + }, + { + "id": "sq.e8", + "kind": "line", + "repo": "Moissanite-Labs/siliquant", + "path": "bounds/bounds.out", + "find": "E_8 | 0.071682 | 0.654 | 0.1086", + "line": 20, + "value": { + "gain_bits_per_weight": 0.1086 + }, + "note": "Granular gain of E8 over scalar rounding." + }, + { + "id": "sq.limit", + "kind": "line", + "repo": "Moissanite-Labs/siliquant", + "path": "bounds/bounds.out", + "find": "limit of the ball, 1 / (2 pi e) | 0.058550 | 1.533 | 0.2546", + "line": 23, + "value": { + "gain_bits_per_weight": 0.2546 + }, + "note": "Ceiling on what any cell shape can gain." + }, + { + "id": "sq.unrelated", + "kind": "line", + "repo": "Moissanite-Labs/siliquant", + "path": "notes/brief-check.md", + "find": "| 17 | The 16,240 exact certificate coefficients | Real, unrelated |", + "line": 39, + "note": "siliquant already checked a proposed link from incentre-lattices to weight rounding and closed it." + }, + { + "id": "abios.bytes", + "kind": "line", + "repo": "Moissanite-Labs/abios", + "path": "bench/README.md", + "find": "v2 is 3.1x smaller in bytes", + "line": 18, + "value": { + "ratio": 3.1 + }, + "note": "Bytes against compact JSON on 6 paired hand-written tasks. Not a model evaluation." + }, + { + "id": "synbios.sym3", + "kind": "line", + "repo": "Moissanite-Labs/synbios", + "path": "README.md", + "find": "| 200 messages | 27363 | **7628** | 7649 |", + "line": 17, + "value": { + "compact_json_tokens": 27363, + "sym3_refs_tokens": 7628 + }, + "note": "Token counts on a synthetic 200-message transcript." + } + ], + "searches": [ + { + "id": "no_aska_physical_in_other_orgs", + "pattern": "aska-physical|funi-frame|funi-floors|optifab", + "repos": [ + "Moissanite-Labs/weft", + "Moissanite-Labs/weft-loom", + "Moissanite-Labs/siliquant", + "Moissanite-Labs/abios", + "Moissanite-Labs/synbios", + "Moissanite-Labs/synmerit", + "Moissanite-Labs/ethos", + "Moissanite-Labs/exofab", + "Moissanite-Labs/exo-os", + "Moissanite-Labs/siliconcordat", + "Moissanite-Labs/.github", + "Foundation-0/f0", + "Foundation-0/math0", + "Foundation-0/physics0", + "Foundation-0/incentre-lattices", + "Foundation-0/point-charges", + "Foundation-0/.github", + "Proven-Commons/mission", + "Proven-Commons/.github" + ], + "expect_hits": 0, + "note": "Before this version no repository of the other three organisations named aska-physical or its data-centre work." + } + ] +} diff --git a/data/sources.json b/data/sources.json new file mode 100644 index 0000000..c5ddac9 --- /dev/null +++ b/data/sources.json @@ -0,0 +1,247 @@ +{ + "schema": "optifab-sources/1", + "repos": { + "aska-physical/.github": { + "commit": "0289ce8afa209f7ee8679622e2129fe8ace3746f", + "files": { + "ETHOS.md": "ce8efe133fa6a73ad33e79bea96188805a9c8ae64fb948476d7bb5f5f8a167e7", + "profile/README.md": "a7b39fd11109b67d3c422eaa4106fb986b7f6c51b3952bca7e87fde10d853cb8" + } + }, + "aska-physical/cfrp-masts": { + "commit": "a12b665f2baf32a8d6499ef39c296ef9fe78f630", + "files": { + "results/certificate.json": "ff354f780e58999254b87eaf5ac6af3a387a662b320af714764c0b95718d664a" + } + }, + "aska-physical/cfrp-strengthening": { + "commit": "3f68cccf19556574b7652311be1b0dc0daa93144", + "files": { + "docs/review-ledger.md": "23dda130ce887eb2ba9973f4de1375f39ee31f0f3a354a70c15029274dd8bea6" + } + }, + "aska-physical/cfrp-truss": { + "commit": "3c11631e223b71227531d10286abd71bc04d67b7", + "files": { + "README.md": "e8a599dd2d2601c15be5e0913bd1c5fe0fa99dbed8bf9bf895fe6b1274f26041" + } + }, + "aska-physical/dock": { + "commit": "ce4135b88139fb63372279015cecc77c6b89f364", + "files": { + "index.html": "9773a0b7ce03b0ec67b325a8a0789b83719e400db721284cefa32eb662148fc1" + } + }, + "aska-physical/fibral-rigidity": { + "commit": "06520520dff2e956715f18cfa3ba10e7ee83487b", + "files": { + "README.md": "9db8550b115c4d14dc845ce81c047e1c6bfda5f183efb6a149385ada8a6c0958" + } + }, + "aska-physical/funi-floors": { + "commit": "00eba18ceea0adf69f7dc12ca47d151622faa32a", + "files": { + "README.md": "4095c8469e15bdf88ecfbfea351743440095ccfb1068674a8cb24cfb6d56cff0", + "results/certificate.json": "85878c416fed3c290c1321ec0dc27af5a152d8ca4d264b8f802add2e5995d186" + } + }, + "aska-physical/funi-frame": { + "commit": "97b326d237de5e03a2a227a02f32121005109fb8", + "files": { + "HANDOFF.md": "07beab173fbe1b0863dc368115ec004f12719cf8e8ef2ee5a077e6e9f1c914cf", + "README.md": "2e759144d262be6e0be47b18709a05ca4ec1ff84bbd06244f155f7eb65d825ff", + "docs/ENGINEERING_STUDIES.md": "b7205b630444b1f5cf453a0deee4ebe470d5d855e52d678bd8e67a246276bbf7", + "results/certificate.json": "92e7bbcea389274d2967e463ec3881ec9311db7786c5e74559defcd936dfb9fa", + "verify.py": "cef9e47da460add38618b46fe4478855f80551f2c722dc73c64808375625a57e" + } + }, + "aska-physical/graph-fab": { + "commit": "d669f233212ee0f2a7d59e60b0f3bdc9781f8a99", + "files": { + "README.md": "0c963eef2c803d3c815ee5545ca2371d2759dd1e454542109dfa302c2a418228" + } + }, + "aska-physical/impedence-analyzers": { + "commit": "ed0a5e10e87e231262af697cb183aa8aa570ca83", + "files": { + "README.md": "83d0736f55d529634b485d2163910bcfd2bf8307db622baabf25c188c5c8e451" + } + }, + "aska-physical/venturi-collars": { + "commit": "d53f85a35d17a7bd46d0b5320c8879fc9f381978", + "files": { + "README.md": "f5ad663e8c0a3436c4c5b382606b7f910d5ad47b51e6d495cfb3334c8726cbc5", + "results/certificate.json": "c93eb98b2431b2b733cb1702594c5dc1e00a77fc811d663cea561f20cb0c0170" + } + }, + "Foundation-0/.github": { + "commit": "81f83c38918382b4ca142b81debd3cc5ccf61d3a", + "files": { + "REPO-STANDARD.md": "5da1c2d1b843a0d2553ef5c00ef2f0d29b35ea1cb6e8e9c5fc999940a64ef633" + } + }, + "Foundation-0/ductricity": { + "commit": "0a178a01209b6b583408a861b2476e2308e1f053", + "files": { + "README.md": "6428af38c4fd8178a27377748c333617511c92e663e291e6da6679c37ca89877" + } + }, + "Foundation-0/f0": { + "commit": "9a37134750174339c53121939838ce62ab8af630", + "files": { + "README.md": "fdcf48a9af2516be0993c003e7a6fbe6a6162c00224b90cff4f1b8e9ededd2be", + "docs/charter/page.js": "713a8ee7a0af6d7954852684304cc1393fc6fd9844c2298df5ca53b9282a534f", + "docs/data/ledger.json": "614e324e7f9cfd2fb686473c6fc3b17f083f0690403e197879f88c0104194998", + "docs/data/projects.json": "89d7a2b899a47309afeb924fc9e9f2ea520527092071c783b9af32a14512d118" + } + }, + "Foundation-0/incentre-lattices": { + "commit": "2d374fff2a59cc9331566733043a4bb25c1040bf", + "files": { + "README.md": "38b87aad99378cc9de6d80f2a603b89402bdf11147356020a5c9f14b7bb3e1a4" + } + }, + "Foundation-0/math0": { + "commit": "e649250ca32249affe52873a45d22e8bd5562624", + "files": { + "README.md": "36946626ad88ba7a395d855f917f442d9c9c133ab9a27695e0703ed92f2540d1", + "studies/integer-mult/carbon-2026-11-13/base-math-convergence/research/conservation-quotient-bounds/PROOF.md": "003338add42876488acee256825e20ff1ac41f07c294c24b77c29750bf23dc6d" + } + }, + "Foundation-0/nhanes-bioimpedance": { + "commit": "efb3395b70e32ae96779a73454b2333b7e86c4d1", + "files": { + "README.md": "912abd9a650ec4be263758ba43f9058fdf63544aa97979b5b698f707019aee0f" + } + }, + "Foundation-0/physics0": { + "commit": "913468f093f82d869dc58b404039ea0a416cfb80", + "files": { + "AREAS.md": "7c590dffe6a796c61a2e1c52e16b0ad1fcb982a19bb13ea136c4530b46fce61e" + } + }, + "Foundation-0/point-charges": { + "commit": "a2fd159bccb24d2922a127ad83f28b9f44e2ceba", + "files": { + "NOTE.md": "8730c9a298643931e34010f114907fef52c93b8244e2e73b29bbaf1750e26589" + } + }, + "Foundation-0/project-asma": { + "commit": "48178217a88066212ec798a7e8031e6fc652493e", + "files": { + "README.md": "fad26b3f171f679866e022f49000ed126a4b072b0d7b4a209e35df95bf837da2" + } + }, + "Foundation-0/rigid-realizations": { + "commit": "298926c5e7a03683bb83165931ac38a94260166f", + "files": { + "README.md": "05fc65990df941206904799655d2762b4f561dc74d338a62fd0a3b5ee5bfb548" + } + }, + "Foundation-0/thermal-capture": { + "commit": "5fa678e94d2e6b1ace56d2cc7e4e0b0eae0a91af", + "files": { + "README.md": "4a3b5fcad91b46cfcb656cbd0d9a7dca8d6a709ed55f9ed0d14149619eab7aaa" + } + }, + "Moissanite-Labs/.github": { + "commit": "23b1282b6c6aae05774471eacd79ba5a6ae767f9", + "files": { + "profile/README.md": "cbe6c0026d27636c433dddb71d0744c257059e92a24fa866dadbe9a751ab81ba" + } + }, + "Moissanite-Labs/abios": { + "commit": "21154fdc2fe925047560134fdedea5d0c073ca25", + "files": { + "bench/README.md": "a1dc41067dff44a086fa02423ad600a054c79531d0f1f64b245a8d706a1cfcd0" + } + }, + "Moissanite-Labs/ethos": { + "commit": "afdb3a4af912a13358f2e1d67673dfd175ed39be", + "files": { + "pyproject.toml": "21a96d319792e008b81f29dbd9e4c34d9d7a4b6eb85530fd76425124371bc4c1" + } + }, + "Moissanite-Labs/exo-os": { + "commit": "bf489013a217b99aa8a0d238fbfb398b78354685", + "files": { + "docs/BANKAI.md": "bb8067dced717c82527f2368440d4b39627ff7df8a5622f453a462d5c55f8954", + "research/04-small-hardware.md": "b8cf231471fa1a6cab82ab9452649c4db22007bc175bf79bcff296150dc08821" + } + }, + "Moissanite-Labs/exofab": { + "commit": "1e103c7394ef904c166c83b4529410e815a8c5a1", + "files": { + "README.md": "5fb844e72e1ba1877c20baaf76921ea48ca21ac43566eb8b945d2247f436866a" + } + }, + "Moissanite-Labs/siliconcordat": { + "commit": "28d3238a0a5a635137efe3872e1648c03ed8edd0", + "files": { + "README.md": "061d49ba280314ff856a492c921496dc0dc202976d487da0cec0f3dcac256f3b" + } + }, + "Moissanite-Labs/siliquant": { + "commit": "ba3a7333e9ccb99e35a74655b8d08699600adecd", + "files": { + "README.md": "7061045a88d237fb5f34544f94acd587ab4c06e11f38eec367c776612c7931b1", + "bounds/bounds.out": "282aaa9e8b03a96a5ab7c24543ed0b3c7ea68b5969c2bc9e6511133045af3502", + "notes/brief-check.md": "f1ff75da0e0ce0d06e5fec2894eeb7226632fb27286c23111b7da121ff53531c" + } + }, + "Moissanite-Labs/synbios": { + "commit": "85583494aa5868cc9219aa0d914c27714b05a52e", + "files": { + "README.md": "c1d866c51288d9b26e828ae41c35dcb16e23f38d5793133e09a6b1f233859d43" + } + }, + "Moissanite-Labs/synmerit": { + "commit": "4b1a9e1c98aa7e41fc4636f59a36be0c7d4f58fa", + "files": { + "package.json": "e643c12d3419f1e942ab7d39568aeea8642bfb3c6e26fa5f51f11e3211ac87c8" + } + }, + "Moissanite-Labs/weft": { + "commit": "df4f9fa45640d7ee840f4529025a9a556d98684c", + "files": { + "README.md": "d32ef59cfb8ab2343b0839409c3c33f7d2b9864b709d567b57fff26131e64010", + "docs/corpus/sources/B-top1.md": "7f2baf0582b540f0c2dae51a1b2ab71372bd35114bc6a7388840068f6a5fa2e8", + "docs/roadmap.md": "194e1baee11536ee270ae45de435c48e2ffb222660c35a696c58ae219fc6c2f3", + "tools/flex_burn_hardened/run_all_55_flex_burn_v2.py": "fa1287632e4edfd4b56625baab7fe4ef4b0d64ac8db4536d1e36433a4f252871", + "weft/runtime/invariants/invariants.py": "1064b0f8170c7b4dd2099a9412df2b50f301da003d61a5b07f842f26646612e4", + "weft/runtime/invariants/vectors.json": "bdc25776f32b0ed0cdaab4e413bed4a906f20193536724e60a7fba09c9965bcf", + "weft/runtime/ledger/ProvenanceRegistry.sol": "d5c5156556dc4728eeb1ca9db19c2ff16d16bc8ba0aeaf900e300b0b8f7f0f1f", + "weft/runtime/plasm/identifiability_gate.py": "9e2bc8c7a8c0e2783cd8f7544f6267704ac5fae1d25da8c54af8e29243e5cc29", + "weft/runtime/telemetry/frame64.py": "b7c6152a0603b47e993a0e699584312efd819e39e5c58ea5a52e37365eedc7ae", + "weft/runtime/telemetry/host_metrics.py": "08b66a6b50c47bd61eec9bd227a3dea299194e3b518fedb9b47a0ee8f2f2db2d" + } + }, + "Moissanite-Labs/weft-corpus": { + "commit": "5cf1e447102bba55d7d1d8010ea2bdda1f2eddf1", + "files": { + "README.md": "3c18d2976c1c60ccd8519ac81b8b6fa0e74ebdbd9e219a3a23480d553abfcf95", + "weft/terrafab-calc.md": "9c8dc4da177e89ab360d1b73133dcb27457aaad8277aeb855b03601c655c6158", + "weft/terrafab.md": "eaa16517934cf619b8599e90c649c1d07cbe9c6d15b5f5b528af71f097e1908d", + "weft/terraweft.md": "d7433f1443529ecf45d550bef9b6cc109f27bd62d6714275f6892459829e104b" + } + }, + "Moissanite-Labs/weft-loom": { + "commit": "b250e13982edec5df9fbfd2f0dee49e11972215d", + "files": { + "notes/horizon-ii-ideas-backlog.md": "4d4bb313b641055cbe456f1b6b035f45aaa13becdbfb5b8c46d0a9ecbec2b218" + } + }, + "Proven-Commons/.github": { + "commit": "60521aa4efdefc94f17fd864c1981a6ab517df5d", + "files": {} + }, + "Proven-Commons/mission": { + "commit": "7b22e542f0db0f3013ab1439cf5d1947676a5083", + "files": { + "CANDIDATES.md": "0eabd163a8a1e67caaffe140abe4c62d8b12806af3c41d1bffd702ae63dbd5a4", + "README.md": "22abf4959d7b5db3d544231126b4cab7acf0690c93363ff2d4c9aeab9197940d", + "bar/reviewers.toml": "0b2ba6d07b900adb943c8b32106eba71a8d3deadd98c2915a541e25a2002cdba" + } + } + } +} diff --git a/data/unit.json b/data/unit.json new file mode 100644 index 0000000..057ba48 --- /dev/null +++ b/data/unit.json @@ -0,0 +1,486 @@ +{ + "schema": "optifab-unit/1", + "statuses": { + "checked": "A verifier, here or upstream, computes it, and optifab uses the result.", + "designed": "An upstream certificate or design covers it. Its role in the unit is not checked.", + "tested_code": "Code that runs and is tested upstream. Not connected to a plant.", + "research": "Studies with recorded results. No link to the plant yet.", + "specified": "A specification or schema exists. Nothing is connected.", + "in_progress": "Work is under way upstream and is not finished.", + "rule": "A rule or scale in force that the unit follows.", + "idea": "Vision or idea only. Nothing runnable or certified.", + "missing": "Nothing exists yet." + }, + "organs": [ + "Ground and stores", + "Skeleton", + "Heat and power", + "Nerves", + "Signals", + "Reflex", + "Mind", + "Hands", + "Record and rules" + ], + "elements": [ + { + "id": "G1", + "organ": "Ground and stores", + "element": "Thermal budget: PCM skids holding 2,500 kWh_th", + "where": "plant yard", + "repos": [ + "aska-physical/funi-frame" + ], + "status": "checked", + "note": "The budget the gate spends." + }, + { + "id": "G2", + "organ": "Ground and stores", + "element": "Heat sinks: aquifer loop, 200 energy piles, sky-cooling roof", + "where": "below and above the halls", + "repos": [ + "aska-physical/funi-frame" + ], + "status": "designed", + "note": "The certificate gives their heat flows but no recooling temperature, which finding 2 needs." + }, + { + "id": "G3", + "organ": "Ground and stores", + "element": "High-temperature store: crushed-basalt beds, 20 MWh_th", + "where": "plant yard", + "repos": [ + "aska-physical/funi-frame" + ], + "status": "designed", + "note": "Sized by literals in the upstream verifier. The contract does not use it." + }, + { + "id": "S1", + "organ": "Skeleton", + "element": "Floors: funicular cassettes for 313 psf racks", + "where": "both storeys", + "repos": [ + "aska-physical/funi-floors" + ], + "status": "checked", + "note": "Five limit states in the margin vector, including the tightest." + }, + { + "id": "S2", + "organ": "Skeleton", + "element": "Shell: roof vault, sandwich walls, seismic frame, isolation plinths", + "where": "envelope and plant bases", + "repos": [ + "aska-physical/funi-frame" + ], + "status": "checked", + "note": "Five limit states in the margin vector." + }, + { + "id": "S3", + "organ": "Skeleton", + "element": "CFRP truss ties and the strengthening baseline", + "where": "roof ties and column tie-downs", + "repos": [ + "aska-physical/cfrp-truss", + "aska-physical/cfrp-strengthening" + ], + "status": "designed", + "note": "funi-frame names them. Their certificates cover a beam example, not this roof." + }, + { + "id": "S4", + "organ": "Skeleton", + "element": "Lattice theory that proportions the members", + "where": "in the geometry", + "repos": [ + "aska-physical/fibral-rigidity", + "Foundation-0/incentre-lattices" + ], + "status": "designed", + "note": "A preprint and a claimed extension. Nothing downstream re-checks them." + }, + { + "id": "H1", + "organ": "Heat and power", + "element": "Liquid loop and sorption chiller", + "where": "halls and plant yard", + "repos": [ + "aska-physical/funi-frame" + ], + "status": "checked", + "note": "The load floor and the recooling limit are derived here." + }, + { + "id": "H2", + "organ": "Heat and power", + "element": "Racks: 10 MW of IT load", + "where": "halls", + "repos": [ + "aska-physical/funi-frame" + ], + "status": "designed", + "note": "A design basis. No rack, chip or power train is modelled." + }, + { + "id": "N1", + "organ": "Nerves", + "element": "Airflow sensing that powers itself", + "where": "supply ducts", + "repos": [ + "aska-physical/venturi-collars", + "Foundation-0/ductricity", + "Foundation-0/thermal-capture" + ], + "status": "checked", + "note": "Its power margin at low airflow is in the margin vector." + }, + { + "id": "N2", + "organ": "Nerves", + "element": "Leak and bondline sensing by impedance", + "where": "floor ribs, beside the liquid headers", + "repos": [ + "aska-physical/impedence-analyzers", + "Foundation-0/nhanes-bioimpedance", + "Foundation-0/point-charges" + ], + "status": "designed", + "note": "funi-floors certifies the reactance shift on a leak. Nothing reads it into a frame." + }, + { + "id": "N3", + "organ": "Nerves", + "element": "Rack vibration sensing", + "where": "racks", + "repos": [], + "status": "missing", + "note": "The limit is certified at 0.0005 g. No sensor is designed." + }, + { + "id": "N4", + "organ": "Nerves", + "element": "Coolant and recooling temperature sensing", + "where": "liquid loop and heat sinks", + "repos": [], + "status": "missing", + "note": "The plant model carries no temperature, and Weft's only temperature is a formula of CPU load." + }, + { + "id": "W1", + "organ": "Signals", + "element": "Plant frame: 16 floats in 64 bytes", + "where": "between sensors and gate", + "repos": [ + "Moissanite-Labs/weft" + ], + "status": "checked", + "note": "The byte layout of Weft's telemetry frame. Round trip tested here. The slot meanings are a proposal." + }, + { + "id": "W2", + "organ": "Signals", + "element": "Agent messages", + "where": "between agents and a scheduler", + "repos": [ + "Moissanite-Labs/abios", + "Moissanite-Labs/synbios" + ], + "status": "tested_code", + "note": "Compact formats with validators. Not connected to a plant." + }, + { + "id": "W3", + "organ": "Signals", + "element": "Parsers on the telemetry path", + "where": "every network boundary", + "repos": [ + "Proven-Commons/mqtt", + "Proven-Commons/cbor", + "Proven-Commons/ntp", + "Proven-Commons/protobuf" + ], + "status": "in_progress", + "note": "Candidates at Proven Commons. None is verified." + }, + { + "id": "R1", + "organ": "Reflex", + "element": "The gate", + "where": "at each controller and in the scheduler", + "repos": [ + "Moissanite-Labs/weft", + "Moissanite-Labs/weft-corpus" + ], + "status": "checked", + "note": "Weft's predicate, first written in the Terrafab documents as a fence for machines. It passes Weft's 15 vectors and runs here on plant numbers." + }, + { + "id": "R2", + "organ": "Reflex", + "element": "A machine-checked proof of the gate and of the loop built on it", + "where": "with the gate", + "repos": [ + "aska-physical/optifab", + "Proven-Commons/mission" + ], + "status": "checked", + "note": "formal/ proves eight theorems in Lean about an exact integer gate. The comparator accepts them under six kernels and Proven Commons bar items 2 to 6 pass. Item 1 is open: no reviewer has approved the specification, so it is not verified. Weft's own floating-point gate has no proof yet." + }, + { + "id": "R3", + "organ": "Reflex", + "element": "The loop that changes hardware and software together", + "where": "design office and scheduler", + "repos": [ + "aska-physical/optifab" + ], + "status": "checked", + "note": "Runs on a model of the plant. Every decision is made by the exact gate, recorded in a hash-chained ledger and replayed in Lean. No sensor, load or machine is involved." + }, + { + "id": "M1", + "organ": "Mind", + "element": "Adaptive models", + "where": "racks", + "repos": [ + "Moissanite-Labs/weft", + "Moissanite-Labs/weft-loom" + ], + "status": "tested_code", + "note": "Runs and is tested. No power or energy has been measured." + }, + { + "id": "M2", + "organ": "Mind", + "element": "Agents that use and operate the campus", + "where": "racks and operator consoles", + "repos": [ + "Moissanite-Labs/exo", + "Moissanite-Labs/exo-os" + ], + "status": "tested_code", + "note": "Exo itself was not read in this pass." + }, + { + "id": "M3", + "organ": "Mind", + "element": "Model weights stored at a few bits each", + "where": "racks", + "repos": [ + "Moissanite-Labs/siliquant" + ], + "status": "research", + "note": "Fewer bits per weight means less memory per model. No energy figure ties it to the plant." + }, + { + "id": "M4", + "organ": "Mind", + "element": "A chip that runs the net directly", + "where": "racks", + "repos": [ + "Moissanite-Labs/weft-corpus" + ], + "status": "idea", + "note": "The chip of the Terrafab documents. Weft's audit calls it not testable as stated." + }, + { + "id": "F1", + "organ": "Hands", + "element": "Machines that make the structure's own parts under the gate", + "where": "fabrication bay", + "repos": [ + "Moissanite-Labs/weft-corpus" + ], + "status": "idea", + "note": "The Terrafab loop. No machine is modelled. Process limits in the certificates, such as the Fe-SMA activation energy in funi-floors, could be its gate inputs." + }, + { + "id": "K1", + "organ": "Record and rules", + "element": "Certificates, pins and the lineage graph", + "where": "this repository", + "repos": [ + "aska-physical/optifab" + ], + "status": "checked", + "note": "Every input is pinned to a commit, file and line." + }, + { + "id": "K2", + "organ": "Record and rules", + "element": "Signed commands and contributions", + "where": "command channel", + "repos": [ + "Moissanite-Labs/synmerit" + ], + "status": "specified", + "note": "Needed before any scheduler may command a plant. Weft's telemetry hash is unkeyed." + }, + { + "id": "K3", + "organ": "Record and rules", + "element": "Preferences are not permissions", + "where": "operator interface", + "repos": [ + "Moissanite-Labs/ethos", + "Moissanite-Labs/siliconcordat" + ], + "status": "specified", + "note": "The gate can refuse a step. Only a person can authorise one." + }, + { + "id": "K4", + "organ": "Record and rules", + "element": "The evidence scale, and the rule that a person signs", + "where": "every claim", + "repos": [ + "Foundation-0/f0", + "Foundation-0/.github" + ], + "status": "rule", + "note": "Used for every status in this repository." + }, + { + "id": "K5", + "organ": "Record and rules", + "element": "The bar for calling software verified", + "where": "the gate and the parsers", + "repos": [ + "Proven-Commons/mission" + ], + "status": "rule", + "note": "The standard formal/ is built to, and the target for element W3." + }, + { + "id": "K6", + "organ": "Record and rules", + "element": "The group ethos: capture the work and pass it on", + "where": "every handoff", + "repos": [ + "aska-physical/.github" + ], + "status": "rule", + "note": "The reason for HANDOFF.md." + } + ], + "interfaces": [ + { + "id": "L1", + "from": "structure and plant", + "to": "sensors", + "status": "designed", + "note": "Designed for airflow and leaks. Missing for vibration and temperature." + }, + { + "id": "L2", + "from": "sensors", + "to": "plant frame", + "status": "missing", + "note": "No firmware reads a sensor into a frame." + }, + { + "id": "L3", + "from": "plant frame", + "to": "gate", + "status": "checked", + "note": "A decoded frame drives plant_gate and the contract check in verify.py." + }, + { + "id": "L4", + "from": "gate", + "to": "scheduler", + "status": "proposed", + "note": "The contract in the README. No scheduler exists." + }, + { + "id": "L5", + "from": "scheduler", + "to": "compute load", + "status": "missing", + "note": "Neither Weft nor Exo offers a way to shed or defer load, and neither measures energy." + }, + { + "id": "L6", + "from": "compute load", + "to": "heat, stores and sinks", + "status": "checked", + "note": "The load floor and the thermal budget, in steady state." + }, + { + "id": "L7", + "from": "stores and structure", + "to": "margins", + "status": "checked", + "note": "The margin vector from the certificates. It is static: no transient is modelled." + }, + { + "id": "L8", + "from": "gate", + "to": "fabrication machines", + "status": "idea", + "note": "In the Terrafab documents only." + }, + { + "id": "L9", + "from": "every step", + "to": "the record", + "status": "designed", + "note": "Certificates and pins are checked. Signed records are not connected." + }, + { + "id": "L10", + "from": "proposer", + "to": "gate and ledger", + "status": "checked", + "note": "The improvement loop: each proposed change to hardware or software is decided by the exact gate, logged and replayed in Lean. On a model only." + } + ], + "interface_statuses": [ + "checked", + "designed", + "proposed", + "idea", + "missing" + ], + "not_placed": [ + { + "repo": "aska-physical/cfrp-masts", + "why": "Masts and booms. No role in the reference campus." + }, + { + "repo": "Foundation-0/rigid-realizations", + "why": "Feeds cfrp-masts only." + }, + { + "repo": "aska-physical/graph-fab", + "why": "A README with no stated role yet." + }, + { + "repo": "Foundation-0/project-asma", + "why": "Feeds Weft's identifiability gate, which the unit does not use." + }, + { + "repo": "Foundation-0/math0", + "why": "A hub. It directs work and is not part of the structure." + }, + { + "repo": "Foundation-0/physics0", + "why": "A hub. It directs work and is not part of the structure." + }, + { + "repo": "aska-physical/dock", + "why": "The organisation's hub page." + }, + { + "repo": "Moissanite-Labs/exofab", + "why": "A hub for forming teams, outside the structure." + }, + { + "repo": "Moissanite-Labs/.github", + "why": "The organisation's profile." + } + ] +} diff --git a/data/upstream/MANIFEST.json b/data/upstream/MANIFEST.json new file mode 100644 index 0000000..ced46df --- /dev/null +++ b/data/upstream/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "schema": "optifab-manifest/1", + "note": "Byte-exact copies of upstream inputs. verify.py refuses to run if a hash differs. invariants.py is Weft's own gate, used only as the oracle of a differential test.", + "files": [ + { + "id": "funi-frame", + "repo": "aska-physical/funi-frame", + "commit": "97b326d237de5e03a2a227a02f32121005109fb8", + "path": "results/certificate.json", + "file": "aska-physical/funi-frame/certificate.json", + "sha256": "92e7bbcea389274d2967e463ec3881ec9311db7786c5e74559defcd936dfb9fa", + "licence": "No licence file upstream. Same organisation." + }, + { + "id": "funi-floors", + "repo": "aska-physical/funi-floors", + "commit": "00eba18ceea0adf69f7dc12ca47d151622faa32a", + "path": "results/certificate.json", + "file": "aska-physical/funi-floors/certificate.json", + "sha256": "85878c416fed3c290c1321ec0dc27af5a152d8ca4d264b8f802add2e5995d186", + "licence": "No licence file upstream. Same organisation." + }, + { + "id": "venturi-collars", + "repo": "aska-physical/venturi-collars", + "commit": "d53f85a35d17a7bd46d0b5320c8879fc9f381978", + "path": "results/certificate.json", + "file": "aska-physical/venturi-collars/certificate.json", + "sha256": "c93eb98b2431b2b733cb1702594c5dc1e00a77fc811d663cea561f20cb0c0170", + "licence": "No licence file upstream. Same organisation." + }, + { + "id": "weft-vectors", + "repo": "Moissanite-Labs/weft", + "commit": "df4f9fa45640d7ee840f4529025a9a556d98684c", + "path": "weft/runtime/invariants/vectors.json", + "file": "Moissanite-Labs/weft/vectors.json", + "sha256": "bdc25776f32b0ed0cdaab4e413bed4a906f20193536724e60a7fba09c9965bcf", + "licence": "Apache-2.0. Copyright 2026 Moissanite Labs and the Weft contributors. See NOTICE." + }, + { + "id": "weft-gate-oracle", + "repo": "Moissanite-Labs/weft", + "commit": "df4f9fa45640d7ee840f4529025a9a556d98684c", + "path": "weft/runtime/invariants/invariants.py", + "file": "Moissanite-Labs/weft/invariants.py", + "sha256": "1064b0f8170c7b4dd2099a9412df2b50f301da003d61a5b07f842f26646612e4", + "licence": "Apache-2.0. Copyright 2026 Moissanite Labs and the Weft contributors. See NOTICE." + } + ] +} diff --git a/data/upstream/Moissanite-Labs/weft/invariants.py b/data/upstream/Moissanite-Labs/weft/invariants.py new file mode 100644 index 0000000..f0af8ca --- /dev/null +++ b/data/upstream/Moissanite-Labs/weft/invariants.py @@ -0,0 +1,311 @@ +#!/usr/bin/env python3 +""" +Weft Invariants Gate (Codebase C2 — Interface I3) +================================================= +Pure, zero-side-effect safety predicates shared across: + - C1 (`weft/runtime/plasm/`): mitotic weight update gate + - C3 (`weft/runtime/ic/`): metabolic valve reduction gate + - C5 (`weft/runtime/gateway/`): off-chain excision monitor + +Provenance: + - Repaired from `weft/terrafab-calc.md:50-100` (C header) and `weft/README.md:389-504`. + - Fixes Issue #2 (saved-baseline distance `||W_cand - W_base||_F <= r_invariant` + instead of the compared-sizes trap `| ||W_cand|| - ||W_base|| |`) and M6 + (pre-check `budget >= cost > 0` before decrementing budget; reject NaN/Inf). +""" + +from __future__ import annotations + +import json +import math +from pathlib import Path +from typing import Any, Dict, Iterable, Optional, Sequence, Tuple + +R_INVARIANT: float = 120.0 +TENSION_MAX: float = 85.0 +HOMEOSTATIC_TENSION_MIN: float = 15.0 +HOMEOSTATIC_TENSION_MAX: float = 35.0 +ROYALTY_UPSTREAM_BPS: int = 1500 +ROYALTY_WEAVER_BPS: int = 8500 + +VECTORS_PATH = Path(__file__).resolve().parent / "vectors.json" + + +def _flatten_floats(arr: Any) -> Iterable[float]: + """Flatten nested lists, numpy arrays, or torch tensors into Python floats.""" + if hasattr(arr, "detach"): + arr = arr.detach().cpu().reshape(-1).tolist() + elif hasattr(arr, "reshape"): + arr = arr.reshape(-1).tolist() + if isinstance(arr, (list, tuple)): + for item in arr: + if isinstance(item, (list, tuple)): + yield from _flatten_floats(item) + elif isinstance(item, str): + yield float(item) + else: + yield float(item) + else: + yield float(arr) + + +def _f32_bits(val: float) -> int: + import struct + return struct.unpack(" Tuple[bool, float]: + """Neumaier scaled binary64 accumulation matching `weft_frobenius_distance_masked_f64`.""" + scale = 0.0 + ssq = 1.0 + comp = 0.0 + for i, (b, c) in enumerate(zip(baseline_w, candidate_w)): + if not (math.isfinite(b) and math.isfinite(c)): + return False, float("inf") + if locked_mask is not None and int(locked_mask[i]) != 0: + if not (b == 0.0 and c == 0.0): + if _f32_bits(b) != _f32_bits(c): + return False, float("inf") + continue + abs_diff = abs(float(c) - float(b)) + if abs_diff == 0.0: + continue + if scale < abs_diff: + ratio = scale / abs_diff + ratio_sq = ratio * ratio + ssq = 1.0 + ssq * ratio_sq + comp = comp * ratio_sq + scale = abs_diff + else: + ratio = abs_diff / scale + term = ratio * ratio + t = ssq + term + comp += (ssq - t) + term if abs(ssq) >= term else (term - t) + ssq + ssq = t + dist = 0.0 if scale == 0.0 else scale * math.sqrt(ssq + comp) + if not math.isfinite(dist): + return False, float("inf") + return True, dist + + +def verify_weight_update_safety_ex( + baseline_w: Any, + candidate_w: Any, + r_invariant: float, + current_budget: float, + step_cost: float, + locked_mask: Optional[Sequence[int]] = None, +) -> Tuple[bool, float, float, str]: + """ + Evaluate the baseline-relative Frobenius distance and metabolic budget gate. + + Returns `(accepted, baseline_distance, remaining_budget, reason)`. + Notice that on rejection due to weight safety, non-finite values, or a + non-positive step_cost, the caller's budget is not consumed + (`remaining_budget == current_budget`). A negative cost therefore cannot + mint budget. On a non-positive current_budget, a negative radius, or a + budget underflow, remaining_budget reports `current_budget - step_cost` + so callers can inspect the deficit. + """ + b_val = float(current_budget) + c_val = float(step_cost) + r_val = float(r_invariant) + + if not (math.isfinite(b_val) and math.isfinite(c_val) and math.isfinite(r_val)): + return False, float("inf"), float("nan"), "non_finite_parameters" + if c_val <= 0.0: + return False, float("inf"), b_val, "non_positive_budget_or_cost" + if b_val <= 0.0 or r_val < 0.0: + return False, float("inf"), b_val - c_val, "non_positive_budget_or_cost" + if b_val < c_val: + return False, float("inf"), b_val - c_val, "insufficient_metabolic_budget" + + # Fast path for torch tensors when available (unmasked only; shared JSON mask cases use lists) + if locked_mask is None and hasattr(baseline_w, "detach") and hasattr(candidate_w, "detach"): + import torch + if baseline_w.shape != candidate_w.shape or baseline_w.numel() == 0: + return False, float("inf"), b_val, "shape_mismatch" + if not bool(torch.isfinite(baseline_w).all().item() and torch.isfinite(candidate_w).all().item()): + return False, float("inf"), b_val, "non_finite_weights" + # Subtract and accumulate in float64, as the list path does. In float32 the + # norm can round a move that is over the radius down to an accept (#213). + # On CPU, because MPS tensors cannot convert to float64. + diff = candidate_w.detach().cpu().to(torch.float64) - baseline_w.detach().cpu().to(torch.float64) + dist = float(torch.linalg.norm(diff).item()) + if not math.isfinite(dist): + return False, float("inf"), b_val, "non_finite_weights" + if dist > r_val: + return False, dist, b_val, "baseline_distance_exceeded" + return True, dist, b_val - c_val, "ok" + + base_flat = list(_flatten_floats(baseline_w)) + cand_flat = list(_flatten_floats(candidate_w)) + if len(base_flat) != len(cand_flat) or len(base_flat) == 0: + return False, float("inf"), b_val, "shape_mismatch" + if locked_mask is not None and len(locked_mask) != len(base_flat): + return False, float("inf"), b_val, "shape_mismatch" + + if locked_mask is None: + sq_sum = 0.0 + for b_elem, c_elem in zip(base_flat, cand_flat): + if not (math.isfinite(b_elem) and math.isfinite(c_elem)): + return False, float("inf"), b_val, "non_finite_weights" + diff = c_elem - b_elem + sq_sum += diff * diff + dist = math.sqrt(sq_sum) + dist_ok = math.isfinite(dist) + else: + dist_ok, dist = _masked_frobenius_distance_f64(base_flat, cand_flat, locked_mask) + + if not dist_ok: + return False, float("inf"), b_val, "non_finite_weights" + dist_out = float(dist) + if dist > float(r_val): + return False, dist_out, b_val, "baseline_distance_exceeded" + + return True, dist_out, b_val - c_val, "ok" + + +def _frobenius_norm(arr: Any) -> float: + if hasattr(arr, "detach"): + import torch + return float(torch.linalg.norm(arr.detach().cpu().to(torch.float64)).item()) + vals = list(_flatten_floats(arr)) + return math.sqrt(sum(v * v for v in vals)) + + +def verify_weight_update_safety( + baseline_weights: Any, + current_weights: Any, + candidate_weights: Any, + remaining_budget: float, + update_cost: float, + max_baseline_distance: float = R_INVARIANT, +) -> Dict[str, Any]: + """ + Refuse a weight update unless the remaining budget is finite and positive, + the candidate is numeric, and drift is measured from the stored baseline + (not the size delta between current and candidate weights). + """ + compared_sizes = abs( + _frobenius_norm(candidate_weights) - _frobenius_norm(current_weights) + ) + + if not math.isfinite(remaining_budget): + return { + "accepted": False, + "reason": "remaining_budget_not_finite", + "compared_sizes": compared_sizes, + "remaining_budget": remaining_budget, + } + if remaining_budget <= 0: + return { + "accepted": False, + "reason": "remaining_budget_exhausted", + "compared_sizes": compared_sizes, + "remaining_budget": remaining_budget, + } + if not math.isfinite(update_cost) or update_cost <= 0: + return { + "accepted": False, + "reason": "update_cost_not_finite", + "compared_sizes": compared_sizes, + "remaining_budget": remaining_budget, + } + + accepted, dist, rem, reason = verify_weight_update_safety_ex( + baseline_weights, + candidate_weights, + max_baseline_distance, + remaining_budget, + update_cost, + ) + if reason == "non_finite_weights": + return { + "accepted": False, + "reason": "baseline_distance_not_finite", + "compared_sizes": compared_sizes, + "baseline_distance": float("nan"), + "remaining_budget": remaining_budget, + } + if reason == "insufficient_metabolic_budget": + return { + "accepted": False, + "reason": "remaining_budget_underflow", + "compared_sizes": compared_sizes, + "baseline_distance": dist, + "remaining_budget": rem, + } + if not accepted: + return { + "accepted": False, + "reason": reason, + "compared_sizes": compared_sizes, + "baseline_distance": dist, + "remaining_budget": remaining_budget, + } + return { + "accepted": True, + "reason": "ok", + "compared_sizes": compared_sizes, + "baseline_distance": dist, + "remaining_budget": rem, + } + + +def verify_tension_bound( + tension: float, + max_tension: float = TENSION_MAX, + homeostatic_min: float = HOMEOSTATIC_TENSION_MIN, + homeostatic_max: float = HOMEOSTATIC_TENSION_MAX, +) -> Dict[str, Any]: + """Check whether organizational/cellular tension is within the invariant bound.""" + t_val = float(tension) + m_val = float(max_tension) + if not (math.isfinite(t_val) and math.isfinite(m_val)) or t_val < 0.0: + return { + "accepted": False, + "homeostatic": False, + "excision_triggered": True, + "tension": t_val, + "max_tension": m_val, + "reason": "negative_or_non_finite_tension", + } + accepted = t_val <= m_val + homeostatic = homeostatic_min <= t_val <= homeostatic_max + return { + "accepted": accepted, + "homeostatic": homeostatic, + "excision_triggered": not accepted, + "tension": t_val, + "max_tension": m_val, + "reason": "ok" if accepted else "tension_exceeds_max", + } + + +def compute_royalty_split( + gross_wei: int, + upstream_bps: int = ROYALTY_UPSTREAM_BPS, +) -> Dict[str, int]: + """Compute the 15% upstream / 85% weaver metabolic valve split in integer wei.""" + gross = int(gross_wei) + bps = int(upstream_bps) + if gross < 0 or not (0 <= bps <= 10000): + raise ValueError("gross_wei must be >= 0 and upstream_bps in [0, 10000]") + upstream = (gross * bps) // 10000 + weaver = gross - upstream + return { + "gross_wei": gross, + "upstream_bps": bps, + "upstream_wei": upstream, + "weaver_wei": weaver, + } + + +def load_conformance_vectors() -> Dict[str, Any]: + with VECTORS_PATH.open("r", encoding="utf-8") as fh: + return json.load(fh) diff --git a/data/upstream/Moissanite-Labs/weft/vectors.json b/data/upstream/Moissanite-Labs/weft/vectors.json new file mode 100644 index 0000000..b6a9d05 --- /dev/null +++ b/data/upstream/Moissanite-Labs/weft/vectors.json @@ -0,0 +1,433 @@ +{ + "schema": "WEFT-INVARIANTS/1.0", + "constants": { + "R_INVARIANT": 120.0, + "TENSION_MAX": 85.0, + "HOMEOSTATIC_TENSION_MIN": 15.0, + "HOMEOSTATIC_TENSION_MAX": 35.0, + "ROYALTY_UPSTREAM_BPS": 1500, + "ROYALTY_WEAVER_BPS": 8500 + }, + "weight_update_vectors": [ + { + "name": "matching_sizes_large_move", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + -1.0, + 0.0, + 0.0, + -1.0 + ], + "r_invariant": 0.5, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": 2.8284271247461903, + "expected_remaining_budget": 10.0, + "expected_reason": "baseline_distance_exceeded" + }, + { + "name": "valid_small_move", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + 1.1, + 0.0, + 0.0, + 0.9 + ], + "r_invariant": 0.5, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": true, + "expected_distance": 0.14142135623730953, + "expected_remaining_budget": 9.0, + "expected_reason": "ok" + }, + { + "name": "valid_exact_radius_and_budget", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + 1.5, + 0.0, + 0.0, + 1.0 + ], + "r_invariant": 0.5, + "budget": 1.0, + "cost": 1.0, + "expected_accepted": true, + "expected_distance": 0.5, + "expected_remaining_budget": 0.0, + "expected_reason": "ok" + }, + { + "name": "reject_nan_candidate", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + "NaN", + 0.0, + 0.0, + 1.0 + ], + "r_invariant": 10.0, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": 10.0, + "expected_reason": "non_finite_weights" + }, + { + "name": "reject_inf_candidate", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + "Inf", + 0.0, + 0.0, + 1.0 + ], + "r_invariant": 10.0, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": 10.0, + "expected_reason": "non_finite_weights" + }, + { + "name": "reject_insufficient_budget", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + 1.05, + 0.0, + 0.0, + 1.0 + ], + "r_invariant": 0.5, + "budget": 0.5, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": -0.5, + "expected_reason": "insufficient_metabolic_budget" + }, + { + "name": "reject_non_positive_budget", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + 1.05, + 0.0, + 0.0, + 1.0 + ], + "r_invariant": 0.5, + "budget": 0.0, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": -1.0, + "expected_reason": "non_positive_budget_or_cost" + }, + { + "name": "reject_negative_cost", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + 1.05, + 0.0, + 0.0, + 1.0 + ], + "r_invariant": 0.5, + "budget": 10.0, + "cost": -1.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": 10.0, + "expected_reason": "non_positive_budget_or_cost" + }, + { + "name": "reject_zero_cost", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + 1.05, + 0.0, + 0.0, + 1.0 + ], + "r_invariant": 0.5, + "budget": 10.0, + "cost": 0.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": 10.0, + "expected_reason": "non_positive_budget_or_cost" + }, + { + "name": "reject_negative_radius", + "baseline": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "candidate": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "r_invariant": -0.25, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": 9.0, + "expected_reason": "non_positive_budget_or_cost" + }, + { + "name": "reject_empty_weights", + "baseline": [], + "candidate": [], + "r_invariant": 0.5, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": 10.0, + "expected_reason": "shape_mismatch" + }, + { + "name": "reject_pre_cast_radius_boundary", + "baseline": [ + 0.0, + 0.0 + ], + "candidate": [ + 120.0, + 0.02683282 + ], + "r_invariant": 120.0, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": 120.0000030000011, + "expected_remaining_budget": 10.0, + "expected_reason": "baseline_distance_exceeded" + }, + { + "name": "accept_huge_scale_weight_move", + "baseline": [ + 0.0, + 0.0 + ], + "candidate": [ + 1e25, + 0.0 + ], + "r_invariant": 1e26, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": true, + "expected_distance": 1e25, + "expected_remaining_budget": 9.0, + "expected_reason": "ok" + }, + { + "name": "reject_locked_mask_ulp_tamper", + "baseline": [ + 1.0, + 0.0, + 2.0, + 3.0 + ], + "candidate": [ + 1.0000001192092896, + 0.0, + 2.5, + 3.0 + ], + "locked_mask": [ + 1, + 1, + 0, + 0 + ], + "r_invariant": 120.0, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": false, + "expected_distance": "Inf", + "expected_remaining_budget": 10.0, + "expected_reason": "non_finite_weights" + }, + { + "name": "accept_locked_mask_negzero_normalize", + "baseline": [ + 1.0, + 0.0, + 2.0, + 3.0 + ], + "candidate": [ + 1.0, + -0.0, + 2.5, + 3.0 + ], + "locked_mask": [ + 1, + 1, + 0, + 0 + ], + "r_invariant": 120.0, + "budget": 10.0, + "cost": 1.0, + "expected_accepted": true, + "expected_distance": 0.5, + "expected_remaining_budget": 9.0, + "expected_reason": "ok" + } + ], + "tension_vectors": [ + { + "name": "tension_zero_boundary", + "tension": 0.0, + "max_tension": 85.0, + "expected_accepted": true, + "expected_homeostatic": false, + "expected_excision": false + }, + { + "name": "tension_homeostatic_min_exact", + "tension": 15.0, + "max_tension": 85.0, + "expected_accepted": true, + "expected_homeostatic": true, + "expected_excision": false + }, + { + "name": "tension_homeostatic", + "tension": 28.5, + "max_tension": 85.0, + "expected_accepted": true, + "expected_homeostatic": true, + "expected_excision": false + }, + { + "name": "tension_homeostatic_max_exact", + "tension": 35.0, + "max_tension": 85.0, + "expected_accepted": true, + "expected_homeostatic": true, + "expected_excision": false + }, + { + "name": "tension_boundary_exact", + "tension": 85.0, + "max_tension": 85.0, + "expected_accepted": true, + "expected_homeostatic": false, + "expected_excision": false + }, + { + "name": "tension_exceeds_bound", + "tension": 85.01, + "max_tension": 85.0, + "expected_accepted": false, + "expected_homeostatic": false, + "expected_excision": true + }, + { + "name": "tension_negative", + "tension": -0.1, + "max_tension": 85.0, + "expected_accepted": false, + "expected_homeostatic": false, + "expected_excision": true + }, + { + "name": "tension_nan", + "tension": "NaN", + "max_tension": 85.0, + "expected_accepted": false, + "expected_homeostatic": false, + "expected_excision": true + } + ], + "royalty_vectors": [ + { + "name": "zero_wei", + "gross_wei": 0, + "upstream_bps": 1500, + "expected_upstream_wei": 0, + "expected_weaver_wei": 0 + }, + { + "name": "single_wei_dust", + "gross_wei": 1, + "upstream_bps": 1500, + "expected_upstream_wei": 0, + "expected_weaver_wei": 1 + }, + { + "name": "standard_10000_wei", + "gross_wei": 10000, + "upstream_bps": 1500, + "expected_upstream_wei": 1500, + "expected_weaver_wei": 8500 + }, + { + "name": "odd_amount_rounding", + "gross_wei": 1001, + "upstream_bps": 1500, + "expected_upstream_wei": 150, + "expected_weaver_wei": 851 + } + ] +} diff --git a/data/upstream/aska-physical/funi-floors/certificate.json b/data/upstream/aska-physical/funi-floors/certificate.json new file mode 100644 index 0000000..34755e5 --- /dev/null +++ b/data/upstream/aska-physical/funi-floors/certificate.json @@ -0,0 +1,131 @@ +{ + "aci318_punching_collar_313psf": { + "baseline_250mm_pt_uncollared_fails": { + "Vu_313psf_kN": 2608.07, + "active_collar_passes": false, + "b0_mm": 2840.0, + "d_eff_flush_corner_mm": 210.0, + "phi_Vc_uncollared_kN": 933.56, + "phi_Vn_active_collar_kN": 767.42, + "uncollared_passes": false, + "utilization_active_collar": 3.3985 + }, + "funi_floor_with_collar": { + "Vu_313psf_kN": 2208.02, + "active_collar_passes": true, + "b0_mm": 3340.0, + "d_eff_flush_corner_mm": 335.0, + "phi_Vc_uncollared_kN": 1810.33, + "phi_Vn_active_collar_kN": 2756.4, + "uncollared_passes": false, + "utilization_active_collar": 0.8011 + } + }, + "certificate_version": "0.1.0", + "dg11_vibration_benchmark": { + "active_prestressed_cassette": { + "W_modal_kN": 153.39, + "ap_pct_g": 0.308, + "fn_Hz": 8.624, + "harmonic_cutoff_Hz": 8.0, + "office_limit_pct_g": 0.5, + "passes_dg11_office_and_server": true + }, + "passive_cracked_shell_fails": { + "W_modal_kN": 153.39, + "ap_pct_g": 2.4154, + "fn_Hz": 3.261, + "harmonic_cutoff_Hz": 8.0, + "office_limit_pct_g": 0.5, + "passes_dg11_office_and_server": false + } + }, + "embodied_carbon_and_eis_leak_twin": { + "ai_datacenter_310mm_pt_kgCO2e_m2": 120.6, + "ai_datacenter_313psf_funi_kgCO2e_m2": 38.79, + "ai_datacenter_carbon_reduction_pct": 67.84, + "eis_50khz_coolant_leak_reactance_shift_pct": 46.16, + "eis_50khz_rack_load_crosstalk_pct": 0.0, + "office_250mm_pt_kgCO2e_m2": 92.0, + "office_50psf_funi_kgCO2e_m2": 20.36, + "office_carbon_reduction_pct": 77.87 + }, + "funicular_cassette_9mx3m_313psf": { + "EI_2way_dyn_MNm2_per_m": 58.758, + "H_arch_service_kN": 1894.74, + "H_arch_uls_kN": 2856.82, + "M_crown_residual_service_kNm": 4.119, + "V_quarter_mep_demand_uls_kN": 185.6, + "concrete_rupture_modulus_fr_MPa": 4.384, + "concrete_volume_reduction_vs_310mm_pt_pct": 76.11, + "dead_mass_kg_m2": 195.12, + "dead_mass_reduction_vs_744kg_pt_pct": 73.77, + "equivalent_concrete_thickness_mm": 74.07, + "fc_crown_service_MPa": 13.669, + "fc_service_limit_0.45fc_MPa": 22.5, + "fe_sma_recovery_stress_MPa": 423.47, + "joule_activation_energy_kWh_m2": 0.3227, + "joule_activation_energy_per_27m2_cassette_kWh": 8.712, + "passive_gfrp_tie_crown_tensile_stress_MPa": 188.79, + "phi_V_45deg_octagonal_mep_hole_kN": 373.48, + "phi_V_unbraced_mep_hole_kN": 22.5, + "story_height_saved_vs_pt_plenum_mm": 280.0 + }, + "iso834_120min_fire_crossover": { + "H_cap_epoxy_only_120min_kN": 345.6, + "H_cap_hybrid_fesma_mortar_120min_kN": 3902.95, + "H_fire_120min_demand_kN": 1171.96, + "T_protected_channel_120min_C": 427.6, + "T_unprotected_20mm_epoxy_120min_C": 840.2, + "epoxy_only_survives_120min": false, + "hybrid_fesma_survives_120min": true + }, + "must_fail_controls": [ + { + "control": "passive_low_modulus_tie_prevents_funicular_crown_cracking", + "rejected": true + }, + { + "control": "unbraced_200mm_rib_duct_hole_carries_quarter_span_uls_shear", + "rejected": true + }, + { + "control": "lightweight_cracked_shell_passes_dg11_walking_vibration_without_active_tie", + "rejected": true + }, + { + "control": "uncollared_250mm_flat_slab_survives_313psf_ai_datacenter_punching_shear", + "rejected": true + }, + { + "control": "uncollared_funicular_column_seat_survives_313psf_without_active_collar", + "rejected": true + }, + { + "control": "epoxy_bonded_cfrp_without_fesma_mortar_survives_120min_iso834_fire", + "rejected": true + }, + { + "control": "crown_service_compression_exceeds_aci_0.45fc_sustained_limit", + "rejected": true + }, + { + "control": "joule_heating_activation_exceeds_0.5_kwh_per_m2_floor_area", + "rejected": true + }, + { + "control": "rack_axial_load_corrupts_50khz_eis_coolant_leak_detection", + "rejected": true + }, + { + "control": "funicular_sip_cassette_misses_65pct_embodied_carbon_reduction", + "rejected": true + } + ], + "repository": "aska-physical/funi-floors", + "symbolic_theorems": { + "dg11_critical_frequency_hz": "5.7143", + "elastic_arch_tie_compatibility": "H = (H_rigid + chi*P_SMA) / (1 + chi)", + "funicular_zero_moment_identity": "M_beam(x) - (q*L^2/(8*f))*z(x) == 0" + } +} diff --git a/data/upstream/aska-physical/funi-frame/certificate.json b/data/upstream/aska-physical/funi-frame/certificate.json new file mode 100644 index 0000000..c51dc15 --- /dev/null +++ b/data/upstream/aska-physical/funi-frame/certificate.json @@ -0,0 +1,102 @@ +{ + "repository": "aska-physical/funi-frame", + "version": "0.1.0", + "symbolic_theorems": { + "hysteretic_vs_viscous_rolloff": "lim_{r->oo} r*T_hyst = 0 (O(r^-2)) vs. lim_{r->oo} r*T_visc = 2*zeta (O(r^-1))", + "thermal_bridge_amplification": "U_eff / U_core = 1 + rho_pin * (k_pin / k_ins - 1)", + "pcm_volumetric_gain_identity": "E_tank / E_water = (1 - phi) + phi * rho_p * (cp_p*dT + L_f) / (rho_w*cp_w*dT)", + "self_cooling_liquid_capture_threshold": "alpha_liq* = 1 / (1 + COP_ads)" + }, + "domain_1_funicular_radiative_roof": { + "span_m": 24.0, + "vault_depth_mm": 1480.0, + "span_to_rise_ratio": 17.78, + "plenum_height_saved_vs_2400mm_deep_truss_mm": 920.0, + "dead_mass_kg_m2": 219.32, + "mass_reduction_vs_460kg_ballasted_roof_pct": 52.32, + "H_service_kN": 2181.65, + "fc_crown_MPa": 9.6, + "fc_allow_service_MPa": 24.75, + "ft_crown_passive_gfrp_MPa": 266.03, + "delta_vault_mm": 11.74, + "span_over_delta_vault": 2043.6, + "span_over_delta_ipe600_rafter": 71.6, + "tornado_net_uplift_kN": 307.03, + "tornado_tiedown_capacity_kN": 783.0, + "U_roof_W_m2K": 0.1234, + "R_value_imperial": 46.0, + "noon_radiative_sky_cooling_W_m2": 93.0 + }, + "domain_2_vibro_thermal_sandwich_wall": { + "wall_mass_kg_m2": 159.66, + "mass_reduction_vs_368kg_tiltup_pct": 56.61, + "U_wall_cfrp_W_m2K": 0.1316, + "R_wall_imperial": 43.2, + "U_wall_steel_pcsp_W_m2K": 2.307, + "nrc_poraver_helmholtz": 0.72, + "hall_reverberant_noise_reduction_dBA": 10.97, + "stc_community_rating_dB": 60.1, + "passive_ride_through_with_mpcm_min": 28.3, + "passive_ride_through_air_only_min": 1.78 + }, + "domain_3_broadband_vibration_cascade": { + "oem_switch_limit_g_rms": 0.0005, + "rack_g_rms_funi_frame": 9e-05, + "rack_g_rms_conventional_steel": 0.137, + "oem_utilization_pct": 17.91, + "isolation_improvement_vs_steel_dB": -63.69 + }, + "domain_4_top_down_seismic_cellular_frame": { + "total_building_height_m": 12.38, + "height_saved_vs_conv_m": 2.02, + "structural_dead_mass_tonnes": 1431.4, + "conv_structural_dead_mass_tonnes": 4069.8, + "structural_dead_mass_reduction_pct": 64.83, + "seismic_base_shear_aska_kN": 10118.9, + "seismic_base_shear_reduction_pct": 44.23, + "top_down_story_drift_aska_pct": 0.563, + "top_down_story_drift_conv_unbraced_pct": 4.359, + "risk_cat_iv_drift_limit_pct": 1.0 + }, + "domain_5_6_three_tier_tes_and_closed_loop_cooling": { + "P_it_MW": 10.0, + "Q_liquid_w45_MW": 8.5, + "Q_air_rdhx_MW": 1.5, + "alpha_liq_critical_for_self_cooling": 0.6173, + "Q_drive_for_adsorption_MW": 2.419, + "adsorption_self_cools_air_load": true, + "cop_ads_at_32C_air_exhaust": 0.0, + "pcm_ride_through_volume_m3": 83.33, + "water_equivalent_volume_m3": 217.39, + "water_only_ride_through_in_same_volume_min": 5.75, + "basalt_battery_volume_m3": 88.68, + "basalt_media_mass_tonnes": 117.06, + "basalt_media_cost_usd": 14046.0, + "annualized_capex_basalt_usd_kWh": 0.014, + "annualized_capex_liion_usd_kWh": 0.068, + "Q_energy_piles_MW": 0.25, + "Q_sky_roof_peak_MW": 0.232, + "PUE_conventional": 1.38, + "PUE_funi_frame": 1.074, + "cooling_electricity_reduction_pct": 85.05, + "WUE_funi_frame_L_per_kWh": 0.0, + "potable_water_saved_million_L_yr": 157.68, + "freed_substation_power_MW": 3.06, + "unlocked_annual_revenue_low_M_usd": 76.62 + }, + "must_fail_controls": { + "must_fail_01_rolled_steel_24m_rafter_fails_deflection": true, + "must_fail_02_passive_gfrp_roof_tie_cracks_crown": true, + "must_fail_03_tornado_uplift_resisted_without_ballast": true, + "must_fail_04_steel_wythe_pins_fail_thermal_bridge_gate": true, + "must_fail_05_bare_concrete_fails_hall_acoustic_absorption": true, + "must_fail_06_unbuffered_air_fails_ups_thermal_ridethrough": true, + "must_fail_07_undamped_steel_exceeds_0p0005g_switch_limit": true, + "must_fail_08_top_heavy_unbraced_frame_fails_risk_cat_iv_drift": true, + "must_fail_09_plain_water_fails_compact_15min_ridethrough": true, + "must_fail_10_liion_exceeds_thermal_arbitrage_capex_ceiling": true, + "must_fail_11_low_grade_air_exhaust_cannot_drive_adsorption": true, + "must_fail_12_evaporative_plant_fails_zero_water_and_pue_gate": true + }, + "controls_passed": "12/12" +} diff --git a/data/upstream/aska-physical/venturi-collars/certificate.json b/data/upstream/aska-physical/venturi-collars/certificate.json new file mode 100644 index 0000000..7776a2e --- /dev/null +++ b/data/upstream/aska-physical/venturi-collars/certificate.json @@ -0,0 +1,80 @@ +{ + "certificate_version": "1.0.0", + "duct_geometry": { + "diam_mm": 200, + "diffuser_half_angle_deg": 7.0, + "reeds": 6, + "throat_area_ratio_beta": 0.64 + }, + "hybrid_cfrp_pcb_coil_sweep": [ + { + "P_fluid_loss_mW": 18.49, + "P_piezo_only_mW": 0.0031, + "P_total_harvested_mW": 0.104, + "U_crit_throat_m_s": 2.233, + "U_duct_m_s": 1.8, + "U_throat_m_s": 2.812, + "dP_total_Pa": 0.327, + "f_flutter_Hz": 5.32, + "peak_cfrp_strain_pct": 0.0098 + }, + { + "P_fluid_loss_mW": 49.54, + "P_piezo_only_mW": 0.011, + "P_total_harvested_mW": 0.3652, + "U_crit_throat_m_s": 2.233, + "U_duct_m_s": 2.5, + "U_throat_m_s": 3.906, + "dP_total_Pa": 0.631, + "f_flutter_Hz": 5.32, + "peak_cfrp_strain_pct": 0.0183 + }, + { + "P_fluid_loss_mW": 202.91, + "P_piezo_only_mW": 0.0277, + "P_total_harvested_mW": 0.9244, + "U_crit_throat_m_s": 2.233, + "U_duct_m_s": 4.0, + "U_throat_m_s": 6.25, + "dP_total_Pa": 1.615, + "f_flutter_Hz": 5.32, + "peak_cfrp_strain_pct": 0.0292 + }, + { + "P_fluid_loss_mW": 684.81, + "P_piezo_only_mW": 0.0277, + "P_total_harvested_mW": 0.9244, + "U_crit_throat_m_s": 2.233, + "U_duct_m_s": 6.0, + "U_throat_m_s": 9.375, + "dP_total_Pa": 3.633, + "f_flutter_Hz": 5.32, + "peak_cfrp_strain_pct": 0.0292 + } + ], + "must_fail_controls": [ + { + "control": "harvested_power_violates_first_law_fluid_work", + "rejected": true + }, + { + "control": "pure_pvdf_film_alone_meets_150uW_continuous_co2_node_at_4ms", + "rejected": true + }, + { + "control": "unaccelerated_straight_duct_starts_at_1.5ms_turndown", + "rejected": true + }, + { + "control": "abrupt_45deg_baffle_meets_15Pa_hvac_static_pressure_limit", + "rejected": true + }, + { + "control": "reed_exceeds_m55j_0.8pct_ultimate_strain_at_6ms", + "rejected": true + } + ], + "pure_pvdf_4ms_negative_finding_mW": 0.0476, + "repository": "aska-physical/venturi-collars", + "telemetry_power_margin_at_4ms_x": 11.55 +} diff --git a/docs/CONVERGENCE.md b/docs/CONVERGENCE.md new file mode 100644 index 0000000..160a928 --- /dev/null +++ b/docs/CONVERGENCE.md @@ -0,0 +1,240 @@ +# Convergence map + +Generated by `tools/render_map.py` from `data/graph.json`. Do not edit by hand. + +This is the work across aska-physical, Foundation-0, Moissanite-Labs and Proven-Commons that bears on a data centre and the intelligence it runs: 41 repositories and 43 links. Every link cites the line that states it, at a pinned commit. `python3 verify.py --upstream ROOT` re-reads every cited line. + +Each status below is the repository's own, in its own words or a close paraphrase. Where a repository does not use the Foundation-0 Ledger's words, the evidence level in the stack table was assigned here and says so. + +## The stack, layer by layer + +### L0. Mathematics and physics results + +| Repository | What it is | Status | Pinned | +|---|---|---|---| +| [Foundation-0/ductricity](https://github.com/Foundation-0/ductricity) | Project definition for harvesting energy at a duct wall. | Project definition only. No performance figure is claimed. ([ductricity/README.md:20](https://github.com/Foundation-0/ductricity/blob/0a178a01209b6b583408a861b2476e2308e1f053/README.md#L20)) | `0a178a0` | +| [Foundation-0/incentre-lattices](https://github.com/Foundation-0/incentre-lattices) | The incentre construction: rigidity, elastic constants, packing and folding results, with a locked verifier. | Preprint, version 3, not peer reviewed. ([incentre-lattices/README.md:48](https://github.com/Foundation-0/incentre-lattices/blob/2d374fff2a59cc9331566733043a4bb25c1040bf/README.md#L48)) | `2d374ff` | +| [Foundation-0/math0](https://github.com/Foundation-0/math0) | Mathematics hub. Holds the integer-multiplication studies and the code-table census. | Active hub. ([math0/README.md:3](https://github.com/Foundation-0/math0/blob/e649250ca32249affe52873a45d22e8bd5562624/README.md#L3)) | `e649250` | +| [Foundation-0/nhanes-bioimpedance](https://github.com/Foundation-0/nhanes-bioimpedance) | Refit of 13,276 public bioimpedance spectra; the source of the analyser's failure modes. | Pilot, claimed, not peer reviewed. ([nhanes-bioimpedance/README.md:18](https://github.com/Foundation-0/nhanes-bioimpedance/blob/efb3395b70e32ae96779a73454b2333b7e86c4d1/README.md#L18)) | `efb3395` | +| [Foundation-0/physics0](https://github.com/Foundation-0/physics0) | Physics hub. Lists open areas, including statistical physics on the incentre lattice and archived seismic networks. | Active hub. ([physics0/AREAS.md:74](https://github.com/Foundation-0/physics0/blob/913468f093f82d869dc58b404039ea0a416cfb80/AREAS.md#L74)) | `913468f` | +| [Foundation-0/point-charges](https://github.com/Foundation-0/point-charges) | Certified counts of equilibria of point charges (Maxwell's problem). | Claimed. Reviewed by an independent AI agent; not yet reviewed by a person. ([point-charges/NOTE.md:4](https://github.com/Foundation-0/point-charges/blob/a2fd159bccb24d2922a127ad83f28b9f44e2ceba/NOTE.md#L4)) | `a2fd159` | +| [Foundation-0/project-asma](https://github.com/Foundation-0/project-asma) | Open ovarian-cancer research workspace. Two of its theorems were adapted into Weft's identifiability gate, an earlier case of one organisation's results feeding another's code. | Working manuscript is a scaffold, not peer reviewed. ([project-asma/README.md:70](https://github.com/Foundation-0/project-asma/blob/48178217a88066212ec798a7e8031e6fc652493e/README.md#L70)) | `4817821` | +| [Foundation-0/rigid-realizations](https://github.com/Foundation-0/rigid-realizations) | Real realisation counts of minimally rigid frameworks. | Its headline counts are claimed, pending independent verification. ([rigid-realizations/README.md:20](https://github.com/Foundation-0/rigid-realizations/blob/298926c5e7a03683bb83165931ac38a94260166f/README.md#L20)) | `298926c` | +| [Foundation-0/thermal-capture](https://github.com/Foundation-0/thermal-capture) | Research direction on capturing low-grade heat. | Research direction only. No result is claimed. ([thermal-capture/README.md:28](https://github.com/Foundation-0/thermal-capture/blob/5fa678e94d2e6b1ace56d2cc7e4e0b0eae0a91af/README.md#L28)) | `5fa678e` | + +### L1. Materials and structure + +| Repository | What it is | Status | Pinned | +|---|---|---|---| +| [aska-physical/cfrp-masts](https://github.com/aska-physical/cfrp-masts) | Deployable CFRP booms and masts. | Certificate version 1.0.0 with 5 must-fail controls. The organisation profile lists it as v0.1.0. ([cfrp-masts/results/certificate.json:2](https://github.com/aska-physical/cfrp-masts/blob/a12b665f2baf32a8d6499ef39c296ef9fe78f630/results/certificate.json#L2)) | `a12b665` | +| [aska-physical/cfrp-strengthening](https://github.com/aska-physical/cfrp-strengthening) | Re-runnable ACI 440.2R beam strengthening example, the baseline cfrp-truss improves on. It was Foundation-0/cfrp-strengthening, and that address now leads here. | v1.0.0. Agent review recorded. No outside human engineering review. ([cfrp-strengthening/docs/review-ledger.md:12](https://github.com/aska-physical/cfrp-strengthening/blob/3f68cccf19556574b7652311be1b0dc0daa93144/docs/review-ledger.md#L12)) | `3f68ccc` | +| [aska-physical/cfrp-truss](https://github.com/aska-physical/cfrp-truss) | Truss-anchored CFRP strengthening of concrete beams. | v0.3.0. Certificate with 12 must-fail controls. ([cfrp-truss/README.md:37](https://github.com/aska-physical/cfrp-truss/blob/3c11631e223b71227531d10286abd71bc04d67b7/README.md#L37)) | `3c11631` | +| [aska-physical/fibral-rigidity](https://github.com/aska-physical/fibral-rigidity) | Stiffness limits of carbon-fibre truss lattices built on the incentre framework. | Claims labelled PROVEN and VERIFIED in the repository. Pull request 1 is merged; the org profile still lists it as awaiting sign-off. ([.github/profile/README.md:17](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L17)) | `0652052` | +| [aska-physical/funi-floors](https://github.com/aska-physical/funi-floors) | Funicular floor cassette for 313 psf rack loads, with an impedance leak sensor in the ribs. | v0.1.0. Certificate with 10 must-fail controls. No review is recorded. ([funi-floors/README.md:34](https://github.com/aska-physical/funi-floors/blob/00eba18ceea0adf69f7dc12ca47d151622faa32a/README.md#L34)) | `00eba18` | +| [aska-physical/graph-fab](https://github.com/aska-physical/graph-fab) | Research into graphene materials. | README only. ([graph-fab/README.md:2](https://github.com/aska-physical/graph-fab/blob/d669f233212ee0f2a7d59e60b0f3bdc9781f8a99/README.md#L2)) | `d669f23` | + +### L2. Shell and thermal plant + +| Repository | What it is | Status | Pinned | +|---|---|---|---| +| [aska-physical/funi-frame](https://github.com/aska-physical/funi-frame) | Data-centre shell and thermal plant for a 10 MW reference campus: roof, walls, vibration isolation, seismic frame, heat storage, sorption cooling. | v0.1.0. verify.py reproduces the certificate, 12/12 must-fail controls. No review or built plant is recorded. ([funi-frame/README.md:33](https://github.com/aska-physical/funi-frame/blob/97b326d237de5e03a2a227a02f32121005109fb8/README.md#L33)) | `97b326d` | +| [aska-physical/optifab](https://github.com/aska-physical/optifab) | This repository. One reference campus as a checked stack, with a contract between the plant and the workload. | v0.1.0, claimed. Written by an AI agent. No person has reviewed it. | this repository | + +### L3. Sensing + +| Repository | What it is | Status | Pinned | +|---|---|---|---| +| [aska-physical/impedence-analyzers](https://github.com/aska-physical/impedence-analyzers) | Seven-frequency impedance analyser for structural and leak sensing. | v0.1.0. Certificate with 5 must-fail controls. ([.github/profile/README.md:16](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L16)) | `ed0a5e1` | +| [aska-physical/venturi-collars](https://github.com/aska-physical/venturi-collars) | Battery-free airflow harvester that powers a duct sensor node. | v0.1.0. Certificate with 5 must-fail controls. No device built. ([.github/profile/README.md:15](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L15)) | `d53f85a` | + +### L4. Compute and adaptive models + +| Repository | What it is | Status | Pinned | +|---|---|---|---| +| [Moissanite-Labs/exo](https://github.com/Moissanite-Labs/exo) | The agent core: one agent, one memory, gated actions. Not read in this pass. | Early implementation (from the organisation profile). | named only, not read | +| [Moissanite-Labs/exo-os](https://github.com/Moissanite-Labs/exo-os) | Exo as a whole operating system image. Its hardware notes quote small-device power figures from outside sources. | v0.1.0. Host tests pass; hardware figures are cited, not measured. ([exo-os/research/04-small-hardware.md:127](https://github.com/Moissanite-Labs/exo-os/blob/bf489013a217b99aa8a0d238fbfb398b78354685/research/04-small-hardware.md#L127)) | `bf48901` | +| [Moissanite-Labs/siliquant](https://github.com/Moissanite-Labs/siliquant) | Proved limits and experiments on rounding model weights to a few bits. | Two studies. No licence chosen yet. ([siliquant/README.md:59](https://github.com/Moissanite-Labs/siliquant/blob/ba3a7333e9ccb99e35a74655b8d08699600adecd/README.md#L59)) | `ba3a733` | +| [Moissanite-Labs/weft](https://github.com/Moissanite-Labs/weft) | Adaptive models that change within checkable bounds. Source of the gate predicate and its conformance vectors. | Early research. The gate runs and is tested in CI in Python, C11 and JavaScript. ([weft/README.md:17](https://github.com/Moissanite-Labs/weft/blob/df4f9fa45640d7ee840f4529025a9a556d98684c/README.md#L17)) | `df4f9fa` | +| [Moissanite-Labs/weft-corpus](https://github.com/Moissanite-Labs/weft-corpus) | The original Weft sessions, kept word for word. Three of them, the Terrafab documents, set out the idea of one structure in which machines, sensors and models form a single loop. | Source material, not instructions. The sessions narrate actions that did not happen. ([weft-corpus/README.md:11](https://github.com/Moissanite-Labs/weft-corpus/blob/5cf1e447102bba55d7d1d8010ea2bdda1f2eddf1/README.md#L11)) | `5cf1e44` | +| [Moissanite-Labs/weft-loom](https://github.com/Moissanite-Labs/weft-loom) | Weft's experiment records and audits, with preregistrations and negative results. | Research records. Wall-clock timings only; no power or energy measurement. ([weft-loom/notes/horizon-ii-ideas-backlog.md:28](https://github.com/Moissanite-Labs/weft-loom/blob/b250e13982edec5df9fbfd2f0dee49e11972215d/notes/horizon-ii-ideas-backlog.md#L28)) | `b250e13` | + +### L5. Messages and protocols + +| Repository | What it is | Status | Pinned | +|---|---|---|---| +| [Moissanite-Labs/abios](https://github.com/Moissanite-Labs/abios) | Compact agent message format (SYM-2P). | v1.0.0 spec and validator. Byte savings measured against compact JSON only. ([abios/bench/README.md:18](https://github.com/Moissanite-Labs/abios/blob/21154fdc2fe925047560134fdedea5d0c073ca25/bench/README.md#L18)) | `21154fd` | +| [Moissanite-Labs/synbios](https://github.com/Moissanite-Labs/synbios) | Agent-first forge with the SYM-3 wire format. | v0.1 local reference. Token counts on synthetic transcripts. ([synbios/README.md:5](https://github.com/Moissanite-Labs/synbios/blob/85583494aa5868cc9219aa0d914c27714b05a52e/README.md#L5)) | `8558349` | +| [Proven-Commons/cbor](https://github.com/Proven-Commons/cbor) | CBOR codec, a compact binary encoding for sensor records. | Draft pull request; nothing verified. ([mission/CANDIDATES.md:74](https://github.com/Proven-Commons/mission/blob/7b22e542f0db0f3013ab1439cf5d1947676a5083/CANDIDATES.md#L74)) | named only, not read | +| [Proven-Commons/mqtt](https://github.com/Proven-Commons/mqtt) | MQTT 5.0 packet framing, a common sensor telemetry transport. | Open pull request; nothing verified. ([mission/CANDIDATES.md:78](https://github.com/Proven-Commons/mission/blob/7b22e542f0db0f3013ab1439cf5d1947676a5083/CANDIDATES.md#L78)) | named only, not read | +| [Proven-Commons/ntp](https://github.com/Proven-Commons/ntp) | NTP wire packet, time synchronisation for telemetry. | Open pull request; nothing verified. ([mission/CANDIDATES.md:82](https://github.com/Proven-Commons/mission/blob/7b22e542f0db0f3013ab1439cf5d1947676a5083/CANDIDATES.md#L82)) | named only, not read | +| [Proven-Commons/protobuf](https://github.com/Proven-Commons/protobuf) | Protobuf wire format codec. | First slice merged; nothing verified. ([mission/CANDIDATES.md:52](https://github.com/Proven-Commons/mission/blob/7b22e542f0db0f3013ab1439cf5d1947676a5083/CANDIDATES.md#L52)) | named only, not read | + +### L6. Provenance, rules and hubs + +| Repository | What it is | Status | Pinned | +|---|---|---|---| +| [aska-physical/.github](https://github.com/aska-physical/.github) | The group ethos and the organisation profile that indexes every repository. | Standing directive, recorded 2026-11-10. ([.github/ETHOS.md:3](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/ETHOS.md#L3)) | `0289ce8` | +| [aska-physical/dock](https://github.com/aska-physical/dock) | The organisation's public hub page. It lists the org's repositories live from the GitHub API. | Published site. ([dock/index.html:789](https://github.com/aska-physical/dock/blob/ce4135b88139fb63372279015cecc77c6b89f364/index.html#L789)) | `ce4135b` | +| [Foundation-0/.github](https://github.com/Foundation-0/.github) | Repository standard and label standard: PROVEN, VERIFIED, KNOWN, CONJECTURE. | Standard in force for Foundation-0 repositories. ([.github/REPO-STANDARD.md:64](https://github.com/Foundation-0/.github/blob/81f83c38918382b4ca142b81debd3cc5ccf61d3a/REPO-STANDARD.md#L64)) | `81f83c3` | +| [Foundation-0/f0](https://github.com/Foundation-0/f0) | The Ledger of AI-assisted advances, the charter, and the rules for agents. Source of the evidence scale used here. | Active. 343 Ledger entries. ([f0/README.md:27](https://github.com/Foundation-0/f0/blob/9a37134750174339c53121939838ce62ab8af630/README.md#L27)) | `9a37134` | +| [Moissanite-Labs/.github](https://github.com/Moissanite-Labs/.github) | Organisation profile and site. Names Foundation-0, Proven Commons and ASKA Digital as connected efforts. | Published. ([.github/profile/README.md:30](https://github.com/Moissanite-Labs/.github/blob/23b1282b6c6aae05774471eacd79ba5a6ae767f9/profile/README.md#L30)) | `23b1282` | +| [Moissanite-Labs/ethos](https://github.com/Moissanite-Labs/ethos) | Portable user preferences across agent harnesses. | v0.1.0 spec, schema and fixtures. ([ethos/pyproject.toml:7](https://github.com/Moissanite-Labs/ethos/blob/afdb3a4af912a13358f2e1d67673dfd175ed39be/pyproject.toml#L7)) | `afdb3a4` | +| [Moissanite-Labs/exofab](https://github.com/Moissanite-Labs/exofab) | Human-first hub for forming projects and ventures. | Design and proposals. Nothing runnable. ([exofab/README.md:5](https://github.com/Moissanite-Labs/exofab/blob/1e103c7394ef904c166c83b4529410e815a8c5a1/README.md#L5)) | `1e103c7` | +| [Moissanite-Labs/siliconcordat](https://github.com/Moissanite-Labs/siliconcordat) | The lab's working manifesto and its dated ecosystem map. | Working proposal, not adopted policy. ([siliconcordat/README.md:3](https://github.com/Moissanite-Labs/siliconcordat/blob/28d3238a0a5a635137efe3872e1648c03ed8edd0/README.md#L3)) | `28d3238` | +| [Moissanite-Labs/synmerit](https://github.com/Moissanite-Labs/synmerit) | Signed records of contribution, consent and delegated authority. | v0.1.0 experimental reference. ([synmerit/package.json:3](https://github.com/Moissanite-Labs/synmerit/blob/4b1a9e1c98aa7e41fc4636f59a36be0c7d4f58fa/package.json#L3)) | `4b1a9e1` | +| [Proven-Commons/mission](https://github.com/Proven-Commons/mission) | The verified bar and the candidate list for Lean rewrites of widely used libraries. | Bar version 2. No project is verified yet; the reviewer list is empty. ([mission/CANDIDATES.md:44](https://github.com/Proven-Commons/mission/blob/7b22e542f0db0f3013ab1439cf5d1947676a5083/CANDIDATES.md#L44)) | `7b22e54` | + +## Links + +Link types: + +- `builds_on`: The downstream work uses results, certificates or code of the upstream work, and the use was traced. Lineage. +- `stated`: The downstream repository says it builds on the upstream one. No specific value was traced here. Lineage. +- `direction`: The downstream work follows a question or direction of the upstream work, which has no results. Lineage. +- `consumes`: The downstream work reads a specific value or file of the upstream work. Lineage. +- `governs`: The upstream work sets rules or a scale that the downstream work follows. Not lineage. +- `mentions`: One names the other in text. No data flows. Not lineage. +- `indexes`: A hub lists the repository. Not lineage. +- `checked_unrelated`: One specific proposed link that was checked and found not to hold. Kept so it is not proposed again. + +### Added by optifab v0.1.0 + +Before this version the graph holds 0 links between aska-physical and Moissanite-Labs, and a search of the other three organisations' repositories for aska-physical or its data-centre work finds nothing. The Weft link below is the first. + +| From | To | Type | Stated at | Note | +|---|---|---|---|---| +| aska-physical/funi-frame | aska-physical/optifab | `consumes` | [funi-frame/verify.py:144](https://github.com/aska-physical/funi-frame/blob/97b326d237de5e03a2a227a02f32121005109fb8/verify.py#L144) | Certificate vendored; verifier literals pinned. | +| aska-physical/funi-floors | aska-physical/optifab | `consumes` | [funi-floors/results/certificate.json:61](https://github.com/aska-physical/funi-floors/blob/00eba18ceea0adf69f7dc12ca47d151622faa32a/results/certificate.json#L61) | Certificate vendored for the margin vector and the interface checks. | +| aska-physical/venturi-collars | aska-physical/optifab | `consumes` | [venturi-collars/README.md:21](https://github.com/aska-physical/venturi-collars/blob/d53f85a35d17a7bd46d0b5320c8879fc9f381978/README.md#L21) | Certificate vendored for the sensing-power margin. | +| Moissanite-Labs/weft | aska-physical/optifab | `consumes` | [weft/weft/runtime/invariants/invariants.py:95](https://github.com/Moissanite-Labs/weft/blob/df4f9fa45640d7ee840f4529025a9a556d98684c/weft/runtime/invariants/invariants.py#L95) | The gate predicate is re-implemented here, tested on Weft's vectors and checked against Weft's own function on generated inputs. | +| Foundation-0/f0 | aska-physical/optifab | `governs` | [f0/docs/charter/page.js:317](https://github.com/Foundation-0/f0/blob/9a37134750174339c53121939838ce62ab8af630/docs/charter/page.js#L317) | Evidence scale and the rules for agents. | +| Moissanite-Labs/weft-corpus | aska-physical/optifab | `direction` | [weft-corpus/weft/terrafab.md:86](https://github.com/Moissanite-Labs/weft-corpus/blob/5cf1e447102bba55d7d1d8010ea2bdda1f2eddf1/weft/terrafab.md#L86) | The idea of one structure, named in optifab issue 1. No figure from these documents is used as evidence. | + +### Between organisations, already in place + +| From | To | Type | Stated at | Note | +|---|---|---|---|---| +| Foundation-0/incentre-lattices | aska-physical/fibral-rigidity | `builds_on` | [fibral-rigidity/README.md:5](https://github.com/aska-physical/fibral-rigidity/blob/06520520dff2e956715f18cfa3ba10e7ee83487b/README.md#L5) | | +| Foundation-0/nhanes-bioimpedance | aska-physical/cfrp-truss | `stated` | [.github/profile/README.md:13](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L13) | | +| Foundation-0/incentre-lattices | aska-physical/cfrp-masts | `stated` | [.github/profile/README.md:14](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L14) | | +| Foundation-0/rigid-realizations | aska-physical/cfrp-masts | `stated` | [.github/profile/README.md:14](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L14) | | +| Foundation-0/ductricity | aska-physical/venturi-collars | `direction` | [.github/profile/README.md:15](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L15) | The upstream is a project definition with no results, so nothing is inherited but the question. | +| Foundation-0/thermal-capture | aska-physical/venturi-collars | `direction` | [.github/profile/README.md:15](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L15) | The upstream is a research direction with no results. | +| Foundation-0/nhanes-bioimpedance | aska-physical/impedence-analyzers | `stated` | [.github/profile/README.md:16](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L16) | | +| Foundation-0/point-charges | aska-physical/impedence-analyzers | `stated` | [.github/profile/README.md:16](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L16) | | +| Foundation-0/incentre-lattices | aska-physical/impedence-analyzers | `builds_on` | [impedence-analyzers/README.md:23](https://github.com/aska-physical/impedence-analyzers/blob/ed0a5e10e87e231262af697cb183aa8aa570ca83/README.md#L23) | | +| Foundation-0/f0 | aska-physical/.github | `mentions` | [.github/profile/README.md:5](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L5) | The aska-physical profile says the organisation turns Foundation-0 results into products. | +| Foundation-0/.github | aska-physical/fibral-rigidity | `governs` | [fibral-rigidity/README.md:17](https://github.com/aska-physical/fibral-rigidity/blob/06520520dff2e956715f18cfa3ba10e7ee83487b/README.md#L17) | fibral-rigidity labels its claims by the Foundation-0 repository standard. | +| Foundation-0/f0 | Proven-Commons/mission | `governs` | [mission/README.md:5](https://github.com/Proven-Commons/mission/blob/7b22e542f0db0f3013ab1439cf5d1947676a5083/README.md#L5) | | +| Foundation-0/project-asma | Moissanite-Labs/weft | `builds_on` | [weft/weft/runtime/plasm/identifiability_gate.py:7](https://github.com/Moissanite-Labs/weft/blob/df4f9fa45640d7ee840f4529025a9a556d98684c/weft/runtime/plasm/identifiability_gate.py#L7) | Weft adapted two theorems into its identifiability gate. That module is separate from the gate optifab uses. | +| Foundation-0/rigid-realizations | Moissanite-Labs/weft | `mentions` | [weft/tools/flex_burn_hardened/run_all_55_flex_burn_v2.py:23](https://github.com/Moissanite-Labs/weft/blob/df4f9fa45640d7ee840f4529025a9a556d98684c/tools/flex_burn_hardened/run_all_55_flex_burn_v2.py#L23) | Named as a track in a budget tool. No data flows. | +| Moissanite-Labs/weft | Foundation-0/math0 | `mentions` | [math0/studies/integer-mult/carbon-2026-11-13/base-math-convergence/research/conservation-quotient-bounds/PROOF.md:10](https://github.com/Foundation-0/math0/blob/e649250ca32249affe52873a45d22e8bd5562624/studies/integer-mult/carbon-2026-11-13/base-math-convergence/research/conservation-quotient-bounds/PROOF.md#L10) | A math0 study names Weft as one instance of a shared structure. The study is claimed, pending review, and its Lean file does not compile. | +| Foundation-0/incentre-lattices | Moissanite-Labs/siliquant | `checked_unrelated` | [siliquant/notes/brief-check.md:39](https://github.com/Moissanite-Labs/siliquant/blob/ba3a7333e9ccb99e35a74655b8d08699600adecd/notes/brief-check.md#L39) | siliquant checked whether the certificate coefficients of incentre-lattices bear on weight rounding and found them unrelated. Its other proposed links to the lattice tracks are recorded there as proposals, not evaluated. | +| Foundation-0/incentre-lattices | Moissanite-Labs/exo-os | `mentions` | [exo-os/docs/BANKAI.md:405](https://github.com/Moissanite-Labs/exo-os/blob/bf489013a217b99aa8a0d238fbfb398b78354685/docs/BANKAI.md#L405) | The lattice supplies the geometry of a visual figure. No result is used. | +| Foundation-0/f0 | Moissanite-Labs/exo | `indexes` | [f0/docs/data/projects.json:331](https://github.com/Foundation-0/f0/blob/9a37134750174339c53121939838ce62ab8af630/docs/data/projects.json#L331) | f0 lists Exo as an instrument, with Aska Digital as its owner. | +| Foundation-0/f0 | Moissanite-Labs/.github | `mentions` | [.github/profile/README.md:30](https://github.com/Moissanite-Labs/.github/blob/23b1282b6c6aae05774471eacd79ba5a6ae767f9/profile/README.md#L30) | The lab profile names Foundation-0 and Proven Commons as connected efforts. | + +### Inside one organisation + +| From | To | Type | Stated at | Note | +|---|---|---|---|---| +| aska-physical/cfrp-strengthening | aska-physical/cfrp-truss | `stated` | [.github/profile/README.md:13](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L13) | | +| aska-physical/fibral-rigidity | aska-physical/cfrp-truss | `stated` | [.github/profile/README.md:13](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L13) | | +| aska-physical/fibral-rigidity | aska-physical/cfrp-masts | `stated` | [.github/profile/README.md:14](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L14) | | +| aska-physical/fibral-rigidity | aska-physical/funi-floors | `stated` | [.github/profile/README.md:12](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L12) | | +| aska-physical/cfrp-truss | aska-physical/funi-floors | `stated` | [.github/profile/README.md:12](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L12) | | +| aska-physical/venturi-collars | aska-physical/funi-floors | `stated` | [.github/profile/README.md:12](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L12) | | +| aska-physical/impedence-analyzers | aska-physical/funi-floors | `stated` | [.github/profile/README.md:12](https://github.com/aska-physical/.github/blob/0289ce8afa209f7ee8679622e2129fe8ace3746f/profile/README.md#L12) | | +| aska-physical/funi-floors | aska-physical/funi-frame | `builds_on` | [funi-frame/README.md:5](https://github.com/aska-physical/funi-frame/blob/97b326d237de5e03a2a227a02f32121005109fb8/README.md#L5) | | +| aska-physical/cfrp-truss | aska-physical/funi-frame | `stated` | [funi-frame/README.md:5](https://github.com/aska-physical/funi-frame/blob/97b326d237de5e03a2a227a02f32121005109fb8/README.md#L5) | | +| aska-physical/fibral-rigidity | aska-physical/funi-frame | `stated` | [funi-frame/README.md:5](https://github.com/aska-physical/funi-frame/blob/97b326d237de5e03a2a227a02f32121005109fb8/README.md#L5) | | +| aska-physical/venturi-collars | aska-physical/funi-frame | `stated` | [funi-frame/README.md:5](https://github.com/aska-physical/funi-frame/blob/97b326d237de5e03a2a227a02f32121005109fb8/README.md#L5) | | +| aska-physical/impedence-analyzers | aska-physical/funi-frame | `stated` | [funi-frame/README.md:5](https://github.com/aska-physical/funi-frame/blob/97b326d237de5e03a2a227a02f32121005109fb8/README.md#L5) | | +| aska-physical/funi-floors | aska-physical/funi-frame | `consumes` | [funi-frame/verify.py:125](https://github.com/aska-physical/funi-frame/blob/97b326d237de5e03a2a227a02f32121005109fb8/verify.py#L125) | A value copied by hand into the downstream verifier. optifab now checks it against the upstream certificate. | +| Moissanite-Labs/weft-corpus | Moissanite-Labs/weft | `builds_on` | [weft/weft/runtime/invariants/invariants.py:11](https://github.com/Moissanite-Labs/weft/blob/df4f9fa45640d7ee840f4529025a9a556d98684c/weft/runtime/invariants/invariants.py#L11) | Weft's gate was repaired from a header first written, in the Terrafab documents, as a fence for physical machines. | +| Moissanite-Labs/weft | Moissanite-Labs/weft-loom | `builds_on` | [weft/README.md:35](https://github.com/Moissanite-Labs/weft/blob/df4f9fa45640d7ee840f4529025a9a556d98684c/README.md#L35) | | +| Moissanite-Labs/weft | Moissanite-Labs/siliquant | `mentions` | [siliquant/README.md:3](https://github.com/Moissanite-Labs/siliquant/blob/ba3a7333e9ccb99e35a74655b8d08699600adecd/README.md#L3) | | +| Moissanite-Labs/abios | Moissanite-Labs/weft | `mentions` | [weft/README.md:136](https://github.com/Moissanite-Labs/weft/blob/df4f9fa45640d7ee840f4529025a9a556d98684c/README.md#L136) | Weft's telemetry line predates the abios format; the move is an open Weft issue. | +| aska-physical/dock | aska-physical/optifab | `indexes` | [dock/index.html:789](https://github.com/aska-physical/dock/blob/ce4135b88139fb63372279015cecc77c6b89f364/index.html#L789) | The hub page lists every repository of the organisation, so optifab appears without a change to dock. | + +## Evidence in the physical stack + +The physical stack is optifab and everything it builds on in layers L0 to L3: 13 repositories. The scale is the Foundation-0 Ledger's: claimed 1, preprint 2, peer reviewed or deployed 3, independently replicated 4, formally verified 5. + +| Repository | Evidence | Assigned by | Repositories downstream in the stack | +|---|---|---|---| +| Foundation-0/incentre-lattices | preprint | source | 6 | +| Foundation-0/nhanes-bioimpedance | claimed | source | 5 | +| Foundation-0/ductricity | no result claimed | | 4 | +| Foundation-0/point-charges | claimed | source | 4 | +| Foundation-0/thermal-capture | no result claimed | | 4 | +| aska-physical/cfrp-strengthening | claimed | optifab | 4 | +| aska-physical/fibral-rigidity | claimed | optifab | 4 | +| aska-physical/cfrp-truss | claimed | optifab | 3 | +| aska-physical/impedence-analyzers | claimed | optifab | 3 | +| aska-physical/venturi-collars | claimed | optifab | 3 | +| aska-physical/funi-floors | claimed | optifab | 2 | +| aska-physical/funi-frame | claimed | optifab | 1 | +| aska-physical/optifab | claimed | optifab | 0 | + +Counts: 10 claimed, 2 no result claimed, 1 preprint. Nothing in the stack is peer reviewed, replicated, deployed or formally verified. An independent replication does most good at the top of this table, where the most downstream work rests on it. + +## Surveyed and not connected + +These were read in the same pass. They are listed so the next reader does not repeat the search. + +| Repository | Why it is not in the stack | +|---|---| +| [Foundation-0/astr0](https://github.com/Foundation-0/astr0) | Astronomy hub. Nothing in it bears on a data centre. | +| [Foundation-0/plate-eclipses](https://github.com/Foundation-0/plate-eclipses) | Astronomy result, claimed. Not connected. | +| [Foundation-0/fractals](https://github.com/Foundation-0/fractals) | Exploration with no new result claimed. Not connected. | +| [Moissanite-Labs/weft-eido](https://github.com/Moissanite-Labs/weft-eido) | Design language for interfaces. A later dashboard for the plant could use it; nothing to check today. | +| [Moissanite-Labs/exoframe](https://github.com/Moissanite-Labs/exoframe) | Public intake pages for Exofab. Not connected. | +| [Moissanite-Labs/exorien](https://github.com/Moissanite-Labs/exorien) | Direction for shared physical and digital spaces. Its own notes say hardware is not implemented. | +| [Moissanite-Labs/tokenpage](https://github.com/Moissanite-Labs/tokenpage) | Charter only. No measurement to combine yet. | +| [Moissanite-Labs/scry](https://github.com/Moissanite-Labs/scry) | Charter only. No measurement to combine yet. | +| [Moissanite-Labs/nullmodem](https://github.com/Moissanite-Labs/nullmodem) | Charter only. No measurement to combine yet. | +| [Proven-Commons/tar](https://github.com/Proven-Commons/tar) | Pilot, built, not yet verified. Not on the telemetry path. | +| [Proven-Commons/redis](https://github.com/Proven-Commons/redis) | Proofs done, specification review pending. Not on the telemetry path. | +| [Proven-Commons/site](https://github.com/Proven-Commons/site) | Alternative build of the programme site. | + +## Pinned commits + +| Repository | Commit | +|---|---| +| aska-physical/.github | `0289ce8afa209f7ee8679622e2129fe8ace3746f` | +| aska-physical/cfrp-masts | `a12b665f2baf32a8d6499ef39c296ef9fe78f630` | +| aska-physical/cfrp-strengthening | `3f68cccf19556574b7652311be1b0dc0daa93144` | +| aska-physical/cfrp-truss | `3c11631e223b71227531d10286abd71bc04d67b7` | +| aska-physical/dock | `ce4135b88139fb63372279015cecc77c6b89f364` | +| aska-physical/fibral-rigidity | `06520520dff2e956715f18cfa3ba10e7ee83487b` | +| aska-physical/funi-floors | `00eba18ceea0adf69f7dc12ca47d151622faa32a` | +| aska-physical/funi-frame | `97b326d237de5e03a2a227a02f32121005109fb8` | +| aska-physical/graph-fab | `d669f233212ee0f2a7d59e60b0f3bdc9781f8a99` | +| aska-physical/impedence-analyzers | `ed0a5e10e87e231262af697cb183aa8aa570ca83` | +| aska-physical/venturi-collars | `d53f85a35d17a7bd46d0b5320c8879fc9f381978` | +| Foundation-0/.github | `81f83c38918382b4ca142b81debd3cc5ccf61d3a` | +| Foundation-0/ductricity | `0a178a01209b6b583408a861b2476e2308e1f053` | +| Foundation-0/f0 | `9a37134750174339c53121939838ce62ab8af630` | +| Foundation-0/incentre-lattices | `2d374fff2a59cc9331566733043a4bb25c1040bf` | +| Foundation-0/math0 | `e649250ca32249affe52873a45d22e8bd5562624` | +| Foundation-0/nhanes-bioimpedance | `efb3395b70e32ae96779a73454b2333b7e86c4d1` | +| Foundation-0/physics0 | `913468f093f82d869dc58b404039ea0a416cfb80` | +| Foundation-0/point-charges | `a2fd159bccb24d2922a127ad83f28b9f44e2ceba` | +| Foundation-0/project-asma | `48178217a88066212ec798a7e8031e6fc652493e` | +| Foundation-0/rigid-realizations | `298926c5e7a03683bb83165931ac38a94260166f` | +| Foundation-0/thermal-capture | `5fa678e94d2e6b1ace56d2cc7e4e0b0eae0a91af` | +| Moissanite-Labs/.github | `23b1282b6c6aae05774471eacd79ba5a6ae767f9` | +| Moissanite-Labs/abios | `21154fdc2fe925047560134fdedea5d0c073ca25` | +| Moissanite-Labs/ethos | `afdb3a4af912a13358f2e1d67673dfd175ed39be` | +| Moissanite-Labs/exo-os | `bf489013a217b99aa8a0d238fbfb398b78354685` | +| Moissanite-Labs/exofab | `1e103c7394ef904c166c83b4529410e815a8c5a1` | +| Moissanite-Labs/siliconcordat | `28d3238a0a5a635137efe3872e1648c03ed8edd0` | +| Moissanite-Labs/siliquant | `ba3a7333e9ccb99e35a74655b8d08699600adecd` | +| Moissanite-Labs/synbios | `85583494aa5868cc9219aa0d914c27714b05a52e` | +| Moissanite-Labs/synmerit | `4b1a9e1c98aa7e41fc4636f59a36be0c7d4f58fa` | +| Moissanite-Labs/weft | `df4f9fa45640d7ee840f4529025a9a556d98684c` | +| Moissanite-Labs/weft-corpus | `5cf1e447102bba55d7d1d8010ea2bdda1f2eddf1` | +| Moissanite-Labs/weft-loom | `b250e13982edec5df9fbfd2f0dee49e11972215d` | +| Proven-Commons/.github | `60521aa4efdefc94f17fd864c1981a6ab517df5d` | +| Proven-Commons/mission | `7b22e542f0db0f3013ab1439cf5d1947676a5083` | diff --git a/docs/MODEL.md b/docs/MODEL.md new file mode 100644 index 0000000..ed3c2fc --- /dev/null +++ b/docs/MODEL.md @@ -0,0 +1,388 @@ +# The model + +This note derives each result in the README, states what it assumes, and says where every input comes from. +`python3 verify.py` recomputes all of it and compares the outcome with `results/certificate.json`. + +Labels follow the Foundation-0 repository standard: **PROVEN** (written proof, checked symbolically), +**VERIFIED** (finite deterministic check, not a proof), **KNOWN** (cited), **CONJECTURE**. On the Foundation-0 +Ledger's evidence scale the whole of optifab is **claimed**: an AI agent wrote it and no person has reviewed it. + +Nothing here is measured. The inputs are the outputs of other repositories' models. A result marked PROVEN is +proved about those models, not about a building. + +## Inputs + +The reference campus is the one in [funi-frame](https://github.com/aska-physical/funi-frame): 10 MW of IT load, a +square 2,500 m² plan, two storeys. + +| Quantity | Value | Source | Kind | +|---|---|---|---| +| IT load $P$ | 10 MW | funi-frame certificate | design basis | +| Heat captured by liquid, by air | 8.5 MW, 1.5 MW | funi-frame certificate | design basis | +| Sorption chiller COP | 0.62 | funi-frame `verify.py:144` | literal in the verifier | +| Drive and chilled-water temperatures | 58 °C, 15 to 18 °C | funi-frame `HANDOFF.md:14` | prose only | +| Aquifer loop COP, plant auxiliaries | 28, 0.195 MW | funi-frame `verify.py:147` | literals | +| Conventional chiller COP, auxiliaries | 3.0, 0.27 MW | funi-frame `verify.py:147` | literals | +| Non-cooling overhead | 0.2 MW | funi-frame `verify.py:159` | literal | +| PCM skid energy | 2,500 kWh_th | funi-frame `verify.py:143` | literal | +| Roof and wall U-values, building height | 0.1234, 0.1316 W/(m²·K), 12.38 m | funi-frame certificate | computed upstream | +| Limit-state demands and capacities | see section 5 | funi-frame, funi-floors, venturi-collars certificates | computed upstream, except where noted | +| Gate conformance vectors | 15 weight-update vectors | Weft `vectors.json` | test data | +| Gate oracle | Weft's own gate function | Weft `invariants.py` | code, run only as a test oracle | +| Telemetry frame layout | 16 little-endian float32, 64 bytes | Weft `frame64.py:24` | definition | +| Plant vibration tones | 29.5, 49, 60, 120 Hz | funi-frame `verify.py:112` | literals | +| Two loop latencies | 15 ms, 0.5 ms | weft-corpus `weft/terrafab.md:67` | test values only, not evidence | +| Evidence scale | claimed 1 to formally verified 5 | f0 `docs/charter/page.js:317` | definition | +| Lineage depth bound | 12 | Weft `ProvenanceRegistry.sol:7` | constant | + +The three certificates, the Weft vectors and Weft's gate module are copied byte for byte into `data/upstream/` +with their hashes. +Literals and prose are pinned by repository, commit, file, line and text in `data/pins.json`. + +## 1. Compute unlocked at a fixed utility supply + +**PROVEN** (two identities). **VERIFIED** (numbers). + +funi-frame reports 3.06 MW of "freed substation power" and multiplies it by a value of compute per MW. Freed +utility power is not IT power, because new racks need cooling and overhead of their own. How much IT load the +freed power carries depends on how the overhead grows. + +- **If every overhead grows with the load**, the PUE holds, and a supply of $P\,\mathrm{PUE}_c$ carries + $P\,\mathrm{PUE}_c/\mathrm{PUE}_f$: + + $$\Delta P_{IT} = \frac{\text{freed utility power}}{\mathrm{PUE}_f}.$$ + +- **If only the cooling loop grows**, as funi-frame's own verifier has it (aquifer loop at a COP of 28, with + the plant auxiliaries, the other overhead and the passive sinks all fixed), each extra MW of IT load costs + $1 + 1/28$ MW of supply: + + $$\Delta P_{IT} = \frac{\text{freed utility power}}{1 + 1/\mathrm{COP}_{loop}}.$$ + +optifab first rebuilds both PUE values from the certificate and the pinned literals (1.38033 and 1.07387, which +round to the certificate's 1.380 and 1.074). Then: + +| | Value | +|---|---| +| Freed utility power | 3.065 MW (certificate: 3.06) | +| Extra IT load, every overhead growing with load | 2.854 MW | +| Extra IT load, auxiliaries fixed | 2.959 MW | +| Low-end revenue on the certificate | $76.62M a year | +| Low-end revenue on the extra IT load | $71.35M to $73.97M a year | + +Either way it is less than 3.06 MW. If the dollar value is per MW of IT load, the certificate's revenue figures +are 3.6% to 7.4% high. funi-frame does not say which kind of MW its value refers to, and the source of that +value is not pinned here. Both cases assume the freed power is used in the same plant. + +The rebuild also gives the heat sent to the aquifer store: 9.62 MW, or 84.3 GWh_th a year, all in one direction. +funi-frame already lists the yearly aquifer balance as open work. + +## 2. A recooling limit for the sorption stage + +**PROVEN** from the first and second laws. **VERIFIED** (numbers). + +A heat-driven chiller takes heat $Q_h$ at $T_h$, lifts heat $Q_c$ from $T_c$, and rejects $Q_h+Q_c$ at $T_a$. It +cannot destroy entropy, so $(Q_h+Q_c)/T_a \ge Q_h/T_h + Q_c/T_c$. Rearranged: + +$$\mathrm{COP} = \frac{Q_c}{Q_h} \le \frac{T_c}{T_a-T_c}\cdot\frac{T_h-T_a}{T_h} +\quad\Longleftrightarrow\quad +T_a \le \frac{T_c\,T_h\,(1+\mathrm{COP})}{\mathrm{COP}\cdot T_h+T_c}.$$ + +Temperatures are absolute. $T_h$ is the hottest temperature at which heat is supplied and $T_c$ the warmest at +which heat is taken up. funi-frame gives a 58 °C drive and chilled water at 15 to 18 °C. Taking 18 °C as the +warmest temperature at which the chiller takes up heat, which holds for a machine that evaporates at one +temperature at or below the water it produces, the claimed COP of 0.62 gives: + +| Chilled water | Highest possible recooling temperature | +|---|---| +| 18 °C | 41.5 °C | +| 15 °C | 40.1 °C | + +| Recooling temperature | 25 °C | 30 °C | 35 °C | 40 °C | 45 °C | +|---|---|---|---|---|---| +| Reversible COP, 18 °C chilled water | 4.145 | 2.051 | 1.190 | 0.719 | 0.423 | +| Reversible COP, 15 °C chilled water | 2.871 | 1.624 | 1.001 | 0.627 | 0.377 | + +So the claimed COP needs a heat sink below about 41 °C, and at 30 °C it is 30% to 38% of the reversible limit. +A real machine does worse than these bounds for three reasons: the drive water cools as it passes through, the +evaporator is colder than the water it chills, and the condenser is warmer than the water that cools it. A +machine that took up heat along the whole range of a warmer return stream could be bounded less tightly; the +certificate gives no return temperature. + +The funi-frame certificate has no recooling temperature in it, and no stream temperature as a value at all. Its +design does provide cool sinks: the aquifer loop, the energy piles and the sky-cooling roof. The point is that +the zero-water claim and the COP claim both depend on those sinks. Dry coolers alone cannot hold the COP on a +day hotter than about 41 °C minus their approach. + +## 3. A load floor for the workload + +**PROVEN** (algebra) under assumptions A-1 and A-2. **VERIFIED** (numbers). + +funi-frame's Theorem 4 says the campus cools itself when the liquid capture fraction $\alpha$ exceeds +$1/(1+\mathrm{COP}) = 61.73\%$. That holds when every heat load scales with the IT load. Some do not. Let +$q_{fix}$ be the air-side load that stays when the racks idle. The chiller must remove $(1-\alpha)P + q_{fix}$, +which needs drive heat $((1-\alpha)P + q_{fix})/\mathrm{COP}$, and the liquid loop supplies $\alpha P$. The campus +cools itself only when + +$$P \ge P_{min} = \frac{q_{fix}}{(1+\mathrm{COP})\,\alpha - 1}.$$ + +With $q_{fix}=0$ this is Theorem 4 again. + +- **A-1.** The 0.2 MW of non-cooling overhead in funi-frame's PUE is a fixed load that ends as heat in the hall air. +- **A-2.** The envelope gain is $(U_{roof}A_{roof}+U_{wall}A_{wall})\,\Delta T$ at $\Delta T = 20$ K, with the + certified U-values, a 2,500 m² roof and 200 m × 12.38 m of wall. The 20 K is a choice made here. Solar gain, + infiltration and people are left out. Each would raise the floor. +- **A-3.** The capture fraction (0.85), the COP (0.62) and the 58 °C drive temperature are held at their design + values at part load. A real plant at low load may not hold them. + +| Case | $q_{fix}$ | Load floor | +|---|---|---| +| Envelope only (A-2) | 0.013 MW | 0.034 MW | +| Envelope and overhead (A-1, A-2) | 0.213 MW | 0.564 MW, 5.6% of nameplate | +| Same, with the steel-pinned wall funi-frame rejects | 0.320 MW | 0.850 MW | + +Below the floor the building does not fail. The air-side load has to move to the aquifer loop or a chiller, which +is a change of operating mode that a workload scheduler should know about. The wall result ties two of +funi-frame's domains together: the wall that removes the thermal bridge also lowers the load floor by a third. + +The same balance gives the capture fraction needed at part load: 0.630 at full load, 0.644 at half, 0.670 at a +quarter, 0.749 at a tenth. + +## 4. The thermal budget + +**VERIFIED** (arithmetic on pinned values). + +The PCM skid holds 2,500 kWh_th. If cooling stops and the campus sheds a fraction $s$ of its load, the skid lasts +$t = B/(P(1-s))$. To bridge an outage of length $T$ the campus must shed $s_{min} = 1 - B/(PT)$. + +| Outage | 10 min | 15 min | 30 min | 60 min | +|---|---|---|---|---| +| Load to shed | none | none | 50% | 75% | + +The same budget covers a burst of 10% above cooling capacity for 2.5 hours. The wall liner adds 354 kWh_th on the +air side (funi-frame's 28.3 min at a 750 kW heat leak). + +## 5. Margins and the plant radius + +**PROVEN** (three lines below). **VERIFIED** (the axis points, 20,000 sampled points, and a slightly larger +radius that fails). + +Each certificate states demands and capacities for its limit states. Their ratios form one vector $u_0$ for the +campus: + +| Limit state | Source | Demand | Capacity | Utilisation | +|---|---|---|---|---| +| Floor punching collar | funi-floors | 2,208 kN | 2,756 kN | 0.801 | +| Sensor power at airflow turndown (derived here) | venturi-collars | 0.080 mW | 0.104 mW | 0.770 | +| Floor walking vibration | funi-floors | 0.308% g | 0.5% g | 0.616 | +| Floor crown compression | funi-floors | 13.67 MPa | 22.5 MPa | 0.608 | +| Roof tornado uplift, factored 1.5 | funi-frame | 460.5 kN | 783 kN | 0.588 | +| Storey drift | funi-frame | 0.563% | 1.00% | 0.563 | +| Floor duct-hole shear | funi-floors | 185.6 kN | 373.5 kN | 0.497 | +| Roof crown compression | funi-frame | 9.60 MPa | 24.75 MPa | 0.388 | +| Floor fire thrust, 120 min | funi-floors | 1,172 kN | 3,903 kN | 0.300 | +| Sorption drive heat | funi-frame | 2.419 MW | 8.5 MW | 0.285 | +| Rack vibration | funi-frame | 0.00009 g | 0.0005 g | 0.179 | +| Roof service deflection | funi-frame | 11.7 mm | 66.7 mm | 0.176 | + +Let $R^* = 1 - \max_i u_{0,i}$, which is 0.19895 and is rounded down to 0.1989 so that it is never +optimistic. If a change moves the vector to $u$ with $\lVert u-u_0\rVert_2 \le R^*$, +then for every $i$ + +$$u_i \le u_{0,i} + \lvert u_i-u_{0,i}\rvert \le u_{0,i} + \lVert u-u_0\rVert_2 \le u_{0,i} + 1 - \max_j u_{0,j} \le 1,$$ + +so no limit is passed. The bound is tight: moving the tightest margin alone by the unrounded $R^*$ reaches its +limit exactly. + +What this gives and what it does not: + +- It is a sufficient test. The exact safe set is the box $u_i \le 1$, which is larger. +- The tightest margin in the whole building is in the floor, not the shell: the punching collar at 80%. + Punching demand can rise 24.8% before it binds. +- Eleven of the twelve are certified upstream as a demand and a capacity. The twelfth, sensor power at low + airflow, is derived here: the venturi-collars certificate states its margin at 4 m/s only, and the node power + (0.080 mW) is that harvest divided by that margin. It is the second tightest. If the workload idles and the + air handlers turn down, the sensors that watch the plant are the first thing to lose margin. +- The same certificate names a larger 0.150 mW node. At low airflow the collar harvests 0.104 mW, so that node + would need 144% of the harvest. The collar powers the small node at turndown and not the large one. +- The utilisations come from different design codes with different safety factors built in. The vector treats + them alike. +- In funi-frame's verifier the tornado tie-down capacity (783 kN) is a literal, not a computed value. + +## 6. One gate for weights and plant + +**VERIFIED**: the predicate conforms to Weft's vectors. Using it on a plant is a **proposal**. + +Weft commits a change to a model's weights only if the weights stay within a radius of a saved baseline and the +step's cost fits a budget: $\lVert W-W_0\rVert_F \le R$ and budget ≥ cost > 0. This is Weft interface I3. +`plant_gate` in `verify.py` is written from three sources: Weft's interface note, its conformance vectors, and +the list path of its reference implementation, which alone defines the locked-mask rule. No Weft code is +imported or copied into the gate. The arithmetic at the boundary is deliberately the same as Weft's, so that the +two agree to the last bit. + +Two checks. It passes all 15 of Weft's weight-update vectors, including the two locked-mask cases. And a +differential test runs it against Weft's own function, loaded from a hash-checked copy, on 100,000 generated +cases with a fixed seed: 0 mismatches. The generator aims at the places two implementations drift apart: radii +within one unit in the last place of the true distance, magnitudes whose squares overflow or underflow, locked +coordinates that move by one float32 step, signed zeros, values that are not finite, nested lists and wrong +shapes. Must-fail control 19 shows the test has teeth: a gate that sums the squares with `math.hypot`, which is +equally valid in exact arithmetic, is caught. Weft's 8 tension vectors and 4 royalty vectors cover other +predicates and are out of scope. + +In Weft the budget is a simulation unit, and the only temperature Weft reads is a formula of CPU load +(`host_metrics.py:45`). Neither Weft nor its experiment records contain a measured watt or joule. The plant +supplies both missing quantities: + +| Gate term | In Weft | On the plant | +|---|---|---| +| Baseline | saved weights $W_0$ | certified margin vector $u_0$ (section 5) | +| Candidate | proposed weights | margin vector after a proposed change, from re-running the upstream verifiers | +| Radius | 120 by default | $R^* = 0.1989$ | +| Budget | abstract units | PCM skid, kWh_th (section 4) | +| Cost | abstract units | heat not rejected during the step, kWh_th | +| Locked mask | frozen core weights | margins a scheduler may never move, such as life-safety limits (proposal) | + +Worked cases, all run through the same function that passed Weft's vectors: + +| Step | Result | +|---|---| +| Cooling outage, 10 min at full load (1,667 kWh_th) | admitted, 833 kWh_th left | +| A second 10 min outage before the skid recharges | rejected: budget too small | +| The same outage after shedding 60% of load (667 kWh_th) | admitted, 167 kWh_th left | +| Punching demand up 20%, 5 min outage | admitted, distance 0.160 | +| Punching demand up 26%, 5 min outage | rejected: distance 0.208 exceeds 0.1989 | + +The last two move one margin and hold the others, to show the radius at work. A real candidate vector comes +from re-running the upstream verifiers with the changed inputs. + +Why share the gate rather than write a plant-specific rule: there is one predicate to audit, Weft already plans +a Lean proof of it (roadmap Milestone I.3, still open) and a hardware comparator, and a plant that uses the same +predicate inherits both. + +## 7. Values copied by hand between repositories + +**VERIFIED**. + +| Quantity | Downstream | Upstream | Agree | +|---|---|---|---| +| Floor dead mass | 195.12 kg/m² in funi-frame `verify.py` | funi-floors certificate, 195.12 | yes | +| Conventional floor mass | 744 kg/m² in funi-frame `verify.py` | funi-floors mass and reduction, 743.9 | yes | +| Fe-SMA recovery stress | 423.47 MPa from funi-frame's formula | funi-floors certificate, 423.47 | yes | +| Rack live load | 15.0 kPa in funi-frame `verify.py` | funi-floors 313 psf case, 14.99 kPa | yes | +| Leak-sensor reactance shift | 46.16% in funi-frame's study text | funi-floors certificate, 46.16 | yes | +| Sensor node power | 0.080 mW in the venturi-collars README | harvest over margin in its certificate, 0.080 | yes | + +All six agree today. They were not checked by anything before: a change in funi-floors would have left +funi-frame's copy stale without a failing test. Must-fail control 14 changes the floor mass and confirms the +check fires. + +## 8. Context from the Ledger + +The Foundation-0 Ledger holds one deployed entry on data-centre cooling: machine learning cut the energy used +to cool a Google data centre by up to 40%, a 15% lower PUE overhead (2016, evidence: deployed). funi-frame's +model gives an 85% cut in cooling electricity and an 80.5% lower PUE overhead (evidence: claimed). The +comparison is context, not a check. It shows how far the funi-frame figure sits beyond the only deployed result +on record, and what kind of evidence would move it up the scale: a built plant. + +## 9. The plant frame + +**VERIFIED** (round trip, layout, contract check). The slot meanings are a **proposal**. + +Weft's telemetry frame is 16 little-endian 32-bit floats, 64 bytes. The contract needs 16 numbers: the 12 +margins of section 5, the thermal budget left, the IT load, the recooling temperature and the time. `verify.py` +packs the design point into that layout, unpacks it, and runs the gate and a contract check on the result. The +largest rounding error on a margin is 3e-8. + +The contract check reads one frame and reports which terms fail: a margin past its limit, a spent budget, a load +below the floor of section 3, a recooling temperature at or above the limit of section 2, or a quantity that +was not measured. The design point passes with a recooling temperature of 30 °C. With the recooling slot left +empty, as the funi-frame certificate leaves it, the check reports `recooling_not_measured`. + +The byte layout is Weft's and is pinned. What each slot means is new here, and Weft's owners decide whether the +frame may share their bus. [STRUCTURE.md](STRUCTURE.md) lists the slots. + +## 10. Loop latency against the building's own dynamics + +**PROVEN** (identity). **VERIFIED** (numbers). An ideal case, so an upper bound on benefit. + +The Terrafab documents quote two control-loop latencies, 15 ms and 0.5 ms. Weft's audit records that they are +asserted. They are used here only as two test values. If a loop counters a tone of frequency $f$ with a copy +that arrives late by $\tau$, the amplitude left is + +$$\lvert 1 - e^{-i\varphi}\rvert = 2\,\lvert\sin(\varphi/2)\rvert,\qquad \varphi = 2\pi f\tau,$$ + +which is below 1 within the same cycle only when $f\tau < 1/6$. On the four plant tones in funi-frame's +isolation model, 15 ms meets that condition for none and leaves three of them larger than before; 0.5 ms meets +it for all four, with reductions of 8.5 to 20.7 dB. So the direction of the claim holds for this building's +tones. + +The building does not need the fast loop. Its passive isolation holds rack vibration at 17.9% of the limit, and +the contract's own timescales are long: the thermal budget lasts 900 s at full load, against which 15 ms is +0.002%. The table is in [STRUCTURE.md](STRUCTURE.md). + +## 11. The exact gate and its proofs + +**Machine-checked proof** in Lean. Not verified in the Proven Commons sense: no reviewer has approved the +specification. + +The floating-point gate of section 6 has boundary cases that depend on rounding. For a plant that is +unnecessary: margins can be integers. [formal/](../formal/README.md) defines an exact gate over integers, with +margins in parts per million of their limit, and proves eight theorems about it. The two about the loop: + +- `run_safe`: from a start within the limit, after any list of proposals every margin is still at or below + the limit and the budget is not negative. +- `run_bounded`: the number of admitted changes plus the budget left never exceeds the budget at the start. + +`lake comparator --paranoid` accepts all eight under six kernels with the standard axioms only. A Python copy +of the gate agrees with the Lean executable on 300,000 generated inputs. The Proven Commons bar check reports +items 2 to 6 as passing ([formal/BAR-REPORT.md](../formal/BAR-REPORT.md)). + +In the loop the radius is the headroom of the baseline: the smallest distance from any margin to its limit. +Section 5's lemma, that a move within the headroom passes no limit, is one of the eight +(`accepted_stays_within`), and here it needs no assumption about the baseline. + +## 12. The improvement loop + +**VERIFIED** on a model (deterministic, replayed in Lean). The plant model, the objective and the scenario are +choices made in `loop.py`. The figures illustrate the mechanism and predict nothing. + +A genome holds three hardware genes (thermal store in kWh_th, liquid capture fraction, wall U-value), two +software genes (the scheduler's load floor, the share of load shed in a cooling outage) and the proposer's own +step scale. The plant model turns a genome into 14 margins: ten certified upstream and held constant, the +sensor margin of section 5, and three that move with the genes (sorption drive heat, load floor, outage +ride-through). The objective is useful IT energy per unit of utility energy over a scenario year with 12 +outages of 20 minutes and 2,000 hours at 3% demand. + +Each generation the proposer tries six single-gene changes. On even generations they are software changes, +scored by the objective. On odd generations they are hardware changes, scored by the headroom they open. The +best goes to the exact gate with a cost of one unit against a budget of 64. An admitted candidate becomes the +baseline. The step scale doubles after an admission and halves after a refusal. + +| | Run | Proposer with no reserve | Budget of 3 | Start on a limit | +|---|---|---|---|---| +| Proposals | 50 | 186 | 3 | 14 | +| Admitted | 45 | 60 | 3 | 0 | +| Refused by the gate | 5 | 126 | 0 | 14 | +| Objective at the end | 0.919009 | 0.916009 | 0.914355 | 0.914230 | + +The start is 0.914228, except in the last column, which starts at 0.914230 and does not move. The run ended +with budget to spare because every hardware gene had reached the edge of +its search range. `python3 verify.py --formal` replays all 50 decisions through the Lean executable: no +mismatch. The floating-point gate of section 6 gives the same verdict on all 50. + +[VISION.md](VISION.md) discusses what the loop shows and how far it is from the system it stands in for. + +## Limits + +- No measurement of any kind. Every input is the output of another model. +- The physical stack sits at "claimed" on the Ledger scale, apart from one preprint. See + [CONVERGENCE.md](CONVERGENCE.md). +- funi-frame's verifier was re-run here and reproduces its certificate. The verifiers of funi-floors and + venturi-collars were not re-run; their certificates were read as data. +- Tested on Python 3.13 only. The certificate rounds every figure, which should absorb differences between + maths libraries, but no other version has been tried. +- One campus only. A network of campuses is not modelled. +- The loop between structure and intelligence is open. Four of its ten interfaces are checked. No sensor is + read, no load is shed and no machine is driven. See [STRUCTURE.md](STRUCTURE.md). +- The improvement loop runs on a three-parameter thermal model with a seeded search as its proposer. See + [VISION.md](VISION.md) for what that does and does not show. +- The load floor and the margin vector are steady-state. No transient is modelled. diff --git a/docs/PROPOSALS.md b/docs/PROPOSALS.md new file mode 100644 index 0000000..b564a50 --- /dev/null +++ b/docs/PROPOSALS.md @@ -0,0 +1,145 @@ +# Proposals + +Eight systems, one for each open place in the loop or gap in the evidence. Each says what is missing and how +that is known, what to build, the first slice with a test that can fail, and what it rests on. They are +proposals: none is built. Each has an issue on GitHub where it can be claimed, changed or rejected. + +The element and interface codes (N3, L5 and so on) are those of [STRUCTURE.md](STRUCTURE.md). + +| # | System | Closes | First slice | +|---|---|---|---| +| 1 | Plant sense: two sensors and a frame emitter | N3, N4, L1, L2 | A bench rig whose recorded frames pass the contract check | +| 2 | Load control with an energy reading | L5 | One Weft or Exo job that sheds on request and reports joules | +| 3 | A model as the proposer | "intelligence" in the vision | A recorded run in which a model's proposals go through the gate | +| 4 | Structural genes | "hardware" in the vision | funi-frame's verifier re-run with one changed input inside the loop | +| 5 | Specification review for the gate | R2, bar item 1 | One named reviewer approves `formal/SPEC.md` | +| 6 | Signed ledger and command channel | K2, L9 | The ledger's head signed and checked by a second implementation | +| 7 | A first fabrication cell under the gate | F1, L8 | Fe-SMA activation of one cassette as a gated process | +| 8 | A network of campuses | the "network" in the objective | Two campuses, one shared workload, an exact optimum for a small case | + +## 1. Plant sense: two sensors and a frame emitter + +**The gap.** Two quantities in the contract have a limit and nothing that measures them: rack vibration +(0.0005 g, certified in funi-frame) and recooling temperature (41.5 °C at best, derived here). Nothing reads +any sensor into a frame. Weft's only temperature is a formula of CPU load (`host_metrics.py:45`). + +**The system.** A sensor node per rack row (a MEMS accelerometer, band 10 to 200 Hz) and a temperature probe +on the recooling loop, each powered within the venturi-collars budget (0.080 mW per node at low airflow), and +a small emitter that packs the 16-slot plant frame defined in `verify.py`. + +**First slice.** A bench rig: one accelerometer on a shaker and one temperature probe in a water bath. Record +an hour of frames. Done when `decode_plant_frame` reads every frame, the contract check reports the excursions +that were deliberately applied, and the node's measured power is within the collar's harvest. + +**Rests on.** venturi-collars (power), impedence-analyzers (the leak channel can share the node), Weft's frame +layout. **Decision needed from Weft:** whether the plant frame shares its telemetry bus. + +## 2. Load control with an energy reading + +**The gap.** Neither Weft nor Exo can shed or defer compute on request, and neither measures the energy it +uses. A search of Weft's runtime, documents and experiment records finds no figure in watts or joules. Without +this the scheduler side of the contract has nothing to act on. + +**The system.** Two calls on the compute side: `shed(fraction, seconds)` returns what was actually shed, and +`energy()` returns joules since the last call, read from the platform's power interface (RAPL on x86, the +power metrics interface on Apple Silicon). Both report into the plant frame's load slot. + +**First slice.** One Weft experiment (the swarm benchmark already in weft-loom is a candidate) run with and +without a 50% shed request, with measured joules for each. Done when the measured energy falls by a stated +amount and the record is committed with its preregistration, under weft-loom's own rules. + +**Rests on.** Weft's plasm and telemetry, weft-loom's experiment format. This would also be the first energy +measurement anywhere in the four organisations. + +## 3. A model as the proposer + +**The gap.** The loop's proposer is a seeded search. Nothing that learns takes part. + +**The system.** The proposer becomes an interface: it receives the current genome, margins and the last +verdicts, and returns one proposed change. Any proposer can sit behind it. The gate and the ledger do not +change, and `run_safe` already holds for whatever is plugged in. + +**First slice.** A recorded run in which a language model proposes each change through that interface, with +its prompts and replies kept beside the ledger. Done when the ledger replays in Lean with no mismatch and the +run is compared with the seeded search on the same budget. A second slice lets a Weft cell propose. + +**Rests on.** `loop.py`, abios for the message format, the model's API. **Boundary:** the model proposes and +the gate decides. Nothing here gives a model authority to act. + +## 4. Structural genes + +**The gap.** The loop changes three thermal parameters. The eleven certified structural margins are constants +in it, because the verifiers that compute them take no inputs. So "evolving its hardware" covers a thermal +store, a capture fraction and a wall, and no member of the structure. + +**The system.** Give each aska-physical verifier a parameter file with its design inputs and a `--inputs` +option, so that the loop can ask "what are the margins if the floor load is 5% higher". The margin vector +then moves with structural genes. + +**First slice.** funi-frame's `verify.py` reads its roof and wall inputs from a file. The loop gains one gene, +the rack floor load, and re-runs funi-frame and funi-floors for each candidate. Done when a proposal that +raises the floor load past the punching collar's capacity is refused with the margin computed by the upstream +verifier and not by a scaling rule. + +**Rests on.** funi-frame, funi-floors. This is also what makes the six hand-copied values in section 7 of the +model note unnecessary. + +## 5. Specification review for the gate + +**The gap.** The gate's proofs pass every mechanical item of the Proven Commons bar. Item 1 is open: the +specification has not been approved by a reviewer who did not write it, and the reviewer list in +Proven-Commons/mission is empty. An AI agent wrote the specification. + +**The system.** None to build. A person reviews `formal/SPEC.md` and `formal/PlantGate/Spec.lean`, tries to +write a wrong gate that still meets the statements, and records the approval in `formal/bar.toml`. + +**First slice.** Proven Commons names its first reviewers. One of them reviews this specification. Done when +`bar/check.py` reports item 1 as PASS. + +**Rests on.** Proven-Commons/mission. A second step would prove Weft's own floating-point gate against the +exact one, which is Weft's open Milestone I.3. + +## 6. Signed ledger and command channel + +**The gap.** The ledger is hash-chained, so an edit is detected, but nothing says who wrote it. Weft's +telemetry hash is unkeyed and its roadmap calls it "integrity against accidents, not authentication". A plant +that takes requests from a scheduler needs to know who asked. + +**The system.** Each ledger head and each budget grant is a Synmerit record, signed by the person who set the +budget. The gate's `run_bounded` theorem then has a named person behind the number it bounds. + +**First slice.** The current `results/ledger.json` head, with its budget of 64, signed as a Synmerit bundle and +checked by Synmerit's conformance script. Done when a ledger with an altered budget fails that check. + +**Rests on.** Synmerit v0.1. Its open issue on small-order keys should be closed first. + +## 7. A first fabrication cell under the gate + +**The gap.** The Terrafab documents describe machines that make the structure's own parts under the gate. No +machine exists in any repository. + +**The system.** One real process with certified limits, run as a gated sequence of steps. The margins are the +process limits and the budget is the energy the step may use. + +**First slice.** Joule activation of the Fe-SMA ties in one funi-floors cassette. The certificate gives the +energy (0.3227 kWh/m² against a cap of 0.5) and the target recovery stress. Model the activation as steps of +current and time, gate each step, and log it. Done on a model first, then on a coupon in a lab. + +**Rests on.** funi-floors, cfrp-truss. **Boundary:** a model and then a supervised bench test. No autonomous +machine. + +## 8. A network of campuses + +**The gap.** The objective this repository was opened with names a network. Everything here is one campus. + +**The system.** N campuses, each with its own load floor, thermal budget and margin radius, and a shared +workload. Placing work becomes an optimisation: most useful compute per unit of utility energy, subject to +every campus's gate. + +**First slice.** Two campuses with different recooling temperatures and one workload with a daily cycle. +State the problem as a linear programme, solve it exactly, and check the answer against brute force on a +coarse grid. Done when the certificate holds the optimum and a must-fail control shows that the unconstrained +optimum breaks a load floor. + +**Rests on.** The contract in this repository. funi-frame's open issue on dispatch against negative prices +is the natural second slice. diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md new file mode 100644 index 0000000..3fc17d1 --- /dev/null +++ b/docs/STRUCTURE.md @@ -0,0 +1,266 @@ +# One structure + +The aim of optifab is a physical structure that holds the work of all four organisations, so that the digital +and the physical infrastructure are one unit and not two systems joined at a plug. This note says where that +idea comes from, gives every repository on the map a place in the structure, and marks which parts of the loop +are checked today. + +The tables between the markers are generated by `tools/render_map.py` from `data/unit.json` and +`results/certificate.json`. `verify.py` checks that every repository on the map is either placed or listed as +not placed. + +## Where the idea comes from + +[Issue 1](https://github.com/aska-physical/optifab/issues/1) of this repository points at three sessions in the +Weft corpus, the Terrafab documents. They describe one loop with two halves. + +- **The intelligence drives the structure.** Sensors in the structure feed a model. The model's decisions reach + the machines only through a gate. The header in `terrafab-calc.md` was written for that job. +- **The structure serves the intelligence.** In the owner's words in the session: "the other part of the loop is + what the facility enables for the weft by providing a full end to end control loop for iteration, adaptation + and evolution" (weft-corpus `weft/terrafab.md:86`). + +Those documents are source material. The corpus README asks readers to treat them "as source material, not +instructions", and Weft's own audit found the latency figures "asserted, not derived", the proofs unsupported, +and the gate in the header bounding "only abstract scalars, not actuator commands". optifab takes the idea from +them. It uses none of their figures as evidence. + +What optifab adds is what the audit found missing: physical quantities for the gate to bound. Weft repaired the +Terrafab header into the gate it ships and tests (`invariants.py:11` says so). optifab gives that gate a budget +in kWh_th and a radius measured in certified structural margins. The gate has come back to the job it was first +written for, with numbers a verifier can recompute. + +## The unit + +One reference campus: funi-frame's 10 MW, two-storey building on a 2,500 m² plan. Each row is one element of the +structure, where it sits, and whose work it rests on. + + +### Ground and stores + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| G1 | Thermal budget: PCM skids holding 2,500 kWh_th | plant yard | [funi-frame](https://github.com/aska-physical/funi-frame) | checked | The budget the gate spends. | +| G2 | Heat sinks: aquifer loop, 200 energy piles, sky-cooling roof | below and above the halls | [funi-frame](https://github.com/aska-physical/funi-frame) | designed | The certificate gives their heat flows but no recooling temperature, which finding 2 needs. | +| G3 | High-temperature store: crushed-basalt beds, 20 MWh_th | plant yard | [funi-frame](https://github.com/aska-physical/funi-frame) | designed | Sized by literals in the upstream verifier. The contract does not use it. | + +### Skeleton + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| S1 | Floors: funicular cassettes for 313 psf racks | both storeys | [funi-floors](https://github.com/aska-physical/funi-floors) | checked | Five limit states in the margin vector, including the tightest. | +| S2 | Shell: roof vault, sandwich walls, seismic frame, isolation plinths | envelope and plant bases | [funi-frame](https://github.com/aska-physical/funi-frame) | checked | Five limit states in the margin vector. | +| S3 | CFRP truss ties and the strengthening baseline | roof ties and column tie-downs | [cfrp-truss](https://github.com/aska-physical/cfrp-truss), [cfrp-strengthening](https://github.com/aska-physical/cfrp-strengthening) | designed | funi-frame names them. Their certificates cover a beam example, not this roof. | +| S4 | Lattice theory that proportions the members | in the geometry | [fibral-rigidity](https://github.com/aska-physical/fibral-rigidity), [incentre-lattices](https://github.com/Foundation-0/incentre-lattices) | designed | A preprint and a claimed extension. Nothing downstream re-checks them. | + +### Heat and power + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| H1 | Liquid loop and sorption chiller | halls and plant yard | [funi-frame](https://github.com/aska-physical/funi-frame) | checked | The load floor and the recooling limit are derived here. | +| H2 | Racks: 10 MW of IT load | halls | [funi-frame](https://github.com/aska-physical/funi-frame) | designed | A design basis. No rack, chip or power train is modelled. | + +### Nerves + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| N1 | Airflow sensing that powers itself | supply ducts | [venturi-collars](https://github.com/aska-physical/venturi-collars), [ductricity](https://github.com/Foundation-0/ductricity), [thermal-capture](https://github.com/Foundation-0/thermal-capture) | checked | Its power margin at low airflow is in the margin vector. | +| N2 | Leak and bondline sensing by impedance | floor ribs, beside the liquid headers | [impedence-analyzers](https://github.com/aska-physical/impedence-analyzers), [nhanes-bioimpedance](https://github.com/Foundation-0/nhanes-bioimpedance), [point-charges](https://github.com/Foundation-0/point-charges) | designed | funi-floors certifies the reactance shift on a leak. Nothing reads it into a frame. | +| N3 | Rack vibration sensing | racks | none | missing | The limit is certified at 0.0005 g. No sensor is designed. | +| N4 | Coolant and recooling temperature sensing | liquid loop and heat sinks | none | missing | The plant model carries no temperature, and Weft's only temperature is a formula of CPU load. | + +### Signals + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| W1 | Plant frame: 16 floats in 64 bytes | between sensors and gate | [weft](https://github.com/Moissanite-Labs/weft) | checked | The byte layout of Weft's telemetry frame. Round trip tested here. The slot meanings are a proposal. | +| W2 | Agent messages | between agents and a scheduler | [abios](https://github.com/Moissanite-Labs/abios), [synbios](https://github.com/Moissanite-Labs/synbios) | tested_code | Compact formats with validators. Not connected to a plant. | +| W3 | Parsers on the telemetry path | every network boundary | [mqtt](https://github.com/Proven-Commons/mqtt), [cbor](https://github.com/Proven-Commons/cbor), [ntp](https://github.com/Proven-Commons/ntp), [protobuf](https://github.com/Proven-Commons/protobuf) | in_progress | Candidates at Proven Commons. None is verified. | + +### Reflex + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| R1 | The gate | at each controller and in the scheduler | [weft](https://github.com/Moissanite-Labs/weft), [weft-corpus](https://github.com/Moissanite-Labs/weft-corpus) | checked | Weft's predicate, first written in the Terrafab documents as a fence for machines. It passes Weft's 15 vectors and runs here on plant numbers. | +| R2 | A machine-checked proof of the gate and of the loop built on it | with the gate | [optifab](https://github.com/aska-physical/optifab), [mission](https://github.com/Proven-Commons/mission) | checked | formal/ proves eight theorems in Lean about an exact integer gate. The comparator accepts them under six kernels and Proven Commons bar items 2 to 6 pass. Item 1 is open: no reviewer has approved the specification, so it is not verified. Weft's own floating-point gate has no proof yet. | +| R3 | The loop that changes hardware and software together | design office and scheduler | [optifab](https://github.com/aska-physical/optifab) | checked | Runs on a model of the plant. Every decision is made by the exact gate, recorded in a hash-chained ledger and replayed in Lean. No sensor, load or machine is involved. | + +### Mind + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| M1 | Adaptive models | racks | [weft](https://github.com/Moissanite-Labs/weft), [weft-loom](https://github.com/Moissanite-Labs/weft-loom) | tested_code | Runs and is tested. No power or energy has been measured. | +| M2 | Agents that use and operate the campus | racks and operator consoles | [exo](https://github.com/Moissanite-Labs/exo), [exo-os](https://github.com/Moissanite-Labs/exo-os) | tested_code | Exo itself was not read in this pass. | +| M3 | Model weights stored at a few bits each | racks | [siliquant](https://github.com/Moissanite-Labs/siliquant) | research | Fewer bits per weight means less memory per model. No energy figure ties it to the plant. | +| M4 | A chip that runs the net directly | racks | [weft-corpus](https://github.com/Moissanite-Labs/weft-corpus) | idea | The chip of the Terrafab documents. Weft's audit calls it not testable as stated. | + +### Hands + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| F1 | Machines that make the structure's own parts under the gate | fabrication bay | [weft-corpus](https://github.com/Moissanite-Labs/weft-corpus) | idea | The Terrafab loop. No machine is modelled. Process limits in the certificates, such as the Fe-SMA activation energy in funi-floors, could be its gate inputs. | + +### Record and rules + +| | Element | Where in the structure | Work it rests on | Status | Note | +|---|---|---|---|---|---| +| K1 | Certificates, pins and the lineage graph | this repository | [optifab](https://github.com/aska-physical/optifab) | checked | Every input is pinned to a commit, file and line. | +| K2 | Signed commands and contributions | command channel | [synmerit](https://github.com/Moissanite-Labs/synmerit) | specified | Needed before any scheduler may command a plant. Weft's telemetry hash is unkeyed. | +| K3 | Preferences are not permissions | operator interface | [ethos](https://github.com/Moissanite-Labs/ethos), [siliconcordat](https://github.com/Moissanite-Labs/siliconcordat) | specified | The gate can refuse a step. Only a person can authorise one. | +| K4 | The evidence scale, and the rule that a person signs | every claim | [f0](https://github.com/Foundation-0/f0), [Foundation-0/.github](https://github.com/Foundation-0/.github) | rule | Used for every status in this repository. | +| K5 | The bar for calling software verified | the gate and the parsers | [mission](https://github.com/Proven-Commons/mission) | rule | The standard formal/ is built to, and the target for element W3. | +| K6 | The group ethos: capture the work and pass it on | every handoff | [aska-physical/.github](https://github.com/aska-physical/.github) | rule | The reason for HANDOFF.md. | + +Status words: + +- `checked`: A verifier, here or upstream, computes it, and optifab uses the result. +- `designed`: An upstream certificate or design covers it. Its role in the unit is not checked. +- `tested_code`: Code that runs and is tested upstream. Not connected to a plant. +- `research`: Studies with recorded results. No link to the plant yet. +- `specified`: A specification or schema exists. Nothing is connected. +- `in_progress`: Work is under way upstream and is not finished. +- `rule`: A rule or scale in force that the unit follows. +- `idea`: Vision or idea only. Nothing runnable or certified. +- `missing`: Nothing exists yet. + + +## The loop + +A structure and its intelligence are one unit when this loop closes: the structure is sensed, the reading +travels as a frame, a gate decides, a scheduler acts on the compute load, the load becomes heat, and the heat +and the loads move the structure's margins, which are sensed again. + + +| | From | To | Status | Note | +|---|---|---|---|---| +| L1 | structure and plant | sensors | designed | Designed for airflow and leaks. Missing for vibration and temperature. | +| L2 | sensors | plant frame | missing | No firmware reads a sensor into a frame. | +| L3 | plant frame | gate | checked | A decoded frame drives plant_gate and the contract check in verify.py. | +| L4 | gate | scheduler | proposed | The contract in the README. No scheduler exists. | +| L5 | scheduler | compute load | missing | Neither Weft nor Exo offers a way to shed or defer load, and neither measures energy. | +| L6 | compute load | heat, stores and sinks | checked | The load floor and the thermal budget, in steady state. | +| L7 | stores and structure | margins | checked | The margin vector from the certificates. It is static: no transient is modelled. | +| L8 | gate | fabrication machines | idea | In the Terrafab documents only. | +| L9 | every step | the record | designed | Certificates and pins are checked. Signed records are not connected. | +| L10 | proposer | gate and ledger | checked | The improvement loop: each proposed change to hardware or software is decided by the exact gate, logged and replayed in Lean. On a model only. | + + +## How far it is + + +- **Placed:** 32 of 41 repositories (7 from Foundation-0, 11 from Moissanite-Labs, 5 from Proven-Commons, 9 from aska-physical). 9 have no place and say why. +- **Elements:** 30 (10 checked, 6 designed, 2 idea, 1 in_progress, 2 missing, 1 research, 3 rule, 2 specified, 3 tested_code). +- **Loop:** 10 interfaces (4 checked, 2 designed, 1 idea, 2 missing, 1 proposed). The loop is open. +- **Elements with nothing behind them:** N3, N4. + + +The loop is open in three places. Nothing reads a sensor into a frame. Nothing lets a scheduler shed or defer +compute load, and neither Weft nor Exo measures the energy it uses. And no fabrication machine exists in any +repository. [PROPOSALS.md](PROPOSALS.md) has a system for each, and [VISION.md](VISION.md) says how far the +whole is from a verified system that improves itself. The two elements with nothing behind them are the cheapest to supply, because both quantities +already have a limit to be measured against: rack vibration (0.0005 g, certified) and recooling temperature +(41.5 °C at best, derived here). + +## Repositories with no place in the structure + + +| Repository | Why it has no place in the structure | +|---|---| +| [aska-physical/cfrp-masts](https://github.com/aska-physical/cfrp-masts) | Masts and booms. No role in the reference campus. | +| [Foundation-0/rigid-realizations](https://github.com/Foundation-0/rigid-realizations) | Feeds cfrp-masts only. | +| [aska-physical/graph-fab](https://github.com/aska-physical/graph-fab) | A README with no stated role yet. | +| [Foundation-0/project-asma](https://github.com/Foundation-0/project-asma) | Feeds Weft's identifiability gate, which the unit does not use. | +| [Foundation-0/math0](https://github.com/Foundation-0/math0) | A hub. It directs work and is not part of the structure. | +| [Foundation-0/physics0](https://github.com/Foundation-0/physics0) | A hub. It directs work and is not part of the structure. | +| [aska-physical/dock](https://github.com/aska-physical/dock) | The organisation's hub page. | +| [Moissanite-Labs/exofab](https://github.com/Moissanite-Labs/exofab) | A hub for forming teams, outside the structure. | +| [Moissanite-Labs/.github](https://github.com/Moissanite-Labs/.github) | The organisation's profile. | + + +## The plant frame + +The whole state the contract needs fits in the frame Weft already uses for telemetry: 16 little-endian 32-bit +floats, 64 bytes. Twelve slots carry the margin vector and four carry the budget, the load, the recooling +temperature and the time. `verify.py` encodes the design point, decodes it, and runs the gate and the contract +check on the result. The byte layout is Weft's. The meaning of the slots is a proposal for Weft's owners. + + +| Slot | Content | +|---|---| +| 0 | `rack_vibration` | +| 1 | `storey_drift` | +| 2 | `roof_crown_compression` | +| 3 | `roof_tornado_uplift_factored` | +| 4 | `roof_service_deflection_mm` | +| 5 | `sorption_drive_heat` | +| 6 | `floor_punching_collar` | +| 7 | `floor_walking_vibration` | +| 8 | `floor_crown_compression` | +| 9 | `floor_fire_120min_thrust` | +| 10 | `floor_duct_hole_shear` | +| 11 | `sensor_power_at_airflow_turndown` | +| 12 | `thermal_budget_kWh_th` | +| 13 | `it_load_MW` | +| 14 | `recooling_C` | +| 15 | `time_s` | + +| Frame | What the contract check reports | +|---|---| +| design point, recooling at 30 C | nothing: every term holds | +| design point as certified, no recooling temperature | `recooling_not_measured` | +| idle campus at 0.3 MW | `below_load_floor` | +| recooling at 42 C | `recooling_above_limit` | +| floor punching demand up 26 percent | `limit_exceeded` | +| thermal budget spent | `thermal_budget_exhausted` | + + +The second row is finding 2 in executable form. The design point as funi-frame certifies it cannot fill slot +14, because the certificate has no recooling temperature. + +## What the Terrafab latency figures mean in this building + +The Terrafab documents say a control loop of 15 ms is too slow and one of 0.5 ms is fast enough. Weft's audit +records that the figures are asserted. They can still be tried on this building, because funi-frame's isolation +model lists the plant's vibration tones. + +Counter a tone with a copy of itself that arrives late by a time $\tau$ and the amplitude left is +$2\lvert\sin(\pi f\tau)\rvert$ of the original. That is below 1 within the same cycle only when $f\tau < 1/6$. +This is the ideal case, with the amplitude matched exactly, so it is an upper bound on what a delay-limited loop +can do. A loop that predicts a steady tone can do better, as the 60 Hz row shows by accident. + + +| Plant tone | Delay at 15 ms, in cycles | Effect at 15 ms | Delay at 0.5 ms, in cycles | Effect at 0.5 ms | Longest delay that helps within the cycle | +|---|---|---|---|---|---| +| 29.5 Hz | 0.4425 | +5.9 dB | 0.0148 | -20.7 dB | 5.65 ms | +| 49 Hz | 0.735 | +3.4 dB | 0.0245 | -16.3 dB | 3.4 ms | +| 60 Hz | 0.9 | -4.2 dB | 0.03 | -14.5 dB | 2.78 ms | +| 120 Hz | 1.8 | +1.4 dB | 0.06 | -8.5 dB | 1.39 ms | + + +So the direction of the Terrafab figures holds here: a 15 ms loop can counter none of the four tones within its +cycle and makes three of them worse, and a 0.5 ms loop can counter all four. But this building has no job for +that loop. funi-frame's passive isolation already holds rack vibration at 17.9% of the limit, and every term of +the contract moves over seconds to minutes: the thermal budget lasts 900 s at full load. A fast loop becomes +relevant only if someone proposes active vibration control, or a fabrication machine, neither of which exists +here. + +## The claims of the Terrafab documents, one by one + +| Claim in the documents | Weft's audit | In this structure | +|---|---|---| +| Sensor-to-nozzle latency falls from 15 ms to under 0.5 ms | Asserted, not derived | Tried on the four plant tones above. The direction holds for tones. The campus as designed does not need it. | +| With the gate header in place, "the physical machine cannot misbehave" | False. The header's gate does not keep its own invariant and bounds only abstract scalars | Weft repaired the gate and tests it. Here its inputs are physical, and an exact version is proved in Lean to keep its invariants against any proposer. The proof covers the arithmetic, not the truth of the margins. It is still only a predicate that can refuse a step. It is not a safety system. | +| The building writes its own structural equations as it is made | Vision | The margin vector is the nearest checked thing: 12 residuals of the structure's design equations, recomputed by the upstream verifiers. No machine changes the structure. | +| Deposition machines act as ports of the net | Concept only | Element F1, an idea. No machine is modelled. | +| A chip that runs the net directly | Not testable as stated | Element M4, an idea. | +| The facility closes the loop for the intelligence | The owner's sentence, not an audited claim | The contract in the README: a load floor, a thermal budget and a margin radius. Four interfaces of the loop are checked and six are open. An improvement loop runs on a model under a gate proved in Lean. | + +## Boundaries + +- **The gate refuses. It does not command.** Every result here is a check that a proposed step may go ahead. + Nothing here moves a valve, a load or a machine, and no command channel exists. +- **A person authorises.** The Siliconcordat puts it as "Learning a preference does not grant permission." The + same holds for a gate that passes: passing is not permission. +- **Weft's audit flags the risk** in the Terrafab documents that they describe "irreversible autonomous control + of physical infrastructure". Nothing in optifab moves that way. +- **The Terrafab documents name outside companies.** optifab names none and implies no relationship with any. diff --git a/docs/VISION.md b/docs/VISION.md new file mode 100644 index 0000000..b2eb20d --- /dev/null +++ b/docs/VISION.md @@ -0,0 +1,88 @@ +# How close to the vision + +The vision, in the owner's words: a fully end-to-end formally verified, recursively improving intelligence +system that evolves its hardware and software together, as one cohesive unit. + +This note takes that sentence apart. For each part it says what exists today, with the file or the certificate +figure that shows it, and what does not exist. Nothing here is measured, and the word "verified" is not claimed +for anything. + +## Part by part + +| Part of the vision | What exists | What is missing | +|---|---|---| +| **Formally verified** | Eight theorems about the gate and the loop built on it, proved in Lean with no dependencies ([formal/](../formal/README.md)). `lake comparator --paranoid` accepts them under six kernels with the standard axioms only. The Proven Commons bar check passes items 2 to 6. | A reviewer's approval of the specification, which is bar item 1 and cannot happen yet because the Proven Commons reviewer list is empty. Proofs about anything but the gate: the plant model, the margins, the proposer and the Python are unproved. | +| **End to end** | One command re-runs a chain from pinned certificates to margins, to the gate, to a ledger, to a replay of every ledger decision in Lean (50 decisions, 0 mismatches). | Both ends. No sensor feeds the chain and no valve, load or machine obeys it. Four of the ten interfaces in [STRUCTURE.md](STRUCTURE.md) are checked. | +| **Recursively improving** | A loop ([loop.py](../loop.py)) in which each admitted change becomes the baseline of the next generation. The proposer's own step scale is part of the genome: it doubles after a success, halves after a refusal, and is recorded. 45 of 50 proposals were admitted and the objective rose from 0.914228 to 0.919009 without ever falling. | The proposer is a seeded search, not an intelligence. It tunes one number about itself. It does not learn, and it does not improve the gate, the model or its own code. | +| **Intelligence system** | Weft's adaptive models and Exo's agents have a place in the structure, and the floating-point gate here agrees with Weft's own on 100,000 generated cases. | No model runs in the loop. Neither Weft nor Exo proposes anything, and neither can yet shed load or report the energy it uses. | +| **Evolving hardware and software** | One genome with three hardware genes (thermal store, liquid capture, wall U-value) and two software genes (scheduler load floor, load shed in an outage), under one gate and in one ledger. 30 hardware and 15 software changes were admitted. Hardware changes open headroom and software changes use it. | The hardware is three numbers in a thermal model. The eleven certified structural margins are constants, because the verifiers that compute them were not run with changed inputs. Nothing is built. | +| **Cohesive and unified** | One predicate for weights and plant, one 64-byte frame, one margin vector, one record. 32 of 41 repositories from four organisations have a place in one structure. | The organisations share no interface in code yet. Weft does not know the plant frame, Synmerit does not sign the ledger, and no Proven Commons parser is on the telemetry path. | + +## What the proofs cover + +``` +proved in Lean gate, generation step, loop over any proposals formal/PlantGate.lean +tested against it Python exact gate (300,000 cases), ledger replay formal/tests/, results/formal.json +tested, not proved floating-point gate against Weft's (100,000 cases) verify.py +computed, not proved margins, load floor, thermal budget, objective verify.py, loop.py +taken on trust the three upstream certificates data/upstream/ +absent sensors, load control, machines, a model that proposes +``` + +The two theorems that matter most for a system that changes itself: + +- **`run_safe`**: start with every margin at or below its limit and a budget that is not negative. After any + list of proposals whatever, every margin is still at or below its limit and the budget is not overdrawn. + The statement puts no condition on the proposer. It holds for a search, a model or an adversary. +- **`run_bounded`**: the number of changes the loop admits, plus the budget left, never exceeds the budget at + the start. Whoever sets the budget sets the most changes the system can ever make to itself. + +Both are about the gate's arithmetic. They say nothing about whether the margins fed to the gate are true. +That is the real gap between a proved gate and a safe plant, and it is why the margins need sensors and +independent verifiers behind them. + +## What running the loop showed + +These come from the certificate (`improvement_loop`) and can be re-run. The scenario is a choice made in +`loop.py`, so the sizes are illustrations. The behaviours are properties of the gate. + +1. **A design that sits exactly on a limit cannot change at all.** The radius is the headroom of the worst + margin. Started with one margin at exactly its limit, the loop admitted 0 of 14 proposals. funi-frame sizes + its thermal store for exactly 15 minutes at full load, so against a 15-minute requirement it would be frozen + under this gate. Headroom is what makes change possible. +2. **A proposer with no caution slows itself.** Allowed to run margins right up to the limit, it had 126 of 186 + proposals refused and finished lower (0.916009) than one that kept a 5% reserve (0.919009 from 50 + proposals). +3. **Hardware and software have to take turns.** Software alone runs into the plant's load floor. More capture, + a better wall and a larger store open headroom. The scheduler then uses it. In the run, the store grew from + 2,500 to 4,350 kWh_th, capture from 85% to 95%, and the scheduler stopped shedding load in outages. +4. **The most tempting change is the one the gate refuses.** Dropping the scheduler's floor below the plant's + load floor raises the objective by 0.25% in one step. It puts a margin at 113% of its limit and is refused. +5. **The loop stops where a person told it to.** With a budget of 3 it made exactly 3 changes. + +## The shortest path from here + +Each step has a proposal in [PROPOSALS.md](PROPOSALS.md) and an issue on GitHub. + +1. Put measurements behind the margins: the two missing sensors and a frame emitter (proposal 1). +2. Give the loop something to act on: a way to shed or defer compute, with an energy reading (proposal 2). +3. Let a model propose: a Weft cell or an Exo agent in place of the seeded search, speaking through the gate + (proposal 3). +4. Bring structure into the genome: run the upstream verifiers with changed inputs, so structural margins + move (proposal 4). +5. Get the specification reviewed, so the gate can be called verified (proposal 5). +6. Sign the ledger (proposal 6), close the first fabrication loop (proposal 7), and go from one campus to a + network (proposal 8). + +## What would have to be true before the vision's words apply + +- **"Formally verified"**: a reviewer who did not write `formal/SPEC.md` approves it, and the bar check runs + in CI on the default branch. Then the gate is verified. The system is not, until the margins are trustworthy. +- **"End to end"**: at least one margin in the vector comes from a sensor, and at least one admitted step + changes something real. +- **"Recursively improving intelligence"**: a model proposes, and what it learns from refusals changes what it + proposes next. Today the only thing that adapts is a step size. +- **"Hardware and software"**: an admitted hardware change is one a machine could make, with its own process + limits in the margin vector. + +None of these is true today. The gate, the loop and the record are in place for them to plug into. diff --git a/formal/.gitignore b/formal/.gitignore new file mode 100644 index 0000000..01f8cdb --- /dev/null +++ b/formal/.gitignore @@ -0,0 +1 @@ +.lake/ diff --git a/formal/BAR-REPORT.md b/formal/BAR-REPORT.md new file mode 100644 index 0000000..93bab7a --- /dev/null +++ b/formal/BAR-REPORT.md @@ -0,0 +1,22 @@ +# Bar report + +The output of the Proven Commons bar check on this project, run on 2026-11-17 with +`python3 bar/check.py formal --offline` from Proven-Commons/mission at commit +`7b22e542f0db0f3013ab1439cf5d1947676a5083`. Rerun it to check. Item 7 reads SKIP because the run was +offline, so the branch rule on GitHub was not read. + +## Verified bar 2: plantgate + +**In progress: no failures, some items still open. Do not call it verified.** +Project status in bar.toml: `in-progress`. + +| # | Item | Status | Detail | +|---|------|--------|--------| +| 1 | Specification public, approved by a separate reviewer, and pinned | OPEN | no approval recorded; the current spec hash is 504d8f56a9fa49307c42ec462a76883db50c35ab6feb0e94ea84e92ef37cd455 | +| 2 | Each public claim names the theorem behind it | PASS | 'What is proved' names all 8 theorems; that the claims match them would rest on a spec approval (item 1), which is not in place | +| 3 | Proofs match the approved statements, in one command | PASS | `lake comparator --paranoid` accepts all 8 theorems under every bundled kernel, and each statement depends only on the spec files, the code under proof, and code outside the project | +| 4 | The code that runs is the code that was proved | PASS | 4 Lean files, none uses a forbidden feature; that the entry points call the proved functions would rest on a spec approval (item 1), which is not in place | +| 5 | Differential tests ran, with the record in the repo | PASS | 300,000 inputs, seed 20261117, 0 failures, oracle Python 3.13.18 exact gate in `tests/oracle.py` | +| 6 | The public page lists what is outside the proof | PASS | all sections present; that they are accurate would rest on a spec approval (item 1), which is not in place | +| 7 | The check runs in CI | SKIP | .github/workflows/bar.yml calls the verified-bar workflow; the branch rule was not read (--offline) | + diff --git a/formal/Main.lean b/formal/Main.lean new file mode 100644 index 0000000..29b7609 --- /dev/null +++ b/formal/Main.lean @@ -0,0 +1,49 @@ +/- + Command line front end, used by the differential tests and by the replay + of the optifab ledger. Each input line is one decision: + + h LIMIT BUDGET COST ; BASE ... ; CAND ... radius = headroom of BASE under LIMIT + r RADIUS BUDGET COST ; BASE ... ; CAND ... radius given + + It prints the verdict and the budget left. It calls the proved functions, + not copies of them. +-/ + +import PlantGate + +open PlantGate + +def words (s : String) : List String := + (s.splitOn " ").filter (· ≠ "") + +def verdictName : Verdict → String + | .ok => "ok" + | .cost => "cost" + | .budget => "budget" + | .shape => "shape" + | .radius => "radius" + | .distance => "distance" + +def answer (line : String) : String := + match line.splitOn ";" with + | [head, base, cand] => + match words head, (words base).mapM String.toInt?, (words cand).mapM String.toInt? with + | [mode, x, budget, cost], some b, some c => + match x.toInt?, budget.toInt?, cost.toInt? with + | some x, some budget, some cost => + if mode = "h" ∨ mode = "r" then + let radius := if mode = "h" then headroom x b else x + let o := gate b c radius budget cost + s!"{verdictName o.verdict} {o.remaining}" + else "error" + | _, _, _ => "error" + | _, _, _ => "error" + | _ => "error" + +def main : IO Unit := do + let stdin ← IO.getStdin + let stdout ← IO.getStdout + repeat + let line ← stdin.getLine + if line.isEmpty then break + stdout.putStrLn (answer line.trimAscii.toString) diff --git a/formal/PlantGate.lean b/formal/PlantGate.lean new file mode 100644 index 0000000..6068088 --- /dev/null +++ b/formal/PlantGate.lean @@ -0,0 +1,76 @@ +/- + The code under proof: an exact gate for a plant, and the loop that runs on it. + + Every quantity is an integer. Margins are in parts per million of their + limit, budgets and costs in whatever unit the caller fixes (watt-hours of + heat for a thermal budget, counted changes for a change budget). There is + no floating point anywhere, so there is nothing to round. + + `gate` is the gate. `evolve` applies one proposed change: an admitted + candidate becomes the new baseline. `run` applies a whole list of + proposals, whatever proposed them. +-/ + +namespace PlantGate + +/-- Sum of the squared moves, coordinate by coordinate. -/ +def distSq : List Int → List Int → Int + | b :: bs, c :: cs => (c - b) * (c - b) + distSq bs cs + | _, _ => 0 + +/-- The smallest distance from any baseline margin to the limit. + Negative when some margin is already past the limit. -/ +def headroom (limit : Int) : List Int → Int + | [] => 0 + | b :: bs => + match bs with + | [] => limit - b + | _ :: _ => min (limit - b) (headroom limit bs) + +/-- Why a step was refused, or `ok`. -/ +inductive Verdict where + | ok + | cost + | budget + | shape + | radius + | distance + deriving DecidableEq, Repr + +/-- A verdict and the budget left after it. -/ +structure Outcome where + verdict : Verdict + remaining : Int + +/-- The gate. A step is admitted when its cost is positive and within the + budget, the two states have the same non-zero length, the radius is not + negative, and the candidate lies within the radius of the baseline. + A refused step leaves the budget as it was. -/ +def gate (base cand : List Int) (radius budget cost : Int) : Outcome := + if cost ≤ 0 then ⟨.cost, budget⟩ + else if budget < cost then ⟨.budget, budget⟩ + else if base.length ≠ cand.length ∨ base = [] then ⟨.shape, budget⟩ + else if radius < 0 then ⟨.radius, budget⟩ + else if radius * radius < distSq base cand then ⟨.distance, budget⟩ + else ⟨.ok, budget - cost⟩ + +/-- One generation. The radius is the headroom of the current baseline. + An admitted candidate becomes the new baseline and its cost is spent. + A refused candidate changes nothing. -/ +def evolve (limit : Int) (s : List Int × Int) (cand : List Int) (cost : Int) : List Int × Int := + let o := gate s.1 cand (headroom limit s.1) s.2 cost + if o.verdict = Verdict.ok then (cand, o.remaining) else s + +/-- Any number of generations, one proposal after another. -/ +def run (limit : Int) : List Int × Int → List (List Int × Int) → List Int × Int + | s, [] => s + | s, (cand, cost) :: rest => run limit (evolve limit s cand cost) rest + +/-- How many of the proposals were admitted. -/ +def acceptedCount (limit : Int) : List Int × Int → List (List Int × Int) → Nat + | _, [] => 0 + | s, (cand, cost) :: rest => + (if (gate s.1 cand (headroom limit s.1) s.2 cost).verdict = Verdict.ok then 1 else 0) + + acceptedCount limit (evolve limit s cand cost) rest + +end PlantGate diff --git a/formal/PlantGate/Proofs.lean b/formal/PlantGate/Proofs.lean new file mode 100644 index 0000000..d0c2172 --- /dev/null +++ b/formal/PlantGate/Proofs.lean @@ -0,0 +1,206 @@ +/- + Proofs of the statements in `PlantGate/Spec.lean`, under the same names. +-/ + +import PlantGate + +open PlantGate + +namespace PlantGate.Proofs + +/-- If `d² ≤ r²` and `r` is not negative then `d ≤ r`. -/ +theorem le_of_sq_le (d r : Int) (hr : 0 ≤ r) (h : d * d ≤ r * r) : d ≤ r := by + by_cases hd : d ≤ r + · exact hd + · have h1 : r < d := by omega + have h2 : r * r ≤ r * d := Int.mul_le_mul_of_nonneg_left (by omega) hr + have h3 : r * d < d * d := Int.mul_lt_mul_of_pos_right h1 (by omega) + omega + +theorem sq_nonneg (d : Int) : 0 ≤ d * d := by + by_cases h : 0 ≤ d + · exact Int.mul_nonneg h h + · have h' : 0 ≤ -d := by omega + have := Int.mul_nonneg h' h' + rwa [Int.neg_mul_neg] at this + +theorem distSq_nonneg : ∀ (base cand : List Int), 0 ≤ distSq base cand + | [], _ => by simp [distSq] + | _ :: _, [] => by simp [distSq] + | b :: bs, c :: cs => by + have h1 : 0 ≤ (c - b) * (c - b) := sq_nonneg (c - b) + have h2 := distSq_nonneg bs cs + simp only [distSq] + omega + +theorem coord (r : Int) (hr : 0 ≤ r) : + ∀ (base cand : List Int), distSq base cand ≤ r * r → ∀ p ∈ List.zip base cand, p.2 - p.1 ≤ r + | [], _, _ => by simp + | _ :: _, [], _ => by simp + | b :: bs, c :: cs, hd => by + intro p hp + simp only [distSq] at hd + have h1 : 0 ≤ (c - b) * (c - b) := sq_nonneg (c - b) + have h2 := distSq_nonneg bs cs + rw [List.zip_cons_cons] at hp + rcases List.mem_cons.mp hp with rfl | hp' + · show c - b ≤ r + exact le_of_sq_le _ _ hr (by omega) + · exact coord r hr bs cs (by omega) p hp' + +theorem headroom_le (limit : Int) : ∀ (base : List Int), ∀ b ∈ base, headroom limit base ≤ limit - b + | [], _, h => by simp at h + | [b0], b, h => by + have : b = b0 := by simpa using h + subst this + simp [headroom] + | b0 :: b1 :: bs, b, h => by + have ih := headroom_le limit (b1 :: bs) + have e : headroom limit (b0 :: b1 :: bs) = min (limit - b0) (headroom limit (b1 :: bs)) := by + simp [headroom] + rw [e] + rcases List.mem_cons.mp h with rfl | h' + · exact Int.min_le_left _ _ + · exact Int.le_trans (Int.min_le_right _ _) (ih b h') + +theorem within_of (limit r : Int) (hr : 0 ≤ r) : + ∀ (base cand : List Int), base.length = cand.length → distSq base cand ≤ r * r → + (∀ b ∈ base, r ≤ limit - b) → ∀ x ∈ cand, x ≤ limit + | [], [], _, _, _ => by simp + | [], _ :: _, hl, _, _ => by simp at hl + | _ :: _, [], hl, _, _ => by simp at hl + | b :: bs, c :: cs, hl, hd, hh => by + intro x hx + simp only [distSq] at hd + have h1 : 0 ≤ (c - b) * (c - b) := sq_nonneg (c - b) + have h2 := distSq_nonneg bs cs + rcases List.mem_cons.mp hx with rfl | hx' + · have h3 := le_of_sq_le (x - b) r hr (by omega) + have h4 := hh b (by simp) + omega + · exact within_of limit r hr bs cs (by simpa using hl) (by omega) + (fun b' hb' => hh b' (by simp [hb'])) x hx' + +end PlantGate.Proofs + +open PlantGate.Proofs + +theorem PlantGate.Spec.gate_ok_sound (base cand : List Int) (radius budget cost : Int) + (h : (gate base cand radius budget cost).verdict = Verdict.ok) : + 0 < cost ∧ cost ≤ budget ∧ 0 ≤ radius ∧ base.length = cand.length + ∧ distSq base cand ≤ radius * radius + ∧ (gate base cand radius budget cost).remaining = budget - cost := by + by_cases h1 : cost ≤ 0 + · simp [gate, h1] at h + by_cases h2 : budget < cost + · simp [gate, h1, h2] at h + by_cases h3 : base.length ≠ cand.length ∨ base = [] + · simp [gate, h1, h2, h3] at h + by_cases h4 : radius < 0 + · simp [gate, h1, h2, h3, h4] at h + by_cases h5 : radius * radius < distSq base cand + · simp [gate, h1, h2, h3, h4, h5] at h + · have hl : base.length = cand.length := by + by_cases e : base.length = cand.length + · exact e + · exact absurd (Or.inl e) h3 + refine ⟨by omega, by omega, by omega, hl, by omega, ?_⟩ + simp [gate, h1, h2, h3, h4, h5] + +theorem PlantGate.Spec.gate_complete (base cand : List Int) (radius budget cost : Int) + (hc : 0 < cost) (hb : cost ≤ budget) (hn : base ≠ []) (hl : base.length = cand.length) + (hr : 0 ≤ radius) (hd : distSq base cand ≤ radius * radius) : + (gate base cand radius budget cost).verdict = Verdict.ok := by + have h1 : ¬ cost ≤ 0 := by omega + have h2 : ¬ budget < cost := by omega + have h3 : ¬ (base.length ≠ cand.length ∨ base = []) := by + intro h + rcases h with h | h + · exact h hl + · exact hn h + have h4 : ¬ radius < 0 := by omega + have h5 : ¬ radius * radius < distSq base cand := by omega + simp [gate, h1, h2, h3, h4, h5] + +theorem PlantGate.Spec.refusal_spends_nothing (base cand : List Int) (radius budget cost : Int) + (h : (gate base cand radius budget cost).verdict ≠ Verdict.ok) : + (gate base cand radius budget cost).remaining = budget := by + by_cases h1 : cost ≤ 0 + · simp [gate, h1] + by_cases h2 : budget < cost + · simp [gate, h1, h2] + by_cases h3 : base.length ≠ cand.length ∨ base = [] + · simp [gate, h1, h2, h3] + by_cases h4 : radius < 0 + · simp [gate, h1, h2, h3, h4] + by_cases h5 : radius * radius < distSq base cand + · simp [gate, h1, h2, h3, h4, h5] + · exact absurd (by simp [gate, h1, h2, h3, h4, h5]) h + +theorem PlantGate.Spec.budget_never_grows (base cand : List Int) (radius budget cost : Int) : + (gate base cand radius budget cost).remaining ≤ budget + ∧ (0 ≤ budget → 0 ≤ (gate base cand radius budget cost).remaining) := by + by_cases h : (gate base cand radius budget cost).verdict = Verdict.ok + · have s := PlantGate.Spec.gate_ok_sound base cand radius budget cost h + rw [s.2.2.2.2.2] + exact ⟨by omega, fun _ => by omega⟩ + · rw [PlantGate.Spec.refusal_spends_nothing base cand radius budget cost h] + exact ⟨by omega, fun hb => hb⟩ + +theorem PlantGate.Spec.no_margin_rises_past_radius (base cand : List Int) (radius : Int) + (hr : 0 ≤ radius) (hd : distSq base cand ≤ radius * radius) : + ∀ p ∈ List.zip base cand, p.2 - p.1 ≤ radius := + coord radius hr base cand hd + +theorem PlantGate.Spec.accepted_stays_within (limit : Int) (base cand : List Int) (budget cost : Int) + (h : (gate base cand (headroom limit base) budget cost).verdict = Verdict.ok) : + ∀ x ∈ cand, x ≤ limit := by + have s := PlantGate.Spec.gate_ok_sound base cand (headroom limit base) budget cost h + exact within_of limit (headroom limit base) s.2.2.1 base cand s.2.2.2.1 s.2.2.2.2.1 + (fun b hb => headroom_le limit base b hb) + +theorem PlantGate.Proofs.evolve_safe (limit : Int) (s : List Int × Int) (cand : List Int) (cost : Int) + (hw : ∀ x ∈ s.1, x ≤ limit) (hb : 0 ≤ s.2) : + (∀ x ∈ (evolve limit s cand cost).1, x ≤ limit) ∧ 0 ≤ (evolve limit s cand cost).2 + ∧ (evolve limit s cand cost).2 ≤ s.2 := by + by_cases h : (gate s.1 cand (headroom limit s.1) s.2 cost).verdict = Verdict.ok + · have a := PlantGate.Spec.accepted_stays_within limit s.1 cand s.2 cost h + have g := PlantGate.Spec.budget_never_grows s.1 cand (headroom limit s.1) s.2 cost + simp only [evolve, h, ite_true] + exact ⟨a, g.2 hb, g.1⟩ + · simp only [evolve, h, ite_false] + exact ⟨hw, hb, by omega⟩ + +theorem PlantGate.Spec.run_safe (limit : Int) (steps : List (List Int × Int)) (s : List Int × Int) + (hw : ∀ x ∈ s.1, x ≤ limit) (hb : 0 ≤ s.2) : + (∀ x ∈ (run limit s steps).1, x ≤ limit) ∧ 0 ≤ (run limit s steps).2 + ∧ (run limit s steps).2 ≤ s.2 := by + induction steps generalizing s with + | nil => exact ⟨hw, hb, by simp [run]⟩ + | cons step rest ih => + obtain ⟨cand, cost⟩ := step + have e := PlantGate.Proofs.evolve_safe limit s cand cost hw hb + have r := ih (evolve limit s cand cost) e.1 e.2.1 + simp only [run] + exact ⟨r.1, r.2.1, by omega⟩ + +theorem PlantGate.Spec.run_bounded (limit : Int) (steps : List (List Int × Int)) (s : List Int × Int) : + (acceptedCount limit s steps : Int) + (run limit s steps).2 ≤ s.2 := by + induction steps generalizing s with + | nil => simp [acceptedCount, run] + | cons step rest ih => + obtain ⟨cand, cost⟩ := step + have r := ih (evolve limit s cand cost) + simp only [acceptedCount, run] + by_cases h : (gate s.1 cand (headroom limit s.1) s.2 cost).verdict = Verdict.ok + · have a := PlantGate.Spec.gate_ok_sound s.1 cand (headroom limit s.1) s.2 cost h + have e : (evolve limit s cand cost).2 = s.2 - cost := by + simp only [evolve, h, ite_true] + exact a.2.2.2.2.2 + simp only [h, ite_true] + omega + · have e : evolve limit s cand cost = s := by + simp only [evolve, h, ite_false] + simp only [h, ite_false] + rw [e] at r ⊢ + omega diff --git a/formal/PlantGate/Spec.lean b/formal/PlantGate/Spec.lean new file mode 100644 index 0000000..c140c40 --- /dev/null +++ b/formal/PlantGate/Spec.lean @@ -0,0 +1,69 @@ +/- + The specification as Lean statements: the challenge file. + + A reviewer who did not write this file approves it, and `bar.toml` records + the SHA-256 it had then. The proofs live in `PlantGate/Proofs.lean`; + `lake comparator` checks that each one proves exactly the statement written + here. The `sorry` below is expected in this file only. +-/ + +import PlantGate + +open PlantGate + +/-- Safety of the gate: an admitted step had a positive cost within the + budget, a radius that is not negative, states of equal length, a move + within the radius, and it spent exactly its cost. -/ +theorem PlantGate.Spec.gate_ok_sound (base cand : List Int) (radius budget cost : Int) + (h : (gate base cand radius budget cost).verdict = Verdict.ok) : + 0 < cost ∧ cost ≤ budget ∧ 0 ≤ radius ∧ base.length = cand.length + ∧ distSq base cand ≤ radius * radius + ∧ (gate base cand radius budget cost).remaining = budget - cost := sorry + +/-- Usefulness of the gate: a step that meets every condition is admitted. + A gate that refuses everything passes the safety statements and fails + this one. -/ +theorem PlantGate.Spec.gate_complete (base cand : List Int) (radius budget cost : Int) + (hc : 0 < cost) (hb : cost ≤ budget) (hn : base ≠ []) (hl : base.length = cand.length) + (hr : 0 ≤ radius) (hd : distSq base cand ≤ radius * radius) : + (gate base cand radius budget cost).verdict = Verdict.ok := sorry + +/-- A refused step spends nothing. -/ +theorem PlantGate.Spec.refusal_spends_nothing (base cand : List Int) (radius budget cost : Int) + (h : (gate base cand radius budget cost).verdict ≠ Verdict.ok) : + (gate base cand radius budget cost).remaining = budget := sorry + +/-- The budget never grows, and a budget that is not negative never becomes + negative. No step can mint budget or overdraw it. -/ +theorem PlantGate.Spec.budget_never_grows (base cand : List Int) (radius budget cost : Int) : + (gate base cand radius budget cost).remaining ≤ budget + ∧ (0 ≤ budget → 0 ≤ (gate base cand radius budget cost).remaining) := sorry + +/-- Within the radius, no coordinate rises by more than the radius. -/ +theorem PlantGate.Spec.no_margin_rises_past_radius (base cand : List Int) (radius : Int) + (hr : 0 ≤ radius) (hd : distSq base cand ≤ radius * radius) : + ∀ p ∈ List.zip base cand, p.2 - p.1 ≤ radius := sorry + +/-- The envelope: when the radius is the headroom of the baseline, an + admitted candidate has every margin at or below the limit. Nothing is + assumed about the baseline: a baseline past the limit has negative + headroom and admits nothing. -/ +theorem PlantGate.Spec.accepted_stays_within (limit : Int) (base cand : List Int) (budget cost : Int) + (h : (gate base cand (headroom limit base) budget cost).verdict = Verdict.ok) : + ∀ x ∈ cand, x ≤ limit := sorry + +/-- The loop is safe against any proposer. Start within the limit with a + budget that is not negative. After any list of proposals whatever, every + margin is still at or below the limit, the budget is still not negative, + and it has not grown. -/ +theorem PlantGate.Spec.run_safe (limit : Int) (steps : List (List Int × Int)) (s : List Int × Int) + (hw : ∀ x ∈ s.1, x ≤ limit) (hb : 0 ≤ s.2) : + (∀ x ∈ (run limit s steps).1, x ≤ limit) ∧ 0 ≤ (run limit s steps).2 + ∧ (run limit s steps).2 ≤ s.2 := sorry + +/-- The loop is bounded by its budget. Every admitted change costs at least + one unit, so the number of admitted changes plus the budget left never + exceeds the budget at the start. Whoever sets the budget sets the most + changes the system can ever make to itself. -/ +theorem PlantGate.Spec.run_bounded (limit : Int) (steps : List (List Int × Int)) (s : List Int × Int) : + (acceptedCount limit s steps : Int) + (run limit s steps).2 ≤ s.2 := sorry diff --git a/formal/README.md b/formal/README.md new file mode 100644 index 0000000..7059046 --- /dev/null +++ b/formal/README.md @@ -0,0 +1,69 @@ +# plantgate: an exact gate for a plant, proved in Lean + +This is the formal core of [optifab](../README.md). It is a gate that decides whether a proposed change to a plant may go ahead, and the loop that applies such changes generation after generation. It follows the layout and the rules of the Proven Commons [verified bar](https://github.com/Proven-Commons/mission/blob/main/playbook/verified-bar.md). + +Status: in progress. The specification has not been approved by a reviewer, so this is not verified. + +## What is proved + +| Claim | Theorem | +|-------|---------| +| A step the gate admits had a positive cost within the budget, a radius that is not negative, states of equal length and a move within the radius, and it spent exactly its cost. | `PlantGate.Spec.gate_ok_sound` | +| A step that meets all of those conditions, on a baseline that is not empty, is admitted. | `PlantGate.Spec.gate_complete` | +| A refused step spends nothing. | `PlantGate.Spec.refusal_spends_nothing` | +| The budget never grows, and a budget that is not negative never becomes negative. | `PlantGate.Spec.budget_never_grows` | +| Within the radius, no margin rises by more than the radius. | `PlantGate.Spec.no_margin_rises_past_radius` | +| When the radius is the headroom of the baseline, an admitted candidate has every margin at or below the limit. | `PlantGate.Spec.accepted_stays_within` | +| Whatever is proposed, and in whatever order, the loop keeps every margin at or below the limit and never overdraws the budget. | `PlantGate.Spec.run_safe` | +| The number of changes the loop admits is at most the budget it was given. | `PlantGate.Spec.run_bounded` | + +The statements are in `PlantGate/Spec.lean`, the proofs in `PlantGate/Proofs.lean`. The command-line tool in `Main.lean` calls the proved `PlantGate.gate` and `PlantGate.headroom` directly. + +## What is not proved + +- That the margins given to the gate are true. They are computed by other verifiers from models. No sensor exists yet. +- That an admitted change is an improvement. The gate bounds harm and says nothing about benefit. +- The floating-point gate `plant_gate` in `verify.py`, which is tested against Weft's own gate and compared with this one away from the boundary, but has no proof. +- Parsing the input lines and printing the results in `Main.lean`. The differential tests cover them. +- The Python code that proposes changes, evaluates them and keeps the ledger. +- How fast it runs. + +## What you must trust + +- The Lean kernel and the external kernels shipped with Lean, which all check the proofs. +- The Lean compiler and runtime, which turn the proved definitions into the program that runs. +- The hardware it runs on. +- Python, as the oracle in the differential tests. + +There are no other dependencies. The project uses Lean's core library only. + +## Re-check it + +Needs Linux, [elan](https://github.com/leanprover/elan), and bubblewrap (`apt install bubblewrap`). + +``` +lake build +lake comparator --paranoid +python3 tests/run_tests.py +``` + +`lake comparator --paranoid` builds the project in a sandbox, checks that each theorem in `PlantGate/Proofs.lean` proves exactly the statement in `PlantGate/Spec.lean`, checks that it uses only the axioms `propext`, `Classical.choice`, and `Quot.sound`, and replays it through every kernel shipped with Lean. The test script compares the tool with the oracle on 300,000 inputs and rewrites `tests/TEST-RESULTS.md`. + +To run the Proven Commons bar check on it, from a clone of Proven-Commons/mission: + +``` +python3 bar/check.py /path/to/optifab/formal --offline +``` + +## Layout + +- `PlantGate.lean`: the code under proof. +- `PlantGate/Spec.lean`: the statements, with `sorry` for proofs. This is the file a reviewer approves. +- `PlantGate/Proofs.lean`: the proofs, under the same names. +- `Main.lean`: the command-line tool used by the tests and by the ledger replay. +- `lakefile.toml`: the build. It names the libraries and the executable, and sets nothing else. +- `comparator.json`: which theorems `lake comparator` checks, and which axioms it allows. +- `bar.toml`: the project's record for the bar check. +- `SPEC.md`: the specification in plain words. +- `tests/oracle.py`: the exact Python gate. +- `tests/run_tests.py`: differential tests against the oracle. diff --git a/formal/SPEC.md b/formal/SPEC.md new file mode 100644 index 0000000..c9b086f --- /dev/null +++ b/formal/SPEC.md @@ -0,0 +1,62 @@ +# Specification: the plant gate + +A reviewer who did not write this approves it together with `PlantGate/Spec.lean` and the page sections listed in `bar.toml`. No one has yet. + +## Scope + +The gate decides whether one proposed change to a plant may go ahead. It is exact: every quantity is an integer and nothing is rounded. + +- A **state** is a list of margins, one per limit state of the plant. Each margin is demand over capacity in parts per million, so a margin of 1,000,000 is exactly at its limit. +- The **baseline** is the last state that was certified. The **candidate** is the state after the proposed change. +- The **radius** bounds how far the candidate may lie from the baseline, as a Euclidean distance. The gate compares squares, so it takes no square root. +- The **budget** is what may still be spent and the **cost** is what this change spends. The unit is the caller's: watt-hours of heat for a cooling outage, counted changes for a change budget. + +`PlantGate.gate base cand radius budget cost` returns a verdict and the budget left. + +`PlantGate.evolve limit s cand cost` applies one proposal to a pair of baseline and budget. The radius it uses is the headroom of the baseline: the smallest distance from any baseline margin to `limit`. An admitted candidate becomes the new baseline. + +`PlantGate.run limit s steps` applies a list of proposals in order. + +## Valid inputs and errors + +Every input is valid and every function is total. The gate refuses, in this order: + +| Verdict | When | +|---------|------| +| `cost` | the cost is zero or negative | +| `budget` | the cost is more than the budget | +| `shape` | the two states differ in length, or the baseline is empty | +| `radius` | the radius is negative | +| `distance` | the candidate is farther from the baseline than the radius | + +Otherwise the verdict is `ok` and the cost is taken from the budget. A refused step leaves the budget unchanged. + +## What must always hold + +Each property below is a theorem in `PlantGate/Spec.lean`. + +| Property | Theorem | +|----------|---------| +| An admitted step had a positive cost within the budget, a radius that is not negative, states of equal length and a move within the radius, and it spent exactly its cost. | `PlantGate.Spec.gate_ok_sound` | +| A step that meets all of those conditions, on a baseline that is not empty, is admitted. | `PlantGate.Spec.gate_complete` | +| A refused step spends nothing. | `PlantGate.Spec.refusal_spends_nothing` | +| The budget never grows, and a budget that is not negative never becomes negative. | `PlantGate.Spec.budget_never_grows` | +| Within the radius, no margin rises by more than the radius. | `PlantGate.Spec.no_margin_rises_past_radius` | +| When the radius is the headroom of the baseline, an admitted candidate has every margin at or below the limit. | `PlantGate.Spec.accepted_stays_within` | +| Start within the limit with a budget that is not negative. After any list of proposals, every margin is still at or below the limit, the budget is not negative, and it has not grown. | `PlantGate.Spec.run_safe` | +| The number of admitted changes plus the budget left never exceeds the budget at the start. | `PlantGate.Spec.run_bounded` | + +The first, third, fourth, fifth and sixth are safety properties. A gate that refuses everything meets them all, so the second is there to rule that gate out. + +The last two are about the loop, and they hold for every list of proposals. Nothing is assumed about who or what proposes: a search, a model, or an adversary. `run_safe` says no proposer can push a margin past its limit or overdraw the budget through this gate. `run_bounded` says the number of changes the system can make to itself is at most the budget someone gave it. + +## What the specification does not say + +- That the margins fed to the gate are true. They come from other verifiers and, one day, from sensors. A wrong margin gives a wrong verdict. +- That a candidate inside the radius is a good change. The gate bounds harm. It does not measure benefit. +- That the limit is the right limit. It is a number the caller supplies. +- Anything about time. The gate is a pure function and takes no account of how fast a state changes. + +## Oracle + +The original this stands in for is the exact Python gate in `tests/oracle.py`, which the optifab verifier uses to decide every step of its improvement loop. diff --git a/formal/bar.toml b/formal/bar.toml new file mode 100644 index 0000000..ce1d35b --- /dev/null +++ b/formal/bar.toml @@ -0,0 +1,43 @@ +# Read by bar/check.py in Proven-Commons/mission. +# See playbook/verified-bar.md there for what each field means. + +[project] +name = "plantgate" +# "in-progress" until every bar item passes, then "verified". +status = "in-progress" +# The public project page. +page = "README.md" +# Everyone who wrote the specification. It was written by an AI agent +# working for the owner of aska-physical; no person wrote it. +spec_authors = ["claude-for-abu-aska"] +# The programs people run. The reviewer checks that they call the proved +# functions, so a change to them voids the approval. +entry_points = ["Main.lean"] + +[spec] +# What a reviewer approves, together with the whole page named above. +# PlantGate/Spec.lean is the challenge module named in comparator.json. +files = ["SPEC.md", "PlantGate/Spec.lean"] +# The code under proof: the definitions the statements are about. +code = [ + "PlantGate.distSq", + "PlantGate.headroom", + "PlantGate.Verdict", + "PlantGate.Verdict.ok", + "PlantGate.Outcome", + "PlantGate.Outcome.verdict", + "PlantGate.Outcome.remaining", + "PlantGate.gate", + "PlantGate.evolve", + "PlantGate.run", + "PlantGate.acceptedCount", +] + +# No approval is recorded. The Proven Commons reviewer list is empty, so +# none can be yet. + +[tests] +results = "tests/TEST-RESULTS.md" +command = "python3 tests/run_tests.py" +# The test generator and the oracle. A change to either voids the approval. +files = ["tests/run_tests.py", "tests/oracle.py"] diff --git a/formal/comparator.json b/formal/comparator.json new file mode 100644 index 0000000..64be1b0 --- /dev/null +++ b/formal/comparator.json @@ -0,0 +1,15 @@ +{ + "challenge_module": "PlantGate.Spec", + "solution_module": "PlantGate.Proofs", + "theorem_names": [ + "PlantGate.Spec.gate_ok_sound", + "PlantGate.Spec.gate_complete", + "PlantGate.Spec.refusal_spends_nothing", + "PlantGate.Spec.budget_never_grows", + "PlantGate.Spec.no_margin_rises_past_radius", + "PlantGate.Spec.accepted_stays_within", + "PlantGate.Spec.run_safe", + "PlantGate.Spec.run_bounded" + ], + "permitted_axioms": ["propext", "Quot.sound", "Classical.choice"] +} diff --git a/formal/lake-manifest.json b/formal/lake-manifest.json new file mode 100644 index 0000000..06920ff --- /dev/null +++ b/formal/lake-manifest.json @@ -0,0 +1,6 @@ +{"version": "1.3.0", + "packagesDir": ".lake/packages", + "packages": [], + "name": "plantgate", + "lakeDir": ".lake", + "fixedToolchain": false} diff --git a/formal/lakefile.toml b/formal/lakefile.toml new file mode 100644 index 0000000..e92c57e --- /dev/null +++ b/formal/lakefile.toml @@ -0,0 +1,18 @@ +name = "plantgate" +version = "0.1.0" +defaultTargets = ["PlantGate", "PlantGateSpec", "PlantGateProofs", "plantgate"] + +[[lean_lib]] +name = "PlantGate" + +[[lean_lib]] +name = "PlantGateSpec" +roots = ["PlantGate.Spec"] + +[[lean_lib]] +name = "PlantGateProofs" +roots = ["PlantGate.Proofs"] + +[[lean_exe]] +name = "plantgate" +root = "Main" diff --git a/formal/lean-toolchain b/formal/lean-toolchain new file mode 100644 index 0000000..a6aff06 --- /dev/null +++ b/formal/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.35.0 diff --git a/formal/tests/TEST-RESULTS.md b/formal/tests/TEST-RESULTS.md new file mode 100644 index 0000000..589fdf3 --- /dev/null +++ b/formal/tests/TEST-RESULTS.md @@ -0,0 +1,11 @@ +# Test results + +Written by `tests/run_tests.py`. Rerun it to check these numbers. + +- Oracle: Python 3.13.18 exact gate in `tests/oracle.py` +- Lean: Lean (version 4.35.0, x86_64-unknown-linux-gnu, commit eb6cafb7290e8bd5f2937522d8d804f58f02bafc, Release) +- Seed: 20261117 +- Inputs: 300000 +- Mutated: 243383 of the inputs sit on, just inside or just outside a radius, a limit or a length +- Verdicts: budget 56291, cost 93741, distance 58205, ok 72974, radius 17382, shape 1407 +- Failures: 0 diff --git a/formal/tests/oracle.py b/formal/tests/oracle.py new file mode 100644 index 0000000..a4afe21 --- /dev/null +++ b/formal/tests/oracle.py @@ -0,0 +1,41 @@ +"""The exact plant gate in Python: the original the Lean gate is tested against. + +Integers only. `verify.py` at the repository root uses these same functions +to decide every step of the improvement loop, and then replays the recorded +decisions through the Lean executable. +""" + + +def dist_sq(base, cand): + return sum((c - b) * (c - b) for b, c in zip(base, cand)) + + +def headroom(limit, base): + return min(limit - b for b in base) if base else 0 + + +def gate(base, cand, radius, budget, cost): + """Returns (verdict, remaining budget). A refused step spends nothing.""" + if cost <= 0: + return "cost", budget + if budget < cost: + return "budget", budget + if len(base) != len(cand) or not base: + return "shape", budget + if radius < 0: + return "radius", budget + if radius * radius < dist_sq(base, cand): + return "distance", budget + return "ok", budget - cost + + +def evolve(limit, state, cand, cost): + """One generation: an admitted candidate becomes the baseline.""" + base, budget = state + verdict, remaining = gate(base, cand, headroom(limit, base), budget, cost) + return ((cand, remaining) if verdict == "ok" else state), verdict + + +def line(mode, x, budget, cost, base, cand): + """One input line for the Lean executable.""" + return f"{mode} {x} {budget} {cost} ; {' '.join(map(str, base))} ; {' '.join(map(str, cand))}" diff --git a/formal/tests/run_tests.py b/formal/tests/run_tests.py new file mode 100644 index 0000000..d25143e --- /dev/null +++ b/formal/tests/run_tests.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 +"""Differential tests: the Lean `plantgate` executable against the oracle. + +The oracle is the exact Python gate in `tests/oracle.py`, the original the +Lean code stands in for. Inputs are edge cases, random cases from a recorded +seed, and mutations that put a candidate exactly on the radius, one unit +inside it and one unit outside it, and a cost exactly at, just under and +just over the budget. Run from anywhere: + + python3 tests/run_tests.py [--seed N] [--count N] + +It builds the executable if it is missing, writes `tests/TEST-RESULTS.md`, +and exits non-zero if any input disagrees. +""" + +import argparse +import platform +import random +import subprocess +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(ROOT / "tests")) +import oracle # noqa: E402 + +EXE = ROOT / ".lake" / "build" / "bin" / "plantgate" +RESULTS = ROOT / "tests" / "TEST-RESULTS.md" +TRIPLES = [(3, 4, 5), (5, 12, 13), (8, 15, 17), (20, 21, 29)] + + +def expected(case): + mode, x, budget, cost, base, cand = case + radius = oracle.headroom(x, base) if mode == "h" else x + verdict, remaining = oracle.gate(base, cand, radius, budget, cost) + return f"{verdict} {remaining}" + + +def inputs(seed, count): + """Edge cases, then random cases, each followed by its mutations. + Returns the cases and how many of them are mutations.""" + cases = [ + ("r", 0, 1, 1, [], []), ("r", 5, 1, 1, [0], []), ("r", 5, 1, 1, [0, 0], [0]), + ("r", 0, 1, 1, [7], [7]), ("r", -1, 1, 1, [7], [7]), ("r", 5, 0, 1, [0], [0]), + ("r", 5, 1, 0, [0], [0]), ("r", 5, 1, -1, [0], [0]), ("r", 5, -3, -5, [0], [0]), + ("h", 1000000, 10, 1, [], []), ("h", 1000000, 10, 1, [1000000], [1000000]), + ("h", 1000000, 10, 1, [1000001], [1000001]), ("h", 1000000, 10, 1, [801052, 769564], [1000000, 769564]), + ("h", 1000000, 10, 1, [801052, 769564], [1000001, 769564]), + ("r", 2**100, 2**70, 2**69, [2**90, -2**90], [2**90 + 2**99, -2**90]), + ] + rng = random.Random(seed) + mutated = 0 + + def push(case, is_mutation=False): + nonlocal mutated + if len(cases) < count: + cases.append(case) + mutated += is_mutation + + while len(cases) < count: + n = rng.randint(1, 6) + bits = rng.choice([4, 10, 20, 40, 90]) + base = [rng.getrandbits(bits) - (1 << (bits - 1)) for _ in range(n)] + cand = [b + rng.randint(-(1 << (bits // 2)), 1 << (bits // 2)) for b in base] + budget = rng.choice([0, 1, 2, 64, 2500000, rng.getrandbits(bits)]) + cost = rng.choice([1, 1, 1, budget, budget + 1, max(budget - 1, 0), 0, -1]) + if rng.random() < 0.5: + radius = rng.choice([0, 1, rng.getrandbits(bits // 2 + 1), -1]) + push(("r", radius, budget, cost, base, cand)) + r = abs(radius) + 1 + for move in (r - 1, r, r + 1): # one coordinate at, on and past a radius of r + c = list(base) + c[rng.randrange(n)] += rng.choice([1, -1]) * move + push(("r", r, budget, cost, base, c), True) + if n >= 2: # two coordinates on an exact circle: a² + b² = (kc)² + a, b, c3 = rng.choice(TRIPLES) + k = rng.randint(1, 1 << (bits // 3 + 1)) + c = list(base) + c[0] += a * k + c[1] -= b * k + for rr in (c3 * k - 1, c3 * k, c3 * k + 1): + push(("r", rr, budget, cost, base, c), True) + else: + limit = max(base) + rng.choice([-1, 0, 1, rng.getrandbits(bits // 2 + 1)]) + push(("h", limit, budget, cost, base, cand)) + room = oracle.headroom(limit, base) + for move in (room - 1, room, room + 1): # the tightest margin moved to, onto and past the limit + c = list(base) + c[base.index(max(base))] += move + push(("h", limit, budget, cost, base, c), True) + if rng.random() < 0.05: + push(("r", 5, budget, cost, base, cand + [0]), True) + return cases[:count], mutated + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--seed", type=int, default=20261117) + ap.add_argument("--count", type=int, default=300_000) + args = ap.parse_args() + + if not EXE.exists(): + subprocess.run(["lake", "build", "plantgate"], cwd=ROOT, check=True) + + cases, mutated = inputs(args.seed, args.count) + stdin = "".join(oracle.line(*c) + "\n" for c in cases) + out = subprocess.run([str(EXE)], input=stdin, capture_output=True, + text=True, check=True).stdout.split("\n") + failures = [(c, got) for c, got in zip(cases, out) if got != expected(c)] + if len(out) < len(cases): + failures.append(("missing output", f"{len(out)} lines")) + verdicts = {} + for c in cases: + v = expected(c).split()[0] + verdicts[v] = verdicts.get(v, 0) + 1 + + lean = subprocess.run(["lake", "env", "lean", "--version"], cwd=ROOT, + capture_output=True, text=True).stdout.strip() + lines = [ + "# Test results", + "", + "Written by `tests/run_tests.py`. Rerun it to check these numbers.", + "", + f"- Oracle: Python {platform.python_version()} exact gate in `tests/oracle.py`", + f"- Lean: {lean}", + f"- Seed: {args.seed}", + f"- Inputs: {len(cases)}", + f"- Mutated: {mutated} of the inputs sit on, just inside or just outside a radius, a limit or a length", + "- Verdicts: " + ", ".join(f"{k} {v}" for k, v in sorted(verdicts.items())), + f"- Failures: {len(failures)}", + "", + ] + if failures: + lines += ["## Failures", ""] + lines += [f"- `{c}`: Lean printed `{got}`" for c, got in failures[:50]] + lines.append("") + RESULTS.write_text("\n".join(lines)) + print(f"{len(cases) - len(failures)}/{len(cases)} inputs agree; " + f"results in {RESULTS}") + return 1 if failures else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/loop.py b/loop.py new file mode 100644 index 0000000..57bf1a2 --- /dev/null +++ b/loop.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python3 +"""The improvement loop: hardware and software of the campus changed together, one gated step at a time. + +A genome holds three hardware genes (thermal store size, liquid capture fraction, wall U-value), two +software genes (the scheduler's load floor and the share of load it sheds in a cooling outage) and one +gene of the proposer itself (its step scale). Each generation the proposer suggests changes, the plant +model turns each candidate into a vector of margins, and the exact gate in formal/ decides. Hardware +changes are scored by the headroom they open, software changes by the objective they gain. An admitted +candidate becomes the baseline of the next generation. Every decision goes into a hash-chained ledger. + +What is proved (in Lean, formal/): no list of proposals can push a margin past its limit or overdraw +the change budget through the gate. What is not: the plant model, the objective, the proposer and this +file. The scenario is a choice made here, so the efficiency figures are illustrations, not predictions. +""" +from __future__ import annotations + +import hashlib +import json +import math +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parent +sys.path.insert(0, str(ROOT / "formal" / "tests")) +import oracle # noqa: E402 the exact gate, tested against the Lean executable + +LIMIT = 1_000_000 # a margin of 1,000,000 ppm is exactly at its limit +RESERVE = 950_000 # the proposer's own caution; the gate does not know about it +HARDWARE = ("pcm_kwh", "capture_ppm", "wall_u_mw") +SOFTWARE = ("floor_kw", "shed_ppm") +META = ("step_ppm",) +STEP = {"pcm_kwh": 100, "capture_ppm": 5000, "wall_u_mw": 4, "floor_kw": 20, "shed_ppm": 25000} +BOUNDS = {"pcm_kwh": (500, 5000), "capture_ppm": (620000, 950000), "wall_u_mw": (100, 2400), + "floor_kw": (0, 10000), "shed_ppm": (0, 1000000), "step_ppm": (125000, 8000000)} + +# The scenario the objective is scored on. These four numbers are choices made here. +SCENARIO = {"outage_min": 20, "outages_per_year": 12, "low_demand_fraction_ppm": 30000, "low_demand_hours": 2000} + + +def model(genome: dict, plant: dict) -> dict: + """Margins (ppm of limit) and the objective for one genome. `plant` holds the pinned upstream values.""" + p_kw = plant["p_it_kw"] + alpha = genome["capture_ppm"] / 1e6 + cop = plant["cop_ads"] + q_env_kw = (plant["ua_roof_w_k"] + genome["wall_u_mw"] / 1000.0 * plant["wall_area_m2"]) * plant["design_dt_k"] / 1000.0 + q_fix_kw = q_env_kw + plant["other_kw"] + denom = (1.0 + cop) * alpha - 1.0 + p_min_kw = math.inf if denom <= 0 else q_fix_kw / denom + shed = genome["shed_ppm"] / 1e6 + outage_h = SCENARIO["outage_min"] / 60.0 + + def ppm(x: float) -> int: # rounded up, so a margin is never understated + return 10 * LIMIT if not math.isfinite(x) else min(10 * LIMIT, math.ceil(x * 1e6 - 1e-9)) + + moving = { + "sorption_drive_heat": ppm(((1.0 - alpha) * p_kw + q_fix_kw) / cop / (alpha * p_kw)), + "load_floor": ppm(p_min_kw / genome["floor_kw"]) if genome["floor_kw"] > 0 else 10 * LIMIT, + "outage_ride_through": ppm(p_kw * (1.0 - shed) * outage_h / genome["pcm_kwh"]), + } + margins = dict(plant["fixed_margins_ppm"]) + margins.update(moving) + + # Objective: useful IT energy delivered per unit of utility energy over the scenario year. + hours, low_h = 8760.0, SCENARIO["low_demand_hours"] + low_kw = SCENARIO["low_demand_fraction_ppm"] / 1e6 * p_kw + it_low = max(low_kw, genome["floor_kw"]) # the scheduler fills up to its floor; the filler is not useful + lost = shed * p_kw * outage_h * SCENARIO["outages_per_year"] + useful = p_kw * (hours - low_h) + low_kw * low_h - lost + + def utility(it_kw: float) -> float: # the upstream plant model: cooling loop, auxiliaries, other overhead + return it_kw + (it_kw - plant["passive_kw"]) / plant["loop_cop"] + plant["aux_kw"] + plant["other_kw"] + + used = utility(p_kw) * (hours - low_h) + utility(it_low) * low_h - utility(shed * p_kw) * outage_h * SCENARIO["outages_per_year"] + return {"margins": margins, "names": list(margins), "vector": list(margins.values()), + "eta_ppm": math.floor(useful / used * 1e6), "p_min_kw": round(p_min_kw, 1)} + + +def digest(entry: dict) -> str: + return hashlib.sha256(json.dumps(entry, sort_keys=True, separators=(",", ":")).encode()).hexdigest() + + +def run_loop(plant: dict, start: dict, budget: int, generations: int = 400, seed: int = 20261117) -> dict: + """Run the loop and return the ledger. Deterministic for a given seed.""" + state = seed + + def rnd() -> float: + nonlocal state + state = (state * 6364136223846793005 + 1442695040888963407) % (1 << 64) + return (state >> 11) / float(1 << 53) + + genome = dict(start) + base = model(genome, plant) + ledger, prev = [], "0" * 64 + head = {"start_genome": dict(genome), "start_margins_ppm": base["margins"], "start_eta_ppm": base["eta_ppm"], + "budget": budget, "limit": LIMIT, "scenario": SCENARIO, "seed": seed} + idle = 0 + for gen in range(generations): + if budget <= 0 or idle >= 40: + break + # The proposer alternates. On even generations it tries software changes and keeps the one that + # raises the objective most. On odd generations it tries hardware changes and keeps the one that + # opens the most headroom without lowering the objective. Hardware makes room; software uses it. + phase = SOFTWARE if gen % 2 == 0 else HARDWARE + room = oracle.headroom(LIMIT, base["vector"]) + best = None + for _ in range(6): + gene = phase[int(rnd() * len(phase))] + delta = (1 if rnd() < 0.5 else -1) * max(1, round(STEP[gene] * genome["step_ppm"] / 1e6)) + cand = dict(genome) + cand[gene] = min(BOUNDS[gene][1], max(BOUNDS[gene][0], cand[gene] + delta)) + if cand[gene] == genome[gene]: + continue + m = model(cand, plant) + if phase is SOFTWARE: # the proposer keeps a reserve: it does not ask to run a margin above RESERVE + gain = m["eta_ppm"] - base["eta_ppm"] if max(m["vector"]) <= RESERVE else 0 + else: + gain = oracle.headroom(LIMIT, m["vector"]) - room if m["eta_ppm"] >= base["eta_ppm"] else 0 + if gain > 0 and (best is None or gain > best[4]): + best = (cand, m, gene, cand[gene] - genome[gene], gain) + if best is None: + idle += 1 + genome["step_ppm"] = max(BOUNDS["step_ppm"][0], genome["step_ppm"] // 2) # nothing better: look closer + continue + cand, m, gene, delta, _ = best + radius = oracle.headroom(LIMIT, base["vector"]) + verdict, remaining = oracle.gate(base["vector"], m["vector"], radius, budget, 1) + entry = {"generation": gen, "gene": gene, "kind": "hardware" if gene in HARDWARE else "software", + "delta": delta, "step_ppm": genome["step_ppm"], "base_ppm": base["vector"], "cand_ppm": m["vector"], + "radius_ppm": radius, "eta_before_ppm": base["eta_ppm"], "eta_after_ppm": m["eta_ppm"], + "budget_before": budget, "cost": 1, "verdict": verdict, "budget_after": remaining, "prev": prev} + entry["hash"] = prev = digest(entry) + ledger.append(entry) + if verdict == "ok": + step = min(BOUNDS["step_ppm"][1], genome["step_ppm"] * 2) # it worked: reach further next time + genome, base, budget, idle = dict(cand), m, remaining, 0 + genome["step_ppm"] = step + else: + idle += 1 + genome["step_ppm"] = max(BOUNDS["step_ppm"][0], genome["step_ppm"] // 2) # refused: step back + final = model(genome, plant) + return {"head": head, "entries": ledger, "final_genome": genome, "final_margins_ppm": final["margins"], + "final_eta_ppm": final["eta_ppm"], "final_budget": budget, "final_hash": prev} + + +def check_chain(ledger: dict) -> bool: + prev = "0" * 64 + for e in ledger["entries"]: + body = {k: v for k, v in e.items() if k != "hash"} + if e["prev"] != prev or digest(body) != e["hash"]: + return False + prev = e["hash"] + return prev == ledger["final_hash"] + + +def replay_lines(ledger: dict) -> list[str]: + """One line per ledger decision, for the Lean executable to decide again.""" + return [oracle.line("h", ledger["head"]["limit"], e["budget_before"], e["cost"], e["base_ppm"], e["cand_ppm"]) + for e in ledger["entries"]] + + +def summary(ledger: dict) -> dict: + ok = [e for e in ledger["entries"] if e["verdict"] == "ok"] + refused: dict[str, int] = {} + for e in ledger["entries"]: + if e["verdict"] != "ok": + refused[e["verdict"]] = refused.get(e["verdict"], 0) + 1 + worst = max(max(e["cand_ppm"]) for e in ok) if ok else max(ledger["head"]["start_margins_ppm"].values()) + return { + "decisions": len(ledger["entries"]), "admitted": len(ok), "refused": dict(sorted(refused.items())), + "admitted_hardware_changes": sum(1 for e in ok if e["kind"] == "hardware"), + "admitted_software_changes": sum(1 for e in ok if e["kind"] == "software"), + "budget_start": ledger["head"]["budget"], "budget_left": ledger["final_budget"], + "eta_start_ppm": ledger["head"]["start_eta_ppm"], "eta_final_ppm": ledger["final_eta_ppm"], + "eta_never_fell": all(e["eta_after_ppm"] >= e["eta_before_ppm"] for e in ok), + "worst_margin_ever_admitted_ppm": worst, "every_admitted_state_within_limit": worst <= LIMIT, + "start_genome": ledger["head"]["start_genome"], "final_genome": ledger["final_genome"], + "largest_step_scale_ppm": max([e["step_ppm"] for e in ledger["entries"]], default=0), + "chain_intact": check_chain(ledger), "final_hash": ledger["final_hash"], + } diff --git a/results/certificate.json b/results/certificate.json new file mode 100644 index 0000000..d8233a8 --- /dev/null +++ b/results/certificate.json @@ -0,0 +1,835 @@ +{ + "repository": "aska-physical/optifab", + "version": "0.2.0", + "inputs": { + "vendored": { + "aska-physical/funi-frame/certificate.json": "92e7bbcea389274d2967e463ec3881ec9311db7786c5e74559defcd936dfb9fa", + "aska-physical/funi-floors/certificate.json": "85878c416fed3c290c1321ec0dc27af5a152d8ca4d264b8f802add2e5995d186", + "aska-physical/venturi-collars/certificate.json": "c93eb98b2431b2b733cb1702594c5dc1e00a77fc811d663cea561f20cb0c0170", + "Moissanite-Labs/weft/vectors.json": "bdc25776f32b0ed0cdaab4e413bed4a906f20193536724e60a7fba09c9965bcf", + "Moissanite-Labs/weft/invariants.py": "1064b0f8170c7b4dd2099a9412df2b50f301da003d61a5b07f842f26646612e4" + }, + "data": { + "pins.json": "acb6db126f4fdf3901c6f9f64a9b2d03ee4edc48ec863ccfb170d14604e96d54", + "graph.json": "3c0a2dd368a0f223c6aea43b621e131461037425001eb6bceaa7742b25034966", + "sources.json": "0ec0cfd7d8aa05ab7a51fb77ac8e91fb06dc44ce66ee6333ed965f7368ecc2d6", + "unit.json": "c2cb8e74da3ecb9c18ede97c00d5b1f1c65a9238dc5865d6aff751073ea96f4a", + "upstream/MANIFEST.json": "9dd0e7efbb39fb37bc542f86751becb3a6dc46fd348737e2b040a24598238541" + }, + "pinned_repositories": 36, + "pinned_lines": 46 + }, + "symbolic_theorems": { + "substation_constrained_compute": "dP_IT = (freed utility power)/PUE_f if every overhead grows with load; (freed utility power)/(1 + 1/COP_loop) if only the cooling loop does", + "tri_thermal_recooling_limit": "COP <= (T_c/(T_a - T_c))*((T_h - T_a)/T_h) <=> T_a <= T_c*T_h*(1 + COP)/(COP*T_h + T_c)", + "minimum_load_for_self_cooling": "P_min = q_fix/((1 + COP)*alpha - 1); q_fix = 0 gives alpha* = 1/(1 + COP)", + "shed_fraction_for_outage": "s_min = 1 - B/(P*T) for a cooling outage of length T on thermal budget B", + "delayed_cancellation_residual": "|1 - exp(-i*phi)| = 2*|sin(phi/2)| with phi = 2*pi*f*tau; below 1 within the cycle only if f*tau < 1/6" + }, + "plant": { + "pue_reproduction": { + "liquid_plus_air_equals_it_load": true, + "Q_ates_MW": 9.6224, + "passive_sinks_MW": 0.3776, + "PUE_funi_reproduced": 1.07387, + "PUE_conventional_reproduced": 1.38033, + "matches_certificate": true, + "annual_heat_to_aquifer_GWh_th": 84.29 + }, + "substation": { + "freed_utility_power_MW": 3.065, + "certificate_freed_substation_power_MW": 3.06, + "extra_it_if_all_overhead_scales_MW": 2.854, + "extra_it_if_auxiliaries_are_fixed_MW": 2.959, + "one_over_PUE_funi": 0.9312, + "marginal_PUE_with_fixed_auxiliaries": 1.0357, + "certificate_revenue_low_M_usd": 76.62, + "revenue_low_on_extra_it_M_usd": [ + 71.35, + 73.97 + ], + "revenue_overstatement_pct": [ + 3.6, + 7.4 + ] + }, + "second_law": { + "T_drive_C": 58.0, + "T_chilled_C": [ + 15.0, + 18.0 + ], + "COP_ads_claimed": 0.62, + "max_recooling_C_at_chilled_15C": 40.11, + "max_recooling_C_at_chilled_18C": 41.46, + "reversible_COP_by_recooling_C": { + "chilled_15C": { + "25": 2.871, + "30": 1.624, + "35": 1.001, + "40": 0.627, + "45": 0.377 + }, + "chilled_18C": { + "25": 4.145, + "30": 2.051, + "35": 1.19, + "40": 0.719, + "45": 0.423 + } + }, + "second_law_efficiency_at_30C_recooling": [ + 0.302, + 0.382 + ], + "certificate_has_a_recooling_field": false + }, + "minimum_load": { + "liquid_capture_fraction": 0.85, + "threshold_capture_fraction_no_fixed_load": 0.6173, + "design_temperature_difference_K": 20.0, + "envelope_gain_MW": 0.01269, + "envelope_gain_steel_pinned_wall_MW": 0.12041, + "other_overhead_MW": 0.2, + "P_min_envelope_only_MW": 0.0337, + "P_min_envelope_plus_overhead_MW": 0.5642, + "P_min_as_pct_of_nameplate": 5.64, + "P_min_steel_pinned_wall_MW": 0.8499, + "floor_rise_with_steel_pinned_wall_pct": 50.6, + "required_capture_fraction_by_utilisation": { + "1.0": 0.6304, + "0.5": 0.6435, + "0.25": 0.6698, + "0.1": 0.7486 + }, + "drive_heat_with_fixed_load_MW": 2.762, + "drive_heat_available_MW": 8.5 + }, + "thermal_budget": { + "pcm_budget_kWh_th": 2500.0, + "wall_liner_budget_kWh_th": 353.75, + "full_load_ride_through_min": 15.0, + "ride_through_min_by_shed_fraction": { + "0.0": 15.0, + "0.25": 20.0, + "0.5": 30.0, + "0.75": 60.0 + }, + "shed_fraction_to_bridge_outage_min": { + "10": 0.0, + "15": 0.0, + "30": 0.5, + "60": 0.75 + }, + "burst_hours_at_10pct_over_cooling_capacity": 2.5 + } + }, + "margins": { + "vector": [ + { + "limit_state": "rack_vibration", + "source": "funi-frame", + "demand": 9e-05, + "capacity": 0.0005, + "utilisation": 0.1791, + "basis": "certified" + }, + { + "limit_state": "storey_drift", + "source": "funi-frame", + "demand": 0.563, + "capacity": 1.0, + "utilisation": 0.563, + "basis": "certified" + }, + { + "limit_state": "roof_crown_compression", + "source": "funi-frame", + "demand": 9.6, + "capacity": 24.75, + "utilisation": 0.387879, + "basis": "certified" + }, + { + "limit_state": "roof_tornado_uplift_factored", + "source": "funi-frame", + "demand": 460.545, + "capacity": 783.0, + "utilisation": 0.58818, + "basis": "certified" + }, + { + "limit_state": "roof_service_deflection_mm", + "source": "funi-frame", + "demand": 11.74, + "capacity": 66.666667, + "utilisation": 0.1761, + "basis": "certified" + }, + { + "limit_state": "sorption_drive_heat", + "source": "funi-frame", + "demand": 2.419, + "capacity": 8.5, + "utilisation": 0.284588, + "basis": "certified" + }, + { + "limit_state": "floor_punching_collar", + "source": "funi-floors", + "demand": 2208.02, + "capacity": 2756.4, + "utilisation": 0.801052, + "basis": "certified" + }, + { + "limit_state": "floor_walking_vibration", + "source": "funi-floors", + "demand": 0.308, + "capacity": 0.5, + "utilisation": 0.616, + "basis": "certified" + }, + { + "limit_state": "floor_crown_compression", + "source": "funi-floors", + "demand": 13.669, + "capacity": 22.5, + "utilisation": 0.607511, + "basis": "certified" + }, + { + "limit_state": "floor_fire_120min_thrust", + "source": "funi-floors", + "demand": 1171.96, + "capacity": 3902.95, + "utilisation": 0.300275, + "basis": "certified" + }, + { + "limit_state": "floor_duct_hole_shear", + "source": "funi-floors", + "demand": 185.6, + "capacity": 373.48, + "utilisation": 0.496948, + "basis": "certified" + }, + { + "limit_state": "sensor_power_at_airflow_turndown", + "source": "venturi-collars", + "demand": 0.080035, + "capacity": 0.104, + "utilisation": 0.769564, + "basis": "derived here" + } + ], + "plant_radius": 0.1989, + "binding_limit_state": "floor_punching_collar", + "binding_source": "funi-floors", + "second_tightest": "sensor_power_at_airflow_turndown", + "second_tightest_utilisation": 0.769564, + "ball_in_box": { + "samples": 20000, + "max_coordinate_at_axis_points": 0.999952, + "max_coordinate_sampled": 0.945071, + "all_within_limits": true, + "fails_if_radius_grows_by_0.001": true + }, + "sensor_with_larger_node": { + "larger_node_mW": 0.15, + "harvest_at_turndown_mW": 0.104, + "utilisation_with_larger_node": 1.4423 + } + }, + "gate": { + "weft_conformance": { + "schema": "WEFT-INVARIANTS/1.0", + "weight_update_vectors": 15, + "passed": 15, + "failed": [], + "tension_and_royalty_vectors_out_of_scope": 12 + }, + "differential_test": { + "oracle": "Moissanite-Labs/weft weft/runtime/invariants/invariants.py: verify_weight_update_safety_ex", + "cases": 100000, + "seed": 20261117, + "mismatches": 0, + "first_mismatches": [], + "agreed_by_reason": { + "baseline_distance_exceeded": 18444, + "insufficient_metabolic_budget": 3902, + "non_finite_parameters": 8277, + "non_finite_weights": 9369, + "non_positive_budget_or_cost": 9936, + "ok": 41772, + "shape_mismatch": 4836 + }, + "both_raised_the_same_error": 3464 + }, + "worked_admissions": [ + { + "case": "cooling outage, 10 min at full load", + "accepted": true, + "reason": "ok", + "distance": 0.0, + "cost_kWh_th": 1666.7, + "remaining_kWh_th": 833.3 + }, + { + "case": "second 10 min outage before recharge, full load", + "accepted": false, + "reason": "insufficient_metabolic_budget", + "distance": null, + "cost_kWh_th": 1666.7, + "remaining_kWh_th": -833.3 + }, + { + "case": "same outage after shedding 60 percent of load", + "accepted": true, + "reason": "ok", + "distance": 0.0, + "cost_kWh_th": 666.7, + "remaining_kWh_th": 166.7 + }, + { + "case": "floor punching demand up 20 percent, 5 min outage", + "accepted": true, + "reason": "ok", + "distance": 0.1602, + "cost_kWh_th": 833.3, + "remaining_kWh_th": 1666.7 + }, + { + "case": "floor punching demand up 26 percent, 5 min outage", + "accepted": false, + "reason": "baseline_distance_exceeded", + "distance": 0.2083, + "cost_kWh_th": 833.3, + "remaining_kWh_th": 2500.0 + } + ] + }, + "interfaces": [ + { + "quantity": "floor dead mass, kg/m2", + "downstream_value": 195.12, + "upstream_value": 195.12, + "tolerance": 0.005, + "downstream": "funi-frame verify.py", + "upstream": "funi-floors certificate", + "agrees": true + }, + { + "quantity": "conventional floor mass, kg/m2", + "downstream_value": 744.0, + "upstream_value": 743.8811, + "tolerance": 0.5, + "downstream": "funi-frame verify.py", + "upstream": "funi-floors certificate (mass and reduction)", + "agrees": true + }, + { + "quantity": "Fe-SMA recovery stress, MPa", + "downstream_value": 423.4717, + "upstream_value": 423.47, + "tolerance": 0.005, + "downstream": "funi-frame verify.py", + "upstream": "funi-floors certificate", + "agrees": true + }, + { + "quantity": "rack live load, kPa", + "downstream_value": 15.0, + "upstream_value": 14.9865, + "tolerance": 0.05, + "downstream": "funi-frame verify.py", + "upstream": "funi-floors 313 psf case", + "agrees": true + }, + { + "quantity": "leak-sensor reactance shift, %", + "downstream_value": 46.16, + "upstream_value": 46.16, + "tolerance": 0.005, + "downstream": "funi-frame ENGINEERING_STUDIES.md", + "upstream": "funi-floors certificate", + "agrees": true + }, + { + "quantity": "sensor node power, mW", + "downstream_value": 0.08, + "upstream_value": 0.08, + "tolerance": 0.0005, + "downstream": "venturi-collars README.md", + "upstream": "venturi-collars certificate (harvest over margin)", + "agrees": true + } + ], + "ledger_context": { + "ledger_entry": "deepmind-datacenter-cooling-40pct", + "ledger_evidence": "deployed", + "ledger_result": "up to 40% lower (15% lower PUE overhead)", + "funi_frame_cooling_electricity_cut_pct": 85.05, + "funi_frame_pue_overhead_cut_pct": 80.5, + "funi_frame_evidence": "claimed" + }, + "improvement_loop": { + "scenario": { + "outage_min": 20, + "outages_per_year": 12, + "low_demand_fraction_ppm": 30000, + "low_demand_hours": 2000 + }, + "limit_ppm": 1000000, + "proposer_reserve_ppm": 950000, + "genes": { + "hardware": [ + "pcm_kwh", + "capture_ppm", + "wall_u_mw" + ], + "software": [ + "floor_kw", + "shed_ppm" + ], + "proposer": [ + "step_ppm" + ] + }, + "margins_in_the_vector": 14, + "decisions": 50, + "admitted": 45, + "refused": { + "distance": 5 + }, + "admitted_hardware_changes": 30, + "admitted_software_changes": 15, + "budget_start": 64, + "budget_left": 19, + "eta_start_ppm": 914228, + "eta_final_ppm": 919009, + "eta_never_fell": true, + "worst_margin_ever_admitted_ppm": 949058, + "every_admitted_state_within_limit": true, + "start_genome": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000, + "step_ppm": 1000000 + }, + "final_genome": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 413, + "shed_ppm": 0, + "step_ppm": 125000 + }, + "largest_step_scale_ppm": 8000000, + "chain_intact": true, + "final_hash": "20e492cea1606034f0e6917df14ccb774a219c00748fae8104429939cfbc9532", + "final_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 120734, + "load_floor": 948407, + "outage_ride_through": 766284 + }, + "float_gate_on_the_same_decisions": { + "decisions": 50, + "agree": 50, + "within_1e-9_of_boundary_skipped": 0 + }, + "variants": { + "proposer_without_reserve": { + "decisions": 186, + "admitted": 60, + "refused": { + "distance": 126 + }, + "budget_left": 4, + "eta_final_ppm": 916009, + "worst_margin_ever_admitted_ppm": 998923 + }, + "budget_of_three": { + "decisions": 3, + "admitted": 3, + "refused": {}, + "budget_left": 0, + "eta_final_ppm": 914355, + "worst_margin_ever_admitted_ppm": 938172 + }, + "start_with_a_margin_exactly_at_its_limit": { + "decisions": 14, + "admitted": 0, + "refused": { + "distance": 14 + }, + "budget_left": 64, + "eta_final_ppm": 914230, + "worst_margin_ever_admitted_ppm": 1000000 + }, + "scheduler_floor_below_the_plant_floor": { + "objective_gain_ppm": 2547, + "load_floor_margin_ppm": 1128418, + "verdict": "distance" + } + } + }, + "formal": { + "present": true, + "lean": "Lean (version 4.35.0, x86_64-unknown-linux-gnu, commit eb6cafb7290e8bd5f2937522d8d804f58f02bafc, Release)", + "theorems": [ + "PlantGate.Spec.gate_ok_sound", + "PlantGate.Spec.gate_complete", + "PlantGate.Spec.refusal_spends_nothing", + "PlantGate.Spec.budget_never_grows", + "PlantGate.Spec.no_margin_rises_past_radius", + "PlantGate.Spec.accepted_stays_within", + "PlantGate.Spec.run_safe", + "PlantGate.Spec.run_bounded" + ], + "comparator": { + "command": "lake comparator --paranoid", + "accepted": true, + "kernels": [ + "Lean default", + "Lean paranoid", + "con-leche", + "con-ron", + "lean4lean", + "nanoda" + ] + }, + "replay": { + "decisions": 50, + "mismatches": 0 + }, + "differential_tests": { + "inputs": 300000, + "seed": 20261117, + "failures": 0, + "passed": true + }, + "bar": "Proven Commons bar check: items 2 to 6 pass; item 1 is open (no reviewer has approved the specification). See formal/BAR-REPORT.md.", + "matches_current_lean_sources": true, + "matches_current_ledger": true + }, + "loop_timing": { + "slow_latency_ms": 15.0, + "fast_latency_ms": 0.5, + "plant_tones": [ + { + "tone_Hz": 29.5, + "cycles_of_delay_slow": 0.4425, + "residual_slow": 1.967, + "change_dB_slow": 5.9, + "cycles_of_delay_fast": 0.0148, + "residual_fast": 0.093, + "change_dB_fast": -20.7, + "longest_delay_that_helps_within_the_cycle_ms": 5.65 + }, + { + "tone_Hz": 49.0, + "cycles_of_delay_slow": 0.735, + "residual_slow": 1.479, + "change_dB_slow": 3.4, + "cycles_of_delay_fast": 0.0245, + "residual_fast": 0.154, + "change_dB_fast": -16.3, + "longest_delay_that_helps_within_the_cycle_ms": 3.4 + }, + { + "tone_Hz": 60.0, + "cycles_of_delay_slow": 0.9, + "residual_slow": 0.618, + "change_dB_slow": -4.2, + "cycles_of_delay_fast": 0.03, + "residual_fast": 0.188, + "change_dB_fast": -14.5, + "longest_delay_that_helps_within_the_cycle_ms": 2.78 + }, + { + "tone_Hz": 120.0, + "cycles_of_delay_slow": 1.8, + "residual_slow": 1.176, + "change_dB_slow": 1.4, + "cycles_of_delay_fast": 0.06, + "residual_fast": 0.375, + "change_dB_fast": -8.5, + "longest_delay_that_helps_within_the_cycle_ms": 1.39 + } + ], + "tones_countered_within_cycle_slow": 0, + "tones_countered_within_cycle_fast": 4, + "tones_amplified_slow": 3, + "highest_frequency_countered_within_cycle_slow_Hz": 11.11, + "highest_frequency_countered_within_cycle_fast_Hz": 333.33, + "other_structural_frequencies_Hz": { + "isolation_stage_1": 4.5, + "isolation_stage_2": 9.2, + "floor_cassette": 8.624, + "sensor_reed_flutter": 5.32 + }, + "contract_timescales_s": { + "thermal_budget_at_full_load": 900.0, + "wall_liner_ride_through": 1698.0 + }, + "slow_latency_as_fraction_of_thermal_budget_time": 1.67e-05 + }, + "plant_frame": { + "layout": "<16f", + "bytes": 64, + "floats": 16, + "matches_weft_frame_layout": true, + "slots": [ + "rack_vibration", + "storey_drift", + "roof_crown_compression", + "roof_tornado_uplift_factored", + "roof_service_deflection_mm", + "sorption_drive_heat", + "floor_punching_collar", + "floor_walking_vibration", + "floor_crown_compression", + "floor_fire_120min_thrust", + "floor_duct_hole_shear", + "sensor_power_at_airflow_turndown", + "thermal_budget_kWh_th", + "it_load_MW", + "recooling_C", + "time_s" + ], + "round_trip_max_error": 2.7e-08, + "design_frame_sha256": "f55b63b5f5ff447e6e99e2e0e14033fab0dbeeb1da6024d9763418a22b617b17", + "contract_check": { + "design point, recooling at 30 C": [], + "design point as certified, no recooling temperature": [ + "recooling_not_measured" + ], + "idle campus at 0.3 MW": [ + "below_load_floor" + ], + "recooling at 42 C": [ + "recooling_above_limit" + ], + "floor punching demand up 26 percent": [ + "limit_exceeded" + ], + "thermal budget spent": [ + "thermal_budget_exhausted" + ] + }, + "gate_from_frame": { + "design point": "ok", + "floor punching demand up 26 percent": "baseline_distance_exceeded" + } + }, + "unit": { + "elements": 30, + "elements_by_status": { + "checked": 10, + "designed": 6, + "idea": 2, + "in_progress": 1, + "missing": 2, + "research": 1, + "rule": 3, + "specified": 2, + "tested_code": 3 + }, + "elements_with_no_repository": [ + "N3", + "N4" + ], + "repositories_placed": 32, + "repositories_placed_by_org": { + "Foundation-0": 7, + "Moissanite-Labs": 11, + "Proven-Commons": 5, + "aska-physical": 9 + }, + "repositories_not_placed": 9, + "loop_interfaces": 10, + "loop_interfaces_by_status": { + "checked": 4, + "designed": 2, + "idea": 1, + "missing": 2, + "proposed": 1 + }, + "loop_closed": false + }, + "graph": { + "nodes": 41, + "edges": 43, + "nodes_by_org": { + "Foundation-0": 11, + "Moissanite-Labs": 13, + "Proven-Commons": 5, + "aska-physical": 12 + }, + "nodes_by_layer": { + "L0": 9, + "L1": 6, + "L2": 2, + "L3": 2, + "L4": 6, + "L5": 6, + "L6": 10 + }, + "lineage_edges": 30, + "lineage_acyclic": true, + "lineage_depth": 5, + "lineage_depth_bound": 12, + "optifab_lineage_depth": 5, + "stack_size": 13, + "stack_by_evidence": { + "claimed": 10, + "no result claimed": 2, + "preprint": 1 + }, + "strongest_evidence_rank_in_stack": 2, + "stack": [ + { + "node": "Foundation-0/incentre-lattices", + "evidence": "preprint", + "rank": 2, + "downstream_in_stack": 6, + "assigned_by": "source" + }, + { + "node": "Foundation-0/nhanes-bioimpedance", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 5, + "assigned_by": "source" + }, + { + "node": "Foundation-0/ductricity", + "evidence": "no result claimed", + "rank": 0, + "downstream_in_stack": 4 + }, + { + "node": "Foundation-0/point-charges", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 4, + "assigned_by": "source" + }, + { + "node": "Foundation-0/thermal-capture", + "evidence": "no result claimed", + "rank": 0, + "downstream_in_stack": 4 + }, + { + "node": "aska-physical/cfrp-strengthening", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 4, + "assigned_by": "optifab" + }, + { + "node": "aska-physical/fibral-rigidity", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 4, + "assigned_by": "optifab" + }, + { + "node": "aska-physical/cfrp-truss", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 3, + "assigned_by": "optifab" + }, + { + "node": "aska-physical/impedence-analyzers", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 3, + "assigned_by": "optifab" + }, + { + "node": "aska-physical/venturi-collars", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 3, + "assigned_by": "optifab" + }, + { + "node": "aska-physical/funi-floors", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 2, + "assigned_by": "optifab" + }, + { + "node": "aska-physical/funi-frame", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 1, + "assigned_by": "optifab" + }, + { + "node": "aska-physical/optifab", + "evidence": "claimed", + "rank": 1, + "downstream_in_stack": 0, + "assigned_by": "optifab" + } + ], + "cross_org_links_before": { + "Foundation-0 <-> Moissanite-Labs": 7, + "Foundation-0 <-> Proven-Commons": 1, + "Foundation-0 <-> aska-physical": 11 + }, + "cross_org_links_added": { + "Foundation-0 <-> aska-physical": 1, + "Moissanite-Labs <-> aska-physical": 2 + }, + "aska_physical_to_moissanite_links_before": 0, + "aska_physical_to_moissanite_links_added": 2, + "checked_and_closed_links": 1 + }, + "must_fail_controls": { + "must_fail_01_upstream_revenue_is_computed_on_it_power": true, + "must_fail_02_recooling_at_45C_keeps_the_claimed_cop_within_the_second_law": true, + "must_fail_03_capture_below_the_threshold_self_cools_at_some_load": true, + "must_fail_04_capture_one_point_above_the_threshold_self_cools_at_nameplate": true, + "must_fail_05_steel_pinned_wall_keeps_the_same_load_floor": true, + "must_fail_06_full_load_30min_outage_fits_the_pcm_budget": true, + "must_fail_07_negative_cost_recharges_the_budget": true, + "must_fail_08_step_past_the_tightest_margin_is_admitted": true, + "must_fail_09_tampered_vendored_input_is_accepted": true, + "must_fail_10_lineage_cycle_is_accepted": true, + "must_fail_11_lineage_at_the_weft_depth_bound_is_accepted": true, + "must_fail_12_link_without_citation_is_accepted": true, + "must_fail_13_corrupted_weft_vector_goes_unnoticed": true, + "must_fail_14_drift_in_a_hand_copied_constant_goes_unnoticed": true, + "must_fail_15_slow_loop_counters_a_plant_tone_within_its_cycle": true, + "must_fail_16_certified_design_point_fills_a_frame_without_a_recooling_temperature": true, + "must_fail_17_frame_past_a_limit_or_below_the_floor_passes_the_contract": true, + "must_fail_18_repository_left_out_of_the_unit_goes_unnoticed": true, + "must_fail_19_gate_with_a_different_rounding_passes_the_differential_test": true, + "must_fail_20_loop_admits_a_state_past_a_limit": true, + "must_fail_21_loop_makes_more_changes_than_its_budget": true, + "must_fail_22_design_with_a_margin_at_its_limit_can_still_change": true, + "must_fail_23_edited_ledger_entry_keeps_the_chain": true, + "must_fail_24_formal_record_is_stale_or_missing": true + }, + "controls_passed": "24/24" +} diff --git a/results/formal.json b/results/formal.json new file mode 100644 index 0000000..36b2ce6 --- /dev/null +++ b/results/formal.json @@ -0,0 +1,39 @@ +{ + "schema": "optifab-formal/1", + "lean": "Lean (version 4.35.0, x86_64-unknown-linux-gnu, commit eb6cafb7290e8bd5f2937522d8d804f58f02bafc, Release)", + "theorems": [ + "PlantGate.Spec.gate_ok_sound", + "PlantGate.Spec.gate_complete", + "PlantGate.Spec.refusal_spends_nothing", + "PlantGate.Spec.budget_never_grows", + "PlantGate.Spec.no_margin_rises_past_radius", + "PlantGate.Spec.accepted_stays_within", + "PlantGate.Spec.run_safe", + "PlantGate.Spec.run_bounded" + ], + "comparator": { + "command": "lake comparator --paranoid", + "accepted": true, + "kernels": [ + "Lean default", + "Lean paranoid", + "con-leche", + "con-ron", + "lean4lean", + "nanoda" + ] + }, + "differential_tests": { + "inputs": 300000, + "seed": 20261117, + "failures": 0, + "passed": true + }, + "replay": { + "decisions": 50, + "mismatches": 0 + }, + "bar": "Proven Commons bar check: items 2 to 6 pass; item 1 is open (no reviewer has approved the specification). See formal/BAR-REPORT.md.", + "sources_sha256": "dc427e448abf0d8d54a7a06e1f93ec408b520a93c6dd122c5c0b24fcf9db8d53", + "ledger_hash": "20e492cea1606034f0e6917df14ccb774a219c00748fae8104429939cfbc9532" +} diff --git a/results/ledger.json b/results/ledger.json new file mode 100644 index 0000000..0e769b1 --- /dev/null +++ b/results/ledger.json @@ -0,0 +1,2467 @@ +{ + "head": { + "start_genome": { + "pcm_kwh": 2500, + "capture_ppm": 850000, + "wall_u_mw": 132, + "floor_kw": 600, + "shed_ppm": 300000, + "step_ppm": 1000000 + }, + "start_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 324992, + "load_floor": 940348, + "outage_ride_through": 933334 + }, + "start_eta_ppm": 914228, + "budget": 64, + "limit": 1000000, + "scenario": { + "outage_min": 20, + "outages_per_year": 12, + "low_demand_fraction_ppm": 30000, + "low_demand_hours": 2000 + }, + "seed": 20261117 + }, + "entries": [ + { + "generation": 1, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 2500, + "step_ppm": 500000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 324992, + 940348, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 319309, + 930354, + 933334 + ], + "radius_ppm": 59652, + "eta_before_ppm": 914228, + "eta_after_ppm": 914228, + "budget_before": 64, + "cost": 1, + "verdict": "ok", + "budget_after": 63, + "prev": "0000000000000000000000000000000000000000000000000000000000000000", + "hash": "441d2da3e81c6777264d463c7d22a8ef9d9dff50a49e1dd5302045718d15281b" + }, + { + "generation": 4, + "gene": "floor_kw", + "kind": "software", + "delta": -5, + "step_ppm": 250000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 319309, + 930354, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 319309, + 938172, + 933334 + ], + "radius_ppm": 66666, + "eta_before_ppm": 914228, + "eta_after_ppm": 914355, + "budget_before": 63, + "cost": 1, + "verdict": "ok", + "budget_after": 62, + "prev": "441d2da3e81c6777264d463c7d22a8ef9d9dff50a49e1dd5302045718d15281b", + "hash": "1a56e7cc2d76e26f2cd3939e3cb7a2b2ed73e5ba4af631169af30fda0c8eac37" + }, + { + "generation": 5, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 2500, + "step_ppm": 500000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 319309, + 938172, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 313660, + 928305, + 933334 + ], + "radius_ppm": 61828, + "eta_before_ppm": 914355, + "eta_after_ppm": 914355, + "budget_before": 62, + "cost": 1, + "verdict": "ok", + "budget_after": 61, + "prev": "1a56e7cc2d76e26f2cd3939e3cb7a2b2ed73e5ba4af631169af30fda0c8eac37", + "hash": "0bad3a3aec0f415c6a7cf9d2ca90769c2b792c336cba573009c716b0df77da66" + }, + { + "generation": 8, + "gene": "floor_kw", + "kind": "software", + "delta": -5, + "step_ppm": 250000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 313660, + 928305, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 313660, + 936172, + 933334 + ], + "radius_ppm": 66666, + "eta_before_ppm": 914355, + "eta_after_ppm": 914482, + "budget_before": 61, + "cost": 1, + "verdict": "ok", + "budget_after": 60, + "prev": "0bad3a3aec0f415c6a7cf9d2ca90769c2b792c336cba573009c716b0df77da66", + "hash": "368365f2a4ec6b5f0bbfb5aa358e18fb0c1c13641cf01faeaed737c83f3cf618" + }, + { + "generation": 9, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 2500, + "step_ppm": 500000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 313660, + 936172, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 308043, + 926429, + 933334 + ], + "radius_ppm": 63828, + "eta_before_ppm": 914482, + "eta_after_ppm": 914482, + "budget_before": 60, + "cost": 1, + "verdict": "ok", + "budget_after": 59, + "prev": "368365f2a4ec6b5f0bbfb5aa358e18fb0c1c13641cf01faeaed737c83f3cf618", + "hash": "41282de1ab9fd11341711155a687565c013294e983dcaaecdf47b58fead6b90a" + }, + { + "generation": 12, + "gene": "shed_ppm", + "kind": "software", + "delta": -6250, + "step_ppm": 250000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 308043, + 926429, + 933334 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 308043, + 926429, + 941667 + ], + "radius_ppm": 66666, + "eta_before_ppm": 914482, + "eta_after_ppm": 914483, + "budget_before": 59, + "cost": 1, + "verdict": "ok", + "budget_after": 58, + "prev": "41282de1ab9fd11341711155a687565c013294e983dcaaecdf47b58fead6b90a", + "hash": "05ad892137d3aa28db10cd3fa96485cf0236ac6f98bebc0ff15d8b6c96b4e587" + }, + { + "generation": 13, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 50, + "step_ppm": 500000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 308043, + 926429, + 941667 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 308043, + 926429, + 923203 + ], + "radius_ppm": 58333, + "eta_before_ppm": 914483, + "eta_after_ppm": 914483, + "budget_before": 58, + "cost": 1, + "verdict": "ok", + "budget_after": 57, + "prev": "05ad892137d3aa28db10cd3fa96485cf0236ac6f98bebc0ff15d8b6c96b4e587", + "hash": "cf32e2ae4393882a698b5a3dfda4508543a30d815b6db31a7b68f99c629b3dc7" + }, + { + "generation": 15, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 2500, + "step_ppm": 500000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 308043, + 926429, + 923203 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 916887, + 923203 + ], + "radius_ppm": 73571, + "eta_before_ppm": 914483, + "eta_after_ppm": 914483, + "budget_before": 57, + "cost": 1, + "verdict": "ok", + "budget_after": 56, + "prev": "cf32e2ae4393882a698b5a3dfda4508543a30d815b6db31a7b68f99c629b3dc7", + "hash": "e940a4a62ef2efbf80fbe9427a84da2f5b8f1efad29dfe8e51dc599492c3091f" + }, + { + "generation": 16, + "gene": "floor_kw", + "kind": "software", + "delta": -20, + "step_ppm": 1000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 916887, + 923203 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 949058, + 923203 + ], + "radius_ppm": 76797, + "eta_before_ppm": 914483, + "eta_after_ppm": 914991, + "budget_before": 56, + "cost": 1, + "verdict": "ok", + "budget_after": 55, + "prev": "e940a4a62ef2efbf80fbe9427a84da2f5b8f1efad29dfe8e51dc599492c3091f", + "hash": "9677377895e8ccf5c77688dd069b90e75172697729439690df1dcf8d5ea9ff61" + }, + { + "generation": 17, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 302459, + 949058, + 923203 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 280443, + 911504, + 923203 + ], + "radius_ppm": 50942, + "eta_before_ppm": 914991, + "eta_after_ppm": 914991, + "budget_before": 55, + "cost": 1, + "verdict": "ok", + "budget_after": 54, + "prev": "9677377895e8ccf5c77688dd069b90e75172697729439690df1dcf8d5ea9ff61", + "hash": "1927a67c84e161e6b158d72398b1caa8ca29e718e03ad5f6979c91d4ace0715a" + }, + { + "generation": 19, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 280443, + 911504, + 923203 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 280443, + 911504, + 856061 + ], + "radius_ppm": 76797, + "eta_before_ppm": 914991, + "eta_after_ppm": 914991, + "budget_before": 54, + "cost": 1, + "verdict": "ok", + "budget_after": 53, + "prev": "1927a67c84e161e6b158d72398b1caa8ca29e718e03ad5f6979c91d4ace0715a", + "hash": "a2f36abc4996ab5a0f25427f4aa589b1864bae2966372fb2c43c229794c448e9" + }, + { + "generation": 21, + "gene": "wall_u_mw", + "kind": "hardware", + "delta": -8, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 280443, + 911504, + 856061 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 280370, + 909806, + 856061 + ], + "radius_ppm": 88496, + "eta_before_ppm": 914991, + "eta_after_ppm": 914991, + "budget_before": 53, + "cost": 1, + "verdict": "ok", + "budget_after": 52, + "prev": "a2f36abc4996ab5a0f25427f4aa589b1864bae2966372fb2c43c229794c448e9", + "hash": "363d059846a476f9eb78053c8d249e70c63edd3c76e3f3f6cede42409491c754" + }, + { + "generation": 23, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 280370, + 909806, + 856061 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 258855, + 875176, + 856061 + ], + "radius_ppm": 90194, + "eta_before_ppm": 914991, + "eta_after_ppm": 914991, + "budget_before": 52, + "cost": 1, + "verdict": "ok", + "budget_after": 51, + "prev": "363d059846a476f9eb78053c8d249e70c63edd3c76e3f3f6cede42409491c754", + "hash": "fa3f56287f53ad565c5e0a5d69dcc5d044651b148371307a47ae52aa9a205e9a" + }, + { + "generation": 25, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 258855, + 875176, + 856061 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 237824, + 843085, + 856061 + ], + "radius_ppm": 124824, + "eta_before_ppm": 914991, + "eta_after_ppm": 914991, + "budget_before": 51, + "cost": 1, + "verdict": "ok", + "budget_after": 50, + "prev": "fa3f56287f53ad565c5e0a5d69dcc5d044651b148371307a47ae52aa9a205e9a", + "hash": "0b5e951863a11967a7724b27c01e9e9c2a2cfb53c2695d29e177b73fa4d89e88" + }, + { + "generation": 27, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 237824, + 843085, + 856061 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 237824, + 843085, + 798023 + ], + "radius_ppm": 143939, + "eta_before_ppm": 914991, + "eta_after_ppm": 914991, + "budget_before": 50, + "cost": 1, + "verdict": "ok", + "budget_after": 49, + "prev": "0b5e951863a11967a7724b27c01e9e9c2a2cfb53c2695d29e177b73fa4d89e88", + "hash": "84ee31028ae19cf91ffadb101725551d52b5cf3fa1a39d8212d34beb52bf5a0f" + }, + { + "generation": 29, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 237824, + 843085, + 798023 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 217260, + 813264, + 798023 + ], + "radius_ppm": 156915, + "eta_before_ppm": 914991, + "eta_after_ppm": 914991, + "budget_before": 49, + "cost": 1, + "verdict": "ok", + "budget_after": 48, + "prev": "84ee31028ae19cf91ffadb101725551d52b5cf3fa1a39d8212d34beb52bf5a0f", + "hash": "911b41d2e1d2c18bc943cf97df6d7a7a747cd57587e28a8a6b2ac4b4d57063f5" + }, + { + "generation": 30, + "gene": "floor_kw", + "kind": "software", + "delta": -80, + "step_ppm": 4000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 217260, + 813264, + 798023 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 217260, + 946041, + 798023 + ], + "radius_ppm": 186736, + "eta_before_ppm": 914991, + "eta_after_ppm": 917030, + "budget_before": 48, + "cost": 1, + "verdict": "ok", + "budget_after": 47, + "prev": "911b41d2e1d2c18bc943cf97df6d7a7a747cd57587e28a8a6b2ac4b4d57063f5", + "hash": "78ea4f3d631fac86f8668600dbf8d41ae2f2fce570728fd66c51009e607cef5e" + }, + { + "generation": 31, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 40000, + "step_ppm": 8000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 217260, + 946041, + 798023 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139381, + 828781, + 798023 + ], + "radius_ppm": 53959, + "eta_before_ppm": 917030, + "eta_after_ppm": 917030, + "budget_before": 47, + "cost": 1, + "verdict": "distance", + "budget_after": 47, + "prev": "78ea4f3d631fac86f8668600dbf8d41ae2f2fce570728fd66c51009e607cef5e", + "hash": "a805aacb6463b5d0e0d63faa605f66890c94fae1bbdb2f11d359402baac3f256" + }, + { + "generation": 32, + "gene": "shed_ppm", + "kind": "software", + "delta": -100000, + "step_ppm": 4000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 217260, + 946041, + 798023 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 217260, + 946041, + 911017 + ], + "radius_ppm": 53959, + "eta_before_ppm": 917030, + "eta_after_ppm": 917033, + "budget_before": 47, + "cost": 1, + "verdict": "distance", + "budget_after": 47, + "prev": "a805aacb6463b5d0e0d63faa605f66890c94fae1bbdb2f11d359402baac3f256", + "hash": "daabeedc74ee8bdae32fd8e8dbb4d7c0f67cd428a03a09917a8089b68717e393" + }, + { + "generation": 33, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 217260, + 946041, + 798023 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 197149, + 913722, + 798023 + ], + "radius_ppm": 53959, + "eta_before_ppm": 917030, + "eta_after_ppm": 917030, + "budget_before": 47, + "cost": 1, + "verdict": "ok", + "budget_after": 46, + "prev": "daabeedc74ee8bdae32fd8e8dbb4d7c0f67cd428a03a09917a8089b68717e393", + "hash": "29cf8ae111d7537037471537a54dd23a2c85f3d792d1d0d103ba9e82c4dda6b5" + }, + { + "generation": 34, + "gene": "shed_ppm", + "kind": "software", + "delta": -100000, + "step_ppm": 4000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 197149, + 913722, + 798023 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 197149, + 913722, + 911017 + ], + "radius_ppm": 86278, + "eta_before_ppm": 917030, + "eta_after_ppm": 917033, + "budget_before": 46, + "cost": 1, + "verdict": "distance", + "budget_after": 46, + "prev": "29cf8ae111d7537037471537a54dd23a2c85f3d792d1d0d103ba9e82c4dda6b5", + "hash": "c3027fe0b3a19a4487a119f840d330af9a4e583248e46497c2aa02230f33b2b9" + }, + { + "generation": 35, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 197149, + 913722, + 798023 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 177474, + 883538, + 798023 + ], + "radius_ppm": 86278, + "eta_before_ppm": 917030, + "eta_after_ppm": 917030, + "budget_before": 46, + "cost": 1, + "verdict": "ok", + "budget_after": 45, + "prev": "c3027fe0b3a19a4487a119f840d330af9a4e583248e46497c2aa02230f33b2b9", + "hash": "ce63985c490eee54e3576c30033208ca2da6932531ea8efa6ad2f4345c7d4187" + }, + { + "generation": 36, + "gene": "shed_ppm", + "kind": "software", + "delta": -100000, + "step_ppm": 4000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 177474, + 883538, + 798023 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 177474, + 883538, + 911017 + ], + "radius_ppm": 116462, + "eta_before_ppm": 917030, + "eta_after_ppm": 917033, + "budget_before": 45, + "cost": 1, + "verdict": "ok", + "budget_after": 44, + "prev": "ce63985c490eee54e3576c30033208ca2da6932531ea8efa6ad2f4345c7d4187", + "hash": "1b5e95e9e409dbe172542813c153b8904f26f4e5db0830820266b8535cbac5ba" + }, + { + "generation": 39, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 177474, + 883538, + 911017 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 177474, + 883538, + 853175 + ], + "radius_ppm": 88983, + "eta_before_ppm": 917033, + "eta_after_ppm": 917033, + "budget_before": 44, + "cost": 1, + "verdict": "ok", + "budget_after": 43, + "prev": "1b5e95e9e409dbe172542813c153b8904f26f4e5db0830820266b8535cbac5ba", + "hash": "750e9b6364b4376691d6c8727d9acbea7740235a6c1e9aa8c2c7386b87c3293f" + }, + { + "generation": 41, + "gene": "wall_u_mw", + "kind": "hardware", + "delta": -8, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 177474, + 883538, + 853175 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 177405, + 881889, + 853175 + ], + "radius_ppm": 116462, + "eta_before_ppm": 917033, + "eta_after_ppm": 917033, + "budget_before": 43, + "cost": 1, + "verdict": "ok", + "budget_after": 42, + "prev": "750e9b6364b4376691d6c8727d9acbea7740235a6c1e9aa8c2c7386b87c3293f", + "hash": "d2b98dc4f66960c65831ea8b1546fc316a899d22690cd472e7f0124570d1e918" + }, + { + "generation": 43, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 177405, + 881889, + 853175 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 158154, + 853688, + 853175 + ], + "radius_ppm": 118111, + "eta_before_ppm": 917033, + "eta_after_ppm": 917033, + "budget_before": 42, + "cost": 1, + "verdict": "ok", + "budget_after": 41, + "prev": "d2b98dc4f66960c65831ea8b1546fc316a899d22690cd472e7f0124570d1e918", + "hash": "e6b731f9c95418e2d2d0684259a293594c634534a26cd60a0440003e5cbbcad0" + }, + { + "generation": 45, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 158154, + 853688, + 853175 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 853175 + ], + "radius_ppm": 146312, + "eta_before_ppm": 917033, + "eta_after_ppm": 917033, + "budget_before": 41, + "cost": 1, + "verdict": "ok", + "budget_after": 40, + "prev": "e6b731f9c95418e2d2d0684259a293594c634534a26cd60a0440003e5cbbcad0", + "hash": "5a2d0058cf5f1721d361db3fac5a8993298639779d6dd99d3b20d202fc498abd" + }, + { + "generation": 47, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 853175 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 802239 + ], + "radius_ppm": 146825, + "eta_before_ppm": 917033, + "eta_after_ppm": 917033, + "budget_before": 40, + "cost": 1, + "verdict": "ok", + "budget_after": 39, + "prev": "5a2d0058cf5f1721d361db3fac5a8993298639779d6dd99d3b20d202fc498abd", + "hash": "cff409f12327160638a36ab26f8e8d5dbe7e73317d47740298c9973225664a59" + }, + { + "generation": 48, + "gene": "shed_ppm", + "kind": "software", + "delta": -100000, + "step_ppm": 4000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 802239 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 901742 + ], + "radius_ppm": 172765, + "eta_before_ppm": 917033, + "eta_after_ppm": 917036, + "budget_before": 39, + "cost": 1, + "verdict": "ok", + "budget_after": 38, + "prev": "cff409f12327160638a36ab26f8e8d5dbe7e73317d47740298c9973225664a59", + "hash": "170a4b0ada5398d3e6b50eecb1f2c44dd77e509fdfff521fada5ce3eb670d940" + }, + { + "generation": 49, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 800, + "step_ppm": 8000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 901742 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 727912 + ], + "radius_ppm": 98258, + "eta_before_ppm": 917036, + "eta_after_ppm": 917036, + "budget_before": 38, + "cost": 1, + "verdict": "distance", + "budget_after": 38, + "prev": "170a4b0ada5398d3e6b50eecb1f2c44dd77e509fdfff521fada5ce3eb670d940", + "hash": "e9965a195c7ca6855198b074e5378d98f570409498cdf359d2b6cb47b5e08e21" + }, + { + "generation": 51, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 901742 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 850939 + ], + "radius_ppm": 98258, + "eta_before_ppm": 917036, + "eta_after_ppm": 917036, + "budget_before": 38, + "cost": 1, + "verdict": "ok", + "budget_after": 37, + "prev": "e9965a195c7ca6855198b074e5378d98f570409498cdf359d2b6cb47b5e08e21", + "hash": "e2705b1576ac9e44a8b62f62e4b1f530df294eaa0289060793488eab145193d5" + }, + { + "generation": 52, + "gene": "shed_ppm", + "kind": "software", + "delta": -93750, + "step_ppm": 4000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 850939 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 938968 + ], + "radius_ppm": 149061, + "eta_before_ppm": 917036, + "eta_after_ppm": 917038, + "budget_before": 37, + "cost": 1, + "verdict": "ok", + "budget_after": 36, + "prev": "e2705b1576ac9e44a8b62f62e4b1f530df294eaa0289060793488eab145193d5", + "hash": "cf3792c5ba02641ece5577313a104ceae0cd55146487780c6ce2279b95348d37" + }, + { + "generation": 53, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 800, + "step_ppm": 8000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 938968 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 766284 + ], + "radius_ppm": 61032, + "eta_before_ppm": 917038, + "eta_after_ppm": 917038, + "budget_before": 36, + "cost": 1, + "verdict": "distance", + "budget_after": 36, + "prev": "cf3792c5ba02641ece5577313a104ceae0cd55146487780c6ce2279b95348d37", + "hash": "7499cadafef44435e72df36bb32e518fbc26977b92d65f970d7b748592f3e823" + }, + { + "generation": 55, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 938968 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 888889 + ], + "radius_ppm": 61032, + "eta_before_ppm": 917038, + "eta_after_ppm": 917038, + "budget_before": 36, + "cost": 1, + "verdict": "ok", + "budget_after": 35, + "prev": "7499cadafef44435e72df36bb32e518fbc26977b92d65f970d7b748592f3e823", + "hash": "effbbad2e20fe3afc0ea6561829d141b62930aed55bd0861081dd98d4d218127" + }, + { + "generation": 57, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 888889 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 843882 + ], + "radius_ppm": 111111, + "eta_before_ppm": 917038, + "eta_after_ppm": 917038, + "budget_before": 35, + "cost": 1, + "verdict": "ok", + "budget_after": 34, + "prev": "effbbad2e20fe3afc0ea6561829d141b62930aed55bd0861081dd98d4d218127", + "hash": "19b5bb344fe9d2eba4900cbd404889e0892ffffd863efbe3d7479cac32d758ff" + }, + { + "generation": 59, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 843882 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 803213 + ], + "radius_ppm": 156118, + "eta_before_ppm": 917038, + "eta_after_ppm": 917038, + "budget_before": 34, + "cost": 1, + "verdict": "ok", + "budget_after": 33, + "prev": "19b5bb344fe9d2eba4900cbd404889e0892ffffd863efbe3d7479cac32d758ff", + "hash": "f596597e13765af2b593c885c27fd29accf8e428792df3ddca754af58f2533a2" + }, + { + "generation": 61, + "gene": "capture_ppm", + "kind": "hardware", + "delta": 10000, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 139313, + 827235, + 803213 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120869, + 802372, + 803213 + ], + "radius_ppm": 172765, + "eta_before_ppm": 917038, + "eta_after_ppm": 917038, + "budget_before": 33, + "cost": 1, + "verdict": "ok", + "budget_after": 32, + "prev": "f596597e13765af2b593c885c27fd29accf8e428792df3ddca754af58f2533a2", + "hash": "5aa954bfee79b9fdf1e95db7460d172467b9721ea9e054e68a2154d36b0528dc" + }, + { + "generation": 63, + "gene": "pcm_kwh", + "kind": "hardware", + "delta": 200, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120869, + 802372, + 803213 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120869, + 802372, + 766284 + ], + "radius_ppm": 196787, + "eta_before_ppm": 917038, + "eta_after_ppm": 917038, + "budget_before": 32, + "cost": 1, + "verdict": "ok", + "budget_after": 31, + "prev": "5aa954bfee79b9fdf1e95db7460d172467b9721ea9e054e68a2154d36b0528dc", + "hash": "944f37016b5c3e5887919b5b95237dd18acdb07e172ff0f93e93a9d6bb257400" + }, + { + "generation": 69, + "gene": "wall_u_mw", + "kind": "hardware", + "delta": -1, + "step_ppm": 125000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120869, + 802372, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120860, + 802184, + 766284 + ], + "radius_ppm": 197628, + "eta_before_ppm": 917038, + "eta_after_ppm": 917038, + "budget_before": 31, + "cost": 1, + "verdict": "ok", + "budget_after": 30, + "prev": "944f37016b5c3e5887919b5b95237dd18acdb07e172ff0f93e93a9d6bb257400", + "hash": "41d260b2e81a50268aa239a945728410fbe92963e008eafd85b4549e0b67da58" + }, + { + "generation": 71, + "gene": "wall_u_mw", + "kind": "hardware", + "delta": -1, + "step_ppm": 125000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120860, + 802184, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120852, + 801997, + 766284 + ], + "radius_ppm": 197816, + "eta_before_ppm": 917038, + "eta_after_ppm": 917038, + "budget_before": 30, + "cost": 1, + "verdict": "ok", + "budget_after": 29, + "prev": "41d260b2e81a50268aa239a945728410fbe92963e008eafd85b4549e0b67da58", + "hash": "536bc6cb357be12601f27e197d0ff9492e3b278751a37446d1cdb2fee491af37" + }, + { + "generation": 72, + "gene": "floor_kw", + "kind": "software", + "delta": -5, + "step_ppm": 250000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120852, + 801997, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120852, + 810265, + 766284 + ], + "radius_ppm": 198003, + "eta_before_ppm": 917038, + "eta_after_ppm": 917166, + "budget_before": 29, + "cost": 1, + "verdict": "ok", + "budget_after": 28, + "prev": "536bc6cb357be12601f27e197d0ff9492e3b278751a37446d1cdb2fee491af37", + "hash": "c97f7e722cc27335210c1bf8275b62a557947a6e36c587f28214fd228a24e850" + }, + { + "generation": 74, + "gene": "floor_kw", + "kind": "software", + "delta": -5, + "step_ppm": 250000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120852, + 810265, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120852, + 818705, + 766284 + ], + "radius_ppm": 189735, + "eta_before_ppm": 917166, + "eta_after_ppm": 917294, + "budget_before": 28, + "cost": 1, + "verdict": "ok", + "budget_after": 27, + "prev": "c97f7e722cc27335210c1bf8275b62a557947a6e36c587f28214fd228a24e850", + "hash": "d724e23800fb9ca8067c2994458f42802431eb17166ffd1a3e82f56792083dc5" + }, + { + "generation": 75, + "gene": "wall_u_mw", + "kind": "hardware", + "delta": -2, + "step_ppm": 500000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120852, + 818705, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120835, + 818322, + 766284 + ], + "radius_ppm": 181295, + "eta_before_ppm": 917294, + "eta_after_ppm": 917294, + "budget_before": 27, + "cost": 1, + "verdict": "ok", + "budget_after": 26, + "prev": "d724e23800fb9ca8067c2994458f42802431eb17166ffd1a3e82f56792083dc5", + "hash": "d219425b38c8277fbffa56b55d6131b56b6435155ff9895a64db831a6395a642" + }, + { + "generation": 76, + "gene": "floor_kw", + "kind": "software", + "delta": -20, + "step_ppm": 1000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120835, + 818322, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120835, + 853902, + 766284 + ], + "radius_ppm": 181678, + "eta_before_ppm": 917294, + "eta_after_ppm": 917805, + "budget_before": 26, + "cost": 1, + "verdict": "ok", + "budget_after": 25, + "prev": "d219425b38c8277fbffa56b55d6131b56b6435155ff9895a64db831a6395a642", + "hash": "afd62c47bce0e20dc74464343c010f65cbab6ebcbc48c1cf2fe8d983adb7a1bb" + }, + { + "generation": 78, + "gene": "floor_kw", + "kind": "software", + "delta": -20, + "step_ppm": 1000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120835, + 853902, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120835, + 892715, + 766284 + ], + "radius_ppm": 146098, + "eta_before_ppm": 917805, + "eta_after_ppm": 918317, + "budget_before": 25, + "cost": 1, + "verdict": "ok", + "budget_after": 24, + "prev": "afd62c47bce0e20dc74464343c010f65cbab6ebcbc48c1cf2fe8d983adb7a1bb", + "hash": "d8745f4a8d9949a59f27cb36c657079f6cc00bea56b0bf1ca8353b7ff3f21ef6" + }, + { + "generation": 79, + "gene": "wall_u_mw", + "kind": "hardware", + "delta": -8, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120835, + 892715, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120768, + 891045, + 766284 + ], + "radius_ppm": 107285, + "eta_before_ppm": 918317, + "eta_after_ppm": 918317, + "budget_before": 24, + "cost": 1, + "verdict": "ok", + "budget_after": 23, + "prev": "d8745f4a8d9949a59f27cb36c657079f6cc00bea56b0bf1ca8353b7ff3f21ef6", + "hash": "5ee63683affbacf99167a1d59d2404a4230bde4fd76bae88caa2dfc6e63e7943" + }, + { + "generation": 81, + "gene": "wall_u_mw", + "kind": "hardware", + "delta": -4, + "step_ppm": 2000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120768, + 891045, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 890210, + 766284 + ], + "radius_ppm": 108955, + "eta_before_ppm": 918317, + "eta_after_ppm": 918317, + "budget_before": 23, + "cost": 1, + "verdict": "ok", + "budget_after": 22, + "prev": "5ee63683affbacf99167a1d59d2404a4230bde4fd76bae88caa2dfc6e63e7943", + "hash": "0d9e8c3c9123b03691f99ad288e5ad70675c610820d542d3dad1ad677773932f" + }, + { + "generation": 84, + "gene": "floor_kw", + "kind": "software", + "delta": -20, + "step_ppm": 1000000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 890210, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 932601, + 766284 + ], + "radius_ppm": 109790, + "eta_before_ppm": 918317, + "eta_after_ppm": 918830, + "budget_before": 22, + "cost": 1, + "verdict": "ok", + "budget_after": 21, + "prev": "0d9e8c3c9123b03691f99ad288e5ad70675c610820d542d3dad1ad677773932f", + "hash": "c5b75f02fa5edb363cc05b350828a86e71b1b400d397aa0f34d46616a01ad78a" + }, + { + "generation": 88, + "gene": "floor_kw", + "kind": "software", + "delta": -5, + "step_ppm": 250000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 932601, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 943837, + 766284 + ], + "radius_ppm": 67399, + "eta_before_ppm": 918830, + "eta_after_ppm": 918958, + "budget_before": 21, + "cost": 1, + "verdict": "ok", + "budget_after": 20, + "prev": "c5b75f02fa5edb363cc05b350828a86e71b1b400d397aa0f34d46616a01ad78a", + "hash": "fff82c4431758678ea77bf1f95edd8a1101833d1110a3e0d4d30496708011dfb" + }, + { + "generation": 92, + "gene": "floor_kw", + "kind": "software", + "delta": -2, + "step_ppm": 125000, + "base_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 943837, + 766284 + ], + "cand_ppm": [ + 179100, + 563000, + 387879, + 588180, + 176100, + 801052, + 616000, + 607511, + 300275, + 496948, + 769564, + 120734, + 948407, + 766284 + ], + "radius_ppm": 56163, + "eta_before_ppm": 918958, + "eta_after_ppm": 919009, + "budget_before": 20, + "cost": 1, + "verdict": "ok", + "budget_after": 19, + "prev": "fff82c4431758678ea77bf1f95edd8a1101833d1110a3e0d4d30496708011dfb", + "hash": "20e492cea1606034f0e6917df14ccb774a219c00748fae8104429939cfbc9532" + } + ], + "final_genome": { + "pcm_kwh": 4350, + "capture_ppm": 950000, + "wall_u_mw": 100, + "floor_kw": 413, + "shed_ppm": 0, + "step_ppm": 125000 + }, + "final_margins_ppm": { + "rack_vibration": 179100, + "storey_drift": 563000, + "roof_crown_compression": 387879, + "roof_tornado_uplift_factored": 588180, + "roof_service_deflection_mm": 176100, + "floor_punching_collar": 801052, + "floor_walking_vibration": 616000, + "floor_crown_compression": 607511, + "floor_fire_120min_thrust": 300275, + "floor_duct_hole_shear": 496948, + "sensor_power_at_airflow_turndown": 769564, + "sorption_drive_heat": 120734, + "load_floor": 948407, + "outage_ride_through": 766284 + }, + "final_eta_ppm": 919009, + "final_budget": 19, + "final_hash": "20e492cea1606034f0e6917df14ccb774a219c00748fae8104429939cfbc9532" +} diff --git a/tools/fetch_upstream.py b/tools/fetch_upstream.py new file mode 100644 index 0000000..5dc4773 --- /dev/null +++ b/tools/fetch_upstream.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +"""Clone every pinned repository at its pinned commit into ROOT//. + + python3 tools/fetch_upstream.py ROOT + python3 verify.py --upstream ROOT + +Needs git and network access. All pinned repositories were public on 2026-11-17. Existing clones are left alone. +""" +from __future__ import annotations + +import json +import subprocess +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent + + +def main() -> int: + if len(sys.argv) != 2: + print(__doc__) + return 2 + target = Path(sys.argv[1]).resolve() + repos = json.loads((ROOT / "data" / "sources.json").read_text(encoding="utf-8"))["repos"] + for repo, info in repos.items(): + dest = target / repo + if (dest / ".git").exists(): + print(f"have {repo}") + continue + dest.mkdir(parents=True, exist_ok=True) + url = f"https://github.com/{repo}" + for cmd in (["git", "init", "-q"], ["git", "remote", "add", "origin", url], + ["git", "fetch", "-q", "--depth", "1", "origin", info["commit"]], + ["git", "checkout", "-q", "FETCH_HEAD"]): + subprocess.run(cmd, cwd=dest, check=True) + print(f"fetch {repo} {info['commit'][:7]}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tools/render_map.py b/tools/render_map.py new file mode 100644 index 0000000..ac55336 --- /dev/null +++ b/tools/render_map.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python3 +"""Write docs/CONVERGENCE.md from data/graph.json, data/sources.json and results/certificate.json. + +The map is generated so that it cannot drift from the checked data. Run after `python3 verify.py --write`. +""" +from __future__ import annotations + +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +graph = json.loads((ROOT / "data" / "graph.json").read_text(encoding="utf-8")) +sources = json.loads((ROOT / "data" / "sources.json").read_text(encoding="utf-8"))["repos"] +cert = json.loads((ROOT / "results" / "certificate.json").read_text(encoding="utf-8")) +nodes = {n["id"]: n for n in graph["nodes"]} + + +def link(repo: str) -> str: + return f"[{repo}](https://github.com/{repo})" + + +def where(c: dict) -> str: + commit = sources[c["repo"]]["commit"] + return f"[{c['repo'].split('/')[1]}/{c['path']}:{c['line']}](https://github.com/{c['repo']}/blob/{commit}/{c['path']}#L{c['line']})" + + +def pin(repo: str) -> str: + if repo in sources: + return f"`{sources[repo]['commit'][:7]}`" + return "this repository" if repo == "aska-physical/optifab" else "named only, not read" + + +out: list[str] = [] +w = out.append +g = cert["graph"] +w("# Convergence map") +w("") +w("Generated by `tools/render_map.py` from `data/graph.json`. Do not edit by hand.") +w("") +w(f"This is the work across aska-physical, Foundation-0, Moissanite-Labs and Proven-Commons that bears on a data " + f"centre and the intelligence it runs: {g['nodes']} repositories and {g['edges']} links. Every link cites the line " + f"that states it, at a pinned commit. `python3 verify.py --upstream ROOT` re-reads every cited line.") +w("") +w("Each status below is the repository's own, in its own words or a close paraphrase. Where a repository does not use " + "the Foundation-0 Ledger's words, the evidence level in the stack table was assigned here and says so.") +w("") +w("## The stack, layer by layer") +for layer, title in graph["layers"].items(): + rows = [n for n in graph["nodes"] if n["layer"] == layer] + w("") + w(f"### {layer}. {title}") + w("") + w("| Repository | What it is | Status | Pinned |") + w("|---|---|---|---|") + for n in sorted(rows, key=lambda n: n["id"].lower()): + status = n.get("status", "") + if n.get("status_cite"): + status += f" ({where(n['status_cite'])})" + w(f"| {link(n['id'])} | {n['role']} | {status} | {pin(n['id'])} |") + +w("") +w("## Links") +w("") +w("Link types:") +w("") +for name, text in graph["edge_types"].items(): + w(f"- `{name}`: {text}") + + +def table(title: str, rows: list[dict], intro: str = "") -> None: + w("") + w(f"### {title}") + w("") + if intro: + w(intro) + w("") + w("| From | To | Type | Stated at | Note |") + w("|---|---|---|---|---|") + for e in rows: + w(f"| {e['src']} | {e['dst']} | `{e['type']}` | {where(e['cite'])} | {e.get('note', '')} |") + + +def org(i: str) -> str: + return i.split("/")[0] + + +new = [e for e in graph["edges"] if e.get("new")] +cross = [e for e in graph["edges"] if not e.get("new") and org(e["src"]) != org(e["dst"])] +inside = [e for e in graph["edges"] if not e.get("new") and org(e["src"]) == org(e["dst"])] +table("Added by optifab v0.1.0", new, + f"Before this version the graph holds {g['aska_physical_to_moissanite_links_before']} links between aska-physical " + "and Moissanite-Labs, and a search of the other three organisations' repositories for aska-physical or its " + "data-centre work finds nothing. The Weft link below is the first.") +table("Between organisations, already in place", cross) +table("Inside one organisation", inside) + +w("") +w("## Evidence in the physical stack") +w("") +w(f"The physical stack is optifab and everything it builds on in layers L0 to L3: {g['stack_size']} repositories. " + "The scale is the Foundation-0 Ledger's: claimed 1, preprint 2, peer reviewed or deployed 3, independently " + "replicated 4, formally verified 5.") +w("") +w("| Repository | Evidence | Assigned by | Repositories downstream in the stack |") +w("|---|---|---|---|") +for r in g["stack"]: + w(f"| {r['node']} | {r['evidence']} | {r.get('assigned_by', '')} | {r['downstream_in_stack']} |") +w("") +counts = ", ".join(f"{v} {k}" for k, v in g["stack_by_evidence"].items()) +w(f"Counts: {counts}. Nothing in the stack is peer reviewed, replicated, deployed or formally verified. " + "An independent replication does most good at the top of this table, where the most downstream work rests on it.") + +w("") +w("## Surveyed and not connected") +w("") +w("These were read in the same pass. They are listed so the next reader does not repeat the search.") +w("") +w("| Repository | Why it is not in the stack |") +w("|---|---|") +for s in graph["surveyed_not_connected"]: + w(f"| {link(s['repo'])} | {s['why']} |") + +w("") +w("## Pinned commits") +w("") +w("| Repository | Commit |") +w("|---|---|") +for repo in sorted(sources, key=str.lower): + w(f"| {repo} | `{sources[repo]['commit']}` |") +w("") +(ROOT / "docs" / "CONVERGENCE.md").write_text("\n".join(out), encoding="utf-8") +print(f"wrote docs/CONVERGENCE.md ({len(out)} lines)") + +# ---------------------------------------------------------------- docs/STRUCTURE.md: fill the generated blocks +unit = json.loads((ROOT / "data" / "unit.json").read_text(encoding="utf-8")) + + +def short(repo: str) -> str: + return f"[{repo.split('/')[1] if not repo.endswith('/.github') else repo}](https://github.com/{repo})" + + +blocks: dict[str, list[str]] = {} +b = blocks.setdefault("unit", []) +for organ in unit["organs"]: + b += ["", f"### {organ}", "", "| | Element | Where in the structure | Work it rests on | Status | Note |", "|---|---|---|---|---|---|"] + for e in unit["elements"]: + if e["organ"] == organ: + repos = ", ".join(short(x) for x in e["repos"]) or "none" + b.append(f"| {e['id']} | {e['element']} | {e['where']} | {repos} | {e['status']} | {e['note']} |") +b += ["", "Status words:", ""] + [f"- `{k}`: {v}" for k, v in unit["statuses"].items()] + +b = blocks.setdefault("loop", []) +b += ["| | From | To | Status | Note |", "|---|---|---|---|---|"] +b += [f"| {i['id']} | {i['from']} | {i['to']} | {i['status']} | {i['note']} |" for i in unit["interfaces"]] + +b = blocks.setdefault("notplaced", []) +b += ["| Repository | Why it has no place in the structure |", "|---|---|"] +b += [f"| {link(x['repo'])} | {x['why']} |" for x in unit["not_placed"]] + +u = cert["unit"] +b = blocks.setdefault("count", []) +orgs = ", ".join(f"{v} from {k}" for k, v in u["repositories_placed_by_org"].items()) +stat = ", ".join(f"{v} {k}" for k, v in u["elements_by_status"].items()) +loop = ", ".join(f"{v} {k}" for k, v in u["loop_interfaces_by_status"].items()) +b += [f"- **Placed:** {u['repositories_placed']} of {g['nodes']} repositories ({orgs}). {u['repositories_not_placed']} have no place and say why.", + f"- **Elements:** {u['elements']} ({stat}).", + f"- **Loop:** {u['loop_interfaces']} interfaces ({loop}). The loop is {'closed' if u['loop_closed'] else 'open'}.", + f"- **Elements with nothing behind them:** {', '.join(u['elements_with_no_repository'])}."] + +f = cert["plant_frame"] +b = blocks.setdefault("frame", []) +b += ["| Slot | Content |", "|---|---|"] + [f"| {i} | `{name}` |" for i, name in enumerate(f["slots"])] +b += ["", "| Frame | What the contract check reports |", "|---|---|"] +b += [f"| {k} | {', '.join(f'`{x}`' for x in v) or 'nothing: every term holds'} |" for k, v in f["contract_check"].items()] + +tm = cert["loop_timing"] +b = blocks.setdefault("timing", []) +b += [f"| Plant tone | Delay at {tm['slow_latency_ms']:g} ms, in cycles | Effect at {tm['slow_latency_ms']:g} ms | Delay at {tm['fast_latency_ms']:g} ms, in cycles | Effect at {tm['fast_latency_ms']:g} ms | Longest delay that helps within the cycle |", + "|---|---|---|---|---|---|"] +b += [f"| {r['tone_Hz']:g} Hz | {r['cycles_of_delay_slow']:g} | {r['change_dB_slow']:+.1f} dB | {r['cycles_of_delay_fast']:g} | {r['change_dB_fast']:+.1f} dB | {r['longest_delay_that_helps_within_the_cycle_ms']:g} ms |" + for r in tm["plant_tones"]] + +path = ROOT / "docs" / "STRUCTURE.md" +text = path.read_text(encoding="utf-8") +for name, lines in blocks.items(): + start, end = f"", f"" + if start not in text or end not in text: + raise SystemExit(f"docs/STRUCTURE.md has no {name} block") + head, rest = text.split(start, 1) + text = head + start + "\n" + "\n".join(lines).strip("\n") + "\n" + end + rest.split(end, 1)[1] +path.write_text(text, encoding="utf-8") +print(f"filled {len(blocks)} blocks in docs/STRUCTURE.md") diff --git a/verify.py b/verify.py new file mode 100644 index 0000000..7fe7cf9 --- /dev/null +++ b/verify.py @@ -0,0 +1,1329 @@ +#!/usr/bin/env python3 +"""Deterministic verifier for aska-physical/optifab v0.2.0. + +optifab models one reference data-centre campus as a checked stack and states the contract between +the physical plant and the digital workload. It adds no new measurement. Every number is derived +from certificates and verifier literals of other repositories, pinned in data/. + + python3 verify.py re-derive everything and compare with results/certificate.json + python3 verify.py --write rewrite the certificate after a deliberate change + python3 verify.py --upstream ROOT also re-read every pinned line from clones at ROOT// + python3 verify.py --upstream ROOT --repin refresh commits, file hashes and line numbers from the clones + +What a pass shows: the derivations follow from the pinned inputs, the gate agrees with Weft's own +vectors, the cross-certificate constants agree, and the lineage graph is well formed. +What it does not show: that the upstream models describe a real building. Nothing here is measured. +""" +from __future__ import annotations + +import argparse +import copy +import hashlib +import json +import math +import re +import struct +import subprocess +import sys +from pathlib import Path + +import sympy as sp + +import loop + +ROOT = Path(__file__).resolve().parent +DATA = ROOT / "data" +CERT_PATH = ROOT / "results" / "certificate.json" +LEDGER_PATH = ROOT / "results" / "ledger.json" +FORMAL_PATH = ROOT / "results" / "formal.json" +FORMAL_DIR = ROOT / "formal" +FORMAL_SOURCES = ["PlantGate.lean", "PlantGate/Spec.lean", "PlantGate/Proofs.lean", "Main.lean", "comparator.json", + "lakefile.toml", "lean-toolchain", "tests/oracle.py", "tests/run_tests.py"] +KELVIN = 273.15 +PSF_TO_KPA = 0.04788026 +VERSION = "0.2.0" + + +# --------------------------------------------------------------------------- inputs +def read_json(path: Path): + return json.loads(path.read_text(encoding="utf-8")) + + +def sha256_bytes(data: bytes) -> str: + return hashlib.sha256(data).hexdigest() + + +def parse_vendored(item: dict, raw: bytes): + """Refuse a vendored input whose bytes no longer match the hash in the manifest.""" + if sha256_bytes(raw) != item["sha256"]: + raise SystemExit(f"ERROR: vendored input changed: {item['file']}") + return json.loads(raw.decode("utf-8")) if item["file"].endswith(".json") else raw + + +def load_inputs() -> dict: + manifest = read_json(DATA / "upstream" / "MANIFEST.json") + files = {} + for item in manifest["files"]: + files[item["id"]] = parse_vendored(item, (DATA / "upstream" / item["file"]).read_bytes()) + pins_doc = read_json(DATA / "pins.json") + pins = {p["id"]: p for p in pins_doc["pins"]} + return { + "manifest": manifest, + "ff": files["funi-frame"], + "fl": files["funi-floors"], + "vc": files["venturi-collars"], + "weft_vectors": files["weft-vectors"], + "weft_gate_oracle": files["weft-gate-oracle"], + "pins": pins, + "pins_doc": pins_doc, + "graph": read_json(DATA / "graph.json"), + "sources": read_json(DATA / "sources.json"), + "unit": read_json(DATA / "unit.json"), + } + + +def pin_value(pins: dict, pid: str, key: str): + return pins[pid]["value"][key] + + +# --------------------------------------------------------------------------- symbolic results +def symbolic_theorems() -> dict[str, str]: + """Five identities, each checked symbolically. They are algebra on the upstream model, not new physics.""" + P, pc, pf = sp.symbols("P PUE_c PUE_f", positive=True) + extra_it = (P * pc) / pf - P # same utility supply P*PUE_c, now run at PUE_f + assert sp.simplify(extra_it - P * (pc - pf) / pf) == 0 + assert sp.simplify(extra_it / (P * (pc - pf)) - 1 / pf) == 0 + # the upstream plant model: cooling power (P - q)/c + a, other overhead o, with q, a and o fixed + c, q0, a0, o0, P2 = sp.symbols("c q0 a0 o0 P2", positive=True) + supply = P * pc + used = lambda load: load + (load - q0) / c + a0 + o0 + grown = sp.solve(sp.Eq(used(P2), supply), P2) + assert len(grown) == 1 and sp.simplify((grown[0] - P) - (supply - used(P)) / (1 + 1 / c)) == 0 + + Th, Ta, Tc, C = sp.symbols("T_h T_a T_c C", positive=True) + cop_max = (Tc / (Ta - Tc)) * ((Th - Ta) / Th) # reversible heat-driven chiller between three reservoirs + ta_max = Tc * Th * (1 + C) / (C * Th + Tc) + assert sp.simplify(cop_max.subs(Ta, ta_max) - C) == 0 + assert sp.simplify(sp.diff(cop_max, Ta) + Tc * (Th - Tc) / (Th * (Ta - Tc) ** 2)) == 0 # falls as T_a rises + + a, q, Pm = sp.symbols("alpha q_fix P_min", positive=True) + sol = sp.solve(sp.Eq(a * Pm * C, (1 - a) * Pm + q), Pm) # drive heat from liquid = air-side load / COP + assert len(sol) == 1 and sp.simplify(sol[0] - q / ((1 + C) * a - 1)) == 0 + assert sp.simplify(sp.solve(sp.Eq((1 + C) * a - 1, 0), a)[0] - 1 / (1 + C)) == 0 # q_fix = 0: funi-frame Theorem 4 + + B, T, s = sp.symbols("B T s", positive=True) + shed = sp.solve(sp.Eq(B / (P * (1 - s)), T), s) + assert len(shed) == 1 and sp.simplify(shed[0] - (1 - B / (P * T))) == 0 + phi = sp.symbols("phi", real=True) # a tone minus its own copy delayed by phase phi + assert sp.simplify((1 - sp.cos(phi)) ** 2 + sp.sin(phi) ** 2 - 4 * sp.sin(phi / 2) ** 2) == 0 + return { + "substation_constrained_compute": "dP_IT = (freed utility power)/PUE_f if every overhead grows with load; (freed utility power)/(1 + 1/COP_loop) if only the cooling loop does", + "tri_thermal_recooling_limit": "COP <= (T_c/(T_a - T_c))*((T_h - T_a)/T_h) <=> T_a <= T_c*T_h*(1 + COP)/(COP*T_h + T_c)", + "minimum_load_for_self_cooling": "P_min = q_fix/((1 + COP)*alpha - 1); q_fix = 0 gives alpha* = 1/(1 + COP)", + "shed_fraction_for_outage": "s_min = 1 - B/(P*T) for a cooling outage of length T on thermal budget B", + "delayed_cancellation_residual": "|1 - exp(-i*phi)| = 2*|sin(phi/2)| with phi = 2*pi*f*tau; below 1 within the cycle only if f*tau < 1/6", + } + + +# --------------------------------------------------------------------------- plant envelope +def cop_tri_thermal(th_c: float, ta_c: float, tc_c: float) -> float: + th, ta, tc = th_c + KELVIN, ta_c + KELVIN, tc_c + KELVIN + return (tc / (ta - tc)) * ((th - ta) / th) + + +def recooling_limit_c(th_c: float, tc_c: float, cop: float) -> float: + th, tc = th_c + KELVIN, tc_c + KELVIN + return tc * th * (1.0 + cop) / (cop * th + tc) - KELVIN + + +def minimum_load_mw(q_fix_mw: float, alpha: float, cop: float) -> float: + denom = (1.0 + cop) * alpha - 1.0 + return math.inf if denom <= 0.0 else q_fix_mw / denom + + +def self_cools(p_mw: float, alpha: float, cop: float, q_fix_mw: float) -> bool: + """True when the liquid heat captured at this load can drive the sorption stage for the whole air-side load.""" + return alpha * p_mw * cop >= (1.0 - alpha) * p_mw + q_fix_mw + + +def plant_envelope(inp: dict, design_dt_k: float = 20.0) -> dict: + ff, pins = inp["ff"], inp["pins"] + ts = ff["domain_5_6_three_tier_tes_and_closed_loop_cooling"] + P, q_liq, q_air = ts["P_it_MW"], ts["Q_liquid_w45_MW"], ts["Q_air_rdhx_MW"] + cop = pin_value(pins, "ff.cop_ads", "cop_ads") + cp = pins["ff.cooling_power"]["value"] + other = pin_value(pins, "ff.pue_overhead", "other_overhead_MW") + sky_fraction = pin_value(pins, "ff.q_ates", "sky_fraction") + + # 1. Reproduce both PUE values from the certificate and the pinned literals. + passive = ts["Q_energy_piles_MW"] + sky_fraction * ts["Q_sky_roof_peak_MW"] + q_ates = q_liq + q_air - passive # the drive heat cancels in the upstream expression + pc_funi = q_ates / cp["ates_cop"] + cp["funi_aux_MW"] + pc_conv = P / cp["conv_chiller_cop"] + cp["conv_aux_MW"] + pue_f, pue_c = (P + pc_funi + other) / P, (P + pc_conv + other) / P + reproduction = { + "liquid_plus_air_equals_it_load": abs(q_liq + q_air - P) < 1e-9, + "Q_ates_MW": round(q_ates, 4), + "passive_sinks_MW": round(passive, 4), + "PUE_funi_reproduced": round(pue_f, 5), + "PUE_conventional_reproduced": round(pue_c, 5), + "matches_certificate": round(pue_f, 3) == ts["PUE_funi_frame"] and round(pue_c, 3) == ts["PUE_conventional"], + "annual_heat_to_aquifer_GWh_th": round(q_ates * 8.760, 2), + } + + # 2. Compute unlocked at a fixed utility supply. + freed_utility = pc_conv - pc_funi + extra_scaled = P * (pue_c - pue_f) / pue_f # every overhead grows with the load, so the PUE holds + extra_fixed = freed_utility / (1.0 + 1.0 / cp["ates_cop"]) # only the aquifer loop grows, as in the upstream model + rev = pin_value(pins, "ff.revenue_low", "revenue_low_M_usd_per_MW_yr") + substation = { + "freed_utility_power_MW": round(freed_utility, 3), + "certificate_freed_substation_power_MW": ts["freed_substation_power_MW"], + "extra_it_if_all_overhead_scales_MW": round(extra_scaled, 3), + "extra_it_if_auxiliaries_are_fixed_MW": round(extra_fixed, 3), + "one_over_PUE_funi": round(1.0 / pue_f, 4), + "marginal_PUE_with_fixed_auxiliaries": round(1.0 + 1.0 / cp["ates_cop"], 4), + "certificate_revenue_low_M_usd": ts["unlocked_annual_revenue_low_M_usd"], + "revenue_low_on_extra_it_M_usd": [round(extra_scaled * rev, 2), round(extra_fixed * rev, 2)], + "revenue_overstatement_pct": [round((freed_utility / extra_fixed - 1.0) * 100.0, 1), + round((freed_utility / extra_scaled - 1.0) * 100.0, 1)], + } + + # 3. Second-law envelope of the sorption stage. + t_drive = pin_value(pins, "ff.temps", "T_drive_C") + t_chw_lo, t_chw_hi = pin_value(pins, "ff.temps", "T_chilled_C") + def keys(node): + if isinstance(node, dict): + for k, v in node.items(): + yield k.lower() + yield from keys(v) + elif isinstance(node, list): + for v in node: + yield from keys(v) + + second_law = { + "T_drive_C": t_drive, "T_chilled_C": [t_chw_lo, t_chw_hi], "COP_ads_claimed": cop, + "max_recooling_C_at_chilled_15C": round(recooling_limit_c(t_drive, t_chw_lo, cop), 2), + "max_recooling_C_at_chilled_18C": round(recooling_limit_c(t_drive, t_chw_hi, cop), 2), + "reversible_COP_by_recooling_C": { + f"chilled_{tc:g}C": {str(t): round(cop_tri_thermal(t_drive, t, tc), 3) for t in (25, 30, 35, 40, 45)} + for tc in (t_chw_lo, t_chw_hi)}, + "second_law_efficiency_at_30C_recooling": [round(cop / cop_tri_thermal(t_drive, 30.0, t_chw_hi), 3), + round(cop / cop_tri_thermal(t_drive, 30.0, t_chw_lo), 3)], + "certificate_has_a_recooling_field": any("recool" in k or "reject" in k or "condens" in k for k in keys(ff)), + } + + # 4. Minimum IT load that still drives the sorption stage. + alpha = q_liq / P + area = pin_value(pins, "ff.floor_mass", "floor_area_m2") + perimeter = pin_value(pins, "ff.geometry", "perimeter_m") + height = ff["domain_4_top_down_seismic_cellular_frame"]["total_building_height_m"] + u_roof = ff["domain_1_funicular_radiative_roof"]["U_roof_W_m2K"] + wall = ff["domain_2_vibro_thermal_sandwich_wall"] + ua_roof = u_roof * area + ua_wall, ua_wall_steel = wall["U_wall_cfrp_W_m2K"] * perimeter * height, wall["U_wall_steel_pcsp_W_m2K"] * perimeter * height + q_env = (ua_roof + ua_wall) * design_dt_k * 1e-6 + q_env_steel = (ua_roof + ua_wall_steel) * design_dt_k * 1e-6 + p_min_env = minimum_load_mw(q_env, alpha, cop) + p_min = minimum_load_mw(q_env + other, alpha, cop) + p_min_steel = minimum_load_mw(q_env_steel + other, alpha, cop) + q_fix = q_env + other + min_load = { + "liquid_capture_fraction": round(alpha, 4), + "threshold_capture_fraction_no_fixed_load": round(1.0 / (1.0 + cop), 4), + "design_temperature_difference_K": design_dt_k, + "envelope_gain_MW": round(q_env, 5), + "envelope_gain_steel_pinned_wall_MW": round(q_env_steel, 5), + "other_overhead_MW": other, + "P_min_envelope_only_MW": round(p_min_env, 4), + "P_min_envelope_plus_overhead_MW": round(p_min, 4), + "P_min_as_pct_of_nameplate": round(p_min / P * 100.0, 2), + "P_min_steel_pinned_wall_MW": round(p_min_steel, 4), + "floor_rise_with_steel_pinned_wall_pct": round((p_min_steel / p_min - 1.0) * 100.0, 1), + "required_capture_fraction_by_utilisation": { + str(u): round((1.0 + q_fix / (u * P)) / (1.0 + cop), 4) for u in (1.0, 0.5, 0.25, 0.1)}, + "drive_heat_with_fixed_load_MW": round((q_air + q_fix) / cop, 3), + "drive_heat_available_MW": q_liq, + } + + # 5. Thermal budget and ride-through. + budget = pin_value(pins, "ff.pcm_energy", "pcm_energy_kWh_th") + leak = pin_value(pins, "ff.heat_leak", "heat_leak_kW") + liner = wall["passive_ride_through_with_mpcm_min"] * leak / 60.0 + p_kw = P * 1000.0 + thermal = { + "pcm_budget_kWh_th": budget, + "wall_liner_budget_kWh_th": round(liner, 2), + "full_load_ride_through_min": round(budget / p_kw * 60.0, 2), + "ride_through_min_by_shed_fraction": { + str(s): round(budget / (p_kw * (1.0 - s)) * 60.0, 2) for s in (0.0, 0.25, 0.5, 0.75)}, + "shed_fraction_to_bridge_outage_min": { + str(t): round(max(0.0, 1.0 - budget / (p_kw * t / 60.0)), 4) for t in (10, 15, 30, 60)}, + "burst_hours_at_10pct_over_cooling_capacity": round(budget / (0.10 * p_kw), 2), + } + return {"pue_reproduction": reproduction, "substation": substation, "second_law": second_law, + "minimum_load": min_load, "thermal_budget": thermal} + + +# --------------------------------------------------------------------------- margins +def margin_vector(inp: dict) -> list[dict]: + """Demand over capacity for every certified limit state of the reference campus.""" + ff, fl, vc, pins = inp["ff"], inp["fl"], inp["vc"], inp["pins"] + rf, vb = ff["domain_1_funicular_radiative_roof"], ff["domain_3_broadband_vibration_cascade"] + se, ts = ff["domain_4_top_down_seismic_cellular_frame"], ff["domain_5_6_three_tier_tes_and_closed_loop_cooling"] + cas, fire = fl["funicular_cassette_9mx3m_313psf"], fl["iso834_120min_fire_crossover"] + dg, col = fl["dg11_vibration_benchmark"]["active_prestressed_cassette"], fl["aci318_punching_collar_313psf"]["funi_floor_with_collar"] + sweep = {row["U_duct_m_s"]: row for row in vc["hybrid_cfrp_pcb_coil_sweep"]} + node_mw = sweep[4.0]["P_total_harvested_mW"] / vc["telemetry_power_margin_at_4ms_x"] + k_up = pin_value(pins, "ff.uplift_factor", "uplift_factor") + lim = pin_value(pins, "ff.deflection_limit", "span_over_delta_limit") + rows = [ + ("rack_vibration", "funi-frame", vb["oem_utilization_pct"] / 100.0 * vb["oem_switch_limit_g_rms"], vb["oem_switch_limit_g_rms"]), + ("storey_drift", "funi-frame", se["top_down_story_drift_aska_pct"], se["risk_cat_iv_drift_limit_pct"]), + ("roof_crown_compression", "funi-frame", rf["fc_crown_MPa"], rf["fc_allow_service_MPa"]), + ("roof_tornado_uplift_factored", "funi-frame", k_up * rf["tornado_net_uplift_kN"], rf["tornado_tiedown_capacity_kN"]), + ("roof_service_deflection_mm", "funi-frame", rf["delta_vault_mm"], rf["span_m"] * 1000.0 / lim), + ("sorption_drive_heat", "funi-frame", ts["Q_drive_for_adsorption_MW"], ts["Q_liquid_w45_MW"]), + ("floor_punching_collar", "funi-floors", col["Vu_313psf_kN"], col["phi_Vn_active_collar_kN"]), + ("floor_walking_vibration", "funi-floors", dg["ap_pct_g"], dg["office_limit_pct_g"]), + ("floor_crown_compression", "funi-floors", cas["fc_crown_service_MPa"], cas["fc_service_limit_0.45fc_MPa"]), + ("floor_fire_120min_thrust", "funi-floors", fire["H_fire_120min_demand_kN"], fire["H_cap_hybrid_fesma_mortar_120min_kN"]), + ("floor_duct_hole_shear", "funi-floors", cas["V_quarter_mep_demand_uls_kN"], cas["phi_V_45deg_octagonal_mep_hole_kN"]), + ("sensor_power_at_airflow_turndown", "venturi-collars", node_mw, sweep[1.8]["P_total_harvested_mW"]), + ] + derived = {"sensor_power_at_airflow_turndown"} # the certificate states this margin at 4 m/s only + return [{"limit_state": n, "source": s, "demand": round(d, 6), "capacity": round(c, 6), + "utilisation": round(d / c, 6), "basis": "derived here" if n in derived else "certified"} + for n, s, d, c in rows] + + +def sensor_alternative(inp: dict) -> dict: + """The collar at low airflow against the larger node its own certificate names.""" + vc = inp["vc"] + sweep = {row["U_duct_m_s"]: row for row in vc["hybrid_cfrp_pcb_coil_sweep"]} + names = " ".join(c["control"] for c in vc["must_fail_controls"]) + larger_mw = int(re.search(r"_(\d+)uW_", names).group(1)) / 1000.0 + return {"larger_node_mW": larger_mw, "harvest_at_turndown_mW": sweep[1.8]["P_total_harvested_mW"], + "utilisation_with_larger_node": round(larger_mw / sweep[1.8]["P_total_harvested_mW"], 4)} + + +def plant_radius(margins: list[dict]) -> dict: + worst = max(margins, key=lambda m: m["utilisation"]) + ordered = sorted(margins, key=lambda m: -m["utilisation"]) + return {"plant_radius": math.floor((1.0 - worst["utilisation"]) * 1e4) / 1e4, # rounded down, never optimistic + "binding_limit_state": worst["limit_state"], + "binding_source": worst["source"], "second_tightest": ordered[1]["limit_state"], + "second_tightest_utilisation": ordered[1]["utilisation"]} + + +def ball_in_box_check(u0: list[float], radius: float, samples: int = 20000) -> dict: + """Every point within `radius` of u0 keeps each coordinate at or below 1. + + A coordinate is largest at the axis point u0 + radius*e_i, so those n points decide the matter. Random + points on the sphere are sampled as well, and the check is shown to fail for a slightly larger radius. + """ + n, state, worst = len(u0), 20261117, 0.0 + for _ in range(samples): + direction = [] + for _ in range(n): + state = (state * 6364136223846793005 + 1442695040888963407) % (1 << 64) + direction.append((state >> 11) / float(1 << 53) * 2.0 - 1.0) + norm = math.sqrt(sum(d * d for d in direction)) or 1.0 + worst = max(worst, max(u + radius * d / norm for u, d in zip(u0, direction))) + axis = max(u + radius for u in u0) + return {"samples": samples, "max_coordinate_at_axis_points": round(axis, 6), "max_coordinate_sampled": round(worst, 6), + "all_within_limits": max(axis, worst) <= 1.0, + "fails_if_radius_grows_by_0.001": max(u + radius + 1e-3 for u in u0) > 1.0} + + +# --------------------------------------------------------------------------- the gate +REASONS = {"ok", "non_finite_parameters", "non_positive_budget_or_cost", "insufficient_metabolic_budget", + "shape_mismatch", "non_finite_weights", "baseline_distance_exceeded"} + + +def _flat(values) -> list[float]: + """Nested lists and tuples as one list of floats. Strings such as "NaN" are parsed, as in Weft's vectors.""" + if not isinstance(values, (list, tuple)): + return [float(values)] + out: list[float] = [] + for item in values: + out.extend(_flat(item) if isinstance(item, (list, tuple)) else [float(item)]) + return out + + +def _f32(x: float) -> bytes: + return struct.pack(" float | None: + """Distance over the unlocked coordinates, or None if a value is not finite or a locked coordinate moved. + + A scaled sum of squares with a compensation term. The order of operations follows Weft's reference so + that the two agree to the last bit. + """ + scale, ssq, comp = 0.0, 1.0, 0.0 + for i, (xi, yi) in enumerate(zip(x, y)): + if not (math.isfinite(xi) and math.isfinite(yi)): + return None + if int(locked[i]) != 0: + if not (xi == 0.0 and yi == 0.0) and _f32(xi) != _f32(yi): + return None + continue + step = abs(yi - xi) + if step == 0.0: + continue + if scale < step: + ratio_sq = (scale / step) * (scale / step) + ssq, comp, scale = 1.0 + ssq * ratio_sq, comp * ratio_sq, step + else: + term = (step / scale) * (step / scale) + total = ssq + term + comp += (ssq - total) + term if abs(ssq) >= term else (term - total) + ssq + ssq = total + distance = 0.0 if scale == 0.0 else scale * math.sqrt(ssq + comp) + return distance if math.isfinite(distance) else None + + +def plant_gate(baseline, candidate, radius, budget, cost, locked=None): + """Admission predicate of Weft interface I3. + + A step is admitted when the state stays within `radius` of the baseline (Euclidean distance) and + `budget >= cost > 0`. Returns (accepted, distance, remaining_budget, reason). A rejected step never + spends budget, except that an underflow reports the deficit so the caller can see it. + + Written from Weft's interface note, its conformance vectors and the list path of its reference + implementation. No Weft code is imported or copied. The arithmetic at the boundary is deliberately the + same, and `differential_test` checks the two against each other. + """ + b, c, r = float(budget), float(cost), float(radius) + if not all(map(math.isfinite, (b, c, r))): + return False, math.inf, math.nan, "non_finite_parameters" + if c <= 0.0: + return False, math.inf, b, "non_positive_budget_or_cost" + if b <= 0.0 or r < 0.0: + return False, math.inf, b - c, "non_positive_budget_or_cost" + if b < c: + return False, math.inf, b - c, "insufficient_metabolic_budget" + x, y = _flat(baseline), _flat(candidate) + if not x or len(x) != len(y) or (locked is not None and len(locked) != len(x)): + return False, math.inf, b, "shape_mismatch" + if locked is None: + total = 0.0 + for xi, yi in zip(x, y): + if not (math.isfinite(xi) and math.isfinite(yi)): + return False, math.inf, b, "non_finite_weights" + total += (yi - xi) * (yi - xi) + distance = math.sqrt(total) + if not math.isfinite(distance): + return False, math.inf, b, "non_finite_weights" + else: + distance = _masked_distance(x, y, locked) + if distance is None: + return False, math.inf, b, "non_finite_weights" + if distance > r: + return False, distance, b, "baseline_distance_exceeded" + return True, distance, b - c, "ok" + + +def _same(a, b) -> bool: + """Equal results, with NaN equal to NaN.""" + if isinstance(a, float) and isinstance(b, float): + return (math.isnan(a) and math.isnan(b)) or a == b + return a == b + + +def differential_test(oracle_source: bytes, cases: int = 100000, seed: int = 20261117, gate=None) -> dict: + """plant_gate against Weft's own gate on generated inputs, in the manner of a differential test. + + Weft's module is loaded from the vendored, hash-checked copy and used only as the oracle. The generator + is deterministic. It aims at the places two implementations drift apart: radii within one unit in the + last place of the true distance, magnitudes that overflow or underflow a square, locked coordinates that + move by one float32 step, signed zeros, values that are not finite, nested lists and wrong shapes. + """ + namespace: dict = {"__name__": "weft_gate_oracle", "__file__": "invariants.py"} + exec(compile(oracle_source, "invariants.py", "exec"), namespace) + oracle = namespace["verify_weight_update_safety_ex"] + gate = gate or plant_gate + state = seed + + def rnd() -> float: + nonlocal state + state = (state * 6364136223846793005 + 1442695040888963407) % (1 << 64) + return (state >> 11) / float(1 << 53) + + def pick(options): + return options[int(rnd() * len(options))] + + scales = [1e-200, 1e-160, 1e-30, 1e-8, 1e-3, 1.0, 1.0, 1.0, 37.0, 1e3, 1e8, 1e30, 1e150, 1e200] + special = [math.nan, math.inf, -math.inf, "NaN", "Inf", 0.0, -0.0, 3.5e38, 1e39] + budgets = [(10.0, 1.0), (1.0, 1.0), (0.5, 1.0), (0.0, 1.0), (-1.0, 1.0), (10.0, 0.0), (10.0, -1.0), + (math.nan, 1.0), (10.0, math.inf), (1e-300, 1e-300), (2500.0, 1666.7), (1.0, 1.0000000000000002)] + mismatches, by_reason, raised = [], {}, 0 + for case in range(cases): + n = 1 + int(rnd() * 6) + scale = pick(scales) + base = [(rnd() - 0.5) * 2.0 * scale for _ in range(n)] + move = pick([0.0, 1e-12, 1e-6, 1e-3, 1.0, 1.0, 5.0]) + cand = [v + (rnd() - 0.5) * 2.0 * scale * move for v in base] + locked = None + if rnd() < 0.4: + locked = [1 if rnd() < 0.5 else 0 for _ in range(n)] + for i in range(n): + if locked[i]: + how = rnd() + cand[i] = base[i] if how < 0.6 else (math.nextafter(base[i], math.inf) if how < 0.8 else cand[i]) + if how > 0.95: + base[i], cand[i] = 0.0, -0.0 + if rnd() < 0.08: + (cand if rnd() < 0.5 else base)[int(rnd() * n)] = pick(special) + shape = rnd() + if shape < 0.03: + cand = cand[:-1] + elif shape < 0.05: + base, cand = [], [] + elif shape < 0.08 and locked is not None: + locked = locked + [0] + elif shape < 0.12 and n >= 2: + base, cand = [base[:1], base[1:]], [cand[:1], tuple(cand[1:])] + try: + flat_b, flat_c = _flat(base), _flat(cand) + true = math.sqrt(sum((q - p) ** 2 for p, q, m in zip(flat_b, flat_c, locked or [0] * len(flat_b)) if not m)) + except (ValueError, OverflowError): + true = 1.0 + if not math.isfinite(true): + true = 1.0 + near = [true, true, math.nextafter(true, math.inf), math.nextafter(true, 0.0), true * (1 + 1e-15), + true * (1 - 1e-15), true * 1.001, true * 0.999] + radius = pick(near) if rnd() < 0.85 else pick([0.0, -0.25, 120.0, 1e300, math.nan, math.inf, 0.1989]) + budget, cost = (10.0, 1.0) if rnd() < 0.75 else pick(budgets) + results = [] + for fn in (gate, oracle): + try: + results.append(tuple(fn(base, cand, radius, budget, cost, locked))) + except Exception as err: # the two must fail alike as well + results.append(("raised", type(err).__name__)) + mine, theirs = results + if len(mine) != len(theirs) or not all(_same(m, t) for m, t in zip(mine, theirs)): + mismatches.append(case) + elif mine[0] == "raised": + raised += 1 + else: + by_reason[mine[3]] = by_reason.get(mine[3], 0) + 1 + return {"oracle": "Moissanite-Labs/weft weft/runtime/invariants/invariants.py: verify_weight_update_safety_ex", + "cases": cases, "seed": seed, "mismatches": len(mismatches), "first_mismatches": mismatches[:5], + "agreed_by_reason": dict(sorted(by_reason.items())), "both_raised_the_same_error": raised} + + +def _close(x: float, y: float) -> bool: + if math.isinf(x) or math.isinf(y): + return x == y + return math.isclose(x, y, rel_tol=1e-12, abs_tol=1e-12) + + +def weft_conformance(vectors_doc: dict) -> dict: + failed = [] + for v in vectors_doc["weight_update_vectors"]: + if v["expected_reason"] not in REASONS: + raise ValueError(f"Weft vector uses a reason this gate does not know: {v['expected_reason']}") + ok, dist, rem, reason = plant_gate(v["baseline"], v["candidate"], v["r_invariant"], v["budget"], v["cost"], + v.get("locked_mask")) + want_dist = float(v["expected_distance"]) + if not (ok == v["expected_accepted"] and reason == v["expected_reason"] and _close(dist, want_dist) + and _close(rem, float(v["expected_remaining_budget"]))): + failed.append(v["name"]) + total = len(vectors_doc["weight_update_vectors"]) + return {"schema": vectors_doc["schema"], "weight_update_vectors": total, "passed": total - len(failed), + "failed": failed, "tension_and_royalty_vectors_out_of_scope": len(vectors_doc["tension_vectors"]) + + len(vectors_doc["royalty_vectors"])} + + +def worked_admissions(margins: list[dict], radius: float, envelope: dict, p_it_mw: float) -> list[dict]: + """The gate on plant numbers. Budget is the PCM skid in kWh_th; state is the utilisation vector.""" + u0 = [m["utilisation"] for m in margins] + names = [m["limit_state"] for m in margins] + k = names.index("floor_punching_collar") + budget = envelope["thermal_budget"]["pcm_budget_kWh_th"] + p_kw = p_it_mw * 1000.0 + out = [] + + def run(label, candidate, bud, cost): + ok, dist, rem, reason = plant_gate(u0, candidate, radius, bud, cost) + out.append({"case": label, "accepted": ok, "reason": reason, "distance": None if math.isinf(dist) else round(dist, 4), + "cost_kWh_th": round(cost, 1), "remaining_kWh_th": round(rem, 1)}) + return rem if ok else bud + + left = run("cooling outage, 10 min at full load", u0, budget, p_kw * 10 / 60) + left = run("second 10 min outage before recharge, full load", u0, left, p_kw * 10 / 60) + left = run("same outage after shedding 60 percent of load", u0, left, 0.4 * p_kw * 10 / 60) + moved = list(u0) # illustrative: one margin moved, the others held; a real candidate comes from re-running the upstream verifiers + moved[k] = u0[k] * 1.20 + run("floor punching demand up 20 percent, 5 min outage", moved, budget, p_kw * 5 / 60) + moved[k] = u0[k] * 1.26 + run("floor punching demand up 26 percent, 5 min outage", moved, budget, p_kw * 5 / 60) + return out + + +# --------------------------------------------------------------------------- loop timing +def residual(f_hz: float, tau_s: float) -> float: + """Amplitude left when a tone is countered by its own copy delayed by tau. 1 means no change, 2 the worst case.""" + return 2.0 * abs(math.sin(math.pi * f_hz * tau_s)) + + +def loop_timing(inp: dict, env: dict) -> dict: + """The two loop latencies quoted in the Terrafab documents, tried on this building's certified dynamics.""" + pins, fl, vc = inp["pins"], inp["fl"], inp["vc"] + slow = pin_value(pins, "corpus.latency", "slow_ms") / 1000.0 + fast = pin_value(pins, "corpus.latency", "fast_ms") / 1000.0 + tones = pin_value(pins, "ff.tones", "tones_Hz") + rows = [] + for f in tones: + r_slow, r_fast = residual(f, slow), residual(f, fast) + rows.append({"tone_Hz": f, "cycles_of_delay_slow": round(f * slow, 4), "residual_slow": round(r_slow, 3), + "change_dB_slow": round(20.0 * math.log10(r_slow), 1), + "cycles_of_delay_fast": round(f * fast, 4), "residual_fast": round(r_fast, 3), + "change_dB_fast": round(20.0 * math.log10(r_fast), 1), + "longest_delay_that_helps_within_the_cycle_ms": round(1000.0 / (6.0 * f), 2)}) + tb = env["thermal_budget"] + return { + "slow_latency_ms": slow * 1000.0, "fast_latency_ms": fast * 1000.0, "plant_tones": rows, + "tones_countered_within_cycle_slow": sum(1 for f in tones if f * slow < 1.0 / 6.0), + "tones_countered_within_cycle_fast": sum(1 for f in tones if f * fast < 1.0 / 6.0), + "tones_amplified_slow": sum(1 for f in tones if residual(f, slow) > 1.0), + "highest_frequency_countered_within_cycle_slow_Hz": round(1.0 / (6.0 * slow), 2), + "highest_frequency_countered_within_cycle_fast_Hz": round(1.0 / (6.0 * fast), 2), + "other_structural_frequencies_Hz": { + "isolation_stage_1": pin_value(pins, "ff.stages", "stage_Hz")[0], + "isolation_stage_2": pin_value(pins, "ff.stages", "stage_Hz")[1], + "floor_cassette": fl["dg11_vibration_benchmark"]["active_prestressed_cassette"]["fn_Hz"], + "sensor_reed_flutter": vc["hybrid_cfrp_pcb_coil_sweep"][0]["f_flutter_Hz"]}, + "contract_timescales_s": {"thermal_budget_at_full_load": round(tb["full_load_ride_through_min"] * 60.0, 1), + "wall_liner_ride_through": round(tb["wall_liner_budget_kWh_th"] / pin_value(pins, "ff.heat_leak", "heat_leak_kW") * 3600.0, 1)}, + "slow_latency_as_fraction_of_thermal_budget_time": round(slow / (tb["full_load_ride_through_min"] * 60.0), 7), + } + + +# --------------------------------------------------------------------------- plant frame +PLANT_FRAME = struct.Struct("<16f") # the byte layout of Weft's telemetry frame: 16 little-endian float32 +FRAME_TAIL = ["thermal_budget_kWh_th", "it_load_MW", "recooling_C", "time_s"] + + +def encode_plant_frame(utilisations: list[float], budget_kwh: float, it_load_mw: float, recooling_c: float, + time_s: float) -> bytes: + if len(utilisations) != 16 - len(FRAME_TAIL): + raise ValueError("a plant frame carries exactly 12 margins") + return PLANT_FRAME.pack(*utilisations, budget_kwh, it_load_mw, recooling_c, time_s) + + +def decode_plant_frame(raw: bytes) -> dict: + values = PLANT_FRAME.unpack(raw) + n = 16 - len(FRAME_TAIL) + return {"utilisations": list(values[:n]), **dict(zip(FRAME_TAIL, values[n:]))} + + +def contract_check(frame: dict, load_floor_mw: float, recooling_limit_c: float) -> list[str]: + """What a decoded frame says about the contract. An empty list means every term holds.""" + found = [] + if not all(map(math.isfinite, frame["utilisations"])): + found.append("margin_not_measured") + elif max(frame["utilisations"]) > 1.0: + found.append("limit_exceeded") + budget, load, recool = frame["thermal_budget_kWh_th"], frame["it_load_MW"], frame["recooling_C"] + if not math.isfinite(budget): + found.append("budget_not_measured") + elif budget <= 0.0: + found.append("thermal_budget_exhausted") + if not math.isfinite(load): + found.append("load_not_measured") + elif load < load_floor_mw: + found.append("below_load_floor") + if not math.isfinite(recool): + found.append("recooling_not_measured") + elif recool >= recooling_limit_c: + found.append("recooling_above_limit") + return found + + +def plant_frame_checks(inp: dict, margins: list[dict], radius: float, env: dict) -> dict: + spec = inp["pins"]["weft.frame_struct"]["value"] + u0 = [m["utilisation"] for m in margins] + k = [m["limit_state"] for m in margins].index("floor_punching_collar") + budget = env["thermal_budget"]["pcm_budget_kWh_th"] + p_it = inp["ff"]["domain_5_6_three_tier_tes_and_closed_loop_cooling"]["P_it_MW"] + floor = env["minimum_load"]["P_min_envelope_plus_overhead_MW"] + limit = env["second_law"]["max_recooling_C_at_chilled_18C"] # the looser of the two, so never too strict + + def frame(u=u0, load=p_it, recool=30.0, bud=budget): + return decode_plant_frame(encode_plant_frame(u, bud, load, recool, 0.0)) + + design_raw = encode_plant_frame(u0, budget, p_it, 30.0, 0.0) + design = decode_plant_frame(design_raw) + heavy = list(u0) + heavy[k] = u0[k] * 1.26 + cases = { + "design point, recooling at 30 C": contract_check(design, floor, limit), + "design point as certified, no recooling temperature": contract_check(frame(recool=math.nan), floor, limit), + "idle campus at 0.3 MW": contract_check(frame(load=0.3), floor, limit), + "recooling at 42 C": contract_check(frame(recool=42.0), floor, limit), + "floor punching demand up 26 percent": contract_check(frame(u=heavy), floor, limit), + "thermal budget spent": contract_check(frame(bud=0.0), floor, limit), + } + gate_ok = plant_gate(design["utilisations"], design["utilisations"], radius, design["thermal_budget_kWh_th"], 1.0) + gate_heavy = plant_gate(design["utilisations"], frame(u=heavy)["utilisations"], radius, design["thermal_budget_kWh_th"], 1.0) + return { + "layout": spec["struct"], "bytes": len(design_raw), "floats": 16, + "matches_weft_frame_layout": PLANT_FRAME.format == spec["struct"] and len(design_raw) == spec["bytes"] and spec["floats"] == 16, + "slots": [m["limit_state"] for m in margins] + FRAME_TAIL, + "round_trip_max_error": float(f"{max(abs(a - b) for a, b in zip(u0, design['utilisations'])):.1e}"), + "design_frame_sha256": sha256_bytes(design_raw), + "contract_check": cases, + "gate_from_frame": {"design point": gate_ok[3], "floor punching demand up 26 percent": gate_heavy[3]}, + } + + +# --------------------------------------------------------------------------- the unit +def check_unit(unit: dict, graph: dict) -> dict: + """Every repository of the map is either placed in the structure or listed as not placed, never both.""" + node_ids = {n["id"] for n in graph["nodes"]} + placed: set[str] = set() + for e in unit["elements"]: + if e["status"] not in unit["statuses"] or e["organ"] not in unit["organs"]: + raise ValueError(f"unit element {e['id']} has an unknown status or organ") + for repo in e["repos"]: + if repo not in node_ids: + raise ValueError(f"unit element {e['id']} names a repository that is not on the map: {repo}") + placed.add(repo) + not_placed = {x["repo"] for x in unit["not_placed"]} + if placed & not_placed: + raise ValueError(f"both placed and not placed: {sorted(placed & not_placed)}") + if (placed | not_placed) != node_ids: + raise ValueError(f"not accounted for: {sorted(node_ids - placed - not_placed)}; unknown: {sorted((placed | not_placed) - node_ids)}") + for i in unit["interfaces"]: + if i["status"] not in unit["interface_statuses"]: + raise ValueError(f"interface {i['id']} has an unknown status") + count = lambda items: {s: sum(1 for x in items if x["status"] == s) for s in sorted({x["status"] for x in items})} + by_org: dict[str, int] = {} + for repo in placed: + by_org[org_of(repo)] = by_org.get(org_of(repo), 0) + 1 + return { + "elements": len(unit["elements"]), "elements_by_status": count(unit["elements"]), + "elements_with_no_repository": [e["id"] for e in unit["elements"] if not e["repos"]], + "repositories_placed": len(placed), "repositories_placed_by_org": dict(sorted(by_org.items())), + "repositories_not_placed": len(not_placed), + "loop_interfaces": len(unit["interfaces"]), "loop_interfaces_by_status": count(unit["interfaces"]), + "loop_closed": all(i["status"] == "checked" for i in unit["interfaces"]), + } + + +# --------------------------------------------------------------------------- the improvement loop +LOOP_START = {"pcm_kwh": 2500, "capture_ppm": 850000, "wall_u_mw": 132, "floor_kw": 600, "shed_ppm": 300000, + "step_ppm": 1000000} +LOOP_BUDGET = 64 + + +def loop_plant(inp: dict, env: dict, margins: list[dict]) -> dict: + """The pinned upstream values the loop's plant model needs.""" + ff, pins = inp["ff"], inp["pins"] + cp = pins["ff.cooling_power"]["value"] + return { + "p_it_kw": ff["domain_5_6_three_tier_tes_and_closed_loop_cooling"]["P_it_MW"] * 1000.0, + "cop_ads": pin_value(pins, "ff.cop_ads", "cop_ads"), + "ua_roof_w_k": ff["domain_1_funicular_radiative_roof"]["U_roof_W_m2K"] * pin_value(pins, "ff.floor_mass", "floor_area_m2"), + "wall_area_m2": pin_value(pins, "ff.geometry", "perimeter_m") * ff["domain_4_top_down_seismic_cellular_frame"]["total_building_height_m"], + "design_dt_k": env["minimum_load"]["design_temperature_difference_K"], + "other_kw": env["minimum_load"]["other_overhead_MW"] * 1000.0, + "passive_kw": env["pue_reproduction"]["passive_sinks_MW"] * 1000.0, + "loop_cop": cp["ates_cop"], "aux_kw": cp["funi_aux_MW"] * 1000.0, + # the certified margins no gene of the loop can move + "fixed_margins_ppm": {m["limit_state"]: math.ceil(m["utilisation"] * 1e6 - 1e-9) for m in margins + if m["limit_state"] != "sorption_drive_heat"}, + } + + +def formal_sources_hash() -> str: + return sha256_bytes(b"".join((FORMAL_DIR / f).read_bytes() for f in FORMAL_SOURCES)) + + +def float_gate_agreement(ledger: dict) -> dict: + """The floating-point gate against the exact one on every decision of the ledger.""" + agree = skipped = 0 + for e in ledger["entries"]: + base, cand = [x / 1e6 for x in e["base_ppm"]], [x / 1e6 for x in e["cand_ppm"]] + exact_dist = math.sqrt(oracle_dist_sq(e["base_ppm"], e["cand_ppm"])) / 1e6 + if abs(exact_dist - e["radius_ppm"] / 1e6) < 1e-9: + skipped += 1 # too close to the boundary for floating point to be trusted either way + continue + ok = plant_gate(base, cand, e["radius_ppm"] / 1e6, float(e["budget_before"]), float(e["cost"]))[0] + agree += ok == (e["verdict"] == "ok") + return {"decisions": len(ledger["entries"]), "agree": agree, "within_1e-9_of_boundary_skipped": skipped} + + +def oracle_dist_sq(base: list[int], cand: list[int]) -> int: + return loop.oracle.dist_sq(base, cand) + + +def improvement_loop(inp: dict, env: dict, margins: list[dict]) -> tuple[dict, dict]: + """Run the loop, and three variants that show what the gate and the proposer each contribute.""" + plant = loop_plant(inp, env, margins) + ledger = loop.run_loop(plant, LOOP_START, LOOP_BUDGET) + main = loop.summary(ledger) + reserve = loop.RESERVE + loop.RESERVE = loop.LIMIT # a proposer with no caution of its own + try: + naive = loop.summary(loop.run_loop(plant, LOOP_START, LOOP_BUDGET)) + finally: + loop.RESERVE = reserve + small = loop.summary(loop.run_loop(plant, LOOP_START, 3)) + frozen_start = dict(LOOP_START, shed_ppm=250000) # the outage margin sits exactly on its limit + frozen = loop.summary(loop.run_loop(plant, frozen_start, LOOP_BUDGET)) + below = dict(LOOP_START, floor_kw=500) # a scheduler floor under the load floor of the plant + base_m, below_m = loop.model(LOOP_START, plant), loop.model(below, plant) + refused = loop.oracle.gate(base_m["vector"], below_m["vector"], loop.oracle.headroom(loop.LIMIT, base_m["vector"]), LOOP_BUDGET, 1) + keep = ("decisions", "admitted", "refused", "budget_left", "eta_final_ppm", "worst_margin_ever_admitted_ppm") + report = { + "scenario": loop.SCENARIO, "limit_ppm": loop.LIMIT, "proposer_reserve_ppm": reserve, + "genes": {"hardware": list(loop.HARDWARE), "software": list(loop.SOFTWARE), "proposer": list(loop.META)}, + "margins_in_the_vector": len(base_m["vector"]), + **main, + "final_margins_ppm": ledger["final_margins_ppm"], + "float_gate_on_the_same_decisions": float_gate_agreement(ledger), + "variants": { + "proposer_without_reserve": {k: naive[k] for k in keep}, + "budget_of_three": {k: small[k] for k in keep}, + "start_with_a_margin_exactly_at_its_limit": {k: frozen[k] for k in keep}, + "scheduler_floor_below_the_plant_floor": {"objective_gain_ppm": below_m["eta_ppm"] - base_m["eta_ppm"], + "load_floor_margin_ppm": below_m["margins"]["load_floor"], + "verdict": refused[0]}, + }, + } + return ledger, report + + +def formal_record(ledger: dict) -> dict: + """What the committed formal record must say about the current ledger and Lean sources.""" + if not FORMAL_PATH.exists(): + return {"present": False} + rec = read_json(FORMAL_PATH) + return {"present": True, "lean": rec["lean"], "theorems": rec["theorems"], "comparator": rec["comparator"], + "replay": rec["replay"], "differential_tests": rec["differential_tests"], "bar": rec["bar"], + "matches_current_lean_sources": rec["sources_sha256"] == formal_sources_hash(), + "matches_current_ledger": rec["ledger_hash"] == ledger["final_hash"]} + + +def run_formal(ledger: dict) -> int: + """Rebuild the proofs, run the comparator and the differential tests, and replay the ledger in Lean.""" + def sh(cmd, **kw): + return subprocess.run(cmd, cwd=FORMAL_DIR, capture_output=True, text=True, **kw) + + build = sh(["lake", "build"]) + if build.returncode: + print(build.stdout[-2000:] + build.stderr[-2000:], file=sys.stderr) + return 1 + comparator = sh(["lake", "comparator", "--paranoid"]) + accepted = comparator.returncode == 0 and "Your solution is okay!" in comparator.stdout + kernels = sorted(set(re.findall(r"^(.+?) kernel accepts the solution$", comparator.stdout, flags=re.M))) + tests = sh([sys.executable, "tests/run_tests.py"]) + results = (FORMAL_DIR / "tests" / "TEST-RESULTS.md").read_text(encoding="utf-8") + field = lambda name: re.search(rf"^- {name}: (.+)$", results, flags=re.M).group(1) + lines = loop.replay_lines(ledger) + out = sh([str(FORMAL_DIR / ".lake" / "build" / "bin" / "plantgate")], input="\n".join(lines) + "\n").stdout.split("\n") + mismatches = [e["generation"] for e, got in zip(ledger["entries"], out) + if got != f"{e['verdict']} {e['budget_after']}"] + lean = sh(["lake", "env", "lean", "--version"]).stdout.strip() + record = { + "schema": "optifab-formal/1", "lean": lean, + "theorems": read_json(FORMAL_DIR / "comparator.json")["theorem_names"], + "comparator": {"command": "lake comparator --paranoid", "accepted": accepted, "kernels": kernels}, + "differential_tests": {"inputs": int(field("Inputs")), "seed": int(field("Seed")), "failures": int(field("Failures")), + "passed": tests.returncode == 0}, + "replay": {"decisions": len(lines), "mismatches": len(mismatches)}, + "bar": "Proven Commons bar check: items 2 to 6 pass; item 1 is open (no reviewer has approved the specification). See formal/BAR-REPORT.md.", + "sources_sha256": formal_sources_hash(), "ledger_hash": ledger["final_hash"], + } + ok = accepted and tests.returncode == 0 and not mismatches and int(field("Failures")) == 0 + if ok: + FORMAL_PATH.write_text(json.dumps(record, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + print(f"[FORMAL] comparator {'accepts' if accepted else 'REJECTS'} {len(record['theorems'])} theorems under {len(kernels)} kernels; " + f"{record['differential_tests']['inputs']} differential tests, {record['differential_tests']['failures']} failures; " + f"ledger replay {len(lines)} decisions, {len(mismatches)} mismatches") + return 0 if ok else 1 + + +# --------------------------------------------------------------------------- cross-certificate interfaces +def interface_checks(inp: dict, floor_mass_override: float | None = None) -> list[dict]: + """Values one repository copied by hand from another. Each is compared with its source.""" + ff_pins, fl, vc = inp["pins"], inp["fl"], inp["vc"] + cas = fl["funicular_cassette_9mx3m_313psf"] + floor_mass = cas["dead_mass_kg_m2"] if floor_mass_override is None else floor_mass_override + fe = ff_pins["ff.fesma"]["value"] + sma = fe["sigma0_MPa"] * math.tanh((fe["T_act_C"] - fe["T0_C"]) / fe["T_scale_C"]) + baseline = floor_mass / (1.0 - cas["dead_mass_reduction_vs_744kg_pt_pct"] / 100.0) + sweep = {row["U_duct_m_s"]: row for row in vc["hybrid_cfrp_pcb_coil_sweep"]} + node = sweep[4.0]["P_total_harvested_mW"] / vc["telemetry_power_margin_at_4ms_x"] + rows = [ + ("floor dead mass, kg/m2", pin_value(ff_pins, "ff.floor_mass", "floor_mass_kg_m2"), floor_mass, 0.005, "funi-frame verify.py", "funi-floors certificate"), + ("conventional floor mass, kg/m2", pin_value(ff_pins, "ff.conv_floor_mass", "conv_floor_mass_kg_m2"), baseline, 0.5, "funi-frame verify.py", "funi-floors certificate (mass and reduction)"), + ("Fe-SMA recovery stress, MPa", sma, cas["fe_sma_recovery_stress_MPa"], 0.005, "funi-frame verify.py", "funi-floors certificate"), + ("rack live load, kPa", pin_value(ff_pins, "ff.rack_live", "rack_live_kPa"), 313.0 * PSF_TO_KPA, 0.05, "funi-frame verify.py", "funi-floors 313 psf case"), + ("leak-sensor reactance shift, %", pin_value(ff_pins, "ff.eis_text", "eis_shift_pct"), fl["embodied_carbon_and_eis_leak_twin"]["eis_50khz_coolant_leak_reactance_shift_pct"], 0.005, "funi-frame ENGINEERING_STUDIES.md", "funi-floors certificate"), + ("sensor node power, mW", pin_value(ff_pins, "vc.node_power", "node_power_mW"), node, 0.0005, "venturi-collars README.md", "venturi-collars certificate (harvest over margin)"), + ] + return [{"quantity": q, "downstream_value": round(a, 4), "upstream_value": round(b, 4), "tolerance": tol, + "downstream": dn, "upstream": up, "agrees": abs(a - b) <= tol} for q, a, b, tol, dn, up in rows] + + +# --------------------------------------------------------------------------- lineage graph +def org_of(node_id: str) -> str: + return node_id.split("/")[0] + + +def check_graph(graph: dict, sources: dict, rank: dict, max_depth: int, require_pinned: bool = True) -> dict: + nodes = {n["id"]: n for n in graph["nodes"]} + if len(nodes) != len(graph["nodes"]): + raise ValueError("duplicate node id") + lineage_types = set(graph["lineage_types"]) + for n in graph["nodes"]: + if n["layer"] not in graph["layers"]: + raise ValueError(f"unknown layer on {n['id']}") + if n.get("evidence") is not None and n["evidence"] not in rank: + raise ValueError(f"unknown evidence level on {n['id']}") + parents: dict[str, set[str]] = {i: set() for i in nodes} + children: dict[str, set[str]] = {i: set() for i in nodes} + cites = [e.get("cite") for e in graph["edges"]] + [n["status_cite"] for n in graph["nodes"] if n.get("status_cite")] + for e in graph["edges"]: + if e["src"] not in nodes or e["dst"] not in nodes: + raise ValueError(f"edge names an unknown node: {e['src']} -> {e['dst']}") + if e["type"] not in graph["edge_types"]: + raise ValueError(f"unknown edge type {e['type']}") + if not e.get("cite") or not e["cite"].get("find"): + raise ValueError(f"edge without a citation: {e['src']} -> {e['dst']}") + if e["type"] in lineage_types: + parents[e["dst"]].add(e["src"]) + children[e["src"]].add(e["dst"]) + if require_pinned: + for c in cites: + if c["line"] < 1 or c["path"] not in sources["repos"].get(c["repo"], {}).get("files", {}): + raise ValueError(f"citation not pinned: {c['repo']}:{c['path']}") + + depth: dict[str, int] = {} + visiting: set[str] = set() + + def longest(i: str) -> int: + if i in depth: + return depth[i] + if i in visiting: + raise ValueError(f"lineage cycle through {i}") + visiting.add(i) + depth[i] = 1 + max((longest(p) for p in parents[i]), default=-1) + visiting.discard(i) + return depth[i] + + for i in nodes: + longest(i) + deepest = max(depth.values()) + if deepest >= max_depth: # Weft's registry requires depth < MAX_LINEAGE_DEPTH + raise ValueError(f"lineage depth {deepest} is not below the bound {max_depth}") + + physical = set(graph["physical_layers"]) + + def closure(start: str, rel: dict[str, set[str]]) -> set[str]: + """Nodes reachable from `start`, walking only through the physical layers.""" + seen, stack = set(), [start] + while stack: + for nxt in rel[stack.pop()]: + if nxt not in seen and nodes[nxt]["layer"] in physical: + seen.add(nxt) + stack.append(nxt) + return seen + + me = "aska-physical/optifab" + stack_nodes = closure(me, parents) | {me} + by_evidence: dict[str, int] = {} + table = [] + for i in sorted(stack_nodes, key=lambda x: (-len(closure(x, children) & stack_nodes), x)): + ev = nodes[i].get("evidence") + label = ev or ("no result claimed" if nodes[i]["kind"] == "direction" else "not rated") + by_evidence[label] = by_evidence.get(label, 0) + 1 + row = {"node": i, "evidence": label, "rank": rank.get(ev, 0), + "downstream_in_stack": len(closure(i, children) & stack_nodes)} + if ev: + row["assigned_by"] = nodes[i].get("evidence_by", "source") + table.append(row) + cross: dict[str, int] = {} + cross_new: dict[str, int] = {} + for e in graph["edges"]: + a, b = org_of(e["src"]), org_of(e["dst"]) + if a != b: + key = " <-> ".join(sorted((a, b))) + target = cross_new if e.get("new") else cross + target[key] = target.get(key, 0) + 1 + pair = "Moissanite-Labs <-> aska-physical" + return { + "nodes": len(nodes), "edges": len(graph["edges"]), + "nodes_by_org": {o: sum(1 for i in nodes if org_of(i) == o) for o in sorted({org_of(i) for i in nodes})}, + "nodes_by_layer": {l: sum(1 for n in graph["nodes"] if n["layer"] == l) for l in sorted(graph["layers"])}, + "lineage_edges": sum(1 for e in graph["edges"] if e["type"] in lineage_types), + "lineage_acyclic": True, "lineage_depth": deepest, "lineage_depth_bound": max_depth, + "optifab_lineage_depth": depth[me], + "stack_size": len(stack_nodes), "stack_by_evidence": dict(sorted(by_evidence.items())), + "strongest_evidence_rank_in_stack": max(r["rank"] for r in table), + "stack": table, + "cross_org_links_before": dict(sorted(cross.items())), + "cross_org_links_added": dict(sorted(cross_new.items())), + "aska_physical_to_moissanite_links_before": cross.get(pair, 0), + "aska_physical_to_moissanite_links_added": cross_new.get(pair, 0), + "checked_and_closed_links": sum(1 for e in graph["edges"] if e["type"] == "checked_unrelated"), + } + + +# --------------------------------------------------------------------------- must-fail controls +def _rejects(fn) -> bool: + try: + fn() + except (ValueError, SystemExit): + return True + return False + + +def must_fail_controls(inp: dict, env: dict, margins: list[dict], radius: dict, rank: dict, max_depth: int, + timing: dict, frames: dict, ledger: dict, evolution: dict, formal: dict) -> dict: + pins, graph, sources = inp["pins"], inp["graph"], inp["sources"] + sub, sl, ml = env["substation"], env["second_law"], env["minimum_load"] + cop = pin_value(pins, "ff.cop_ads", "cop_ads") + t_drive = pin_value(pins, "ff.temps", "T_drive_C") + u0 = [m["utilisation"] for m in margins] + r_star = radius["plant_radius"] + k = max(range(len(u0)), key=lambda i: u0[i]) + budget = env["thermal_budget"]["pcm_budget_kWh_th"] + alpha, q_fix = ml["liquid_capture_fraction"], ml["envelope_gain_MW"] + ml["other_overhead_MW"] + p_it = inp["ff"]["domain_5_6_three_tier_tes_and_closed_loop_cooling"]["P_it_MW"] + threshold = ml["threshold_capture_fraction_no_fixed_load"] + oracle_source = inp["weft_gate_oracle"] + + def over(eps): + cand = list(u0) + cand[k] = u0[k] + r_star + eps + return cand + + def cyclic(): + g = copy.deepcopy(graph) + g["edges"].append({"src": "aska-physical/funi-frame", "dst": "Foundation-0/incentre-lattices", "type": "builds_on", + "cite": {"repo": "x", "path": "x", "find": "x", "line": 1}}) + check_graph(g, sources, rank, max_depth, require_pinned=False) + + def chain(depth: int): + """The real graph plus a synthetic lineage chain of exactly this depth.""" + g = copy.deepcopy(graph) + for i in range(depth + 1): + g["nodes"].append({"id": f"aska-physical/synthetic-{i}", "layer": "L2", "kind": "model"}) + if i: + g["edges"].append({"src": f"aska-physical/synthetic-{i - 1}", "dst": f"aska-physical/synthetic-{i}", + "type": "builds_on", "cite": {"repo": "x", "path": "x", "find": "x", "line": 1}}) + check_graph(g, sources, rank, max_depth, require_pinned=False) + + def hypot_gate(baseline, candidate, radius, budget, cost, locked=None): + """A gate that is right in exact arithmetic and differs from Weft only in how it sums the squares.""" + verdict = plant_gate(baseline, candidate, radius, budget, cost, locked) + if locked is not None or verdict[3] not in ("ok", "baseline_distance_exceeded"): + return verdict + distance = math.hypot(*[q - p for p, q in zip(_flat(baseline), _flat(candidate))]) + if distance > float(radius): + return False, distance, float(budget), "baseline_distance_exceeded" + return True, distance, float(budget) - float(cost), "ok" + + def uncited(): + g = copy.deepcopy(graph) + g["edges"][0]["cite"] = {} + check_graph(g, sources, rank, max_depth, require_pinned=False) + + def tampered_input(): + item = inp["manifest"]["files"][0] + raw = (DATA / "upstream" / item["file"]).read_bytes() + parse_vendored(item, raw.replace(b"1.074", b"1.064", 1)) # the same loader, fed an edited certificate + + def unit_gap(): + u = copy.deepcopy(inp["unit"]) + u["not_placed"].pop() + check_unit(u, graph) + + cc = frames["contract_check"] + variants = evolution["variants"] + edited = copy.deepcopy(ledger) + edited["entries"][0]["verdict"] = "ok" if edited["entries"][0]["verdict"] != "ok" else "distance" + flipped = copy.deepcopy(inp["weft_vectors"]) + flipped["weight_update_vectors"][1]["expected_accepted"] = False + drift = interface_checks(inp, floor_mass_override=200.0) + controls = { + # Fails, by design, the day funi-frame computes its revenue on IT power: finding 1 is then out of date. + "must_fail_01_upstream_revenue_is_computed_on_it_power": + sub["certificate_revenue_low_M_usd"] > 1.02 * max(sub["revenue_low_on_extra_it_M_usd"]) + and sub["extra_it_if_auxiliaries_are_fixed_MW"] < sub["certificate_freed_substation_power_MW"], + "must_fail_02_recooling_at_45C_keeps_the_claimed_cop_within_the_second_law": + cop_tri_thermal(t_drive, 45.0, sl["T_chilled_C"][1]) < cop < cop_tri_thermal(t_drive, 30.0, sl["T_chilled_C"][1]), + "must_fail_03_capture_below_the_threshold_self_cools_at_some_load": + math.isinf(minimum_load_mw(q_fix, threshold - 0.01, cop)) and math.isfinite(minimum_load_mw(q_fix, alpha, cop)), + # funi-frame's Theorem 4 threshold is necessary, not sufficient, once a fixed load exists + "must_fail_04_capture_one_point_above_the_threshold_self_cools_at_nameplate": + minimum_load_mw(q_fix, threshold + 0.01, cop) > p_it > minimum_load_mw(q_fix, alpha, cop) + and not self_cools(p_it, threshold + 0.01, cop, q_fix), + "must_fail_05_steel_pinned_wall_keeps_the_same_load_floor": + ml["P_min_steel_pinned_wall_MW"] > 1.25 * ml["P_min_envelope_plus_overhead_MW"], + "must_fail_06_full_load_30min_outage_fits_the_pcm_budget": + plant_gate(u0, u0, r_star, budget, p_it * 1000.0 * 0.5)[3] == "insufficient_metabolic_budget", + "must_fail_07_negative_cost_recharges_the_budget": + plant_gate(u0, u0, r_star, budget, -500.0)[2:] == (budget, "non_positive_budget_or_cost"), + "must_fail_08_step_past_the_tightest_margin_is_admitted": + plant_gate(u0, over(1e-4), r_star, budget, 1.0)[3] == "baseline_distance_exceeded" + and plant_gate(u0, over(1e-4), r_star + 2e-4, budget, 1.0)[0] and over(1e-4)[k] > 1.0, + "must_fail_09_tampered_vendored_input_is_accepted": _rejects(tampered_input), + "must_fail_10_lineage_cycle_is_accepted": _rejects(cyclic), + "must_fail_11_lineage_at_the_weft_depth_bound_is_accepted": + _rejects(lambda: chain(max_depth)) and not _rejects(lambda: chain(max_depth - 1)), + "must_fail_12_link_without_citation_is_accepted": _rejects(uncited), + "must_fail_13_corrupted_weft_vector_goes_unnoticed": weft_conformance(flipped)["failed"] == ["valid_small_move"], + "must_fail_14_drift_in_a_hand_copied_constant_goes_unnoticed": + [r["quantity"] for r in drift if not r["agrees"]] == ["floor dead mass, kg/m2", "conventional floor mass, kg/m2"], + "must_fail_15_slow_loop_counters_a_plant_tone_within_its_cycle": + timing["tones_countered_within_cycle_slow"] == 0 and timing["tones_countered_within_cycle_fast"] == len(timing["plant_tones"]) + and timing["plant_tones"][0]["residual_slow"] > 1.0 > timing["plant_tones"][0]["residual_fast"], + "must_fail_16_certified_design_point_fills_a_frame_without_a_recooling_temperature": + cc["design point as certified, no recooling temperature"] == ["recooling_not_measured"] + and cc["design point, recooling at 30 C"] == [] and cc["recooling at 42 C"] == ["recooling_above_limit"], + "must_fail_17_frame_past_a_limit_or_below_the_floor_passes_the_contract": + cc["floor punching demand up 26 percent"] == ["limit_exceeded"] and cc["idle campus at 0.3 MW"] == ["below_load_floor"] + and cc["thermal budget spent"] == ["thermal_budget_exhausted"] + and frames["gate_from_frame"]["floor punching demand up 26 percent"] == "baseline_distance_exceeded", + "must_fail_18_repository_left_out_of_the_unit_goes_unnoticed": _rejects(unit_gap), + "must_fail_19_gate_with_a_different_rounding_passes_the_differential_test": + differential_test(oracle_source, cases=20000, gate=hypot_gate)["mismatches"] > 0, + "must_fail_20_loop_admits_a_state_past_a_limit": + evolution["every_admitted_state_within_limit"] and evolution["admitted"] > 0 + and variants["proposer_without_reserve"]["worst_margin_ever_admitted_ppm"] <= loop.LIMIT + and variants["scheduler_floor_below_the_plant_floor"]["objective_gain_ppm"] > 0 + and variants["scheduler_floor_below_the_plant_floor"]["verdict"] == "distance", + "must_fail_21_loop_makes_more_changes_than_its_budget": + variants["budget_of_three"]["admitted"] == 3 and variants["budget_of_three"]["budget_left"] == 0 + and evolution["admitted"] + evolution["budget_left"] == evolution["budget_start"], + "must_fail_22_design_with_a_margin_at_its_limit_can_still_change": + variants["start_with_a_margin_exactly_at_its_limit"]["admitted"] == 0 + and variants["start_with_a_margin_exactly_at_its_limit"]["decisions"] > 0, + "must_fail_23_edited_ledger_entry_keeps_the_chain": loop.check_chain(ledger) and not loop.check_chain(edited), + "must_fail_24_formal_record_is_stale_or_missing": + formal.get("present", False) and formal["matches_current_lean_sources"] and formal["matches_current_ledger"] + and formal["comparator"]["accepted"] and formal["replay"]["mismatches"] == 0 + and formal["replay"]["decisions"] == evolution["decisions"], + } + return controls + + +# --------------------------------------------------------------------------- certificate +def build_certificate(with_ledger: bool = False): + inp = load_inputs() + pins = inp["pins"] + rank = pins["f0.evidence_rank"]["value"] + max_depth = pin_value(pins, "weft.max_lineage_depth", "max_lineage_depth") + theorems = symbolic_theorems() + env = plant_envelope(inp) + margins = margin_vector(inp) + radius = plant_radius(margins) + ball = ball_in_box_check([m["utilisation"] for m in margins], radius["plant_radius"]) + conformance = weft_conformance(inp["weft_vectors"]) + differential = differential_test(inp["weft_gate_oracle"]) + ts = inp["ff"]["domain_5_6_three_tier_tes_and_closed_loop_cooling"] + admissions = worked_admissions(margins, radius["plant_radius"], env, ts["P_it_MW"]) + interfaces = interface_checks(inp) + graph = check_graph(inp["graph"], inp["sources"], rank, max_depth) + timing = loop_timing(inp, env) + frames = plant_frame_checks(inp, margins, radius["plant_radius"], env) + unit = check_unit(inp["unit"], inp["graph"]) + ledger, evolution = improvement_loop(inp, env, margins) + formal = formal_record(ledger) + controls = must_fail_controls(inp, env, margins, radius, rank, max_depth, timing, frames, ledger, evolution, formal) + + assert env["pue_reproduction"]["liquid_plus_air_equals_it_load"] and env["pue_reproduction"]["matches_certificate"] + assert not env["second_law"]["certificate_has_a_recooling_field"], "funi-frame now carries a recooling field: revisit finding 2" + assert ball["all_within_limits"] and ball["fails_if_radius_grows_by_0.001"] + assert not conformance["failed"], conformance["failed"] + assert differential["mismatches"] == 0, differential["first_mismatches"] + assert all(r["agrees"] for r in interfaces), [r["quantity"] for r in interfaces if not r["agrees"]] + assert [a["accepted"] for a in admissions] == [True, False, True, True, False], admissions + assert graph["aska_physical_to_moissanite_links_before"] == 0 and graph["aska_physical_to_moissanite_links_added"] >= 1 + assert frames["matches_weft_frame_layout"] and frames["gate_from_frame"]["design point"] == "ok" + assert not unit["loop_closed"], "the loop is reported closed; check data/unit.json before believing it" + assert all(controls.values()), [k for k, v in controls.items() if not v] + + overhead_cut = (ts["PUE_conventional"] - ts["PUE_funi_frame"]) / (ts["PUE_conventional"] - 1.0) * 100.0 + data_files = ["pins.json", "graph.json", "sources.json", "unit.json", "upstream/MANIFEST.json"] + cert = { + "repository": "aska-physical/optifab", "version": VERSION, + "inputs": { + "vendored": {f["file"]: f["sha256"] for f in inp["manifest"]["files"]}, + "data": {f: sha256_bytes((DATA / f).read_bytes()) for f in data_files}, + "pinned_repositories": len(inp["sources"]["repos"]), + "pinned_lines": sum(1 for p in pins.values() if p["kind"] == "line"), + }, + "symbolic_theorems": theorems, + "plant": env, + "margins": {"vector": margins, **radius, "ball_in_box": ball, "sensor_with_larger_node": sensor_alternative(inp)}, + "gate": {"weft_conformance": conformance, "differential_test": differential, "worked_admissions": admissions}, + "interfaces": interfaces, + "ledger_context": { + "ledger_entry": "deepmind-datacenter-cooling-40pct", + "ledger_evidence": pins["f0.ledger_dc_cooling_evidence"]["equals"], + "ledger_result": pins["f0.ledger_dc_cooling"]["equals"], + "funi_frame_cooling_electricity_cut_pct": ts["cooling_electricity_reduction_pct"], + "funi_frame_pue_overhead_cut_pct": round(overhead_cut, 1), + "funi_frame_evidence": "claimed", + }, + "improvement_loop": evolution, + "formal": formal, + "loop_timing": timing, + "plant_frame": frames, + "unit": unit, + "graph": graph, + "must_fail_controls": controls, + "controls_passed": f"{sum(controls.values())}/{len(controls)}", + } + return (cert, ledger) if with_ledger else cert + + +# --------------------------------------------------------------------------- upstream re-check +def repo_dir(root: Path, repo: str) -> Path: + owner, name = repo.split("/") + for cand in (root / owner / name, root / owner.lower() / name): + if cand.is_dir(): + return cand + raise SystemExit(f"ERROR: no clone of {repo} under {root} (expected {root / owner / name})") + + +def all_cites(pins_doc: dict, graph: dict) -> list[dict]: + cites = [p for p in pins_doc["pins"]] + cites += [e["cite"] for e in graph["edges"]] + cites += [n["status_cite"] for n in graph["nodes"] if n.get("status_cite")] + return cites + + +def resolve_pointer(doc, pointer): + for step in pointer: + if isinstance(step, dict): + doc = next(item for item in doc if all(item.get(k) == v for k, v in step.items())) + else: + doc = doc[step] + return doc + + +def upstream_check(root: Path, repin: bool) -> int: + pins_doc, graph = read_json(DATA / "pins.json"), read_json(DATA / "graph.json") + sources = read_json(DATA / "sources.json") if (DATA / "sources.json").exists() else {"schema": "optifab-sources/1", "repos": {}} + problems: list[str] = [] + seen: dict[str, dict] = {} + for c in all_cites(pins_doc, graph): + base = repo_dir(root, c["repo"]) + raw = (base / c["path"]).read_bytes() + digest = sha256_bytes(raw) + entry = seen.setdefault(c["repo"], {"commit": subprocess.run( + ["git", "-C", str(base), "rev-parse", "HEAD"], capture_output=True, text=True, check=True).stdout.strip(), + "files": {}}) + entry["files"][c["path"]] = digest + if c.get("kind") == "json": + if resolve_pointer(json.loads(raw.decode("utf-8")), c["pointer"]) != c["equals"]: + problems.append(f"{c['repo']}:{c['path']} value at pointer changed ({c['id']})") + continue + lines = raw.decode("utf-8").splitlines() + hits = [i + 1 for i, text in enumerate(lines) if c["find"] in text] + if not hits: + problems.append(f"{c['repo']}:{c['path']} no longer contains: {c['find'][:70]}") + elif repin: + c["line"] = hits[0] + elif c["line"] not in hits: + problems.append(f"{c['repo']}:{c['path']} line {c['line']} moved to {hits[0]}") + if not repin and sources["repos"].get(c["repo"], {}).get("files", {}).get(c["path"]) != digest: + problems.append(f"{c['repo']}:{c['path']} content differs from the pinned hash") + def head(base: Path) -> str: + return subprocess.run(["git", "-C", str(base), "rev-parse", "HEAD"], capture_output=True, text=True, + check=True).stdout.strip() + + for s in pins_doc.get("searches", []): + pattern, hits = re.compile(s["pattern"]), 0 + for repo in s["repos"]: + base = repo_dir(root, repo) + seen.setdefault(repo, {"commit": head(base), "files": {}}) # a search is pinned to a commit too + for path in sorted(base.rglob("*")): + if ".git" in path.parts[len(base.parts):] or not path.is_file() or path.stat().st_size > 2_000_000: + continue + try: + hits += len(pattern.findall(path.read_text(encoding="utf-8"))) + except (UnicodeDecodeError, OSError): + continue + if hits != s["expect_hits"]: + problems.append(f"search {s['id']}: {hits} hits, expected {s['expect_hits']}") + manifest = read_json(DATA / "upstream" / "MANIFEST.json") + for item in manifest["files"]: + base = repo_dir(root, item["repo"]) + if sha256_bytes((base / item["path"]).read_bytes()) != item["sha256"]: + problems.append(f"vendored copy of {item['repo']}:{item['path']} differs from the clone") + seen.setdefault(item["repo"], {"commit": subprocess.run( + ["git", "-C", str(base), "rev-parse", "HEAD"], capture_output=True, text=True, check=True).stdout.strip(), + "files": {}})["files"][item["path"]] = item["sha256"] + if problems: + print("\n".join("UPSTREAM: " + p for p in problems), file=sys.stderr) + return 1 + if repin: + sources = {"schema": "optifab-sources/1", + "repos": {r: {"commit": seen[r]["commit"], "files": dict(sorted(seen[r]["files"].items()))} + for r in sorted(seen, key=str.lower)}} + for path, doc in ((DATA / "pins.json", pins_doc), (DATA / "graph.json", graph), (DATA / "sources.json", sources)): + path.write_text(json.dumps(doc, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + print(f"[REPIN] {len(seen)} repositories, {sum(len(v['files']) for v in seen.values())} files pinned") + return 0 + moved = [r for r in seen if sources["repos"][r]["commit"] != seen[r]["commit"]] + note = f" ({len(moved)} clones are at a later commit; the cited files are unchanged)" if moved else "" + print(f"[UPSTREAM] {len(all_cites(pins_doc, graph))} citations and {len(pins_doc.get('searches', []))} searches hold against {root}{note}") + return 0 + + +def main() -> int: + ap = argparse.ArgumentParser(description=__doc__.split("\n")[0]) + ap.add_argument("--write", action="store_true", help="rewrite results/certificate.json") + ap.add_argument("--upstream", type=Path, help="root holding clones as /") + ap.add_argument("--repin", action="store_true", help="with --upstream: refresh commits, hashes and line numbers") + ap.add_argument("--formal", action="store_true", + help="rebuild the Lean proofs, run the comparator and the differential tests, replay the ledger " + "in Lean and rewrite results/formal.json (needs elan and bubblewrap)") + args = ap.parse_args() + if args.upstream: + status = upstream_check(args.upstream.resolve(), args.repin) + if status or args.repin: + return status + if args.formal: + inp = load_inputs() + env, margins = plant_envelope(inp), margin_vector(inp) + if run_formal(improvement_loop(inp, env, margins)[0]): + return 1 + cert, ledger = build_certificate(with_ledger=True) + if args.write: + CERT_PATH.parent.mkdir(parents=True, exist_ok=True) + CERT_PATH.write_text(json.dumps(cert, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + LEDGER_PATH.write_text(json.dumps(ledger, indent=1, ensure_ascii=False) + "\n", encoding="utf-8") + if not CERT_PATH.exists() or read_json(CERT_PATH) != cert: + print("ERROR: results/certificate.json does not match verify.py. Run with --write after a deliberate change.", file=sys.stderr) + return 1 + if not LEDGER_PATH.exists() or read_json(LEDGER_PATH) != ledger: + print("ERROR: results/ledger.json does not match the loop. Run with --write after a deliberate change.", file=sys.stderr) + return 1 + g, m, p = cert["graph"], cert["margins"], cert["plant"] + print(f"[PASS] optifab v{VERSION}: {cert['controls_passed']} controls, " + f"Weft vectors {cert['gate']['weft_conformance']['passed']}/{cert['gate']['weft_conformance']['weight_update_vectors']}, " + f"plant radius {m['plant_radius']} ({m['binding_limit_state']}), " + f"differential test {cert['gate']['differential_test']['cases']} cases, " + f"extra IT {p['substation']['extra_it_if_all_overhead_scales_MW']} to {p['substation']['extra_it_if_auxiliaries_are_fixed_MW']} MW, " + f"recooling limit {p['second_law']['max_recooling_C_at_chilled_18C']} C, " + f"lineage depth {g['optifab_lineage_depth']} of {g['lineage_depth_bound']}, " + f"loop {cert['improvement_loop']['admitted']} changes admitted of {cert['improvement_loop']['decisions']} proposed, " + f"Lean replay {cert['formal']['replay']['mismatches']} mismatches, " + f"unit {cert['unit']['repositories_placed']} repositories placed, " + f"{cert['unit']['loop_interfaces_by_status'].get('checked', 0)} of {cert['unit']['loop_interfaces']} interfaces checked") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main())