@riddledc/riddle-proof 0.7.120 → 0.7.122

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
@@ -198,12 +198,31 @@ generic inline-script warning threshold. Use `--strict=true` when you
198
198
  deliberately want Riddle's non-critical script-safety warnings to block the run.
199
199
  Critical script-safety violations remain blocked by Riddle either way.
200
200
 
201
+ When promoting proof artifacts into a durable public profile, avoid guessing
202
+ which backend or runner tokens are preserved inside `proof.json`. Derive the
203
+ `body_contains` fragments from the artifact body first:
204
+
205
+ ```sh
206
+ riddle-proof-loop profile-body-assertions \
207
+ --artifact artifacts/job_abc123/proof.json.json \
208
+ --candidates-json '["product_regression","completed_timeout","Timed Out","partial results available"]' \
209
+ --required-json '["product_regression"]' \
210
+ --format body-contains
211
+ ```
212
+
213
+ The command prints only snippets that are actually present in the artifact.
214
+ Missing optional candidates are reported in JSON mode as warnings, while missing
215
+ required snippets make the command exit non-zero. This keeps Good Catch and
216
+ audit-profile promotions tied to real artifacts instead of hand-authored token
217
+ guesses.
218
+
201
219
  The package includes generic starter profiles:
202
220
 
203
221
  - `examples/profiles/page-content-basic.json` for route/content/layout smoke profiles.
204
222
  - `examples/profiles/route-inventory-basic.json` for source-link and direct-route audits.
205
223
  - `examples/profiles/handled-recovery-list-load.json` for failed or malformed list-load recovery profiles.
206
224
  - `examples/profiles/handled-recovery-action-malformed-success.json` for action recovery profiles where the request succeeds at HTTP level but returns an unusable body.
225
+ - `examples/profiles/terminal-result-partial-evidence.json` for API-console terminal error or timeout receipts that preserve partial screenshot, console, and HAR evidence.
207
226
 
208
227
  Copy one of those shapes into a repository profile directory and replace the
209
228
  routes, selectors, mock URLs, and text checks with app-specific invariants.
@@ -236,6 +255,16 @@ message, captures a recovery screenshot, and keeps parser text plus browser
236
255
  console/page errors out of the final proof. This catches action paths that look
237
256
  recovered to a user but still poison the browser evidence stream.
238
257
 
258
+ For terminal result profiles, prove status honesty separately from artifact
259
+ presence. A page can preserve screenshots, console output, HAR, billing, and raw
260
+ response evidence while still lying about the terminal state or omitting that
261
+ the evidence is partial. Return a terminal `completed_error` or
262
+ `completed_timeout` response with partial evidence, require the visible status
263
+ and `partial results available` copy, assert each artifact class, reject Success
264
+ and contradictory empty-evidence copy, assert success/error/timeout selector
265
+ polarity, and keep `no_horizontal_overflow`, `no_fatal_console_errors`, and
266
+ `no_console_warnings` in the same profile.
267
+
239
268
  Checks normally apply to every captured viewport. Add `viewports` (or
240
269
  `viewport_names`) to a check when responsive UI intentionally exposes an
241
270
  invariant only on named viewports, such as desktop-only helper copy while phone
@@ -79,6 +79,36 @@ var RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES = [
79
79
  "timedout",
80
80
  "failed"
81
81
  ];
82
+ function uniqueNonEmptyStrings(values) {
83
+ const seen = /* @__PURE__ */ new Set();
84
+ const result = [];
85
+ for (const value of values ?? []) {
86
+ const normalized = typeof value === "string" ? value.trim() : "";
87
+ if (!normalized || seen.has(normalized)) continue;
88
+ seen.add(normalized);
89
+ result.push(normalized);
90
+ }
91
+ return result;
92
+ }
93
+ function deriveRiddleProofArtifactBodyAssertions(input) {
94
+ const artifactText = typeof input.artifact_text === "string" ? input.artifact_text : "";
95
+ const candidates = uniqueNonEmptyStrings(input.candidates);
96
+ const required = uniqueNonEmptyStrings(input.required);
97
+ const mergedCandidates = uniqueNonEmptyStrings([...required, ...candidates]);
98
+ const presentCandidates = mergedCandidates.filter((snippet) => artifactText.includes(snippet));
99
+ const missingCandidates = mergedCandidates.filter((snippet) => !artifactText.includes(snippet));
100
+ const missingRequired = required.filter((snippet) => !artifactText.includes(snippet));
101
+ const warnings = missingCandidates.map((snippet) => `candidate snippet is not present in artifact body: ${snippet}`);
102
+ return {
103
+ version: "riddle-proof.artifact-body-assertions.v1",
104
+ ok: missingRequired.length === 0,
105
+ body_contains: presentCandidates,
106
+ present_candidates: presentCandidates,
107
+ missing_candidates: missingCandidates,
108
+ missing_required: missingRequired,
109
+ warnings
110
+ };
111
+ }
82
112
  var DEFAULT_VIEWPORTS = [
83
113
  { name: "desktop", width: 1280, height: 800 }
84
114
  ];
