@monkeytestai/monkeytester 0.7.2-beta.2 → 0.7.2-beta.3
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/CHANGELOG.md +18 -0
- package/README.md +37 -15
- package/dist/audit/adjudication.d.ts +107 -0
- package/dist/audit/adjudication.d.ts.map +1 -0
- package/dist/audit/adjudication.js +164 -0
- package/dist/audit/adjudication.js.map +1 -0
- package/dist/auth/bind.d.ts +21 -0
- package/dist/auth/bind.d.ts.map +1 -0
- package/dist/auth/bind.js +152 -0
- package/dist/auth/bind.js.map +1 -0
- package/dist/auth/browser.d.ts +36 -0
- package/dist/auth/browser.d.ts.map +1 -0
- package/dist/auth/browser.js +64 -0
- package/dist/auth/browser.js.map +1 -0
- package/dist/auth/contract.d.ts +145 -0
- package/dist/auth/contract.d.ts.map +1 -0
- package/dist/auth/contract.js +50 -0
- package/dist/auth/contract.js.map +1 -0
- package/dist/auth/createProvider.d.ts +42 -0
- package/dist/auth/createProvider.d.ts.map +1 -0
- package/dist/auth/createProvider.js +152 -0
- package/dist/auth/createProvider.js.map +1 -0
- package/dist/auth/egress.d.ts +37 -0
- package/dist/auth/egress.d.ts.map +1 -0
- package/dist/auth/egress.js +117 -0
- package/dist/auth/egress.js.map +1 -0
- package/dist/auth/establish.d.ts +56 -0
- package/dist/auth/establish.d.ts.map +1 -0
- package/dist/auth/establish.js +346 -0
- package/dist/auth/establish.js.map +1 -0
- package/dist/auth/fence.d.ts +16 -0
- package/dist/auth/fence.d.ts.map +1 -0
- package/dist/auth/fence.js +215 -0
- package/dist/auth/fence.js.map +1 -0
- package/dist/auth/index.d.ts +16 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +11 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/origins.d.ts +64 -0
- package/dist/auth/origins.d.ts.map +1 -0
- package/dist/auth/origins.js +443 -0
- package/dist/auth/origins.js.map +1 -0
- package/dist/auth/proof.d.ts +31 -0
- package/dist/auth/proof.d.ts.map +1 -0
- package/dist/auth/proof.js +104 -0
- package/dist/auth/proof.js.map +1 -0
- package/dist/auth/provider.d.ts +19 -0
- package/dist/auth/provider.d.ts.map +1 -0
- package/dist/auth/provider.js +74 -0
- package/dist/auth/provider.js.map +1 -0
- package/dist/auth/redact.d.ts +37 -0
- package/dist/auth/redact.d.ts.map +1 -0
- package/dist/auth/redact.js +126 -0
- package/dist/auth/redact.js.map +1 -0
- package/dist/auth/report.d.ts +32 -0
- package/dist/auth/report.d.ts.map +1 -0
- package/dist/auth/report.js +110 -0
- package/dist/auth/report.js.map +1 -0
- package/dist/auth/resolve.d.ts +41 -0
- package/dist/auth/resolve.d.ts.map +1 -0
- package/dist/auth/resolve.js +119 -0
- package/dist/auth/resolve.js.map +1 -0
- package/dist/auth/secretInput.d.ts +13 -0
- package/dist/auth/secretInput.d.ts.map +1 -0
- package/dist/auth/secretInput.js +39 -0
- package/dist/auth/secretInput.js.map +1 -0
- package/dist/auth/secrets.d.ts +33 -0
- package/dist/auth/secrets.d.ts.map +1 -0
- package/dist/auth/secrets.js +211 -0
- package/dist/auth/secrets.js.map +1 -0
- package/dist/auth/sessionFile.d.ts +47 -0
- package/dist/auth/sessionFile.d.ts.map +1 -0
- package/dist/auth/sessionFile.js +219 -0
- package/dist/auth/sessionFile.js.map +1 -0
- package/dist/checks/execute.d.ts +4 -0
- package/dist/checks/execute.d.ts.map +1 -1
- package/dist/checks/execute.js +55 -10
- package/dist/checks/execute.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +330 -6
- package/dist/cli.js.map +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +9 -1
- package/dist/events.js.map +1 -1
- package/dist/explorer/index.d.ts +13 -5
- package/dist/explorer/index.d.ts.map +1 -1
- package/dist/explorer/index.js +133 -35
- package/dist/explorer/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/monkey.d.ts +6 -0
- package/dist/monkey.d.ts.map +1 -1
- package/dist/monkey.js +160 -16
- package/dist/monkey.js.map +1 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +14 -0
- package/dist/outcome.js.map +1 -1
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +3 -2
- package/dist/persistence/index.js.map +1 -1
- package/dist/planner/index.d.ts +2 -0
- package/dist/planner/index.d.ts.map +1 -1
- package/dist/planner/index.js +3 -1
- package/dist/planner/index.js.map +1 -1
- package/dist/reportPaths.d.ts +19 -0
- package/dist/reportPaths.d.ts.map +1 -0
- package/dist/reportPaths.js +25 -0
- package/dist/reportPaths.js.map +1 -0
- package/dist/runner/actions.d.ts +1 -0
- package/dist/runner/actions.d.ts.map +1 -1
- package/dist/runner/actions.js +18 -2
- package/dist/runner/actions.js.map +1 -1
- package/dist/runner/authNegative.d.ts +1 -0
- package/dist/runner/authNegative.d.ts.map +1 -1
- package/dist/runner/authNegative.js +3 -0
- package/dist/runner/authNegative.js.map +1 -1
- package/dist/runner/evidence.d.ts.map +1 -1
- package/dist/runner/evidence.js +21 -8
- package/dist/runner/evidence.js.map +1 -1
- package/dist/runner/index.d.ts +17 -0
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/index.js +118 -7
- package/dist/runner/index.js.map +1 -1
- package/dist/runner/replay.d.ts +18 -1
- package/dist/runner/replay.d.ts.map +1 -1
- package/dist/runner/replay.js +105 -4
- package/dist/runner/replay.js.map +1 -1
- package/dist/runner/sensitive.d.ts +7 -1
- package/dist/runner/sensitive.d.ts.map +1 -1
- package/dist/runner/sensitive.js +58 -36
- package/dist/runner/sensitive.js.map +1 -1
- package/dist/starNudge.d.ts +74 -0
- package/dist/starNudge.d.ts.map +1 -0
- package/dist/starNudge.js +88 -0
- package/dist/starNudge.js.map +1 -0
- package/dist/types.d.ts +16 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/verify/index.d.ts +6 -0
- package/dist/verify/index.d.ts.map +1 -1
- package/dist/verify/index.js +62 -5
- package/dist/verify/index.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.7.2-beta.3] — 2026-11-10
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `monkeytest open` prints the stored run path and the screenshot and WebM paths already on that run. It does not fetch the site.
|
|
15
|
+
- A diff-only star line. It prints on a TTY only when the later run finished with `outcome` `clean`, zero bugs left, and a real fixed delta (nothing new, persisting, or regressed). `verify` does not ask. Stubs, loopback, CI, JSON, and `--no-star` / `MONKEYTEST_NO_STAR=1` do not ask. The one-time marker is a local file and is not sent anywhere.
|
|
16
|
+
- Existing-account sign-in for the local CLI: headed `monkeytest auth login`, or `--username-env` / `--password-env` / `--password-stdin`. Session files stay in `auth/session.json` (mode 600, directory 700) and are not uploaded. A rerun does not reuse one unless `--use-session` or a new password reference is passed. Expired, MFA, and off-origin results are `could_not_test`, not a pass.
|
|
17
|
+
- `AUTH_PROVIDER_CONTRACT` (`monkeytester.auth.provider.v1`) and `createAuthProvider` for a later server pin. Hosted targets are public https only. The hosted product is not claiming sign-in. This publish is npm `next` only. `latest` stays 0.7.1.
|
|
18
|
+
- Signed-in runs use one egress fence (page routes cannot skip it), and scrub known credentials before prompts, events, and saved output. A login is authenticated only when a post-login URL or selector matches. The contract string is unchanged.
|
|
19
|
+
- Signed-in pages cannot construct a dedicated worker, shared worker, WebRTC peer, or WebTransport. Non-proxied UDP is disabled. A saved session needs the same post-login check. A password field later in the run, or an envelope that expires mid-run, is `could_not_test`. Signed-in link probes are not sent.
|
|
20
|
+
- A post-login URL is checked when the session is bound. Later flows may leave that path. `hostedEgress` is `deny-nonpublic-recheck`. The contract string is still `monkeytester.auth.provider.v1`.
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
- npm `latest`, npm `next`, this tree's `package.json` version, and the hosted service are written down as different things. A registry observation is dated and is not a pin. The hosted API and worker observation (0.7.0, checkout `60def87b`) is not described as protected by a newer npm tag.
|
|
25
|
+
- Docs build emits `robots.txt`, `sitemap.xml`, and a canonical link. The Vercel project settings are unchanged.
|
|
26
|
+
- The fixed 10-site false-positive gate is specified and recorded as not measured.
|
|
27
|
+
|
|
10
28
|
## [0.7.2-beta.2] — 2026-11-02
|
|
11
29
|
|
|
12
30
|
### Fixed
|
package/README.md
CHANGED
|
@@ -28,7 +28,15 @@
|
|
|
28
28
|
<a href="https://monkeytest.ai">Cloud</a>
|
|
29
29
|
</p>
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Open-source autonomous website QA. Pass a URL to the CLI or the library. It explores with Playwright, files findings that carry evidence, and — when a trace was stored — replays that same plan with `rerun` and compares fingerprints with `diff`.
|
|
32
|
+
|
|
33
|
+
It is an AGPL-3.0 TypeScript CLI and library. The command is `monkeytest`. It is not a hosted REST API and it does not ship an MCP server. Programmatic use is a normal import.
|
|
34
|
+
|
|
35
|
+
A flow is `passed` only when its outcome check verifies. Unfinished checks stay `inconclusive`. Coverage is what the crawl reached under the depth cap, not the whole site. Confirm a filed bug on the site before you treat the run as the whole story. Contact, enquiry, feedback, support, quote, and get-in-touch messages are not sent. Password reset, OTP, newsletter, payment, and account deletion stay blocked unless you opt in with your own inbox, or with `allowSensitive` where the engine already allows it. There is no hosted inbox.
|
|
36
|
+
|
|
37
|
+
The accuracy gate — false positives under 10% on a fixed 10-site set — has not been measured. A 0% note on two sites is not that gate. See [Quality methodology](https://docs.monkeytest.ai/guides/quality).
|
|
38
|
+
|
|
39
|
+
npm dist-tag `latest` is the stable channel (`npm install @monkeytestai/monkeytester`). npm dist-tag `next` is the pre-release channel. This checkout's version is `package.json`, printed by `monkeytest version`. It is not the hosted product. A registry check on 8 Nov 2026 at 10:16 IST reported `latest` 0.7.1 and `next` 0.7.2-beta.2. That observation is not a pin. The hosted API and worker were observed running 0.7.0 from droplet checkout `60def87b`. The image revision is unproven, and unset safety flags do not establish safety defaults. An npm tag is not that deployment. [Versions](https://docs.monkeytest.ai/getting-started/versions).
|
|
32
40
|
|
|
33
41
|
## Quick start
|
|
34
42
|
|
|
@@ -47,7 +55,7 @@ npm install @monkeytestai/monkeytester
|
|
|
47
55
|
npx playwright install chromium
|
|
48
56
|
```
|
|
49
57
|
|
|
50
|
-
pnpm, yarn, and bun install the same package (`pnpm add`, `yarn add`, `bun add`). Playwright downloads its own Chromium.
|
|
58
|
+
pnpm, yarn, and bun install the same package (`pnpm add`, `yarn add`, `bun add`). Playwright downloads its own Chromium. Node.js 20 or newer. You bring a model: OpenAI, Gemini, Anthropic, Mistral, Groq, or any OpenAI-compatible endpoint (Ollama, vLLM, LM Studio, OpenRouter). The stable install follows npm `latest`. For the pre-release channel:
|
|
51
59
|
|
|
52
60
|
```bash
|
|
53
61
|
npm install @monkeytestai/monkeytester@next
|
|
@@ -62,14 +70,19 @@ npx monkeytest run https://example.com --depth basic
|
|
|
62
70
|
|
|
63
71
|
With an OpenAI key, the default model is `gpt-4o-mini`. If several keys are set, auto-detect uses the first of: `GEMINI_API_KEY` or `GOOGLE_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `MISTRAL_API_KEY`, `GROQ_API_KEY`, then `OPENAI_COMPATIBLE_BASE_URL`.
|
|
64
72
|
|
|
65
|
-
`--depth basic` is Quick pass: 6 pages, 5 LLM flows, page checks outside that budget, and a 120 second cap. About 10 cases, usually 1–2 minutes. `--max` and `--flows` override the page and flow caps.
|
|
73
|
+
`--depth basic` is Quick pass: 6 pages, 5 LLM flows, page checks outside that budget, and a 120 second cap. About 10 cases, usually 1–2 minutes. `--max` and `--flows` override the page and flow caps. Dollar figures for a larger standard run are a sketch in [Cost and depth](https://docs.monkeytest.ai/guides/cost-and-depth). Quick pass is smaller than that sketch. They are not an invoice. A missing key exits 2 before Chromium starts.
|
|
66
74
|
|
|
67
75
|
### 4. Read the report
|
|
68
76
|
|
|
69
77
|
```bash
|
|
70
78
|
npx monkeytest report
|
|
79
|
+
npx monkeytest open
|
|
71
80
|
```
|
|
72
81
|
|
|
82
|
+
`open` is unreleased in this source tree. The npm packages observed on 8 Nov 2026 do not include it.
|
|
83
|
+
|
|
84
|
+
`report` prints the run. `open` prints the absolute path of that file and the screenshot and WebM paths stored on it. It does not upload them and it does not open the site. There is no hosted report URL.
|
|
85
|
+
|
|
73
86
|
| Path | What it is |
|
|
74
87
|
| --- | --- |
|
|
75
88
|
| `.monkeytest/plan.json` | The plan. `rerun` replays its trace. |
|
|
@@ -80,7 +93,9 @@ Exit `0` when no blocking bug remains (`minor` does not fail the process). Exit
|
|
|
80
93
|
|
|
81
94
|
## Demo
|
|
82
95
|
|
|
83
|
-
> **Not a recording.**
|
|
96
|
+
> **Not a recording.** The figure below is a diagram of the loop. It is not a captured session.
|
|
97
|
+
|
|
98
|
+
A find → fix → same-trace rerun → diff on the local demo fixture is in [examples/fixture-loop](./examples/fixture-loop/README.md). The plan is hand-authored and the action resolver is a stub. `examples/fixture-loop/artifact.json` is that stub run, stamped with the engine version. It is not a live model and not a customer site. A real-model recording is blocked: this tree was not given a model credential, and the stub artifact is not that proof. The diagram above stays a diagram.
|
|
84
99
|
|
|
85
100
|
<p align="center">
|
|
86
101
|
<img alt="Diagram: monkeytest run, you fix the site, monkeytest rerun replays the same trace, monkeytest diff reports what changed. Not a captured session." src="docs/public/loop.svg" width="720" />
|
|
@@ -90,7 +105,7 @@ Exit `0` when no blocking bug remains (`minor` does not fail the process). Exit
|
|
|
90
105
|
|
|
91
106
|
Page checks run without a model call. The five are console errors, same-site failed requests and broken links, axe-core WCAG A/AA, mobile overflow and tap targets at 375px, and title / description / lang / viewport / h1. Serious or critical axe violations are bugs. A flow is `passed` only when its outcome check verifies. No check is `inconclusive` with reason `no_assertion`. A check that cannot be decided is `assertion_unverifiable`.
|
|
92
107
|
|
|
93
|
-
The contributor smoke script
|
|
108
|
+
The contributor smoke script is a **stub**, not real-model testing. It does not call a provider. It crawls `https://example.com`. From a clone, after `npm run build` and `npx playwright install chromium`:
|
|
94
109
|
|
|
95
110
|
```bash
|
|
96
111
|
node scripts/smoke.mjs
|
|
@@ -99,6 +114,7 @@ node scripts/smoke.mjs
|
|
|
99
114
|
This is the output of `node scripts/smoke.mjs` on this repository after `npm run build`. The duration is from that run.
|
|
100
115
|
|
|
101
116
|
```text
|
|
117
|
+
STUB — not real-model testing. No API key is read. The crawl target is https://example.com.
|
|
102
118
|
· visited https://example.com/ — Static placeholder page used as the canonical example domain.
|
|
103
119
|
|
|
104
120
|
[explore] done in 1.1 s
|
|
@@ -114,6 +130,7 @@ This is the output of `node scripts/smoke.mjs` on this repository after `npm run
|
|
|
114
130
|
- [accessibility] Page metadata (1 steps)
|
|
115
131
|
|
|
116
132
|
OK — engine pipeline is wired correctly.
|
|
133
|
+
STUB — this success line is not a real-model result.
|
|
117
134
|
```
|
|
118
135
|
|
|
119
136
|
When one confirmed bug is filed, the engine's `outcome_detail` is this sentence (asserted by the outcome tests, not a sample report):
|
|
@@ -124,16 +141,18 @@ Found 1 confirmed bug. Open the top one and confirm it on the site before treati
|
|
|
124
141
|
|
|
125
142
|
On a login-only crawl (`public_screens` is `0`) the same case says deeper journeys need an account, and `outcome_reason` is `login_required`.
|
|
126
143
|
|
|
144
|
+
An existing account can be signed in on the machine that runs the CLI (`monkeytest auth login`, or `--username-env` / `--password-env`). The session file stays local. The hosted product does not take those credentials. See the auth guide.
|
|
145
|
+
|
|
127
146
|
## How is this different?
|
|
128
147
|
|
|
129
|
-
| | Who
|
|
130
|
-
| --- | --- | --- |
|
|
131
|
-
| **monkeytester** | The
|
|
132
|
-
| **[Playwright](https://playwright.dev/docs/intro)** |
|
|
133
|
-
| **[browser-use](https://github.com/browser-use/browser-use)** |
|
|
134
|
-
| **Recorders and other scripted QA tools** | You
|
|
148
|
+
| | What it is | Who supplies the goal | What you keep |
|
|
149
|
+
| --- | --- | --- | --- |
|
|
150
|
+
| **monkeytester** | Open-source CLI and library for autonomous website QA | A URL. The crawl, the planner, and the page checks propose cases | Evidence-backed bugs, a stored plan, `rerun` of that plan, fingerprint `diff` |
|
|
151
|
+
| **[Playwright Test](https://playwright.dev/docs/intro)** | An end-to-end framework for tests you own | You, or [Playwright Test Agents](https://playwright.dev/docs/test-agents), which plan, generate, and heal Playwright tests | Test files and their report |
|
|
152
|
+
| **[browser-use](https://github.com/browser-use/browser-use)** | Open-source browser-agent infrastructure | A task you give the agent. The agent can inspect the page while doing that task. That is discovery in service of the task | The task result |
|
|
153
|
+
| **Recorders and other scripted QA tools** | Session capture or a script you wrote | You, by recording or writing the steps | A replay of those steps |
|
|
135
154
|
|
|
136
|
-
|
|
155
|
+
A pass requires a verified outcome check, otherwise the result is `inconclusive`. `monkeytest rerun` replays the stored trace, and `monkeytest diff` compares fingerprints. This table is not a score. More on the [comparison page](https://docs.monkeytest.ai/guides/how-is-this-different).
|
|
137
156
|
|
|
138
157
|
## Find, fix, rerun, diff
|
|
139
158
|
|
|
@@ -146,7 +165,9 @@ npx monkeytest diff prev latest
|
|
|
146
165
|
|
|
147
166
|
`rerun` replays the action trace and does not call the LLM. `--heal` may call the model when a stored locator misses. Runs saved before traces existed fall back to re-executing the plan with the LLM. `diff prev latest` compares the previous run to the newest one. The printer's line is `N new, N fixed, N still broken, N regressed (net ±N)`. It exits 1 when a bug is new or more severe.
|
|
148
167
|
|
|
149
|
-
`monkeytest verify` replays each known bug and prints `fixed`, `still_broken`, `flaky`, `healed`, or `blocked`.
|
|
168
|
+
`monkeytest verify` replays each known bug and prints `fixed`, `still_broken`, `flaky`, `healed`, or `blocked`. It does not ask for a star. A `fixed` verdict is not a clean run.
|
|
169
|
+
|
|
170
|
+
The star line is unreleased and `diff`-only. On a TTY, `diff` may print one link — https://github.com/monkeytestai/monkeytester — only when the later run has `finishedAt`, `outcome` `clean`, and no bugs left, and the diff has at least one fixed bug with nothing new, persisting, or regressed. `inconclusive`, `could_not_test`, `bugs_found`, an unknown outcome, and a missing `finishedAt` do not ask, even if the diff counts look all-fixed. A loopback URL does not ask. A run whose stored `warnings`, step errors, or bug text already name a stub provider (`[stub · …]`) does not ask, including when the URL is not loopback. The one-time marker is `.monkeytest/.star-noted` and contains the word `noted`. Nothing is sent. Set `MONKEYTEST_NO_STAR=1` or pass `--no-star` to skip it. CI, `--json`, and a non-interactive stdout stay quiet. A star is not a usage metric, and neither are npm downloads.
|
|
150
171
|
|
|
151
172
|
The same loop from the library:
|
|
152
173
|
|
|
@@ -219,12 +240,13 @@ Ollama, vLLM, LM Studio, and OpenRouter use `openai_compatible` and `--base-url`
|
|
|
219
240
|
- [Sign-up testing with your own inbox](https://docs.monkeytest.ai/guides/signup)
|
|
220
241
|
- [Cost and depth](https://docs.monkeytest.ai/guides/cost-and-depth)
|
|
221
242
|
- [CLI](https://docs.monkeytest.ai/reference/cli), [config](https://docs.monkeytest.ai/reference/config), [API](https://docs.monkeytest.ai/reference/api), [report fields](https://docs.monkeytest.ai/reference/report)
|
|
243
|
+
- [Versions](https://docs.monkeytest.ai/getting-started/versions), [quality methodology](https://docs.monkeytest.ai/guides/quality)
|
|
222
244
|
|
|
223
|
-
Hosted runs
|
|
245
|
+
Hosted runs are a separate service at [monkeytest.ai](https://monkeytest.ai). The observed API and worker version is not the npm tag. See [Versions](https://docs.monkeytest.ai/getting-started/versions).
|
|
224
246
|
|
|
225
247
|
## Contributing
|
|
226
248
|
|
|
227
|
-
Issues and pull requests are welcome. Read [CONTRIBUTING.md](./CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md). Report vulnerabilities in private using [SECURITY.md](./SECURITY.md).
|
|
249
|
+
Issues and pull requests are welcome. Read [CONTRIBUTING.md](./CONTRIBUTING.md), the concrete briefs in [STARTER_ISSUES.md](./.github/STARTER_ISSUES.md), and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md). Report vulnerabilities in private using [SECURITY.md](./SECURITY.md). Recommended GitHub About text and topics, which this pull request does not apply, are in [REPOSITORY_METADATA.md](./.github/REPOSITORY_METADATA.md).
|
|
228
250
|
|
|
229
251
|
## License
|
|
230
252
|
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed 10-site false-positive protocol.
|
|
3
|
+
*
|
|
4
|
+
* This module does not fetch any site. The in-repo result is `null`:
|
|
5
|
+
* the gate has not been measured. A historical 0% note on two sites is
|
|
6
|
+
* not a measurement of this set.
|
|
7
|
+
*
|
|
8
|
+
* Denominator: confirmed bugs the engine filed (`bugs[]`). Suggestions,
|
|
9
|
+
* inconclusive flows, and pages are not the denominator. Zero confirmed
|
|
10
|
+
* bugs is an undefined rate, not 0%.
|
|
11
|
+
*
|
|
12
|
+
* Aggregate rate sums counts across sites. It does not average per-site
|
|
13
|
+
* rates, so a site with no bugs cannot dilute a site with false positives.
|
|
14
|
+
*
|
|
15
|
+
* Coverage and misses are reported beside the rate. Misses are known
|
|
16
|
+
* defects that no filed bug matched. They are not false positives.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ADJUDICATION_PROTOCOL_ID = "fixed-10-2026-11-08";
|
|
19
|
+
/** Gate threshold. A lower rate is required. Equality does not pass. */
|
|
20
|
+
export declare const FALSE_POSITIVE_GATE = 0.1;
|
|
21
|
+
export type AdjudicationSource = 'bake-off-corpus' | 'unassigned';
|
|
22
|
+
export interface AdjudicationSite {
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* Host named by an old labelled corpus. `null` means the slot is empty.
|
|
26
|
+
* This string is not a request and not permission to crawl.
|
|
27
|
+
*/
|
|
28
|
+
startUrl: string | null;
|
|
29
|
+
source: AdjudicationSource;
|
|
30
|
+
/**
|
|
31
|
+
* Always false. A corpus URL, including a customer site, does not
|
|
32
|
+
* authorize `monkeytest run` or any other fetch.
|
|
33
|
+
*/
|
|
34
|
+
authorizedToRun: false;
|
|
35
|
+
/** Customer or partner site. Must not be started from this roster. */
|
|
36
|
+
customerSite: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Nine hosts are names from the hand-labelled bake-off corpus in
|
|
40
|
+
* `test/fp-measurement.test.ts`. The tenth slot stays unassigned.
|
|
41
|
+
* Nothing in this module fetches a host. `authorizedToRun` is false on
|
|
42
|
+
* every row, including the jewellery customer site.
|
|
43
|
+
*/
|
|
44
|
+
export declare const FIXED_10_SITES: readonly AdjudicationSite[];
|
|
45
|
+
/** The corpus list is not a run list. This is constant, not a switch. */
|
|
46
|
+
export declare function corpusAuthorizesExecution(): false;
|
|
47
|
+
/**
|
|
48
|
+
* Release-note figure for 0.7.1: 0 of 12 bugs on two hosts. Recorded here
|
|
49
|
+
* so a reader can see why it does not close the gate.
|
|
50
|
+
*/
|
|
51
|
+
export declare const PRIOR_TWO_SITE_NOTE: {
|
|
52
|
+
sites: string[];
|
|
53
|
+
claimedFalsePositives: number;
|
|
54
|
+
claimedConfirmedBugs: number;
|
|
55
|
+
engine: string;
|
|
56
|
+
sufficientForGate: false;
|
|
57
|
+
reason: string;
|
|
58
|
+
};
|
|
59
|
+
export interface SiteAdjudication {
|
|
60
|
+
siteId: string;
|
|
61
|
+
engineVersion: string;
|
|
62
|
+
gitSha: string;
|
|
63
|
+
/** `latest`, `next`, or `source` when the binary was this checkout. */
|
|
64
|
+
channel: 'latest' | 'next' | 'source';
|
|
65
|
+
depth: string;
|
|
66
|
+
models: {
|
|
67
|
+
explorer: string;
|
|
68
|
+
planner: string;
|
|
69
|
+
runner: string;
|
|
70
|
+
};
|
|
71
|
+
/** Confirmed bugs filed. This is the per-site denominator. */
|
|
72
|
+
confirmedBugs: number;
|
|
73
|
+
falsePositives: number;
|
|
74
|
+
inScopePages: number;
|
|
75
|
+
pagesExplored: number;
|
|
76
|
+
/** Known defects with no matching filed bug. */
|
|
77
|
+
misses: number;
|
|
78
|
+
inconclusiveFlows: number;
|
|
79
|
+
}
|
|
80
|
+
export interface AdjudicationReport {
|
|
81
|
+
protocolId: string;
|
|
82
|
+
sites: SiteAdjudication[];
|
|
83
|
+
}
|
|
84
|
+
/** No completed fixed-10 adjudication is stored in this repository. */
|
|
85
|
+
export declare const CURRENT_ADJUDICATION: AdjudicationReport | null;
|
|
86
|
+
export interface GateResult {
|
|
87
|
+
passed: boolean;
|
|
88
|
+
reason: string;
|
|
89
|
+
rate: number | undefined;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Fail closed before any rate is summed. A bad channel, a count outside
|
|
93
|
+
* its range, or coverage that cannot be computed rejects the whole sheet.
|
|
94
|
+
* This does not record an adjudication and does not authorize a crawl.
|
|
95
|
+
*/
|
|
96
|
+
export declare function siteRowError(row: SiteAdjudication): string | null;
|
|
97
|
+
export declare function assignedSiteCount(sites?: readonly AdjudicationSite[]): number;
|
|
98
|
+
/**
|
|
99
|
+
* False positives divided by confirmed bugs. `undefined` when the
|
|
100
|
+
* denominator is 0, or when false positives exceed the denominator.
|
|
101
|
+
*/
|
|
102
|
+
export declare function falsePositiveRate(confirmedBugs: number, falsePositives: number): number | undefined;
|
|
103
|
+
export declare function aggregateFalsePositiveRate(rows: Array<Pick<SiteAdjudication, 'confirmedBugs' | 'falsePositives'>>): number | undefined;
|
|
104
|
+
/** Pages explored divided by the adjudicator's in-scope page list. */
|
|
105
|
+
export declare function coverageRatio(pagesExplored: number, inScopePages: number): number | undefined;
|
|
106
|
+
export declare function evaluateGate(report: AdjudicationReport | null, sites?: readonly AdjudicationSite[]): GateResult;
|
|
107
|
+
//# sourceMappingURL=adjudication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjudication.d.ts","sourceRoot":"","sources":["../../src/audit/adjudication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AA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AAoB,EAAE,kBAAkB,GAAG,IAAW,CAAC;AAEpE,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAID;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAiBjE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,GAAE,SAAS,gBAAgB,EAAmB,GAAG,MAAM,CAE7F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAInG;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,gBAAgB,CAAC,CAAC,GAAG,MAAM,GAAG,SAAS,CAItI;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI7F;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GAAG,IAAI,EACjC,KAAK,GAAE,SAAS,gBAAgB,EAAmB,GAClD,UAAU,CAiDZ"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed 10-site false-positive protocol.
|
|
3
|
+
*
|
|
4
|
+
* This module does not fetch any site. The in-repo result is `null`:
|
|
5
|
+
* the gate has not been measured. A historical 0% note on two sites is
|
|
6
|
+
* not a measurement of this set.
|
|
7
|
+
*
|
|
8
|
+
* Denominator: confirmed bugs the engine filed (`bugs[]`). Suggestions,
|
|
9
|
+
* inconclusive flows, and pages are not the denominator. Zero confirmed
|
|
10
|
+
* bugs is an undefined rate, not 0%.
|
|
11
|
+
*
|
|
12
|
+
* Aggregate rate sums counts across sites. It does not average per-site
|
|
13
|
+
* rates, so a site with no bugs cannot dilute a site with false positives.
|
|
14
|
+
*
|
|
15
|
+
* Coverage and misses are reported beside the rate. Misses are known
|
|
16
|
+
* defects that no filed bug matched. They are not false positives.
|
|
17
|
+
*/
|
|
18
|
+
export const ADJUDICATION_PROTOCOL_ID = 'fixed-10-2026-11-08';
|
|
19
|
+
/** Gate threshold. A lower rate is required. Equality does not pass. */
|
|
20
|
+
export const FALSE_POSITIVE_GATE = 0.1;
|
|
21
|
+
/**
|
|
22
|
+
* Nine hosts are names from the hand-labelled bake-off corpus in
|
|
23
|
+
* `test/fp-measurement.test.ts`. The tenth slot stays unassigned.
|
|
24
|
+
* Nothing in this module fetches a host. `authorizedToRun` is false on
|
|
25
|
+
* every row, including the jewellery customer site.
|
|
26
|
+
*/
|
|
27
|
+
export const FIXED_10_SITES = [
|
|
28
|
+
{ id: 'automationexercise', startUrl: 'https://automationexercise.com/', source: 'bake-off-corpus', authorizedToRun: false, customerSite: false },
|
|
29
|
+
{ id: 'bananabeings', startUrl: 'https://bananabeings.com/', source: 'bake-off-corpus', authorizedToRun: false, customerSite: true },
|
|
30
|
+
{ id: 'playwright-todomvc', startUrl: 'https://demo.playwright.dev/todomvc', source: 'bake-off-corpus', authorizedToRun: false, customerSite: false },
|
|
31
|
+
{ id: 'demoqa', startUrl: 'https://demoqa.com/', source: 'bake-off-corpus', authorizedToRun: false, customerSite: false },
|
|
32
|
+
{ id: 'jewellery-lovable', startUrl: 'https://jewellerycasting08.lovable.app/', source: 'bake-off-corpus', authorizedToRun: false, customerSite: true },
|
|
33
|
+
{ id: 'parabank', startUrl: 'https://parabank.parasoft.com/parabank/index.htm', source: 'bake-off-corpus', authorizedToRun: false, customerSite: false },
|
|
34
|
+
{ id: 'practice-software-testing', startUrl: 'https://practicesoftwaretesting.com/', source: 'bake-off-corpus', authorizedToRun: false, customerSite: false },
|
|
35
|
+
{ id: 'the-internet', startUrl: 'https://the-internet.herokuapp.com/', source: 'bake-off-corpus', authorizedToRun: false, customerSite: false },
|
|
36
|
+
{ id: 'saucedemo', startUrl: 'https://www.saucedemo.com/', source: 'bake-off-corpus', authorizedToRun: false, customerSite: false },
|
|
37
|
+
{ id: 'slot-10', startUrl: null, source: 'unassigned', authorizedToRun: false, customerSite: false },
|
|
38
|
+
];
|
|
39
|
+
/** The corpus list is not a run list. This is constant, not a switch. */
|
|
40
|
+
export function corpusAuthorizesExecution() {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Release-note figure for 0.7.1: 0 of 12 bugs on two hosts. Recorded here
|
|
45
|
+
* so a reader can see why it does not close the gate.
|
|
46
|
+
*/
|
|
47
|
+
export const PRIOR_TWO_SITE_NOTE = {
|
|
48
|
+
sites: ['app.monkeytest.ai', 'bananabeings.com'],
|
|
49
|
+
claimedFalsePositives: 0,
|
|
50
|
+
claimedConfirmedBugs: 12,
|
|
51
|
+
engine: '0.7.1',
|
|
52
|
+
sufficientForGate: false,
|
|
53
|
+
reason: 'The gate is a false-positive rate under 10% on all 10 assigned sites. Two sites are not that set.',
|
|
54
|
+
};
|
|
55
|
+
/** No completed fixed-10 adjudication is stored in this repository. */
|
|
56
|
+
export const CURRENT_ADJUDICATION = null;
|
|
57
|
+
const CHANNELS = new Set(['latest', 'next', 'source']);
|
|
58
|
+
/**
|
|
59
|
+
* Fail closed before any rate is summed. A bad channel, a count outside
|
|
60
|
+
* its range, or coverage that cannot be computed rejects the whole sheet.
|
|
61
|
+
* This does not record an adjudication and does not authorize a crawl.
|
|
62
|
+
*/
|
|
63
|
+
export function siteRowError(row) {
|
|
64
|
+
if (!CHANNELS.has(row.channel))
|
|
65
|
+
return 'channel must be latest, next, or source';
|
|
66
|
+
if (!row.engineVersion || !row.gitSha || !row.depth)
|
|
67
|
+
return 'version stamp is incomplete';
|
|
68
|
+
if (!row.models?.explorer || !row.models?.planner || !row.models?.runner)
|
|
69
|
+
return 'model stamp is incomplete';
|
|
70
|
+
if (!Number.isInteger(row.confirmedBugs) || row.confirmedBugs < 0)
|
|
71
|
+
return 'confirmedBugs must be a non-negative integer';
|
|
72
|
+
if (!Number.isInteger(row.falsePositives) || row.falsePositives < 0 || row.falsePositives > row.confirmedBugs) {
|
|
73
|
+
return 'falsePositives must be an integer from 0 through confirmedBugs';
|
|
74
|
+
}
|
|
75
|
+
if (!Number.isInteger(row.inScopePages) || row.inScopePages <= 0)
|
|
76
|
+
return 'inScopePages must be a positive integer';
|
|
77
|
+
if (!Number.isInteger(row.pagesExplored) || row.pagesExplored < 0 || row.pagesExplored > row.inScopePages) {
|
|
78
|
+
return 'pagesExplored must be an integer from 0 through inScopePages';
|
|
79
|
+
}
|
|
80
|
+
if (!Number.isInteger(row.misses) || row.misses < 0)
|
|
81
|
+
return 'misses must be a non-negative integer';
|
|
82
|
+
if (!Number.isInteger(row.inconclusiveFlows) || row.inconclusiveFlows < 0) {
|
|
83
|
+
return 'inconclusiveFlows must be a non-negative integer';
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
export function assignedSiteCount(sites = FIXED_10_SITES) {
|
|
88
|
+
return sites.filter(site => site.source !== 'unassigned' && site.startUrl).length;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* False positives divided by confirmed bugs. `undefined` when the
|
|
92
|
+
* denominator is 0, or when false positives exceed the denominator.
|
|
93
|
+
*/
|
|
94
|
+
export function falsePositiveRate(confirmedBugs, falsePositives) {
|
|
95
|
+
if (!Number.isInteger(confirmedBugs) || !Number.isInteger(falsePositives))
|
|
96
|
+
return undefined;
|
|
97
|
+
if (confirmedBugs <= 0 || falsePositives < 0 || falsePositives > confirmedBugs)
|
|
98
|
+
return undefined;
|
|
99
|
+
return falsePositives / confirmedBugs;
|
|
100
|
+
}
|
|
101
|
+
export function aggregateFalsePositiveRate(rows) {
|
|
102
|
+
const confirmed = rows.reduce((sum, row) => sum + row.confirmedBugs, 0);
|
|
103
|
+
const falsePositives = rows.reduce((sum, row) => sum + row.falsePositives, 0);
|
|
104
|
+
return falsePositiveRate(confirmed, falsePositives);
|
|
105
|
+
}
|
|
106
|
+
/** Pages explored divided by the adjudicator's in-scope page list. */
|
|
107
|
+
export function coverageRatio(pagesExplored, inScopePages) {
|
|
108
|
+
if (!Number.isInteger(pagesExplored) || !Number.isInteger(inScopePages))
|
|
109
|
+
return undefined;
|
|
110
|
+
if (inScopePages <= 0 || pagesExplored < 0)
|
|
111
|
+
return undefined;
|
|
112
|
+
return pagesExplored / inScopePages;
|
|
113
|
+
}
|
|
114
|
+
export function evaluateGate(report, sites = FIXED_10_SITES) {
|
|
115
|
+
if (sites.length !== 10) {
|
|
116
|
+
return { passed: false, rate: undefined, reason: 'The protocol is a fixed set of 10 sites.' };
|
|
117
|
+
}
|
|
118
|
+
if (assignedSiteCount(sites) !== 10) {
|
|
119
|
+
return {
|
|
120
|
+
passed: false,
|
|
121
|
+
rate: undefined,
|
|
122
|
+
reason: 'A site slot is unassigned. The gate cannot be scored from a shorter list.',
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
if (!report) {
|
|
126
|
+
return { passed: false, rate: undefined, reason: 'No fixed-10 adjudication is recorded.' };
|
|
127
|
+
}
|
|
128
|
+
if (report.protocolId !== ADJUDICATION_PROTOCOL_ID) {
|
|
129
|
+
return { passed: false, rate: undefined, reason: 'The report is for a different protocol id.' };
|
|
130
|
+
}
|
|
131
|
+
if (report.sites.length !== 10) {
|
|
132
|
+
return { passed: false, rate: undefined, reason: 'The report does not contain 10 site rows.' };
|
|
133
|
+
}
|
|
134
|
+
const ids = new Set(sites.map(site => site.id));
|
|
135
|
+
if (report.sites.some(row => !ids.has(row.siteId))) {
|
|
136
|
+
return { passed: false, rate: undefined, reason: 'The report names a site outside the frozen set.' };
|
|
137
|
+
}
|
|
138
|
+
if (new Set(report.sites.map(row => row.siteId)).size !== 10) {
|
|
139
|
+
return { passed: false, rate: undefined, reason: 'The report repeats a site or omits one.' };
|
|
140
|
+
}
|
|
141
|
+
for (const row of report.sites) {
|
|
142
|
+
const rowError = siteRowError(row);
|
|
143
|
+
if (rowError) {
|
|
144
|
+
return {
|
|
145
|
+
passed: false,
|
|
146
|
+
rate: undefined,
|
|
147
|
+
reason: `${row.siteId || '(missing site)'}: ${rowError}`,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const rate = aggregateFalsePositiveRate(report.sites);
|
|
152
|
+
if (rate === undefined) {
|
|
153
|
+
return {
|
|
154
|
+
passed: false,
|
|
155
|
+
rate: undefined,
|
|
156
|
+
reason: 'The false-positive rate is undefined. A set that filed no confirmed bugs is not 0%.',
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (rate >= FALSE_POSITIVE_GATE) {
|
|
160
|
+
return { passed: false, rate, reason: 'The false-positive rate is not under 10%.' };
|
|
161
|
+
}
|
|
162
|
+
return { passed: true, rate, reason: 'The recorded fixed-10 adjudication is under 10%.' };
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=adjudication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjudication.js","sourceRoot":"","sources":["../../src/audit/adjudication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAE9D,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAqBvC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC;IACzD,EAAE,EAAE,EAAE,oBAAoB,EAAE,QAAQ,EAAE,iCAAiC,EAAE,MAAM,EAAE,iBAAiB,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE;IACjJ,EAAE,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,2BAA2B,EAAE,MAAM,EAAE,iBAAiB,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE;IACpI,E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CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,qFAAqF;SAC9F,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,IAAI,mBAAmB,EAAE,CAAC;QAChC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,2CAA2C,EAAE,CAAC;IACtF,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,kDAAkD,EAAE,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bind an in-memory session before explore, plan, or replay.
|
|
3
|
+
* Does not read a previous run, write a file, grant allowSensitive, or
|
|
4
|
+
* record a screenshot. A past expiresAt is `expired` and is not applied.
|
|
5
|
+
*/
|
|
6
|
+
import type { AuthStorageState } from './contract.js';
|
|
7
|
+
import type { AuthResult } from './establish.js';
|
|
8
|
+
export interface AuthBindInput {
|
|
9
|
+
targetOrigin: string;
|
|
10
|
+
idpOrigins?: string[];
|
|
11
|
+
storageState: AuthStorageState;
|
|
12
|
+
/** Caller envelope expiry. The server uses 120 seconds. Past this, the jar is not applied. */
|
|
13
|
+
expiresAt?: string;
|
|
14
|
+
nowMs?: number;
|
|
15
|
+
/** Path or absolute URL on the target that is visible only after sign-in. */
|
|
16
|
+
postLoginUrl?: string;
|
|
17
|
+
/** Selector that is visible only after sign-in. */
|
|
18
|
+
postLoginSelector?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function bindAuthProvider(input: AuthBindInput): Promise<AuthResult>;
|
|
21
|
+
//# sourceMappingURL=bind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../../src/auth/bind.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CA8IhF"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bind an in-memory session before explore, plan, or replay.
|
|
3
|
+
* Does not read a previous run, write a file, grant allowSensitive, or
|
|
4
|
+
* record a screenshot. A past expiresAt is `expired` and is not applied.
|
|
5
|
+
*/
|
|
6
|
+
import { acceptSessionMaterial, assertSessionBound, jarExpired, policyFrom } from './origins.js';
|
|
7
|
+
import { proveStoredSession } from './proof.js';
|
|
8
|
+
import { publicMetadata } from './report.js';
|
|
9
|
+
export async function bindAuthProvider(input) {
|
|
10
|
+
const policyResult = policyFrom(input.targetOrigin, input.idpOrigins ?? []);
|
|
11
|
+
if (!policyResult.ok) {
|
|
12
|
+
return {
|
|
13
|
+
ok: false,
|
|
14
|
+
setup: true,
|
|
15
|
+
metadata: publicMetadata({
|
|
16
|
+
mode: 'session',
|
|
17
|
+
outcome: 'target_rejected',
|
|
18
|
+
policy: { targetOrigin: 'https://invalid.invalid', idpOrigins: [] },
|
|
19
|
+
custody: 'in-memory',
|
|
20
|
+
detail: policyResult.detail,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const policy = policyResult.policy;
|
|
25
|
+
const now = input.nowMs ?? Date.now();
|
|
26
|
+
if (input.expiresAt !== undefined) {
|
|
27
|
+
const expiresMs = Date.parse(input.expiresAt);
|
|
28
|
+
if (Number.isNaN(expiresMs)) {
|
|
29
|
+
return {
|
|
30
|
+
ok: false,
|
|
31
|
+
setup: true,
|
|
32
|
+
metadata: publicMetadata({
|
|
33
|
+
mode: 'session',
|
|
34
|
+
outcome: 'not_authorized',
|
|
35
|
+
policy,
|
|
36
|
+
custody: 'in-memory',
|
|
37
|
+
detail: 'The session expiry is not a time. It was not applied. This is not a verified run.',
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (input.expiresAt && Date.parse(input.expiresAt) <= now) {
|
|
43
|
+
return {
|
|
44
|
+
ok: false,
|
|
45
|
+
setup: false,
|
|
46
|
+
metadata: publicMetadata({
|
|
47
|
+
mode: 'session',
|
|
48
|
+
outcome: 'expired',
|
|
49
|
+
policy,
|
|
50
|
+
custody: 'in-memory',
|
|
51
|
+
expiresAt: input.expiresAt,
|
|
52
|
+
detail: 'Our test couldn\'t complete the run because the in-memory sign-in envelope expired. It was not applied. This is not a verified run and it does not mean the site has no bugs.',
|
|
53
|
+
}),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (jarExpired(input.storageState, now)) {
|
|
57
|
+
return {
|
|
58
|
+
ok: false,
|
|
59
|
+
setup: false,
|
|
60
|
+
metadata: publicMetadata({
|
|
61
|
+
mode: 'session',
|
|
62
|
+
outcome: 'expired',
|
|
63
|
+
policy,
|
|
64
|
+
custody: 'in-memory',
|
|
65
|
+
...(input.expiresAt ? { expiresAt: input.expiresAt } : {}),
|
|
66
|
+
detail: 'Our test couldn\'t complete the run because the session cookies are expired. They were not applied. This is not a verified run and it does not mean the site has no bugs.',
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const material = acceptSessionMaterial(input.storageState);
|
|
71
|
+
if (!material.ok) {
|
|
72
|
+
return {
|
|
73
|
+
ok: false,
|
|
74
|
+
setup: false,
|
|
75
|
+
metadata: publicMetadata({
|
|
76
|
+
mode: 'session',
|
|
77
|
+
outcome: 'not_authorized',
|
|
78
|
+
policy,
|
|
79
|
+
custody: 'in-memory',
|
|
80
|
+
detail: `Our test couldn't complete the run. ${material.detail} This is not a verified run.`,
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const bound = assertSessionBound(input.storageState, policy);
|
|
85
|
+
if (!bound.ok) {
|
|
86
|
+
return {
|
|
87
|
+
ok: false,
|
|
88
|
+
setup: false,
|
|
89
|
+
metadata: publicMetadata({
|
|
90
|
+
mode: 'session',
|
|
91
|
+
outcome: 'origin_rejected',
|
|
92
|
+
policy,
|
|
93
|
+
custody: 'in-memory',
|
|
94
|
+
detail: `Our test couldn't complete the run. ${bound.detail} This is not a verified run.`,
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (!input.postLoginUrl && !input.postLoginSelector) {
|
|
99
|
+
return {
|
|
100
|
+
ok: false,
|
|
101
|
+
setup: true,
|
|
102
|
+
metadata: publicMetadata({
|
|
103
|
+
mode: 'session',
|
|
104
|
+
outcome: 'not_authorized',
|
|
105
|
+
policy,
|
|
106
|
+
custody: 'in-memory',
|
|
107
|
+
...(input.expiresAt ? { expiresAt: input.expiresAt } : {}),
|
|
108
|
+
detail: 'A saved session is not signed in until a post-login URL or selector is shown on the target. Nothing was marked authenticated. This is not a verified run.',
|
|
109
|
+
}),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const proved = await proveStoredSession({
|
|
113
|
+
targetUrl: input.targetOrigin,
|
|
114
|
+
policy,
|
|
115
|
+
storageState: input.storageState,
|
|
116
|
+
postLoginUrl: input.postLoginUrl,
|
|
117
|
+
postLoginSelector: input.postLoginSelector,
|
|
118
|
+
});
|
|
119
|
+
if (!proved) {
|
|
120
|
+
return {
|
|
121
|
+
ok: false,
|
|
122
|
+
setup: false,
|
|
123
|
+
metadata: publicMetadata({
|
|
124
|
+
mode: 'session',
|
|
125
|
+
outcome: 'credentials_rejected',
|
|
126
|
+
policy,
|
|
127
|
+
custody: 'in-memory',
|
|
128
|
+
...(input.expiresAt ? { expiresAt: input.expiresAt } : {}),
|
|
129
|
+
detail: 'Our test couldn\'t complete the run because the target did not show the configured post-login URL or selector. The saved session was not applied. This is not a verified run.',
|
|
130
|
+
}),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const metadata = publicMetadata({
|
|
134
|
+
mode: 'session',
|
|
135
|
+
outcome: 'authenticated',
|
|
136
|
+
policy,
|
|
137
|
+
custody: 'in-memory',
|
|
138
|
+
...(input.expiresAt ? { expiresAt: input.expiresAt } : {}),
|
|
139
|
+
detail: 'Bound an in-memory session for this process and this exact origin. It was not written to a plan, run, or report. Screenshots and video are off. A later rerun needs a new envelope. The hosted product is not holding this session.',
|
|
140
|
+
});
|
|
141
|
+
return {
|
|
142
|
+
ok: true,
|
|
143
|
+
setup: false,
|
|
144
|
+
metadata,
|
|
145
|
+
storageState: input.storageState,
|
|
146
|
+
authOrigin: policy,
|
|
147
|
+
toJSON() {
|
|
148
|
+
return { ok: true, setup: false, metadata, storageState: { redacted: true } };
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=bind.js.map
|