@riddledc/riddle-proof 0.7.28 → 0.7.29

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 CHANGED
@@ -109,7 +109,30 @@ or as a stronger proof base before a change loop.
109
109
  { "name": "desktop", "width": 1440, "height": 1000 }
110
110
  ],
111
111
  "auth": "none",
112
+ "network_mocks": [
113
+ {
114
+ "label": "plans-api",
115
+ "url": "**/api/plans",
116
+ "method": "GET",
117
+ "status": 200,
118
+ "content_type": "application/json",
119
+ "json": {
120
+ "plans": [{ "name": "Builder", "price": "$20" }]
121
+ }
122
+ }
123
+ ],
112
124
  "setup_actions": [
125
+ {
126
+ "type": "local_storage",
127
+ "key": "demo-auth",
128
+ "json": { "role": "tester" },
129
+ "reload": true
130
+ },
131
+ {
132
+ "type": "fill",
133
+ "selector": "[data-testid='email']",
134
+ "value": "builder@example.com"
135
+ },
113
136
  { "type": "click", "selector": "[data-testid='show-plans']" },
114
137
  { "type": "wait_for_text", "selector": "body", "text": "Start building" }
115
138
  ]
@@ -145,14 +168,23 @@ The package includes a generic starter profile at
145
168
  profile directory and replace the selector/text checks with app-specific
146
169
  invariants.
147
170
 
171
+ `target.network_mocks` is optional. The Riddle runner registers these mocks
172
+ before navigation, records each hit, and adds an implicit
173
+ `network_mocks_succeeded` check when mocks are present. A mock supports
174
+ `url`/`glob`/`pattern`, optional `method`, `status`, `content_type`, `headers`,
175
+ string `body`, JSON `json` / `body_json`, and `required: false` for
176
+ best-effort mocks.
177
+
148
178
  `target.setup_actions` is optional. Use it when the meaningful proof surface
149
- appears only after a picker, tab, login stub, transport control, or other
150
- bounded interaction. Supported setup actions are `click`, `wait`,
179
+ appears only after a picker, tab, login stub, storage seed, form fill,
180
+ transport control, or other bounded interaction. Supported setup actions are
181
+ `click`, `fill`, `set_input_value`, `local_storage`, `wait`,
151
182
  `wait_for_selector`, and `wait_for_text`; a failed setup action is recorded as
152
183
  a failed `setup_actions_succeeded` check so the profile cannot pass without
153
184
  reaching the intended state. Text-matched `click` actions prefer visible
154
185
  matching elements, which keeps responsive layouts from selecting hidden desktop
155
- or mobile-only links.
186
+ or mobile-only links. `local_storage` accepts a `key` plus string `value` or
187
+ JSON `json` / `value_json`, and can reload the page with `reload: true`.
156
188
 
157
189
  `target.timeout_sec` is optional. Use it for known-heavy profile targets so the
158
190
  profile carries its own hosted Riddle worker budget; an explicit CLI `--timeout`
@@ -120,7 +120,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
120
120
  target_image_hash: string;
121
121
  viewport_matrix_json: string;
122
122
  deterministic_setup_json: string;
123
- reference: "before" | "prod" | "both";
123
+ reference: "prod" | "before" | "both";
124
124
  base_branch: string;
125
125
  before_ref: string;
126
126
  allow_static_preview_fallback: string;
@@ -120,7 +120,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
120
120
  target_image_hash: string;
121
121
  viewport_matrix_json: string;
122
122
  deterministic_setup_json: string;
123
- reference: "before" | "prod" | "both";
123
+ reference: "prod" | "before" | "both";
124
124
  base_branch: string;
125
125
  before_ref: string;
126
126
  allow_static_preview_fallback: 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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.28",
3
+ "version": "0.7.29",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",