@openprose/reactor-cradle 0.1.0-rc.1
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/LICENSE +21 -0
- package/README.md +270 -0
- package/dist/assert/index.d.ts +35 -0
- package/dist/assert/index.d.ts.map +1 -0
- package/dist/assert/index.js +398 -0
- package/dist/baselines/cost-thesis/index.d.ts +103 -0
- package/dist/baselines/cost-thesis/index.d.ts.map +1 -0
- package/dist/baselines/cost-thesis/index.js +337 -0
- package/dist/baselines/naive-loop/index.d.ts +46 -0
- package/dist/baselines/naive-loop/index.d.ts.map +1 -0
- package/dist/baselines/naive-loop/index.js +188 -0
- package/dist/baselines/no-memo/index.d.ts +84 -0
- package/dist/baselines/no-memo/index.d.ts.map +1 -0
- package/dist/baselines/no-memo/index.js +226 -0
- package/dist/doubles/clock.d.ts +9 -0
- package/dist/doubles/clock.d.ts.map +1 -0
- package/dist/doubles/clock.js +42 -0
- package/dist/doubles/storage.d.ts +24 -0
- package/dist/doubles/storage.d.ts.map +1 -0
- package/dist/doubles/storage.js +191 -0
- package/dist/eval/index.d.ts +204 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +596 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/policy-author/index.d.ts +103 -0
- package/dist/policy-author/index.d.ts.map +1 -0
- package/dist/policy-author/index.js +358 -0
- package/dist/policy-drift/index.d.ts +64 -0
- package/dist/policy-drift/index.d.ts.map +1 -0
- package/dist/policy-drift/index.js +495 -0
- package/dist/policy-replay/index.d.ts +106 -0
- package/dist/policy-replay/index.d.ts.map +1 -0
- package/dist/policy-replay/index.js +361 -0
- package/dist/provider-parity/index.d.ts +91 -0
- package/dist/provider-parity/index.d.ts.map +1 -0
- package/dist/provider-parity/index.js +439 -0
- package/dist/recompile/index.d.ts +161 -0
- package/dist/recompile/index.d.ts.map +1 -0
- package/dist/recompile/index.js +690 -0
- package/dist/release-candidate/index.d.ts +139 -0
- package/dist/release-candidate/index.d.ts.map +1 -0
- package/dist/release-candidate/index.js +553 -0
- package/dist/release-parity/index.d.ts +80 -0
- package/dist/release-parity/index.d.ts.map +1 -0
- package/dist/release-parity/index.js +1035 -0
- package/dist/replay/model-gateway.d.ts +25 -0
- package/dist/replay/model-gateway.d.ts.map +1 -0
- package/dist/replay/model-gateway.js +166 -0
- package/dist/replay/parity.d.ts +110 -0
- package/dist/replay/parity.d.ts.map +1 -0
- package/dist/replay/parity.js +232 -0
- package/dist/rollback/index.d.ts +106 -0
- package/dist/rollback/index.d.ts.map +1 -0
- package/dist/rollback/index.js +694 -0
- package/dist/scenario/parser.d.ts +11 -0
- package/dist/scenario/parser.d.ts.map +1 -0
- package/dist/scenario/parser.js +490 -0
- package/dist/scenario/runner.d.ts +12 -0
- package/dist/scenario/runner.d.ts.map +1 -0
- package/dist/scenario/runner.js +345 -0
- package/dist/scenario/synthetic-world-adapter.d.ts +4 -0
- package/dist/scenario/synthetic-world-adapter.d.ts.map +1 -0
- package/dist/scenario/synthetic-world-adapter.js +82 -0
- package/dist/scenario/time.d.ts +4 -0
- package/dist/scenario/time.d.ts.map +1 -0
- package/dist/scenario/time.js +45 -0
- package/dist/scenario/types.d.ts +149 -0
- package/dist/scenario/types.d.ts.map +1 -0
- package/dist/scenario/types.js +5 -0
- package/dist/spikes/index.d.ts +10 -0
- package/dist/spikes/index.d.ts.map +1 -0
- package/dist/spikes/index.js +29 -0
- package/dist/spikes/k1-ensemble-spread.d.ts +88 -0
- package/dist/spikes/k1-ensemble-spread.d.ts.map +1 -0
- package/dist/spikes/k1-ensemble-spread.js +396 -0
- package/dist/spikes/k2-policy-author.d.ts +25 -0
- package/dist/spikes/k2-policy-author.d.ts.map +1 -0
- package/dist/spikes/k2-policy-author.js +503 -0
- package/dist/spikes/live-refresh.d.ts +150 -0
- package/dist/spikes/live-refresh.d.ts.map +1 -0
- package/dist/spikes/live-refresh.js +511 -0
- package/dist/world/index.d.ts +2 -0
- package/dist/world/index.d.ts.map +1 -0
- package/dist/world/index.js +17 -0
- package/dist/world/synthetic-world.d.ts +104 -0
- package/dist/world/synthetic-world.d.ts.map +1 -0
- package/dist/world/synthetic-world.js +449 -0
- package/package.json +139 -0
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROVIDER_PARITY_POLICY_AUTHOR_LAUNCH_REPRESENTATION_V0 = exports.PROVIDER_PARITY_REPORT_VERSION_V0 = exports.PROVIDER_PARITY_REPORT_SCHEMA_V0 = exports.PROVIDER_PARITY_GATEWAY_REQUEST_SCHEMA_V0 = void 0;
|
|
4
|
+
exports.runProviderPolicyArtifactParityV0 = runProviderPolicyArtifactParityV0;
|
|
5
|
+
exports.assertProviderPolicyArtifactParityV0 = assertProviderPolicyArtifactParityV0;
|
|
6
|
+
exports.assertProviderPolicyArtifactParityReportV0 = assertProviderPolicyArtifactParityReportV0;
|
|
7
|
+
exports.createRecordedProviderModelGatewayV0 = createRecordedProviderModelGatewayV0;
|
|
8
|
+
exports.createModelGatewayBackedPolicyAuthorAgentSdkV0 = createModelGatewayBackedPolicyAuthorAgentSdkV0;
|
|
9
|
+
exports.buildProviderParityModelGatewayRequestV0 = buildProviderParityModelGatewayRequestV0;
|
|
10
|
+
const node_crypto_1 = require("node:crypto");
|
|
11
|
+
exports.PROVIDER_PARITY_GATEWAY_REQUEST_SCHEMA_V0 = "openprose.reactor-cradle.provider-parity.policy-author-gateway-request";
|
|
12
|
+
exports.PROVIDER_PARITY_REPORT_SCHEMA_V0 = "openprose.reactor-cradle.provider-parity.report";
|
|
13
|
+
exports.PROVIDER_PARITY_REPORT_VERSION_V0 = 0;
|
|
14
|
+
exports.PROVIDER_PARITY_POLICY_AUTHOR_LAUNCH_REPRESENTATION_V0 = "agent-sdk-backed-by-model-gateway";
|
|
15
|
+
const POLICY_ARTIFACT_VERSION = 0;
|
|
16
|
+
const POLICY_AUTHOR_ARTIFACT_RESPONSE_SCHEMA = "openprose.reactor.policy-author.artifact-response";
|
|
17
|
+
const POLICY_AUTHOR_HISTORY_QUERY_SCHEMA = "openprose.reactor.policy-author.history-query";
|
|
18
|
+
async function runProviderPolicyArtifactParityV0(input) {
|
|
19
|
+
validateParityInput(input);
|
|
20
|
+
const authorPolicyArtifact = input.authorPolicyArtifactV0 ?? loadDefaultAuthorPolicyArtifactV0();
|
|
21
|
+
const providers = assertProviderSet(input.providers);
|
|
22
|
+
const results = [];
|
|
23
|
+
for (const provider of providers) {
|
|
24
|
+
const gateway = createRecordedProviderModelGatewayV0(provider);
|
|
25
|
+
const bridge = createModelGatewayBackedPolicyAuthorAgentSdkV0({
|
|
26
|
+
provider_name: provider.name,
|
|
27
|
+
modelGateway: gateway,
|
|
28
|
+
});
|
|
29
|
+
const registry = await authorPolicyArtifact({
|
|
30
|
+
responsibility_id: input.responsibility_id,
|
|
31
|
+
contract_revision: input.contract_revision,
|
|
32
|
+
contract_summary: input.contract_summary,
|
|
33
|
+
no_anchor: input.no_anchor,
|
|
34
|
+
live_observables: input.live_observables,
|
|
35
|
+
receipt_history: input.receipt_history,
|
|
36
|
+
agentSdk: bridge.agentSdk,
|
|
37
|
+
...(input.policy_artifact_namespace === undefined
|
|
38
|
+
? {}
|
|
39
|
+
: { policy_artifact_namespace: input.policy_artifact_namespace }),
|
|
40
|
+
});
|
|
41
|
+
results.push(snapshotProviderResult(provider, registry, gateway.calls()));
|
|
42
|
+
}
|
|
43
|
+
const baseline = readResult(results, 0);
|
|
44
|
+
const byteIdentical = results.every((result) => result.artifact_bytes === baseline.artifact_bytes);
|
|
45
|
+
return {
|
|
46
|
+
schema: exports.PROVIDER_PARITY_REPORT_SCHEMA_V0,
|
|
47
|
+
v: exports.PROVIDER_PARITY_REPORT_VERSION_V0,
|
|
48
|
+
provider_names: results.map((result) => result.provider_name),
|
|
49
|
+
artifact_hashes: results.map((result) => result.artifact_hash),
|
|
50
|
+
artifact_bytes: results.map((result) => result.artifact_bytes),
|
|
51
|
+
artifact_byte_lengths: results.map((result) => result.artifact_byte_length),
|
|
52
|
+
byte_identical: byteIdentical,
|
|
53
|
+
validation_state: "validated",
|
|
54
|
+
providers: results,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function assertProviderPolicyArtifactParityV0(input) {
|
|
58
|
+
const report = await runProviderPolicyArtifactParityV0(input);
|
|
59
|
+
return assertProviderPolicyArtifactParityReportV0(report);
|
|
60
|
+
}
|
|
61
|
+
function assertProviderPolicyArtifactParityReportV0(report) {
|
|
62
|
+
if (report.schema !== exports.PROVIDER_PARITY_REPORT_SCHEMA_V0) {
|
|
63
|
+
throw new Error("gateway-provider-parity report schema is invalid");
|
|
64
|
+
}
|
|
65
|
+
if (report.v !== exports.PROVIDER_PARITY_REPORT_VERSION_V0) {
|
|
66
|
+
throw new Error("gateway-provider-parity report version must be 0");
|
|
67
|
+
}
|
|
68
|
+
if (report.providers.length < 2) {
|
|
69
|
+
throw new Error("gateway-provider-parity requires at least two providers");
|
|
70
|
+
}
|
|
71
|
+
if (report.validation_state !== "validated") {
|
|
72
|
+
throw new Error("gateway-provider-parity did not validate all artifacts");
|
|
73
|
+
}
|
|
74
|
+
if (!report.byte_identical) {
|
|
75
|
+
const details = report.providers
|
|
76
|
+
.map((provider) => `${provider.provider_name}=${provider.artifact_hash}`)
|
|
77
|
+
.join(", ");
|
|
78
|
+
throw new Error(`gateway-provider-parity failed: policy artifact bytes differ (${details})`);
|
|
79
|
+
}
|
|
80
|
+
return report;
|
|
81
|
+
}
|
|
82
|
+
function createRecordedProviderModelGatewayV0(provider) {
|
|
83
|
+
validateProvider(provider, new Set());
|
|
84
|
+
const calls = [];
|
|
85
|
+
return {
|
|
86
|
+
provider_name: provider.name,
|
|
87
|
+
model: provider.model,
|
|
88
|
+
invoke(request) {
|
|
89
|
+
const requestSnapshot = createCanonicalSnapshot(request, "provider parity model gateway request");
|
|
90
|
+
const envelope = readProviderParityGatewayRequest(requestSnapshot.value, provider.name);
|
|
91
|
+
const step = readPolicyAuthorStep(envelope.agent_request);
|
|
92
|
+
const usage = usageForProvider(provider, step, calls.length);
|
|
93
|
+
const response = createProviderResponse(provider, step, usage);
|
|
94
|
+
const responseSnapshot = createCanonicalSnapshot(response, "provider parity model gateway response");
|
|
95
|
+
calls.push({
|
|
96
|
+
provider_name: provider.name,
|
|
97
|
+
model: provider.model,
|
|
98
|
+
step,
|
|
99
|
+
request: requestSnapshot.value,
|
|
100
|
+
request_hash: requestSnapshot.hash,
|
|
101
|
+
response: responseSnapshot.value,
|
|
102
|
+
response_hash: responseSnapshot.hash,
|
|
103
|
+
usage,
|
|
104
|
+
});
|
|
105
|
+
return cloneFromCanonical(responseSnapshot);
|
|
106
|
+
},
|
|
107
|
+
calls() {
|
|
108
|
+
return cloneJson(calls);
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function createModelGatewayBackedPolicyAuthorAgentSdkV0(input) {
|
|
113
|
+
assertNonEmptyString(input.provider_name, "provider_name");
|
|
114
|
+
if (typeof input.modelGateway?.invoke !== "function") {
|
|
115
|
+
throw new Error("modelGateway.invoke adapter is required");
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
agentSdk: {
|
|
119
|
+
launch(request) {
|
|
120
|
+
if (request.kind !== "policy-author") {
|
|
121
|
+
throw new Error("provider parity bridge only supports policy-author launches");
|
|
122
|
+
}
|
|
123
|
+
const response = input.modelGateway.invoke(buildProviderParityModelGatewayRequestV0({
|
|
124
|
+
provider_name: input.provider_name,
|
|
125
|
+
agent_request: request,
|
|
126
|
+
}));
|
|
127
|
+
return {
|
|
128
|
+
payload: response.payload,
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function buildProviderParityModelGatewayRequestV0(input) {
|
|
135
|
+
return {
|
|
136
|
+
kind: "policy-compile",
|
|
137
|
+
payload: {
|
|
138
|
+
schema: exports.PROVIDER_PARITY_GATEWAY_REQUEST_SCHEMA_V0,
|
|
139
|
+
v: exports.PROVIDER_PARITY_REPORT_VERSION_V0,
|
|
140
|
+
provider_name: input.provider_name,
|
|
141
|
+
launch_representation: exports.PROVIDER_PARITY_POLICY_AUTHOR_LAUNCH_REPRESENTATION_V0,
|
|
142
|
+
agent_request: input.agent_request,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function snapshotProviderResult(provider, registry, calls) {
|
|
147
|
+
const validationState = readRegistryValidationState(registry);
|
|
148
|
+
const artifactHash = readContentHash(registry.policy_artifact_content_hash, "registry.policy_artifact_content_hash");
|
|
149
|
+
const artifactBytes = readNonEmptyString(registry.policy_artifact_bytes, "registry.policy_artifact_bytes");
|
|
150
|
+
const policyArtifactRevision = readNonEmptyString(registry.policy_artifact_revision, "registry.policy_artifact_revision");
|
|
151
|
+
if (calls.length !== 2) {
|
|
152
|
+
throw new Error(`${provider.name} policy author must use exactly two model gateway calls; observed ${calls.length}`);
|
|
153
|
+
}
|
|
154
|
+
const steps = calls.map((call) => call.step).join(" -> ");
|
|
155
|
+
if (steps !== "history-query -> author-artifact") {
|
|
156
|
+
throw new Error(`${provider.name} policy author model gateway calls are out of order: ${steps}`);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
provider_name: provider.name,
|
|
160
|
+
model: provider.model,
|
|
161
|
+
policy_author_launch_representation: exports.PROVIDER_PARITY_POLICY_AUTHOR_LAUNCH_REPRESENTATION_V0,
|
|
162
|
+
validation_state: validationState,
|
|
163
|
+
artifact_hash: artifactHash,
|
|
164
|
+
artifact_bytes: artifactBytes,
|
|
165
|
+
artifact_byte_length: Buffer.byteLength(artifactBytes, "utf8"),
|
|
166
|
+
artifact_bytes_canonical: true,
|
|
167
|
+
policy_artifact_revision: policyArtifactRevision,
|
|
168
|
+
model_gateway_call_count: calls.length,
|
|
169
|
+
model_gateway_request_hashes: calls.map((call) => call.request_hash),
|
|
170
|
+
model_gateway_response_hashes: calls.map((call) => call.response_hash),
|
|
171
|
+
model_gateway_usage: calls.map((call) => call.usage),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function createProviderResponse(provider, step, usage) {
|
|
175
|
+
if (step === "history-query") {
|
|
176
|
+
return {
|
|
177
|
+
payload: cloneJson(provider.history_query),
|
|
178
|
+
usage,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
payload: {
|
|
183
|
+
schema: POLICY_AUTHOR_ARTIFACT_RESPONSE_SCHEMA,
|
|
184
|
+
v: POLICY_ARTIFACT_VERSION,
|
|
185
|
+
artifact: cloneJson(provider.artifact),
|
|
186
|
+
},
|
|
187
|
+
usage,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function usageForProvider(provider, step, exchangeIndex) {
|
|
191
|
+
const recordedUsage = provider.usage?.[step];
|
|
192
|
+
if (recordedUsage !== undefined) {
|
|
193
|
+
assertUsageMatchesProvider(recordedUsage, provider, step);
|
|
194
|
+
return cloneJson(recordedUsage);
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
provider: provider.name,
|
|
198
|
+
model: provider.model,
|
|
199
|
+
tokens: step === "history-query"
|
|
200
|
+
? { fresh: 19, reused: 0 }
|
|
201
|
+
: { fresh: 43, reused: 0 },
|
|
202
|
+
provider_norm: {
|
|
203
|
+
schema: "openprose.reactor-cradle.provider-parity.recorded-usage",
|
|
204
|
+
provider_name: provider.name,
|
|
205
|
+
model: provider.model,
|
|
206
|
+
exchange_index: exchangeIndex,
|
|
207
|
+
step,
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function assertUsageMatchesProvider(usage, provider, step) {
|
|
212
|
+
if (usage.provider !== provider.name) {
|
|
213
|
+
throw new Error(`${provider.name} ${step} usage provider must match provider name`);
|
|
214
|
+
}
|
|
215
|
+
if (usage.model !== provider.model) {
|
|
216
|
+
throw new Error(`${provider.name} ${step} usage model must match model`);
|
|
217
|
+
}
|
|
218
|
+
if (!Number.isFinite(usage.tokens.fresh) || usage.tokens.fresh < 0) {
|
|
219
|
+
throw new Error(`${provider.name} ${step} usage fresh tokens must be >= 0`);
|
|
220
|
+
}
|
|
221
|
+
if (!Number.isFinite(usage.tokens.reused) || usage.tokens.reused < 0) {
|
|
222
|
+
throw new Error(`${provider.name} ${step} usage reused tokens must be >= 0`);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function readProviderParityGatewayRequest(request, expectedProviderName) {
|
|
226
|
+
if (request.kind !== "policy-compile") {
|
|
227
|
+
throw new Error("provider parity gateway request kind must be policy-compile");
|
|
228
|
+
}
|
|
229
|
+
if (!isRecord(request.payload)) {
|
|
230
|
+
throw new Error("provider parity gateway payload must be an object");
|
|
231
|
+
}
|
|
232
|
+
if (request.payload["schema"] !== exports.PROVIDER_PARITY_GATEWAY_REQUEST_SCHEMA_V0) {
|
|
233
|
+
throw new Error("provider parity gateway payload schema is invalid");
|
|
234
|
+
}
|
|
235
|
+
if (request.payload["v"] !== exports.PROVIDER_PARITY_REPORT_VERSION_V0) {
|
|
236
|
+
throw new Error("provider parity gateway payload version must be 0");
|
|
237
|
+
}
|
|
238
|
+
if (request.payload["provider_name"] !== expectedProviderName) {
|
|
239
|
+
throw new Error(`provider parity gateway payload provider_name must be ${expectedProviderName}`);
|
|
240
|
+
}
|
|
241
|
+
if (request.payload["launch_representation"] !==
|
|
242
|
+
exports.PROVIDER_PARITY_POLICY_AUTHOR_LAUNCH_REPRESENTATION_V0) {
|
|
243
|
+
throw new Error("provider parity gateway launch representation is invalid");
|
|
244
|
+
}
|
|
245
|
+
const agentRequest = request.payload["agent_request"];
|
|
246
|
+
if (!isRecord(agentRequest)) {
|
|
247
|
+
throw new Error("provider parity gateway agent_request must be an object");
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
schema: exports.PROVIDER_PARITY_GATEWAY_REQUEST_SCHEMA_V0,
|
|
251
|
+
v: exports.PROVIDER_PARITY_REPORT_VERSION_V0,
|
|
252
|
+
provider_name: expectedProviderName,
|
|
253
|
+
launch_representation: exports.PROVIDER_PARITY_POLICY_AUTHOR_LAUNCH_REPRESENTATION_V0,
|
|
254
|
+
agent_request: agentRequest,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function readPolicyAuthorStep(request) {
|
|
258
|
+
if (request.kind !== "policy-author") {
|
|
259
|
+
throw new Error("provider parity gateway only accepts policy-author requests");
|
|
260
|
+
}
|
|
261
|
+
if (!isRecord(request.payload)) {
|
|
262
|
+
throw new Error("policy-author payload must be an object");
|
|
263
|
+
}
|
|
264
|
+
const step = request.payload["step"];
|
|
265
|
+
if (step === "history-query" || step === "author-artifact") {
|
|
266
|
+
return step;
|
|
267
|
+
}
|
|
268
|
+
throw new Error("policy-author payload step must be history-query or author-artifact");
|
|
269
|
+
}
|
|
270
|
+
function validateParityInput(input) {
|
|
271
|
+
assertNonEmptyString(input.responsibility_id, "responsibility_id");
|
|
272
|
+
readContentHash(input.contract_revision, "contract_revision");
|
|
273
|
+
assertNonEmptyString(input.contract_summary, "contract_summary");
|
|
274
|
+
if (typeof input.no_anchor !== "boolean") {
|
|
275
|
+
throw new Error("no_anchor must be boolean");
|
|
276
|
+
}
|
|
277
|
+
if (!Array.isArray(input.live_observables)) {
|
|
278
|
+
throw new Error("live_observables must be an array");
|
|
279
|
+
}
|
|
280
|
+
if (!Array.isArray(input.receipt_history)) {
|
|
281
|
+
throw new Error("receipt_history must be an array");
|
|
282
|
+
}
|
|
283
|
+
if (input.policy_artifact_namespace !== undefined &&
|
|
284
|
+
input.policy_artifact_namespace.length === 0) {
|
|
285
|
+
throw new Error("policy_artifact_namespace must be non-empty when supplied");
|
|
286
|
+
}
|
|
287
|
+
if (input.authorPolicyArtifactV0 !== undefined &&
|
|
288
|
+
typeof input.authorPolicyArtifactV0 !== "function") {
|
|
289
|
+
throw new Error("authorPolicyArtifactV0 must be a function when supplied");
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function assertProviderSet(providers) {
|
|
293
|
+
if (!Array.isArray(providers)) {
|
|
294
|
+
throw new Error("providers must be an array");
|
|
295
|
+
}
|
|
296
|
+
if (providers.length < 2) {
|
|
297
|
+
throw new Error("gateway-provider-parity requires at least two providers");
|
|
298
|
+
}
|
|
299
|
+
const names = new Set();
|
|
300
|
+
for (const provider of providers) {
|
|
301
|
+
validateProvider(provider, names);
|
|
302
|
+
names.add(provider.name);
|
|
303
|
+
}
|
|
304
|
+
return providers;
|
|
305
|
+
}
|
|
306
|
+
function validateProvider(provider, existingNames) {
|
|
307
|
+
assertNonEmptyString(provider.name, "provider.name");
|
|
308
|
+
if (existingNames.has(provider.name)) {
|
|
309
|
+
throw new Error(`provider name must be unique: ${provider.name}`);
|
|
310
|
+
}
|
|
311
|
+
assertNonEmptyString(provider.model, `${provider.name}.model`);
|
|
312
|
+
if (provider.history_query.schema !== POLICY_AUTHOR_HISTORY_QUERY_SCHEMA) {
|
|
313
|
+
throw new Error(`${provider.name}.history_query schema must be ${POLICY_AUTHOR_HISTORY_QUERY_SCHEMA}`);
|
|
314
|
+
}
|
|
315
|
+
if (provider.history_query.v !== POLICY_ARTIFACT_VERSION) {
|
|
316
|
+
throw new Error(`${provider.name}.history_query version must be 0`);
|
|
317
|
+
}
|
|
318
|
+
if (!Array.isArray(provider.history_query.selected_receipt_hashes)) {
|
|
319
|
+
throw new Error(`${provider.name}.history_query selected hashes must be an array`);
|
|
320
|
+
}
|
|
321
|
+
cloneJson(provider.artifact);
|
|
322
|
+
}
|
|
323
|
+
function readResult(results, index) {
|
|
324
|
+
const result = results[index];
|
|
325
|
+
if (result === undefined) {
|
|
326
|
+
throw new Error(`expected provider parity result ${index}`);
|
|
327
|
+
}
|
|
328
|
+
return result;
|
|
329
|
+
}
|
|
330
|
+
function readRegistryValidationState(registry) {
|
|
331
|
+
const state = registry.policy_artifact_validation_state ?? registry.validation_state;
|
|
332
|
+
if (isRecord(state) && state["status"] === "validated") {
|
|
333
|
+
return "validated";
|
|
334
|
+
}
|
|
335
|
+
if (state === "validated") {
|
|
336
|
+
return "validated";
|
|
337
|
+
}
|
|
338
|
+
throw new Error("registry policy artifact validation state must be validated");
|
|
339
|
+
}
|
|
340
|
+
function assertNonEmptyString(value, label) {
|
|
341
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
342
|
+
throw new Error(`${label} must be a non-empty string`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
function readNonEmptyString(value, label) {
|
|
346
|
+
assertNonEmptyString(value, label);
|
|
347
|
+
return value;
|
|
348
|
+
}
|
|
349
|
+
function readContentHash(value, label) {
|
|
350
|
+
if (typeof value !== "string" || !/^sha256:[a-f0-9]{64}$/.test(value)) {
|
|
351
|
+
throw new Error(`${label} must be a sha256 content address`);
|
|
352
|
+
}
|
|
353
|
+
return value;
|
|
354
|
+
}
|
|
355
|
+
function createCanonicalSnapshot(value, label) {
|
|
356
|
+
try {
|
|
357
|
+
const canonical = renderCanonical(value);
|
|
358
|
+
return {
|
|
359
|
+
value: JSON.parse(canonical),
|
|
360
|
+
canonical,
|
|
361
|
+
hash: hashCanonical(canonical),
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
const message = error instanceof Error ? error.message : "canonicalization failed";
|
|
366
|
+
throw new Error(`${label} must be canonical JSON: ${message}`);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function cloneFromCanonical(snapshot) {
|
|
370
|
+
return JSON.parse(snapshot.canonical);
|
|
371
|
+
}
|
|
372
|
+
function cloneJson(value) {
|
|
373
|
+
return cloneFromCanonical(createCanonicalSnapshot(value, "provider parity JSON"));
|
|
374
|
+
}
|
|
375
|
+
function hashCanonical(canonical) {
|
|
376
|
+
return `sha256:${(0, node_crypto_1.createHash)("sha256").update(canonical).digest("hex")}`;
|
|
377
|
+
}
|
|
378
|
+
function renderCanonical(value) {
|
|
379
|
+
if (value === null) {
|
|
380
|
+
return "null";
|
|
381
|
+
}
|
|
382
|
+
switch (typeof value) {
|
|
383
|
+
case "boolean":
|
|
384
|
+
return value ? "true" : "false";
|
|
385
|
+
case "number":
|
|
386
|
+
if (!Number.isFinite(value)) {
|
|
387
|
+
throw new TypeError("Cannot canonicalize non-finite numbers");
|
|
388
|
+
}
|
|
389
|
+
return JSON.stringify(value);
|
|
390
|
+
case "string":
|
|
391
|
+
return JSON.stringify(value);
|
|
392
|
+
case "object":
|
|
393
|
+
if (Array.isArray(value)) {
|
|
394
|
+
return `[${value.map((item) => renderCanonical(item)).join(",")}]`;
|
|
395
|
+
}
|
|
396
|
+
if (!isRecord(value)) {
|
|
397
|
+
throw new TypeError("Cannot canonicalize non-plain object");
|
|
398
|
+
}
|
|
399
|
+
return `{${Object.keys(value)
|
|
400
|
+
.sort()
|
|
401
|
+
.map((key) => {
|
|
402
|
+
const item = value[key];
|
|
403
|
+
if (item === undefined) {
|
|
404
|
+
throw new TypeError(`Cannot canonicalize undefined field ${key}`);
|
|
405
|
+
}
|
|
406
|
+
return `${JSON.stringify(key)}:${renderCanonical(item)}`;
|
|
407
|
+
})
|
|
408
|
+
.join(",")}}`;
|
|
409
|
+
case "undefined":
|
|
410
|
+
case "bigint":
|
|
411
|
+
case "function":
|
|
412
|
+
case "symbol":
|
|
413
|
+
throw new TypeError(`Cannot canonicalize ${typeof value}`);
|
|
414
|
+
}
|
|
415
|
+
throw new TypeError("Cannot canonicalize unknown value");
|
|
416
|
+
}
|
|
417
|
+
function isRecord(value) {
|
|
418
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
419
|
+
}
|
|
420
|
+
function loadDefaultAuthorPolicyArtifactV0() {
|
|
421
|
+
return loadReactorPolicy().authorPolicyArtifactV0;
|
|
422
|
+
}
|
|
423
|
+
function loadReactorPolicy() {
|
|
424
|
+
try {
|
|
425
|
+
return require("@openprose/reactor/policy");
|
|
426
|
+
}
|
|
427
|
+
catch (error) {
|
|
428
|
+
if (isMissingReactorSubpath(error, "@openprose/reactor/policy")) {
|
|
429
|
+
return require("../../../reactor/dist/policy");
|
|
430
|
+
}
|
|
431
|
+
throw error;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function isMissingReactorSubpath(error, subpath) {
|
|
435
|
+
return (isRecord(error) &&
|
|
436
|
+
error["code"] === "MODULE_NOT_FOUND" &&
|
|
437
|
+
typeof error["message"] === "string" &&
|
|
438
|
+
error["message"].includes(subpath));
|
|
439
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { AuthoredPolicyArtifactV0, PolicyLiveObservableV0 } from "@openprose/reactor/policy";
|
|
2
|
+
import type { ContentHashV0, ReceiptV0 } from "@openprose/reactor/receipt";
|
|
3
|
+
import type { ReactorAgentSdkAdapterV0, ReactorModelGatewayAdapterV0, ReactorRegistrySnapshotV0 } from "@openprose/reactor/sdk";
|
|
4
|
+
import { type RecordedPolicyDriftP2ScenarioV0 } from "../policy-drift";
|
|
5
|
+
export declare const POLICY_RECOMPILE_D1_SCENARIO_SCHEMA_V0: "openprose.reactor-cradle.recompile-d1-scenario";
|
|
6
|
+
export declare const POLICY_RECOMPILE_D1_SCENARIO_VERSION_V0: 0;
|
|
7
|
+
export declare const POLICY_RECOMPILE_D1_AUTHOR_CASSETTE_SCHEMA_V0: "openprose.reactor-cradle.recompile-d1-author-cassette";
|
|
8
|
+
export declare const POLICY_RECOMPILE_D1_AUTHOR_CASSETTE_VERSION_V0: 0;
|
|
9
|
+
export type PolicyRecompileDecisionOutcomeV0 = "no-recompile-needed" | "recompile-requested" | "recompile-delayed" | "needs-judgment";
|
|
10
|
+
export type PlanPolicyRecompileV0 = (input: PolicyRecompilePlanInputV0) => Promise<unknown> | unknown;
|
|
11
|
+
export type ExecutePolicyRecompileV0 = (input: PolicyRecompileExecutionInputV0) => Promise<unknown> | unknown;
|
|
12
|
+
export type PolicyRecompileAuthorV0 = (input: unknown) => Promise<ReactorRegistrySnapshotV0> | ReactorRegistrySnapshotV0;
|
|
13
|
+
export interface RecordedPolicyRecompileD1ScenarioV0 {
|
|
14
|
+
readonly schema: typeof POLICY_RECOMPILE_D1_SCENARIO_SCHEMA_V0;
|
|
15
|
+
readonly v: typeof POLICY_RECOMPILE_D1_SCENARIO_VERSION_V0;
|
|
16
|
+
readonly responsibility_id: string;
|
|
17
|
+
readonly contract_revision: ContentHashV0;
|
|
18
|
+
readonly contract_summary: string;
|
|
19
|
+
readonly as_of: string;
|
|
20
|
+
readonly last_recompile_at_allowed: string;
|
|
21
|
+
readonly last_recompile_at_blocked: string;
|
|
22
|
+
readonly min_recompile_interval_ms: number;
|
|
23
|
+
readonly receipt_history: readonly ReceiptV0[];
|
|
24
|
+
readonly policy_artifact: AuthoredPolicyArtifactV0;
|
|
25
|
+
readonly policy_artifact_bytes: string;
|
|
26
|
+
readonly policy_artifact_content_hash: ContentHashV0;
|
|
27
|
+
readonly recompiled_registry_snapshot: ReactorRegistrySnapshotV0;
|
|
28
|
+
readonly drift_scenario: RecordedPolicyDriftP2ScenarioV0;
|
|
29
|
+
}
|
|
30
|
+
export interface PolicyRecompilePlanInputV0 {
|
|
31
|
+
readonly artifact: AuthoredPolicyArtifactV0;
|
|
32
|
+
readonly policy_artifact: AuthoredPolicyArtifactV0;
|
|
33
|
+
readonly receipts: readonly ReceiptV0[];
|
|
34
|
+
readonly receipt_history: readonly ReceiptV0[];
|
|
35
|
+
readonly as_of: string;
|
|
36
|
+
readonly last_recompile_at: string | null;
|
|
37
|
+
readonly last_policy_recompile_at: string | null;
|
|
38
|
+
readonly last_policy_revalidated_at: string;
|
|
39
|
+
readonly last_unforced_deep_at: string;
|
|
40
|
+
}
|
|
41
|
+
export interface PolicyRecompileExecutionInputV0 {
|
|
42
|
+
readonly decision: unknown;
|
|
43
|
+
readonly plan: unknown;
|
|
44
|
+
readonly recompile_decision: unknown;
|
|
45
|
+
readonly normalized_decision: NormalizedPolicyRecompileDecisionV0;
|
|
46
|
+
readonly artifact: AuthoredPolicyArtifactV0;
|
|
47
|
+
readonly policy_artifact: AuthoredPolicyArtifactV0;
|
|
48
|
+
readonly receipts: readonly ReceiptV0[];
|
|
49
|
+
readonly receipt_history: readonly ReceiptV0[];
|
|
50
|
+
readonly responsibility_id: string;
|
|
51
|
+
readonly contract_revision: ContentHashV0;
|
|
52
|
+
readonly contract_summary: string;
|
|
53
|
+
readonly no_anchor: boolean;
|
|
54
|
+
readonly live_observables: readonly PolicyLiveObservableV0[];
|
|
55
|
+
readonly as_of: string;
|
|
56
|
+
readonly last_recompile_at: string | null;
|
|
57
|
+
readonly last_policy_recompile_at: string | null;
|
|
58
|
+
readonly policy_artifact_namespace: string;
|
|
59
|
+
readonly authorPolicyArtifactV0: PolicyRecompileAuthorV0;
|
|
60
|
+
readonly author_policy_artifact_v0: PolicyRecompileAuthorV0;
|
|
61
|
+
readonly author_input: {
|
|
62
|
+
readonly responsibility_id: string;
|
|
63
|
+
readonly contract_revision: ContentHashV0;
|
|
64
|
+
readonly contract_summary: string;
|
|
65
|
+
readonly no_anchor: boolean;
|
|
66
|
+
readonly live_observables: readonly PolicyLiveObservableV0[];
|
|
67
|
+
readonly receipt_history: readonly ReceiptV0[];
|
|
68
|
+
readonly agentSdk: Pick<ReactorAgentSdkAdapterV0, "launch">;
|
|
69
|
+
readonly policy_artifact_namespace: string;
|
|
70
|
+
};
|
|
71
|
+
readonly agentSdk: Pick<ReactorAgentSdkAdapterV0, "launch">;
|
|
72
|
+
readonly agent_sdk: Pick<ReactorAgentSdkAdapterV0, "launch">;
|
|
73
|
+
readonly modelGateway: Pick<ReactorModelGatewayAdapterV0, "invoke">;
|
|
74
|
+
readonly model_gateway: Pick<ReactorModelGatewayAdapterV0, "invoke">;
|
|
75
|
+
}
|
|
76
|
+
export interface NormalizedPolicyRecompileDecisionV0 {
|
|
77
|
+
readonly outcome: PolicyRecompileDecisionOutcomeV0;
|
|
78
|
+
readonly drift_outcome?: "not-tripped" | "tripped" | "indeterminate";
|
|
79
|
+
readonly evidence_receipt_hashes: readonly ContentHashV0[];
|
|
80
|
+
readonly raw: unknown;
|
|
81
|
+
}
|
|
82
|
+
export interface NormalizedPolicyRecompileExecutionV0 {
|
|
83
|
+
readonly outcome: "recompiled" | "skipped" | "unknown";
|
|
84
|
+
readonly registry_snapshot?: ReactorRegistrySnapshotV0;
|
|
85
|
+
readonly raw: unknown;
|
|
86
|
+
}
|
|
87
|
+
export interface RecordedPolicyRecompileAuthorInvocationV0 {
|
|
88
|
+
readonly input: unknown;
|
|
89
|
+
readonly input_canonical: string;
|
|
90
|
+
readonly input_hash: ContentHashV0;
|
|
91
|
+
readonly output: ReactorRegistrySnapshotV0;
|
|
92
|
+
readonly output_canonical: string;
|
|
93
|
+
readonly output_hash: ContentHashV0;
|
|
94
|
+
}
|
|
95
|
+
export interface RecordedPolicyRecompileAuthorAgentExchangeV0 {
|
|
96
|
+
readonly request: unknown;
|
|
97
|
+
readonly request_canonical: string;
|
|
98
|
+
readonly request_hash: ContentHashV0;
|
|
99
|
+
readonly response: unknown;
|
|
100
|
+
readonly response_canonical: string;
|
|
101
|
+
readonly response_hash: ContentHashV0;
|
|
102
|
+
}
|
|
103
|
+
export interface RecordedPolicyRecompileAuthorCassetteV0 {
|
|
104
|
+
readonly schema: typeof POLICY_RECOMPILE_D1_AUTHOR_CASSETTE_SCHEMA_V0;
|
|
105
|
+
readonly v: typeof POLICY_RECOMPILE_D1_AUTHOR_CASSETTE_VERSION_V0;
|
|
106
|
+
readonly invocations: readonly RecordedPolicyRecompileAuthorInvocationV0[];
|
|
107
|
+
readonly agent_exchanges: readonly RecordedPolicyRecompileAuthorAgentExchangeV0[];
|
|
108
|
+
readonly author_session_count: number;
|
|
109
|
+
}
|
|
110
|
+
export interface RecordedPolicyRecompileAuthorDoubleV0 {
|
|
111
|
+
readonly authorPolicyArtifactV0: PolicyRecompileAuthorV0;
|
|
112
|
+
readonly agentSdk: Pick<ReactorAgentSdkAdapterV0, "launch">;
|
|
113
|
+
readonly cassette: RecordedPolicyRecompileAuthorCassetteV0;
|
|
114
|
+
readonly invocation_count: number;
|
|
115
|
+
readonly assertInvokedExactly: (expected: number) => void;
|
|
116
|
+
}
|
|
117
|
+
export interface PolicyRecompileGatewayProbeV0 {
|
|
118
|
+
readonly agentSdk: Pick<ReactorAgentSdkAdapterV0, "launch">;
|
|
119
|
+
readonly agent_sdk: Pick<ReactorAgentSdkAdapterV0, "launch">;
|
|
120
|
+
readonly modelGateway: Pick<ReactorModelGatewayAdapterV0, "invoke">;
|
|
121
|
+
readonly model_gateway: Pick<ReactorModelGatewayAdapterV0, "invoke">;
|
|
122
|
+
readonly agent_launch_count: number;
|
|
123
|
+
readonly model_gateway_invocation_count: number;
|
|
124
|
+
readonly assertNoInvocations: () => void;
|
|
125
|
+
}
|
|
126
|
+
export interface RecordedPolicyRecompileD1ProofV0 {
|
|
127
|
+
readonly scenario: RecordedPolicyRecompileD1ScenarioV0;
|
|
128
|
+
readonly requested: NormalizedPolicyRecompileDecisionV0;
|
|
129
|
+
readonly delayed: NormalizedPolicyRecompileDecisionV0;
|
|
130
|
+
readonly requested_execution: NormalizedPolicyRecompileExecutionV0;
|
|
131
|
+
readonly delayed_execution: NormalizedPolicyRecompileExecutionV0;
|
|
132
|
+
readonly requested_author_cassette: RecordedPolicyRecompileAuthorCassetteV0;
|
|
133
|
+
readonly delayed_author_cassette: RecordedPolicyRecompileAuthorCassetteV0;
|
|
134
|
+
readonly requested_policy_author_invocation_count: 1;
|
|
135
|
+
readonly delayed_policy_author_invocation_count: 0;
|
|
136
|
+
readonly gateway_invocations: {
|
|
137
|
+
readonly requested: {
|
|
138
|
+
readonly agent_launch_count: 0;
|
|
139
|
+
readonly model_gateway_invocation_count: 0;
|
|
140
|
+
};
|
|
141
|
+
readonly delayed: {
|
|
142
|
+
readonly agent_launch_count: 0;
|
|
143
|
+
readonly model_gateway_invocation_count: 0;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export interface RunRecordedPolicyRecompileD1ProofInputV0 {
|
|
148
|
+
readonly planPolicyRecompileV0: PlanPolicyRecompileV0;
|
|
149
|
+
readonly executePolicyRecompileV0: ExecutePolicyRecompileV0;
|
|
150
|
+
readonly scenario?: RecordedPolicyRecompileD1ScenarioV0;
|
|
151
|
+
}
|
|
152
|
+
export declare function makeRecordedPolicyRecompileD1ScenarioV0(): RecordedPolicyRecompileD1ScenarioV0;
|
|
153
|
+
export declare function assertRecordedPolicyRecompileD1ScenarioV0(scenario: RecordedPolicyRecompileD1ScenarioV0): void;
|
|
154
|
+
export declare function createRecordedPolicyRecompileAuthorDoubleV0(scenario: RecordedPolicyRecompileD1ScenarioV0): RecordedPolicyRecompileAuthorDoubleV0;
|
|
155
|
+
export declare function createPolicyRecompileGatewayProbeV0(): PolicyRecompileGatewayProbeV0;
|
|
156
|
+
export declare function runRecordedPolicyRecompileD1ProofV0(input: RunRecordedPolicyRecompileD1ProofInputV0): Promise<RecordedPolicyRecompileD1ProofV0>;
|
|
157
|
+
export declare function normalizePolicyRecompileDecisionV0(result: unknown): NormalizedPolicyRecompileDecisionV0;
|
|
158
|
+
export declare function normalizePolicyRecompileExecutionV0(result: unknown, decision: NormalizedPolicyRecompileDecisionV0, authorInvocationCount: number): NormalizedPolicyRecompileExecutionV0;
|
|
159
|
+
export declare function createRecordedPolicyRecompilePlannerDoubleV0(): PlanPolicyRecompileV0;
|
|
160
|
+
export declare function createRecordedPolicyRecompileExecutorDoubleV0(): ExecutePolicyRecompileV0;
|
|
161
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recompile/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,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