Skip to content

Commit e937d48

Browse files
committed
ops: align setup install and reconciliation gates
1 parent c9e7e2f commit e937d48

35 files changed

Lines changed: 3952 additions & 275 deletions

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ jobs:
2525
- name: cargo fmt
2626
working-directory: elastos
2727
run: cargo fmt --all -- --check
28+
- name: architecture entropy checks
29+
run: |
30+
bash scripts/check-wci-alignment.sh
31+
node scripts/home-entropy-check.mjs
32+
node scripts/browser-entropy-check.mjs
2833
- name: cargo clippy
2934
working-directory: elastos
3035
run: cargo clippy --workspace --all-targets -- -D warnings

justfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ lint:
4646
fmt:
4747
cd elastos && cargo fmt --all
4848

49-
# Pre-commit gate: alignment, smoke tests, fmt/lint/test
49+
# Pre-commit gate: alignment, entropy, smoke tests, fmt/lint/test
5050
verify:
51+
git diff --check
5152
just alignment-check
53+
node scripts/home-entropy-check.mjs
54+
node scripts/browser-entropy-check.mjs
5255
just local-carrier-setup-smoke
5356
./scripts/command-smoke.sh
5457
just candidate-command-audit

scripts/README.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Top-level directly-invoked entrypoints stay at the root:
2121
- `home-demo-local.sh` — prepare and launch the local source-based Home demo in a clean temp home
2222
- `publish-release.sh` — low-level release publisher
2323
- `setup-crosvm.sh` — install runtime VM prerequisites
24+
- `setup-source-home.sh` — build/provision the source-home runtime and generated helper scripts
2425
- `share-demo.sh` — share project docs/content
2526

2627
If a script is something a human is expected to type from docs, it belongs here.
@@ -48,12 +49,36 @@ Proof, smoke, and audit helpers also currently live at the root. Common examples
4849
- `public-install-home-frontdoor-smoke.sh`
4950
- `protected-content-provider-contract-smoke.sh`
5051
- `recovery-kit-live-smoke.sh`
52+
- `people-conversations-local-smoke.sh`
53+
- `browser-vm-target-refresh.sh`
54+
- `linux-source-home-restart.sh`
5155

