feat(04-05): A34 host-side + orchestrator — fetch+XHR network_error empirical (ROADMAP SC #2 GREEN)

- Append driveA34 host-side: JSZip-parse logs/events.json + filter
  network_error entries by '404-fetch-a34' / '404-xhr-a34' target
  marker; assert >=1 of each + meta.status === 404
- readMetaStatus helper narrows UserEvent.meta.status (typed
  Record<string,unknown>) to number without an unchecked any cast
- 3-site orchestrator wiring in harness.test.ts: import binding,
  driveA34Wrapped (downloadsDir closure), drivers-array push entry
- UAT harness 34 -> 35; skip-mode (SKIP_LONG_UAT=1) 35/35 GREEN
- A34 empirical: fetch entry target carries the real URL
  (https://example.com/404-fetch-a34-<stamp>), NOT '[object Request]'
  — Plan 04-01 P1 #11 fix validated end-to-end at the SAVE->archive
  layer; XHR entry confirms the distinct prototype-wrapper path;
  both meta.status === 404 (ROADMAP SC #2 closed)
- vitest baseline 184/184 GREEN preserved (no unit tests this plan)
- FORBIDDEN_HOOK_STRINGS unchanged at 12

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 12:26:14 +02:00
parent a20372a8b8
commit 0712c245a1
2 changed files with 218 additions and 0 deletions

View File

@@ -109,6 +109,9 @@ import {
// reframe per debug session-2 verdict; needs Browser + extensionId for
// CDP-based SW kill + downloadsDir for host-side JSZip parse).
driveA33,
// Plan 04-05 — driveA34 fetch + XHR network_error empirical (ROADMAP SC #2;
// needs downloadsDir for host-side JSZip parse of logs/events.json).
driveA34,
getManifestVersion,
} from './lib/harness-page-driver';
import {
@@ -363,6 +366,10 @@ async function main(): Promise<number> {
// AND downloadsDir for host-side JSZip parse of post-restart zip.
const driveA33Wrapped: (page: import('puppeteer').Page) => Promise<AssertionRecord> =
(page) => driveA33(page, handles.browser, handles.extensionId, handles.downloadsDir);
// Plan 04-05 — driveA34 needs downloadsDir for host-side JSZip parse of
// logs/events.json (fetch + XHR network_error entry inspection).
const driveA34Wrapped: (page: import('puppeteer').Page) => Promise<AssertionRecord> =
(page) => driveA34(page, handles.downloadsDir);
const drivers: ReadonlyArray<{
readonly name: string;
@@ -514,6 +521,17 @@ async function main(): Promise<number> {
})
: driveA33Wrapped,
},
// Plan 04-05 A34: fetch + XHR network_error empirical (ROADMAP SC #2).
// Verifies both protocol paths in src/content/index.ts setupNetworkLogging
// produce events.json entries. Empirically validates Plan 04-01 P1 #11
// fetch URL extraction fix at the SAVE->archive layer (A34.4 + A34.5).
// A34 owns its SAVE because event-log cleanup runs every 60s
// (src/content/index.ts CLEANUP_INTERVAL_MS) and the 2 synthetic
// failing requests need a fresh event-log window. Opens a fresh
// https://example.com probe tab + injects fetch(404)+XHR(404) via
// chrome.scripting.executeScript ISOLATED-world. Runs ~25s (always
// RUN — not env-gated; the 5-min wait is A33's, not A34's).
{ name: 'A34', drive: driveA34Wrapped },
];
const buffers = { swConsole: handles.swConsole, offConsole: handles.offConsole };