@riddledc/riddle-proof 0.7.2 → 0.7.4

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.
@@ -14,7 +14,7 @@ import {
14
14
  visualDeltaForState,
15
15
  visualDeltaRequiredForState,
16
16
  visualDeltaShipGateReason
17
- } from "./chunk-FPD2RF3Q.js";
17
+ } from "./chunk-SGXB5S4B.js";
18
18
  import {
19
19
  authorPacketPayloadFromCheckpointResponse,
20
20
  buildCheckpointPacketForEngineResult,
@@ -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 and set window.__riddleProofEvidence in that browser page context to a JSON-serializable object. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
612
- "Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence outside page.evaluate; the Riddle worker context may not expose those globals safely.",
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 and persist the same evidence object: const evidence = await page.evaluate(async () => { /* browser measurements */ window.__riddleProofEvidence = { ... }; return window.__riddleProofEvidence; }); Then assert evidence fields before saving screenshots.",
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.",
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-4DM3OTWH.js";
7
7
  import {
8
8
  noImplementationModeFor
9
- } from "./chunk-FPD2RF3Q.js";
9
+ } from "./chunk-SGXB5S4B.js";
10
10
  import {
11
11
  createRunResult
12
12
  } from "./chunk-DUFDZJOF.js";
@@ -116,6 +116,9 @@ function buildSetupArgs(params, config) {
116
116
  context: params.context || "",
117
117
  reviewer: params.reviewer || config.defaultReviewer,
118
118
  mode: previewModeFromWorkflowMode(params.mode) || "",
119
+ implementation_mode: params.implementation_mode || "",
120
+ require_diff: params.require_diff,
121
+ allow_code_changes: params.allow_code_changes,
119
122
  build_command: params.build_command || "npm run build",
120
123
  build_output: params.build_output || "build",
121
124
  server_image: params.server_image || "node:20-slim",
package/dist/cli.cjs CHANGED
@@ -134,6 +134,9 @@ function buildSetupArgs(params, config) {
134
134
  context: params.context || "",
135
135
  reviewer: params.reviewer || config.defaultReviewer,
136
136
  mode: previewModeFromWorkflowMode(params.mode) || "",
137
+ implementation_mode: params.implementation_mode || "",
138
+ require_diff: params.require_diff,
139
+ allow_code_changes: params.allow_code_changes,
137
140
  build_command: params.build_command || "npm run build",
138
141
  build_output: params.build_output || "build",
139
142
  server_image: params.server_image || "node:20-slim",
@@ -6291,12 +6294,12 @@ function createCodexExecAgentAdapter(config = {}, runner = createCodexExecJsonRu
6291
6294
  "Use the recon-approved route and baseline context; make the plan name the concrete target, expected before state, expected after state, and stop condition.",
6292
6295
  "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.",
6293
6296
  "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.",
6294
- "For structured proof, collect meaningful measurements inside page.evaluate and set window.__riddleProofEvidence in that browser page context to a JSON-serializable object. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
6295
- "Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence outside page.evaluate; the Riddle worker context may not expose those globals safely.",
6297
+ "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.",
6298
+ "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.",
6296
6299
  "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.",
6297
6300
  "When page.evaluate needs data from the outer Playwright script, pass exactly one serializable argument object; do not pass multiple positional arguments.",
6298
6301
  "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.",
6299
- "For audio/data/metric proof, return and persist the same evidence object: const evidence = await page.evaluate(async () => { /* browser measurements */ window.__riddleProofEvidence = { ... }; return window.__riddleProofEvidence; }); Then assert evidence fields before saving screenshots.",
6302
+ "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.",
6300
6303
  "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.",
6301
6304
  "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.",
6302
6305
  "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,10 +18,10 @@ import {
18
18
  createDisabledRiddleProofAgentAdapter,
19
19
  readRiddleProofRunStatus,
20
20
  runRiddleProofEngineHarness
21
- } from "./chunk-N5BVCRKI.js";
21
+ } from "./chunk-3ICNKAWF.js";
22
22
  import "./chunk-4DM3OTWH.js";
23
23
  import "./chunk-3UHWI3FO.js";
24
- import "./chunk-FPD2RF3Q.js";
24
+ import "./chunk-SGXB5S4B.js";
25
25
  import {
26
26
  createCheckpointResponseTemplate
27
27
  } from "./chunk-33XO42CY.js";
@@ -29,7 +29,7 @@ import "./chunk-JFQXAJH2.js";
29
29
  import {
30
30
  createCodexExecAgentAdapter,
31
31
  runCodexExecAgentDoctor
32
- } from "./chunk-3266V3MO.js";
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 and set window.__riddleProofEvidence in that browser page context to a JSON-serializable object. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
651
- "Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence outside page.evaluate; the Riddle worker context may not expose those globals safely.",
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 and persist the same evidence object: const evidence = await page.evaluate(async () => { /* browser measurements */ window.__riddleProofEvidence = { ... }; return window.__riddleProofEvidence; }); Then assert evidence fields before saving screenshots.",
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.",
@@ -2,7 +2,7 @@ import {
2
2
  createCodexExecAgentAdapter,
3
3
  createCodexExecJsonRunner,
4
4
  runCodexExecAgentDoctor
5
- } from "./chunk-3266V3MO.js";
5
+ } from "./chunk-EXF7V6TJ.js";
6
6
  import "./chunk-DUFDZJOF.js";
