Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Bugpatrol review: dashboardNo problem introduced · tested Tested
Not tested
Updated on each push. Tests only what the diff can affect. Does not block the merge. |
Bugpatrol review: fixture-appNo problem introduced · tested Tested
Not tested
Updated on each push. Tests only what the diff can affect. Does not block the merge. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd5b949833
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Bugpatrol review: cliNo problem introduced · tested Tested
Not tested
Updated on each push. Tests only what the diff can affect. Does not block the merge. |
|
Codex and Muse review of
|
|
Getting ready to merge: MergeLoop settles any conflict and sees its checks pass, fixing them if it can. It keeps its place in the queue. |
There was a problem hiding this comment.
MergeLoop's review
The PR shares deny matching across policies, drivers and proxies and adds config validation and reporting. All required checks and 53 existing focused tests pass, but two reproduced browser bypasses still let denied requests reach the backend.
It sent 2 back to the author, each in a thread on its line. For each, fix it and push, or reply with why it doesn't apply, then resolve the thread. To have the agent look again before you push, reply in the thread with @merge-loop and why. Once every thread is resolved, the PR goes on to the merge queue with no human approval.
What it cleared
- Config validation and request matching share the same glob parser (100%)
- The proxy checks denied requests and upgrades before forwarding (100%)
- Deny-only runs retain a shared blocked-request log (100%)
| if (SAFE.has(request.method())) return route.continue(); | ||
| options.log.record(request.method(), request.url()); | ||
| const rule = options.deny?.(request.method(), request.url()); | ||
| if (!rule && (options.allowWrites || SAFE.has(request.method()))) return route.continue(); |
There was a problem hiding this comment.
Sent back to the author · f1 · other · 100% sure
Redirected requests bypass the browser deny list
Playwright invokes this route handler only for the first request in a redirect chain. An allowed POST to /start returning a 307 to /billing/checkout therefore reaches that backend endpoint despite POST /billing/** being denied, without recording a block. This shared guard affects both web and Electron.
Shows it: MergeLoop ran pnpm install --frozen-lockfile && pnpm build && npm install --prefix /tmp/bugpatrol-review-browser --no-save --no-package-lock @sparticuz/chromium@153.0.0 && node --input-type=module -e 'import Chromium, { inflate } from "/tmp/bugpatrol-review-browser/node_modules/@sparticuz/chromium/build/index.js"; await Chromium.executablePath(); await inflate("/tmp/bugpatrol-review-browser/node_modules/@sparticuz/chromium/bin/al2023.tar.br");' && LD_LIBRARY_PATH=/tmp/al2023/lib REVIEW_CHROMIUM=/tmp/chromium pnpm vitest run packages/drivers/src/deny-redirect.review.test.ts on 0224bea and it failed:
Tests 1 failed (1)
Start at 20:13:56
Duration 2.53s (transform 479ms, setup 0ms, collect 1.46s, tests 528ms, environment 0ms, prepare 152ms)
$ tsc --build
�[33mThe CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.�[39m
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
FAIL packages/drivers/src/deny-redirect.review.test.ts > checks a deny glob again after a 307 redirect
AssertionError: expected [ 'GET /', 'POST /start', …(1) ] to not include 'POST /billing/checkout'
❯ packages/drivers/src/deny-redirect.review.test.ts:37:22
35| await page.evaluate(() => fetch('/start', { method: 'POST', body: …
36| expect(seen).toContain('POST /start');
37| expect(seen).not.toContain('POST /billing/checkout');
| ^
38| expect(log.drain()).toEqual([expect.stringContaining('app.connect.…
39| } finally {
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
With the test it wrote, in packages/drivers/src/deny-redirect.review.test.ts
diff --git a/packages/drivers/src/deny-redirect.review.test.ts b/packages/drivers/src/deny-redirect.review.test.ts
new file mode 100644
index 0000000..ad9e7d5
--- /dev/null
+++ b/packages/drivers/src/deny-redirect.review.test.ts
@@ -0,0 +1,44 @@
+import { createServer } from 'node:http';
+import type { AddressInfo } from 'node:net';
+import { denyList } from '@bugpatrol/contract';
+import { chromium } from 'playwright';
+import { expect, it } from 'vitest';
+import { guardBrowser, WriteLog } from './readonly.js';
+
+it('checks a deny glob again after a 307 redirect', { timeout: 30_000 }, async () => {
+ const seen: string[] = [];
+ const server = createServer((request, response) => {
+ seen.push(`${request.method} ${request.url}`);
+ if (request.url === '/start') {
+ response.writeHead(307, { location: '/billing/checkout' });
+ response.end();
+ } else {
+ response.setHeader('content-type', 'text/html');
+ response.end('<title>App</title>');
+ }
+ });
+ await new Promise<void>((done) => server.listen(0, '127.0.0.1', done));
+ const origin = `http://127.0.0.1:${(server.address() as AddressInfo).port}`;
+ const browser = await chromium.launch({ headless: true, executablePath: process.env.REVIEW_CHROMIUM });
+ try {
+ const context = await browser.newContext();
+ const log = new WriteLog();
+ await guardBrowser(context, {
+ log,
+ allowWrites: true,
+ websockets: 'pass',
+ dropFrames: [],
+ deny: denyList(['POST /billing/**']),
+ });
+ const page = await context.newPage();
+ await page.goto(origin);
+ await page.evaluate(() => fetch('/start', { method: 'POST', body: 'checkout' }).catch(() => undefined));
+ expect(seen).toContain('POST /start');
+ expect(seen).not.toContain('POST /billing/checkout');
+ expect(log.drain()).toEqual([expect.stringContaining('app.connect.deny has POST /billing/**')]);
+ } finally {
+ await browser.close();
+ server.closeAllConnections();
+ await new Promise<void>((done) => server.close(() => done()));
+ }
+});Change: Enforce the deny policy on every redirect hop and log a matching destination before aborting it.
Fix it and push, or reply with why it doesn't apply. Then resolve this thread.
There was a problem hiding this comment.
Still holds on 60c2e7d: This remains unfixed: route.continue() follows redirects without running this handler for subsequent hops. With POST /billing/** denied, an allowed POST /start returning a 307 to /billing/checkout sends the payment request to the backend without logging it; this affects the shared web and Electron guard.
Still at: packages/drivers/src/readonly.ts:88.
Shows it: MergeLoop ran pnpm install --frozen-lockfile && pnpm build && npm install --prefix /tmp/bugpatrol-review-browser --no-save --no-package-lock @sparticuz/chromium@153.0.0 && node --input-type=module -e 'import Chromium, { inflate } from "/tmp/bugpatrol-review-browser/node_modules/@sparticuz/chromium/build/index.js"; await Chromium.executablePath(); await inflate("/tmp/bugpatrol-review-browser/node_modules/@sparticuz/chromium/bin/al2023.tar.br");' && LD_LIBRARY_PATH=/tmp/al2023/lib REVIEW_CHROMIUM=/tmp/chromium pnpm vitest run packages/drivers/src/deny-redirect.review.test.ts on 60c2e7d and it failed:
AssertionError: expected [ Array(1) ] to deeply equal [ StringContaining{…}, …(1) ]
- Expected
+ Received
Array [
StringContaining "app.connect.deny has POST /billing/**",
- StringMatching /POST .*\/billing\/checkout at .*: app.connect.deny has POST \/billing\/\*\*$/,
]
❯ packages/drivers/src/deny-redirect.review.test.ts:48:27
46| });
47| expect.soft(seen.filter((line) => line.includes('/billing/'))).t…
48| expect(log.drain()).toEqual([
| ^
49| expect.stringContaining('app.connect.deny has POST /billing/**…
50| expect.stringMatching(/POST .*\/billing\/checkout at .*: app.c…
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯
With the test it wrote, in packages/drivers/src/deny-redirect.review.test.ts
diff --git a/packages/drivers/src/deny-redirect.review.test.ts b/packages/drivers/src/deny-redirect.review.test.ts
new file mode 100644
index 0000000..02a9a40
--- /dev/null
+++ b/packages/drivers/src/deny-redirect.review.test.ts
@@ -0,0 +1,58 @@
+import { createServer } from 'node:http';
+import type { AddressInfo } from 'node:net';
+import { denyList } from '@bugpatrol/contract';
+import { chromium } from 'playwright';
+import { expect, it } from 'vitest';
+import { guardBrowser, WriteLog } from './readonly.js';
+
+it.each(['web', 'electron'] as const)(
+ '%s denies and logs a redirected POST before it reaches billing',
+ async (platform) => {
+ const seen: string[] = [];
+ const server = createServer((request, response) => {
+ seen.push(`${request.method} ${request.url}`);
+ if (request.url === '/start') {
+ response.writeHead(307, { location: '/billing/checkout' });
+ response.end();
+ } else {
+ response.setHeader('content-type', 'text/html');
+ response.end('<title>App</title>');
+ }
+ });
+ await new Promise<void>((done) => server.listen(0, '127.0.0.1', done));
+ const url = `http://127.0.0.1:${(server.address() as AddressInfo).port}`;
+ const browser = await chromium.launch({
+ headless: true,
+ executablePath: process.env.REVIEW_CHROMIUM,
+ args: ['--no-sandbox', '--disable-gpu'],
+ });
+ try {
+ const context = await browser.newContext({ serviceWorkers: 'block' });
+ const page = await context.newPage();
+ // Electron attaches to an already loaded renderer; web installs the guard first.
+ if (platform === 'electron') await page.goto(url);
+ const log = new WriteLog();
+ await guardBrowser(context, {
+ log,
+ allowWrites: true,
+ websockets: 'pass',
+ dropFrames: [],
+ deny: denyList(['POST /billing/**']),
+ });
+ if (platform === 'web') await page.goto(url);
+ await page.evaluate(async () => {
+ await fetch('/billing/direct', { method: 'POST' }).catch(() => undefined);
+ await fetch('/start', { method: 'POST', body: 'payment' }).catch(() => undefined);
+ });
+ expect.soft(seen.filter((line) => line.includes('/billing/'))).toEqual([]);
+ expect(log.drain()).toEqual([
+ expect.stringContaining('app.connect.deny has POST /billing/**'),
+ expect.stringMatching(/POST .*\/billing\/checkout at .*: app.connect.deny has POST \/billing\/\*\*$/),
+ ]);
+ } finally {
+ await browser.close();
+ server.closeAllConnections();
+ await new Promise<void>((done) => server.close(() => done()));
+ }
+ },
+);Change: Enforce the deny policy before dispatching every redirect hop, logging a matching destination before aborting it.
Fix it and push, or reply with why it doesn't apply. Then resolve this thread.
| await context.addInitScript(refuseWorkers); | ||
| const readOnlySockets = options.websockets === 'block' || options.dropFrames.length > 0; | ||
| if (!readOnlySockets && !options.deny) return; | ||
| if (readOnlySockets) { |
There was a problem hiding this comment.
Sent back to the author · f2 · other · 100% sure
Workers can open WebSockets to denied paths
Deny-only options set websockets to pass with no frame filters, so this branch leaves workers enabled. WebSocket routing does not intercept worker sockets: a dedicated worker can open /billing/checkout despite /billing/** being denied, and the backend receives the handshake without a blocked-request log. The shared guard leaves this gap on web and Electron.
Shows it: MergeLoop ran pnpm install --frozen-lockfile && pnpm build && npm install --prefix /tmp/bugpatrol-review-browser --no-save --no-package-lock @sparticuz/chromium@153.0.0 && node --input-type=module -e 'import Chromium, { inflate } from "/tmp/bugpatrol-review-browser/node_modules/@sparticuz/chromium/build/index.js"; await Chromium.executablePath(); await inflate("/tmp/bugpatrol-review-browser/node_modules/@sparticuz/chromium/bin/al2023.tar.br");' && LD_LIBRARY_PATH=/tmp/al2023/lib REVIEW_CHROMIUM=/tmp/chromium pnpm vitest run packages/drivers/src/deny-worker-websocket.review.test.ts on 0224bea and it failed:
AssertionError: expected [ '/billing/checkout' ] to deeply equal []
- Expected
+ Received
- Array []
+ Array [
+ "/billing/checkout",
+ ]
❯ packages/drivers/src/deny-worker-websocket.review.test.ts:51:22
49| `${origin.replace('http:', 'ws:')}/billing/checkout`,
50| );
51| expect(upgrades).toEqual([]);
| ^
52| expect(log.count).toBeGreaterThan(0);
53| } finally {
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
With the test it wrote, in packages/drivers/src/deny-worker-websocket.review.test.ts
diff --git a/packages/drivers/src/deny-worker-websocket.review.test.ts b/packages/drivers/src/deny-worker-websocket.review.test.ts
new file mode 100644
index 0000000..3b3862e
--- /dev/null
+++ b/packages/drivers/src/deny-worker-websocket.review.test.ts
@@ -0,0 +1,58 @@
+import { createServer } from 'node:http';
+import type { AddressInfo } from 'node:net';
+import { denyList } from '@bugpatrol/contract';
+import { chromium } from 'playwright';
+import { expect, it } from 'vitest';
+import { guardBrowser, WriteLog } from './readonly.js';
+
+it('holds back a denied WebSocket opened by a dedicated worker', { timeout: 30_000 }, async () => {
+ const upgrades: string[] = [];
+ const server = createServer((_request, response) => {
+ response.setHeader('content-type', 'text/html');
+ response.end('<title>Worker app</title>');
+ });
+ server.on('upgrade', (request, socket) => {
+ upgrades.push(request.url!);
+ socket.end('HTTP/1.1 403 Forbidden\r\nConnection: close\r\nContent-Length: 0\r\n\r\n');
+ });
+ await new Promise<void>((done) => server.listen(0, '127.0.0.1', done));
+ const origin = `http://127.0.0.1:${(server.address() as AddressInfo).port}`;
+ const browser = await chromium.launch({ headless: true, executablePath: process.env.REVIEW_CHROMIUM });
+ try {
+ const context = await browser.newContext({ serviceWorkers: 'block' });
+ const log = new WriteLog();
+ await guardBrowser(context, {
+ log,
+ allowWrites: true,
+ websockets: 'pass',
+ dropFrames: [],
+ deny: denyList(['/billing/**']),
+ });
+ const page = await context.newPage();
+ await page.goto(origin);
+ await page.evaluate(
+ async (url) => {
+ const source = `const socket = new WebSocket(${JSON.stringify(url)});
+ socket.onopen = socket.onerror = socket.onclose = () => postMessage('finished');`;
+ await new Promise<void>((done) => {
+ try {
+ const worker = new Worker(URL.createObjectURL(new Blob([source], { type: 'text/javascript' })));
+ worker.onmessage = () => {
+ worker.terminate();
+ done();
+ };
+ } catch {
+ done();
+ }
+ });
+ },
+ `${origin.replace('http:', 'ws:')}/billing/checkout`,
+ );
+ expect(upgrades).toEqual([]);
+ expect(log.count).toBeGreaterThan(0);
+ } finally {
+ await browser.close();
+ server.closeAllConnections();
+ await new Promise<void>((done) => server.close(() => done()));
+ }
+});Change: Apply the deny policy to worker WebSockets, or prevent workers from bypassing it while reporting the restriction.
Fix it and push, or reply with why it doesn't apply. Then resolve this thread.
There was a problem hiding this comment.
Still holds on 60c2e7d: This remains unfixed: worker prevention is installed only for read-only WebSocket rules, while deny-only mode permits workers. Playwright WebSocket routing does not cover their sockets, so both dedicated and shared workers reach /billing/checkout despite GET /billing/** being denied, without recording a blocked request.
Still at: packages/drivers/src/readonly.ts:94.
Shows it: MergeLoop ran pnpm install --frozen-lockfile && pnpm build && npm install --prefix /tmp/bugpatrol-review-browser --no-save --no-package-lock @sparticuz/chromium@153.0.0 && node --input-type=module -e 'import Chromium, { inflate } from "/tmp/bugpatrol-review-browser/node_modules/@sparticuz/chromium/build/index.js"; await Chromium.executablePath(); await inflate("/tmp/bugpatrol-review-browser/node_modules/@sparticuz/chromium/bin/al2023.tar.br");' && LD_LIBRARY_PATH=/tmp/al2023/lib REVIEW_CHROMIUM=/tmp/chromium pnpm vitest run packages/drivers/src/deny-worker-websocket.review.test.ts on 60c2e7d and it failed:
66| }, kind);
67| expect.soft(upgrades).toEqual([]);
| ^
68| expect(log.count).toBeGreaterThan(0);
69| } finally {
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯
FAIL packages/drivers/src/deny-worker-websocket.review.test.ts > SharedWorker cannot open a denied WebSocket without a blocked log
AssertionError: expected 0 to be greater than 0
❯ packages/drivers/src/deny-worker-websocket.review.test.ts:68:25
66| }, kind);
67| expect.soft(upgrades).toEqual([]);
68| expect(log.count).toBeGreaterThan(0);
| ^
69| } finally {
70| await browser.close();
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯
With the test it wrote, in packages/drivers/src/deny-worker-websocket.review.test.ts
diff --git a/packages/drivers/src/deny-worker-websocket.review.test.ts b/packages/drivers/src/deny-worker-websocket.review.test.ts
new file mode 100644
index 0000000..61317a7
--- /dev/null
+++ b/packages/drivers/src/deny-worker-websocket.review.test.ts
@@ -0,0 +1,75 @@
+import { createServer } from 'node:http';
+import type { AddressInfo } from 'node:net';
+import { denyList } from '@bugpatrol/contract';
+import { chromium } from 'playwright';
+import { expect, it } from 'vitest';
+import { guardBrowser, WriteLog } from './readonly.js';
+
+it.each(['Worker', 'SharedWorker'] as const)(
+ '%s cannot open a denied WebSocket without a blocked log',
+ async (kind) => {
+ const upgrades: string[] = [];
+ const server = createServer((_request, response) => {
+ response.setHeader('content-type', 'text/html');
+ response.end('<title>App</title>');
+ });
+ server.on('upgrade', (request, socket) => {
+ upgrades.push(request.url ?? '');
+ socket.destroy();
+ });
+ await new Promise<void>((done) => server.listen(0, '127.0.0.1', done));
+ const url = `http://127.0.0.1:${(server.address() as AddressInfo).port}`;
+ const browser = await chromium.launch({
+ headless: true,
+ executablePath: process.env.REVIEW_CHROMIUM,
+ args: ['--no-sandbox', '--disable-gpu'],
+ });
+ try {
+ const context = await browser.newContext({ serviceWorkers: 'block' });
+ const log = new WriteLog();
+ await guardBrowser(context, {
+ log,
+ allowWrites: true,
+ websockets: 'pass',
+ dropFrames: [],
+ deny: denyList(['GET /billing/**']),
+ });
+ const page = await context.newPage();
+ await page.goto(url);
+ await page.evaluate(async (workerKind) => {
+ const ws = `ws://${location.host}/billing/checkout`;
+ const action = `const socket = new WebSocket(${JSON.stringify(ws)}); socket.onerror = () => port.postMessage('closed');`;
+ const source =
+ workerKind === 'Worker'
+ ? `const port = self; ${action}`
+ : `onconnect = (event) => { const port = event.ports[0]; ${action} };`;
+ const blob = URL.createObjectURL(new Blob([source], { type: 'text/javascript' }));
+ try {
+ if (workerKind === 'Worker') {
+ const worker = new Worker(blob);
+ await new Promise<void>((done) => {
+ worker.onmessage = () => done();
+ });
+ worker.terminate();
+ } else {
+ const worker = new SharedWorker(blob);
+ await new Promise<void>((done) => {
+ worker.port.onmessage = () => done();
+ });
+ worker.port.close();
+ }
+ } catch (error) {
+ if (!(error instanceof DOMException) || error.name !== 'SecurityError') throw error;
+ } finally {
+ URL.revokeObjectURL(blob);
+ }
+ }, kind);
+ expect.soft(upgrades).toEqual([]);
+ expect(log.count).toBeGreaterThan(0);
+ } finally {
+ await browser.close();
+ server.closeAllConnections();
+ await new Promise<void>((done) => server.close(() => done()));
+ }
+ },
+);Change: Apply the deny policy to worker WebSockets, or prevent workers from bypassing it while logging the restriction.
Fix it and push, or reply with why it doesn't apply. Then resolve this thread.
app.connect.deny applied only to the API request policy, so a web or Electron review could start a payment that the app guide forbids, and app.readOnly blocks every write an app needs. The same globs now reach the web and Electron drivers, which abort a matching request and log it as blocked for the explorer while every other write goes out, and the read-only proxies of CLI, desktop and mobile apps, which answer it with a 403. One matcher, denyList, serves the policy, drivers and proxies. Closes #214 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Resolved-by: mergeloop, claude (claude-opus-5-5) Co-authored-by: Cillian Berragan <cillian@nebula.gg>
A server that splits the path before decoding reads /billing/session/a%2Fb as one segment, so POST /billing/session/* must deny it. denyList now tests both the encoded and the decoded path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cillian Berragan <cillian@nebula.gg>
…ig load - A WebSocket handshake that a deny glob matches is refused, in the browser guard and in the read-only proxy, and logged with its glob. - A deny-only run gets one blocked-request log, so app.stop() reports it and a driver recreated for review or retest keeps the same log. - denyRule moves to core, so the config rejects a glob of another shape, or with an empty segment, at load instead of after setup ran. - Docs: what an Electron driver does not see, the API path's reporting, and that a proxy's deny list adds to read-only mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cillian Berragan <cillian@nebula.gg>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cillian Berragan <cillian@nebula.gg>
0224bea to
60c2e7d
Compare
There was a problem hiding this comment.
MergeLoop's review
The PR extends deny rules across drivers and proxies with shared matching and reporting. All five required checks and 56 existing focused tests pass, but both previously reported browser bypasses remain reproducible.
It sent 2 back to the author, each in a thread on its line. For each, fix it and push, or reply with why it doesn't apply, then resolve the thread. To have the agent look again before you push, reply in the thread with @merge-loop and why. Once every thread is resolved, the PR goes on to the merge queue with no human approval.
What it cleared
- Config validation and request matching share the deny rules (100%)
- Proxy denials and shared logs preserve blocked-request reporting (100%)
- All required verification checks pass (100%)
Why
A web or Electron review could start a payment the app guide forbids: in a Nebula Desktop review the explorer clicked the Billing page's top-up preset, which starts a Stripe checkout. The guide's never-do list is prose for the model,
app.readOnlyblocks every write the app needs, andapp.connect.denyonly reached the API request policy.Scope
denyRule(glob)in@bugpatrol/coreparses one[METHOD] /pathglob; the config schema uses it, so a glob of another shape or with an empty segment (POST //billing/**) is rejected at load, before setup runs.denyList(globs)in@bugpatrol/contracttests a request against the globs and names the matching one. It tests both the encoded and the decoded path, soa%2Fbcannot slip past a single-segment*.requestPolicyuses it, so there is one matcher.guardBrowseraborts a request whose method and path match a deny glob (on any host), refuses a WebSocket whose handshake matches (as aGET), and logs both with the glob; every other request, writes included, goes out unlessapp.readOnlyis on. A web context blocks service workers whenever the guard is on, as read-only mode already did.connect.denyon those platforms withoutapp.readOnly.proxy, since Bugpatrol cannot see their requests otherwise.readOnlyOptions(app)builds the options for both drivers and proxies.startAppcreates one blocked-request log for a read-only or a deny-only run, so the run summary reports it and a driver recreated for review or retest keeps it.POST <url> at <time>: app.connect.deny has POST /billing/**; the explorer's tool output, thewrite-blockedevent and the session summary (Bugpatrol blocked N request(s).) cover both read-only and deny blocks.docs/configuration.md, schema comment, full-file example.Electron
launch/cdpdiffs are kept offelectron.tsentirely and to one comment line inweb.ts, since #213 edits those files.Verification
vitest runon policy, readonly, factory, load, lifecycle, read-only, native-readonly-events and readonly-routine-events tests: 53 passed.tsc --build, biome on changed files, knip: clean. CI green on 6caabcf.Reviews
Codex (gpt-reserve, xhigh) and Muse reviewed
origin/main...HEADblind, then exchanged exclusive findings once.//typos never matched (Muse; Codex confirmed fixed); docs overstated API reporting (Codex; Muse confirmed); codex-connector: encoded path before decoding.Risks
Closes #214
🤖 Generated with Claude Code