@riddledc/riddle-proof 0.8.81 → 0.8.83
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 +101 -0
- package/dist/chunk-DB5ZHRUP.js +585 -0
- package/dist/index.cjs +593 -4
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -0
- package/dist/semantic-certificate.cjs +614 -0
- package/dist/semantic-certificate.d.cts +191 -0
- package/dist/semantic-certificate.d.ts +191 -0
- package/dist/semantic-certificate.js +17 -0
- package/package.json +8 -3
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { JsonValue } from './types.cjs';
|
|
2
|
+
import './public-state.cjs';
|
|
3
|
+
|
|
4
|
+
declare const RIDDLE_PROOF_SEMANTIC_CERTIFICATE_VERSION: "riddle-proof.semantic-certificate.v0";
|
|
5
|
+
interface RiddleProofSemanticScope {
|
|
6
|
+
repository: string;
|
|
7
|
+
revision: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
target: string;
|
|
10
|
+
proof_attempt: string;
|
|
11
|
+
}
|
|
12
|
+
interface RiddleProofSemanticClaimRef {
|
|
13
|
+
claim_id: string;
|
|
14
|
+
claim_version: string;
|
|
15
|
+
parameters?: Record<string, JsonValue>;
|
|
16
|
+
}
|
|
17
|
+
interface RiddleProofSemanticClaim extends RiddleProofSemanticClaimRef {
|
|
18
|
+
label: string;
|
|
19
|
+
}
|
|
20
|
+
interface RiddleProofSemanticClaimExpectation extends RiddleProofSemanticClaimRef {
|
|
21
|
+
label?: string;
|
|
22
|
+
}
|
|
23
|
+
interface RiddleProofSemanticEvidenceRef {
|
|
24
|
+
receipt_id: string;
|
|
25
|
+
artifact_digest: string;
|
|
26
|
+
role: string;
|
|
27
|
+
artifact_url?: string;
|
|
28
|
+
artifact_path?: string;
|
|
29
|
+
}
|
|
30
|
+
type RiddleProofSemanticEvidenceBundle = [
|
|
31
|
+
RiddleProofSemanticEvidenceRef,
|
|
32
|
+
...RiddleProofSemanticEvidenceRef[]
|
|
33
|
+
];
|
|
34
|
+
interface RiddleProofSemanticContractRef {
|
|
35
|
+
contract_id: string;
|
|
36
|
+
contract_version: string;
|
|
37
|
+
label: string;
|
|
38
|
+
}
|
|
39
|
+
interface RiddleProofSemanticContract extends RiddleProofSemanticContractRef {
|
|
40
|
+
claim: RiddleProofSemanticClaim;
|
|
41
|
+
}
|
|
42
|
+
interface RiddleProofSemanticRuntimeContract<Observation> extends RiddleProofSemanticContract {
|
|
43
|
+
accepts: (scope: RiddleProofSemanticScope, observation: Observation) => boolean;
|
|
44
|
+
}
|
|
45
|
+
interface RiddleProofSemanticRule {
|
|
46
|
+
rule_id: string;
|
|
47
|
+
rule_version: string;
|
|
48
|
+
label: string;
|
|
49
|
+
premises: [RiddleProofSemanticClaimRef, ...RiddleProofSemanticClaimRef[]];
|
|
50
|
+
conclusion: RiddleProofSemanticClaim;
|
|
51
|
+
}
|
|
52
|
+
type RiddleProofSemanticAssurance = "runtime_contract_accepted" | "declared_runtime_rule";
|
|
53
|
+
interface RiddleProofSemanticPremise {
|
|
54
|
+
certificate_id: string;
|
|
55
|
+
derivation_kind: RiddleProofSemanticDerivation["kind"];
|
|
56
|
+
assurance: RiddleProofSemanticAssurance;
|
|
57
|
+
scope: RiddleProofSemanticScope;
|
|
58
|
+
claim: RiddleProofSemanticClaim;
|
|
59
|
+
evidence: RiddleProofSemanticEvidenceBundle;
|
|
60
|
+
}
|
|
61
|
+
interface RiddleProofSemanticContractDerivation {
|
|
62
|
+
kind: "contract";
|
|
63
|
+
assurance: "runtime_contract_accepted";
|
|
64
|
+
contract: RiddleProofSemanticContract;
|
|
65
|
+
}
|
|
66
|
+
interface RiddleProofSemanticCompositionDerivation {
|
|
67
|
+
kind: "composition";
|
|
68
|
+
assurance: "declared_runtime_rule";
|
|
69
|
+
rule: RiddleProofSemanticRule;
|
|
70
|
+
premises: [RiddleProofSemanticPremise, ...RiddleProofSemanticPremise[]];
|
|
71
|
+
}
|
|
72
|
+
type RiddleProofSemanticDerivation = RiddleProofSemanticContractDerivation | RiddleProofSemanticCompositionDerivation;
|
|
73
|
+
interface RiddleProofSemanticCertificate {
|
|
74
|
+
version: typeof RIDDLE_PROOF_SEMANTIC_CERTIFICATE_VERSION;
|
|
75
|
+
certificate_id: string;
|
|
76
|
+
scope: RiddleProofSemanticScope;
|
|
77
|
+
claim: RiddleProofSemanticClaim;
|
|
78
|
+
evidence: RiddleProofSemanticEvidenceBundle;
|
|
79
|
+
derivation: RiddleProofSemanticDerivation;
|
|
80
|
+
issued_at: string;
|
|
81
|
+
}
|
|
82
|
+
interface CreateRiddleProofSemanticCertificateInput<Observation> {
|
|
83
|
+
scope: RiddleProofSemanticScope;
|
|
84
|
+
evidence: RiddleProofSemanticEvidenceBundle;
|
|
85
|
+
observation: Observation;
|
|
86
|
+
contract: RiddleProofSemanticRuntimeContract<Observation>;
|
|
87
|
+
issued_at?: string;
|
|
88
|
+
}
|
|
89
|
+
interface RiddleProofSemanticContractRejected {
|
|
90
|
+
code: "contract_rejected";
|
|
91
|
+
contract: RiddleProofSemanticContractRef;
|
|
92
|
+
message: string;
|
|
93
|
+
}
|
|
94
|
+
interface RiddleProofSemanticContractError {
|
|
95
|
+
code: "contract_error";
|
|
96
|
+
contract: RiddleProofSemanticContractRef;
|
|
97
|
+
message: string;
|
|
98
|
+
}
|
|
99
|
+
type RiddleProofSemanticCertificationResult = {
|
|
100
|
+
ok: true;
|
|
101
|
+
certificate: RiddleProofSemanticCertificate;
|
|
102
|
+
} | {
|
|
103
|
+
ok: false;
|
|
104
|
+
error: RiddleProofSemanticContractRejected | RiddleProofSemanticContractError;
|
|
105
|
+
};
|
|
106
|
+
interface ComposeRiddleProofSemanticCertificatesInput {
|
|
107
|
+
rule: RiddleProofSemanticRule;
|
|
108
|
+
certificates: [RiddleProofSemanticCertificate, ...RiddleProofSemanticCertificate[]];
|
|
109
|
+
issued_at?: string;
|
|
110
|
+
}
|
|
111
|
+
type RiddleProofSemanticScopeField = keyof RiddleProofSemanticScope;
|
|
112
|
+
interface RiddleProofSemanticScopeMismatch {
|
|
113
|
+
code: "scope_mismatch";
|
|
114
|
+
input_index: number;
|
|
115
|
+
field: RiddleProofSemanticScopeField;
|
|
116
|
+
expected: string;
|
|
117
|
+
observed: string;
|
|
118
|
+
message: string;
|
|
119
|
+
}
|
|
120
|
+
interface RiddleProofSemanticPremiseCountMismatch {
|
|
121
|
+
code: "premise_count_mismatch";
|
|
122
|
+
expected: number;
|
|
123
|
+
observed: number;
|
|
124
|
+
message: string;
|
|
125
|
+
}
|
|
126
|
+
interface RiddleProofSemanticPremiseMismatch {
|
|
127
|
+
code: "premise_mismatch";
|
|
128
|
+
input_index: number;
|
|
129
|
+
expected: RiddleProofSemanticClaimRef;
|
|
130
|
+
observed: RiddleProofSemanticClaimRef;
|
|
131
|
+
message: string;
|
|
132
|
+
}
|
|
133
|
+
type RiddleProofSemanticCompositionError = RiddleProofSemanticScopeMismatch | RiddleProofSemanticPremiseCountMismatch | RiddleProofSemanticPremiseMismatch;
|
|
134
|
+
type RiddleProofSemanticCompositionResult = {
|
|
135
|
+
ok: true;
|
|
136
|
+
certificate: RiddleProofSemanticCertificate;
|
|
137
|
+
} | {
|
|
138
|
+
ok: false;
|
|
139
|
+
error: RiddleProofSemanticCompositionError;
|
|
140
|
+
};
|
|
141
|
+
interface MatchRiddleProofSemanticCertificateInput {
|
|
142
|
+
certificate: unknown;
|
|
143
|
+
expected_certificate_id: string;
|
|
144
|
+
expected_scope: RiddleProofSemanticScope;
|
|
145
|
+
expected_claim: RiddleProofSemanticClaimExpectation;
|
|
146
|
+
expected_assurance: RiddleProofSemanticAssurance;
|
|
147
|
+
}
|
|
148
|
+
interface RiddleProofSemanticCertificateInvalid {
|
|
149
|
+
code: "invalid_certificate";
|
|
150
|
+
message: string;
|
|
151
|
+
}
|
|
152
|
+
interface RiddleProofSemanticCertificateIdMismatch {
|
|
153
|
+
code: "certificate_id_mismatch";
|
|
154
|
+
expected: string;
|
|
155
|
+
observed: string;
|
|
156
|
+
message: string;
|
|
157
|
+
}
|
|
158
|
+
interface RiddleProofSemanticCertificateMatchScopeMismatch {
|
|
159
|
+
code: "scope_mismatch";
|
|
160
|
+
field: RiddleProofSemanticScopeField;
|
|
161
|
+
expected: string;
|
|
162
|
+
observed: string;
|
|
163
|
+
message: string;
|
|
164
|
+
}
|
|
165
|
+
interface RiddleProofSemanticCertificateClaimMismatch {
|
|
166
|
+
code: "claim_mismatch";
|
|
167
|
+
expected: RiddleProofSemanticClaimRef;
|
|
168
|
+
observed: RiddleProofSemanticClaimRef;
|
|
169
|
+
message: string;
|
|
170
|
+
}
|
|
171
|
+
interface RiddleProofSemanticCertificateAssuranceMismatch {
|
|
172
|
+
code: "assurance_mismatch";
|
|
173
|
+
expected: RiddleProofSemanticAssurance;
|
|
174
|
+
observed: RiddleProofSemanticAssurance;
|
|
175
|
+
message: string;
|
|
176
|
+
}
|
|
177
|
+
type RiddleProofSemanticCertificateMatchError = RiddleProofSemanticCertificateInvalid | RiddleProofSemanticCertificateIdMismatch | RiddleProofSemanticCertificateMatchScopeMismatch | RiddleProofSemanticCertificateClaimMismatch | RiddleProofSemanticCertificateAssuranceMismatch;
|
|
178
|
+
type RiddleProofSemanticCertificateMatchResult = {
|
|
179
|
+
ok: true;
|
|
180
|
+
certificate: RiddleProofSemanticCertificate;
|
|
181
|
+
} | {
|
|
182
|
+
ok: false;
|
|
183
|
+
error: RiddleProofSemanticCertificateMatchError;
|
|
184
|
+
};
|
|
185
|
+
declare function riddleProofSemanticScopesEqual(left: RiddleProofSemanticScope, right: RiddleProofSemanticScope): boolean;
|
|
186
|
+
declare function createRiddleProofSemanticCertificate<Observation>(input: CreateRiddleProofSemanticCertificateInput<Observation>): RiddleProofSemanticCertificationResult;
|
|
187
|
+
declare function parseRiddleProofSemanticCertificate(value: unknown): RiddleProofSemanticCertificate;
|
|
188
|
+
declare function matchRiddleProofSemanticCertificate(input: MatchRiddleProofSemanticCertificateInput): RiddleProofSemanticCertificateMatchResult;
|
|
189
|
+
declare function composeRiddleProofSemanticCertificates(input: ComposeRiddleProofSemanticCertificatesInput): RiddleProofSemanticCompositionResult;
|
|
190
|
+
|
|
191
|
+
export { type ComposeRiddleProofSemanticCertificatesInput, type CreateRiddleProofSemanticCertificateInput, type MatchRiddleProofSemanticCertificateInput, RIDDLE_PROOF_SEMANTIC_CERTIFICATE_VERSION, type RiddleProofSemanticAssurance, type RiddleProofSemanticCertificate, type RiddleProofSemanticCertificateAssuranceMismatch, type RiddleProofSemanticCertificateClaimMismatch, type RiddleProofSemanticCertificateIdMismatch, type RiddleProofSemanticCertificateInvalid, type RiddleProofSemanticCertificateMatchError, type RiddleProofSemanticCertificateMatchResult, type RiddleProofSemanticCertificateMatchScopeMismatch, type RiddleProofSemanticCertificationResult, type RiddleProofSemanticClaim, type RiddleProofSemanticClaimExpectation, type RiddleProofSemanticClaimRef, type RiddleProofSemanticCompositionDerivation, type RiddleProofSemanticCompositionError, type RiddleProofSemanticCompositionResult, type RiddleProofSemanticContract, type RiddleProofSemanticContractDerivation, type RiddleProofSemanticContractError, type RiddleProofSemanticContractRef, type RiddleProofSemanticContractRejected, type RiddleProofSemanticDerivation, type RiddleProofSemanticEvidenceBundle, type RiddleProofSemanticEvidenceRef, type RiddleProofSemanticPremise, type RiddleProofSemanticPremiseCountMismatch, type RiddleProofSemanticPremiseMismatch, type RiddleProofSemanticRule, type RiddleProofSemanticRuntimeContract, type RiddleProofSemanticScope, type RiddleProofSemanticScopeField, type RiddleProofSemanticScopeMismatch, composeRiddleProofSemanticCertificates, createRiddleProofSemanticCertificate, matchRiddleProofSemanticCertificate, parseRiddleProofSemanticCertificate, riddleProofSemanticScopesEqual };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { JsonValue } from './types.js';
|
|
2
|
+
import './public-state.js';
|
|
3
|
+
|
|
4
|
+
declare const RIDDLE_PROOF_SEMANTIC_CERTIFICATE_VERSION: "riddle-proof.semantic-certificate.v0";
|
|
5
|
+
interface RiddleProofSemanticScope {
|
|
6
|
+
repository: string;
|
|
7
|
+
revision: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
target: string;
|
|
10
|
+
proof_attempt: string;
|
|
11
|
+
}
|
|
12
|
+
interface RiddleProofSemanticClaimRef {
|
|
13
|
+
claim_id: string;
|
|
14
|
+
claim_version: string;
|
|
15
|
+
parameters?: Record<string, JsonValue>;
|
|
16
|
+
}
|
|
17
|
+
interface RiddleProofSemanticClaim extends RiddleProofSemanticClaimRef {
|
|
18
|
+
label: string;
|
|
19
|
+
}
|
|
20
|
+
interface RiddleProofSemanticClaimExpectation extends RiddleProofSemanticClaimRef {
|
|
21
|
+
label?: string;
|
|
22
|
+
}
|
|
23
|
+
interface RiddleProofSemanticEvidenceRef {
|
|
24
|
+
receipt_id: string;
|
|
25
|
+
artifact_digest: string;
|
|
26
|
+
role: string;
|
|
27
|
+
artifact_url?: string;
|
|
28
|
+
artifact_path?: string;
|
|
29
|
+
}
|
|
30
|
+
type RiddleProofSemanticEvidenceBundle = [
|
|
31
|
+
RiddleProofSemanticEvidenceRef,
|
|
32
|
+
...RiddleProofSemanticEvidenceRef[]
|
|
33
|
+
];
|
|
34
|
+
interface RiddleProofSemanticContractRef {
|
|
35
|
+
contract_id: string;
|
|
36
|
+
contract_version: string;
|
|
37
|
+
label: string;
|
|
38
|
+
}
|
|
39
|
+
interface RiddleProofSemanticContract extends RiddleProofSemanticContractRef {
|
|
40
|
+
claim: RiddleProofSemanticClaim;
|
|
41
|
+
}
|
|
42
|
+
interface RiddleProofSemanticRuntimeContract<Observation> extends RiddleProofSemanticContract {
|
|
43
|
+
accepts: (scope: RiddleProofSemanticScope, observation: Observation) => boolean;
|
|
44
|
+
}
|
|
45
|
+
interface RiddleProofSemanticRule {
|
|
46
|
+
rule_id: string;
|
|
47
|
+
rule_version: string;
|
|
48
|
+
label: string;
|
|
49
|
+
premises: [RiddleProofSemanticClaimRef, ...RiddleProofSemanticClaimRef[]];
|
|
50
|
+
conclusion: RiddleProofSemanticClaim;
|
|
51
|
+
}
|
|
52
|
+
type RiddleProofSemanticAssurance = "runtime_contract_accepted" | "declared_runtime_rule";
|
|
53
|
+
interface RiddleProofSemanticPremise {
|
|
54
|
+
certificate_id: string;
|
|
55
|
+
derivation_kind: RiddleProofSemanticDerivation["kind"];
|
|
56
|
+
assurance: RiddleProofSemanticAssurance;
|
|
57
|
+
scope: RiddleProofSemanticScope;
|
|
58
|
+
claim: RiddleProofSemanticClaim;
|
|
59
|
+
evidence: RiddleProofSemanticEvidenceBundle;
|
|
60
|
+
}
|
|
61
|
+
interface RiddleProofSemanticContractDerivation {
|
|
62
|
+
kind: "contract";
|
|
63
|
+
assurance: "runtime_contract_accepted";
|
|
64
|
+
contract: RiddleProofSemanticContract;
|
|
65
|
+
}
|
|
66
|
+
interface RiddleProofSemanticCompositionDerivation {
|
|
67
|
+
kind: "composition";
|
|
68
|
+
assurance: "declared_runtime_rule";
|
|
69
|
+
rule: RiddleProofSemanticRule;
|
|
70
|
+
premises: [RiddleProofSemanticPremise, ...RiddleProofSemanticPremise[]];
|
|
71
|
+
}
|
|
72
|
+
type RiddleProofSemanticDerivation = RiddleProofSemanticContractDerivation | RiddleProofSemanticCompositionDerivation;
|
|
73
|
+
interface RiddleProofSemanticCertificate {
|
|
74
|
+
version: typeof RIDDLE_PROOF_SEMANTIC_CERTIFICATE_VERSION;
|
|
75
|
+
certificate_id: string;
|
|
76
|
+
scope: RiddleProofSemanticScope;
|
|
77
|
+
claim: RiddleProofSemanticClaim;
|
|
78
|
+
evidence: RiddleProofSemanticEvidenceBundle;
|
|
79
|
+
derivation: RiddleProofSemanticDerivation;
|
|
80
|
+
issued_at: string;
|
|
81
|
+
}
|
|
82
|
+
interface CreateRiddleProofSemanticCertificateInput<Observation> {
|
|
83
|
+
scope: RiddleProofSemanticScope;
|
|
84
|
+
evidence: RiddleProofSemanticEvidenceBundle;
|
|
85
|
+
observation: Observation;
|
|
86
|
+
contract: RiddleProofSemanticRuntimeContract<Observation>;
|
|
87
|
+
issued_at?: string;
|
|
88
|
+
}
|
|
89
|
+
interface RiddleProofSemanticContractRejected {
|
|
90
|
+
code: "contract_rejected";
|
|
91
|
+
contract: RiddleProofSemanticContractRef;
|
|
92
|
+
message: string;
|
|
93
|
+
}
|
|
94
|
+
interface RiddleProofSemanticContractError {
|
|
95
|
+
code: "contract_error";
|
|
96
|
+
contract: RiddleProofSemanticContractRef;
|
|
97
|
+
message: string;
|
|
98
|
+
}
|
|
99
|
+
type RiddleProofSemanticCertificationResult = {
|
|
100
|
+
ok: true;
|
|
101
|
+
certificate: RiddleProofSemanticCertificate;
|
|
102
|
+
} | {
|
|
103
|
+
ok: false;
|
|
104
|
+
error: RiddleProofSemanticContractRejected | RiddleProofSemanticContractError;
|
|
105
|
+
};
|
|
106
|
+
interface ComposeRiddleProofSemanticCertificatesInput {
|
|
107
|
+
rule: RiddleProofSemanticRule;
|
|
108
|
+
certificates: [RiddleProofSemanticCertificate, ...RiddleProofSemanticCertificate[]];
|
|
109
|
+
issued_at?: string;
|
|
110
|
+
}
|
|
111
|
+
type RiddleProofSemanticScopeField = keyof RiddleProofSemanticScope;
|
|
112
|
+
interface RiddleProofSemanticScopeMismatch {
|
|
113
|
+
code: "scope_mismatch";
|
|
114
|
+
input_index: number;
|
|
115
|
+
field: RiddleProofSemanticScopeField;
|
|
116
|
+
expected: string;
|
|
117
|
+
observed: string;
|
|
118
|
+
message: string;
|
|
119
|
+
}
|
|
120
|
+
interface RiddleProofSemanticPremiseCountMismatch {
|
|
121
|
+
code: "premise_count_mismatch";
|
|
122
|
+
expected: number;
|
|
123
|
+
observed: number;
|
|
124
|
+
message: string;
|
|
125
|
+
}
|
|
126
|
+
interface RiddleProofSemanticPremiseMismatch {
|
|
127
|
+
code: "premise_mismatch";
|
|
128
|
+
input_index: number;
|
|
129
|
+
expected: RiddleProofSemanticClaimRef;
|
|
130
|
+
observed: RiddleProofSemanticClaimRef;
|
|
131
|
+
message: string;
|
|
132
|
+
}
|
|
133
|
+
type RiddleProofSemanticCompositionError = RiddleProofSemanticScopeMismatch | RiddleProofSemanticPremiseCountMismatch | RiddleProofSemanticPremiseMismatch;
|
|
134
|
+
type RiddleProofSemanticCompositionResult = {
|
|
135
|
+
ok: true;
|
|
136
|
+
certificate: RiddleProofSemanticCertificate;
|
|
137
|
+
} | {
|
|
138
|
+
ok: false;
|
|
139
|
+
error: RiddleProofSemanticCompositionError;
|
|
140
|
+
};
|
|
141
|
+
interface MatchRiddleProofSemanticCertificateInput {
|
|
142
|
+
certificate: unknown;
|
|
143
|
+
expected_certificate_id: string;
|
|
144
|
+
expected_scope: RiddleProofSemanticScope;
|
|
145
|
+
expected_claim: RiddleProofSemanticClaimExpectation;
|
|
146
|
+
expected_assurance: RiddleProofSemanticAssurance;
|
|
147
|
+
}
|
|
148
|
+
interface RiddleProofSemanticCertificateInvalid {
|
|
149
|
+
code: "invalid_certificate";
|
|
150
|
+
message: string;
|
|
151
|
+
}
|
|
152
|
+
interface RiddleProofSemanticCertificateIdMismatch {
|
|
153
|
+
code: "certificate_id_mismatch";
|
|
154
|
+
expected: string;
|
|
155
|
+
observed: string;
|
|
156
|
+
message: string;
|
|
157
|
+
}
|
|
158
|
+
interface RiddleProofSemanticCertificateMatchScopeMismatch {
|
|
159
|
+
code: "scope_mismatch";
|
|
160
|
+
field: RiddleProofSemanticScopeField;
|
|
161
|
+
expected: string;
|
|
162
|
+
observed: string;
|
|
163
|
+
message: string;
|
|
164
|
+
}
|
|
165
|
+
interface RiddleProofSemanticCertificateClaimMismatch {
|
|
166
|
+
code: "claim_mismatch";
|
|
167
|
+
expected: RiddleProofSemanticClaimRef;
|
|
168
|
+
observed: RiddleProofSemanticClaimRef;
|
|
169
|
+
message: string;
|
|
170
|
+
}
|
|
171
|
+
interface RiddleProofSemanticCertificateAssuranceMismatch {
|
|
172
|
+
code: "assurance_mismatch";
|
|
173
|
+
expected: RiddleProofSemanticAssurance;
|
|
174
|
+
observed: RiddleProofSemanticAssurance;
|
|
175
|
+
message: string;
|
|
176
|
+
}
|
|
177
|
+
type RiddleProofSemanticCertificateMatchError = RiddleProofSemanticCertificateInvalid | RiddleProofSemanticCertificateIdMismatch | RiddleProofSemanticCertificateMatchScopeMismatch | RiddleProofSemanticCertificateClaimMismatch | RiddleProofSemanticCertificateAssuranceMismatch;
|
|
178
|
+
type RiddleProofSemanticCertificateMatchResult = {
|
|
179
|
+
ok: true;
|
|
180
|
+
certificate: RiddleProofSemanticCertificate;
|
|
181
|
+
} | {
|
|
182
|
+
ok: false;
|
|
183
|
+
error: RiddleProofSemanticCertificateMatchError;
|
|
184
|
+
};
|
|
185
|
+
declare function riddleProofSemanticScopesEqual(left: RiddleProofSemanticScope, right: RiddleProofSemanticScope): boolean;
|
|
186
|
+
declare function createRiddleProofSemanticCertificate<Observation>(input: CreateRiddleProofSemanticCertificateInput<Observation>): RiddleProofSemanticCertificationResult;
|
|
187
|
+
declare function parseRiddleProofSemanticCertificate(value: unknown): RiddleProofSemanticCertificate;
|
|
188
|
+
declare function matchRiddleProofSemanticCertificate(input: MatchRiddleProofSemanticCertificateInput): RiddleProofSemanticCertificateMatchResult;
|
|
189
|
+
declare function composeRiddleProofSemanticCertificates(input: ComposeRiddleProofSemanticCertificatesInput): RiddleProofSemanticCompositionResult;
|
|
190
|
+
|
|
191
|
+
export { type ComposeRiddleProofSemanticCertificatesInput, type CreateRiddleProofSemanticCertificateInput, type MatchRiddleProofSemanticCertificateInput, RIDDLE_PROOF_SEMANTIC_CERTIFICATE_VERSION, type RiddleProofSemanticAssurance, type RiddleProofSemanticCertificate, type RiddleProofSemanticCertificateAssuranceMismatch, type RiddleProofSemanticCertificateClaimMismatch, type RiddleProofSemanticCertificateIdMismatch, type RiddleProofSemanticCertificateInvalid, type RiddleProofSemanticCertificateMatchError, type RiddleProofSemanticCertificateMatchResult, type RiddleProofSemanticCertificateMatchScopeMismatch, type RiddleProofSemanticCertificationResult, type RiddleProofSemanticClaim, type RiddleProofSemanticClaimExpectation, type RiddleProofSemanticClaimRef, type RiddleProofSemanticCompositionDerivation, type RiddleProofSemanticCompositionError, type RiddleProofSemanticCompositionResult, type RiddleProofSemanticContract, type RiddleProofSemanticContractDerivation, type RiddleProofSemanticContractError, type RiddleProofSemanticContractRef, type RiddleProofSemanticContractRejected, type RiddleProofSemanticDerivation, type RiddleProofSemanticEvidenceBundle, type RiddleProofSemanticEvidenceRef, type RiddleProofSemanticPremise, type RiddleProofSemanticPremiseCountMismatch, type RiddleProofSemanticPremiseMismatch, type RiddleProofSemanticRule, type RiddleProofSemanticRuntimeContract, type RiddleProofSemanticScope, type RiddleProofSemanticScopeField, type RiddleProofSemanticScopeMismatch, composeRiddleProofSemanticCertificates, createRiddleProofSemanticCertificate, matchRiddleProofSemanticCertificate, parseRiddleProofSemanticCertificate, riddleProofSemanticScopesEqual };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RIDDLE_PROOF_SEMANTIC_CERTIFICATE_VERSION,
|
|
3
|
+
composeRiddleProofSemanticCertificates,
|
|
4
|
+
createRiddleProofSemanticCertificate,
|
|
5
|
+
matchRiddleProofSemanticCertificate,
|
|
6
|
+
parseRiddleProofSemanticCertificate,
|
|
7
|
+
riddleProofSemanticScopesEqual
|
|
8
|
+
} from "./chunk-DB5ZHRUP.js";
|
|
9
|
+
import "./chunk-MLKGABMK.js";
|
|
10
|
+
export {
|
|
11
|
+
RIDDLE_PROOF_SEMANTIC_CERTIFICATE_VERSION,
|
|
12
|
+
composeRiddleProofSemanticCertificates,
|
|
13
|
+
createRiddleProofSemanticCertificate,
|
|
14
|
+
matchRiddleProofSemanticCertificate,
|
|
15
|
+
parseRiddleProofSemanticCertificate,
|
|
16
|
+
riddleProofSemanticScopesEqual
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riddledc/riddle-proof",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.83",
|
|
4
4
|
"description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "RiddleDC",
|
|
@@ -139,6 +139,11 @@
|
|
|
139
139
|
"import": "./dist/receipts.js",
|
|
140
140
|
"require": "./dist/receipts.cjs"
|
|
141
141
|
},
|
|
142
|
+
"./semantic-certificate": {
|
|
143
|
+
"types": "./dist/semantic-certificate.d.ts",
|
|
144
|
+
"import": "./dist/semantic-certificate.js",
|
|
145
|
+
"require": "./dist/semantic-certificate.cjs"
|
|
146
|
+
},
|
|
142
147
|
"./change-proof": {
|
|
143
148
|
"types": "./dist/change-proof.d.ts",
|
|
144
149
|
"import": "./dist/change-proof.js",
|
|
@@ -254,9 +259,9 @@
|
|
|
254
259
|
"typescript": "^5.4.5"
|
|
255
260
|
},
|
|
256
261
|
"scripts": {
|
|
257
|
-
"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/receipts.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",
|
|
262
|
+
"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/receipts.ts src/semantic-certificate.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",
|
|
258
263
|
"clean": "rm -rf dist",
|
|
259
264
|
"lint": "echo 'lint: (not configured)'",
|
|
260
|
-
"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))"
|
|
265
|
+
"test": "npm run build && node test.js && node semantic-certificate.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))"
|
|
261
266
|
}
|
|
262
267
|
}
|