@kashscript/lexicons 0.1.2 → 0.2.0-alpha.0
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 +7 -1
- package/README.md +1 -0
- package/dist/extensions/door.d.ts +225 -0
- package/dist/extensions/door.d.ts.map +1 -0
- package/dist/extensions/door.js +158 -0
- package/dist/extensions/door.js.map +1 -0
- package/dist/schema.js +5 -1
- package/dist/schema.js.map +1 -1
- package/package.json +10 -2
- package/src/extensions/door.ts +384 -0
- package/src/schema.ts +5 -1
package/LICENSE
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2026 KashScript Studio.
|
|
2
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
you may not use this file except in compliance with the License.
|
|
4
|
+
|
|
1
5
|
Apache License
|
|
2
6
|
Version 2.0, January 2004
|
|
3
7
|
http://www.apache.org/licenses/
|
|
@@ -196,4 +200,6 @@
|
|
|
196
200
|
License Agreement (SSLA) v1.0, Schedule A (Permissive Packages).
|
|
197
201
|
The SSLA grant is at-least-as-permissive as Apache-2.0 and exists to
|
|
198
202
|
give the entire Foundry a single agreement to point at. Full text:
|
|
199
|
-
|
|
203
|
+
docs/legal/SSLA.md in the KashScript repository, or on request from
|
|
204
|
+
studio@kashscript.dev. Canonical public URL from the first commercial
|
|
205
|
+
release: https://www.kashscript.com/legal/ssla
|
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ out of the box. The domain extensions (`social`, `trade`, `zkp`,
|
|
|
30
30
|
| `@kashscript/lexicons/extensions/trade` | The `kash.trade.*` vocabulary |
|
|
31
31
|
| `@kashscript/lexicons/extensions/zkp` | The `kash.zkp.*` vocabulary |
|
|
32
32
|
| `@kashscript/lexicons/extensions/{education,civic,community}` | Further opt-in vocabularies |
|
|
33
|
+
| `@kashscript/lexicons/extensions/door` | `kash.rule@1.0.0` (a door's published rule) and `kash.decision@1.0.0` (the decision receipt — the person's record, never published: `PERSONAL_LEXICONS`). Meaning is checked by `@kashscript/predicate`; see `specs/rule.md` and `specs/decision.md` |
|
|
33
34
|
|
|
34
35
|
---
|
|
35
36
|
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Door Extension — the rule a door publishes, and the decision receipt it
|
|
3
|
+
* gives back (ECOSYSTEM d84(a): rule · receipt · decision · recourse · renewal).
|
|
4
|
+
*
|
|
5
|
+
* kash.rule@1.0.0
|
|
6
|
+
* A door's published rule: what it decides, why, who decides (a role),
|
|
7
|
+
* the reasons it may give, its contest window, its renewal and end dates,
|
|
8
|
+
* and its criteria. Each criterion is an OpenID4VP 1.0 DCQL query for the
|
|
9
|
+
* receipts that answer it (or the person's own word) plus a FEEL condition
|
|
10
|
+
* over what the query returns — DMN's literal expression. Public and
|
|
11
|
+
* organisation-authored. Signed by its author as a DSSE envelope
|
|
12
|
+
* (`application/vnd.kash.rule+json`).
|
|
13
|
+
*
|
|
14
|
+
* kash.decision@1.0.0
|
|
15
|
+
* The decision receipt: the outcome under one version of a rule, with its
|
|
16
|
+
* reasons, the rows that fired and the hashes of the receipts it relied on —
|
|
17
|
+
* never their content. Signed by the deciding organisation as an SD-JWT VC
|
|
18
|
+
* (`https://kashscript.com/vct/decision/1`) to the person, who keeps it.
|
|
19
|
+
* **It is the person's record, so it is never published** — it is listed in
|
|
20
|
+
* `PERSONAL_LEXICONS`, which muffler's guard refuses.
|
|
21
|
+
*
|
|
22
|
+
* Both shapes are closed: a field this schema does not name is refused, so
|
|
23
|
+
* neither can carry a score, a person's identity or a receipt's content.
|
|
24
|
+
* Meaning (the floor's refusals, the FEEL check, the decision's routing rules)
|
|
25
|
+
* is checked by `@kashscript/predicate`; this extension is the shape.
|
|
26
|
+
*
|
|
27
|
+
* Import path: `@kashscript/lexicons/extensions/door`.
|
|
28
|
+
*/
|
|
29
|
+
import type { LexiconDef } from "../registry";
|
|
30
|
+
import { type ObjectSchema } from "../schema";
|
|
31
|
+
/** The DMN types a rule may give a value it reads — DMN's itemDefinition, in the FEEL subset. */
|
|
32
|
+
export declare const DOOR_INPUT_TYPES: readonly ["string", "number", "boolean", "date", "date and time", "days and time duration", "years and months duration", "list of string", "list of number", "list of boolean", "list of date", "list of date and time", "list of days and time duration", "list of years and months duration"];
|
|
33
|
+
export type DoorInputType = (typeof DOOR_INPUT_TYPES)[number];
|
|
34
|
+
export declare const DECISION_OUTCOMES: readonly ["yes", "not-yet", "no", "partial"];
|
|
35
|
+
export type DecisionOutcome = (typeof DECISION_OUTCOMES)[number];
|
|
36
|
+
export type ClaimPathElement = string | number | null;
|
|
37
|
+
export interface DcqlClaimsQuery {
|
|
38
|
+
/** Required here: a claim's id is the name its criterion's condition reads. */
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly path: readonly ClaimPathElement[];
|
|
41
|
+
readonly values?: readonly (string | number | boolean)[];
|
|
42
|
+
}
|
|
43
|
+
export interface DcqlTrustedAuthoritiesQuery {
|
|
44
|
+
/** `kash_issuer` (issuer DIDs) or `kash_trust_list` (`<publisher DID>#<list id>`), in the spec's extension point. */
|
|
45
|
+
readonly type: string;
|
|
46
|
+
readonly values: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
export interface DcqlMeta {
|
|
49
|
+
/** `dc+sd-jwt`: the accepted `vct` values. */
|
|
50
|
+
readonly vct_values?: readonly string[];
|
|
51
|
+
/** `kash-artifact`: the accepted registered DSTs (attest's registry). */
|
|
52
|
+
readonly dst_values?: readonly string[];
|
|
53
|
+
/** `kash-artifact`: `countersigned` asks for two independent signatures over the same bytes. */
|
|
54
|
+
readonly attestation?: "countersigned" | "issuer-signed";
|
|
55
|
+
/** `kash-artifact`: where in the signed payload the holder's key is named, for the presentation's binding. */
|
|
56
|
+
readonly holder_path?: readonly ClaimPathElement[];
|
|
57
|
+
}
|
|
58
|
+
export interface DcqlCredentialQuery {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly format: string;
|
|
61
|
+
readonly multiple?: boolean;
|
|
62
|
+
readonly meta?: DcqlMeta;
|
|
63
|
+
readonly trusted_authorities?: readonly DcqlTrustedAuthoritiesQuery[];
|
|
64
|
+
readonly require_cryptographic_holder_binding?: boolean;
|
|
65
|
+
readonly claims?: readonly DcqlClaimsQuery[];
|
|
66
|
+
readonly claim_sets?: readonly (readonly string[])[];
|
|
67
|
+
}
|
|
68
|
+
export declare const DCQL_CLAIMS_QUERY_SCHEMA: ObjectSchema;
|
|
69
|
+
export declare const DCQL_CREDENTIAL_QUERY_SCHEMA: ObjectSchema;
|
|
70
|
+
export declare const KASH_RULE_NSID: "kash.rule";
|
|
71
|
+
export declare const KASH_RULE_ID: "kash.rule@1.0.0";
|
|
72
|
+
export interface RuleParameter {
|
|
73
|
+
readonly type: DoorInputType;
|
|
74
|
+
/** Public rules: the threshold in clear. */
|
|
75
|
+
readonly value?: string | number | boolean;
|
|
76
|
+
/** Private rules: SHA-256 hex of JCS({name, value, salt}); the desk holds the opening. */
|
|
77
|
+
readonly sealed?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface RuleReason {
|
|
80
|
+
readonly code: string;
|
|
81
|
+
readonly outcome: DecisionOutcome;
|
|
82
|
+
readonly text: string;
|
|
83
|
+
}
|
|
84
|
+
export interface CriterionBasis {
|
|
85
|
+
readonly title: string;
|
|
86
|
+
readonly url?: string;
|
|
87
|
+
readonly clause?: string;
|
|
88
|
+
readonly page?: number;
|
|
89
|
+
readonly quote?: string;
|
|
90
|
+
}
|
|
91
|
+
export type CriterionAnswer = {
|
|
92
|
+
readonly by: "receipts";
|
|
93
|
+
/** DCQL credential queries, verbatim. Their ids are `<criterion>` or `<criterion>_<suffix>`. */
|
|
94
|
+
readonly query: readonly DcqlCredentialQuery[];
|
|
95
|
+
/** Which of them together answer the criterion (DCQL `credential_sets.options`). Default: each alone. */
|
|
96
|
+
readonly options?: readonly (readonly string[])[];
|
|
97
|
+
/** Display names for issuer DIDs and trust lists the queries name. */
|
|
98
|
+
readonly names?: Readonly<Record<string, string>>;
|
|
99
|
+
} | {
|
|
100
|
+
readonly by: "own-word";
|
|
101
|
+
/** What the person states, in plain words. */
|
|
102
|
+
readonly statement: string;
|
|
103
|
+
/** The values the person gives, by name and DMN type. */
|
|
104
|
+
readonly fields: Readonly<Record<string, DoorInputType>>;
|
|
105
|
+
};
|
|
106
|
+
export interface Criterion {
|
|
107
|
+
readonly id: string;
|
|
108
|
+
readonly label: string;
|
|
109
|
+
/** Why the door needs it. Required: P4's second rule — a rule asks only for what its purpose needs. */
|
|
110
|
+
readonly purpose: string;
|
|
111
|
+
readonly answer: CriterionAnswer;
|
|
112
|
+
/** An issuer's predicate (attest's predicate credential, `kind` = this criterion, `rule` = this rule) answers the row instead. */
|
|
113
|
+
readonly predicate?: {
|
|
114
|
+
readonly issuers: readonly {
|
|
115
|
+
readonly id: string;
|
|
116
|
+
readonly name: string;
|
|
117
|
+
}[];
|
|
118
|
+
readonly freshDays: number;
|
|
119
|
+
};
|
|
120
|
+
/** A FEEL expression (the DMN subset) over what the query returns, with a DMN type for every claim it reads. */
|
|
121
|
+
readonly condition?: {
|
|
122
|
+
readonly feel: string;
|
|
123
|
+
readonly types: Readonly<Record<string, DoorInputType>>;
|
|
124
|
+
};
|
|
125
|
+
/** The clause it comes from, when a rule is drawn from a written policy. */
|
|
126
|
+
readonly basis?: CriterionBasis;
|
|
127
|
+
}
|
|
128
|
+
export interface RuleBody {
|
|
129
|
+
/** `did:kash:<author>/rule/<slug>` — the publisher's DID plus a path, as d60 identifies places. */
|
|
130
|
+
readonly id: string;
|
|
131
|
+
readonly version: number;
|
|
132
|
+
/** The organisation that publishes it and answers for it. Never a person. */
|
|
133
|
+
readonly author: string;
|
|
134
|
+
readonly title: string;
|
|
135
|
+
readonly purpose: string;
|
|
136
|
+
readonly visibility: "public" | "private";
|
|
137
|
+
readonly parameters?: Readonly<Record<string, RuleParameter>>;
|
|
138
|
+
/** d43: every rule renews and ends. */
|
|
139
|
+
readonly dates: {
|
|
140
|
+
readonly published: string;
|
|
141
|
+
readonly renewBy: string;
|
|
142
|
+
readonly endsAt: string;
|
|
143
|
+
};
|
|
144
|
+
/** Who decides: a role, never a named person. */
|
|
145
|
+
readonly decider: {
|
|
146
|
+
readonly role: string;
|
|
147
|
+
};
|
|
148
|
+
readonly outcome: {
|
|
149
|
+
/** What a yes grants, in plain words. */
|
|
150
|
+
readonly grants: string;
|
|
151
|
+
/** It binds the person — credit, a contract, a debt (P3): never automatic. */
|
|
152
|
+
readonly binds: boolean;
|
|
153
|
+
/** It touches sensitive data (GDPR art. 9): never automatic. */
|
|
154
|
+
readonly sensitive: boolean;
|
|
155
|
+
/** The author's standing decision: a yes is given when every criterion is met. Refused with `binds` or `sensitive`. */
|
|
156
|
+
readonly automaticYes: boolean;
|
|
157
|
+
};
|
|
158
|
+
readonly reasons: readonly RuleReason[];
|
|
159
|
+
readonly contest: {
|
|
160
|
+
readonly windowDays: number;
|
|
161
|
+
readonly answerDays: number;
|
|
162
|
+
readonly how: string;
|
|
163
|
+
};
|
|
164
|
+
/** P4's first rule: another way to show the same thing. Paper is the floor. */
|
|
165
|
+
readonly anotherWay: string;
|
|
166
|
+
readonly criteria: readonly Criterion[];
|
|
167
|
+
/** The author's written answers to the warnings validation raised. Published with the rule. */
|
|
168
|
+
readonly answers?: readonly {
|
|
169
|
+
readonly criterion: string;
|
|
170
|
+
readonly code: string;
|
|
171
|
+
readonly text: string;
|
|
172
|
+
}[];
|
|
173
|
+
/** Practice rules say so inside what is signed. */
|
|
174
|
+
readonly practice?: boolean;
|
|
175
|
+
}
|
|
176
|
+
export declare const CRITERION_SCHEMA: ObjectSchema;
|
|
177
|
+
export declare const KASH_RULE_BODY_SCHEMA: ObjectSchema;
|
|
178
|
+
export declare const KASH_RULE_LEXICON: LexiconDef;
|
|
179
|
+
export declare const KASH_DECISION_NSID: "kash.decision";
|
|
180
|
+
export declare const KASH_DECISION_ID: "kash.decision@1.0.0";
|
|
181
|
+
export type DecidedBy = {
|
|
182
|
+
readonly kind: "standing";
|
|
183
|
+
readonly standing: string;
|
|
184
|
+
} | {
|
|
185
|
+
readonly kind: "person";
|
|
186
|
+
readonly role: string;
|
|
187
|
+
readonly seat: string;
|
|
188
|
+
readonly signature: string;
|
|
189
|
+
};
|
|
190
|
+
export interface DecisionBody {
|
|
191
|
+
readonly rule: {
|
|
192
|
+
readonly id: string;
|
|
193
|
+
readonly version: number;
|
|
194
|
+
readonly hash: string;
|
|
195
|
+
};
|
|
196
|
+
readonly outcome: DecisionOutcome;
|
|
197
|
+
/** Codes from the rule's reasons. At least one — node rule 11. */
|
|
198
|
+
readonly reasons: readonly string[];
|
|
199
|
+
readonly rows: {
|
|
200
|
+
readonly fired: readonly string[];
|
|
201
|
+
readonly missing: readonly string[];
|
|
202
|
+
};
|
|
203
|
+
/** SHA-256 hex of each receipt relied on. Never the receipt. */
|
|
204
|
+
readonly reliedOn: readonly string[];
|
|
205
|
+
readonly decidedBy: DecidedBy;
|
|
206
|
+
readonly automatic: boolean;
|
|
207
|
+
/** A refusal or a partial grant names the unmet criterion and that the receipts were read (P3). */
|
|
208
|
+
readonly refusal?: {
|
|
209
|
+
readonly unmet: readonly string[];
|
|
210
|
+
readonly receiptsRead: true;
|
|
211
|
+
};
|
|
212
|
+
readonly decidedAt: string;
|
|
213
|
+
readonly contestUntil: string;
|
|
214
|
+
readonly practice?: boolean;
|
|
215
|
+
}
|
|
216
|
+
export declare const KASH_DECISION_BODY_SCHEMA: ObjectSchema;
|
|
217
|
+
export declare const KASH_DECISION_LEXICON: LexiconDef;
|
|
218
|
+
export declare const DOOR_LEXICONS: readonly LexiconDef[];
|
|
219
|
+
/**
|
|
220
|
+
* NSIDs whose records belong to a person and are never published. muffler's
|
|
221
|
+
* guard (KS-N1) refuses them; d59: muffler and the lexicons publish public,
|
|
222
|
+
* organisation-authored records only.
|
|
223
|
+
*/
|
|
224
|
+
export declare const PERSONAL_LEXICONS: readonly string[];
|
|
225
|
+
//# sourceMappingURL=door.d.ts.map
|
|
@@ -0,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ECOSYSTEM d84(a): rule · receipt · decision · recourse · renewal).
|
|
4
|
+
*
|
|
5
|
+
* kash.rule@1.0.0
|
|
6
|
+
* A door's published rule: what it decides, why, who decides (a role),
|
|
7
|
+
* the reasons it may give, its contest window, its renewal and end dates,
|
|
8
|
+
* and its criteria. Each criterion is an OpenID4VP 1.0 DCQL query for the
|
|
9
|
+
* receipts that answer it (or the person's own word) plus a FEEL condition
|
|
10
|
+
* over what the query returns — DMN's literal expression. Public and
|
|
11
|
+
* organisation-authored. Signed by its author as a DSSE envelope
|
|
12
|
+
* (`application/vnd.kash.rule+json`).
|
|
13
|
+
*
|
|
14
|
+
* kash.decision@1.0.0
|
|
15
|
+
* The decision receipt: the outcome under one version of a rule, with its
|
|
16
|
+
* reasons, the rows that fired and the hashes of the receipts it relied on —
|
|
17
|
+
* never their content. Signed by the deciding organisation as an SD-JWT VC
|
|
18
|
+
* (`https://kashscript.com/vct/decision/1`) to the person, who keeps it.
|
|
19
|
+
* **It is the person's record, so it is never published** — it is listed in
|
|
20
|
+
* `PERSONAL_LEXICONS`, which muffler's guard refuses.
|
|
21
|
+
*
|
|
22
|
+
* Both shapes are closed: a field this schema does not name is refused, so
|
|
23
|
+
* neither can carry a score, a person's identity or a receipt's content.
|
|
24
|
+
* Meaning (the floor's refusals, the FEEL check, the decision's routing rules)
|
|
25
|
+
* is checked by `@kashscript/predicate`; this extension is the shape.
|
|
26
|
+
*
|
|
27
|
+
* Import path: `@kashscript/lexicons/extensions/door`.
|
|
28
|
+
*/
|
|
29
|
+
import { S } from "../schema";
|
|
30
|
+
/* ── shared pieces ─────────────────────────────────────────────────── */
|
|
31
|
+
const DID = S.string({ format: "did-ks" });
|
|
32
|
+
const ISO = S.string({ format: "iso8601" });
|
|
33
|
+
const HEX64 = S.string({ pattern: /^[0-9a-f]{64}$/ });
|
|
34
|
+
const SLUG = S.string({ pattern: /^[a-z0-9][a-z0-9-]{0,62}$/ });
|
|
35
|
+
/** DCQL ids: alphanumerics, `_` and `-` (OpenID4VP 1.0 §6.1). */
|
|
36
|
+
const DCQL_ID = S.string({ pattern: /^[A-Za-z0-9_-]{1,64}$/ });
|
|
37
|
+
const TEXT = (max) => S.string({ minLength: 1, maxLength: max });
|
|
38
|
+
/** The DMN types a rule may give a value it reads — DMN's itemDefinition, in the FEEL subset. */
|
|
39
|
+
export const DOOR_INPUT_TYPES = [
|
|
40
|
+
"string",
|
|
41
|
+
"number",
|
|
42
|
+
"boolean",
|
|
43
|
+
"date",
|
|
44
|
+
"date and time",
|
|
45
|
+
"days and time duration",
|
|
46
|
+
"years and months duration",
|
|
47
|
+
"list of string",
|
|
48
|
+
"list of number",
|
|
49
|
+
"list of boolean",
|
|
50
|
+
"list of date",
|
|
51
|
+
"list of date and time",
|
|
52
|
+
"list of days and time duration",
|
|
53
|
+
"list of years and months duration",
|
|
54
|
+
];
|
|
55
|
+
const INPUT_TYPE = S.enum(...DOOR_INPUT_TYPES);
|
|
56
|
+
export const DECISION_OUTCOMES = ["yes", "not-yet", "no", "partial"];
|
|
57
|
+
const PATH = S.array(S.union(S.string({ minLength: 1, maxLength: 128 }), S.number({ integer: true, min: 0 }), S.literal(null)), { minItems: 1, maxItems: 16 });
|
|
58
|
+
export const DCQL_CLAIMS_QUERY_SCHEMA = S.object({
|
|
59
|
+
id: DCQL_ID,
|
|
60
|
+
path: PATH,
|
|
61
|
+
values: S.optional(S.array(S.union(S.string({ maxLength: 512 }), S.number({ integer: true }), S.boolean()), { minItems: 1, maxItems: 64 })),
|
|
62
|
+
}, ["id", "path"]);
|
|
63
|
+
export const DCQL_CREDENTIAL_QUERY_SCHEMA = S.object({
|
|
64
|
+
id: DCQL_ID,
|
|
65
|
+
format: S.string({ minLength: 1, maxLength: 64 }),
|
|
66
|
+
multiple: S.optional(S.boolean()),
|
|
67
|
+
meta: S.optional(S.object({
|
|
68
|
+
vct_values: S.optional(S.array(S.string({ minLength: 1, maxLength: 256 }), { minItems: 1, maxItems: 16 })),
|
|
69
|
+
dst_values: S.optional(S.array(S.string({ minLength: 1, maxLength: 256 }), { minItems: 1, maxItems: 16 })),
|
|
70
|
+
attestation: S.optional(S.enum("countersigned", "issuer-signed")),
|
|
71
|
+
holder_path: S.optional(PATH),
|
|
72
|
+
})),
|
|
73
|
+
trusted_authorities: S.optional(S.array(S.object({ type: S.string({ minLength: 1, maxLength: 64 }), values: S.array(S.string({ minLength: 1, maxLength: 256 }), { minItems: 1, maxItems: 64 }) }, ["type", "values"]), { minItems: 1, maxItems: 8 })),
|
|
74
|
+
require_cryptographic_holder_binding: S.optional(S.boolean()),
|
|
75
|
+
claims: S.optional(S.array(DCQL_CLAIMS_QUERY_SCHEMA, { minItems: 1, maxItems: 32 })),
|
|
76
|
+
claim_sets: S.optional(S.array(S.array(DCQL_ID, { minItems: 1, maxItems: 32 }), { minItems: 1, maxItems: 16 })),
|
|
77
|
+
}, ["id", "format"]);
|
|
78
|
+
/* ── kash.rule@1.0.0 ───────────────────────────────────────────────── */
|
|
79
|
+
export const KASH_RULE_NSID = "kash.rule";
|
|
80
|
+
export const KASH_RULE_ID = "kash.rule@1.0.0";
|
|
81
|
+
const OWN_WORD_ANSWER = S.object({ by: S.literal("own-word"), statement: TEXT(280), fields: S.record(INPUT_TYPE, S.string({ pattern: /^[A-Za-z_][A-Za-z0-9_]{0,63}$/ })) }, ["by", "statement", "fields"]);
|
|
82
|
+
const RECEIPTS_ANSWER = S.object({
|
|
83
|
+
by: S.literal("receipts"),
|
|
84
|
+
query: S.array(DCQL_CREDENTIAL_QUERY_SCHEMA, { minItems: 1, maxItems: 8 }),
|
|
85
|
+
options: S.optional(S.array(S.array(DCQL_ID, { minItems: 1, maxItems: 8 }), { minItems: 1, maxItems: 8 })),
|
|
86
|
+
names: S.optional(S.record(TEXT(120))),
|
|
87
|
+
}, ["by", "query"]);
|
|
88
|
+
export const CRITERION_SCHEMA = S.object({
|
|
89
|
+
id: SLUG,
|
|
90
|
+
label: TEXT(160),
|
|
91
|
+
purpose: TEXT(600),
|
|
92
|
+
answer: S.union(RECEIPTS_ANSWER, OWN_WORD_ANSWER),
|
|
93
|
+
predicate: S.optional(S.object({
|
|
94
|
+
issuers: S.array(S.object({ id: DID, name: TEXT(120) }, ["id", "name"]), { minItems: 1, maxItems: 16 }),
|
|
95
|
+
freshDays: S.number({ integer: true, min: 1, max: 366 }),
|
|
96
|
+
}, ["issuers", "freshDays"])),
|
|
97
|
+
condition: S.optional(S.object({ feel: S.string({ minLength: 1, maxLength: 2048 }), types: S.record(INPUT_TYPE, S.string({ pattern: /^[A-Za-z_][A-Za-z0-9_]{0,63}$/ })) }, ["feel", "types"])),
|
|
98
|
+
basis: S.optional(S.object({ title: TEXT(200), url: S.optional(S.string({ format: "url" })), clause: S.optional(TEXT(120)), page: S.optional(S.number({ integer: true, min: 1 })), quote: S.optional(TEXT(1000)) }, ["title"])),
|
|
99
|
+
}, ["id", "label", "purpose", "answer"]);
|
|
100
|
+
export const KASH_RULE_BODY_SCHEMA = S.object({
|
|
101
|
+
id: S.string({ pattern: /^did:kash:[1-9A-HJ-NP-Za-km-z]{32,48}\/rule\/[a-z0-9][a-z0-9-]{0,62}$/ }),
|
|
102
|
+
version: S.number({ integer: true, min: 1 }),
|
|
103
|
+
author: DID,
|
|
104
|
+
title: TEXT(160),
|
|
105
|
+
purpose: TEXT(1000),
|
|
106
|
+
visibility: S.enum("public", "private"),
|
|
107
|
+
parameters: S.optional(S.record(S.object({ type: INPUT_TYPE, value: S.optional(S.union(S.string({ maxLength: 256 }), S.number(), S.boolean())), sealed: S.optional(HEX64) }, ["type"]), S.string({ pattern: /^[A-Za-z_][A-Za-z0-9_]{0,63}$/ }))),
|
|
108
|
+
dates: S.object({ published: ISO, renewBy: ISO, endsAt: ISO }, ["published", "renewBy", "endsAt"]),
|
|
109
|
+
decider: S.object({ role: TEXT(64) }, ["role"]),
|
|
110
|
+
outcome: S.object({ grants: TEXT(280), binds: S.boolean(), sensitive: S.boolean(), automaticYes: S.boolean() }, ["grants", "binds", "sensitive", "automaticYes"]),
|
|
111
|
+
reasons: S.array(S.object({ code: SLUG, outcome: S.enum(...DECISION_OUTCOMES), text: TEXT(400) }, ["code", "outcome", "text"]), { minItems: 2, maxItems: 32 }),
|
|
112
|
+
contest: S.object({ windowDays: S.number({ integer: true, min: 1, max: 366 }), answerDays: S.number({ integer: true, min: 1, max: 366 }), how: TEXT(400) }, ["windowDays", "answerDays", "how"]),
|
|
113
|
+
anotherWay: TEXT(600),
|
|
114
|
+
criteria: S.array(CRITERION_SCHEMA, { minItems: 1, maxItems: 32 }),
|
|
115
|
+
answers: S.optional(S.array(S.object({ criterion: SLUG, code: S.string({ pattern: /^[A-Z][A-Z_]{1,63}$/ }), text: TEXT(1000) }, ["criterion", "code", "text"]), { maxItems: 64 })),
|
|
116
|
+
practice: S.optional(S.boolean()),
|
|
117
|
+
}, ["id", "version", "author", "title", "purpose", "visibility", "dates", "decider", "outcome", "reasons", "contest", "anotherWay", "criteria"]);
|
|
118
|
+
export const KASH_RULE_LEXICON = {
|
|
119
|
+
id: KASH_RULE_ID,
|
|
120
|
+
nsid: KASH_RULE_NSID,
|
|
121
|
+
semver: { major: 1, minor: 0, patch: 0 },
|
|
122
|
+
bodySchema: KASH_RULE_BODY_SCHEMA,
|
|
123
|
+
title: "A door's rule",
|
|
124
|
+
description: "What a door decides, why, who decides, the reasons it may give, its contest window, renewal and end dates, and its criteria — each an OpenID4VP 1.0 DCQL query plus a FEEL condition. Public, organisation-authored, signed by its author.",
|
|
125
|
+
};
|
|
126
|
+
/* ── kash.decision@1.0.0 ───────────────────────────────────────────── */
|
|
127
|
+
export const KASH_DECISION_NSID = "kash.decision";
|
|
128
|
+
export const KASH_DECISION_ID = "kash.decision@1.0.0";
|
|
129
|
+
export const KASH_DECISION_BODY_SCHEMA = S.object({
|
|
130
|
+
rule: S.object({ id: KASH_RULE_BODY_SCHEMA.properties.id, version: S.number({ integer: true, min: 1 }), hash: HEX64 }, ["id", "version", "hash"]),
|
|
131
|
+
outcome: S.enum(...DECISION_OUTCOMES),
|
|
132
|
+
reasons: S.array(SLUG, { minItems: 1, maxItems: 32 }),
|
|
133
|
+
rows: S.object({ fired: S.array(SLUG, { maxItems: 32 }), missing: S.array(SLUG, { maxItems: 32 }) }, ["fired", "missing"]),
|
|
134
|
+
reliedOn: S.array(HEX64, { maxItems: 256 }),
|
|
135
|
+
decidedBy: S.union(S.object({ kind: S.literal("standing"), standing: S.string({ pattern: /^standing:did:kash:[1-9A-HJ-NP-Za-km-z]{32,48}$/ }) }, ["kind", "standing"]), S.object({ kind: S.literal("person"), role: TEXT(64), seat: DID, signature: S.string({ pattern: /^[A-Za-z0-9_-]+\.\.[A-Za-z0-9_-]+$/, maxLength: 1024 }) }, ["kind", "role", "seat", "signature"])),
|
|
136
|
+
automatic: S.boolean(),
|
|
137
|
+
refusal: S.optional(S.object({ unmet: S.array(SLUG, { minItems: 1, maxItems: 32 }), receiptsRead: S.literal(true) }, ["unmet", "receiptsRead"])),
|
|
138
|
+
decidedAt: ISO,
|
|
139
|
+
contestUntil: ISO,
|
|
140
|
+
practice: S.optional(S.boolean()),
|
|
141
|
+
}, ["rule", "outcome", "reasons", "rows", "reliedOn", "decidedBy", "automatic", "decidedAt", "contestUntil"]);
|
|
142
|
+
export const KASH_DECISION_LEXICON = {
|
|
143
|
+
id: KASH_DECISION_ID,
|
|
144
|
+
nsid: KASH_DECISION_NSID,
|
|
145
|
+
semver: { major: 1, minor: 0, patch: 0 },
|
|
146
|
+
bodySchema: KASH_DECISION_BODY_SCHEMA,
|
|
147
|
+
title: "A decision receipt",
|
|
148
|
+
description: "The outcome under one version of a rule, its reasons, the rows that fired and the hashes of the receipts relied on — never their content. The person's own record: signed to them, never published.",
|
|
149
|
+
};
|
|
150
|
+
/* ── bundles ───────────────────────────────────────────────────────── */
|
|
151
|
+
export const DOOR_LEXICONS = [KASH_RULE_LEXICON, KASH_DECISION_LEXICON];
|
|
152
|
+
/**
|
|
153
|
+
* NSIDs whose records belong to a person and are never published. muffler's
|
|
154
|
+
* guard (KS-N1) refuses them; d59: muffler and the lexicons publish public,
|
|
155
|
+
* organisation-authored records only.
|
|
156
|
+
*/
|
|
157
|
+
export const PERSONAL_LEXICONS = [KASH_DECISION_NSID];
|
|
158
|
+
//# sourceMappingURL=door.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"door.js","sourceRoot":"","sources":["../../src/extensions/door.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,CAAC,EAAkC,MAAM,WAAW,CAAC;AAE9D,0EAA0E;AAE1E,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC3C,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAC5C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACtD,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,CAAC;AAChE,iEAAiE;AACjE,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAC/D,MAAM,IAAI,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;AAEjF,iGAAiG;AACjG,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;IACN,eAAe;IACf,wBAAwB;IACxB,2BAA2B;IAC3B,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,uBAAuB;IACvB,gCAAgC;IAChC,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CAAC,CAAC,OAAO,EAAE,CAAC;CAClC,EACD,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,CAAC,CAC1G,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAe;IAC/C,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;IACxC,UAAU,EAAE,yBAAyB;IACrC,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,qMAAqM;CACxM,CAAC;AAEF,0EAA0E;AAE1E,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;AAE/F;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAsB,CAAC,kBAAkB,CAAC,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -196,7 +196,11 @@ function validateObject(s, value, path, errors) {
|
|
|
196
196
|
}
|
|
197
197
|
if (!s.additionalProperties) {
|
|
198
198
|
for (const k of Object.keys(obj)) {
|
|
199
|
-
|
|
199
|
+
// audit r1 (muffler F5): use own-key membership, not `k in s.properties`.
|
|
200
|
+
// `"__proto__" in s.properties` is `true` via Object.prototype, so the `in`
|
|
201
|
+
// form silently ACCEPTS a `__proto__`/`constructor` key under a strict
|
|
202
|
+
// (additionalProperties:false) schema — a prototype-pollution passthrough.
|
|
203
|
+
if (!Object.prototype.hasOwnProperty.call(s.properties, k)) {
|
|
200
204
|
errors.push(err([...path, k], "unknown field", obj[k]));
|
|
201
205
|
}
|
|
202
206
|
}
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA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,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kashscript/lexicons",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
4
4
|
"description": "Zero-dependency lexicon framework — envelope, schema DSL, registry, validator. Agnostic core; domain content ships as opt-in extensions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -70,6 +70,11 @@
|
|
|
70
70
|
"types": "./dist/extensions/community.d.ts",
|
|
71
71
|
"import": "./dist/extensions/community.js",
|
|
72
72
|
"default": "./dist/extensions/community.js"
|
|
73
|
+
},
|
|
74
|
+
"./extensions/door": {
|
|
75
|
+
"types": "./dist/extensions/door.d.ts",
|
|
76
|
+
"import": "./dist/extensions/door.js",
|
|
77
|
+
"default": "./dist/extensions/door.js"
|
|
73
78
|
}
|
|
74
79
|
},
|
|
75
80
|
"sideEffects": false,
|
|
@@ -82,10 +87,13 @@
|
|
|
82
87
|
"scripts": {
|
|
83
88
|
"build": "tsc -p tsconfig.json",
|
|
84
89
|
"typecheck": "tsc --noEmit",
|
|
90
|
+
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
|
|
91
|
+
"test": "bun run typecheck:test && bun test",
|
|
85
92
|
"clean": "rm -rf dist .turbo"
|
|
86
93
|
},
|
|
87
94
|
"devDependencies": {
|
|
88
|
-
"typescript": "^5.6.3"
|
|
95
|
+
"typescript": "^5.6.3",
|
|
96
|
+
"@types/bun": "^1.2.5"
|
|
89
97
|
},
|
|
90
98
|
"license": "Apache-2.0",
|
|
91
99
|
"publishConfig": {
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Door Extension — the rule a door publishes, and the decision receipt it
|
|
3
|
+
* gives back (ECOSYSTEM d84(a): rule · receipt · decision · recourse · renewal).
|
|
4
|
+
*
|
|
5
|
+
* kash.rule@1.0.0
|
|
6
|
+
* A door's published rule: what it decides, why, who decides (a role),
|
|
7
|
+
* the reasons it may give, its contest window, its renewal and end dates,
|
|
8
|
+
* and its criteria. Each criterion is an OpenID4VP 1.0 DCQL query for the
|
|
9
|
+
* receipts that answer it (or the person's own word) plus a FEEL condition
|
|
10
|
+
* over what the query returns — DMN's literal expression. Public and
|
|
11
|
+
* organisation-authored. Signed by its author as a DSSE envelope
|
|
12
|
+
* (`application/vnd.kash.rule+json`).
|
|
13
|
+
*
|
|
14
|
+
* kash.decision@1.0.0
|
|
15
|
+
* The decision receipt: the outcome under one version of a rule, with its
|
|
16
|
+
* reasons, the rows that fired and the hashes of the receipts it relied on —
|
|
17
|
+
* never their content. Signed by the deciding organisation as an SD-JWT VC
|
|
18
|
+
* (`https://kashscript.com/vct/decision/1`) to the person, who keeps it.
|
|
19
|
+
* **It is the person's record, so it is never published** — it is listed in
|
|
20
|
+
* `PERSONAL_LEXICONS`, which muffler's guard refuses.
|
|
21
|
+
*
|
|
22
|
+
* Both shapes are closed: a field this schema does not name is refused, so
|
|
23
|
+
* neither can carry a score, a person's identity or a receipt's content.
|
|
24
|
+
* Meaning (the floor's refusals, the FEEL check, the decision's routing rules)
|
|
25
|
+
* is checked by `@kashscript/predicate`; this extension is the shape.
|
|
26
|
+
*
|
|
27
|
+
* Import path: `@kashscript/lexicons/extensions/door`.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import type { LexiconDef } from "../registry";
|
|
31
|
+
import { S, type ObjectSchema, type Schema } from "../schema";
|
|
32
|
+
|
|
33
|
+
/* ── shared pieces ─────────────────────────────────────────────────── */
|
|
34
|
+
|
|
35
|
+
const DID = S.string({ format: "did-ks" });
|
|
36
|
+
const ISO = S.string({ format: "iso8601" });
|
|
37
|
+
const HEX64 = S.string({ pattern: /^[0-9a-f]{64}$/ });
|
|
38
|
+
const SLUG = S.string({ pattern: /^[a-z0-9][a-z0-9-]{0,62}$/ });
|
|
39
|
+
/** DCQL ids: alphanumerics, `_` and `-` (OpenID4VP 1.0 §6.1). */
|
|
40
|
+
const DCQL_ID = S.string({ pattern: /^[A-Za-z0-9_-]{1,64}$/ });
|
|
41
|
+
const TEXT = (max: number): Schema => S.string({ minLength: 1, maxLength: max });
|
|
42
|
+
|
|
43
|
+
/** The DMN types a rule may give a value it reads — DMN's itemDefinition, in the FEEL subset. */
|
|
44
|
+
export const DOOR_INPUT_TYPES = [
|
|
45
|
+
"string",
|
|
46
|
+
"number",
|
|
47
|
+
"boolean",
|
|
48
|
+
"date",
|
|
49
|
+
"date and time",
|
|
50
|
+
"days and time duration",
|
|
51
|
+
"years and months duration",
|
|
52
|
+
"list of string",
|
|
53
|
+
"list of number",
|
|
54
|
+
"list of boolean",
|
|
55
|
+
"list of date",
|
|
56
|
+
"list of date and time",
|
|
57
|
+
"list of days and time duration",
|
|
58
|
+
"list of years and months duration",
|
|
59
|
+
] as const;
|
|
60
|
+
export type DoorInputType = (typeof DOOR_INPUT_TYPES)[number];
|
|
61
|
+
const INPUT_TYPE = S.enum(...DOOR_INPUT_TYPES);
|
|
62
|
+
|
|
63
|
+
export const DECISION_OUTCOMES = ["yes", "not-yet", "no", "partial"] as const;
|
|
64
|
+
export type DecisionOutcome = (typeof DECISION_OUTCOMES)[number];
|
|
65
|
+
|
|
66
|
+
/* ── DCQL (OpenID4VP 1.0 §6), as a rule carries it ─────────────────── */
|
|
67
|
+
|
|
68
|
+
export type ClaimPathElement = string | number | null;
|
|
69
|
+
|
|
70
|
+
export interface DcqlClaimsQuery {
|
|
71
|
+
/** Required here: a claim's id is the name its criterion's condition reads. */
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly path: readonly ClaimPathElement[];
|
|
74
|
+
readonly values?: readonly (string | number | boolean)[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface DcqlTrustedAuthoritiesQuery {
|
|
78
|
+
/** `kash_issuer` (issuer DIDs) or `kash_trust_list` (`<publisher DID>#<list id>`), in the spec's extension point. */
|
|
79
|
+
readonly type: string;
|
|
80
|
+
readonly values: readonly string[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface DcqlMeta {
|
|
84
|
+
/** `dc+sd-jwt`: the accepted `vct` values. */
|
|
85
|
+
readonly vct_values?: readonly string[];
|
|
86
|
+
/** `kash-artifact`: the accepted registered DSTs (attest's registry). */
|
|
87
|
+
readonly dst_values?: readonly string[];
|
|
88
|
+
/** `kash-artifact`: `countersigned` asks for two independent signatures over the same bytes. */
|
|
89
|
+
readonly attestation?: "countersigned" | "issuer-signed";
|
|
90
|
+
/** `kash-artifact`: where in the signed payload the holder's key is named, for the presentation's binding. */
|
|
91
|
+
readonly holder_path?: readonly ClaimPathElement[];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface DcqlCredentialQuery {
|
|
95
|
+
readonly id: string;
|
|
96
|
+
readonly format: string;
|
|
97
|
+
readonly multiple?: boolean;
|
|
98
|
+
readonly meta?: DcqlMeta;
|
|
99
|
+
readonly trusted_authorities?: readonly DcqlTrustedAuthoritiesQuery[];
|
|
100
|
+
readonly require_cryptographic_holder_binding?: boolean;
|
|
101
|
+
readonly claims?: readonly DcqlClaimsQuery[];
|
|
102
|
+
readonly claim_sets?: readonly (readonly string[])[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const PATH = S.array(S.union(S.string({ minLength: 1, maxLength: 128 }), S.number({ integer: true, min: 0 }), S.literal(null)), { minItems: 1, maxItems: 16 });
|
|
106
|
+
|
|
107
|
+
export const DCQL_CLAIMS_QUERY_SCHEMA: ObjectSchema = S.object(
|
|
108
|
+
{
|
|
109
|
+
id: DCQL_ID,
|
|
110
|
+
path: PATH,
|
|
111
|
+
values: S.optional(S.array(S.union(S.string({ maxLength: 512 }), S.number({ integer: true }), S.boolean()), { minItems: 1, maxItems: 64 })),
|
|
112
|
+
},
|
|
113
|
+
["id", "path"],
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
export const DCQL_CREDENTIAL_QUERY_SCHEMA: ObjectSchema = S.object(
|
|
117
|
+
{
|
|
118
|
+
id: DCQL_ID,
|
|
119
|
+
format: S.string({ minLength: 1, maxLength: 64 }),
|
|
120
|
+
multiple: S.optional(S.boolean()),
|
|
121
|
+
meta: S.optional(
|
|
122
|
+
S.object({
|
|
123
|
+
vct_values: S.optional(S.array(S.string({ minLength: 1, maxLength: 256 }), { minItems: 1, maxItems: 16 })),
|
|
124
|
+
dst_values: S.optional(S.array(S.string({ minLength: 1, maxLength: 256 }), { minItems: 1, maxItems: 16 })),
|
|
125
|
+
attestation: S.optional(S.enum("countersigned", "issuer-signed")),
|
|
126
|
+
holder_path: S.optional(PATH),
|
|
127
|
+
}),
|
|
128
|
+
),
|
|
129
|
+
trusted_authorities: S.optional(
|
|
130
|
+
S.array(S.object({ type: S.string({ minLength: 1, maxLength: 64 }), values: S.array(S.string({ minLength: 1, maxLength: 256 }), { minItems: 1, maxItems: 64 }) }, ["type", "values"]), { minItems: 1, maxItems: 8 }),
|
|
131
|
+
),
|
|
132
|
+
require_cryptographic_holder_binding: S.optional(S.boolean()),
|
|
133
|
+
claims: S.optional(S.array(DCQL_CLAIMS_QUERY_SCHEMA, { minItems: 1, maxItems: 32 })),
|
|
134
|
+
claim_sets: S.optional(S.array(S.array(DCQL_ID, { minItems: 1, maxItems: 32 }), { minItems: 1, maxItems: 16 })),
|
|
135
|
+
},
|
|
136
|
+
["id", "format"],
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
/* ── kash.rule@1.0.0 ───────────────────────────────────────────────── */
|
|
140
|
+
|
|
141
|
+
export const KASH_RULE_NSID = "kash.rule" as const;
|
|
142
|
+
export const KASH_RULE_ID = "kash.rule@1.0.0" as const;
|
|
143
|
+
|
|
144
|
+
export interface RuleParameter {
|
|
145
|
+
readonly type: DoorInputType;
|
|
146
|
+
/** Public rules: the threshold in clear. */
|
|
147
|
+
readonly value?: string | number | boolean;
|
|
148
|
+
/** Private rules: SHA-256 hex of JCS({name, value, salt}); the desk holds the opening. */
|
|
149
|
+
readonly sealed?: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface RuleReason {
|
|
153
|
+
readonly code: string;
|
|
154
|
+
readonly outcome: DecisionOutcome;
|
|
155
|
+
readonly text: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface CriterionBasis {
|
|
159
|
+
readonly title: string;
|
|
160
|
+
readonly url?: string;
|
|
161
|
+
readonly clause?: string;
|
|
162
|
+
readonly page?: number;
|
|
163
|
+
readonly quote?: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export type CriterionAnswer =
|
|
167
|
+
| {
|
|
168
|
+
readonly by: "receipts";
|
|
169
|
+
/** DCQL credential queries, verbatim. Their ids are `<criterion>` or `<criterion>_<suffix>`. */
|
|
170
|
+
readonly query: readonly DcqlCredentialQuery[];
|
|
171
|
+
/** Which of them together answer the criterion (DCQL `credential_sets.options`). Default: each alone. */
|
|
172
|
+
readonly options?: readonly (readonly string[])[];
|
|
173
|
+
/** Display names for issuer DIDs and trust lists the queries name. */
|
|
174
|
+
readonly names?: Readonly<Record<string, string>>;
|
|
175
|
+
}
|
|
176
|
+
| {
|
|
177
|
+
readonly by: "own-word";
|
|
178
|
+
/** What the person states, in plain words. */
|
|
179
|
+
readonly statement: string;
|
|
180
|
+
/** The values the person gives, by name and DMN type. */
|
|
181
|
+
readonly fields: Readonly<Record<string, DoorInputType>>;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export interface Criterion {
|
|
185
|
+
readonly id: string;
|
|
186
|
+
readonly label: string;
|
|
187
|
+
/** Why the door needs it. Required: P4's second rule — a rule asks only for what its purpose needs. */
|
|
188
|
+
readonly purpose: string;
|
|
189
|
+
readonly answer: CriterionAnswer;
|
|
190
|
+
/** An issuer's predicate (attest's predicate credential, `kind` = this criterion, `rule` = this rule) answers the row instead. */
|
|
191
|
+
readonly predicate?: { readonly issuers: readonly { readonly id: string; readonly name: string }[]; readonly freshDays: number };
|
|
192
|
+
/** A FEEL expression (the DMN subset) over what the query returns, with a DMN type for every claim it reads. */
|
|
193
|
+
readonly condition?: { readonly feel: string; readonly types: Readonly<Record<string, DoorInputType>> };
|
|
194
|
+
/** The clause it comes from, when a rule is drawn from a written policy. */
|
|
195
|
+
readonly basis?: CriterionBasis;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface RuleBody {
|
|
199
|
+
/** `did:kash:<author>/rule/<slug>` — the publisher's DID plus a path, as d60 identifies places. */
|
|
200
|
+
readonly id: string;
|
|
201
|
+
readonly version: number;
|
|
202
|
+
/** The organisation that publishes it and answers for it. Never a person. */
|
|
203
|
+
readonly author: string;
|
|
204
|
+
readonly title: string;
|
|
205
|
+
readonly purpose: string;
|
|
206
|
+
readonly visibility: "public" | "private";
|
|
207
|
+
readonly parameters?: Readonly<Record<string, RuleParameter>>;
|
|
208
|
+
/** d43: every rule renews and ends. */
|
|
209
|
+
readonly dates: { readonly published: string; readonly renewBy: string; readonly endsAt: string };
|
|
210
|
+
/** Who decides: a role, never a named person. */
|
|
211
|
+
readonly decider: { readonly role: string };
|
|
212
|
+
readonly outcome: {
|
|
213
|
+
/** What a yes grants, in plain words. */
|
|
214
|
+
readonly grants: string;
|
|
215
|
+
/** It binds the person — credit, a contract, a debt (P3): never automatic. */
|
|
216
|
+
readonly binds: boolean;
|
|
217
|
+
/** It touches sensitive data (GDPR art. 9): never automatic. */
|
|
218
|
+
readonly sensitive: boolean;
|
|
219
|
+
/** The author's standing decision: a yes is given when every criterion is met. Refused with `binds` or `sensitive`. */
|
|
220
|
+
readonly automaticYes: boolean;
|
|
221
|
+
};
|
|
222
|
+
readonly reasons: readonly RuleReason[];
|
|
223
|
+
readonly contest: { readonly windowDays: number; readonly answerDays: number; readonly how: string };
|
|
224
|
+
/** P4's first rule: another way to show the same thing. Paper is the floor. */
|
|
225
|
+
readonly anotherWay: string;
|
|
226
|
+
readonly criteria: readonly Criterion[];
|
|
227
|
+
/** The author's written answers to the warnings validation raised. Published with the rule. */
|
|
228
|
+
readonly answers?: readonly { readonly criterion: string; readonly code: string; readonly text: string }[];
|
|
229
|
+
/** Practice rules say so inside what is signed. */
|
|
230
|
+
readonly practice?: boolean;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const OWN_WORD_ANSWER = S.object(
|
|
234
|
+
{ by: S.literal("own-word"), statement: TEXT(280), fields: S.record(INPUT_TYPE, S.string({ pattern: /^[A-Za-z_][A-Za-z0-9_]{0,63}$/ })) },
|
|
235
|
+
["by", "statement", "fields"],
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
const RECEIPTS_ANSWER = S.object(
|
|
239
|
+
{
|
|
240
|
+
by: S.literal("receipts"),
|
|
241
|
+
query: S.array(DCQL_CREDENTIAL_QUERY_SCHEMA, { minItems: 1, maxItems: 8 }),
|
|
242
|
+
options: S.optional(S.array(S.array(DCQL_ID, { minItems: 1, maxItems: 8 }), { minItems: 1, maxItems: 8 })),
|
|
243
|
+
names: S.optional(S.record(TEXT(120))),
|
|
244
|
+
},
|
|
245
|
+
["by", "query"],
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
export const CRITERION_SCHEMA: ObjectSchema = S.object(
|
|
249
|
+
{
|
|
250
|
+
id: SLUG,
|
|
251
|
+
label: TEXT(160),
|
|
252
|
+
purpose: TEXT(600),
|
|
253
|
+
answer: S.union(RECEIPTS_ANSWER, OWN_WORD_ANSWER),
|
|
254
|
+
predicate: S.optional(
|
|
255
|
+
S.object(
|
|
256
|
+
{
|
|
257
|
+
issuers: S.array(S.object({ id: DID, name: TEXT(120) }, ["id", "name"]), { minItems: 1, maxItems: 16 }),
|
|
258
|
+
freshDays: S.number({ integer: true, min: 1, max: 366 }),
|
|
259
|
+
},
|
|
260
|
+
["issuers", "freshDays"],
|
|
261
|
+
),
|
|
262
|
+
),
|
|
263
|
+
condition: S.optional(
|
|
264
|
+
S.object(
|
|
265
|
+
{ feel: S.string({ minLength: 1, maxLength: 2048 }), types: S.record(INPUT_TYPE, S.string({ pattern: /^[A-Za-z_][A-Za-z0-9_]{0,63}$/ })) },
|
|
266
|
+
["feel", "types"],
|
|
267
|
+
),
|
|
268
|
+
),
|
|
269
|
+
basis: S.optional(
|
|
270
|
+
S.object(
|
|
271
|
+
{ title: TEXT(200), url: S.optional(S.string({ format: "url" })), clause: S.optional(TEXT(120)), page: S.optional(S.number({ integer: true, min: 1 })), quote: S.optional(TEXT(1000)) },
|
|
272
|
+
["title"],
|
|
273
|
+
),
|
|
274
|
+
),
|
|
275
|
+
},
|
|
276
|
+
["id", "label", "purpose", "answer"],
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
export const KASH_RULE_BODY_SCHEMA: ObjectSchema = S.object(
|
|
280
|
+
{
|
|
281
|
+
id: S.string({ pattern: /^did:kash:[1-9A-HJ-NP-Za-km-z]{32,48}\/rule\/[a-z0-9][a-z0-9-]{0,62}$/ }),
|
|
282
|
+
version: S.number({ integer: true, min: 1 }),
|
|
283
|
+
author: DID,
|
|
284
|
+
title: TEXT(160),
|
|
285
|
+
purpose: TEXT(1000),
|
|
286
|
+
visibility: S.enum("public", "private"),
|
|
287
|
+
parameters: S.optional(
|
|
288
|
+
S.record(
|
|
289
|
+
S.object({ type: INPUT_TYPE, value: S.optional(S.union(S.string({ maxLength: 256 }), S.number(), S.boolean())), sealed: S.optional(HEX64) }, ["type"]),
|
|
290
|
+
S.string({ pattern: /^[A-Za-z_][A-Za-z0-9_]{0,63}$/ }),
|
|
291
|
+
),
|
|
292
|
+
),
|
|
293
|
+
dates: S.object({ published: ISO, renewBy: ISO, endsAt: ISO }, ["published", "renewBy", "endsAt"]),
|
|
294
|
+
decider: S.object({ role: TEXT(64) }, ["role"]),
|
|
295
|
+
outcome: S.object({ grants: TEXT(280), binds: S.boolean(), sensitive: S.boolean(), automaticYes: S.boolean() }, ["grants", "binds", "sensitive", "automaticYes"]),
|
|
296
|
+
reasons: S.array(S.object({ code: SLUG, outcome: S.enum(...DECISION_OUTCOMES), text: TEXT(400) }, ["code", "outcome", "text"]), { minItems: 2, maxItems: 32 }),
|
|
297
|
+
contest: S.object(
|
|
298
|
+
{ windowDays: S.number({ integer: true, min: 1, max: 366 }), answerDays: S.number({ integer: true, min: 1, max: 366 }), how: TEXT(400) },
|
|
299
|
+
["windowDays", "answerDays", "how"],
|
|
300
|
+
),
|
|
301
|
+
anotherWay: TEXT(600),
|
|
302
|
+
criteria: S.array(CRITERION_SCHEMA, { minItems: 1, maxItems: 32 }),
|
|
303
|
+
answers: S.optional(S.array(S.object({ criterion: SLUG, code: S.string({ pattern: /^[A-Z][A-Z_]{1,63}$/ }), text: TEXT(1000) }, ["criterion", "code", "text"]), { maxItems: 64 })),
|
|
304
|
+
practice: S.optional(S.boolean()),
|
|
305
|
+
},
|
|
306
|
+
["id", "version", "author", "title", "purpose", "visibility", "dates", "decider", "outcome", "reasons", "contest", "anotherWay", "criteria"],
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
export const KASH_RULE_LEXICON: LexiconDef = {
|
|
310
|
+
id: KASH_RULE_ID,
|
|
311
|
+
nsid: KASH_RULE_NSID,
|
|
312
|
+
semver: { major: 1, minor: 0, patch: 0 },
|
|
313
|
+
bodySchema: KASH_RULE_BODY_SCHEMA,
|
|
314
|
+
title: "A door's rule",
|
|
315
|
+
description:
|
|
316
|
+
"What a door decides, why, who decides, the reasons it may give, its contest window, renewal and end dates, and its criteria — each an OpenID4VP 1.0 DCQL query plus a FEEL condition. Public, organisation-authored, signed by its author.",
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
/* ── kash.decision@1.0.0 ───────────────────────────────────────────── */
|
|
320
|
+
|
|
321
|
+
export const KASH_DECISION_NSID = "kash.decision" as const;
|
|
322
|
+
export const KASH_DECISION_ID = "kash.decision@1.0.0" as const;
|
|
323
|
+
|
|
324
|
+
export type DecidedBy =
|
|
325
|
+
| { readonly kind: "standing"; readonly standing: string }
|
|
326
|
+
| { readonly kind: "person"; readonly role: string; readonly seat: string; readonly signature: string };
|
|
327
|
+
|
|
328
|
+
export interface DecisionBody {
|
|
329
|
+
readonly rule: { readonly id: string; readonly version: number; readonly hash: string };
|
|
330
|
+
readonly outcome: DecisionOutcome;
|
|
331
|
+
/** Codes from the rule's reasons. At least one — node rule 11. */
|
|
332
|
+
readonly reasons: readonly string[];
|
|
333
|
+
readonly rows: { readonly fired: readonly string[]; readonly missing: readonly string[] };
|
|
334
|
+
/** SHA-256 hex of each receipt relied on. Never the receipt. */
|
|
335
|
+
readonly reliedOn: readonly string[];
|
|
336
|
+
readonly decidedBy: DecidedBy;
|
|
337
|
+
readonly automatic: boolean;
|
|
338
|
+
/** A refusal or a partial grant names the unmet criterion and that the receipts were read (P3). */
|
|
339
|
+
readonly refusal?: { readonly unmet: readonly string[]; readonly receiptsRead: true };
|
|
340
|
+
readonly decidedAt: string;
|
|
341
|
+
readonly contestUntil: string;
|
|
342
|
+
readonly practice?: boolean;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export const KASH_DECISION_BODY_SCHEMA: ObjectSchema = S.object(
|
|
346
|
+
{
|
|
347
|
+
rule: S.object({ id: KASH_RULE_BODY_SCHEMA.properties.id!, version: S.number({ integer: true, min: 1 }), hash: HEX64 }, ["id", "version", "hash"]),
|
|
348
|
+
outcome: S.enum(...DECISION_OUTCOMES),
|
|
349
|
+
reasons: S.array(SLUG, { minItems: 1, maxItems: 32 }),
|
|
350
|
+
rows: S.object({ fired: S.array(SLUG, { maxItems: 32 }), missing: S.array(SLUG, { maxItems: 32 }) }, ["fired", "missing"]),
|
|
351
|
+
reliedOn: S.array(HEX64, { maxItems: 256 }),
|
|
352
|
+
decidedBy: S.union(
|
|
353
|
+
S.object({ kind: S.literal("standing"), standing: S.string({ pattern: /^standing:did:kash:[1-9A-HJ-NP-Za-km-z]{32,48}$/ }) }, ["kind", "standing"]),
|
|
354
|
+
S.object({ kind: S.literal("person"), role: TEXT(64), seat: DID, signature: S.string({ pattern: /^[A-Za-z0-9_-]+\.\.[A-Za-z0-9_-]+$/, maxLength: 1024 }) }, ["kind", "role", "seat", "signature"]),
|
|
355
|
+
),
|
|
356
|
+
automatic: S.boolean(),
|
|
357
|
+
refusal: S.optional(S.object({ unmet: S.array(SLUG, { minItems: 1, maxItems: 32 }), receiptsRead: S.literal(true) }, ["unmet", "receiptsRead"])),
|
|
358
|
+
decidedAt: ISO,
|
|
359
|
+
contestUntil: ISO,
|
|
360
|
+
practice: S.optional(S.boolean()),
|
|
361
|
+
},
|
|
362
|
+
["rule", "outcome", "reasons", "rows", "reliedOn", "decidedBy", "automatic", "decidedAt", "contestUntil"],
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
export const KASH_DECISION_LEXICON: LexiconDef = {
|
|
366
|
+
id: KASH_DECISION_ID,
|
|
367
|
+
nsid: KASH_DECISION_NSID,
|
|
368
|
+
semver: { major: 1, minor: 0, patch: 0 },
|
|
369
|
+
bodySchema: KASH_DECISION_BODY_SCHEMA,
|
|
370
|
+
title: "A decision receipt",
|
|
371
|
+
description:
|
|
372
|
+
"The outcome under one version of a rule, its reasons, the rows that fired and the hashes of the receipts relied on — never their content. The person's own record: signed to them, never published.",
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
/* ── bundles ───────────────────────────────────────────────────────── */
|
|
376
|
+
|
|
377
|
+
export const DOOR_LEXICONS: readonly LexiconDef[] = [KASH_RULE_LEXICON, KASH_DECISION_LEXICON];
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* NSIDs whose records belong to a person and are never published. muffler's
|
|
381
|
+
* guard (KS-N1) refuses them; d59: muffler and the lexicons publish public,
|
|
382
|
+
* organisation-authored records only.
|
|
383
|
+
*/
|
|
384
|
+
export const PERSONAL_LEXICONS: readonly string[] = [KASH_DECISION_NSID];
|
package/src/schema.ts
CHANGED
|
@@ -319,7 +319,11 @@ function validateObject(s: ObjectSchema, value: unknown, path: readonly (string
|
|
|
319
319
|
}
|
|
320
320
|
if (!s.additionalProperties) {
|
|
321
321
|
for (const k of Object.keys(obj)) {
|
|
322
|
-
|
|
322
|
+
// audit r1 (muffler F5): use own-key membership, not `k in s.properties`.
|
|
323
|
+
// `"__proto__" in s.properties` is `true` via Object.prototype, so the `in`
|
|
324
|
+
// form silently ACCEPTS a `__proto__`/`constructor` key under a strict
|
|
325
|
+
// (additionalProperties:false) schema — a prototype-pollution passthrough.
|
|
326
|
+
if (!Object.prototype.hasOwnProperty.call(s.properties, k)) {
|
|
323
327
|
errors.push(err([...path, k], "unknown field", obj[k]));
|
|
324
328
|
}
|
|
325
329
|
}
|