@@ -5884,6 +5914,7 @@ export {
5884
5914
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
5885
5915
  RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES,
5886
5916
  RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES,
5917
+ deriveRiddleProofArtifactBodyAssertions,
5887
5918
  slugifyRiddleProofProfileName,
5888
5919
  collectRiddleProofProfileWarnings,
5889
5920
  normalizeRiddleProofProfile,
package/dist/cli.cjs CHANGED
@@ -7016,6 +7016,36 @@ var RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES = [
7016
7016
  "timedout",
7017
7017
  "failed"
7018
7018
  ];
7019
+ function uniqueNonEmptyStrings(values) {
7020
+ const seen = /* @__PURE__ */ new Set();
7021
+ const result = [];
7022
+ for (const value of values ?? []) {
7023
+ const normalized = typeof value === "string" ? value.trim() : "";
7024
+ if (!normalized || seen.has(normalized)) continue;
7025
+ seen.add(normalized);
7026
+ result.push(normalized);
7027
+ }
7028
+ return result;
7029
+ }
7030
+ function deriveRiddleProofArtifactBodyAssertions(input) {
7031
+ const artifactText = typeof input.artifact_text === "string" ? input.artifact_text : "";
7032
+ const candidates = uniqueNonEmptyStrings(input.candidates);
7033
+ const required = uniqueNonEmptyStrings(input.required);
7034
+ const mergedCandidates = uniqueNonEmptyStrings([...required, ...candidates]);
7035
+ const presentCandidates = mergedCandidates.filter((snippet) => artifactText.includes(snippet));
7036
+ const missingCandidates = mergedCandidates.filter((snippet) => !artifactText.includes(snippet));
7037
+ const missingRequired = required.filter((snippet) => !artifactText.includes(snippet));
7038
+ const warnings = missingCandidates.map((snippet) => `candidate snippet is not present in artifact body: ${snippet}`);
7039
+ return {
7040
+ version: "riddle-proof.artifact-body-assertions.v1",
7041
+ ok: missingRequired.length === 0,
7042
+ body_contains: presentCandidates,
7043
+ present_candidates: presentCandidates,
7044
+ missing_candidates: missingCandidates,
7045
+ missing_required: missingRequired,
7046
+ warnings
7047
+ };
7048
+ }
7019
7049
  var DEFAULT_VIEWPORTS = [
7020
7050
  { name: "desktop", width: 1280, height: 800 }
7021
7051
  ];
@@ -12807,6 +12837,7 @@ function usage() {
12807
12837
  " riddle-proof-loop respond --state-path <path> --decision <decision> --summary <text> [--payload-json <file|json|->]",
12808
12838
  " riddle-proof-loop status --state-path <path>",
12809
12839
  " riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--runner riddle] [--strict true|false; default false] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--quiet]",
12840
+ " riddle-proof-loop profile-body-assertions --artifact <file|url|-> --candidates-json <file|json|-> [--required-json <file|json|->] [--format json|body-contains]",
12810
12841
  " riddle-proof-loop riddle-preview-deploy <build-dir> <label> [--framework spa|static]",
12811
12842
  " riddle-proof-loop riddle-server-preview <directory> --script-file <file> [--path /route] [--wait-for-selector selector]",
12812
12843
  " riddle-proof-loop riddle-run-script --url <url> --script-file <file> [--viewport 1280x720] [--strict true|false]",
@@ -12879,6 +12910,18 @@ function previewFrameworkOption(options) {
12879
12910
  function readStdin() {
12880
12911
  return (0, import_node_fs6.readFileSync)(0, "utf-8");
12881
12912
  }
12913
+ async function readTextValue(value, label) {
12914
+ if (!value) throw new Error(`${label} is required.`);
12915
+ if (value === "-") return readStdin();
12916
+ if (/^https?:\/\//i.test(value)) {
12917
+ const response = await fetch(value);
12918
+ const text = await response.text();
12919
+ if (!response.ok) throw new Error(`${label} URL failed HTTP ${response.status}: ${text.slice(0, 500)}`);
12920
+ return text;
12921
+ }
12922
+ if ((0, import_node_fs6.existsSync)(value)) return (0, import_node_fs6.readFileSync)(value, "utf-8");
12923
+ throw new Error(`${label} must be a readable file path, URL, or -.`);
12924
+ }
12882
12925
  function formatPollDuration(ms) {
12883
12926
  if (typeof ms !== "number" || !Number.isFinite(ms)) return "n/a";
12884
12927
  const seconds = Math.max(0, Math.round(ms / 1e3));
@@ -13648,6 +13691,31 @@ async function main() {
13648
13691
  process.exitCode = profileStatusExitCode(profile, result.status);
13649
13692
  return;
13650
13693
  }
13694
+ if (command === "profile-body-assertions") {
13695
+ const artifactText = await readTextValue(optionString(options, "artifact") ?? optionString(options, "input"), "--artifact");
13696
+ const candidates = readOptionalJsonStringArray(optionString(options, "candidatesJson") ?? optionString(options, "candidateJson"), "--candidates-json") ?? [];
13697
+ const required = readOptionalJsonStringArray(optionString(options, "requiredJson"), "--required-json");
13698
+ if (!candidates.length && !required?.length) {
13699
+ throw new Error("--candidates-json or --required-json must provide at least one snippet.");
13700
+ }
13701
+ const result = deriveRiddleProofArtifactBodyAssertions({
13702
+ artifact_text: artifactText,
13703
+ candidates,
13704
+ required
13705
+ });
13706
+ const format = optionString(options, "format") || "json";
13707
+ if (format === "body-contains") {
13708
+ process.stdout.write(`${JSON.stringify(result.body_contains, null, 2)}
13709
+ `);
13710
+ } else if (format === "json") {
13711
+ process.stdout.write(`${JSON.stringify(result, null, 2)}
13712
+ `);
13713
+ } else {
13714
+ throw new Error("--format must be json or body-contains.");
13715
+ }
13716
+ process.exitCode = result.ok ? 0 : 1;
13717
+ return;
13718
+ }
13651
13719
  if (command === "riddle-preview-deploy") {
13652
13720
  const buildDir = positional[1];
13653
13721
  const label = positional[2];
package/dist/cli.js CHANGED
@@ -5,12 +5,13 @@ import {
5
5
  collectRiddleProfileArtifactRefs,
6
6
  createRiddleProofProfileEnvironmentBlockedResult,
7
7
  createRiddleProofProfileInsufficientResult,
8
+ deriveRiddleProofArtifactBodyAssertions,
8
9
  extractRiddleProofProfileResult,
9
10
  normalizeRiddleProofProfile,
10
11
  profileStatusExitCode,
11
12
  resolveRiddleProofProfileTargetUrl,
12
13
  resolveRiddleProofProfileTimeoutSec
13
- } from "./chunk-DVMBXDIF.js";
14
+ } from "./chunk-TBEVHMU3.js";
14
15
  import {
15
16
  createRiddleApiClient,
16
17
  parseRiddleViewport
@@ -45,6 +46,7 @@ function usage() {
45
46
  " riddle-proof-loop respond --state-path <path> --decision <decision> --summary <text> [--payload-json <file|json|->]",
46
47
  " riddle-proof-loop status --state-path <path>",
47
48
  " riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--runner riddle] [--strict true|false; default false] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--quiet]",
49
+ " riddle-proof-loop profile-body-assertions --artifact <file|url|-> --candidates-json <file|json|-> [--required-json <file|json|->] [--format json|body-contains]",
48
50
  " riddle-proof-loop riddle-preview-deploy <build-dir> <label> [--framework spa|static]",
49
51
  " riddle-proof-loop riddle-server-preview <directory> --script-file <file> [--path /route] [--wait-for-selector selector]",
50
52
  " riddle-proof-loop riddle-run-script --url <url> --script-file <file> [--viewport 1280x720] [--strict true|false]",
@@ -117,6 +119,18 @@ function previewFrameworkOption(options) {
117
119
  function readStdin() {
118
120
  return readFileSync(0, "utf-8");
119
121
  }
122
+ async function readTextValue(value, label) {
123
+ if (!value) throw new Error(`${label} is required.`);
124
+ if (value === "-") return readStdin();
125
+ if (/^https?:\/\//i.test(value)) {
126
+ const response = await fetch(value);
127
+ const text = await response.text();
128
+ if (!response.ok) throw new Error(`${label} URL failed HTTP ${response.status}: ${text.slice(0, 500)}`);
129
+ return text;
130
+ }
131
+ if (existsSync(value)) return readFileSync(value, "utf-8");
132
+ throw new Error(`${label} must be a readable file path, URL, or -.`);
133
+ }
120
134
  function formatPollDuration(ms) {
121
135
  if (typeof ms !== "number" || !Number.isFinite(ms)) return "n/a";
122
136
  const seconds = Math.max(0, Math.round(ms / 1e3));
@@ -886,6 +900,31 @@ async function main() {
886
900
  process.exitCode = profileStatusExitCode(profile, result.status);
887
901
  return;
888
902
  }
903
+ if (command === "profile-body-assertions") {
904
+ const artifactText = await readTextValue(optionString(options, "artifact") ?? optionString(options, "input"), "--artifact");
905
+ const candidates = readOptionalJsonStringArray(optionString(options, "candidatesJson") ?? optionString(options, "candidateJson"), "--candidates-json") ?? [];
906
+ const required = readOptionalJsonStringArray(optionString(options, "requiredJson"), "--required-json");
907
+ if (!candidates.length && !required?.length) {
908
+ throw new Error("--candidates-json or --required-json must provide at least one snippet.");
909
+ }
910
+ const result = deriveRiddleProofArtifactBodyAssertions({
911
+ artifact_text: artifactText,
912
+ candidates,
913
+ required
914
+ });
915
+ const format = optionString(options, "format") || "json";
916
+ if (format === "body-contains") {
917
+ process.stdout.write(`${JSON.stringify(result.body_contains, null, 2)}
918
+ `);
919
+ } else if (format === "json") {
920
+ process.stdout.write(`${JSON.stringify(result, null, 2)}
921
+ `);
922
+ } else {
923
+ throw new Error("--format must be json or body-contains.");
924
+ }
925
+ process.exitCode = result.ok ? 0 : 1;
926
+ return;
927
+ }
889
928
  if (command === "riddle-preview-deploy") {
890
929
  const buildDir = positional[1];
891
930
  const label = positional[2];
package/dist/index.cjs CHANGED
@@ -2972,6 +2972,7 @@ __export(index_exports, {
2972
2972
  createRunStatusSnapshot: () => createRunStatusSnapshot,
2973
2973
  deployRiddlePreview: () => deployRiddlePreview,
2974
2974
  deployRiddleStaticPreview: () => deployRiddleStaticPreview,
2975
+ deriveRiddleProofArtifactBodyAssertions: () => deriveRiddleProofArtifactBodyAssertions,
2975
2976
  extractBasicGameplayEvidence: () => extractBasicGameplayEvidence,
2976
2977
  extractPlayabilityEvidence: () => extractPlayabilityEvidence,
2977
2978
  extractRiddleProofProfileResult: () => extractRiddleProofProfileResult,
@@ -8810,6 +8811,36 @@ var RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES = [
8810
8811
  "timedout",
8811
8812
  "failed"
8812
8813
  ];
8814
+ function uniqueNonEmptyStrings(values) {
8815
+ const seen = /* @__PURE__ */ new Set();
8816
+ const result = [];
8817
+ for (const value of values ?? []) {
8818
+ const normalized = typeof value === "string" ? value.trim() : "";
8819
+ if (!normalized || seen.has(normalized)) continue;
8820
+ seen.add(normalized);
8821
+ result.push(normalized);
8822
+ }
8823
+ return result;
8824
+ }
8825
+ function deriveRiddleProofArtifactBodyAssertions(input) {
8826
+ const artifactText = typeof input.artifact_text === "string" ? input.artifact_text : "";
8827
+ const candidates = uniqueNonEmptyStrings(input.candidates);
8828
+ const required = uniqueNonEmptyStrings(input.required);
8829
+ const mergedCandidates = uniqueNonEmptyStrings([...required, ...candidates]);
8830
+ const presentCandidates = mergedCandidates.filter((snippet) => artifactText.includes(snippet));
8831
+ const missingCandidates = mergedCandidates.filter((snippet) => !artifactText.includes(snippet));
8832
+ const missingRequired = required.filter((snippet) => !artifactText.includes(snippet));
8833
+ const warnings = missingCandidates.map((snippet) => `candidate snippet is not present in artifact body: ${snippet}`);
8834
+ return {
8835
+ version: "riddle-proof.artifact-body-assertions.v1",
8836
+ ok: missingRequired.length === 0,
8837
+ body_contains: presentCandidates,
8838
+ present_candidates: presentCandidates,
8839
+ missing_candidates: missingCandidates,
8840
+ missing_required: missingRequired,
8841
+ warnings
8842
+ };
8843
+ }
8813
8844
  var DEFAULT_VIEWPORTS = [
8814
8845
  { name: "desktop", width: 1280, height: 800 }
8815
8846
  ];
@@ -15058,6 +15089,7 @@ function createRiddleApiClient(config = {}) {
15058
15089
  createRunStatusSnapshot,
15059
15090
  deployRiddlePreview,
15060
15091
  deployRiddleStaticPreview,
15092
+ deriveRiddleProofArtifactBodyAssertions,
15061
15093
  extractBasicGameplayEvidence,
15062
15094
  extractPlayabilityEvidence,
15063
15095
  extractRiddleProofProfileResult,
package/dist/index.d.cts CHANGED
@@ -10,5 +10,5 @@ export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_D
10
10
  export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.cjs';
11
11
  export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.cjs';
12
12
  export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayBoundsOffender, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayResponsiveViewportEvidence, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.cjs';
13
- export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
13
+ export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofArtifactBodyAssertionInput, RiddleProofArtifactBodyAssertionResult, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
14
14
  export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
package/dist/index.d.ts CHANGED
@@ -10,5 +10,5 @@ export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_D
10
10
  export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.js';
11
11
  export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.js';
12
12
  export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayBoundsOffender, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayResponsiveViewportEvidence, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.js';
13
- export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
13
+ export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofArtifactBodyAssertionInput, RiddleProofArtifactBodyAssertionResult, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
14
14
  export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
package/dist/index.js CHANGED
@@ -52,6 +52,7 @@ import {
52
52
  createRiddleProofProfileConfigurationError,
53
53
  createRiddleProofProfileEnvironmentBlockedResult,
54
54
  createRiddleProofProfileInsufficientResult,
55
+ deriveRiddleProofArtifactBodyAssertions,
55
56
  extractRiddleProofProfileResult,
56
57
  normalizeRiddleProofProfile,
57
58
  profileStatusExitCode,
@@ -60,7 +61,7 @@ import {
60
61
  resolveRiddleProofProfileTimeoutSec,
61
62
  slugifyRiddleProofProfileName,
62
63
  summarizeRiddleProofProfileResult
63
- } from "./chunk-DVMBXDIF.js";
64
+ } from "./chunk-TBEVHMU3.js";
64
65
  import {
65
66
  DEFAULT_RIDDLE_API_BASE_URL,
66
67
  DEFAULT_RIDDLE_API_KEY_FILE,
@@ -214,6 +215,7 @@ export {
214
215
  createRunStatusSnapshot,
215
216
  deployRiddlePreview,
216
217
  deployRiddleStaticPreview,
218
+ deriveRiddleProofArtifactBodyAssertions,
217
219
  extractBasicGameplayEvidence,
218
220
  extractPlayabilityEvidence,
219
221
  extractRiddleProofProfileResult,
package/dist/profile.cjs CHANGED
@@ -34,6 +34,7 @@ __export(profile_exports, {
34
34
  createRiddleProofProfileConfigurationError: () => createRiddleProofProfileConfigurationError,
35
35
  createRiddleProofProfileEnvironmentBlockedResult: () => createRiddleProofProfileEnvironmentBlockedResult,
36
36
  createRiddleProofProfileInsufficientResult: () => createRiddleProofProfileInsufficientResult,
37
+ deriveRiddleProofArtifactBodyAssertions: () => deriveRiddleProofArtifactBodyAssertions,
37
38
  extractRiddleProofProfileResult: () => extractRiddleProofProfileResult,
38
39
  normalizeRiddleProofProfile: () => normalizeRiddleProofProfile,
39
40
  profileStatusExitCode: () => profileStatusExitCode,
@@ -124,6 +125,36 @@ var RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES = [
124
125
  "timedout",
125
126
  "failed"
126
127
  ];
128
+ function uniqueNonEmptyStrings(values) {
129
+ const seen = /* @__PURE__ */ new Set();
130
+ const result = [];
131
+ for (const value of values ?? []) {
132
+ const normalized = typeof value === "string" ? value.trim() : "";
133
+ if (!normalized || seen.has(normalized)) continue;
134
+ seen.add(normalized);
135
+ result.push(normalized);
136
+ }
137
+ return result;
138
+ }
139
+ function deriveRiddleProofArtifactBodyAssertions(input) {
140
+ const artifactText = typeof input.artifact_text === "string" ? input.artifact_text : "";
141
+ const candidates = uniqueNonEmptyStrings(input.candidates);
142
+ const required = uniqueNonEmptyStrings(input.required);
143
+ const mergedCandidates = uniqueNonEmptyStrings([...required, ...candidates]);
144
+ const presentCandidates = mergedCandidates.filter((snippet) => artifactText.includes(snippet));
145
+ const missingCandidates = mergedCandidates.filter((snippet) => !artifactText.includes(snippet));
146
+ const missingRequired = required.filter((snippet) => !artifactText.includes(snippet));
147
+ const warnings = missingCandidates.map((snippet) => `candidate snippet is not present in artifact body: ${snippet}`);
148
+ return {
149
+ version: "riddle-proof.artifact-body-assertions.v1",
150
+ ok: missingRequired.length === 0,
151
+ body_contains: presentCandidates,
152
+ present_candidates: presentCandidates,
153
+ missing_candidates: missingCandidates,
154
+ missing_required: missingRequired,
155
+ warnings
156
+ };
157
+ }
127
158
  var DEFAULT_VIEWPORTS = [
128
159
  { name: "desktop", width: 1280, height: 800 }
129
160
  ];
@@ -5936,6 +5967,7 @@ function extractRiddleProofProfileResult(input) {
5936
5967
  createRiddleProofProfileConfigurationError,
5937
5968
  createRiddleProofProfileEnvironmentBlockedResult,
5938
5969
  createRiddleProofProfileInsufficientResult,
5970
+ deriveRiddleProofArtifactBodyAssertions,
5939
5971
  extractRiddleProofProfileResult,
5940
5972
  normalizeRiddleProofProfile,
5941
5973
  profileStatusExitCode,
@@ -14,6 +14,21 @@ type RiddleProofProfileNetworkAbortErrorCode = typeof RIDDLE_PROOF_PROFILE_NETWO
14
14
  type RiddleProofProfileRunner = "riddle" | "local-playwright" | "browserless" | "github-actions" | (string & {});
15
15
  type RiddleProofProfileFailureAction = "fail" | "neutral" | "review";
16
16
  type RiddleProofProfileBaselinePolicy = "invariant_only" | "production_comparison" | "last_accepted_artifact" | "golden_reference_artifact" | (string & {});
17
+ interface RiddleProofArtifactBodyAssertionInput {
18
+ artifact_text: string;
19
+ candidates: string[];
20
+ required?: string[];
21
+ }
22
+ interface RiddleProofArtifactBodyAssertionResult {
23
+ version: "riddle-proof.artifact-body-assertions.v1";
24
+ ok: boolean;
25
+ body_contains: string[];
26
+ present_candidates: string[];
27
+ missing_candidates: string[];
28
+ missing_required: string[];
29
+ warnings: string[];
30
+ }
31
+ declare function deriveRiddleProofArtifactBodyAssertions(input: RiddleProofArtifactBodyAssertionInput): RiddleProofArtifactBodyAssertionResult;
17
32
  interface RiddleProofProfileViewport {
18
33
  name: string;
19
34
  width: number;
@@ -330,4 +345,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
330
345
  declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
331
346
  declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
332
347
 
333
- export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
348
+ export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
package/dist/profile.d.ts CHANGED
@@ -14,6 +14,21 @@ type RiddleProofProfileNetworkAbortErrorCode = typeof RIDDLE_PROOF_PROFILE_NETWO
14
14
  type RiddleProofProfileRunner = "riddle" | "local-playwright" | "browserless" | "github-actions" | (string & {});
15
15
  type RiddleProofProfileFailureAction = "fail" | "neutral" | "review";
16
16
  type RiddleProofProfileBaselinePolicy = "invariant_only" | "production_comparison" | "last_accepted_artifact" | "golden_reference_artifact" | (string & {});
17
+ interface RiddleProofArtifactBodyAssertionInput {
18
+ artifact_text: string;
19
+ candidates: string[];
20
+ required?: string[];
21
+ }
22
+ interface RiddleProofArtifactBodyAssertionResult {
23
+ version: "riddle-proof.artifact-body-assertions.v1";
24
+ ok: boolean;
25
+ body_contains: string[];
26
+ present_candidates: string[];
27
+ missing_candidates: string[];
28
+ missing_required: string[];
29
+ warnings: string[];
30
+ }
31
+ declare function deriveRiddleProofArtifactBodyAssertions(input: RiddleProofArtifactBodyAssertionInput): RiddleProofArtifactBodyAssertionResult;
17
32
  interface RiddleProofProfileViewport {
18
33
  name: string;
19
34
  width: number;
@@ -330,4 +345,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
330
345
  declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
331
346
  declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
332
347
 
333
- export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
348
+ export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
package/dist/profile.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  createRiddleProofProfileConfigurationError,
14
14
  createRiddleProofProfileEnvironmentBlockedResult,
15
15
  createRiddleProofProfileInsufficientResult,
16
+ deriveRiddleProofArtifactBodyAssertions,
16
17
  extractRiddleProofProfileResult,
17
18
  normalizeRiddleProofProfile,
18
19
  profileStatusExitCode,
@@ -21,7 +22,7 @@ import {
21
22
  resolveRiddleProofProfileTimeoutSec,
22
23
  slugifyRiddleProofProfileName,
23
24
  summarizeRiddleProofProfileResult
24
- } from "./chunk-DVMBXDIF.js";
25
+ } from "./chunk-TBEVHMU3.js";
25
26
  export {
26
27
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
27
28
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -37,6 +38,7 @@ export {
37
38
  createRiddleProofProfileConfigurationError,
38
39
  createRiddleProofProfileEnvironmentBlockedResult,
39
40
  createRiddleProofProfileInsufficientResult,
41
+ deriveRiddleProofArtifactBodyAssertions,
40
42
  extractRiddleProofProfileResult,
41
43
  normalizeRiddleProofProfile,
42
44
  profileStatusExitCode,
@@ -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;
@@ -0,0 +1,122 @@
1
+ {
2
+ "version": "riddle-proof.profile.v1",
3
+ "name": "terminal-result-partial-evidence",
4
+ "target": {
5
+ "route": "/playground",
6
+ "viewports": [
7
+ { "name": "mobile", "width": 390, "height": 844 },
8
+ { "name": "tablet", "width": 820, "height": 1180 },
9
+ { "name": "desktop", "width": 1440, "height": 1000 }
10
+ ],
11
+ "timeout_sec": 300,
12
+ "wait_ms": 800,
13
+ "network_mocks": [
14
+ {
15
+ "label": "api-console-sync-terminal-error-with-partial-evidence",
16
+ "url": "**/v1/run",
17
+ "method": "POST",
18
+ "status": 200,
19
+ "content_type": "application/json",
20
+ "required_hit_count": 3,
21
+ "max_hit_count": 3,
22
+ "capture_request_body": true,
23
+ "request_body_contains": [
24
+ "\"sync\":true",
25
+ "\"include\":[\"screenshots\",\"console\",\"har\"]",
26
+ "terminal-result-template-screenshot"
27
+ ],
28
+ "json": {
29
+ "status": "completed_error",
30
+ "success": false,
31
+ "job_id": "job_terminal_result_template",
32
+ "error": {
33
+ "message": "Synthetic terminal result template failed after collecting partial evidence"
34
+ },
35
+ "screenshots": [
36
+ {
37
+ "name": "terminal-result-template-screenshot",
38
+ "url": "https://cdn.example.invalid/terminal-result-template-screenshot.png"
39
+ }
40
+ ],
41
+ "console": [
42
+ {
43
+ "type": "log",
44
+ "text": "terminal result template collected console evidence"
45
+ }
46
+ ],
47
+ "har": {
48
+ "log": {
49
+ "entries": [
50
+ {
51
+ "request": {
52
+ "method": "GET",
53
+ "url": "https://example.com/terminal-result-template-resource"
54
+ },
55
+ "response": {
56
+ "status": 500
57
+ }
58
+ }
59
+ ]
60
+ }
61
+ },
62
+ "billing": {
63
+ "actual_seconds": 30,
64
+ "cost_usd": 0.004
65
+ }
66
+ }
67
+ }
68
+ ],
69
+ "setup_actions": [
70
+ { "type": "clear_storage", "storage": "both", "reload": true },
71
+ { "type": "wait_for_selector", "selector": "[data-testid='api-console-page']", "timeout_ms": 30000 },
72
+ { "type": "fill", "selector": "[data-testid='api-console-json']", "value": "{ \"steps\": [{ \"screenshot\": \"terminal-result-template-screenshot\" }], \"sync\": true, \"include\": [\"screenshots\", \"console\", \"har\"] }" },
73
+ { "type": "clear_console" },
74
+ { "type": "screenshot", "label": "terminal-result-before-submit" },
75
+ { "type": "click", "selector": "[data-testid='run-api-console']", "text": "Run" },
76
+ { "type": "wait_for_text", "selector": "body", "text": "Synthetic terminal result template failed after collecting partial evidence", "timeout_ms": 30000 },
77
+ { "type": "wait_for_text", "selector": "body", "text": "partial results available", "timeout_ms": 30000 },
78
+ { "type": "assert_text_visible", "selector": "body", "text": "terminal-result-template-screenshot", "timeout_ms": 5000 },
79
+ { "type": "assert_text_visible", "selector": "body", "text": "terminal result template collected console evidence", "timeout_ms": 5000 },
80
+ { "type": "assert_text_visible", "selector": "body", "text": "terminal-result-template-resource", "timeout_ms": 5000 },
81
+ { "type": "assert_text_absent", "selector": "body", "text": "Success", "timeout_ms": 1000 },
82
+ { "type": "assert_text_absent", "selector": "body", "text": "No screenshots captured", "timeout_ms": 1000 },
83
+ { "type": "assert_text_absent", "selector": "body", "text": "No console output captured", "timeout_ms": 1000 },
84
+ { "type": "assert_text_absent", "selector": "body", "text": "No network requests captured", "timeout_ms": 1000 },
85
+ { "type": "screenshot", "label": "terminal-result-partial-evidence-expanded" }
86
+ ]
87
+ },
88
+ "checks": [
89
+ { "type": "route_loaded", "expected_path": "/playground" },
90
+ { "type": "selector_visible", "selector": "[data-testid='api-console-page']" },
91
+ { "type": "text_visible", "text": "Error" },
92
+ { "type": "text_visible", "text": "Synthetic terminal result template failed after collecting partial evidence" },
93
+ { "type": "text_visible", "text": "partial results available" },
94
+ { "type": "selector_text_visible", "selector": "[data-testid='api-console-screenshots']", "text": "terminal-result-template-screenshot" },
95
+ { "type": "selector_text_visible", "selector": "[data-testid='api-console-output']", "text": "terminal result template collected console evidence" },
96
+ { "type": "selector_text_visible", "selector": "[data-testid='api-console-har']", "text": "terminal-result-template-resource" },
97
+ { "type": "text_absent", "text": "Success" },
98
+ { "type": "text_absent", "text": "No screenshots captured" },
99
+ { "type": "text_absent", "text": "No console output captured" },
100
+ { "type": "text_absent", "text": "No network requests captured" },
101
+ { "type": "text_absent", "text": "Application error" },
102
+ { "type": "selector_count_equals", "selector": "[data-testid='api-console-error-indicator']", "expected_count": 1 },
103
+ { "type": "selector_count_equals", "selector": "[data-testid='api-console-timeout-indicator']", "expected_count": 0 },
104
+ { "type": "selector_count_equals", "selector": "[data-testid='api-console-success-indicator']", "expected_count": 0 },
105
+ { "type": "selector_count_equals", "selector": "[data-testid='api-console-screenshot-item']", "expected_count": 1 },
106
+ { "type": "selector_count_at_least", "selector": "[data-testid='api-console-output']", "min_count": 1 },
107
+ { "type": "selector_count_at_least", "selector": "[data-testid='api-console-har']", "min_count": 1 },
108
+ { "type": "no_horizontal_overflow", "max_overflow_px": 1 },
109
+ { "type": "no_fatal_console_errors" },
110
+ { "type": "no_console_warnings" }
111
+ ],
112
+ "artifacts": ["screenshot", "console", "dom_summary", "proof_json"],
113
+ "baseline_policy": "invariant_only",
114
+ "failure_policy": {
115
+ "environment_blocked": "neutral",
116
+ "proof_insufficient": "fail",
117
+ "product_regression": "fail"
118
+ },
119
+ "metadata": {
120
+ "purpose": "Template for API-console terminal result honesty: return a terminal error or timeout JSON response with partial screenshot, console, and HAR evidence; require visible status honesty, partial-results copy, each artifact class, correct success/error/timeout selector polarity, no contradictory empty-evidence copy, and clean browser evidence. For timeout variants, change the mocked status and visible status checks to the product's timeout indicator while preserving the same partial-evidence contract."
121
+ }
122
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.120",
3
+ "version": "0.7.122",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",