@riddledc/riddle-proof 0.7.3 → 0.7.5
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/dist/{chunk-3266V3MO.js → chunk-EXF7V6TJ.js} +3 -3
- package/dist/{chunk-3ICNKAWF.js → chunk-F7BNWDF6.js} +14 -0
- package/dist/cli.cjs +17 -3
- package/dist/cli.js +2 -2
- package/dist/codex-exec-agent.cjs +3 -3
- package/dist/codex-exec-agent.js +1 -1
- package/dist/engine-harness.cjs +14 -0
- package/dist/engine-harness.js +1 -1
- package/dist/index.cjs +17 -3
- package/dist/index.js +2 -2
- package/dist/local-agent.cjs +3 -3
- package/dist/local-agent.js +1 -1
- package/package.json +1 -1
- package/runtime/lib/author.py +3 -3
- package/runtime/lib/verify.py +7 -8
- package/runtime/tests/recon_verify_smoke.py +7 -6
|
@@ -608,12 +608,12 @@ function createCodexExecAgentAdapter(config = {}, runner = createCodexExecJsonRu
|
|
|
608
608
|
"Use the recon-approved route and baseline context; make the plan name the concrete target, expected before state, expected after state, and stop condition.",
|
|
609
609
|
"Choose the evidence modality from verification_mode and success_criteria: screenshots for visual/UI proof, interactions plus screenshots for interaction proof, structured metrics/logs/JSON/audio analysis for non-visual proof.",
|
|
610
610
|
"For playable/gameplay proof, treat screenshots as supporting artifacts only: start the game, send keyboard or pointer input, measure state before/after, measure non-HUD canvas/playfield pixel deltas across time, and return playability evidence with version riddle-proof.playability.v1.",
|
|
611
|
-
"For structured proof, collect meaningful measurements inside page.evaluate
|
|
612
|
-
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence
|
|
611
|
+
"For structured proof, collect meaningful measurements inside page.evaluate, assign them to an evidence variable, and return that object from capture_script. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
|
|
612
|
+
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence in the worker context. Avoid global evidence assignment unless it is inside page.evaluate for compatibility with older packets.",
|
|
613
613
|
"Do not call Playwright page.* APIs inside page.evaluate; page.evaluate runs in the browser page, while page.waitForFunction, page.waitForSelector, page.click, and saveScreenshot belong in the outer capture script.",
|
|
614
614
|
"When page.evaluate needs data from the outer Playwright script, pass exactly one serializable argument object; do not pass multiple positional arguments.",
|
|
615
615
|
"When setting Playwright wait timeouts, use the correct signature: await page.waitForFunction(fn, undefined, { timeout: 60000 }). Do not write page.waitForFunction(fn, { timeout: 60000 }); that passes the object as the page argument and leaves the default timeout in place.",
|
|
616
|
-
"For audio/data/metric proof, return
|
|
616
|
+
"For audio/data/metric proof, return the same evidence object: const evidence = await page.evaluate(async () => ({ /* browser measurements */ })); Then assert evidence fields before saving screenshots and return evidence from capture_script.",
|
|
617
617
|
"If a capture attempt errors or proof_evidence is absent, revise the capture_script to make structured evidence easier to collect; do not only add more screenshots for non-visual proof.",
|
|
618
618
|
"When checking visible copy, normalize text before exact matching: const normalizedText = (document.body?.innerText || '').replace(/\\s+/g, ' ').trim(); Avoid raw innerText.includes(exact sentence) because browser line wrapping can split copy.",
|
|
619
619
|
"Prefer success-oriented evidence booleans such as newCopyVisible: true and oldCopyAbsent: true. If a positive assertion is false while screenshots/text samples look right, fix the capture script instead of leaving contradictory proof evidence.",
|
|
@@ -1081,6 +1081,20 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
1081
1081
|
})
|
|
1082
1082
|
};
|
|
1083
1083
|
}
|
|
1084
|
+
if (checkpoint === "verify_audit_complete") {
|
|
1085
|
+
return {
|
|
1086
|
+
terminal: terminalResult(
|
|
1087
|
+
state,
|
|
1088
|
+
"completed",
|
|
1089
|
+
result,
|
|
1090
|
+
result.summary || "Riddle Proof audit complete.",
|
|
1091
|
+
{
|
|
1092
|
+
audit_complete: true,
|
|
1093
|
+
ship_disabled: true
|
|
1094
|
+
}
|
|
1095
|
+
)
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1084
1098
|
if (input.dry_run || request.dry_run) {
|
|
1085
1099
|
return {
|
|
1086
1100
|
blocker: {
|
package/dist/cli.cjs
CHANGED
|
@@ -5267,6 +5267,20 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5267
5267
|
})
|
|
5268
5268
|
};
|
|
5269
5269
|
}
|
|
5270
|
+
if (checkpoint === "verify_audit_complete") {
|
|
5271
|
+
return {
|
|
5272
|
+
terminal: terminalResult(
|
|
5273
|
+
state,
|
|
5274
|
+
"completed",
|
|
5275
|
+
result,
|
|
5276
|
+
result.summary || "Riddle Proof audit complete.",
|
|
5277
|
+
{
|
|
5278
|
+
audit_complete: true,
|
|
5279
|
+
ship_disabled: true
|
|
5280
|
+
}
|
|
5281
|
+
)
|
|
5282
|
+
};
|
|
5283
|
+
}
|
|
5270
5284
|
if (input.dry_run || request.dry_run) {
|
|
5271
5285
|
return {
|
|
5272
5286
|
blocker: {
|
|
@@ -6294,12 +6308,12 @@ function createCodexExecAgentAdapter(config = {}, runner = createCodexExecJsonRu
|
|
|
6294
6308
|
"Use the recon-approved route and baseline context; make the plan name the concrete target, expected before state, expected after state, and stop condition.",
|
|
6295
6309
|
"Choose the evidence modality from verification_mode and success_criteria: screenshots for visual/UI proof, interactions plus screenshots for interaction proof, structured metrics/logs/JSON/audio analysis for non-visual proof.",
|
|
6296
6310
|
"For playable/gameplay proof, treat screenshots as supporting artifacts only: start the game, send keyboard or pointer input, measure state before/after, measure non-HUD canvas/playfield pixel deltas across time, and return playability evidence with version riddle-proof.playability.v1.",
|
|
6297
|
-
"For structured proof, collect meaningful measurements inside page.evaluate
|
|
6298
|
-
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence
|
|
6311
|
+
"For structured proof, collect meaningful measurements inside page.evaluate, assign them to an evidence variable, and return that object from capture_script. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
|
|
6312
|
+
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence in the worker context. Avoid global evidence assignment unless it is inside page.evaluate for compatibility with older packets.",
|
|
6299
6313
|
"Do not call Playwright page.* APIs inside page.evaluate; page.evaluate runs in the browser page, while page.waitForFunction, page.waitForSelector, page.click, and saveScreenshot belong in the outer capture script.",
|
|
6300
6314
|
"When page.evaluate needs data from the outer Playwright script, pass exactly one serializable argument object; do not pass multiple positional arguments.",
|
|
6301
6315
|
"When setting Playwright wait timeouts, use the correct signature: await page.waitForFunction(fn, undefined, { timeout: 60000 }). Do not write page.waitForFunction(fn, { timeout: 60000 }); that passes the object as the page argument and leaves the default timeout in place.",
|
|
6302
|
-
"For audio/data/metric proof, return
|
|
6316
|
+
"For audio/data/metric proof, return the same evidence object: const evidence = await page.evaluate(async () => ({ /* browser measurements */ })); Then assert evidence fields before saving screenshots and return evidence from capture_script.",
|
|
6303
6317
|
"If a capture attempt errors or proof_evidence is absent, revise the capture_script to make structured evidence easier to collect; do not only add more screenshots for non-visual proof.",
|
|
6304
6318
|
"When checking visible copy, normalize text before exact matching: const normalizedText = (document.body?.innerText || '').replace(/\\s+/g, ' ').trim(); Avoid raw innerText.includes(exact sentence) because browser line wrapping can split copy.",
|
|
6305
6319
|
"Prefer success-oriented evidence booleans such as newCopyVisible: true and oldCopyAbsent: true. If a positive assertion is false while screenshots/text samples look right, fix the capture script instead of leaving contradictory proof evidence.",
|
package/dist/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
createDisabledRiddleProofAgentAdapter,
|
|
19
19
|
readRiddleProofRunStatus,
|
|
20
20
|
runRiddleProofEngineHarness
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-F7BNWDF6.js";
|
|
22
22
|
import "./chunk-4DM3OTWH.js";
|
|
23
23
|
import "./chunk-3UHWI3FO.js";
|
|
24
24
|
import "./chunk-SGXB5S4B.js";
|
|
@@ -29,7 +29,7 @@ import "./chunk-JFQXAJH2.js";
|
|
|
29
29
|
import {
|
|
30
30
|
createCodexExecAgentAdapter,
|
|
31
31
|
runCodexExecAgentDoctor
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-EXF7V6TJ.js";
|
|
33
33
|
import "./chunk-DUFDZJOF.js";
|
|
34
34
|
|
|
35
35
|
// src/cli.ts
|
|
@@ -647,12 +647,12 @@ function createCodexExecAgentAdapter(config = {}, runner = createCodexExecJsonRu
|
|
|
647
647
|
"Use the recon-approved route and baseline context; make the plan name the concrete target, expected before state, expected after state, and stop condition.",
|
|
648
648
|
"Choose the evidence modality from verification_mode and success_criteria: screenshots for visual/UI proof, interactions plus screenshots for interaction proof, structured metrics/logs/JSON/audio analysis for non-visual proof.",
|
|
649
649
|
"For playable/gameplay proof, treat screenshots as supporting artifacts only: start the game, send keyboard or pointer input, measure state before/after, measure non-HUD canvas/playfield pixel deltas across time, and return playability evidence with version riddle-proof.playability.v1.",
|
|
650
|
-
"For structured proof, collect meaningful measurements inside page.evaluate
|
|
651
|
-
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence
|
|
650
|
+
"For structured proof, collect meaningful measurements inside page.evaluate, assign them to an evidence variable, and return that object from capture_script. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
|
|
651
|
+
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence in the worker context. Avoid global evidence assignment unless it is inside page.evaluate for compatibility with older packets.",
|
|
652
652
|
"Do not call Playwright page.* APIs inside page.evaluate; page.evaluate runs in the browser page, while page.waitForFunction, page.waitForSelector, page.click, and saveScreenshot belong in the outer capture script.",
|
|
653
653
|
"When page.evaluate needs data from the outer Playwright script, pass exactly one serializable argument object; do not pass multiple positional arguments.",
|
|
654
654
|
"When setting Playwright wait timeouts, use the correct signature: await page.waitForFunction(fn, undefined, { timeout: 60000 }). Do not write page.waitForFunction(fn, { timeout: 60000 }); that passes the object as the page argument and leaves the default timeout in place.",
|
|
655
|
-
"For audio/data/metric proof, return
|
|
655
|
+
"For audio/data/metric proof, return the same evidence object: const evidence = await page.evaluate(async () => ({ /* browser measurements */ })); Then assert evidence fields before saving screenshots and return evidence from capture_script.",
|
|
656
656
|
"If a capture attempt errors or proof_evidence is absent, revise the capture_script to make structured evidence easier to collect; do not only add more screenshots for non-visual proof.",
|
|
657
657
|
"When checking visible copy, normalize text before exact matching: const normalizedText = (document.body?.innerText || '').replace(/\\s+/g, ' ').trim(); Avoid raw innerText.includes(exact sentence) because browser line wrapping can split copy.",
|
|
658
658
|
"Prefer success-oriented evidence booleans such as newCopyVisible: true and oldCopyAbsent: true. If a positive assertion is false while screenshots/text samples look right, fix the capture script instead of leaving contradictory proof evidence.",
|
package/dist/codex-exec-agent.js
CHANGED
package/dist/engine-harness.cjs
CHANGED
|
@@ -5196,6 +5196,20 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5196
5196
|
})
|
|
5197
5197
|
};
|
|
5198
5198
|
}
|
|
5199
|
+
if (checkpoint === "verify_audit_complete") {
|
|
5200
|
+
return {
|
|
5201
|
+
terminal: terminalResult(
|
|
5202
|
+
state,
|
|
5203
|
+
"completed",
|
|
5204
|
+
result,
|
|
5205
|
+
result.summary || "Riddle Proof audit complete.",
|
|
5206
|
+
{
|
|
5207
|
+
audit_complete: true,
|
|
5208
|
+
ship_disabled: true
|
|
5209
|
+
}
|
|
5210
|
+
)
|
|
5211
|
+
};
|
|
5212
|
+
}
|
|
5199
5213
|
if (input.dry_run || request.dry_run) {
|
|
5200
5214
|
return {
|
|
5201
5215
|
blocker: {
|
package/dist/engine-harness.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -5919,6 +5919,20 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5919
5919
|
})
|
|
5920
5920
|
};
|
|
5921
5921
|
}
|
|
5922
|
+
if (checkpoint === "verify_audit_complete") {
|
|
5923
|
+
return {
|
|
5924
|
+
terminal: terminalResult(
|
|
5925
|
+
state,
|
|
5926
|
+
"completed",
|
|
5927
|
+
result,
|
|
5928
|
+
result.summary || "Riddle Proof audit complete.",
|
|
5929
|
+
{
|
|
5930
|
+
audit_complete: true,
|
|
5931
|
+
ship_disabled: true
|
|
5932
|
+
}
|
|
5933
|
+
)
|
|
5934
|
+
};
|
|
5935
|
+
}
|
|
5922
5936
|
if (input.dry_run || request.dry_run) {
|
|
5923
5937
|
return {
|
|
5924
5938
|
blocker: {
|
|
@@ -6946,12 +6960,12 @@ function createCodexExecAgentAdapter(config = {}, runner = createCodexExecJsonRu
|
|
|
6946
6960
|
"Use the recon-approved route and baseline context; make the plan name the concrete target, expected before state, expected after state, and stop condition.",
|
|
6947
6961
|
"Choose the evidence modality from verification_mode and success_criteria: screenshots for visual/UI proof, interactions plus screenshots for interaction proof, structured metrics/logs/JSON/audio analysis for non-visual proof.",
|
|
6948
6962
|
"For playable/gameplay proof, treat screenshots as supporting artifacts only: start the game, send keyboard or pointer input, measure state before/after, measure non-HUD canvas/playfield pixel deltas across time, and return playability evidence with version riddle-proof.playability.v1.",
|
|
6949
|
-
"For structured proof, collect meaningful measurements inside page.evaluate
|
|
6950
|
-
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence
|
|
6963
|
+
"For structured proof, collect meaningful measurements inside page.evaluate, assign them to an evidence variable, and return that object from capture_script. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
|
|
6964
|
+
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence in the worker context. Avoid global evidence assignment unless it is inside page.evaluate for compatibility with older packets.",
|
|
6951
6965
|
"Do not call Playwright page.* APIs inside page.evaluate; page.evaluate runs in the browser page, while page.waitForFunction, page.waitForSelector, page.click, and saveScreenshot belong in the outer capture script.",
|
|
6952
6966
|
"When page.evaluate needs data from the outer Playwright script, pass exactly one serializable argument object; do not pass multiple positional arguments.",
|
|
6953
6967
|
"When setting Playwright wait timeouts, use the correct signature: await page.waitForFunction(fn, undefined, { timeout: 60000 }). Do not write page.waitForFunction(fn, { timeout: 60000 }); that passes the object as the page argument and leaves the default timeout in place.",
|
|
6954
|
-
"For audio/data/metric proof, return
|
|
6968
|
+
"For audio/data/metric proof, return the same evidence object: const evidence = await page.evaluate(async () => ({ /* browser measurements */ })); Then assert evidence fields before saving screenshots and return evidence from capture_script.",
|
|
6955
6969
|
"If a capture attempt errors or proof_evidence is absent, revise the capture_script to make structured evidence easier to collect; do not only add more screenshots for non-visual proof.",
|
|
6956
6970
|
"When checking visible copy, normalize text before exact matching: const normalizedText = (document.body?.innerText || '').replace(/\\s+/g, ' ').trim(); Avoid raw innerText.includes(exact sentence) because browser line wrapping can split copy.",
|
|
6957
6971
|
"Prefer success-oriented evidence booleans such as newCopyVisible: true and oldCopyAbsent: true. If a positive assertion is false while screenshots/text samples look right, fix the capture script instead of leaving contradictory proof evidence.",
|
package/dist/index.js
CHANGED
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
createDisabledRiddleProofAgentAdapter,
|
|
85
85
|
readRiddleProofRunStatus,
|
|
86
86
|
runRiddleProofEngineHarness
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-F7BNWDF6.js";
|
|
88
88
|
import {
|
|
89
89
|
RIDDLE_PROOF_RUN_STATE_VERSION,
|
|
90
90
|
appendRunEvent,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
createCodexExecAgentAdapter,
|
|
124
124
|
createCodexExecJsonRunner,
|
|
125
125
|
runCodexExecAgentDoctor
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-EXF7V6TJ.js";
|
|
127
127
|
import {
|
|
128
128
|
applyTerminalMetadata,
|
|
129
129
|
compactRecord,
|
package/dist/local-agent.cjs
CHANGED
|
@@ -649,12 +649,12 @@ function createCodexExecAgentAdapter(config = {}, runner = createCodexExecJsonRu
|
|
|
649
649
|
"Use the recon-approved route and baseline context; make the plan name the concrete target, expected before state, expected after state, and stop condition.",
|
|
650
650
|
"Choose the evidence modality from verification_mode and success_criteria: screenshots for visual/UI proof, interactions plus screenshots for interaction proof, structured metrics/logs/JSON/audio analysis for non-visual proof.",
|
|
651
651
|
"For playable/gameplay proof, treat screenshots as supporting artifacts only: start the game, send keyboard or pointer input, measure state before/after, measure non-HUD canvas/playfield pixel deltas across time, and return playability evidence with version riddle-proof.playability.v1.",
|
|
652
|
-
"For structured proof, collect meaningful measurements inside page.evaluate
|
|
653
|
-
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence
|
|
652
|
+
"For structured proof, collect meaningful measurements inside page.evaluate, assign them to an evidence variable, and return that object from capture_script. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
|
|
653
|
+
"Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence in the worker context. Avoid global evidence assignment unless it is inside page.evaluate for compatibility with older packets.",
|
|
654
654
|
"Do not call Playwright page.* APIs inside page.evaluate; page.evaluate runs in the browser page, while page.waitForFunction, page.waitForSelector, page.click, and saveScreenshot belong in the outer capture script.",
|
|
655
655
|
"When page.evaluate needs data from the outer Playwright script, pass exactly one serializable argument object; do not pass multiple positional arguments.",
|
|
656
656
|
"When setting Playwright wait timeouts, use the correct signature: await page.waitForFunction(fn, undefined, { timeout: 60000 }). Do not write page.waitForFunction(fn, { timeout: 60000 }); that passes the object as the page argument and leaves the default timeout in place.",
|
|
657
|
-
"For audio/data/metric proof, return
|
|
657
|
+
"For audio/data/metric proof, return the same evidence object: const evidence = await page.evaluate(async () => ({ /* browser measurements */ })); Then assert evidence fields before saving screenshots and return evidence from capture_script.",
|
|
658
658
|
"If a capture attempt errors or proof_evidence is absent, revise the capture_script to make structured evidence easier to collect; do not only add more screenshots for non-visual proof.",
|
|
659
659
|
"When checking visible copy, normalize text before exact matching: const normalizedText = (document.body?.innerText || '').replace(/\\s+/g, ' ').trim(); Avoid raw innerText.includes(exact sentence) because browser line wrapping can split copy.",
|
|
660
660
|
"Prefer success-oriented evidence booleans such as newCopyVisible: true and oldCopyAbsent: true. If a positive assertion is false while screenshots/text samples look right, fix the capture script instead of leaving contradictory proof evidence.",
|
package/dist/local-agent.js
CHANGED
package/package.json
CHANGED
package/runtime/lib/author.py
CHANGED
|
@@ -151,9 +151,9 @@ def author_request_payload(state, reference, baselines, current_plan, hypothesis
|
|
|
151
151
|
'Return the authored packet via author_packet_json when possible. You may also set proof_plan, capture_script, server_path, and wait_for_selector directly.',
|
|
152
152
|
'Keep capture_script concise Playwright statements.',
|
|
153
153
|
'For visual/UI proof, include saveScreenshot(\'after-proof\') exactly once.',
|
|
154
|
-
'For playable/gameplay proof, start the experience, send keyboard or pointer input, sample state before/after, measure non-HUD playfield/canvas pixel deltas across time, and
|
|
155
|
-
'For data/audio/log/metric/custom proof, screenshots are optional;
|
|
156
|
-
'Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence
|
|
154
|
+
'For playable/gameplay proof, start the experience, send keyboard or pointer input, sample state before/after, measure non-HUD playfield/canvas pixel deltas across time, and return a JSON-serializable evidence object with playability or playability_evidence version riddle-proof.playability.v1.',
|
|
155
|
+
'For data/audio/log/metric/custom proof, screenshots are optional; collect measurements inside page.evaluate, assign the result to an evidence variable, and return that evidence object from capture_script.',
|
|
156
|
+
'Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence in the worker context. Avoid global evidence assignment unless it is inside page.evaluate for compatibility with older packets.',
|
|
157
157
|
'When page.evaluate needs data from the outer Playwright script, pass exactly one serializable argument object; do not pass multiple positional arguments.',
|
|
158
158
|
'Do not begin capture_script with page.goto unless an in-app navigation is genuinely required after the preview opens the target route.',
|
|
159
159
|
'Only escalate to the human after the supervising agent concludes the workflow is genuinely stuck or not converging.',
|
package/runtime/lib/verify.py
CHANGED
|
@@ -316,10 +316,13 @@ def build_probe_capture_script(base_script='', verification_mode='proof', proof_
|
|
|
316
316
|
pieces = []
|
|
317
317
|
script = (base_script or '').strip()
|
|
318
318
|
pieces.append('let __riddleProofCaptureScriptError = null;')
|
|
319
|
+
pieces.append('let __riddleProofCaptureScriptResult = null;')
|
|
319
320
|
if script:
|
|
320
321
|
pieces.extend([
|
|
321
322
|
'try {',
|
|
323
|
+
'__riddleProofCaptureScriptResult = await (async () => {',
|
|
322
324
|
script.rstrip(';') + ';',
|
|
325
|
+
'})();',
|
|
323
326
|
'} catch (err) {',
|
|
324
327
|
' __riddleProofCaptureScriptError = err;',
|
|
325
328
|
'}',
|
|
@@ -359,17 +362,13 @@ def build_probe_capture_script(base_script='', verification_mode='proof', proof_
|
|
|
359
362
|
' };',
|
|
360
363
|
'});',
|
|
361
364
|
'console.log(' + json.dumps(PAGE_STATE_PREFIX) + ' + JSON.stringify(pageState));',
|
|
362
|
-
'let __riddleProofEvidenceValue = null;',
|
|
363
|
-
'try {',
|
|
365
|
+
'let __riddleProofEvidenceValue = __riddleProofCaptureScriptResult ?? null;',
|
|
366
|
+
'if (__riddleProofEvidenceValue === null || __riddleProofEvidenceValue === undefined) { try {',
|
|
364
367
|
' __riddleProofEvidenceValue = await page.evaluate(() => {',
|
|
365
|
-
' const root = (typeof window !== "undefined" && window) ||
|
|
368
|
+
' const root = (typeof window !== "undefined" && window) || {};',
|
|
366
369
|
' return root.__riddleProofEvidence ?? root.riddleProofEvidence ?? null;',
|
|
367
370
|
' });',
|
|
368
|
-
'} catch {}',
|
|
369
|
-
'if (__riddleProofEvidenceValue === null || __riddleProofEvidenceValue === undefined) {',
|
|
370
|
-
' const __riddleProofEvidenceRoot = (typeof globalThis !== "undefined" && globalThis) || (typeof window !== "undefined" && window) || (typeof self !== "undefined" && self) || {};',
|
|
371
|
-
' __riddleProofEvidenceValue = __riddleProofEvidenceRoot.__riddleProofEvidence ?? __riddleProofEvidenceRoot.riddleProofEvidence ?? null;',
|
|
372
|
-
'}',
|
|
371
|
+
'} catch {} }',
|
|
373
372
|
'if (__riddleProofEvidenceValue !== null && __riddleProofEvidenceValue !== undefined) {',
|
|
374
373
|
' try { console.log(' + json.dumps(PROOF_EVIDENCE_PREFIX) + ' + JSON.stringify(__riddleProofEvidenceValue)); }',
|
|
375
374
|
' catch (err) { console.log(' + json.dumps(PROOF_EVIDENCE_PREFIX) + ' + JSON.stringify({ serialization_error: String(err) })); }',
|
|
@@ -197,7 +197,7 @@ class FakeRiddle:
|
|
|
197
197
|
},
|
|
198
198
|
},
|
|
199
199
|
}
|
|
200
|
-
if 'window.__riddleProofEvidence' in script or 'globalThis.__riddleProofEvidence' in script:
|
|
200
|
+
if 'attack_ms_after' in script or 'window.__riddleProofEvidence' in script or 'globalThis.__riddleProofEvidence' in script:
|
|
201
201
|
page_state = {
|
|
202
202
|
'bodyTextLength': 36,
|
|
203
203
|
'visibleTextSample': 'Neon step sequencer audio workbench',
|
|
@@ -1626,10 +1626,10 @@ def run_verify_structured_evidence_without_screenshot():
|
|
|
1626
1626
|
'server_path': '/sequencer',
|
|
1627
1627
|
'proof_plan': 'Measure the rendered synth transient envelope and compare attack/energy metrics.',
|
|
1628
1628
|
'capture_script': (
|
|
1629
|
-
"await page.evaluate(() => { "
|
|
1630
|
-
"window.__riddleProofEvidence = { "
|
|
1629
|
+
"const evidence = await page.evaluate(() => ({ "
|
|
1631
1630
|
"modality: 'audio', attack_ms_before: 42, attack_ms_after: 12, "
|
|
1632
|
-
"transient_energy_delta_db: 4.8, passed: true };
|
|
1631
|
+
"transient_energy_delta_db: 4.8, passed: true })); "
|
|
1632
|
+
"return evidence;"
|
|
1633
1633
|
),
|
|
1634
1634
|
'recon_results': {
|
|
1635
1635
|
'baselines': {'before': {'path': '/sequencer', 'url': 'https://cdn.example.com/before.png'}},
|
|
@@ -1657,8 +1657,9 @@ def run_verify_structured_evidence_without_screenshot():
|
|
|
1657
1657
|
assert script_calls, 'verify should run a proof capture script'
|
|
1658
1658
|
capture_script = script_calls[-1]
|
|
1659
1659
|
assert 'globalThis.__riddleProofEvidence ??' not in capture_script
|
|
1660
|
-
assert 'typeof globalThis !== "undefined"' in capture_script
|
|
1661
|
-
assert '__riddleProofEvidenceRoot.__riddleProofEvidence' in capture_script
|
|
1660
|
+
assert 'typeof globalThis !== "undefined"' not in capture_script
|
|
1661
|
+
assert '__riddleProofEvidenceRoot.__riddleProofEvidence' not in capture_script
|
|
1662
|
+
assert '__riddleProofCaptureScriptResult = await (async () =>' in capture_script
|
|
1662
1663
|
assert 'attack_ms_after' in supporting['proof_evidence_sample']
|
|
1663
1664
|
assert after_verify['evidence_bundle']['proof_evidence']['attack_ms_after'] == 12
|
|
1664
1665
|
assert after_verify['evidence_bundle']['after']['proof_evidence']['attack_ms_after'] == 12
|