@riddledc/riddle-proof 0.8.73 → 0.8.74
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 +30 -0
- package/dist/advanced/index.d.cts +1 -1
- package/dist/advanced/index.d.ts +1 -1
- package/dist/advanced/proof-run-engine.d.cts +1 -1
- package/dist/advanced/proof-run-engine.d.ts +1 -1
- package/dist/change-proof.cjs +193 -0
- package/dist/change-proof.d.cts +74 -0
- package/dist/change-proof.d.ts +74 -0
- package/dist/change-proof.js +11 -0
- package/dist/chunk-6S7DZWVC.js +167 -0
- package/dist/cli/index.js +3 -3
- package/dist/cli.js +3 -3
- package/dist/index.cjs +168 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23 -15
- package/dist/{proof-run-engine-DpChFR5H.d.cts → proof-run-engine-Baiv6l3A.d.cts} +3 -3
- package/dist/{proof-run-engine-BqRoA3Do.d.ts → proof-run-engine-MiKZt9oY.d.ts} +3 -3
- package/dist/proof-run-engine.d.cts +1 -1
- package/dist/proof-run-engine.d.ts +1 -1
- package/package.json +7 -2
- package/dist/{chunk-ICIJTEHD.js → chunk-ANUWU3DO.js} +4 -4
package/README.md
CHANGED
|
@@ -49,6 +49,7 @@ import { createRunResult, createRunState } from "@riddledc/riddle-proof";
|
|
|
49
49
|
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
|
+
import { assessRiddleProofChange } from "@riddledc/riddle-proof/change-proof";
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
The root export provides generic contracts and helpers. Integration-specific
|
|
@@ -56,6 +57,35 @@ adapters are exposed through subpaths such as
|
|
|
56
57
|
`@riddledc/riddle-proof/openclaw`, so wrappers can reuse the mapping logic
|
|
57
58
|
without depending on another plugin runtime.
|
|
58
59
|
|
|
60
|
+
### Change Proof Contracts
|
|
61
|
+
|
|
62
|
+
Use `assessRiddleProofChange` when one proof needs to compose two profile
|
|
63
|
+
results: a before target and an after target. The profile contract remains the
|
|
64
|
+
portable page-level sensor; the change contract binds that sensor to two
|
|
65
|
+
environments and checks the expected delta.
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
const result = assessRiddleProofChange({
|
|
69
|
+
version: "riddle-proof.change-contract.v1",
|
|
70
|
+
name: "Hero art appears after change",
|
|
71
|
+
deltas: [{
|
|
72
|
+
type: "check_status_transition",
|
|
73
|
+
check_label: "hero-art-visible",
|
|
74
|
+
before_status: "failed",
|
|
75
|
+
after_status: "passed",
|
|
76
|
+
}],
|
|
77
|
+
}, {
|
|
78
|
+
before_result: productionProfileResult,
|
|
79
|
+
after_result: previewProfileResult,
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The default group semantics are intentionally change-oriented: the before
|
|
84
|
+
group may be `passed` or `product_regression`, while the after group must be
|
|
85
|
+
`passed`. Environment blockers dominate, missing before/after evidence is
|
|
86
|
+
`proof_insufficient`, and a missing or failed required delta cannot become a
|
|
87
|
+
passing change proof.
|
|
88
|
+
|
|
59
89
|
## Durable Loop CLI
|
|
60
90
|
|
|
61
91
|
The package publishes `riddle-proof-loop` as a host-agnostic runner surface for
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { b as runner } from '../runner-4LJ5z0D-.cjs';
|
|
2
2
|
export { l as engineHarness } from '../engine-harness-LBfqbFSe.cjs';
|
|
3
3
|
export { p as proofRunCore } from '../proof-run-core-7Dqm7RKM.cjs';
|
|
4
|
-
export { p as proofRunEngine } from '../proof-run-engine-
|
|
4
|
+
export { p as proofRunEngine } from '../proof-run-engine-Baiv6l3A.cjs';
|
|
5
5
|
import '../types.cjs';
|
|
6
6
|
import '../public-state.cjs';
|
package/dist/advanced/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { b as runner } from '../runner-BdQpOkZD.js';
|
|
2
2
|
export { l as engineHarness } from '../engine-harness-CMACHP6A.js';
|
|
3
3
|
export { p as proofRunCore } from '../proof-run-core-7Dqm7RKM.js';
|
|
4
|
-
export { p as proofRunEngine } from '../proof-run-engine-
|
|
4
|
+
export { p as proofRunEngine } from '../proof-run-engine-MiKZt9oY.js';
|
|
5
5
|
import '../types.js';
|
|
6
6
|
import '../public-state.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-Baiv6l3A.cjs';
|
|
2
2
|
import '../proof-run-core-7Dqm7RKM.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-MiKZt9oY.js';
|
|
2
2
|
import '../proof-run-core-7Dqm7RKM.js';
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/change-proof.ts
|
|
21
|
+
var change_proof_exports = {};
|
|
22
|
+
__export(change_proof_exports, {
|
|
23
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION: () => RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
24
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION: () => RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
25
|
+
assessRiddleProofChange: () => assessRiddleProofChange
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(change_proof_exports);
|
|
28
|
+
var RIDDLE_PROOF_CHANGE_CONTRACT_VERSION = "riddle-proof.change-contract.v1";
|
|
29
|
+
var RIDDLE_PROOF_CHANGE_RESULT_VERSION = "riddle-proof.change-result.v1";
|
|
30
|
+
var DEFAULT_BEFORE_STATUSES = ["passed", "product_regression"];
|
|
31
|
+
var DEFAULT_AFTER_STATUSES = ["passed"];
|
|
32
|
+
var DEFAULT_PROFILE_STATUS_TRANSITION_BEFORE = ["product_regression"];
|
|
33
|
+
var DEFAULT_PROFILE_STATUS_TRANSITION_AFTER = ["passed"];
|
|
34
|
+
var DEFAULT_CHECK_STATUS_TRANSITION_BEFORE = ["failed"];
|
|
35
|
+
var DEFAULT_CHECK_STATUS_TRANSITION_AFTER = ["passed"];
|
|
36
|
+
function listValue(value, fallback) {
|
|
37
|
+
if (Array.isArray(value)) return value;
|
|
38
|
+
if (value === void 0) return fallback;
|
|
39
|
+
return [value];
|
|
40
|
+
}
|
|
41
|
+
function includesValue(allowed, observed) {
|
|
42
|
+
return observed !== void 0 && allowed.includes(observed);
|
|
43
|
+
}
|
|
44
|
+
function groupResult(side, contract, result) {
|
|
45
|
+
const fallback = side === "before" ? DEFAULT_BEFORE_STATUSES : DEFAULT_AFTER_STATUSES;
|
|
46
|
+
const requiredStatus = listValue(contract?.required_status, fallback);
|
|
47
|
+
const label = contract?.label || side;
|
|
48
|
+
if (!result) {
|
|
49
|
+
return {
|
|
50
|
+
side,
|
|
51
|
+
label,
|
|
52
|
+
ok: false,
|
|
53
|
+
status: "missing",
|
|
54
|
+
required_status: requiredStatus,
|
|
55
|
+
message: `${label} profile result is missing.`
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const ok = includesValue(requiredStatus, result.status);
|
|
59
|
+
return {
|
|
60
|
+
side,
|
|
61
|
+
label,
|
|
62
|
+
ok,
|
|
63
|
+
profile_name: result.profile_name,
|
|
64
|
+
status: result.status,
|
|
65
|
+
required_status: requiredStatus,
|
|
66
|
+
summary: result.summary,
|
|
67
|
+
message: ok ? void 0 : `${label} profile status ${result.status} did not match required status ${requiredStatus.join(", ")}.`
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function findCheck(result, delta) {
|
|
71
|
+
return result.checks.find((check) => {
|
|
72
|
+
if (delta.check_label && check.label !== delta.check_label) return false;
|
|
73
|
+
if (delta.check_type && check.type !== delta.check_type) return false;
|
|
74
|
+
return Boolean(delta.check_label || delta.check_type);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function profileStatusTransitionResult(delta, before, after) {
|
|
78
|
+
const label = delta.label || "profile-status-transition";
|
|
79
|
+
if (!before || !after) {
|
|
80
|
+
return {
|
|
81
|
+
type: delta.type,
|
|
82
|
+
label,
|
|
83
|
+
status: "proof_insufficient",
|
|
84
|
+
before_observed: before?.status,
|
|
85
|
+
after_observed: after?.status,
|
|
86
|
+
message: `${label} needs both before and after profile results.`
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const beforeAllowed = listValue(delta.before_status, DEFAULT_PROFILE_STATUS_TRANSITION_BEFORE);
|
|
90
|
+
const afterAllowed = listValue(delta.after_status, DEFAULT_PROFILE_STATUS_TRANSITION_AFTER);
|
|
91
|
+
const passed = includesValue(beforeAllowed, before.status) && includesValue(afterAllowed, after.status);
|
|
92
|
+
return {
|
|
93
|
+
type: delta.type,
|
|
94
|
+
label,
|
|
95
|
+
status: passed ? "passed" : "failed",
|
|
96
|
+
before_observed: before.status,
|
|
97
|
+
after_observed: after.status,
|
|
98
|
+
message: passed ? void 0 : `${label} expected before ${beforeAllowed.join(", ")} and after ${afterAllowed.join(", ")}, got ${before.status} -> ${after.status}.`
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function checkStatusTransitionResult(delta, before, after) {
|
|
102
|
+
const label = delta.label || delta.check_label || delta.check_type || "check-status-transition";
|
|
103
|
+
if (!delta.check_label && !delta.check_type) {
|
|
104
|
+
return {
|
|
105
|
+
type: delta.type,
|
|
106
|
+
label,
|
|
107
|
+
status: "configuration_error",
|
|
108
|
+
message: `${label} needs check_label or check_type.`
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (!before || !after) {
|
|
112
|
+
return {
|
|
113
|
+
type: delta.type,
|
|
114
|
+
label,
|
|
115
|
+
status: "proof_insufficient",
|
|
116
|
+
before_observed: before?.status,
|
|
117
|
+
after_observed: after?.status,
|
|
118
|
+
message: `${label} needs both before and after profile results.`
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const beforeCheck = findCheck(before, delta);
|
|
122
|
+
const afterCheck = findCheck(after, delta);
|
|
123
|
+
if (!beforeCheck || !afterCheck) {
|
|
124
|
+
return {
|
|
125
|
+
type: delta.type,
|
|
126
|
+
label,
|
|
127
|
+
status: "proof_insufficient",
|
|
128
|
+
before_observed: beforeCheck?.status,
|
|
129
|
+
after_observed: afterCheck?.status,
|
|
130
|
+
message: `${label} was not present in ${!beforeCheck && !afterCheck ? "before or after" : !beforeCheck ? "before" : "after"} profile checks.`
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const beforeAllowed = listValue(delta.before_status, DEFAULT_CHECK_STATUS_TRANSITION_BEFORE);
|
|
134
|
+
const afterAllowed = listValue(delta.after_status, DEFAULT_CHECK_STATUS_TRANSITION_AFTER);
|
|
135
|
+
const passed = includesValue(beforeAllowed, beforeCheck.status) && includesValue(afterAllowed, afterCheck.status);
|
|
136
|
+
return {
|
|
137
|
+
type: delta.type,
|
|
138
|
+
label,
|
|
139
|
+
status: passed ? "passed" : "failed",
|
|
140
|
+
before_observed: beforeCheck.status,
|
|
141
|
+
after_observed: afterCheck.status,
|
|
142
|
+
message: passed ? void 0 : `${label} expected before ${beforeAllowed.join(", ")} and after ${afterAllowed.join(", ")}, got ${beforeCheck.status} -> ${afterCheck.status}.`
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function assessDelta(delta, before, after) {
|
|
146
|
+
if (delta.type === "profile_status_transition") {
|
|
147
|
+
return profileStatusTransitionResult(delta, before, after);
|
|
148
|
+
}
|
|
149
|
+
return checkStatusTransitionResult(delta, before, after);
|
|
150
|
+
}
|
|
151
|
+
function collapsedChangeStatus(groups, deltas) {
|
|
152
|
+
const groupResults = [groups.before, groups.after];
|
|
153
|
+
if (groupResults.some((group) => group.status === "environment_blocked")) return "environment_blocked";
|
|
154
|
+
if (groupResults.some((group) => group.status === "configuration_error")) return "configuration_error";
|
|
155
|
+
if (deltas.some((delta) => delta.status === "configuration_error")) return "configuration_error";
|
|
156
|
+
if (groupResults.some((group) => group.status === "needs_human_review")) return "needs_human_review";
|
|
157
|
+
if (groupResults.some((group) => group.status === "missing" || group.status === "proof_insufficient")) return "proof_insufficient";
|
|
158
|
+
if (!deltas.length || deltas.some((delta) => delta.status === "proof_insufficient")) return "proof_insufficient";
|
|
159
|
+
if (groupResults.some((group) => !group.ok)) return "product_regression";
|
|
160
|
+
if (deltas.some((delta) => delta.status === "failed")) return "product_regression";
|
|
161
|
+
return "passed";
|
|
162
|
+
}
|
|
163
|
+
function changeSummary(name, status, deltas) {
|
|
164
|
+
if (status === "passed") return `${name} passed ${deltas.length} change delta(s).`;
|
|
165
|
+
if (status === "environment_blocked") return `${name} could not compare reliable evidence because an environment was blocked.`;
|
|
166
|
+
if (status === "configuration_error") return `${name} has an invalid change proof contract.`;
|
|
167
|
+
if (status === "needs_human_review") return `${name} needs human review before the change proof can pass.`;
|
|
168
|
+
if (status === "proof_insufficient") return `${name} did not produce enough before/after evidence for a change proof.`;
|
|
169
|
+
return `${name} failed ${deltas.filter((delta) => delta.status === "failed").length} change delta(s).`;
|
|
170
|
+
}
|
|
171
|
+
function assessRiddleProofChange(contract, input) {
|
|
172
|
+
const groups = {
|
|
173
|
+
before: groupResult("before", contract.before, input.before_result),
|
|
174
|
+
after: groupResult("after", contract.after, input.after_result)
|
|
175
|
+
};
|
|
176
|
+
const deltas = (contract.deltas || []).map((delta) => assessDelta(delta, input.before_result, input.after_result));
|
|
177
|
+
const status = collapsedChangeStatus(groups, deltas);
|
|
178
|
+
return {
|
|
179
|
+
version: RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
180
|
+
contract_name: contract.name,
|
|
181
|
+
status,
|
|
182
|
+
groups,
|
|
183
|
+
deltas,
|
|
184
|
+
summary: changeSummary(contract.name, status, deltas),
|
|
185
|
+
metadata: contract.metadata
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
189
|
+
0 && (module.exports = {
|
|
190
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
191
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
192
|
+
assessRiddleProofChange
|
|
193
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { RiddleProofProfileResult, RiddleProofProfileStatus, RiddleProofProfileCheckResult } from './profile.cjs';
|
|
2
|
+
import { JsonValue } from './types.cjs';
|
|
3
|
+
import './public-state.cjs';
|
|
4
|
+
|
|
5
|
+
declare const RIDDLE_PROOF_CHANGE_CONTRACT_VERSION: "riddle-proof.change-contract.v1";
|
|
6
|
+
declare const RIDDLE_PROOF_CHANGE_RESULT_VERSION: "riddle-proof.change-result.v1";
|
|
7
|
+
type RiddleProofChangeSide = "before" | "after";
|
|
8
|
+
type RiddleProofChangeStatus = RiddleProofProfileStatus;
|
|
9
|
+
type RiddleProofChangeDeltaStatus = "passed" | "failed" | "proof_insufficient" | "configuration_error";
|
|
10
|
+
type RiddleProofChangeProfileCheckStatus = RiddleProofProfileCheckResult["status"];
|
|
11
|
+
interface RiddleProofChangeGroupContract {
|
|
12
|
+
label?: string;
|
|
13
|
+
required_status?: RiddleProofProfileStatus | RiddleProofProfileStatus[];
|
|
14
|
+
}
|
|
15
|
+
interface RiddleProofProfileStatusTransitionDelta {
|
|
16
|
+
type: "profile_status_transition";
|
|
17
|
+
label?: string;
|
|
18
|
+
before_status?: RiddleProofProfileStatus | RiddleProofProfileStatus[];
|
|
19
|
+
after_status?: RiddleProofProfileStatus | RiddleProofProfileStatus[];
|
|
20
|
+
}
|
|
21
|
+
interface RiddleProofCheckStatusTransitionDelta {
|
|
22
|
+
type: "check_status_transition";
|
|
23
|
+
label?: string;
|
|
24
|
+
check_label?: string;
|
|
25
|
+
check_type?: string;
|
|
26
|
+
before_status?: RiddleProofChangeProfileCheckStatus | RiddleProofChangeProfileCheckStatus[];
|
|
27
|
+
after_status?: RiddleProofChangeProfileCheckStatus | RiddleProofChangeProfileCheckStatus[];
|
|
28
|
+
}
|
|
29
|
+
type RiddleProofChangeDelta = RiddleProofProfileStatusTransitionDelta | RiddleProofCheckStatusTransitionDelta;
|
|
30
|
+
interface RiddleProofChangeContract {
|
|
31
|
+
version?: typeof RIDDLE_PROOF_CHANGE_CONTRACT_VERSION;
|
|
32
|
+
name: string;
|
|
33
|
+
before?: RiddleProofChangeGroupContract;
|
|
34
|
+
after?: RiddleProofChangeGroupContract;
|
|
35
|
+
deltas: RiddleProofChangeDelta[];
|
|
36
|
+
metadata?: Record<string, JsonValue>;
|
|
37
|
+
}
|
|
38
|
+
interface RiddleProofChangeGroupResult {
|
|
39
|
+
side: RiddleProofChangeSide;
|
|
40
|
+
label: string;
|
|
41
|
+
ok: boolean;
|
|
42
|
+
profile_name?: string;
|
|
43
|
+
status: RiddleProofProfileStatus | "missing";
|
|
44
|
+
required_status: RiddleProofProfileStatus[];
|
|
45
|
+
summary?: string;
|
|
46
|
+
message?: string;
|
|
47
|
+
}
|
|
48
|
+
interface RiddleProofChangeDeltaResult {
|
|
49
|
+
type: RiddleProofChangeDelta["type"];
|
|
50
|
+
label: string;
|
|
51
|
+
status: RiddleProofChangeDeltaStatus;
|
|
52
|
+
before_observed?: JsonValue;
|
|
53
|
+
after_observed?: JsonValue;
|
|
54
|
+
message?: string;
|
|
55
|
+
}
|
|
56
|
+
interface RiddleProofChangeResult {
|
|
57
|
+
version: typeof RIDDLE_PROOF_CHANGE_RESULT_VERSION;
|
|
58
|
+
contract_name: string;
|
|
59
|
+
status: RiddleProofChangeStatus;
|
|
60
|
+
groups: {
|
|
61
|
+
before: RiddleProofChangeGroupResult;
|
|
62
|
+
after: RiddleProofChangeGroupResult;
|
|
63
|
+
};
|
|
64
|
+
deltas: RiddleProofChangeDeltaResult[];
|
|
65
|
+
summary: string;
|
|
66
|
+
metadata?: Record<string, JsonValue>;
|
|
67
|
+
}
|
|
68
|
+
interface AssessRiddleProofChangeInput {
|
|
69
|
+
before_result?: RiddleProofProfileResult;
|
|
70
|
+
after_result?: RiddleProofProfileResult;
|
|
71
|
+
}
|
|
72
|
+
declare function assessRiddleProofChange(contract: RiddleProofChangeContract, input: AssessRiddleProofChangeInput): RiddleProofChangeResult;
|
|
73
|
+
|
|
74
|
+
export { type AssessRiddleProofChangeInput, RIDDLE_PROOF_CHANGE_CONTRACT_VERSION, RIDDLE_PROOF_CHANGE_RESULT_VERSION, type RiddleProofChangeContract, type RiddleProofChangeDelta, type RiddleProofChangeDeltaResult, type RiddleProofChangeDeltaStatus, type RiddleProofChangeGroupContract, type RiddleProofChangeGroupResult, type RiddleProofChangeProfileCheckStatus, type RiddleProofChangeResult, type RiddleProofChangeSide, type RiddleProofChangeStatus, type RiddleProofCheckStatusTransitionDelta, type RiddleProofProfileStatusTransitionDelta, assessRiddleProofChange };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { RiddleProofProfileResult, RiddleProofProfileStatus, RiddleProofProfileCheckResult } from './profile.js';
|
|
2
|
+
import { JsonValue } from './types.js';
|
|
3
|
+
import './public-state.js';
|
|
4
|
+
|
|
5
|
+
declare const RIDDLE_PROOF_CHANGE_CONTRACT_VERSION: "riddle-proof.change-contract.v1";
|
|
6
|
+
declare const RIDDLE_PROOF_CHANGE_RESULT_VERSION: "riddle-proof.change-result.v1";
|
|
7
|
+
type RiddleProofChangeSide = "before" | "after";
|
|
8
|
+
type RiddleProofChangeStatus = RiddleProofProfileStatus;
|
|
9
|
+
type RiddleProofChangeDeltaStatus = "passed" | "failed" | "proof_insufficient" | "configuration_error";
|
|
10
|
+
type RiddleProofChangeProfileCheckStatus = RiddleProofProfileCheckResult["status"];
|
|
11
|
+
interface RiddleProofChangeGroupContract {
|
|
12
|
+
label?: string;
|
|
13
|
+
required_status?: RiddleProofProfileStatus | RiddleProofProfileStatus[];
|
|
14
|
+
}
|
|
15
|
+
interface RiddleProofProfileStatusTransitionDelta {
|
|
16
|
+
type: "profile_status_transition";
|
|
17
|
+
label?: string;
|
|
18
|
+
before_status?: RiddleProofProfileStatus | RiddleProofProfileStatus[];
|
|
19
|
+
after_status?: RiddleProofProfileStatus | RiddleProofProfileStatus[];
|
|
20
|
+
}
|
|
21
|
+
interface RiddleProofCheckStatusTransitionDelta {
|
|
22
|
+
type: "check_status_transition";
|
|
23
|
+
label?: string;
|
|
24
|
+
check_label?: string;
|
|
25
|
+
check_type?: string;
|
|
26
|
+
before_status?: RiddleProofChangeProfileCheckStatus | RiddleProofChangeProfileCheckStatus[];
|
|
27
|
+
after_status?: RiddleProofChangeProfileCheckStatus | RiddleProofChangeProfileCheckStatus[];
|
|
28
|
+
}
|
|
29
|
+
type RiddleProofChangeDelta = RiddleProofProfileStatusTransitionDelta | RiddleProofCheckStatusTransitionDelta;
|
|
30
|
+
interface RiddleProofChangeContract {
|
|
31
|
+
version?: typeof RIDDLE_PROOF_CHANGE_CONTRACT_VERSION;
|
|
32
|
+
name: string;
|
|
33
|
+
before?: RiddleProofChangeGroupContract;
|
|
34
|
+
after?: RiddleProofChangeGroupContract;
|
|
35
|
+
deltas: RiddleProofChangeDelta[];
|
|
36
|
+
metadata?: Record<string, JsonValue>;
|
|
37
|
+
}
|
|
38
|
+
interface RiddleProofChangeGroupResult {
|
|
39
|
+
side: RiddleProofChangeSide;
|
|
40
|
+
label: string;
|
|
41
|
+
ok: boolean;
|
|
42
|
+
profile_name?: string;
|
|
43
|
+
status: RiddleProofProfileStatus | "missing";
|
|
44
|
+
required_status: RiddleProofProfileStatus[];
|
|
45
|
+
summary?: string;
|
|
46
|
+
message?: string;
|
|
47
|
+
}
|
|
48
|
+
interface RiddleProofChangeDeltaResult {
|
|
49
|
+
type: RiddleProofChangeDelta["type"];
|
|
50
|
+
label: string;
|
|
51
|
+
status: RiddleProofChangeDeltaStatus;
|
|
52
|
+
before_observed?: JsonValue;
|
|
53
|
+
after_observed?: JsonValue;
|
|
54
|
+
message?: string;
|
|
55
|
+
}
|
|
56
|
+
interface RiddleProofChangeResult {
|
|
57
|
+
version: typeof RIDDLE_PROOF_CHANGE_RESULT_VERSION;
|
|
58
|
+
contract_name: string;
|
|
59
|
+
status: RiddleProofChangeStatus;
|
|
60
|
+
groups: {
|
|
61
|
+
before: RiddleProofChangeGroupResult;
|
|
62
|
+
after: RiddleProofChangeGroupResult;
|
|
63
|
+
};
|
|
64
|
+
deltas: RiddleProofChangeDeltaResult[];
|
|
65
|
+
summary: string;
|
|
66
|
+
metadata?: Record<string, JsonValue>;
|
|
67
|
+
}
|
|
68
|
+
interface AssessRiddleProofChangeInput {
|
|
69
|
+
before_result?: RiddleProofProfileResult;
|
|
70
|
+
after_result?: RiddleProofProfileResult;
|
|
71
|
+
}
|
|
72
|
+
declare function assessRiddleProofChange(contract: RiddleProofChangeContract, input: AssessRiddleProofChangeInput): RiddleProofChangeResult;
|
|
73
|
+
|
|
74
|
+
export { type AssessRiddleProofChangeInput, RIDDLE_PROOF_CHANGE_CONTRACT_VERSION, RIDDLE_PROOF_CHANGE_RESULT_VERSION, type RiddleProofChangeContract, type RiddleProofChangeDelta, type RiddleProofChangeDeltaResult, type RiddleProofChangeDeltaStatus, type RiddleProofChangeGroupContract, type RiddleProofChangeGroupResult, type RiddleProofChangeProfileCheckStatus, type RiddleProofChangeResult, type RiddleProofChangeSide, type RiddleProofChangeStatus, type RiddleProofCheckStatusTransitionDelta, type RiddleProofProfileStatusTransitionDelta, assessRiddleProofChange };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
3
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
4
|
+
assessRiddleProofChange
|
|
5
|
+
} from "./chunk-6S7DZWVC.js";
|
|
6
|
+
import "./chunk-MLKGABMK.js";
|
|
7
|
+
export {
|
|
8
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
9
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
10
|
+
assessRiddleProofChange
|
|
11
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// src/change-proof.ts
|
|
2
|
+
var RIDDLE_PROOF_CHANGE_CONTRACT_VERSION = "riddle-proof.change-contract.v1";
|
|
3
|
+
var RIDDLE_PROOF_CHANGE_RESULT_VERSION = "riddle-proof.change-result.v1";
|
|
4
|
+
var DEFAULT_BEFORE_STATUSES = ["passed", "product_regression"];
|
|
5
|
+
var DEFAULT_AFTER_STATUSES = ["passed"];
|
|
6
|
+
var DEFAULT_PROFILE_STATUS_TRANSITION_BEFORE = ["product_regression"];
|
|
7
|
+
var DEFAULT_PROFILE_STATUS_TRANSITION_AFTER = ["passed"];
|
|
8
|
+
var DEFAULT_CHECK_STATUS_TRANSITION_BEFORE = ["failed"];
|
|
9
|
+
var DEFAULT_CHECK_STATUS_TRANSITION_AFTER = ["passed"];
|
|
10
|
+
function listValue(value, fallback) {
|
|
11
|
+
if (Array.isArray(value)) return value;
|
|
12
|
+
if (value === void 0) return fallback;
|
|
13
|
+
return [value];
|
|
14
|
+
}
|
|
15
|
+
function includesValue(allowed, observed) {
|
|
16
|
+
return observed !== void 0 && allowed.includes(observed);
|
|
17
|
+
}
|
|
18
|
+
function groupResult(side, contract, result) {
|
|
19
|
+
const fallback = side === "before" ? DEFAULT_BEFORE_STATUSES : DEFAULT_AFTER_STATUSES;
|
|
20
|
+
const requiredStatus = listValue(contract?.required_status, fallback);
|
|
21
|
+
const label = contract?.label || side;
|
|
22
|
+
if (!result) {
|
|
23
|
+
return {
|
|
24
|
+
side,
|
|
25
|
+
label,
|
|
26
|
+
ok: false,
|
|
27
|
+
status: "missing",
|
|
28
|
+
required_status: requiredStatus,
|
|
29
|
+
message: `${label} profile result is missing.`
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const ok = includesValue(requiredStatus, result.status);
|
|
33
|
+
return {
|
|
34
|
+
side,
|
|
35
|
+
label,
|
|
36
|
+
ok,
|
|
37
|
+
profile_name: result.profile_name,
|
|
38
|
+
status: result.status,
|
|
39
|
+
required_status: requiredStatus,
|
|
40
|
+
summary: result.summary,
|
|
41
|
+
message: ok ? void 0 : `${label} profile status ${result.status} did not match required status ${requiredStatus.join(", ")}.`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function findCheck(result, delta) {
|
|
45
|
+
return result.checks.find((check) => {
|
|
46
|
+
if (delta.check_label && check.label !== delta.check_label) return false;
|
|
47
|
+
if (delta.check_type && check.type !== delta.check_type) return false;
|
|
48
|
+
return Boolean(delta.check_label || delta.check_type);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function profileStatusTransitionResult(delta, before, after) {
|
|
52
|
+
const label = delta.label || "profile-status-transition";
|
|
53
|
+
if (!before || !after) {
|
|
54
|
+
return {
|
|
55
|
+
type: delta.type,
|
|
56
|
+
label,
|
|
57
|
+
status: "proof_insufficient",
|
|
58
|
+
before_observed: before?.status,
|
|
59
|
+
after_observed: after?.status,
|
|
60
|
+
message: `${label} needs both before and after profile results.`
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const beforeAllowed = listValue(delta.before_status, DEFAULT_PROFILE_STATUS_TRANSITION_BEFORE);
|
|
64
|
+
const afterAllowed = listValue(delta.after_status, DEFAULT_PROFILE_STATUS_TRANSITION_AFTER);
|
|
65
|
+
const passed = includesValue(beforeAllowed, before.status) && includesValue(afterAllowed, after.status);
|
|
66
|
+
return {
|
|
67
|
+
type: delta.type,
|
|
68
|
+
label,
|
|
69
|
+
status: passed ? "passed" : "failed",
|
|
70
|
+
before_observed: before.status,
|
|
71
|
+
after_observed: after.status,
|
|
72
|
+
message: passed ? void 0 : `${label} expected before ${beforeAllowed.join(", ")} and after ${afterAllowed.join(", ")}, got ${before.status} -> ${after.status}.`
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function checkStatusTransitionResult(delta, before, after) {
|
|
76
|
+
const label = delta.label || delta.check_label || delta.check_type || "check-status-transition";
|
|
77
|
+
if (!delta.check_label && !delta.check_type) {
|
|
78
|
+
return {
|
|
79
|
+
type: delta.type,
|
|
80
|
+
label,
|
|
81
|
+
status: "configuration_error",
|
|
82
|
+
message: `${label} needs check_label or check_type.`
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (!before || !after) {
|
|
86
|
+
return {
|
|
87
|
+
type: delta.type,
|
|
88
|
+
label,
|
|
89
|
+
status: "proof_insufficient",
|
|
90
|
+
before_observed: before?.status,
|
|
91
|
+
after_observed: after?.status,
|
|
92
|
+
message: `${label} needs both before and after profile results.`
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const beforeCheck = findCheck(before, delta);
|
|
96
|
+
const afterCheck = findCheck(after, delta);
|
|
97
|
+
if (!beforeCheck || !afterCheck) {
|
|
98
|
+
return {
|
|
99
|
+
type: delta.type,
|
|
100
|
+
label,
|
|
101
|
+
status: "proof_insufficient",
|
|
102
|
+
before_observed: beforeCheck?.status,
|
|
103
|
+
after_observed: afterCheck?.status,
|
|
104
|
+
message: `${label} was not present in ${!beforeCheck && !afterCheck ? "before or after" : !beforeCheck ? "before" : "after"} profile checks.`
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const beforeAllowed = listValue(delta.before_status, DEFAULT_CHECK_STATUS_TRANSITION_BEFORE);
|
|
108
|
+
const afterAllowed = listValue(delta.after_status, DEFAULT_CHECK_STATUS_TRANSITION_AFTER);
|
|
109
|
+
const passed = includesValue(beforeAllowed, beforeCheck.status) && includesValue(afterAllowed, afterCheck.status);
|
|
110
|
+
return {
|
|
111
|
+
type: delta.type,
|
|
112
|
+
label,
|
|
113
|
+
status: passed ? "passed" : "failed",
|
|
114
|
+
before_observed: beforeCheck.status,
|
|
115
|
+
after_observed: afterCheck.status,
|
|
116
|
+
message: passed ? void 0 : `${label} expected before ${beforeAllowed.join(", ")} and after ${afterAllowed.join(", ")}, got ${beforeCheck.status} -> ${afterCheck.status}.`
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function assessDelta(delta, before, after) {
|
|
120
|
+
if (delta.type === "profile_status_transition") {
|
|
121
|
+
return profileStatusTransitionResult(delta, before, after);
|
|
122
|
+
}
|
|
123
|
+
return checkStatusTransitionResult(delta, before, after);
|
|
124
|
+
}
|
|
125
|
+
function collapsedChangeStatus(groups, deltas) {
|
|
126
|
+
const groupResults = [groups.before, groups.after];
|
|
127
|
+
if (groupResults.some((group) => group.status === "environment_blocked")) return "environment_blocked";
|
|
128
|
+
if (groupResults.some((group) => group.status === "configuration_error")) return "configuration_error";
|
|
129
|
+
if (deltas.some((delta) => delta.status === "configuration_error")) return "configuration_error";
|
|
130
|
+
if (groupResults.some((group) => group.status === "needs_human_review")) return "needs_human_review";
|
|
131
|
+
if (groupResults.some((group) => group.status === "missing" || group.status === "proof_insufficient")) return "proof_insufficient";
|
|
132
|
+
if (!deltas.length || deltas.some((delta) => delta.status === "proof_insufficient")) return "proof_insufficient";
|
|
133
|
+
if (groupResults.some((group) => !group.ok)) return "product_regression";
|
|
134
|
+
if (deltas.some((delta) => delta.status === "failed")) return "product_regression";
|
|
135
|
+
return "passed";
|
|
136
|
+
}
|
|
137
|
+
function changeSummary(name, status, deltas) {
|
|
138
|
+
if (status === "passed") return `${name} passed ${deltas.length} change delta(s).`;
|
|
139
|
+
if (status === "environment_blocked") return `${name} could not compare reliable evidence because an environment was blocked.`;
|
|
140
|
+
if (status === "configuration_error") return `${name} has an invalid change proof contract.`;
|
|
141
|
+
if (status === "needs_human_review") return `${name} needs human review before the change proof can pass.`;
|
|
142
|
+
if (status === "proof_insufficient") return `${name} did not produce enough before/after evidence for a change proof.`;
|
|
143
|
+
return `${name} failed ${deltas.filter((delta) => delta.status === "failed").length} change delta(s).`;
|
|
144
|
+
}
|
|
145
|
+
function assessRiddleProofChange(contract, input) {
|
|
146
|
+
const groups = {
|
|
147
|
+
before: groupResult("before", contract.before, input.before_result),
|
|
148
|
+
after: groupResult("after", contract.after, input.after_result)
|
|
149
|
+
};
|
|
150
|
+
const deltas = (contract.deltas || []).map((delta) => assessDelta(delta, input.before_result, input.after_result));
|
|
151
|
+
const status = collapsedChangeStatus(groups, deltas);
|
|
152
|
+
return {
|
|
153
|
+
version: RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
154
|
+
contract_name: contract.name,
|
|
155
|
+
status,
|
|
156
|
+
groups,
|
|
157
|
+
deltas,
|
|
158
|
+
summary: changeSummary(contract.name, status, deltas),
|
|
159
|
+
metadata: contract.metadata
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
165
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
166
|
+
assessRiddleProofChange
|
|
167
|
+
};
|
package/dist/cli/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-ANUWU3DO.js";
|
|
2
2
|
import "../chunk-B2DP2LET.js";
|
|
3
|
+
import "../chunk-JFQXAJH2.js";
|
|
3
4
|
import "../chunk-CWRIXP5H.js";
|
|
4
5
|
import "../chunk-UE4I7RTI.js";
|
|
5
6
|
import "../chunk-GG2D3MFZ.js";
|
|
7
|
+
import "../chunk-KXLEN4SA.js";
|
|
6
8
|
import "../chunk-WLUMLHII.js";
|
|
7
9
|
import "../chunk-CGJX7LJO.js";
|
|
8
10
|
import "../chunk-UTCL7FEZ.js";
|
|
9
11
|
import "../chunk-EKZXU6MU.js";
|
|
10
12
|
import "../chunk-DYE3URAQ.js";
|
|
11
|
-
import "../chunk-JFQXAJH2.js";
|
|
12
|
-
import "../chunk-KXLEN4SA.js";
|
|
13
13
|
import "../chunk-NKHZASNQ.js";
|
|
14
14
|
import "../chunk-ZAR7BWMN.js";
|
|
15
15
|
import "../chunk-MLKGABMK.js";
|
package/dist/cli.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-ANUWU3DO.js";
|
|
3
3
|
import "./chunk-B2DP2LET.js";
|
|
4
|
+
import "./chunk-JFQXAJH2.js";
|
|
4
5
|
import "./chunk-CWRIXP5H.js";
|
|
5
6
|
import "./chunk-UE4I7RTI.js";
|
|
6
7
|
import "./chunk-GG2D3MFZ.js";
|
|
8
|
+
import "./chunk-KXLEN4SA.js";
|
|
7
9
|
import "./chunk-WLUMLHII.js";
|
|
8
10
|
import "./chunk-CGJX7LJO.js";
|
|
9
11
|
import "./chunk-UTCL7FEZ.js";
|
|
10
12
|
import "./chunk-EKZXU6MU.js";
|
|
11
13
|
import "./chunk-DYE3URAQ.js";
|
|
12
|
-
import "./chunk-JFQXAJH2.js";
|
|
13
|
-
import "./chunk-KXLEN4SA.js";
|
|
14
14
|
import "./chunk-NKHZASNQ.js";
|
|
15
15
|
import "./chunk-ZAR7BWMN.js";
|
|
16
16
|
import "./chunk-MLKGABMK.js";
|
package/dist/index.cjs
CHANGED
|
@@ -3418,6 +3418,8 @@ __export(index_exports, {
|
|
|
3418
3418
|
RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION: () => RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION,
|
|
3419
3419
|
RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION: () => RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION,
|
|
3420
3420
|
RIDDLE_PROOF_CAPTURE_DIAGNOSTIC_VERSION: () => RIDDLE_PROOF_CAPTURE_DIAGNOSTIC_VERSION,
|
|
3421
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION: () => RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
3422
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION: () => RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
3421
3423
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION: () => RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
3422
3424
|
RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION: () => RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
|
3423
3425
|
RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS: () => RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS,
|
|
@@ -3450,6 +3452,7 @@ __export(index_exports, {
|
|
|
3450
3452
|
assessBasicGameplayProgressionChecks: () => assessBasicGameplayProgressionChecks,
|
|
3451
3453
|
assessBasicGameplayRoute: () => assessBasicGameplayRoute,
|
|
3452
3454
|
assessPlayabilityEvidence: () => assessPlayabilityEvidence,
|
|
3455
|
+
assessRiddleProofChange: () => assessRiddleProofChange,
|
|
3453
3456
|
assessRiddleProofProfileArtifactCompleteness: () => assessRiddleProofProfileArtifactCompleteness,
|
|
3454
3457
|
assessRiddleProofProfileEvidence: () => assessRiddleProofProfileEvidence,
|
|
3455
3458
|
attachBasicGameplayArtifactScreenshotHashes: () => attachBasicGameplayArtifactScreenshotHashes,
|
|
@@ -19929,6 +19932,168 @@ function suggestRiddleProofProfileChecks(input) {
|
|
|
19929
19932
|
};
|
|
19930
19933
|
}
|
|
19931
19934
|
|
|
19935
|
+
// src/change-proof.ts
|
|
19936
|
+
var RIDDLE_PROOF_CHANGE_CONTRACT_VERSION = "riddle-proof.change-contract.v1";
|
|
19937
|
+
var RIDDLE_PROOF_CHANGE_RESULT_VERSION = "riddle-proof.change-result.v1";
|
|
19938
|
+
var DEFAULT_BEFORE_STATUSES = ["passed", "product_regression"];
|
|
19939
|
+
var DEFAULT_AFTER_STATUSES = ["passed"];
|
|
19940
|
+
var DEFAULT_PROFILE_STATUS_TRANSITION_BEFORE = ["product_regression"];
|
|
19941
|
+
var DEFAULT_PROFILE_STATUS_TRANSITION_AFTER = ["passed"];
|
|
19942
|
+
var DEFAULT_CHECK_STATUS_TRANSITION_BEFORE = ["failed"];
|
|
19943
|
+
var DEFAULT_CHECK_STATUS_TRANSITION_AFTER = ["passed"];
|
|
19944
|
+
function listValue3(value, fallback) {
|
|
19945
|
+
if (Array.isArray(value)) return value;
|
|
19946
|
+
if (value === void 0) return fallback;
|
|
19947
|
+
return [value];
|
|
19948
|
+
}
|
|
19949
|
+
function includesValue(allowed, observed) {
|
|
19950
|
+
return observed !== void 0 && allowed.includes(observed);
|
|
19951
|
+
}
|
|
19952
|
+
function groupResult(side, contract, result) {
|
|
19953
|
+
const fallback = side === "before" ? DEFAULT_BEFORE_STATUSES : DEFAULT_AFTER_STATUSES;
|
|
19954
|
+
const requiredStatus = listValue3(contract?.required_status, fallback);
|
|
19955
|
+
const label = contract?.label || side;
|
|
19956
|
+
if (!result) {
|
|
19957
|
+
return {
|
|
19958
|
+
side,
|
|
19959
|
+
label,
|
|
19960
|
+
ok: false,
|
|
19961
|
+
status: "missing",
|
|
19962
|
+
required_status: requiredStatus,
|
|
19963
|
+
message: `${label} profile result is missing.`
|
|
19964
|
+
};
|
|
19965
|
+
}
|
|
19966
|
+
const ok = includesValue(requiredStatus, result.status);
|
|
19967
|
+
return {
|
|
19968
|
+
side,
|
|
19969
|
+
label,
|
|
19970
|
+
ok,
|
|
19971
|
+
profile_name: result.profile_name,
|
|
19972
|
+
status: result.status,
|
|
19973
|
+
required_status: requiredStatus,
|
|
19974
|
+
summary: result.summary,
|
|
19975
|
+
message: ok ? void 0 : `${label} profile status ${result.status} did not match required status ${requiredStatus.join(", ")}.`
|
|
19976
|
+
};
|
|
19977
|
+
}
|
|
19978
|
+
function findCheck(result, delta) {
|
|
19979
|
+
return result.checks.find((check) => {
|
|
19980
|
+
if (delta.check_label && check.label !== delta.check_label) return false;
|
|
19981
|
+
if (delta.check_type && check.type !== delta.check_type) return false;
|
|
19982
|
+
return Boolean(delta.check_label || delta.check_type);
|
|
19983
|
+
});
|
|
19984
|
+
}
|
|
19985
|
+
function profileStatusTransitionResult(delta, before, after) {
|
|
19986
|
+
const label = delta.label || "profile-status-transition";
|
|
19987
|
+
if (!before || !after) {
|
|
19988
|
+
return {
|
|
19989
|
+
type: delta.type,
|
|
19990
|
+
label,
|
|
19991
|
+
status: "proof_insufficient",
|
|
19992
|
+
before_observed: before?.status,
|
|
19993
|
+
after_observed: after?.status,
|
|
19994
|
+
message: `${label} needs both before and after profile results.`
|
|
19995
|
+
};
|
|
19996
|
+
}
|
|
19997
|
+
const beforeAllowed = listValue3(delta.before_status, DEFAULT_PROFILE_STATUS_TRANSITION_BEFORE);
|
|
19998
|
+
const afterAllowed = listValue3(delta.after_status, DEFAULT_PROFILE_STATUS_TRANSITION_AFTER);
|
|
19999
|
+
const passed = includesValue(beforeAllowed, before.status) && includesValue(afterAllowed, after.status);
|
|
20000
|
+
return {
|
|
20001
|
+
type: delta.type,
|
|
20002
|
+
label,
|
|
20003
|
+
status: passed ? "passed" : "failed",
|
|
20004
|
+
before_observed: before.status,
|
|
20005
|
+
after_observed: after.status,
|
|
20006
|
+
message: passed ? void 0 : `${label} expected before ${beforeAllowed.join(", ")} and after ${afterAllowed.join(", ")}, got ${before.status} -> ${after.status}.`
|
|
20007
|
+
};
|
|
20008
|
+
}
|
|
20009
|
+
function checkStatusTransitionResult(delta, before, after) {
|
|
20010
|
+
const label = delta.label || delta.check_label || delta.check_type || "check-status-transition";
|
|
20011
|
+
if (!delta.check_label && !delta.check_type) {
|
|
20012
|
+
return {
|
|
20013
|
+
type: delta.type,
|
|
20014
|
+
label,
|
|
20015
|
+
status: "configuration_error",
|
|
20016
|
+
message: `${label} needs check_label or check_type.`
|
|
20017
|
+
};
|
|
20018
|
+
}
|
|
20019
|
+
if (!before || !after) {
|
|
20020
|
+
return {
|
|
20021
|
+
type: delta.type,
|
|
20022
|
+
label,
|
|
20023
|
+
status: "proof_insufficient",
|
|
20024
|
+
before_observed: before?.status,
|
|
20025
|
+
after_observed: after?.status,
|
|
20026
|
+
message: `${label} needs both before and after profile results.`
|
|
20027
|
+
};
|
|
20028
|
+
}
|
|
20029
|
+
const beforeCheck = findCheck(before, delta);
|
|
20030
|
+
const afterCheck = findCheck(after, delta);
|
|
20031
|
+
if (!beforeCheck || !afterCheck) {
|
|
20032
|
+
return {
|
|
20033
|
+
type: delta.type,
|
|
20034
|
+
label,
|
|
20035
|
+
status: "proof_insufficient",
|
|
20036
|
+
before_observed: beforeCheck?.status,
|
|
20037
|
+
after_observed: afterCheck?.status,
|
|
20038
|
+
message: `${label} was not present in ${!beforeCheck && !afterCheck ? "before or after" : !beforeCheck ? "before" : "after"} profile checks.`
|
|
20039
|
+
};
|
|
20040
|
+
}
|
|
20041
|
+
const beforeAllowed = listValue3(delta.before_status, DEFAULT_CHECK_STATUS_TRANSITION_BEFORE);
|
|
20042
|
+
const afterAllowed = listValue3(delta.after_status, DEFAULT_CHECK_STATUS_TRANSITION_AFTER);
|
|
20043
|
+
const passed = includesValue(beforeAllowed, beforeCheck.status) && includesValue(afterAllowed, afterCheck.status);
|
|
20044
|
+
return {
|
|
20045
|
+
type: delta.type,
|
|
20046
|
+
label,
|
|
20047
|
+
status: passed ? "passed" : "failed",
|
|
20048
|
+
before_observed: beforeCheck.status,
|
|
20049
|
+
after_observed: afterCheck.status,
|
|
20050
|
+
message: passed ? void 0 : `${label} expected before ${beforeAllowed.join(", ")} and after ${afterAllowed.join(", ")}, got ${beforeCheck.status} -> ${afterCheck.status}.`
|
|
20051
|
+
};
|
|
20052
|
+
}
|
|
20053
|
+
function assessDelta(delta, before, after) {
|
|
20054
|
+
if (delta.type === "profile_status_transition") {
|
|
20055
|
+
return profileStatusTransitionResult(delta, before, after);
|
|
20056
|
+
}
|
|
20057
|
+
return checkStatusTransitionResult(delta, before, after);
|
|
20058
|
+
}
|
|
20059
|
+
function collapsedChangeStatus(groups, deltas) {
|
|
20060
|
+
const groupResults = [groups.before, groups.after];
|
|
20061
|
+
if (groupResults.some((group) => group.status === "environment_blocked")) return "environment_blocked";
|
|
20062
|
+
if (groupResults.some((group) => group.status === "configuration_error")) return "configuration_error";
|
|
20063
|
+
if (deltas.some((delta) => delta.status === "configuration_error")) return "configuration_error";
|
|
20064
|
+
if (groupResults.some((group) => group.status === "needs_human_review")) return "needs_human_review";
|
|
20065
|
+
if (groupResults.some((group) => group.status === "missing" || group.status === "proof_insufficient")) return "proof_insufficient";
|
|
20066
|
+
if (!deltas.length || deltas.some((delta) => delta.status === "proof_insufficient")) return "proof_insufficient";
|
|
20067
|
+
if (groupResults.some((group) => !group.ok)) return "product_regression";
|
|
20068
|
+
if (deltas.some((delta) => delta.status === "failed")) return "product_regression";
|
|
20069
|
+
return "passed";
|
|
20070
|
+
}
|
|
20071
|
+
function changeSummary(name, status, deltas) {
|
|
20072
|
+
if (status === "passed") return `${name} passed ${deltas.length} change delta(s).`;
|
|
20073
|
+
if (status === "environment_blocked") return `${name} could not compare reliable evidence because an environment was blocked.`;
|
|
20074
|
+
if (status === "configuration_error") return `${name} has an invalid change proof contract.`;
|
|
20075
|
+
if (status === "needs_human_review") return `${name} needs human review before the change proof can pass.`;
|
|
20076
|
+
if (status === "proof_insufficient") return `${name} did not produce enough before/after evidence for a change proof.`;
|
|
20077
|
+
return `${name} failed ${deltas.filter((delta) => delta.status === "failed").length} change delta(s).`;
|
|
20078
|
+
}
|
|
20079
|
+
function assessRiddleProofChange(contract, input) {
|
|
20080
|
+
const groups = {
|
|
20081
|
+
before: groupResult("before", contract.before, input.before_result),
|
|
20082
|
+
after: groupResult("after", contract.after, input.after_result)
|
|
20083
|
+
};
|
|
20084
|
+
const deltas = (contract.deltas || []).map((delta) => assessDelta(delta, input.before_result, input.after_result));
|
|
20085
|
+
const status = collapsedChangeStatus(groups, deltas);
|
|
20086
|
+
return {
|
|
20087
|
+
version: RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
20088
|
+
contract_name: contract.name,
|
|
20089
|
+
status,
|
|
20090
|
+
groups,
|
|
20091
|
+
deltas,
|
|
20092
|
+
summary: changeSummary(contract.name, status, deltas),
|
|
20093
|
+
metadata: contract.metadata
|
|
20094
|
+
};
|
|
20095
|
+
}
|
|
20096
|
+
|
|
19932
20097
|
// src/riddle-client.ts
|
|
19933
20098
|
var import_node_child_process4 = require("child_process");
|
|
19934
20099
|
var import_node_fs5 = require("fs");
|
|
@@ -20903,6 +21068,8 @@ function buildRiddleProofPrCommentMarkdown(input) {
|
|
|
20903
21068
|
RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION,
|
|
20904
21069
|
RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION,
|
|
20905
21070
|
RIDDLE_PROOF_CAPTURE_DIAGNOSTIC_VERSION,
|
|
21071
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
21072
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
20906
21073
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
20907
21074
|
RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
|
20908
21075
|
RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS,
|
|
@@ -20935,6 +21102,7 @@ function buildRiddleProofPrCommentMarkdown(input) {
|
|
|
20935
21102
|
assessBasicGameplayProgressionChecks,
|
|
20936
21103
|
assessBasicGameplayRoute,
|
|
20937
21104
|
assessPlayabilityEvidence,
|
|
21105
|
+
assessRiddleProofChange,
|
|
20938
21106
|
assessRiddleProofProfileArtifactCompleteness,
|
|
20939
21107
|
assessRiddleProofProfileEvidence,
|
|
20940
21108
|
attachBasicGameplayArtifactScreenshotHashes,
|
package/dist/index.d.cts
CHANGED
|
@@ -13,5 +13,6 @@ export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
|
|
|
13
13
|
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';
|
|
14
14
|
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS, 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, RiddleProofProfileArtifactCompleteness, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileHttpStatusBodyJsonAssertion, RiddleProofProfileHttpStatusBodyJsonAssertionResult, RiddleProofProfileHttpStatusPreflightCheckResult, RiddleProofProfileHttpStatusPreflightFetch, RiddleProofProfileHttpStatusPreflightFetchResponse, RiddleProofProfileHttpStatusPreflightOptions, RiddleProofProfileHttpStatusPreflightResult, RiddleProofProfileJsonValueType, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileReturnSummaryField, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileRunnerArtifactPreflight, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, applyRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, preflightRiddleProofProfileRunnerArtifacts, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
|
|
15
15
|
export { RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION, RiddleProofProfileChangedTextInput, RiddleProofProfileSuggestion, RiddleProofProfileSuggestionInput, RiddleProofProfileSuggestionsResult, suggestRiddleProofProfileChecks } from './profile-suggestions.cjs';
|
|
16
|
+
export { AssessRiddleProofChangeInput, RIDDLE_PROOF_CHANGE_CONTRACT_VERSION, RIDDLE_PROOF_CHANGE_RESULT_VERSION, RiddleProofChangeContract, RiddleProofChangeDelta, RiddleProofChangeDeltaResult, RiddleProofChangeDeltaStatus, RiddleProofChangeGroupContract, RiddleProofChangeGroupResult, RiddleProofChangeProfileCheckStatus, RiddleProofChangeResult, RiddleProofChangeSide, RiddleProofChangeStatus, RiddleProofCheckStatusTransitionDelta, RiddleProofProfileStatusTransitionDelta, assessRiddleProofChange } from './change-proof.cjs';
|
|
16
17
|
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RIDDLE_UNSUBMITTED_WAKE_HINT, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployProgressSnapshot, RiddlePreviewDeployResult, RiddlePreviewDeployStage, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
|
|
17
18
|
export { RIDDLE_PROOF_PR_COMMENT_MARKER, RiddleProofPrCommentArtifact, RiddleProofPrCommentArtifactKind, RiddleProofPrCommentCheckpointSummary, RiddleProofPrCommentInput, RiddleProofPrCommentPageSummary, RiddleProofPrCommentSummary, buildRiddleProofPrCommentMarkdown, summarizeRiddleProofPrComment } from './pr-comment.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -13,5 +13,6 @@ export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
|
|
|
13
13
|
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';
|
|
14
14
|
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS, 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, RiddleProofProfileArtifactCompleteness, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileHttpStatusBodyJsonAssertion, RiddleProofProfileHttpStatusBodyJsonAssertionResult, RiddleProofProfileHttpStatusPreflightCheckResult, RiddleProofProfileHttpStatusPreflightFetch, RiddleProofProfileHttpStatusPreflightFetchResponse, RiddleProofProfileHttpStatusPreflightOptions, RiddleProofProfileHttpStatusPreflightResult, RiddleProofProfileJsonValueType, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileReturnSummaryField, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileRunnerArtifactPreflight, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, applyRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, preflightRiddleProofProfileRunnerArtifacts, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
|
|
15
15
|
export { RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION, RiddleProofProfileChangedTextInput, RiddleProofProfileSuggestion, RiddleProofProfileSuggestionInput, RiddleProofProfileSuggestionsResult, suggestRiddleProofProfileChecks } from './profile-suggestions.js';
|
|
16
|
+
export { AssessRiddleProofChangeInput, RIDDLE_PROOF_CHANGE_CONTRACT_VERSION, RIDDLE_PROOF_CHANGE_RESULT_VERSION, RiddleProofChangeContract, RiddleProofChangeDelta, RiddleProofChangeDeltaResult, RiddleProofChangeDeltaStatus, RiddleProofChangeGroupContract, RiddleProofChangeGroupResult, RiddleProofChangeProfileCheckStatus, RiddleProofChangeResult, RiddleProofChangeSide, RiddleProofChangeStatus, RiddleProofCheckStatusTransitionDelta, RiddleProofProfileStatusTransitionDelta, assessRiddleProofChange } from './change-proof.js';
|
|
16
17
|
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RIDDLE_UNSUBMITTED_WAKE_HINT, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployProgressSnapshot, RiddlePreviewDeployResult, RiddlePreviewDeployStage, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
|
|
17
18
|
export { RIDDLE_PROOF_PR_COMMENT_MARKER, RiddleProofPrCommentArtifact, RiddleProofPrCommentArtifactKind, RiddleProofPrCommentCheckpointSummary, RiddleProofPrCommentInput, RiddleProofPrCommentPageSummary, RiddleProofPrCommentSummary, buildRiddleProofPrCommentMarkdown, summarizeRiddleProofPrComment } from './pr-comment.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
|
|
3
|
+
RIDDLE_PROOF_VISUAL_SESSION_VERSION,
|
|
4
|
+
buildVisualProofSession,
|
|
5
|
+
compareVisualProofSessionFingerprint,
|
|
6
|
+
parseVisualProofSession,
|
|
7
|
+
visualSessionFingerprint,
|
|
8
|
+
visualSessionFingerprintBasis
|
|
9
|
+
} from "./chunk-ODORKNSO.js";
|
|
1
10
|
import {
|
|
2
11
|
runRiddleProof
|
|
3
12
|
} from "./chunk-YH7ADFY4.js";
|
|
@@ -9,15 +18,6 @@ import {
|
|
|
9
18
|
extractPlayabilityEvidence,
|
|
10
19
|
isRiddleProofPlayabilityMode
|
|
11
20
|
} from "./chunk-NSWT3VSV.js";
|
|
12
|
-
import {
|
|
13
|
-
RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
|
|
14
|
-
RIDDLE_PROOF_VISUAL_SESSION_VERSION,
|
|
15
|
-
buildVisualProofSession,
|
|
16
|
-
compareVisualProofSessionFingerprint,
|
|
17
|
-
parseVisualProofSession,
|
|
18
|
-
visualSessionFingerprint,
|
|
19
|
-
visualSessionFingerprintBasis
|
|
20
|
-
} from "./chunk-ODORKNSO.js";
|
|
21
21
|
import {
|
|
22
22
|
BASIC_GAMEPLAY_ACTION_TYPES,
|
|
23
23
|
BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES,
|
|
@@ -37,6 +37,11 @@ import {
|
|
|
37
37
|
resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
|
|
38
38
|
sanitizeBasicGameplayJsonString
|
|
39
39
|
} from "./chunk-ELZSPOWV.js";
|
|
40
|
+
import {
|
|
41
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
42
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
43
|
+
assessRiddleProofChange
|
|
44
|
+
} from "./chunk-6S7DZWVC.js";
|
|
40
45
|
import {
|
|
41
46
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
42
47
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
|
@@ -56,6 +61,7 @@ import {
|
|
|
56
61
|
runRiddleScript,
|
|
57
62
|
runRiddleServerPreview
|
|
58
63
|
} from "./chunk-B2DP2LET.js";
|
|
64
|
+
import "./chunk-JFQXAJH2.js";
|
|
59
65
|
import {
|
|
60
66
|
RIDDLE_PROOF_PR_COMMENT_MARKER,
|
|
61
67
|
buildRiddleProofPrCommentMarkdown,
|
|
@@ -95,6 +101,11 @@ import {
|
|
|
95
101
|
slugifyRiddleProofProfileName,
|
|
96
102
|
summarizeRiddleProofProfileResult
|
|
97
103
|
} from "./chunk-GG2D3MFZ.js";
|
|
104
|
+
import {
|
|
105
|
+
createCodexExecAgentAdapter,
|
|
106
|
+
createCodexExecJsonRunner,
|
|
107
|
+
runCodexExecAgentDoctor
|
|
108
|
+
} from "./chunk-KXLEN4SA.js";
|
|
98
109
|
import {
|
|
99
110
|
DEFAULT_DIAGNOSTIC_ARRAY_LIMIT,
|
|
100
111
|
DEFAULT_DIAGNOSTIC_HISTORY_LIMIT,
|
|
@@ -144,12 +155,6 @@ import {
|
|
|
144
155
|
proofContractFromAuthorCheckpointResponse,
|
|
145
156
|
statePathsForRunState
|
|
146
157
|
} from "./chunk-DYE3URAQ.js";
|
|
147
|
-
import "./chunk-JFQXAJH2.js";
|
|
148
|
-
import {
|
|
149
|
-
createCodexExecAgentAdapter,
|
|
150
|
-
createCodexExecJsonRunner,
|
|
151
|
-
runCodexExecAgentDoctor
|
|
152
|
-
} from "./chunk-KXLEN4SA.js";
|
|
153
158
|
import {
|
|
154
159
|
applyShipControlState,
|
|
155
160
|
applyTerminalMetadata,
|
|
@@ -187,6 +192,8 @@ export {
|
|
|
187
192
|
RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION,
|
|
188
193
|
RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION,
|
|
189
194
|
RIDDLE_PROOF_CAPTURE_DIAGNOSTIC_VERSION,
|
|
195
|
+
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
196
|
+
RIDDLE_PROOF_CHANGE_RESULT_VERSION,
|
|
190
197
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
191
198
|
RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
|
192
199
|
RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS,
|
|
@@ -219,6 +226,7 @@ export {
|
|
|
219
226
|
assessBasicGameplayProgressionChecks,
|
|
220
227
|
assessBasicGameplayRoute,
|
|
221
228
|
assessPlayabilityEvidence,
|
|
229
|
+
assessRiddleProofChange,
|
|
222
230
|
assessRiddleProofProfileArtifactCompleteness,
|
|
223
231
|
assessRiddleProofProfileEvidence,
|
|
224
232
|
attachBasicGameplayArtifactScreenshotHashes,
|
|
@@ -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: "
|
|
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: "
|
|
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: "
|
|
662
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship";
|
|
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: "
|
|
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: "
|
|
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: "
|
|
662
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import './proof-run-core-7Dqm7RKM.cjs';
|
|
2
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-
|
|
2
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-Baiv6l3A.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import './proof-run-core-7Dqm7RKM.js';
|
|
2
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-
|
|
2
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-MiKZt9oY.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riddledc/riddle-proof",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.74",
|
|
4
4
|
"description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "RiddleDC",
|
|
@@ -134,6 +134,11 @@
|
|
|
134
134
|
"import": "./dist/profile-suggestions.js",
|
|
135
135
|
"require": "./dist/profile-suggestions.cjs"
|
|
136
136
|
},
|
|
137
|
+
"./change-proof": {
|
|
138
|
+
"types": "./dist/change-proof.d.ts",
|
|
139
|
+
"import": "./dist/change-proof.js",
|
|
140
|
+
"require": "./dist/change-proof.cjs"
|
|
141
|
+
},
|
|
137
142
|
"./pr-comment": {
|
|
138
143
|
"types": "./dist/pr-comment.d.ts",
|
|
139
144
|
"import": "./dist/pr-comment.js",
|
|
@@ -244,7 +249,7 @@
|
|
|
244
249
|
"typescript": "^5.4.5"
|
|
245
250
|
},
|
|
246
251
|
"scripts": {
|
|
247
|
-
"build": "npm --workspace @riddledc/riddle-proof-app-contract run build --if-present && tsup src/index.ts src/types.ts src/result.ts src/state.ts src/checkpoint.ts src/run-card.ts src/public-state.ts src/runner.ts src/engine-harness.ts src/codex-exec-agent.ts src/local-agent.ts src/cli.ts src/cli/index.ts src/diagnostics.ts src/proof-session.ts src/playability.ts src/basic-gameplay.ts src/profile.ts src/profile/index.ts src/profile-suggestions.ts src/pr-comment.ts src/openclaw.ts src/proof-run-core.ts src/proof-run-engine.ts src/riddle-client.ts src/runtime/riddle-client.ts src/spec/index.ts src/spec/types.ts src/spec/result.ts src/spec/state.ts src/spec/checkpoint.ts src/spec/run-card.ts src/spec/public-state.ts src/runtime/index.ts src/app-contract/index.ts src/advanced/index.ts src/advanced/runner.ts src/advanced/engine-harness.ts src/advanced/proof-run-core.ts src/advanced/proof-run-engine.ts src/adapters/openclaw.ts src/adapters/local-agent.ts src/adapters/codex-exec-agent.ts src/adapters/codex.ts --format cjs,esm --dts --out-dir dist --clean",
|
|
252
|
+
"build": "npm --workspace @riddledc/riddle-proof-app-contract run build --if-present && tsup src/index.ts src/types.ts src/result.ts src/state.ts src/checkpoint.ts src/run-card.ts src/public-state.ts src/runner.ts src/engine-harness.ts src/codex-exec-agent.ts src/local-agent.ts src/cli.ts src/cli/index.ts src/diagnostics.ts src/proof-session.ts src/playability.ts src/basic-gameplay.ts src/profile.ts src/profile/index.ts src/profile-suggestions.ts src/change-proof.ts src/pr-comment.ts src/openclaw.ts src/proof-run-core.ts src/proof-run-engine.ts src/riddle-client.ts src/runtime/riddle-client.ts src/spec/index.ts src/spec/types.ts src/spec/result.ts src/spec/state.ts src/spec/checkpoint.ts src/spec/run-card.ts src/spec/public-state.ts src/runtime/index.ts src/app-contract/index.ts src/advanced/index.ts src/advanced/runner.ts src/advanced/engine-harness.ts src/advanced/proof-run-core.ts src/advanced/proof-run-engine.ts src/adapters/openclaw.ts src/adapters/local-agent.ts src/adapters/codex-exec-agent.ts src/adapters/codex.ts --format cjs,esm --dts --out-dir dist --clean",
|
|
248
253
|
"clean": "rm -rf dist",
|
|
249
254
|
"lint": "echo 'lint: (not configured)'",
|
|
250
255
|
"test": "npm run build && node test.js && node proof-run.test.js && node formal-conformance.test.js && node trust-boundary.test.js && node regression-packs.test.js && node story-matrix.test.js && python3 runtime/tests/trust_boundary_regression.py && python3 runtime/tests/ship_artifact_publication.py && (python3 runtime/tests/recon_verify_smoke.py >/tmp/riddle-proof-recon-verify-smoke.json || (tail -120 /tmp/riddle-proof-recon-verify-smoke.json; exit 1))"
|
|
@@ -30,6 +30,10 @@ import {
|
|
|
30
30
|
resolveRiddleProofProfileTargetUrl,
|
|
31
31
|
resolveRiddleProofProfileTimeoutSec
|
|
32
32
|
} from "./chunk-GG2D3MFZ.js";
|
|
33
|
+
import {
|
|
34
|
+
createCodexExecAgentAdapter,
|
|
35
|
+
runCodexExecAgentDoctor
|
|
36
|
+
} from "./chunk-KXLEN4SA.js";
|
|
33
37
|
import {
|
|
34
38
|
createDisabledRiddleProofAgentAdapter,
|
|
35
39
|
readRiddleProofRunStatus,
|
|
@@ -38,10 +42,6 @@ import {
|
|
|
38
42
|
import {
|
|
39
43
|
createCheckpointResponseTemplate
|
|
40
44
|
} from "./chunk-DYE3URAQ.js";
|
|
41
|
-
import {
|
|
42
|
-
createCodexExecAgentAdapter,
|
|
43
|
-
runCodexExecAgentDoctor
|
|
44
|
-
} from "./chunk-KXLEN4SA.js";
|
|
45
45
|
|
|
46
46
|
// src/cli.ts
|
|
47
47
|
import { spawnSync } from "child_process";
|