# Experimental Verification Center — V16.2

Use a fresh, trusted extracted portal on Linux or Ubuntu/Kali WSL. The runner executes only its built-in profiles, not arbitrary editor drafts or shell commands. Temporary copies, bounded execution times and process group cleanup limit accidental changes; this is **not** an OS sandbox. Run as a normal user. Do not enable this companion on a remote server or an untrusted student's machine.

## Choose how to run

**Offline browser:** open `verification.html`, select a test profile, copy the command and run it in the extracted portal root (the directory containing `index.html`). Import the resulting JSON. This works without a local web server. Reports are untrusted/imported evidence, not authenticated grades. Each run has a UTC timestamp and source-file SHA-256 manifest for staged sources. It does not hash the complete host environment or installed transitive dependencies.

**Local companion (Ubuntu WSL):** stop the old port-8760 Studio server with Ctrl+C in its own terminal. Run `START_VERIFICATION_STUDIO.cmd` on Windows or `bash verification/start.sh` in the extracted root inside Ubuntu. This selects the toolkit virtual environment if available; otherwise it uses `python3`. Open `http://localhost:8760/verification.html`. Choose a profile and click Run approved tests. Only explicitly enabled local same-origin requests with a fixed profile are accepted. No firmware downloads, arbitrary commands, package installation, shell argument injection or test of arbitrary editor drafts are exposed. Use the CLI for full standard acceptance or firmware compilation. Do not start multiple concurrent CLI runners, since some legacy teaching tests use fixed loopback ports.

**CLI (Ubuntu or Kali):** activate the required environment first. From the extracted portal root:

```bash
python3 verification/runner.py --profile standard --output standard-evidence.json
```

Expected: a fresh JSON report and one status line per executed test group. Exit status 0 means no failed/inconclusive/blocked groups; 1 means at least one failed or inconclusive group; 2 means at least one blocked group and no failure. Always inspect the report. Existing output files are never overwritten. Choose another filename for later runs. Profile `services` only observes listeners; a zero exit code in that profile does not establish an application-level pass.

## Profiles and prerequisites

| Profile | Scope | Preparation |
|---|---|---|
| models | 13 actual JS regression suites, browser-model semantics | Node.js |
| python | 6 groups: static, telemetry fixtures, mock local labs, extended acceptance | Python with cryptography, requests, h5py, Pillow; Bash, OpenSSL, Node; fixed loopback ports must be free |
| security | 11 groups, core and advanced security; some tests use synthetic cases or broker decision fixtures | Kali course dependencies or equivalent Python cryptography, Bash, OpenSSL |
| mqtt | Disposable local plaintext MQTT 5 broker, QoS 1 subscription/publication/delivery | Mosquitto executable and Paho MQTT 2.x |
| services | Seven existing fixed loopback listeners, no authentication or DB writes | Start required services according to the individual labs |
| evm | Pinned Solidity compiler, local Ganache transactions, gas receipts | Node >=20 and the pinned direct dependencies installed in `blockchain/node_modules` |
| firmware | Four PlatformIO builds; compilation only | PlatformIO CLI, explicit `--allow-build` consent, toolchains and internet if packages not cached |
| standard | JS + Python + core security + MQTT + EVM; avoids repeating K12–20 (included in extended acceptance) | Combined prerequisites |

When a prerequisite is missing, the affected group is blocked rather than passed. For Python dependencies use the existing Ubuntu toolkit installer or Kali `setup_kali.sh` as appropriate; do not install all packages globally. Existing code is run with fake sensors where applicable. Existing WSL services, real hardware, and public cloud accounts are not changed by the runner. A fixed-port conflict must be resolved by identifying the owner, not by blindly killing processes.

## Actual Solidity execution

In the extracted portal root, open a normal Ubuntu terminal with Node 20 or newer:

```bash
cd blockchain
npm install
cd ..
python3 verification/runner.py --profile evm --output evm-evidence-run1.json
```

Expected: install succeeds, then the report includes actual successful compiler/deployment/state tests, 12 paired raw/digest gas trials and the CSV receipts. The runner requires direct versions `solc 0.8.28`, `ethers 6.13.5`, `ganache 7.9.2`. Save the generated package-lock.json for subsequent installs using `npm ci`; the distributed package does not yet include a resolved dependency lock. No real wallet or public network is used in the runner. A missing npm dependency is blocked. Do not invent gas results.

## Firmware compilation and Wokwi scenarios

Install PlatformIO Core following its official guide if the CLI is absent. Verify `pio --version` in the same Linux environment. From the extracted portal root:

```bash
python3 verification/runner.py --profile firmware --allow-build --output firmware-run1.json
```

Expected: four compile results, or explicit blocked/failed states. This opt-in step can download toolchains and modifies the PlatformIO cache. It compiles temporary project copies, does not flash a device and does not retain binaries. For subsequent Wokwi tests compile the actual extracted project separately, not the temporary runner copy. Example from the root:

```bash
cd psut-wsl/wokwi/uno-blink
pio run
wokwi-cli . --scenario ../../../verification/scenarios/uno-blink.yaml
```

Expected: the built firmware is simulated, and three digital pin assertions check the nominal blink cycle. Wokwi CLI requires a valid installation and may require a token/account and network connection; never paste a token into the portal or an evidence report. Use its documented authentication route. `uno-led-serial.yaml` checks H/L control; `uno-telemetry.yaml` checks a serial prefix only, not numerical sensor correctness. Run each from its corresponding project with `pio run` first. These scenario files are authored from the packaged firmware and official scenario format, **not executed in the build environment**. Wokwi's scenario API is alpha; if a pin name or timing is rejected, inspect the actual simulator trace and record the issue, not a pass. Do not use scenarios to infer actual physical electrical behavior.

Official references: https://docs.platformio.org/en/stable/core/userguide/cmd_run.html ; https://docs.wokwi.com/wokwi-ci/automation-scenarios ; https://docs.wokwi.com/wokwi-ci/cli-installation ; https://docs.npmjs.com/cli/v11/commands/npm-ci/ .

## Interpretation and evidence

- Passed in scope: the defined test group passed; it does not mean every step of every associated lab passed.
- Failed: a test returned failure. Check the logs for implementation, environment or harness errors.
- Blocked: missing prerequisites or port conflict prevented execution.
- Inconclusive: timeout or missing required evidence. Do not score it as a pass.
- Reachable only: TCP connection opened; application functionality is not verified.
- Not executed: there is no associated result in the selected report.

Export the JSON and Markdown, inspect artifacts, and use the lab acceptance checklist for manual or physical tests. The mentor receives selected text from the result, but not arbitrary shell execution. Reports can contain host observations; inspect them before sharing. Do not distribute logs containing actual credentials. This is a reproducibility tool, not an exam security boundary.

### Supplemental virtual electronics profile
Run `python3 verification/runner.py --profile electronics --output electronics-evidence.json` from the portal root. Expected: one group passes, reporting 927 model assertions. This profile is separate from the historical consolidated audit to preserve its scope. No physical signal acquisition or firmware execution.

## V17.2 consolidated acceptance
Run `python3 verification/runner.py --profile consolidated --output release172-evidence.json`. Includes the newer module tests and catalog/HTTP controls; Instructor also runs LMS and backup checks. Some groups require Mosquitto/Paho and pinned local EVM dependencies. The consolidated profile is CLI-only. Firmware builds, physical sensors and external services remain separate.
