@riddledc/riddle-proof 0.8.77 → 0.8.79

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.
Files changed (48) hide show
  1. package/README.md +65 -3
  2. package/dist/change-proof.cjs +744 -85
  3. package/dist/change-proof.d.cts +100 -8
  4. package/dist/change-proof.d.ts +100 -8
  5. package/dist/change-proof.js +15 -1
  6. package/dist/{chunk-B2DP2LET.js → chunk-5IFZSUPF.js} +52 -13
  7. package/dist/chunk-6VFS2JFR.js +886 -0
  8. package/dist/{chunk-IY4W6STC.js → chunk-7N6X54WG.js} +116 -17
  9. package/dist/{chunk-GG2D3MFZ.js → chunk-FCSJZBC5.js} +26 -1
  10. package/dist/chunk-MEVVL4TI.js +258 -0
  11. package/dist/{chunk-H25IDX76.js → chunk-NEXWITV4.js} +221 -35
  12. package/dist/{chunk-UE4I7RTI.js → chunk-RQPCKRKT.js} +1 -1
  13. package/dist/cli/index.js +7 -6
  14. package/dist/cli.cjs +2026 -1060
  15. package/dist/cli.js +7 -6
  16. package/dist/index.cjs +932 -122
  17. package/dist/index.d.cts +4 -3
  18. package/dist/index.d.ts +4 -3
  19. package/dist/index.js +42 -14
  20. package/dist/pr-comment.cjs +416 -17
  21. package/dist/pr-comment.d.cts +6 -1
  22. package/dist/pr-comment.d.ts +6 -1
  23. package/dist/pr-comment.js +6 -1
  24. package/dist/profile/index.cjs +26 -1
  25. package/dist/profile/index.js +1 -1
  26. package/dist/profile-suggestions.js +2 -2
  27. package/dist/profile.cjs +26 -1
  28. package/dist/profile.d.cts +7 -0
  29. package/dist/profile.d.ts +7 -0
  30. package/dist/profile.js +1 -1
  31. package/dist/receipts.cjs +286 -0
  32. package/dist/receipts.d.cts +115 -0
  33. package/dist/receipts.d.ts +115 -0
  34. package/dist/receipts.js +15 -0
  35. package/dist/riddle-client.cjs +98 -13
  36. package/dist/riddle-client.d.cts +18 -5
  37. package/dist/riddle-client.d.ts +18 -5
  38. package/dist/riddle-client.js +4 -1
  39. package/dist/runtime/index.cjs +98 -13
  40. package/dist/runtime/index.d.cts +5 -1
  41. package/dist/runtime/index.d.ts +5 -1
  42. package/dist/runtime/index.js +4 -1
  43. package/dist/runtime/riddle-client.cjs +98 -13
  44. package/dist/runtime/riddle-client.d.cts +5 -1
  45. package/dist/runtime/riddle-client.d.ts +5 -1
  46. package/dist/runtime/riddle-client.js +4 -1
  47. package/package.json +7 -2
  48. package/dist/chunk-BILL3UC2.js +0 -488
package/README.md CHANGED
@@ -50,6 +50,7 @@ import { runRiddleProof } from "@riddledc/riddle-proof/runner";
50
50
  import { createCaptureDiagnostic } from "@riddledc/riddle-proof/diagnostics";
51
51
  import { toRiddleProofRunParams } from "@riddledc/riddle-proof/openclaw";
52
52
  import { assessRiddleProofChange } from "@riddledc/riddle-proof/change-proof";
