@dreamdata_io/verify-tracking 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -25
- package/dist/cli.js +54 -0
- package/dist/cli.js.map +1 -1
- package/dist/config/env.js.map +1 -1
- package/dist/review/dashboard.js +37 -0
- package/dist/review/dashboard.js.map +1 -0
- package/dist/review/data.js +185 -0
- package/dist/review/data.js.map +1 -0
- package/dist/review/emit.js +66 -0
- package/dist/review/emit.js.map +1 -0
- package/dist/review/open.js +53 -0
- package/dist/review/open.js.map +1 -0
- package/dist/version.js +1 -1
- package/package.json +2 -1
- package/scripts/install.sh +43 -3
- package/verification/review/index.html +1810 -0
package/README.md
CHANGED
|
@@ -107,6 +107,12 @@ against `package.json`, runs the typecheck and tests, and `prepublishOnly`
|
|
|
107
107
|
rebuilds `dist/` so the tarball is never a stale checkout. Keep
|
|
108
108
|
`src/version.ts` in step with `package.json` — the tag check does not see it.
|
|
109
109
|
|
|
110
|
+
`npm pack --dry-run` before either, and check `verification/review/index.html`
|
|
111
|
+
is in the file list: the dashboard page is shipped as a template rather than
|
|
112
|
+
compiled, so `prepublishOnly` cannot catch a `files` entry that dropped it —
|
|
113
|
+
the checkout always has the file, and only the tarball can be wrong. An
|
|
114
|
+
installed run would then write its reports and fail on the dashboard.
|
|
115
|
+
|
|
110
116
|
Publishing by hand does the same job:
|
|
111
117
|
|
|
112
118
|
```bash
|
|
@@ -118,15 +124,16 @@ workflow fail on a version already on the registry.
|
|
|
118
124
|
|
|
119
125
|
## Usage
|
|
120
126
|
|
|
121
|
-
One
|
|
127
|
+
One command:
|
|
122
128
|
|
|
123
129
|
```bash
|
|
124
|
-
|
|
125
|
-
bun run verification/review/build.ts
|
|
130
|
+
verify-tracking --slug paytronix_com --url https://www.paytronix.com/
|
|
126
131
|
```
|
|
127
132
|
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
(In a checkout, `bun run src/cli.ts` is the same thing.)
|
|
134
|
+
|
|
135
|
+
It walks the site and **writes the report itself** — no output flag needed. It
|
|
136
|
+
writes a pair, and prints both paths when the run ends:
|
|
130
137
|
|
|
131
138
|
| File | What it holds |
|
|
132
139
|
| --- | --- |
|
|
@@ -141,24 +148,34 @@ than re-derived on demand. `--out <path>` writes the report somewhere else and
|
|
|
141
148
|
puts its companion beside it as `<path>.evidence.json`; `--no-save-report`
|
|
142
149
|
skips both.
|
|
143
150
|
|
|
144
|
-
Both paths are relative to the
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
`VERIFY_TRACKING_OUTPUT_DIR` (a flag-free setting, so
|
|
148
|
-
is its natural home) to root them
|
|
149
|
-
|
|
151
|
+
Both paths are relative to the output root, which is `verification/` under the
|
|
152
|
+
working directory by default — right inside this repo for a checkout, and
|
|
153
|
+
unwelcome for a globally installed CLI run from somewhere arbitrary. Set
|
|
154
|
+
`VERIFY_TRACKING_OUTPUT_DIR` (a flag-free setting, so
|
|
155
|
+
`~/.config/verify-tracking/config.env` is its natural home) to root them
|
|
156
|
+
somewhere else; **the installer writes `$HOME/dreamdata-tracking` there**, so an
|
|
157
|
+
installed CLI has one predictable home no matter which directory it is run
|
|
158
|
+
from. The run prints absolute paths when it ends either way.
|
|
150
159
|
|
|
151
160
|
What the report leaves out, and why it is safe to leave out, is documented in
|
|
152
161
|
`src/report/projection.ts`: every check and verdict is already resolved against
|
|
153
162
|
the full evidence before serialization, so nothing the report drops could have
|
|
154
163
|
changed one.
|
|
155
164
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
It then **rebuilds the review dashboard and opens it**. That is a third file,
|
|
166
|
+
beside the two above:
|
|
167
|
+
|
|
168
|
+
| File | What it holds |
|
|
169
|
+
| --- | --- |
|
|
170
|
+
| `<output root>/dreamdata-tracking-dashboard.html` | Every account in `reports/`, as one self-contained page — the data is inlined, so there is nothing to load beside it and the file can be handed to someone who has never installed the tool. |
|
|
171
|
+
|
|
172
|
+
It is rebuilt from whatever is in `reports/` at that moment, with `evidence/`
|
|
173
|
+
read on top of it for the raw values, and overwritten in place — so the path is
|
|
174
|
+
stable and an old tab can just be reloaded. `--dashboard` rebuilds and opens it
|
|
175
|
+
without checking a site (no browser, no signed-in model, so a closed tab is
|
|
176
|
+
always one command away); `--no-open` builds it and only prints the path.
|
|
177
|
+
Opening a browser is macOS-only; elsewhere the path is printed and nothing is
|
|
178
|
+
launched.
|
|
162
179
|
|
|
163
180
|
That single `cli.ts` run already walks **all three consent states** — clean,
|
|
164
181
|
grant, refused — each in its own fresh browser context, and reports them side by
|
|
@@ -171,8 +188,7 @@ is recorded inside the file, so a run against a host that is not the account's
|
|
|
171
188
|
own domain still files under the account:
|
|
172
189
|
|
|
173
190
|
```bash
|
|
174
|
-
|
|
175
|
-
bun run verification/review/build.ts
|
|
191
|
+
verify-tracking --slug tungstenautomation_com --url https://sign-in.printix.net/
|
|
176
192
|
```
|
|
177
193
|
|
|
178
194
|
Without it the slug is derived from the URL's hostname — which would have filed
|
|
@@ -634,10 +650,18 @@ correct report.
|
|
|
634
650
|
|
|
635
651
|
## Verification review index
|
|
636
652
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
653
|
+
The review page gives a browsable view of every report in the reports
|
|
654
|
+
directory. One `<slug>_report.json` there is one account on the page; nothing
|
|
655
|
+
else is aggregated, so whatever a run has written is exactly what the dashboard
|
|
656
|
+
shows.
|
|
657
|
+
|
|
658
|
+
**One page, two ways of carrying its data.** A run writes
|
|
659
|
+
`<output root>/dreamdata-tracking-dashboard.html`, which is that same page with
|
|
660
|
+
its dataset inlined — one file, nothing to load beside it. In this checkout,
|
|
661
|
+
`verification/review/index.html` reads an external `verification/review/data.js`
|
|
662
|
+
instead, which is what keeps the `?data=` switch below usable. The page itself
|
|
663
|
+
is shipped in the npm package as the template for the first form; `src/review/`
|
|
664
|
+
builds the dataset for both.
|
|
641
665
|
|
|
642
666
|
It is built in three levels, so the first screen is scannable and everything
|
|
643
667
|
that needs reading is one click away:
|
|
@@ -646,7 +670,7 @@ that needs reading is one click away:
|
|
|
646
670
|
| --- | --- |
|
|
647
671
|
| **The list** | One line per account: slug, overall PASS/FAIL, the check tally (`✕` fail / `?` inconclusive / `✓` pass), and a 3×5 thumbnail of that account's matrix. |
|
|
648
672
|
| **The card** | The **matrix** — three consent states down the side, five signals (`script present`, `event on page load`, `event on page nav`, `identity storage`, `consent mode`) across the top, one verdict per cell — then every cross-phase check as a single line, worst first. |
|
|
649
|
-
| **The reason** | A cell opens the raw values it was computed from plus the check that judged it; a check line opens its own detail and evidence. *Everything measured* holds the complete per-phase evidence JSON, the deployment analysis and the model's raw response —
|
|
673
|
+
| **The reason** | A cell opens the raw values it was computed from plus the check that judged it; a check line opens its own detail and evidence. *Everything measured* holds the complete per-phase evidence JSON, the deployment analysis and the model's raw response — read from the evidence directory when the run archived them, so nothing is summarised away here even though the report file itself is trimmed. |
|
|
650
674
|
|
|
651
675
|
Cell colour is never re-derived in the page. Every consent comparison is already
|
|
652
676
|
resolved in `src/analysis/deployment.ts` and shipped as `deployment.checks`; a
|
|
@@ -656,7 +680,10 @@ present` is left uncoloured because a tag's presence is a fact about the install
|
|
|
656
680
|
a verdict. A **dashed** cell is one whose colour is genuinely shared by more than
|
|
657
681
|
one consent state.
|
|
658
682
|
|
|
659
|
-
|
|
683
|
+
A run rebuilds and opens its own dashboard, so nothing has to be re-run by
|
|
684
|
+
hand; `verify-tracking --dashboard` rebuilds and opens it on its own.
|
|
685
|
+
|
|
686
|
+
In this checkout, rebuild the external dataset after a sweep run:
|
|
660
687
|
|
|
661
688
|
```bash
|
|
662
689
|
bun run verification/review/build.ts
|
package/dist/cli.js
CHANGED
|
@@ -8,6 +8,8 @@ import { USER_CONFIG_PATH, loadUserConfig } from "./config/user-config.js";
|
|
|
8
8
|
import { isValidHttpUrl, promptForUrl } from "./interactive/prompt.js";
|
|
9
9
|
import { renderPhaseDetail, renderTextReport } from "./report/render.js";
|
|
10
10
|
import { serializeEvidenceToJson, serializeToJson, serializeToMarkdown } from "./report/serializers.js";
|
|
11
|
+
import { buildDashboard } from "./review/dashboard.js";
|
|
12
|
+
import { openDashboard } from "./review/open.js";
|
|
11
13
|
import { runVerification, writeDefaultArtifacts, writeEnsuringDir } from "./run/verify.js";
|
|
12
14
|
import { logger } from "./utils/logger.js";
|
|
13
15
|
import { isSafeSlug, slugFromUrl } from "./utils/slug.js";
|
|
@@ -59,6 +61,12 @@ verify-tracking [--url <url>] [options]
|
|
|
59
61
|
evidence lands beside it as <path>.evidence.json
|
|
60
62
|
rather than in verification/evidence/.
|
|
61
63
|
--no-save-report Skip both default writes (report and full evidence)
|
|
64
|
+
--dashboard Rebuild the review dashboard from the reports already
|
|
65
|
+
saved and open it, without checking a site. Needs no
|
|
66
|
+
browser and no signed-in model, so a closed tab is
|
|
67
|
+
always one command away. Ignores --url.
|
|
68
|
+
--no-open Build the dashboard but do not open a browser. The
|
|
69
|
+
path is printed either way.
|
|
62
70
|
--format <fmt> text | json | markdown (default: text)
|
|
63
71
|
--timeout <ms> Navigation timeout in ms (default: ${DEFAULT_TIMEOUT_MS})
|
|
64
72
|
|
|
@@ -130,6 +138,8 @@ function parseArgs(argv) {
|
|
|
130
138
|
probeOverHttp: true,
|
|
131
139
|
verbose: false,
|
|
132
140
|
noSaveReport: false,
|
|
141
|
+
dashboard: false,
|
|
142
|
+
noOpen: false,
|
|
133
143
|
};
|
|
134
144
|
for (let i = 0; i < argv.length; i++) {
|
|
135
145
|
const arg = argv[i];
|
|
@@ -176,6 +186,12 @@ function parseArgs(argv) {
|
|
|
176
186
|
case "--no-save-report":
|
|
177
187
|
flags.noSaveReport = true;
|
|
178
188
|
break;
|
|
189
|
+
case "--dashboard":
|
|
190
|
+
flags.dashboard = true;
|
|
191
|
+
break;
|
|
192
|
+
case "--no-open":
|
|
193
|
+
flags.noOpen = true;
|
|
194
|
+
break;
|
|
179
195
|
case "--format":
|
|
180
196
|
flags.format = argv[++i];
|
|
181
197
|
break;
|
|
@@ -249,6 +265,10 @@ async function main() {
|
|
|
249
265
|
// answer on a machine with no browser installed — the preflight is about the
|
|
250
266
|
// run, not about printing text.
|
|
251
267
|
const flags = parseArgs(process.argv.slice(2));
|
|
268
|
+
if (flags.dashboard) {
|
|
269
|
+
await refreshDashboard(flags, { announceEmpty: true });
|
|
270
|
+
process.exit(0);
|
|
271
|
+
}
|
|
252
272
|
const preflight = browserPreflightError();
|
|
253
273
|
if (preflight) {
|
|
254
274
|
console.error(preflight);
|
|
@@ -334,9 +354,43 @@ async function main() {
|
|
|
334
354
|
// needs somewhere they can actually go.
|
|
335
355
|
logger.info(`Report written to ${resolve(written.reportPath)}`);
|
|
336
356
|
logger.info(`Full evidence written to ${resolve(written.evidencePath)}`);
|
|
357
|
+
// The dashboard reads the default layout, so a --out or --no-save-report
|
|
358
|
+
// run has nothing there to rebuild from and would only refresh a stale
|
|
359
|
+
// set. Failures are reported and swallowed: overallPass is the exit code,
|
|
360
|
+
// and a dashboard that could not be written must not change the verdict.
|
|
361
|
+
await refreshDashboard(flags, { announceEmpty: false });
|
|
337
362
|
}
|
|
338
363
|
process.exit(result.overallPass ? 0 : 1);
|
|
339
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Rebuild the single-file dashboard from whatever is saved, and hand it to a
|
|
367
|
+
* browser unless asked not to. Both callers want the path printed; only
|
|
368
|
+
* `--dashboard` wants to hear that there is nothing saved yet, since after a
|
|
369
|
+
* run there obviously is.
|
|
370
|
+
*/
|
|
371
|
+
async function refreshDashboard(flags, options) {
|
|
372
|
+
let built;
|
|
373
|
+
try {
|
|
374
|
+
built = await buildDashboard();
|
|
375
|
+
}
|
|
376
|
+
catch (err) {
|
|
377
|
+
logger.warn(`Could not build the review dashboard: ${err instanceof Error ? err.message : String(err)}`);
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
logger.info(`Dashboard: ${built.path}`);
|
|
381
|
+
if (options.announceEmpty && built.accounts === 0) {
|
|
382
|
+
logger.info("No checks saved yet — the page shows how to run the first one.");
|
|
383
|
+
}
|
|
384
|
+
if (flags.noOpen)
|
|
385
|
+
return;
|
|
386
|
+
const opened = openDashboard({ path: built.path });
|
|
387
|
+
if (opened.kind === "opened") {
|
|
388
|
+
logger.info("Opened in your browser. Already had it open? Reload that tab.");
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
logger.info("Open that file in a browser to review it.");
|
|
392
|
+
}
|
|
393
|
+
}
|
|
340
394
|
main().catch((err) => {
|
|
341
395
|
logger.error("verify-tracking failed", err);
|
|
342
396
|
process.exit(1);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,oBAAoB,GAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACxG,OAAO,EAAE,eA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IAAI,CAAC,gEAAgE,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,KAAK,CAAC,MAAM;QAAE,OAAO;IACzB,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IAC/E,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/config/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AA0DlD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAe;IAChD,IAAI,KAAK,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;I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;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAe;IAC3C,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IAClD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dashboard the CLI builds for itself: one self-contained HTML file at the
|
|
3
|
+
* root of the output directory, rebuilt from whatever reports are on disk.
|
|
4
|
+
*
|
|
5
|
+
* Written even when there are no reports yet. The page's own empty state is
|
|
6
|
+
* what tells a new operator how to run their first check, so the installer can
|
|
7
|
+
* finish by opening it — a dashboard that only exists after a successful run
|
|
8
|
+
* would leave nothing to open at exactly the moment someone needs the
|
|
9
|
+
* instructions.
|
|
10
|
+
*/
|
|
11
|
+
import { resolve } from "node:path";
|
|
12
|
+
import { evidenceDir, reportsDir } from "../report/store.js";
|
|
13
|
+
import { outputRoot } from "../config/user-config.js";
|
|
14
|
+
import { buildReviewData } from "./data.js";
|
|
15
|
+
import { readReviewTemplate, renderStandaloneHtml, writeReviewFile } from "./emit.js";
|
|
16
|
+
import { dashboardPath } from "./open.js";
|
|
17
|
+
export async function buildDashboard() {
|
|
18
|
+
const root = resolve(outputRoot());
|
|
19
|
+
const reports = resolve(reportsDir());
|
|
20
|
+
const { data } = buildReviewData({
|
|
21
|
+
reportsDir: reports,
|
|
22
|
+
evidenceDir: resolve(evidenceDir()),
|
|
23
|
+
/**
|
|
24
|
+
* Flat, matching what the default reports directory means: a run writes
|
|
25
|
+
* its report at the top level, and subfolders there are archives (a
|
|
26
|
+
* golden set, a replayed run) that nobody asked to see.
|
|
27
|
+
*/
|
|
28
|
+
recursive: false,
|
|
29
|
+
pathBase: root,
|
|
30
|
+
outputRoot: root,
|
|
31
|
+
});
|
|
32
|
+
const html = renderStandaloneHtml(await readReviewTemplate(), data, reports);
|
|
33
|
+
const path = dashboardPath();
|
|
34
|
+
await writeReviewFile(path, html);
|
|
35
|
+
return { path, accounts: data.slugs.length };
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/review/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAS1C,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IACtC,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;QAC/B,UAAU,EAAE,OAAO;QACnB,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;QACnC;;;;WAIG;QACH,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,kBAAkB,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregates `<reportsDir>/**\/*_report.json` into the dataset the review page
|
|
3
|
+
* renders, with `<evidenceDir>/<slug>_evidence.json` read on top of it for the
|
|
4
|
+
* raw values a report no longer carries (see src/report/projection.ts).
|
|
5
|
+
*
|
|
6
|
+
* The reports directory decides which accounts appear: whatever a run wrote
|
|
7
|
+
* there is what the dashboard shows, and there is no separate list of accounts
|
|
8
|
+
* to keep in step with it.
|
|
9
|
+
*
|
|
10
|
+
* This module holds no paths of its own. Both callers — the CLI's post-run
|
|
11
|
+
* dashboard build and `verification/review/build.ts` — resolve their own
|
|
12
|
+
* directories and pass them in, because the two answer the question
|
|
13
|
+
* differently: the CLI follows `outputRoot()`, while the repo script is
|
|
14
|
+
* anchored to the checkout.
|
|
15
|
+
*/
|
|
16
|
+
import { readFileSync, existsSync, readdirSync } from "node:fs";
|
|
17
|
+
import { join, dirname, relative } from "node:path";
|
|
18
|
+
const REPORT_SUFFIX = "_report.json";
|
|
19
|
+
const PHASE_LABELS = {
|
|
20
|
+
clean: "clean (banner untouched)",
|
|
21
|
+
grant: "grant (consent accepted)",
|
|
22
|
+
reject: "reject (consent refused)",
|
|
23
|
+
};
|
|
24
|
+
function readJson(path) {
|
|
25
|
+
return JSON.parse(readFileSync(path, "utf-8"));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The full evidence for this slug, if the run that wrote the report also
|
|
29
|
+
* archived it. Unreadable is treated as absent: a corrupt or half-written
|
|
30
|
+
* sidecar must not take the report down with it, since the report alone still
|
|
31
|
+
* renders every cell and check.
|
|
32
|
+
*/
|
|
33
|
+
function readEvidenceSidecar(evidenceDir, slug) {
|
|
34
|
+
const path = join(evidenceDir, `${slug}_evidence.json`);
|
|
35
|
+
if (!existsSync(path))
|
|
36
|
+
return null;
|
|
37
|
+
try {
|
|
38
|
+
const parsed = readJson(path);
|
|
39
|
+
return Array.isArray(parsed?.phases) ? parsed : null;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A slug on disk may differ from the one the run recorded (a report written
|
|
47
|
+
* before `--slug` existed, or a file renamed by hand). Surfacing the mismatch
|
|
48
|
+
* rather than silently preferring one keeps the dashboard honest about which
|
|
49
|
+
* account it is showing.
|
|
50
|
+
*/
|
|
51
|
+
function slugMismatch(slug, report) {
|
|
52
|
+
const recorded = report?.reportSlug;
|
|
53
|
+
return recorded && recorded !== slug ? recorded : null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* All `*_report.json` files under `dir`, optionally walking subfolders. A
|
|
57
|
+
* missing directory yields nothing rather than throwing: a machine that has
|
|
58
|
+
* not run a check yet still gets a page, and the page's own empty state is
|
|
59
|
+
* what tells the reader what to do next.
|
|
60
|
+
*/
|
|
61
|
+
function findReportFiles(dir, recursive) {
|
|
62
|
+
if (!existsSync(dir))
|
|
63
|
+
return [];
|
|
64
|
+
const found = [];
|
|
65
|
+
const stack = [dir];
|
|
66
|
+
while (stack.length > 0) {
|
|
67
|
+
const current = stack.pop();
|
|
68
|
+
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
|
69
|
+
const full = join(current, entry.name);
|
|
70
|
+
if (entry.isDirectory()) {
|
|
71
|
+
if (recursive)
|
|
72
|
+
stack.push(full);
|
|
73
|
+
}
|
|
74
|
+
else if (entry.name.endsWith(REPORT_SUFFIX)) {
|
|
75
|
+
found.push(full);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return found;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* One run now produces one file covering every consent state, so the report's
|
|
83
|
+
* `phases` array is what the variant tabs are built from. Files written before
|
|
84
|
+
* that — the `_accepted`/`_rejected` trio — carry no phases and are reported as
|
|
85
|
+
* stale rather than rendered: their verdicts were reached without the
|
|
86
|
+
* cross-phase comparison, so showing them next to current ones would invite
|
|
87
|
+
* exactly the wrong conclusion.
|
|
88
|
+
*/
|
|
89
|
+
function readSlugReport(options, path, slug) {
|
|
90
|
+
const rel = relative(options.pathBase, path);
|
|
91
|
+
const dir = dirname(path);
|
|
92
|
+
let parsed;
|
|
93
|
+
try {
|
|
94
|
+
parsed = readJson(path);
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
return { path: rel, error: String(err) };
|
|
98
|
+
}
|
|
99
|
+
const legacyVariants = ["_accepted", "_rejected"]
|
|
100
|
+
.map((variant) => `${slug}_report${variant}.json`)
|
|
101
|
+
.filter((name) => existsSync(join(dir, name)));
|
|
102
|
+
if (!Array.isArray(parsed.phases)) {
|
|
103
|
+
return { path: rel, stale: true, legacyVariants };
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Pairing is by slug, but only a matching `timestamp` proves the two files
|
|
107
|
+
* came from the SAME run — a report re-run after its sidecar was written, or
|
|
108
|
+
* a sidecar left behind by a run whose report was overwritten, would
|
|
109
|
+
* otherwise show raw values from one run under another's verdicts.
|
|
110
|
+
*/
|
|
111
|
+
const sidecar = readEvidenceSidecar(options.evidenceDir, slug);
|
|
112
|
+
const fullEvidence = sidecar && sidecar.timestamp === parsed.timestamp ? sidecar : null;
|
|
113
|
+
const fullPhaseFor = (phase) => fullEvidence?.phases.find((p) => p.phase === phase.phase) ?? phase;
|
|
114
|
+
return {
|
|
115
|
+
path: rel,
|
|
116
|
+
/**
|
|
117
|
+
* What the run itself recorded, as opposed to what the filename says. A
|
|
118
|
+
* report written with `--slug` carries the account it belongs to even when
|
|
119
|
+
* the URL under test lives on an unrelated host; older reports have no
|
|
120
|
+
* `slug` field at all, hence the null.
|
|
121
|
+
*/
|
|
122
|
+
reportSlug: parsed.slug ?? null,
|
|
123
|
+
url: parsed.url ?? null,
|
|
124
|
+
timestamp: parsed.timestamp ?? null,
|
|
125
|
+
deployment: parsed.deployment ?? null,
|
|
126
|
+
/**
|
|
127
|
+
* Run-level, not per-phase: what a plain HTTP GET was served. The page
|
|
128
|
+
* reads its `cmpMarkers` to name a vendor the browser could only match by
|
|
129
|
+
* button text, and its `frameworkMarkers` for the sites where no second
|
|
130
|
+
* page could be reached and behaviour says nothing about routing.
|
|
131
|
+
*/
|
|
132
|
+
httpProbe: parsed.httpProbe ?? null,
|
|
133
|
+
/** The report's own result; the sidecar's adds back the model's raw reply. */
|
|
134
|
+
result: fullEvidence?.result ?? parsed.result ?? null,
|
|
135
|
+
hasFullEvidence: fullEvidence !== null,
|
|
136
|
+
variants: parsed.phases.map((phase) => ({
|
|
137
|
+
key: phase.phase,
|
|
138
|
+
label: PHASE_LABELS[phase.phase] ?? phase.phase,
|
|
139
|
+
evidence: fullPhaseFor(phase),
|
|
140
|
+
})),
|
|
141
|
+
legacyVariants,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export function buildReviewData(options) {
|
|
145
|
+
const reportFiles = findReportFiles(options.reportsDir, options.recursive).sort();
|
|
146
|
+
// Two files can name the same slug (a report re-filed into a dated
|
|
147
|
+
// subfolder, a stray duplicate) — last one found wins, but it is worth
|
|
148
|
+
// telling the caller rather than silently dropping one.
|
|
149
|
+
const bySlug = new Map();
|
|
150
|
+
const duplicated = new Set();
|
|
151
|
+
for (const file of reportFiles) {
|
|
152
|
+
const slug = basenameSlug(file);
|
|
153
|
+
if (bySlug.has(slug))
|
|
154
|
+
duplicated.add(slug);
|
|
155
|
+
bySlug.set(slug, file);
|
|
156
|
+
}
|
|
157
|
+
const duplicates = [...duplicated].sort();
|
|
158
|
+
const slugs = [...bySlug.entries()]
|
|
159
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
160
|
+
.map(([slug, file]) => {
|
|
161
|
+
const report = readSlugReport(options, file, slug);
|
|
162
|
+
return {
|
|
163
|
+
slug,
|
|
164
|
+
slugRecordedAs: slugMismatch(slug, report),
|
|
165
|
+
report,
|
|
166
|
+
};
|
|
167
|
+
});
|
|
168
|
+
const data = {
|
|
169
|
+
generatedAt: new Date().toISOString(),
|
|
170
|
+
reportsDir: relative(options.pathBase, options.reportsDir),
|
|
171
|
+
slugs,
|
|
172
|
+
};
|
|
173
|
+
// Assigned conditionally so a dataset with no single home omits the key
|
|
174
|
+
// rather than carrying an empty one — the page renders the line only when
|
|
175
|
+
// the key is there, which is also what keeps older data.js files clean.
|
|
176
|
+
if (options.outputRoot)
|
|
177
|
+
data.outputRoot = options.outputRoot;
|
|
178
|
+
return { data, duplicates };
|
|
179
|
+
}
|
|
180
|
+
/** The slug a report filename names, on any path separator. */
|
|
181
|
+
function basenameSlug(file) {
|
|
182
|
+
const name = file.split(/[/\\]/).pop();
|
|
183
|
+
return name.slice(0, -REPORT_SUFFIX.length);
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/review/data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA8CpD,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,MAAM,YAAY,GAA2B;IAC3C,KAAK,EAAE,0BAA0B;IACjC,KAAK,EAAE,0BAA0B;IACjC,MAAM,EAAE,0BAA0B;CACnC,CAAC;AAEF,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,WAAmB,EAAE,IAAY;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,G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IAAY;IAChC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAG,CAAC;IACxC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns a `ReviewData` into something a browser can open.
|
|
3
|
+
*
|
|
4
|
+
* Two shapes, one dataset. `renderDataScript` writes the external `data.js`
|
|
5
|
+
* the checkout's page loads via `<script src>`; `renderStandaloneHtml` folds
|
|
6
|
+
* the same data into a copy of the page itself, which is what an installed CLI
|
|
7
|
+
* writes — one file to open, one file to hand to a colleague, and nothing to
|
|
8
|
+
* keep in step beside it.
|
|
9
|
+
*/
|
|
10
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
11
|
+
import { dirname, join } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
/** The `window.__REVIEW_DATA__ = …;` file the checkout's page loads. */
|
|
14
|
+
export function renderDataScript(data) {
|
|
15
|
+
return `window.__REVIEW_DATA__ = ${JSON.stringify(data, null, 2)};\n`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The shipped page, resolved from this module's own location rather than the
|
|
19
|
+
* working directory. `dist/` is a flat mirror of `src/`, so the same walk
|
|
20
|
+
* lands on the same file from `dist/review/emit.js` inside an installed
|
|
21
|
+
* package and from `src/review/emit.ts` under Bun in the checkout.
|
|
22
|
+
*
|
|
23
|
+
* `fileURLToPath` rather than `new URL(...).pathname`: the latter leaves
|
|
24
|
+
* percent-encoded segments encoded, so an install path containing a space
|
|
25
|
+
* would resolve to a file that does not exist.
|
|
26
|
+
*/
|
|
27
|
+
export function reviewTemplatePath() {
|
|
28
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
return join(here, "..", "..", "verification", "review", "index.html");
|
|
30
|
+
}
|
|
31
|
+
const BODY_TAG = "<body>";
|
|
32
|
+
/**
|
|
33
|
+
* The page with its dataset inlined, replacing the `data.js` fetch.
|
|
34
|
+
*
|
|
35
|
+
* Every `<` in the payload becomes the JS escape `\u003c`, which parses back
|
|
36
|
+
* to `<` and so neutralises `</script`, `<script` and `<!--` in one
|
|
37
|
+
* substitution. An HTML entity would NOT work here: a `<script>` element is
|
|
38
|
+
* raw text, its entities are never decoded, so the escape would survive into
|
|
39
|
+
* the JSON string and corrupt the captured page HTML that reports carry —
|
|
40
|
+
* while a literal `</script>` inside that HTML ends the element early and
|
|
41
|
+
* white-screens the page.
|
|
42
|
+
*
|
|
43
|
+
* `sourceLabel` names the dataset in the page's own empty state, which would
|
|
44
|
+
* otherwise say "data.js" for a page that has no data.js.
|
|
45
|
+
*/
|
|
46
|
+
export function renderStandaloneHtml(template, data, sourceLabel) {
|
|
47
|
+
const at = template.indexOf(BODY_TAG);
|
|
48
|
+
if (at === -1) {
|
|
49
|
+
throw new Error(`No <body> in the review page template at ${reviewTemplatePath()}`);
|
|
50
|
+
}
|
|
51
|
+
const payload = JSON.stringify(data).replace(/</g, "\\u003c");
|
|
52
|
+
const label = JSON.stringify(sourceLabel).replace(/</g, "\\u003c");
|
|
53
|
+
const inlined = `\n<script>window.__REVIEW_DATA__ = ${payload};window.__REVIEW_DATA_FILE__ = ${label};</script>`;
|
|
54
|
+
const cut = at + BODY_TAG.length;
|
|
55
|
+
return template.slice(0, cut) + inlined + template.slice(cut);
|
|
56
|
+
}
|
|
57
|
+
/** The template's contents, read on demand so a missing file fails one call. */
|
|
58
|
+
export async function readReviewTemplate() {
|
|
59
|
+
return readFile(reviewTemplatePath(), "utf-8");
|
|
60
|
+
}
|
|
61
|
+
/** Write, creating the parent directory the way the report writer does. */
|
|
62
|
+
export async function writeReviewFile(path, contents) {
|
|
63
|
+
await mkdir(dirname(path), { recursive: true });
|
|
64
|
+
await writeFile(path, contents, "utf-8");
|
|
65
|
+
}
|
|
66
|
+
//# source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