5256
These are review and release helpers, not automatically part of the stable
5357
end-user command contract. The `public-install-*.sh` helpers can target a
54-
published candidate gateway by setting `ELASTOS_PUBLISHER_GATEWAY=<url>`.
58+
published candidate gateway by setting `ELASTOS_PUBLISHER_GATEWAY=<url>`. They
59+
use the stamped trusted-source transports by default. During 0.5.0 candidate
60+
review, `ELASTOS_BIN_OVERRIDE=<path-to-branch-elastos>` swaps in the current
61+
branch binary only when the selected gateway serves a 0.5.0-compatible manifest
62+
with the current `home` setup profile and checksummed artifacts. The helpers pin
63+
the installer-selected components manifest so source checkout metadata cannot
64+
leak into the installed-path smoke. Use `scripts/local-carrier-setup-smoke.sh`
65+
for source/local Carrier setup proof before a candidate gateway exists. Set
66+
`ELASTOS_PUBLIC_INSTALL_FORCE_RELAY_ONLY=1` when you intentionally want to
67+
turn the public install proof into a stricter publisher relay-health check.
5568
`recovery-kit-live-smoke.sh` requires `ELASTOS_HOME_TOKEN` from a signed
5669
browser session and is non-mutating unless create/import flags are set.
70+
`people-conversations-local-smoke.sh` is a local review wrapper for the People
71+
and Chat conversation slice. It composes the Home entropy guard with the narrow
72+
Rust/WASM tests for join-object creation, launch-query preservation, profile
73+
cards, People contact projection, and Chat invite-query decoding.
74+
`browser-vm-target-refresh.sh` is the renewable drift-repair path for
75+
already-provisioned Browser VM targets. It refreshes installed helper scripts
76+
and guest script artifacts from the reviewed source checkout without pretending
77+
those helpers are standalone `components.json` release components.
78+
`linux-source-home-restart.sh` is the Linux source-home gateway restart/proof
79+
path for targets such as Jetson. Run it after full source-home setup replaces
80+
the gateway binary so the live front door comes back with a hash-bound Home and
81+
Services receipt.
5782
`auth-wallet-focus-smoke.sh` runs the current passkey, Recovery Kit,
5883
capsule-bridge principal storage, principal-launch, System managed-wallet route,
5984
wallet approval, managed-wallet, BTC, typed chain proof/prepare/broadcast,
@@ -72,6 +97,7 @@ include:
7297
- `browser-glide-wallet-smoke.sh`
7398
- `browser-per-launch-selkies-supervisor-smoke.sh`
7499
- `browser-session-capacity-smoke.sh`
100+
- `browser-vm-engine-supervisor-autostart-smoke.sh`
75101
- `browser-home-session-smoke.sh`
76102
- `browser-ela-city-protected-content-open-smoke.sh`
77103
- `HOME_URL=http://localhost:8090/apps/home/ HOME_VIRTUAL_AUTH_BROWSER=1 HOME_VIRTUAL_AUTH_BROWSER_OPEN=1 node scripts/home-passkey-virtual-auth-smoke.mjs`
@@ -100,9 +126,17 @@ Use `HOME_VIRTUAL_AUTH_BROWSER_OPEN_CONCURRENT=2` and
100126
`HOME_VIRTUAL_AUTH_BROWSER_OPEN_HOLD_MS=30000` with the same smoke to prove
101127
multiple Runtime Browser pages can stay alive, receive heartbeats, appear in
102128
the Browser session-capacity receipt, and close without leaving capacity behind.
103-
Use `scripts/browser-session-capacity-smoke.sh` first when you only need to
104-
verify that a running gateway exposes `elastos.browser.session-capacity/v1`
105-
without opening a heavyweight Browser engine session.
129+
Use `HOME_VIRTUAL_AUTH_BROWSER_OPEN=0 HOME_VIRTUAL_AUTH_BROWSER_SUMMARY=1` on
130+
`home-passkey-virtual-auth-smoke.mjs` when you only need to verify that a
131+
running gateway exposes `elastos.browser.session-capacity/v1` without opening a
132+
heavyweight Browser engine session.
133+
Use `scripts/browser-session-capacity-smoke.sh` to prove the active Browser
134+
capacity path. By default it opens one Browser page, holds heartbeats for
135+
30 seconds, verifies an additional open fails closed with structured
136+
`browser_capacity_unavailable`, then closes the page and checks the Browser
137+
session-capacity receipt returns to baseline. Override
138+
`HOME_VIRTUAL_AUTH_BROWSER_OPEN_CONCURRENT` only for a provider that truthfully
139+
supports more active pages than the current Mac VM single-page substrate.
106140
`scripts/browser-home-session-smoke.sh` is the named release gate wrapper for
107141
that proof. Override `HOME_URL`, `HOME_VIRTUAL_AUTH_BROWSER_OPEN_CONCURRENT`,
108142
and `HOME_VIRTUAL_AUTH_BROWSER_OPEN_HOLD_MS` when testing another runtime.
@@ -115,6 +149,11 @@ through a disposable Home passkey and close the page cleanly. This is a Browser
115149
reachability and session-cleanup proof only; it does not prove purchase,
116150
license, key release, or dDRM playback success.
117151

152+
Internal target-maintenance wrappers that depend on private SSH aliases,
153+
reverse tunnels, local usernames, or host-specific data roots should not live in
154+
the public repo. Keep those commands in local operator notes and leave reusable
155+
repo scripts parameterized through explicit environment variables or CLI flags.
156+
118157
## Support Subdirectories
119158

120159
- `build/` — lower-level build helpers

