Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (65 loc) · 3.43 KB
/
Copy pathMakefile
File metadata and controls
75 lines (65 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.PHONY: build wasm test site check-local check-notices check-smokes check-site-live
APPS = app app-img app-img2pdf app-scrub app-zip
# wasm-pack resolves its --out-dir from the crate directory, so the core lands
# in app/src/wasm; every other app gets the same bytes copied in. They MUST all
# be the same build: an app running a stale core would report notices from a
# contract the interface no longer speaks.
wasm:
wasm-pack build core-rs --target web --out-dir ../app/src/wasm
@for app in app-img app-img2pdf app-scrub app-zip; do \
mkdir -p $$app/src/wasm && cp app/src/wasm/* $$app/src/wasm/; \
done
build: wasm
@for app in $(APPS); do npm --prefix $$app run build || exit 1; done
test:
cargo test --manifest-path core-rs/Cargo.toml
# The provable-local gate over every built app, plus the gate ON that gate:
# check-local.test.mjs breaks a real dist/ one property at a time and proves the
# checker goes red for each. A green check-local run means nothing without it.
#
# The runtime half of the proof is scripts/receipt-proof.mjs, which drives the
# built dist in a real browser and proves the receipt's request counter sees the
# WORKER's timeline, not just the window's. It runs on the staging box, never
# here:
# scp -r <app>/dist scripts/receipt-proof.mjs bilvi-dev-stage@10.96.16.18:~/localbench-smoke/
# ssh bilvi-dev-stage@10.96.16.18 'cd ~/localbench-smoke && \
# CHROME_PATH=$$HOME/.cache/ms-playwright/chromium-1228/chrome-linux64/chrome \
# node receipt-proof.mjs dist'
check-local:
@for app in $(APPS); do \
node scripts/check-local.mjs $$app/dist || exit 1; \
done
node --test scripts/check-local.test.mjs
# The honesty gate: a notice the Rust core returns must reach the user.
#
# This half runs anywhere — it reads the FileResult contract out of the Rust
# source, checks every worker and every answer against it, and drives the real
# compiled core over the fixtures in Node so a fixture that stopped provoking a
# notice fails loudly instead of passing vacuously.
#
# The other half is scripts/notice-proof.mjs, which proves the sentences reach a
# SCREEN. It needs a browser, so it runs on the staging box, never here:
# node scripts/notice-fixtures.mjs ./notice-corpus
# scp -r app*/dist scripts/notice-proof.mjs notice-corpus test-corpus \
# scrub-corpus img2pdf-corpus bilvi-dev-stage@10.96.16.18:~/localbench-notice/
# ssh bilvi-dev-stage@10.96.16.18 'cd ~/localbench-notice && \
# CHROME_PATH=$$HOME/.cache/ms-playwright/chromium-1228/chrome-linux64/chrome \
# node notice-proof.mjs'
check-notices:
node --test scripts/notice-plumbing.test.mjs
# The gate on the live smoke harness. The five browser smokes must fail for
# PRODUCT reasons and nothing else, so this proves - without a browser or a
# network - that all five still carry the same expected-CSP-block filter, that
# the filter excuses exactly Cloudflare's injected inline script (all three
# engine wordings) and NOTHING else, and that the asynchronous privacy-inspector
# counter is read only after it settles instead of the instant it is opened.
check-smokes:
node --test scripts/smoke-harness.test.mjs
# Assembles site/dist: the landing page plus the canonical shared/identity.css.
site:
node scripts/build-site.mjs
# Live smoke over the deployed landing (plain fetch, runs anywhere). Includes
# the Pages soft-404 gate: unknown paths must answer 404, not the 200 index.
# Run after every keeplocal-site deploy.
check-site-live:
node scripts/site-smoke.mjs