53
+ import { createRiddleProofObservationReceipt } from "@riddledc/riddle-proof/receipts";
53
54
  ```
54
55
 
55
56
  The root export provides generic contracts and helpers. Integration-specific
@@ -57,6 +58,35 @@ adapters are exposed through subpaths such as
57
58
  `@riddledc/riddle-proof/openclaw`, so wrappers can reuse the mapping logic
58
59
  without depending on another plugin runtime.
59
60
 
61
+ ### Compositional Receipts
62
+
63
+ Riddle records four different facts instead of flattening every run into one
64
+ surface label:
65
+
66
+ - `riddle.preview-receipt.v1` identifies immutable deployed content by Preview
67
+ ID, URL, expiration, content digest, and source Git identity.
68
+ - `riddle-proof.observation-receipt.v1` records an executor, target, comparison
69
+ role, artifacts, optional profile result, publication, and execution telemetry.
70
+ - `riddle-proof.change-receipt.v2` composes before and after Observation
71
+ receipts and evaluates only the declared delta and source-binding contract.
72
+ - `riddle-proof.handoff-receipt.v1` projects the Change verdict,
73
+ recommendation, and canonical screenshot pair for GitHub or another consumer.
74
+
75
+ Executor (`local_playwright`, `riddle_hosted`, or direct collection), target
76
+ (`url` or `preview`), proof contract, comparison role, publication, and source
77
+ identity are independent dimensions. A merge recommendation is evidence-based
78
+ advice; it does not grant shipping authorization.
79
+
80
+ Persist a deploy result and its immutable receipt for later Change Proof input:
81
+
82
+ ```sh
83
+ riddle-proof-loop riddle-preview-deploy build pr-123 --framework spa \
84
+ --output artifacts/riddle-proof/pr-123-preview
85
+ ```
86
+
87
+ When the hosted service returns a receipt, this writes both
88
+ `preview-deploy-result.json` and `preview-receipt.json`.
89
+
60
90
  ### Change Proof Contracts
61
91
 
62
92
  Use `assessRiddleProofChange` when one proof needs to compose two profile
@@ -86,6 +116,27 @@ group may be `passed` or `product_regression`, while the after group must be
86
116
  `proof_insufficient`, and a missing or failed required delta cannot become a
87
117
  passing change proof.
88
118
 
119
+ For a Preview-backed after state, require the immutable receipt and expected
120
+ revision in the change contract/input. Missing, dirty, digest-free, mismatched,
121
+ or expired required Preview evidence collapses to `proof_insufficient`:
122
+
123
+ ```ts
124
+ const result = assessRiddleProofChange({
125
+ name: "Hero art appears after change",
126
+ source_binding: { after: { preview_receipt_required: true } },
127
+ deltas: [{
128
+ type: "check_status_transition",
129
+ check_label: "hero-art-visible",
130
+ before_status: "failed",
131
+ after_status: "passed",
132
+ }],
133
+ }, {
134
+ before_observation: beforeObservation,
135
+ after_observation: afterObservation,
136
+ expected_source_revisions: { after: pullRequestHeadSha },
137
+ });
138
+ ```
139
+
89
140
  The CLI can collect the two sides against hosted Riddle targets and write one
90
141
  change receipt:
91
142
 
@@ -95,6 +146,8 @@ riddle-proof-loop run-change-proof \
95
146
  --change-contract .riddle-proof/change-contracts/hero-art-change.json \
96
147
  --before-url https://example.com \
97
148
  --after-url https://preview.example.com \
149
+ --after-preview-receipt artifacts/preview/preview-receipt.json \
150
+ --after-source-revision "$PR_HEAD_SHA" \
98
151
  --output artifacts/riddle-proof/hero-art-change
99
152
  ```
100
153
 
@@ -109,11 +162,18 @@ riddle-proof-loop run-change-proof \
109
162
  --result-format compact-json
110
163
  ```
111
164
 
165
+ Prefer `--before-observation` and `--after-observation` when source identity,
166
+ Preview binding, executor, publication, or hosted telemetry matters. Use
167
+ `--before-source-revision` and `--after-source-revision` to bind the comparison
168
+ to the expected commits.
169
+
112
170
  When `--output` / `--output-dir` is set, the command writes
113
171
  `change-proof-result.json`, `change-proof-receipt.json`,
114
- `change-proof-receipt.md`, `change-proof-receipt.html`, `summary.md`, and
172
+ `change-proof-receipt.md`, `change-proof-receipt.html`,
173
+ `handoff-receipt.json`, `handoff-receipt.md`, `summary.md`, and
115
174
  normalized copies of the `before/profile-result.json` and
116
- `after/profile-result.json` inputs. The receipt files are the human-facing
175
+ `after/profile-result.json` inputs plus each side's `observation-receipt.json`.
176
+ The receipt files are the human-facing
117
177
  handoff: they show the before/after evidence pair, delta verdicts, screenshot
118
178
  links when hosted artifacts are available, explicit proof claims from
119
179
  `metadata.required_receipts`, and limits from `metadata.does_not_prove`.
@@ -1249,7 +1309,9 @@ human progress lines to stderr while waiting. The JSON result includes
1249
1309
  `poll.timed_out`, `poll.elapsed_ms`, `poll.queue_elapsed_ms`,
1250
1310
  `poll.pre_submission_elapsed_ms`, and `poll.running_without_submission` so
1251
1311
  delayed dispatch is distinguishable from a terminal proof failure.
1252
- `queue_elapsed_ms` reflects Riddle's `created_at` to `submitted_at` timestamps;
1312
+ The progress snapshot also records the hosted `phase` and execution timestamps.
1313
+ `queue_elapsed_ms` ends when a worker claims the job; active browser execution
1314
+ is reported separately instead of being described as queue waiting.
1253
1315
  `pre_submission_elapsed_ms` preserves how long the CLI actually observed the
1254
1316
  job before `submitted_at` appeared. If `--wait` exhausts its attempts before a
1255
1317
  terminal job status, the command exits non-zero and the result explains the