@riddledc/riddle-proof 0.7.105 → 0.7.107
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 +2 -0
- package/dist/{chunk-VO5U4I7F.js → chunk-BZ3XERXC.js} +23 -7
- package/dist/cli.cjs +23 -7
- package/dist/cli.js +1 -1
- package/dist/index.cjs +23 -7
- package/dist/index.js +1 -1
- package/dist/profile.cjs +23 -7
- package/dist/profile.js +1 -1
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -309,6 +309,8 @@ proof state must expose a terminal flag. `assert_selector_count` accepts
|
|
|
309
309
|
`expected_count`; `assert_text_visible` and `assert_text_absent` prefer rendered
|
|
310
310
|
selector text (`innerText`) so casing from CSS `text-transform` matches
|
|
311
311
|
`selector_text_visible`, with a `textContent` fallback for non-HTML elements.
|
|
312
|
+
Literal setup text matching also checks a whitespace-normalized form, so visible
|
|
313
|
+
phrases split across rendered line breaks can still satisfy the assertion.
|
|
312
314
|
`assert_window_value` accepts `path` / `state_path` plus
|
|
313
315
|
`expected_value` / `expected` and compares JSON-safe values exactly.
|
|
314
316
|
`assert_window_number` accepts `path` / `state_path` plus `expected_value`,
|
|
@@ -1556,13 +1556,16 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
1556
1556
|
const results = viewports.map((viewport) => {
|
|
1557
1557
|
const texts = textSequenceForCheck(viewport, check);
|
|
1558
1558
|
const matches = texts.filter((text) => matchText(text, check));
|
|
1559
|
+
const matched = matches.length > 0;
|
|
1560
|
+
const failedAgainstExpectation = matched !== expectedVisible;
|
|
1561
|
+
const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
|
|
1559
1562
|
return {
|
|
1560
1563
|
viewport: viewport.name,
|
|
1561
1564
|
selector_count: viewport.selectors?.[key]?.count || 0,
|
|
1562
1565
|
visible_count: viewport.selectors?.[key]?.visible_count || 0,
|
|
1563
1566
|
matched_count: matches.length,
|
|
1564
|
-
matched
|
|
1565
|
-
samples:
|
|
1567
|
+
matched,
|
|
1568
|
+
samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240))
|
|
1566
1569
|
};
|
|
1567
1570
|
});
|
|
1568
1571
|
const failed = results.filter((result) => result.matched !== expectedVisible).length;
|
|
@@ -3136,13 +3139,16 @@ function assessProfile(profile, evidence) {
|
|
|
3136
3139
|
const results = checkViewports.map((viewport) => {
|
|
3137
3140
|
const texts = textSequenceForCheck(viewport, check);
|
|
3138
3141
|
const matches = texts.filter((text) => textMatches(text, check));
|
|
3142
|
+
const matched = matches.length > 0;
|
|
3143
|
+
const failedAgainstExpectation = matched !== expectedVisible;
|
|
3144
|
+
const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
|
|
3139
3145
|
return {
|
|
3140
3146
|
viewport: viewport.name,
|
|
3141
3147
|
selector_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].count : 0,
|
|
3142
3148
|
visible_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].visible_count : 0,
|
|
3143
3149
|
matched_count: matches.length,
|
|
3144
|
-
matched
|
|
3145
|
-
samples:
|
|
3150
|
+
matched,
|
|
3151
|
+
samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240)),
|
|
3146
3152
|
};
|
|
3147
3153
|
});
|
|
3148
3154
|
const failed = results.filter((result) => result.matched !== expectedVisible).length;
|
|
@@ -3583,11 +3589,21 @@ function setupFiniteNumber(value) {
|
|
|
3583
3589
|
const number = Number(value);
|
|
3584
3590
|
return Number.isFinite(number) ? number : undefined;
|
|
3585
3591
|
}
|
|
3592
|
+
function normalizeSetupMatchText(value) {
|
|
3593
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
3594
|
+
}
|
|
3586
3595
|
function setupTextMatches(sample, action) {
|
|
3596
|
+
const rawSample = String(sample || "");
|
|
3587
3597
|
if (action.pattern) {
|
|
3588
|
-
try {
|
|
3589
|
-
|
|
3590
|
-
|
|
3598
|
+
try {
|
|
3599
|
+
const rawPattern = new RegExp(action.pattern, action.flags || "");
|
|
3600
|
+
if (rawPattern.test(rawSample)) return true;
|
|
3601
|
+
return new RegExp(action.pattern, action.flags || "").test(normalizeSetupMatchText(rawSample));
|
|
3602
|
+
} catch { return false; }
|
|
3603
|
+
}
|
|
3604
|
+
const expected = String(action.text || "");
|
|
3605
|
+
return rawSample.includes(expected)
|
|
3606
|
+
|| normalizeSetupMatchText(rawSample).includes(normalizeSetupMatchText(expected));
|
|
3591
3607
|
}
|
|
3592
3608
|
async function waitForAnyVisibleSelector(context, selector, timeout) {
|
|
3593
3609
|
const deadline = Date.now() + setupNumber(timeout, 15000);
|
package/dist/cli.cjs
CHANGED
|
@@ -8449,13 +8449,16 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
8449
8449
|
const results = viewports.map((viewport) => {
|
|
8450
8450
|
const texts = textSequenceForCheck(viewport, check);
|
|
8451
8451
|
const matches = texts.filter((text) => matchText(text, check));
|
|
8452
|
+
const matched = matches.length > 0;
|
|
8453
|
+
const failedAgainstExpectation = matched !== expectedVisible;
|
|
8454
|
+
const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
|
|
8452
8455
|
return {
|
|
8453
8456
|
viewport: viewport.name,
|
|
8454
8457
|
selector_count: viewport.selectors?.[key]?.count || 0,
|
|
8455
8458
|
visible_count: viewport.selectors?.[key]?.visible_count || 0,
|
|
8456
8459
|
matched_count: matches.length,
|
|
8457
|
-
matched
|
|
8458
|
-
samples:
|
|
8460
|
+
matched,
|
|
8461
|
+
samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240))
|
|
8459
8462
|
};
|
|
8460
8463
|
});
|
|
8461
8464
|
const failed = results.filter((result) => result.matched !== expectedVisible).length;
|
|
@@ -10013,13 +10016,16 @@ function assessProfile(profile, evidence) {
|
|
|
10013
10016
|
const results = checkViewports.map((viewport) => {
|
|
10014
10017
|
const texts = textSequenceForCheck(viewport, check);
|
|
10015
10018
|
const matches = texts.filter((text) => textMatches(text, check));
|
|
10019
|
+
const matched = matches.length > 0;
|
|
10020
|
+
const failedAgainstExpectation = matched !== expectedVisible;
|
|
10021
|
+
const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
|
|
10016
10022
|
return {
|
|
10017
10023
|
viewport: viewport.name,
|
|
10018
10024
|
selector_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].count : 0,
|
|
10019
10025
|
visible_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].visible_count : 0,
|
|
10020
10026
|
matched_count: matches.length,
|
|
10021
|
-
matched
|
|
10022
|
-
samples:
|
|
10027
|
+
matched,
|
|
10028
|
+
samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240)),
|
|
10023
10029
|
};
|
|
10024
10030
|
});
|
|
10025
10031
|
const failed = results.filter((result) => result.matched !== expectedVisible).length;
|
|
@@ -10460,11 +10466,21 @@ function setupFiniteNumber(value) {
|
|
|
10460
10466
|
const number = Number(value);
|
|
10461
10467
|
return Number.isFinite(number) ? number : undefined;
|
|
10462
10468
|
}
|
|
10469
|
+
function normalizeSetupMatchText(value) {
|
|
10470
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
10471
|
+
}
|
|
10463
10472
|
function setupTextMatches(sample, action) {
|
|
10473
|
+
const rawSample = String(sample || "");
|
|
10464
10474
|
if (action.pattern) {
|
|
10465
|
-
try {
|
|
10466
|
-
|
|
10467
|
-
|
|
10475
|
+
try {
|
|
10476
|
+
const rawPattern = new RegExp(action.pattern, action.flags || "");
|
|
10477
|
+
if (rawPattern.test(rawSample)) return true;
|
|
10478
|
+
return new RegExp(action.pattern, action.flags || "").test(normalizeSetupMatchText(rawSample));
|
|
10479
|
+
} catch { return false; }
|
|
10480
|
+
}
|
|
10481
|
+
const expected = String(action.text || "");
|
|
10482
|
+
return rawSample.includes(expected)
|
|
10483
|
+
|| normalizeSetupMatchText(rawSample).includes(normalizeSetupMatchText(expected));
|
|
10468
10484
|
}
|
|
10469
10485
|
async function waitForAnyVisibleSelector(context, selector, timeout) {
|
|
10470
10486
|
const deadline = Date.now() + setupNumber(timeout, 15000);
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -10285,13 +10285,16 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
10285
10285
|
const results = viewports.map((viewport) => {
|
|
10286
10286
|
const texts = textSequenceForCheck(viewport, check);
|
|
10287
10287
|
const matches = texts.filter((text) => matchText(text, check));
|
|
10288
|
+
const matched = matches.length > 0;
|
|
10289
|
+
const failedAgainstExpectation = matched !== expectedVisible;
|
|
10290
|
+
const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
|
|
10288
10291
|
return {
|
|
10289
10292
|
viewport: viewport.name,
|
|
10290
10293
|
selector_count: viewport.selectors?.[key]?.count || 0,
|
|
10291
10294
|
visible_count: viewport.selectors?.[key]?.visible_count || 0,
|
|
10292
10295
|
matched_count: matches.length,
|
|
10293
|
-
matched
|
|
10294
|
-
samples:
|
|
10296
|
+
matched,
|
|
10297
|
+
samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240))
|
|
10295
10298
|
};
|
|
10296
10299
|
});
|
|
10297
10300
|
const failed = results.filter((result) => result.matched !== expectedVisible).length;
|
|
@@ -11865,13 +11868,16 @@ function assessProfile(profile, evidence) {
|
|
|
11865
11868
|
const results = checkViewports.map((viewport) => {
|
|
11866
11869
|
const texts = textSequenceForCheck(viewport, check);
|
|
11867
11870
|
const matches = texts.filter((text) => textMatches(text, check));
|
|
11871
|
+
const matched = matches.length > 0;
|
|
11872
|
+
const failedAgainstExpectation = matched !== expectedVisible;
|
|
11873
|
+
const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
|
|
11868
11874
|
return {
|
|
11869
11875
|
viewport: viewport.name,
|
|
11870
11876
|
selector_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].count : 0,
|
|
11871
11877
|
visible_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].visible_count : 0,
|
|
11872
11878
|
matched_count: matches.length,
|
|
11873
|
-
matched
|
|
11874
|
-
samples:
|
|
11879
|
+
matched,
|
|
11880
|
+
samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240)),
|
|
11875
11881
|
};
|
|
11876
11882
|
});
|
|
11877
11883
|
const failed = results.filter((result) => result.matched !== expectedVisible).length;
|
|
@@ -12312,11 +12318,21 @@ function setupFiniteNumber(value) {
|
|
|
12312
12318
|
const number = Number(value);
|
|
12313
12319
|
return Number.isFinite(number) ? number : undefined;
|
|
12314
12320
|
}
|
|
12321
|
+
function normalizeSetupMatchText(value) {
|
|
12322
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
12323
|
+
}
|
|
12315
12324
|
function setupTextMatches(sample, action) {
|
|
12325
|
+
const rawSample = String(sample || "");
|
|
12316
12326
|
if (action.pattern) {
|
|
12317
|
-
try {
|
|
12318
|
-
|
|
12319
|
-
|
|
12327
|
+
try {
|
|
12328
|
+
const rawPattern = new RegExp(action.pattern, action.flags || "");
|
|
12329
|
+
if (rawPattern.test(rawSample)) return true;
|
|
12330
|
+
return new RegExp(action.pattern, action.flags || "").test(normalizeSetupMatchText(rawSample));
|
|
12331
|
+
} catch { return false; }
|
|
12332
|
+
}
|
|
12333
|
+
const expected = String(action.text || "");
|
|
12334
|
+
return rawSample.includes(expected)
|
|
12335
|
+
|| normalizeSetupMatchText(rawSample).includes(normalizeSetupMatchText(expected));
|
|
12320
12336
|
}
|
|
12321
12337
|
async function waitForAnyVisibleSelector(context, selector, timeout) {
|
|
12322
12338
|
const deadline = Date.now() + setupNumber(timeout, 15000);
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
resolveRiddleProofProfileTimeoutSec,
|
|
59
59
|
slugifyRiddleProofProfileName,
|
|
60
60
|
summarizeRiddleProofProfileResult
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-BZ3XERXC.js";
|
|
62
62
|
import {
|
|
63
63
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
64
64
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -1599,13 +1599,16 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
1599
1599
|
const results = viewports.map((viewport) => {
|
|
1600
1600
|
const texts = textSequenceForCheck(viewport, check);
|
|
1601
1601
|
const matches = texts.filter((text) => matchText(text, check));
|
|
1602
|
+
const matched = matches.length > 0;
|
|
1603
|
+
const failedAgainstExpectation = matched !== expectedVisible;
|
|
1604
|
+
const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
|
|
1602
1605
|
return {
|
|
1603
1606
|
viewport: viewport.name,
|
|
1604
1607
|
selector_count: viewport.selectors?.[key]?.count || 0,
|
|
1605
1608
|
visible_count: viewport.selectors?.[key]?.visible_count || 0,
|
|
1606
1609
|
matched_count: matches.length,
|
|
1607
|
-
matched
|
|
1608
|
-
samples:
|
|
1610
|
+
matched,
|
|
1611
|
+
samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240))
|
|
1609
1612
|
};
|
|
1610
1613
|
});
|
|
1611
1614
|
const failed = results.filter((result) => result.matched !== expectedVisible).length;
|
|
@@ -3179,13 +3182,16 @@ function assessProfile(profile, evidence) {
|
|
|
3179
3182
|
const results = checkViewports.map((viewport) => {
|
|
3180
3183
|
const texts = textSequenceForCheck(viewport, check);
|
|
3181
3184
|
const matches = texts.filter((text) => textMatches(text, check));
|
|
3185
|
+
const matched = matches.length > 0;
|
|
3186
|
+
const failedAgainstExpectation = matched !== expectedVisible;
|
|
3187
|
+
const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
|
|
3182
3188
|
return {
|
|
3183
3189
|
viewport: viewport.name,
|
|
3184
3190
|
selector_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].count : 0,
|
|
3185
3191
|
visible_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].visible_count : 0,
|
|
3186
3192
|
matched_count: matches.length,
|
|
3187
|
-
matched
|
|
3188
|
-
samples:
|
|
3193
|
+
matched,
|
|
3194
|
+
samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240)),
|
|
3189
3195
|
};
|
|
3190
3196
|
});
|
|
3191
3197
|
const failed = results.filter((result) => result.matched !== expectedVisible).length;
|
|
@@ -3626,11 +3632,21 @@ function setupFiniteNumber(value) {
|
|
|
3626
3632
|
const number = Number(value);
|
|
3627
3633
|
return Number.isFinite(number) ? number : undefined;
|
|
3628
3634
|
}
|
|
3635
|
+
function normalizeSetupMatchText(value) {
|
|
3636
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
3637
|
+
}
|
|
3629
3638
|
function setupTextMatches(sample, action) {
|
|
3639
|
+
const rawSample = String(sample || "");
|
|
3630
3640
|
if (action.pattern) {
|
|
3631
|
-
try {
|
|
3632
|
-
|
|
3633
|
-
|
|
3641
|
+
try {
|
|
3642
|
+
const rawPattern = new RegExp(action.pattern, action.flags || "");
|
|
3643
|
+
if (rawPattern.test(rawSample)) return true;
|
|
3644
|
+
return new RegExp(action.pattern, action.flags || "").test(normalizeSetupMatchText(rawSample));
|
|
3645
|
+
} catch { return false; }
|
|
3646
|
+
}
|
|
3647
|
+
const expected = String(action.text || "");
|
|
3648
|
+
return rawSample.includes(expected)
|
|
3649
|
+
|| normalizeSetupMatchText(rawSample).includes(normalizeSetupMatchText(expected));
|
|
3634
3650
|
}
|
|
3635
3651
|
async function waitForAnyVisibleSelector(context, selector, timeout) {
|
|
3636
3652
|
const deadline = Date.now() + setupNumber(timeout, 15000);
|
package/dist/profile.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveRiddleProofProfileTimeoutSec,
|
|
20
20
|
slugifyRiddleProofProfileName,
|
|
21
21
|
summarizeRiddleProofProfileResult
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BZ3XERXC.js";
|
|
23
23
|
export {
|
|
24
24
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
25
25
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|