7
7
  export {
8
8
  createCodexExecAgentAdapter,
@@ -134,6 +134,9 @@ function buildSetupArgs(params, config) {
134
134
  context: params.context || "",
135
135
  reviewer: params.reviewer || config.defaultReviewer,
136
136
  mode: previewModeFromWorkflowMode(params.mode) || "",
137
+ implementation_mode: params.implementation_mode || "",
138
+ require_diff: params.require_diff,
139
+ allow_code_changes: params.allow_code_changes,
137
140
  build_command: params.build_command || "npm run build",
138
141
  build_output: params.build_output || "build",
139
142
  server_image: params.server_image || "node:20-slim",
@@ -2,10 +2,10 @@ import {
2
2
  createDisabledRiddleProofAgentAdapter,
3
3
  readRiddleProofRunStatus,
4
4
  runRiddleProofEngineHarness
5
- } from "./chunk-N5BVCRKI.js";
5
+ } from "./chunk-3ICNKAWF.js";
6
6
  import "./chunk-4DM3OTWH.js";
7
7
  import "./chunk-3UHWI3FO.js";
8
- import "./chunk-FPD2RF3Q.js";
8
+ import "./chunk-SGXB5S4B.js";
9
9
  import "./chunk-33XO42CY.js";
10
10
  import "./chunk-DUFDZJOF.js";
11
11
  export {
package/dist/index.cjs CHANGED
@@ -134,6 +134,9 @@ function buildSetupArgs(params, config) {
134
134
  context: params.context || "",
135
135
  reviewer: params.reviewer || config.defaultReviewer,
136
136
  mode: previewModeFromWorkflowMode(params.mode) || "",
137
+ implementation_mode: params.implementation_mode || "",
138
+ require_diff: params.require_diff,
139
+ allow_code_changes: params.allow_code_changes,
137
140
  build_command: params.build_command || "npm run build",
138
141
  build_output: params.build_output || "build",
139
142
  server_image: params.server_image || "node:20-slim",
@@ -6943,12 +6946,12 @@ function createCodexExecAgentAdapter(config = {}, runner = createCodexExecJsonRu
6943
6946
  "Use the recon-approved route and baseline context; make the plan name the concrete target, expected before state, expected after state, and stop condition.",
6944
6947
  "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.",
6945
6948
  "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.",
6946
- "For structured proof, collect meaningful measurements inside page.evaluate and set window.__riddleProofEvidence in that browser page context to a JSON-serializable object. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
6947
- "Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence outside page.evaluate; the Riddle worker context may not expose those globals safely.",
6949
+ "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.",
6950
+ "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.",
6948
6951
  "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.",
6949
6952
  "When page.evaluate needs data from the outer Playwright script, pass exactly one serializable argument object; do not pass multiple positional arguments.",
6950
6953
  "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.",
6951
- "For audio/data/metric proof, return and persist the same evidence object: const evidence = await page.evaluate(async () => { /* browser measurements */ window.__riddleProofEvidence = { ... }; return window.__riddleProofEvidence; }); Then assert evidence fields before saving screenshots.",
6954
+ "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.",
6952
6955
  "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.",
6953
6956
  "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.",
6954
6957
  "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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-HIKFPDRO.js";
3
+ } from "./chunk-JRFKVTKY.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
  import {
6
6
  RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
@@ -84,7 +84,7 @@ import {
84
84
  createDisabledRiddleProofAgentAdapter,
85
85
  readRiddleProofRunStatus,
86
86
  runRiddleProofEngineHarness
87
- } from "./chunk-N5BVCRKI.js";
87
+ } from "./chunk-3ICNKAWF.js";
88
88
  import {
89
89
  RIDDLE_PROOF_RUN_STATE_VERSION,
90
90
  appendRunEvent,
@@ -101,7 +101,7 @@ import {
101
101
  RIDDLE_PROOF_RUN_CARD_VERSION,
102
102
  createRiddleProofRunCard
103
103
  } from "./chunk-3UHWI3FO.js";
104
- import "./chunk-FPD2RF3Q.js";
104
+ import "./chunk-SGXB5S4B.js";
105
105
  import {
106
106
  RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
107
107
  RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
@@ -123,7 +123,7 @@ import {
123
123
  createCodexExecAgentAdapter,
124
124
  createCodexExecJsonRunner,
125
125
  runCodexExecAgentDoctor
126
- } from "./chunk-3266V3MO.js";
126
+ } from "./chunk-EXF7V6TJ.js";
127
127
  import {
128
128
  applyTerminalMetadata,
129
129
  compactRecord,
@@ -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 and set window.__riddleProofEvidence in that browser page context to a JSON-serializable object. Screenshots are optional supporting context for data/audio/log/metric/custom modes.",
653
- "Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence outside page.evaluate; the Riddle worker context may not expose those globals safely.",
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 and persist the same evidence object: const evidence = await page.evaluate(async () => { /* browser measurements */ window.__riddleProofEvidence = { ... }; return window.__riddleProofEvidence; }); Then assert evidence fields before saving screenshots.",
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.",
@@ -3,7 +3,7 @@ import {
3
3
  createCodexExecAgentAdapter,
4
4
  createCodexExecJsonRunner,
5
5
  runCodexExecAgentDoctor
6
- } from "./chunk-3266V3MO.js";
6
+ } from "./chunk-EXF7V6TJ.js";
7
7
  import "./chunk-DUFDZJOF.js";
8
8
  export {
9
9
  createCodexExecAgentAdapter as createLocalAgentAdapter,
@@ -177,6 +177,9 @@ function buildSetupArgs(params, config) {
177
177
  context: params.context || "",
178
178
  reviewer: params.reviewer || config.defaultReviewer,
179
179
  mode: previewModeFromWorkflowMode(params.mode) || "",
180
+ implementation_mode: params.implementation_mode || "",
181
+ require_diff: params.require_diff,
182
+ allow_code_changes: params.allow_code_changes,
180
183
  build_command: params.build_command || "npm run build",
181
184
  build_output: params.build_output || "build",
182
185
  server_image: params.server_image || "node:20-slim",
@@ -127,6 +127,9 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
127
127
  context: string;
128
128
  reviewer: string;
129
129
  mode: string;
130
+ implementation_mode: string | (string & {});
131
+ require_diff: boolean | undefined;
132
+ allow_code_changes: boolean | undefined;
130
133
  build_command: string;
131
134
  build_output: string;
132
135
  server_image: string;
@@ -127,6 +127,9 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
127
127
  context: string;
128
128
  reviewer: string;
129
129
  mode: string;
130
+ implementation_mode: string | (string & {});
131
+ require_diff: boolean | undefined;
132
+ allow_code_changes: boolean | undefined;
130
133
  build_command: string;
131
134
  build_output: string;
132
135
  server_image: string;
@@ -26,7 +26,7 @@ import {
26
26
  visualDeltaShipGateReason,
27
27
  workflowFile,
28
28
  writeState
29
- } from "./chunk-FPD2RF3Q.js";
29
+ } from "./chunk-SGXB5S4B.js";
30
30
  export {
31
31
  BUNDLED_RIDDLE_PROOF_DIR,
32
32
  CHECKPOINT_CONTRACT_VERSION,
@@ -157,6 +157,9 @@ function buildSetupArgs(params, config) {
157
157
  context: params.context || "",
158
158
  reviewer: params.reviewer || config.defaultReviewer,
159
159
  mode: previewModeFromWorkflowMode(params.mode) || "",
160
+ implementation_mode: params.implementation_mode || "",
161
+ require_diff: params.require_diff,
162
+ allow_code_changes: params.allow_code_changes,
160
163
  build_command: params.build_command || "npm run build",
161
164
  build_output: params.build_output || "build",
162
165
  server_image: params.server_image || "node:20-slim",
@@ -15,7 +15,7 @@ import {
15
15
  validateShipGate,
16
16
  workflowFile,
17
17
  writeState
18
- } from "./chunk-FPD2RF3Q.js";
18
+ } from "./chunk-SGXB5S4B.js";
19
19
 
20
20
  // src/proof-run-engine.ts
21
21
  import { execFileSync } from "child_process";
package/dist/runner.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-HIKFPDRO.js";
3
+ } from "./chunk-JRFKVTKY.js";
4
4
  import "./chunk-4DM3OTWH.js";
5
5
  import "./chunk-3UHWI3FO.js";
6
- import "./chunk-FPD2RF3Q.js";
6
+ import "./chunk-SGXB5S4B.js";
7
7
  import "./chunk-33XO42CY.js";
8
8
  import "./chunk-DUFDZJOF.js";
9
9
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",
@@ -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 set window.__riddleProofEvidence.playability or playability_evidence with version riddle-proof.playability.v1.',
155
- 'For data/audio/log/metric/custom proof, screenshots are optional; set window.__riddleProofEvidence inside page.evaluate to a JSON-serializable object with the measured observations the verifier should judge.',
156
- 'Do not assign globalThis.__riddleProofEvidence, window.__riddleProofEvidence, or self.__riddleProofEvidence outside page.evaluate; the Riddle worker context may not expose those globals safely.',
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.',
@@ -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) || (typeof globalThis !== "undefined" && globalThis) || (typeof self !== "undefined" && self) || {};',
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