fix(browser): preserve form destinations and satisfies mutation uncertainty (#825)

Resolve empty form destinations from the captured document URL while preserving
base-relative links and Chrome's form/control whitespace distinction. Follow
satisfies wrappers when propagating explicit member mutation paths.

Add fail-before regressions and real-browser CLI/MCP verification.

Fixes #820

Assisted-by: Yukari (gensokyo-skills:yukari-boundary-analysis)
Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
This commit is contained in:
N0zoM1z0
2026-10-07 11:22:03 +08:00
committed by GitHub
parent 3ed59b2812
commit 6dd719eaf6
11 changed files with 272 additions and 4 deletions
@@ -87,6 +87,7 @@ function assertObservationPrivacy(result) {
}
function assertObservationMetadata(result, origin) {
assertFormDestinations(result);
if (
!result.metadata.dom_urls.some(
({ attribute, url }) =>
@@ -121,6 +122,23 @@ function assertObservationMetadata(result, origin) {
throw new Error("Real Chrome safe response metadata was missing");
}
/** Assert the fixture's empty form destinations retain the current document URL. */
export function assertFormDestinations(
result,
documentUrl = result.target.url,
) {
const destinations = result.metadata.dom_urls.filter(
({ attribute }) => attribute === "action" || attribute === "formaction",
);
if (
destinations.length !== 4 ||
destinations.some(({ url }) => url !== documentUrl)
)
throw new Error(
`Real Chrome form destinations did not use the current document URL: ${JSON.stringify({ expected: documentUrl, target: result.target.url, destinations })}`,
);
}
/** Assert real-browser static bundle and source-map findings. */
export function assertBundleAnalysis(result) {
if (