@sema-agent/settings-schema 24.0.0 → 25.1.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/CHANGELOG.md +208 -0
- package/README.md +24 -2
- package/conformance/VERSION +1 -1
- package/conformance/cases/c88-projects-content-attestation-carried/expected.json +185 -0
- package/conformance/cases/c88-projects-content-attestation-carried/input.json +59 -0
- package/conformance/cases/c88-projects-content-attestation-carried/meta.json +6 -0
- package/conformance/cases/c89-projects-content-attestation-malformed/expected.json +104 -0
- package/conformance/cases/c89-projects-content-attestation-malformed/input.json +38 -0
- package/conformance/cases/c89-projects-content-attestation-malformed/meta.json +6 -0
- package/dist/config-fns.d.ts +43 -4
- package/dist/config-fns.js +112 -8
- package/dist/fleet.d.ts +41 -31
- package/dist/fleet.js +63 -30
- package/dist/types.d.ts +5 -2
- package/dist/types.js +6 -2
- package/docs/API-SURFACE.md +11 -5
- package/docs/CONSUMER-INTEGRATION.md +60 -0
- package/llms-full.txt +8 -5
- package/llms.txt +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"version": 18,
|
|
4
|
+
"updatedAt": "2026-11-09T00:00:00.000Z"
|
|
5
|
+
},
|
|
6
|
+
"domains": {
|
|
7
|
+
"projects": {
|
|
8
|
+
"projects": {
|
|
9
|
+
"01890a5d-ac96-774b-bcce-b302099a8101": {
|
|
10
|
+
"displayName": "stamped",
|
|
11
|
+
"gitRemotes": [
|
|
12
|
+
"example.com/acme/stamped"
|
|
13
|
+
],
|
|
14
|
+
"defaultScopes": [
|
|
15
|
+
"proj"
|
|
16
|
+
],
|
|
17
|
+
"registeredBy": "alice",
|
|
18
|
+
"registeredAt": "2026-10-01T00:00:00.000Z",
|
|
19
|
+
"goal": "ship the project object",
|
|
20
|
+
"contentAttestedAt": "2026-11-09T01:02:03Z"
|
|
21
|
+
},
|
|
22
|
+
"01890a5d-ac96-774b-bcce-b302099a8102": {
|
|
23
|
+
"displayName": "bad-stamp",
|
|
24
|
+
"gitRemotes": [
|
|
25
|
+
"example.com/acme/bad"
|
|
26
|
+
],
|
|
27
|
+
"defaultScopes": [
|
|
28
|
+
"proj"
|
|
29
|
+
],
|
|
30
|
+
"registeredBy": "alice",
|
|
31
|
+
"registeredAt": "2026-10-01T00:00:00.000Z",
|
|
32
|
+
"goal": "stamp is not a time",
|
|
33
|
+
"contentAttestedAt": "yesterday"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contributor": "contract",
|
|
3
|
+
"claim": "内容证明键形坏(\"yesterday\",不是 RFC 3339 date-time)的登记:读腿把那一条丢掉(entry-dropped,路径点到该登记),带合法章的那条照常在;严写腿整份拒。打的是两种读法分歧:章按 registeredAt 的「非空串」形收下(\"yesterday\" 读成「在场」,下游把没经过写口的内容当已证明)/ 坏章被静默剥掉而登记还在(读方看见一条「没有章」的登记,分不出是存量还是坏写)。",
|
|
4
|
+
"firstRedOn": [],
|
|
5
|
+
"note": "firstRedOn 为空:historical 阶梯(≤ 2.1.0)不覆盖 25.1.0 的新键;对 25.0.0 这一条读腿同样会丢这条登记(未知键),但原因不同,那一版不在入库的真跑证据里。"
|
|
6
|
+
}
|
package/dist/config-fns.d.ts
CHANGED
|
@@ -50,15 +50,54 @@ export declare const USER_ROLES: readonly UserRole[];
|
|
|
50
50
|
export declare function roleAtLeast(role: UserRole, min: UserRole): boolean;
|
|
51
51
|
export declare function isRole(v: unknown): v is UserRole;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* The FLOOR of a domain write: the minimum role any write to the domain needs. Default = `editor`; `skills` and `mcp` are raised to `publisher`
|
|
54
54
|
* because their content goes straight into the agent's system prompt / tool surface — one edit retargets
|
|
55
55
|
* the prompt of every worker × scenario that loads it (the mcp/skills design note §3.3, decision §6 Q3 从严).
|
|
56
|
-
*
|
|
56
|
+
* Any domain absent here uses {@link DEFAULT_DOMAIN_WRITE_ROLE}. Nobody reads this table directly: the one reader is
|
|
57
|
+
* {@link writeRoleFor}, which also looks at WHICH fields a write changes ({@link DOMAIN_FIELD_WRITE_ROLE}).
|
|
57
58
|
*/
|
|
58
59
|
export declare const DEFAULT_DOMAIN_WRITE_ROLE: UserRole;
|
|
59
60
|
export declare const DOMAIN_WRITE_ROLE: Partial<Record<DomainName, UserRole>>;
|
|
60
|
-
/**
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* The per-field write roles of a domain whose document is a record of entries: ONE role for each field of an entry, exhaustive for the entry's
|
|
63
|
+
* shape (the table is `satisfies`-checked against the entry type, so a field added to the entry without a role is a compile error — a new field
|
|
64
|
+
* cannot default into the floor unseen). `entries` is the document key that holds the record (`projects` ⇒ `{ projects: { <projectId>: <registration> } }`).
|
|
65
|
+
*/
|
|
66
|
+
export interface DomainFieldWriteRoles {
|
|
67
|
+
readonly entries: string;
|
|
68
|
+
readonly fields: Readonly<Record<string, UserRole>>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The domains whose write role depends on WHICH fields a write changes. Same shape of use as {@link DOMAIN_WRITE_ROLE} — a package-owned table,
|
|
72
|
+
* one row per domain, an absent row means "the floor decides" — read only through {@link writeRoleFor}; the changed fields come from
|
|
73
|
+
* {@link changedWriteFields} (the one place that diffs two documents against this table).
|
|
74
|
+
*/
|
|
75
|
+
export declare const DOMAIN_FIELD_WRITE_ROLE: Partial<Record<DomainName, DomainFieldWriteRoles>>;
|
|
76
|
+
/**
|
|
77
|
+
* The minimum role to make a write that changes exactly `changedFields` in `domain`: the HIGHEST of the domain's floor ({@link DOMAIN_WRITE_ROLE},
|
|
78
|
+
* else {@link DEFAULT_DOMAIN_WRITE_ROLE}) and the role of each changed field ({@link DOMAIN_FIELD_WRITE_ROLE}). `[]` = a write that changes no
|
|
79
|
+
* field that has a role of its own — the floor alone, which is also the answer to "may this role write anything in the domain at all" (a UI
|
|
80
|
+
* deciding whether to show a write affordance). The PUT, PATCH and mint doors of a domain all ask this ONE function, with the fields
|
|
81
|
+
* {@link changedWriteFields} reports for the document they are about to store. A field name the domain's table does not have — a typo, a
|
|
82
|
+
* field of another domain, any name for a domain with no field table — is a RangeError (the answer would otherwise be the floor, a quiet
|
|
83
|
+
* lowering): a caller's mistake is loud, never an `editor`.
|
|
84
|
+
*/
|
|
85
|
+
export declare function writeRoleFor(domain: DomainName, changedFields: readonly string[]): UserRole;
|
|
86
|
+
/**
|
|
87
|
+
* Which fields a write changes: the fields of {@link DOMAIN_FIELD_WRITE_ROLE}`[domain]` whose value differs, in ANY entry, between the stored
|
|
88
|
+
* document `before` and the document about to be stored `after` — in the table's order, each once. This is the one place two documents are
|
|
89
|
+
* diffed against the table, whatever the door: a whole-domain PUT passes the stored and the submitted document; a PATCH passes the stored
|
|
90
|
+
* document and the document {@link applyProjectPatch} returns; a mint passes the stored document and the document with the new entry.
|
|
91
|
+
* Both documents are read through {@link parseDomain}, the reading a write is validated with, so the comparison is between the documents the
|
|
92
|
+
* store would receive: store what you authorized — the parse result, not a second reading of the raw body. A field is changed when it is added
|
|
93
|
+
* (absent → present), removed (present → absent) or its value differs; a new entry changes every field it carries, a removed one every field it
|
|
94
|
+
* carried; resending a field unchanged, or the keys in another order, changes nothing. `before` `undefined` = the domain has no document yet (the
|
|
95
|
+
* only spelling of "nothing stored"). A domain with no field table ⇒ `[]` (the floor alone decides). Fail-closed on the security axis, in ONE
|
|
96
|
+
* arm: a document the domain's schema refuses or cannot read — not an object, a getter or trap that throws, a bad entry, a stored document that
|
|
97
|
+
* no longer passes — or any step of the comparison that fails ⇒ EVERY field of the table, so the write needs the highest role the table names.
|
|
98
|
+
* Never throws.
|
|
99
|
+
*/
|
|
100
|
+
export declare function changedWriteFields(domain: DomainName, before: unknown, after: unknown): readonly string[];
|
|
62
101
|
/** A console user (no secret). */
|
|
63
102
|
export interface User {
|
|
64
103
|
username: string;
|
package/dist/config-fns.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { z } from "zod";
|
|
19
19
|
import { MODEL_ENTRY_REFUSAL_CODES, ModelRefusalsWire } from "./fleet.js";
|
|
20
20
|
import { UNINSPECTABLE, dataDescriptor, emptyDocument, guardedSafeParse, inspect, isAccessorDescriptor, isolatedObject, ownEntriesOf, ownRow, ownValueOf } from "./own-key-read.js";
|
|
21
|
+
import { stableStringify } from "./hash.js";
|
|
21
22
|
import { ownEnabledFlag } from "./catalog-manages.js";
|
|
22
23
|
import { isJsonArray, isPlainJsonObject, jsonShapeOf } from "./plain-json-object.js";
|
|
23
24
|
import { carriesUserinfo, secretScanForms } from "./secret-scan.js"; // package-private normalization (both scanners read it) + the userinfo judgement (not in the barrel)
|
|
@@ -162,10 +163,11 @@ export function isRole(v) {
|
|
|
162
163
|
return typeof v === "string" && USER_ROLES.includes(v);
|
|
163
164
|
}
|
|
164
165
|
/**
|
|
165
|
-
*
|
|
166
|
+
* The FLOOR of a domain write: the minimum role any write to the domain needs. Default = `editor`; `skills` and `mcp` are raised to `publisher`
|
|
166
167
|
* because their content goes straight into the agent's system prompt / tool surface — one edit retargets
|
|
167
168
|
* the prompt of every worker × scenario that loads it (the mcp/skills design note §3.3, decision §6 Q3 从严).
|
|
168
|
-
*
|
|
169
|
+
* Any domain absent here uses {@link DEFAULT_DOMAIN_WRITE_ROLE}. Nobody reads this table directly: the one reader is
|
|
170
|
+
* {@link writeRoleFor}, which also looks at WHICH fields a write changes ({@link DOMAIN_FIELD_WRITE_ROLE}).
|
|
169
171
|
*/
|
|
170
172
|
export const DEFAULT_DOMAIN_WRITE_ROLE = "editor";
|
|
171
173
|
export const DOMAIN_WRITE_ROLE = {
|
|
@@ -180,7 +182,7 @@ export const DOMAIN_WRITE_ROLE = {
|
|
|
180
182
|
// systems drive CREDENTIAL minting/delivery/rotation (S2/S3) — the credential lifecycle is ≥ the skills tier.
|
|
181
183
|
systems: "publisher",
|
|
182
184
|
// access: DELETED in 0.6.0 (域整删,EXPERT-REDESIGN §9)。
|
|
183
|
-
// governance (治理三件,0.6.0 从 runtime 拆出): editor(EXPERT-REDESIGN §5
|
|
185
|
+
// governance (治理三件,0.6.0 从 runtime 拆出): editor(与 EXPERT-REDESIGN §5 的写角色表同步;
|
|
184
186
|
// default 即 editor,故不列条目;此注释即该裁定的落点)。
|
|
185
187
|
// entitlement governs who-can-USE-what (models/skills/mcp/budget/runtime caps) per principal — a governance +
|
|
186
188
|
// security surface (budget ceilings, bypass kill-switch) on par with systems. Same raised gate.
|
|
@@ -192,8 +194,10 @@ export const DOMAIN_WRITE_ROLE = {
|
|
|
192
194
|
prompts: "publisher",
|
|
193
195
|
// execution (0.8.0): editor — same档 as governance (治理旋钮同类;真安全边界在 service gate,
|
|
194
196
|
// client-advisory 面不值 publisher 档)。default 即 editor,故不列条目;此注释即该裁定的落点。
|
|
195
|
-
// projects (0.10.0
|
|
196
|
-
//
|
|
197
|
+
// projects (0.10.0): the floor is editor — the registry's identity fields (name, remotes, default scopes, icon, colour, archive time)
|
|
198
|
+
// are an index, an editor's job; default 即 editor,故不列条目。25.0.0: the registration's CONTENT fields (`goal`, `contextItems`, `notes`)
|
|
199
|
+
// are not an index — they ride into the system prompt and the task's workspace — and are raised field by field in
|
|
200
|
+
// {@link DOMAIN_FIELD_WRITE_ROLE}, not by raising the whole domain.
|
|
197
201
|
// limits (0.19.0): editor —— 与它的前身 runtime 域(11.0.0 retired)同档,刻意不抬 publisher:本域是纯数值
|
|
198
202
|
// 旋钮,无 prompt 注入面、无凭据、无可执行内容;真正的执法点在消费方的限额闸,发布闸(PUBLISH_MODE /
|
|
199
203
|
// 审批流)才是"要不要多一道人"的属主。default 即 editor,故不列条目;此注释即该裁定的落点。
|
|
@@ -202,9 +206,109 @@ export const DOMAIN_WRITE_ROLE = {
|
|
|
202
206
|
// Written out (not left to the default) because the default would be the WRONG answer here.
|
|
203
207
|
a2a: "publisher",
|
|
204
208
|
};
|
|
205
|
-
/**
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
/**
|
|
210
|
+
* `projects`: a registration's identity fields are an index and stay with the floor (`editor`); its CONTENT fields are what the project hands
|
|
211
|
+
* to the agent — `goal` and `notes` ride into the system prompt, `contextItems` carries folder / file entries the task's workspace and
|
|
212
|
+
* attachments are built from — the same injection surface as `prompts`, so they need `publisher`. `registeredBy` / `registeredAt` are stamped
|
|
213
|
+
* by the write port on registration; whether a caller may rewrite them is that port's rule, not a role (raising them would also block an
|
|
214
|
+
* editor from registering a project at all). `contentAttestedAt` is the stamp of the opposite kind: the port puts it on a registration after a
|
|
215
|
+
* write it judged with {@link writeRoleFor}, as proof that the content fields passed that judgement. A caller who could set, change or tear it
|
|
216
|
+
* could forge the proof or hide the lack of one, so it needs `publisher` — the same as the fields it vouches for; an editor registers a project
|
|
217
|
+
* (no content, no stamp) and renames it without touching the stamp.
|
|
218
|
+
*/
|
|
219
|
+
const PROJECT_FIELD_WRITE_ROLE = {
|
|
220
|
+
displayName: "editor",
|
|
221
|
+
gitRemotes: "editor",
|
|
222
|
+
defaultScopes: "editor",
|
|
223
|
+
registeredBy: "editor",
|
|
224
|
+
registeredAt: "editor",
|
|
225
|
+
notes: "publisher",
|
|
226
|
+
goal: "publisher",
|
|
227
|
+
contextItems: "publisher",
|
|
228
|
+
archivedAt: "editor",
|
|
229
|
+
contentAttestedAt: "publisher",
|
|
230
|
+
icon: "editor",
|
|
231
|
+
color: "editor",
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* The domains whose write role depends on WHICH fields a write changes. Same shape of use as {@link DOMAIN_WRITE_ROLE} — a package-owned table,
|
|
235
|
+
* one row per domain, an absent row means "the floor decides" — read only through {@link writeRoleFor}; the changed fields come from
|
|
236
|
+
* {@link changedWriteFields} (the one place that diffs two documents against this table).
|
|
237
|
+
*/
|
|
238
|
+
export const DOMAIN_FIELD_WRITE_ROLE = {
|
|
239
|
+
projects: { entries: "projects", fields: PROJECT_FIELD_WRITE_ROLE },
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* The minimum role to make a write that changes exactly `changedFields` in `domain`: the HIGHEST of the domain's floor ({@link DOMAIN_WRITE_ROLE},
|
|
243
|
+
* else {@link DEFAULT_DOMAIN_WRITE_ROLE}) and the role of each changed field ({@link DOMAIN_FIELD_WRITE_ROLE}). `[]` = a write that changes no
|
|
244
|
+
* field that has a role of its own — the floor alone, which is also the answer to "may this role write anything in the domain at all" (a UI
|
|
245
|
+
* deciding whether to show a write affordance). The PUT, PATCH and mint doors of a domain all ask this ONE function, with the fields
|
|
246
|
+
* {@link changedWriteFields} reports for the document they are about to store. A field name the domain's table does not have — a typo, a
|
|
247
|
+
* field of another domain, any name for a domain with no field table — is a RangeError (the answer would otherwise be the floor, a quiet
|
|
248
|
+
* lowering): a caller's mistake is loud, never an `editor`.
|
|
249
|
+
*/
|
|
250
|
+
export function writeRoleFor(domain, changedFields) {
|
|
251
|
+
let role = ownRow(DOMAIN_WRITE_ROLE, domain) ?? DEFAULT_DOMAIN_WRITE_ROLE;
|
|
252
|
+
const table = ownRow(DOMAIN_FIELD_WRITE_ROLE, domain);
|
|
253
|
+
for (const field of changedFields) {
|
|
254
|
+
const fieldRole = table === undefined ? undefined : ownRow(table.fields, field);
|
|
255
|
+
if (fieldRole === undefined) {
|
|
256
|
+
throw new RangeError(`writeRoleFor: ${JSON.stringify(String(field))} is not a field with a write role in domain "${domain}" (${table === undefined ? "the domain has no field table" : `its fields: ${Object.keys(table.fields).join(", ")}`})`);
|
|
257
|
+
}
|
|
258
|
+
if (ROLE_RANK[fieldRole] > ROLE_RANK[role])
|
|
259
|
+
role = fieldRole;
|
|
260
|
+
}
|
|
261
|
+
return role;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* The entries of one domain document as the STORE would receive them: the document read through {@link parseDomain} — the reading a write is
|
|
265
|
+
* validated with — so what {@link changedWriteFields} compares and what is persisted are one document, not two readings of the caller's object
|
|
266
|
+
* (a Proxy that lists no keys but answers the validator's reads, an accessor, a key the validator strips). Anything `parseDomain` refuses or cannot
|
|
267
|
+
* read throws; the caller turns every throw into the fail-closed answer.
|
|
268
|
+
*/
|
|
269
|
+
function writeEntriesOf(domain, table, document) {
|
|
270
|
+
const parsed = parseDomain(domain, document); // `undefined` = nothing stored yet = the domain's empty document
|
|
271
|
+
const carried = ownValueOf(parsed, table.entries);
|
|
272
|
+
if (!carried.ok || !isPlainJsonObject(carried.value))
|
|
273
|
+
throw new TypeError(`changedWriteFields: domain "${domain}" has no record of entries under "${table.entries}"`);
|
|
274
|
+
const entries = new Map();
|
|
275
|
+
for (const [id, entry] of Object.entries(carried.value)) {
|
|
276
|
+
if (!isPlainJsonObject(entry))
|
|
277
|
+
throw new TypeError(`changedWriteFields: an entry of domain "${domain}" is not an object`);
|
|
278
|
+
entries.set(id, entry);
|
|
279
|
+
}
|
|
280
|
+
return entries;
|
|
281
|
+
}
|
|
282
|
+
/** What one field of one entry holds, as a string two entries can be compared by: absent and present are different, and a value is compared by its stable JSON. */
|
|
283
|
+
function writeFieldImage(entry, field) {
|
|
284
|
+
return entry === undefined || !Object.hasOwn(entry, field) ? "-" : `=${stableStringify(entry[field])}`;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Which fields a write changes: the fields of {@link DOMAIN_FIELD_WRITE_ROLE}`[domain]` whose value differs, in ANY entry, between the stored
|
|
288
|
+
* document `before` and the document about to be stored `after` — in the table's order, each once. This is the one place two documents are
|
|
289
|
+
* diffed against the table, whatever the door: a whole-domain PUT passes the stored and the submitted document; a PATCH passes the stored
|
|
290
|
+
* document and the document {@link applyProjectPatch} returns; a mint passes the stored document and the document with the new entry.
|
|
291
|
+
* Both documents are read through {@link parseDomain}, the reading a write is validated with, so the comparison is between the documents the
|
|
292
|
+
* store would receive: store what you authorized — the parse result, not a second reading of the raw body. A field is changed when it is added
|
|
293
|
+
* (absent → present), removed (present → absent) or its value differs; a new entry changes every field it carries, a removed one every field it
|
|
294
|
+
* carried; resending a field unchanged, or the keys in another order, changes nothing. `before` `undefined` = the domain has no document yet (the
|
|
295
|
+
* only spelling of "nothing stored"). A domain with no field table ⇒ `[]` (the floor alone decides). Fail-closed on the security axis, in ONE
|
|
296
|
+
* arm: a document the domain's schema refuses or cannot read — not an object, a getter or trap that throws, a bad entry, a stored document that
|
|
297
|
+
* no longer passes — or any step of the comparison that fails ⇒ EVERY field of the table, so the write needs the highest role the table names.
|
|
298
|
+
* Never throws.
|
|
299
|
+
*/
|
|
300
|
+
export function changedWriteFields(domain, before, after) {
|
|
301
|
+
const table = ownRow(DOMAIN_FIELD_WRITE_ROLE, domain);
|
|
302
|
+
if (table === undefined)
|
|
303
|
+
return [];
|
|
304
|
+
const fields = Object.keys(table.fields);
|
|
305
|
+
const changed = inspect(() => {
|
|
306
|
+
const was = writeEntriesOf(domain, table, before);
|
|
307
|
+
const now = writeEntriesOf(domain, table, after);
|
|
308
|
+
const ids = [...new Set([...was.keys(), ...now.keys()])];
|
|
309
|
+
return fields.filter((field) => ids.some((id) => writeFieldImage(was.get(id), field) !== writeFieldImage(now.get(id), field)));
|
|
310
|
+
});
|
|
311
|
+
return changed.ok ? changed.value : fields;
|
|
208
312
|
}
|
|
209
313
|
/** The empty/defaults effective config at version 0 — what publish mode serves before the first publish.
|
|
210
314
|
* Seeds the epoch (`new Date(0)`) so it's deterministic (the wall-clock default was the original store.ts
|
package/dist/fleet.d.ts
CHANGED
|
@@ -94,14 +94,15 @@ export declare function compareGeneration(a: string, b: string): -1 | 0 | 1;
|
|
|
94
94
|
/**
|
|
95
95
|
* The serving lease as the ENGINE holds it — a CLOSED set of four words, owned here (the engine's vocabulary, word for word;
|
|
96
96
|
* a reader that switches on it exhaustively is told by the compiler when a word is added):
|
|
97
|
-
* - `none` — the lease is not in effect: web-admin
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* `none` — it keeps the state it had.
|
|
97
|
+
* - `none` — the lease is not in effect: web-admin's most recent capability declaration ({@link readCapabilityReading} said `declared`) did
|
|
98
|
+
* not carry {@link WebAdminCapabilities}`.servingLease`. The engine behaves exactly as an engine without a lease — no renewals, no fence.
|
|
99
|
+
* A reply that is not a declaration (`unreadable`: an older web-admin that sends no `capabilities` key, a gateway answering `{}`, a body that
|
|
100
|
+
* cannot be read) is not a reading: it does not move the engine into or out of `none` — it keeps the state it had.
|
|
101
101
|
* - `granted` — the engine holds a lease; `leaseUntil` says until when (epoch ms, the engine's own computation from the
|
|
102
102
|
* granted `ttlMs`, see {@link ServingLeaseResponse}).
|
|
103
103
|
* - `expired` — the lease is in effect but no grant is valid right now (web-admin is unreachable, answered `unknown`, or has
|
|
104
|
-
* not granted one yet
|
|
104
|
+
* not granted one yet; a fleet member that has not yet heard any declaration from web-admin is presumed to be inside the fence, its
|
|
105
|
+
* outage clock running from the engine's start): the engine keeps serving until its own outage allowance runs out. Not a denial.
|
|
105
106
|
* - `denied` — web-admin denied this instance on positive evidence (the `denied` verdict): sticky; the engine is draining and
|
|
106
107
|
* stops at its deadline.
|
|
107
108
|
* Only a fleet member says it: an engine without a generation has no lease and carries no `leaseState` at all (there is no
|
|
@@ -694,19 +695,23 @@ export declare function readServingLeaseResponse(body: unknown): ServingLeaseRea
|
|
|
694
695
|
* What web-admin says it can do: capability bits an engine reads before it starts using a web-admin-side endpoint.
|
|
695
696
|
* - `servingLease` — web-admin answers serving-lease renewals ({@link ServingLeaseRequest} / {@link ServingLeaseResponse}).
|
|
696
697
|
*
|
|
697
|
-
* A bit is `true` or absent — one spelling for "not supported" (there is no `false`).
|
|
698
|
-
*
|
|
699
|
-
*
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
*
|
|
698
|
+
* A bit is `true` or absent — one spelling for "not supported" (there is no `false`). A bit absent from a DECLARED object means web-admin
|
|
699
|
+
* does not support it, and for `servingLease` the engine then neither renews a lease nor is fenced by one: that is web-admin's own word (the
|
|
700
|
+
* lease switched off there, or a caller under the shared token, below). Having NO declaration is a different fact and is not read as "not
|
|
701
|
+
* supported": a heartbeat reply that carries no `capabilities` key (an older web-admin, a gateway or maintenance page answering `{}`) is not
|
|
702
|
+
* a reading ({@link readCapabilityReading} says `unreadable`), and a fleet member that has heard no declaration is presumed to be inside the
|
|
703
|
+
* fence — silence never loosens it. So the compatibility gate this shape gives (an executor may ship ahead of web-admin) holds on the
|
|
704
|
+
* heartbeat path of a web-admin that answers with the key — every web-admin release that can render a fleet generation does; a path whose
|
|
705
|
+
* answer carries no key (a gateway, a differently routed live base, a rolled-back web-admin) leaves the member inside the presumed fence.
|
|
706
|
+
* It is a gate, not a verdict — nothing in this shape says "web-admin refuses leases". Read a heartbeat reply with
|
|
707
|
+
* {@link readCapabilityReading} and start the lease client only on a `declared` reading whose `capabilities.servingLease === true`.
|
|
703
708
|
* Unknown bits are stripped (a newer web-admin's extra bits never break an older reader); a known bit whose value is not `true` breaks
|
|
704
|
-
* the declaration — and a broken declaration is NOT an absent
|
|
709
|
+
* the declaration — and a broken declaration is NOT an absent bit: the reply reads as `unreadable`, which is not a reading (the engine
|
|
705
710
|
* keeps the state it had; see {@link readCapabilityReading}).
|
|
706
711
|
* It rides in ONE place: the heartbeat's 2xx reply ({@link FLEET_PATHS}`.instances`), under {@link HEARTBEAT_REPLY_CAPABILITIES_KEY}.
|
|
707
712
|
* Web-admin answers the bits per CALLER CREDENTIAL: under a per-worker token, by what web-admin supports; under the shared token
|
|
708
713
|
* `servingLease` is always absent (the serving-lease endpoint takes per-worker tokens only, so announcing it there would only push
|
|
709
|
-
* that caller into the unreachable arm).
|
|
714
|
+
* that caller into the unreachable arm) — an empty declaration, `{ capabilities: {} }`, not a reply without the key.
|
|
710
715
|
*/
|
|
711
716
|
export declare const WebAdminCapabilities: z.ZodObject<{
|
|
712
717
|
servingLease: z.ZodOptional<z.ZodLiteral<true>>;
|
|
@@ -717,34 +722,39 @@ export type WebAdminCapabilities = z.infer<typeof WebAdminCapabilities>;
|
|
|
717
722
|
* Web-admin writes `{ …, [HEARTBEAT_REPLY_CAPABILITIES_KEY]: caps }`; the engine reads the whole reply with
|
|
718
723
|
* `readCapabilityReading(reply)` — the key lookup lives in the reader, one carrier one reader — and only on a 2xx (a failed heartbeat
|
|
719
724
|
* says nothing about the bits). Nested, not flat: the reply's own keys and the capability bits never share a namespace.
|
|
720
|
-
* A reply without the key is
|
|
721
|
-
*
|
|
725
|
+
* A reply without the key is not a declaration — it reads `unreadable` (`capabilities-absent`): an older web-admin, a gateway answering `{}`,
|
|
726
|
+
* bits flat on the body and `undefined` as the key's value (what JSON cannot carry) all read this way, and the engine acts on it as on no reply at all.
|
|
727
|
+
* A reply with the key present with a value that breaks the shape reads `unreadable` too (`invalid-capabilities`). Only an object under this
|
|
728
|
+
* key that passes {@link WebAdminCapabilities} is a reading.
|
|
722
729
|
*/
|
|
723
730
|
export declare const HEARTBEAT_REPLY_CAPABILITIES_KEY = "capabilities";
|
|
724
|
-
/**
|
|
731
|
+
/**
|
|
732
|
+
* What one heartbeat reply says about web-admin's capabilities — two words, see {@link readCapabilityReading}: `declared` (an explicit
|
|
733
|
+
* declaration, the only reading) or `unreadable` (the reply is not a declaration; `why` says which way).
|
|
734
|
+
*/
|
|
725
735
|
export type CapabilityReading = {
|
|
726
736
|
kind: "declared";
|
|
727
737
|
capabilities: WebAdminCapabilities;
|
|
728
|
-
} | {
|
|
729
|
-
kind: "undeclared";
|
|
730
738
|
} | {
|
|
731
739
|
kind: "unreadable";
|
|
732
|
-
why: "not-an-object" | "invalid-capabilities";
|
|
740
|
+
why: "not-an-object" | "capabilities-absent" | "invalid-capabilities";
|
|
733
741
|
};
|
|
734
742
|
/**
|
|
735
743
|
* Engine side: what one heartbeat reply says about web-admin's capabilities. The input is the heartbeat's whole 2xx reply body
|
|
736
|
-
* (the key lookup lives here — one carrier, one reader), the output one of
|
|
737
|
-
* - `declared` — the key ({@link HEARTBEAT_REPLY_CAPABILITIES_KEY}) is
|
|
738
|
-
* `capabilities` is
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
* - `unreadable` — the reply is not an object (`
|
|
742
|
-
* {
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
* on `
|
|
747
|
-
*
|
|
744
|
+
* (the key lookup lives here — one carrier, one reader), the output one of two words:
|
|
745
|
+
* - `declared` — the key ({@link HEARTBEAT_REPLY_CAPABILITIES_KEY}) is an own key of the reply and its value passes {@link WebAdminCapabilities}:
|
|
746
|
+
* web-admin made an explicit declaration. `capabilities` is a copy of it — the known bits that are set, as own properties of an object on the
|
|
747
|
+
* package's isolated prototype (unknown bits stripped, an absent bit stays absent and reads `undefined` even when `Object.prototype` is polluted with its name).
|
|
748
|
+
* `{ capabilities: {} }` is a declaration of no bits.
|
|
749
|
+
* - `unreadable` — anything else, and `why` says which way: the reply is not an object (`not-an-object`); the key is absent
|
|
750
|
+
* (`capabilities-absent` — an older web-admin, a body of `{}` or `{ ok: true }`, bits flat on the body, `undefined` as the key's value,
|
|
751
|
+
* a key that exists only on the prototype chain); the key is present but its value is not a {@link WebAdminCapabilities}
|
|
752
|
+
* (`invalid-capabilities`; a hidden key or an accessor that throws reads the same way).
|
|
753
|
+
* Only `declared` is a reading. A reply that is not a declaration says nothing about the fence — silence never loosens it: the engine acts
|
|
754
|
+
* on `unreadable` as on no reply at all. A fleet member that has heard no declaration is presumed to be inside the fence (its outage clock
|
|
755
|
+
* running from its own start); one that has heard a declaration keeps the state that declaration gave it, and leaves its clocks, the lease
|
|
756
|
+
* expiry and the outage allowance, as they were. Start the lease client only on `declared` with `capabilities.servingLease === true`.
|
|
757
|
+
* Never throws; judged by the same one guarded body judgement as every other reader here.
|
|
748
758
|
*/
|
|
749
759
|
export declare function readCapabilityReading(reply: unknown): CapabilityReading;
|
|
750
760
|
/**
|
package/dist/fleet.js
CHANGED
|
@@ -21,7 +21,7 @@ import { z } from "zod";
|
|
|
21
21
|
import { INTEGER } from "./integer.js";
|
|
22
22
|
import { fnv1a64 } from "./hash.js";
|
|
23
23
|
import { parseDeclared } from "./declared-capture.js";
|
|
24
|
-
import { readDeclaredKey, ownValueOf } from "./own-key-read.js";
|
|
24
|
+
import { dataDescriptor, isolatedObject, readDeclaredKey, ownValueOf } from "./own-key-read.js";
|
|
25
25
|
import { isPlainJsonObject } from "./plain-json-object.js";
|
|
26
26
|
import { buildQuotedIssue } from "./quoted-issue.js";
|
|
27
27
|
// ── Web-admin's fleet endpoints (paths, one spelling) ─────────────────────────────────────────────────────
|
|
@@ -123,14 +123,15 @@ const Generation = z.string().refine(isCanonicalGeneration, buildQuotedIssue `a
|
|
|
123
123
|
/**
|
|
124
124
|
* The serving lease as the ENGINE holds it — a CLOSED set of four words, owned here (the engine's vocabulary, word for word;
|
|
125
125
|
* a reader that switches on it exhaustively is told by the compiler when a word is added):
|
|
126
|
-
* - `none` — the lease is not in effect: web-admin
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* `none` — it keeps the state it had.
|
|
126
|
+
* - `none` — the lease is not in effect: web-admin's most recent capability declaration ({@link readCapabilityReading} said `declared`) did
|
|
127
|
+
* not carry {@link WebAdminCapabilities}`.servingLease`. The engine behaves exactly as an engine without a lease — no renewals, no fence.
|
|
128
|
+
* A reply that is not a declaration (`unreadable`: an older web-admin that sends no `capabilities` key, a gateway answering `{}`, a body that
|
|
129
|
+
* cannot be read) is not a reading: it does not move the engine into or out of `none` — it keeps the state it had.
|
|
130
130
|
* - `granted` — the engine holds a lease; `leaseUntil` says until when (epoch ms, the engine's own computation from the
|
|
131
131
|
* granted `ttlMs`, see {@link ServingLeaseResponse}).
|
|
132
132
|
* - `expired` — the lease is in effect but no grant is valid right now (web-admin is unreachable, answered `unknown`, or has
|
|
133
|
-
* not granted one yet
|
|
133
|
+
* not granted one yet; a fleet member that has not yet heard any declaration from web-admin is presumed to be inside the fence, its
|
|
134
|
+
* outage clock running from the engine's start): the engine keeps serving until its own outage allowance runs out. Not a denial.
|
|
134
135
|
* - `denied` — web-admin denied this instance on positive evidence (the `denied` verdict): sticky; the engine is draining and
|
|
135
136
|
* stops at its deadline.
|
|
136
137
|
* Only a fleet member says it: an engine without a generation has no lease and carries no `leaseState` at all (there is no
|
|
@@ -707,19 +708,23 @@ export function readServingLeaseResponse(body) {
|
|
|
707
708
|
* What web-admin says it can do: capability bits an engine reads before it starts using a web-admin-side endpoint.
|
|
708
709
|
* - `servingLease` — web-admin answers serving-lease renewals ({@link ServingLeaseRequest} / {@link ServingLeaseResponse}).
|
|
709
710
|
*
|
|
710
|
-
* A bit is `true` or absent — one spelling for "not supported" (there is no `false`).
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
*
|
|
715
|
-
*
|
|
711
|
+
* A bit is `true` or absent — one spelling for "not supported" (there is no `false`). A bit absent from a DECLARED object means web-admin
|
|
712
|
+
* does not support it, and for `servingLease` the engine then neither renews a lease nor is fenced by one: that is web-admin's own word (the
|
|
713
|
+
* lease switched off there, or a caller under the shared token, below). Having NO declaration is a different fact and is not read as "not
|
|
714
|
+
* supported": a heartbeat reply that carries no `capabilities` key (an older web-admin, a gateway or maintenance page answering `{}`) is not
|
|
715
|
+
* a reading ({@link readCapabilityReading} says `unreadable`), and a fleet member that has heard no declaration is presumed to be inside the
|
|
716
|
+
* fence — silence never loosens it. So the compatibility gate this shape gives (an executor may ship ahead of web-admin) holds on the
|
|
717
|
+
* heartbeat path of a web-admin that answers with the key — every web-admin release that can render a fleet generation does; a path whose
|
|
718
|
+
* answer carries no key (a gateway, a differently routed live base, a rolled-back web-admin) leaves the member inside the presumed fence.
|
|
719
|
+
* It is a gate, not a verdict — nothing in this shape says "web-admin refuses leases". Read a heartbeat reply with
|
|
720
|
+
* {@link readCapabilityReading} and start the lease client only on a `declared` reading whose `capabilities.servingLease === true`.
|
|
716
721
|
* Unknown bits are stripped (a newer web-admin's extra bits never break an older reader); a known bit whose value is not `true` breaks
|
|
717
|
-
* the declaration — and a broken declaration is NOT an absent
|
|
722
|
+
* the declaration — and a broken declaration is NOT an absent bit: the reply reads as `unreadable`, which is not a reading (the engine
|
|
718
723
|
* keeps the state it had; see {@link readCapabilityReading}).
|
|
719
724
|
* It rides in ONE place: the heartbeat's 2xx reply ({@link FLEET_PATHS}`.instances`), under {@link HEARTBEAT_REPLY_CAPABILITIES_KEY}.
|
|
720
725
|
* Web-admin answers the bits per CALLER CREDENTIAL: under a per-worker token, by what web-admin supports; under the shared token
|
|
721
726
|
* `servingLease` is always absent (the serving-lease endpoint takes per-worker tokens only, so announcing it there would only push
|
|
722
|
-
* that caller into the unreachable arm).
|
|
727
|
+
* that caller into the unreachable arm) — an empty declaration, `{ capabilities: {} }`, not a reply without the key.
|
|
723
728
|
*/
|
|
724
729
|
export const WebAdminCapabilities = z.object({
|
|
725
730
|
servingLease: z.literal(true).optional(),
|
|
@@ -729,26 +734,50 @@ export const WebAdminCapabilities = z.object({
|
|
|
729
734
|
* Web-admin writes `{ …, [HEARTBEAT_REPLY_CAPABILITIES_KEY]: caps }`; the engine reads the whole reply with
|
|
730
735
|
* `readCapabilityReading(reply)` — the key lookup lives in the reader, one carrier one reader — and only on a 2xx (a failed heartbeat
|
|
731
736
|
* says nothing about the bits). Nested, not flat: the reply's own keys and the capability bits never share a namespace.
|
|
732
|
-
* A reply without the key is
|
|
733
|
-
*
|
|
737
|
+
* A reply without the key is not a declaration — it reads `unreadable` (`capabilities-absent`): an older web-admin, a gateway answering `{}`,
|
|
738
|
+
* bits flat on the body and `undefined` as the key's value (what JSON cannot carry) all read this way, and the engine acts on it as on no reply at all.
|
|
739
|
+
* A reply with the key present with a value that breaks the shape reads `unreadable` too (`invalid-capabilities`). Only an object under this
|
|
740
|
+
* key that passes {@link WebAdminCapabilities} is a reading.
|
|
734
741
|
*/
|
|
735
742
|
export const HEARTBEAT_REPLY_CAPABILITIES_KEY = "capabilities";
|
|
736
743
|
/** The reply body as far as the capability carrier is concerned: the one key, optional, nothing else (the reply's other keys are stripped). */
|
|
737
744
|
const CapabilitiesCarrier = z.object({ [HEARTBEAT_REPLY_CAPABILITIES_KEY]: WebAdminCapabilities.optional() });
|
|
745
|
+
/** The bits {@link WebAdminCapabilities} knows — read off its shape, so a bit added there is copied here without a second list. */
|
|
746
|
+
const CAPABILITY_BITS = Object.keys(WebAdminCapabilities.shape);
|
|
747
|
+
/**
|
|
748
|
+
* The declaration as the reader hands it out: a copy holding exactly the known bits that are set, as OWN data properties of an object on the
|
|
749
|
+
* package's isolated prototype (nothing is inherited from `Object.prototype`). A consumer's `capabilities.servingLease` can then only find a bit web-admin declared — an
|
|
750
|
+
* absent bit is `undefined` even when `Object.prototype` has been polluted with its name, and the copy is not the caller's object. A bit that cannot
|
|
751
|
+
* be read off the validated value (it was parsed from a snapshot, so this cannot happen) ⇒ `undefined`, which the reader answers as `unreadable`,
|
|
752
|
+
* never as a declaration of fewer bits.
|
|
753
|
+
*/
|
|
754
|
+
function ownCapabilityBits(validated) {
|
|
755
|
+
const copy = isolatedObject();
|
|
756
|
+
for (const bit of CAPABILITY_BITS) {
|
|
757
|
+
const read = ownValueOf(validated, bit);
|
|
758
|
+
if (!read.ok)
|
|
759
|
+
return undefined;
|
|
760
|
+
if (read.value !== undefined)
|
|
761
|
+
Object.defineProperty(copy, bit, dataDescriptor(read.value));
|
|
762
|
+
}
|
|
763
|
+
return copy;
|
|
764
|
+
}
|
|
738
765
|
/**
|
|
739
766
|
* Engine side: what one heartbeat reply says about web-admin's capabilities. The input is the heartbeat's whole 2xx reply body
|
|
740
|
-
* (the key lookup lives here — one carrier, one reader), the output one of
|
|
741
|
-
* - `declared` — the key ({@link HEARTBEAT_REPLY_CAPABILITIES_KEY}) is
|
|
742
|
-
* `capabilities` is
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
* - `unreadable` — the reply is not an object (`
|
|
746
|
-
* {
|
|
747
|
-
*
|
|
748
|
-
*
|
|
749
|
-
*
|
|
750
|
-
* on `
|
|
751
|
-
*
|
|
767
|
+
* (the key lookup lives here — one carrier, one reader), the output one of two words:
|
|
768
|
+
* - `declared` — the key ({@link HEARTBEAT_REPLY_CAPABILITIES_KEY}) is an own key of the reply and its value passes {@link WebAdminCapabilities}:
|
|
769
|
+
* web-admin made an explicit declaration. `capabilities` is a copy of it — the known bits that are set, as own properties of an object on the
|
|
770
|
+
* package's isolated prototype (unknown bits stripped, an absent bit stays absent and reads `undefined` even when `Object.prototype` is polluted with its name).
|
|
771
|
+
* `{ capabilities: {} }` is a declaration of no bits.
|
|
772
|
+
* - `unreadable` — anything else, and `why` says which way: the reply is not an object (`not-an-object`); the key is absent
|
|
773
|
+
* (`capabilities-absent` — an older web-admin, a body of `{}` or `{ ok: true }`, bits flat on the body, `undefined` as the key's value,
|
|
774
|
+
* a key that exists only on the prototype chain); the key is present but its value is not a {@link WebAdminCapabilities}
|
|
775
|
+
* (`invalid-capabilities`; a hidden key or an accessor that throws reads the same way).
|
|
776
|
+
* Only `declared` is a reading. A reply that is not a declaration says nothing about the fence — silence never loosens it: the engine acts
|
|
777
|
+
* on `unreadable` as on no reply at all. A fleet member that has heard no declaration is presumed to be inside the fence (its outage clock
|
|
778
|
+
* running from its own start); one that has heard a declaration keeps the state that declaration gave it, and leaves its clocks, the lease
|
|
779
|
+
* expiry and the outage allowance, as they were. Start the lease client only on `declared` with `capabilities.servingLease === true`.
|
|
780
|
+
* Never throws; judged by the same one guarded body judgement as every other reader here.
|
|
752
781
|
*/
|
|
753
782
|
export function readCapabilityReading(reply) {
|
|
754
783
|
const judged = judgeSignalBody(reply, WHOLE_BODY, CapabilitiesCarrier);
|
|
@@ -760,8 +789,12 @@ export function readCapabilityReading(reply) {
|
|
|
760
789
|
case "read": {
|
|
761
790
|
// the validated output is an ordinary object: an absent optional key must stay absent, not be read off a polluted `Object.prototype` — own key only (it was parsed from a snapshot, so it cannot be unreadable)
|
|
762
791
|
const carried = ownValueOf(judged.value, HEARTBEAT_REPLY_CAPABILITIES_KEY);
|
|
763
|
-
|
|
764
|
-
|
|
792
|
+
if (!carried.ok)
|
|
793
|
+
return { kind: "unreadable", why: "invalid-capabilities" };
|
|
794
|
+
if (carried.value === undefined)
|
|
795
|
+
return { kind: "unreadable", why: "capabilities-absent" };
|
|
796
|
+
const capabilities = ownCapabilityBits(carried.value);
|
|
797
|
+
return capabilities === undefined ? { kind: "unreadable", why: "invalid-capabilities" } : { kind: "declared", capabilities };
|
|
765
798
|
}
|
|
766
799
|
default: {
|
|
767
800
|
const unhandled = judged;
|
package/dist/types.d.ts
CHANGED
|
@@ -1191,6 +1191,7 @@ export declare const ProjectRegistration: z.ZodObject<{
|
|
|
1191
1191
|
value: z.ZodString;
|
|
1192
1192
|
}, z.core.$strip>], "kind">>>;
|
|
1193
1193
|
archivedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
1194
|
+
contentAttestedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
1194
1195
|
icon: z.ZodOptional<z.ZodString>;
|
|
1195
1196
|
color: z.ZodOptional<z.ZodString>;
|
|
1196
1197
|
}, z.core.$strip>;
|
|
@@ -1215,12 +1216,13 @@ export declare const ProjectsConfig: z.ZodObject<{
|
|
|
1215
1216
|
value: z.ZodString;
|
|
1216
1217
|
}, z.core.$strip>], "kind">>>;
|
|
1217
1218
|
archivedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
1219
|
+
contentAttestedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
1218
1220
|
icon: z.ZodOptional<z.ZodString>;
|
|
1219
1221
|
color: z.ZodOptional<z.ZodString>;
|
|
1220
1222
|
}, z.core.$strip>>>;
|
|
1221
1223
|
}, z.core.$strip>;
|
|
1222
1224
|
export type ProjectsConfig = z.infer<typeof ProjectsConfig>;
|
|
1223
|
-
/** The PATCH form of one registration: every key a PATCH may change, all optional; `registeredBy` / `registeredAt` (and any key
|
|
1225
|
+
/** The PATCH form of one registration: every key a PATCH may change, all optional; `registeredBy` / `registeredAt` / `contentAttestedAt` (and any key
|
|
1224
1226
|
* the registration does not have) are refused (`.strict()`). An optional key given `null` is cleared (merge-patch: `archivedAt: null`
|
|
1225
1227
|
* un-archives). Each field is the registration's own schema — one bound, one shape. */
|
|
1226
1228
|
export declare const ProjectRegistrationPatch: z.ZodObject<{
|
|
@@ -1247,7 +1249,7 @@ export type ProjectRegistrationPatch = z.infer<typeof ProjectRegistrationPatch>;
|
|
|
1247
1249
|
/**
|
|
1248
1250
|
* Apply a PATCH to one registration and judge the whole document with **the same** {@link ProjectsConfig} (the same remote-uniqueness rule a
|
|
1249
1251
|
* full write meets — a PATCH has no rule of its own). The patch is judged here by {@link ProjectRegistrationPatch} first — whatever the caller
|
|
1250
|
-
* did before (a request body handed over as is cannot rewrite `registeredBy` / `registeredAt` or carry an unknown key) — and only its parsed
|
|
1252
|
+
* did before (a request body handed over as is cannot rewrite `registeredBy` / `registeredAt` / `contentAttestedAt` or carry an unknown key) — and only its parsed
|
|
1251
1253
|
* keys are merged. The patched project is judged LAST, so a remote another project already holds is refused on the patched project and the
|
|
1252
1254
|
* sentence names the holder, whatever the document's key order; a successful result keeps the document's key order. Every issue path is a
|
|
1253
1255
|
* document coordinate (`["projects", <projectId>, …]`), the patch's own included. `projectId` must be registered (the caller answers "no such
|
|
@@ -3024,6 +3026,7 @@ export declare const DOMAIN_SCHEMAS: {
|
|
|
3024
3026
|
value: z.ZodString;
|
|
3025
3027
|
}, z.core.$strip>], "kind">>>;
|
|
3026
3028
|
archivedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
3029
|
+
contentAttestedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
3027
3030
|
icon: z.ZodOptional<z.ZodString>;
|
|
3028
3031
|
color: z.ZodOptional<z.ZodString>;
|
|
3029
3032
|
}, z.core.$strip>>>;
|