scripts/browser-entropy-check.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,8 @@ assert(
993993

994994
assert(
995995
browserVmRemoteVzLauncher.includes("ELASTOS_BROWSER_REMOTE_VZ_SSH") &&
996+
browserVmRemoteVzLauncher.includes("ELASTOS_BROWSER_REMOTE_VZ_SSH must name") &&
997+
!browserVmRemoteVzLauncher.includes(["elastos", "mac", "staging"].join("-")) &&
996998
browserVmRemoteVzLauncher.includes("-R") &&
997999
!browserVmRemoteVzLauncher.includes("control-forward") &&
9981000
!browserVmRemoteVzLauncher.includes("waitForLocalTcpPort") &&

scripts/browser-mac-vm-acceptance-audit-smoke.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ write_machine_proof "$tmp_dir/mac-generic-profile.json" "Log In Profile director
363363
const proof = JSON.parse(fs.readFileSync(process.argv[1], "utf8"));
364364
proof.profile_reset.receipt.profile.profile_key = "profile-secret";
365365
proof.profile_reset.receipt.profile.principal_id = "person:local:secret";
366-
proof.profile_reset.receipt.profile.disk_path = "/Users/anders/elastos/Users/0123456789ab/BrowserProfiles/default/profile.ext4";
366+
proof.profile_reset.receipt.profile.disk_path = "/Users/operator/elastos/Users/0123456789ab/BrowserProfiles/default/profile.ext4";
367367
fs.writeFileSync(process.argv[2], `${JSON.stringify(proof, null, 2)}\n`);
368368
' "$tmp_dir/mac-authenticated.json" "$tmp_dir/mac-leaky-profile-reset.json"
369369

@@ -411,13 +411,13 @@ const sourceHomeRestart = {
411411
ok: true,
412412
dry_run: false,
413413
generated_at: "2026-06-19T00:00:00.000Z",
414-
repo: "/Users/anders/Code/elastos-runtime",
415-
test_home: "/Users/anders/elastos-mac-test-home",
416-
data_dir: "/Users/anders/elastos-mac-test-home/Library/Application Support/elastos",
414+
repo: "/Users/operator/Code/elastos-runtime",
415+
test_home: "/Users/operator/elastos-mac-test-home",
416+
data_dir: "/Users/operator/elastos-mac-test-home/Library/Application Support/elastos",
417417
addr: "localhost:61180",
418418
home_url: "http://localhost:61180/apps/home/",
419-
gateway_bin: "/Users/anders/Code/elastos-runtime/elastos/target/release/elastos",
420-
gateway_log: "/Users/anders/elastos-mac-test-home/logs/gateway-smoke.log",
419+
gateway_bin: "/Users/operator/Code/elastos-runtime/elastos/target/release/elastos",
420+
gateway_log: "/Users/operator/elastos-mac-test-home/logs/gateway-smoke.log",
421421
http_code: 200,
422422
served_index_sha256: proof.home.installed_index_sha256,
423423
installed_index_sha256: proof.home.installed_index_sha256,

scripts/browser-mac-vm-acceptance-handoff-smoke.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,13 @@ const receipt = {
186186
ok: true,
187187
dry_run: false,
188188
generated_at: "2026-06-19T00:00:00.000Z",
189-
repo: "/Users/anders/Code/elastos-runtime",
190-
test_home: "/Users/anders/elastos-mac-test-home",
191-
data_dir: "/Users/anders/elastos-mac-test-home/Library/Application Support/elastos",
189+
repo: "/Users/operator/Code/elastos-runtime",
190+
test_home: "/Users/operator/elastos-mac-test-home",
191+
data_dir: "/Users/operator/elastos-mac-test-home/Library/Application Support/elastos",
192192
addr: "localhost:61180",
193193
home_url: "http://localhost:61180/apps/home/",
194-
gateway_bin: "/Users/anders/Code/elastos-runtime/elastos/target/release/elastos",
195-
gateway_log: "/Users/anders/elastos-mac-test-home/logs/gateway-smoke.log",
194+
gateway_bin: "/Users/operator/Code/elastos-runtime/elastos/target/release/elastos",
195+
gateway_log: "/Users/operator/elastos-mac-test-home/logs/gateway-smoke.log",
196196
http_code: 200,
197197
served_index_sha256: proof.home.installed_index_sha256,
198198
installed_index_sha256: proof.home.installed_index_sha256,

scripts/browser-mac-vm-manual-ux-smoke.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ missing_profile_reset_sha="$("$node_bin" -e 'const fs = require("node:fs"); cons
294294
const proof = JSON.parse(fs.readFileSync(process.argv[1], "utf8"));
295295
proof.profile_reset.receipt.profile.profile_key = "profile-secret";
296296
proof.profile_reset.receipt.profile.principal_id = "person:local:secret";
297-
proof.profile_reset.receipt.profile.disk_path = "/Users/anders/elastos/Users/0123456789ab/BrowserProfiles/default/profile.ext4";
297+
proof.profile_reset.receipt.profile.disk_path = "/Users/operator/elastos/Users/0123456789ab/BrowserProfiles/default/profile.ext4";
298298
fs.writeFileSync(process.argv[2], `${JSON.stringify(proof, null, 2)}\n`);
299299
' "$tmp_dir/mac-valid.json" "$tmp_dir/mac-leaky-profile-reset.json"
300300
leaky_profile_reset_sha="$("$node_bin" -e 'const fs = require("node:fs"); const crypto = require("node:crypto"); process.stdout.write(crypto.createHash("sha256").update(fs.readFileSync(process.argv[1])).digest("hex"));' "$tmp_dir/mac-leaky-profile-reset.json")"

scripts/browser-per-launch-selkies-supervisor-smoke.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ trap cleanup EXIT
2020

2121
cd "$repo_root"
2222

23-
service_home="${ELASTOS_BROWSER_SERVICE_HOME:-/home/wau/.local/share/elastos-public-gateway-live}"
23+
service_home="${ELASTOS_BROWSER_SERVICE_HOME:-$tmp_dir/service-home}"
2424
service_xdg_data_home="${ELASTOS_BROWSER_SERVICE_XDG_DATA_HOME:-$service_home/xdg-data}"
2525
browser_program="${ELASTOS_BROWSER_SELKIES_BROWSER_PROGRAM:-}"
26-
if [[ -z "$browser_program" && -x /home/wau/.cache/ms-playwright/chromium-1217/chrome-linux64/chrome ]]; then
27-
browser_program="/home/wau/.cache/ms-playwright/chromium-1217/chrome-linux64/chrome"
28-
fi
2926
if [[ -z "$browser_program" || ! -x "$browser_program" ]]; then
3027
echo "ELASTOS_BROWSER_SELKIES_BROWSER_PROGRAM must point at an executable Chromium binary" >&2
3128
exit 2

scripts/browser-provider-decision-report.mjs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,14 @@ import { spawnSync } from "node:child_process";
66
import process from "node:process";
77

88
const selkiesBaselineConfig = "/tmp/elastos-browser-selkies-live/browser-engine-adapter.json";
9-
const gatewayLiveConfig = "/home/wau/.local/share/elastos-public-gateway-live/xdg-data/elastos/config/browser-engine-adapter.json";
109
const userDataHomeConfig = path.join(os.homedir(), "Library/Application Support/elastos/config/browser-engine-adapter.json");
11-
const macStagingConfig = path.join(os.homedir(), "elastos-mac-test-home/Library/Application Support/elastos/config/browser-engine-adapter.json");
1210
const nodeBinary = process.execPath;
1311

1412
function defaultLiveConfig() {
1513
if (process.env.ELASTOS_BROWSER_ENGINE_ADAPTER_CONFIG) {
1614
return process.env.ELASTOS_BROWSER_ENGINE_ADAPTER_CONFIG;
1715
}
1816
for (const candidate of [
19-
gatewayLiveConfig,
20-
macStagingConfig,
2117
userDataHomeConfig,
2218
selkiesBaselineConfig,
2319
]) {
@@ -137,13 +133,6 @@ function discoverNativeBrowserProgram(explicitProgram) {
137133
const found = commandPath(command);
138134
if (found) return found;
139135
}
140-
for (const candidate of [
141-
"/home/wau/.cache/ms-playwright/chromium-1217/chrome-linux64/chrome",
142-
"/home/wau/.cache/ms-playwright/chromium-1208/chrome-linux64/chrome",
143-
"/home/wau/.cache/ms-playwright/chromium-1181/chrome-linux/chrome",
144-
]) {
145-
if (fs.existsSync(candidate)) return candidate;
146-
}
147136
return "";
148137
}
149138

scripts/browser-provider-runbook.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ ${shellBlock([
340340
"node scripts/browser-hosted-product-operator-config.mjs \\",
341341
" --candidate kasm-workspaces \\",
342342
" --out-dir /opt/elastos/kasm-workspaces \\",
343-
" --supervisor-program /home/wau/elastos-runtime/scripts/browser-hosted-product-supervisor.mjs \\",
343+
" --supervisor-program \"$PWD/scripts/browser-hosted-product-supervisor.mjs\" \\",
344344
" --control-socket \"$KASM_CONTROL_SOCKET\"",
345345
"",
346346
"node scripts/browser-hosted-provider-preflight.mjs \\",
@@ -382,7 +382,7 @@ ${shellBlock([
382382
"node scripts/browser-hosted-product-operator-config.mjs \\",
383383
" --candidate browserbox \\",
384384
" --out-dir /opt/elastos/browserbox \\",
385-
" --supervisor-program /home/wau/elastos-runtime/scripts/browser-hosted-product-supervisor.mjs \\",
385+
" --supervisor-program \"$PWD/scripts/browser-hosted-product-supervisor.mjs\" \\",
386386
" --control-socket \"$BROWSERBOX_CONTROL_SOCKET\"",
387387
"",
388388
"node scripts/browser-hosted-provider-preflight.mjs \\",

0 commit comments

Comments
 (0)