@cleocode/contracts 2026.9.26 → 2026.10.2
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/dist/cloud/api.d.ts +469 -2
- package/dist/cloud/api.d.ts.map +1 -1
- package/dist/cloud/api.js +209 -8
- package/dist/cloud/api.js.map +1 -1
- package/dist/cloud/envelope.d.ts +6 -0
- package/dist/cloud/envelope.d.ts.map +1 -1
- package/dist/cloud/envelope.js +12 -0
- package/dist/cloud/envelope.js.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/heavy-command-hook.d.ts +123 -0
- package/dist/heavy-command-hook.d.ts.map +1 -0
- package/dist/heavy-command-hook.js +17 -0
- package/dist/heavy-command-hook.js.map +1 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +8 -0
- package/dist/install.d.ts.map +1 -1
- package/dist/invariants/index.d.ts +2 -0
- package/dist/invariants/index.d.ts.map +1 -1
- package/dist/invariants/index.js +1 -0
- package/dist/invariants/index.js.map +1 -1
- package/dist/invariants/sync-write-invariants.d.ts +115 -0
- package/dist/invariants/sync-write-invariants.d.ts.map +1 -0
- package/dist/invariants/sync-write-invariants.js +123 -0
- package/dist/invariants/sync-write-invariants.js.map +1 -0
- package/dist/nexus-account.d.ts +91 -3
- package/dist/nexus-account.d.ts.map +1 -1
- package/dist/nexus-account.js +30 -1
- package/dist/nexus-account.js.map +1 -1
- package/dist/nexus-cloud.d.ts +718 -0
- package/dist/nexus-cloud.d.ts.map +1 -0
- package/dist/nexus-cloud.js +418 -0
- package/dist/nexus-cloud.js.map +1 -0
- package/dist/nexus-vault.d.ts +266 -0
- package/dist/nexus-vault.d.ts.map +1 -0
- package/dist/nexus-vault.js +82 -0
- package/dist/nexus-vault.js.map +1 -0
- package/dist/portable-bundle.d.ts +5 -0
- package/dist/portable-bundle.d.ts.map +1 -1
- package/dist/resource-governor.d.ts +13 -0
- package/dist/resource-governor.d.ts.map +1 -1
- package/dist/resource-governor.js +13 -0
- package/dist/resource-governor.js.map +1 -1
- package/dist/sync-schema.d.ts +34 -0
- package/dist/sync-schema.d.ts.map +1 -0
- package/dist/sync-schema.js +34 -0
- package/dist/sync-schema.js.map +1 -0
- package/dist/task.d.ts +49 -1
- package/dist/task.d.ts.map +1 -1
- package/dist/tasks.d.ts +6 -0
- package/dist/tasks.d.ts.map +1 -1
- package/dist/tasks.js.map +1 -1
- package/package.json +2 -2
- package/src/cloud/api.ts +258 -9
- package/src/cloud/envelope.ts +12 -0
- package/src/config.ts +13 -0
- package/src/heavy-command-hook.ts +136 -0
- package/src/index.ts +108 -0
- package/src/install.ts +9 -0
- package/src/invariants/index.ts +6 -0
- package/src/invariants/sync-write-invariants.ts +460 -0
- package/src/nexus-account.ts +120 -3
- package/src/nexus-cloud.ts +673 -0
- package/src/nexus-vault.ts +280 -0
- package/src/portable-bundle.ts +5 -0
- package/src/resource-governor.ts +15 -0
- package/src/sync-schema.ts +34 -0
- package/src/task.ts +49 -1
- package/src/tasks.ts +6 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud vault contracts: `cleo cloud push | pull | restore | verify | activity | lease`.
|
|
3
|
+
*
|
|
4
|
+
* The vault keeps encrypted snapshots of a project's (or this account's
|
|
5
|
+
* global) CLEO state on Cleo Nexus, as checkpoints on the project's journal
|
|
6
|
+
* stream (or the account's `home:` stream). The server stores ciphertext plus
|
|
7
|
+
* a plaintext manifest of per-table row counts and keyed hashes, and refuses a
|
|
8
|
+
* snapshot that does not descend from the stream head or whose counts do not
|
|
9
|
+
* reconcile with the journal.
|
|
10
|
+
*
|
|
11
|
+
* Keys (owner decision 2026-10-01): adding a device needs only `cleo login`
|
|
12
|
+
* and the one-time browser approval. The account master key is escrowed on
|
|
13
|
+
* the server (stored encrypted under a server-held key, cleo-nexus T082) and
|
|
14
|
+
* released only to an approved, active device, sealed to that device's X25519
|
|
15
|
+
* key (`GET /v1/account/keys/escrow`). Snapshots are encrypted, but with keys
|
|
16
|
+
* the server can recover: server-escrowed encryption, not zero-knowledge.
|
|
17
|
+
*
|
|
18
|
+
* The response schemas here parse what the API returns for the endpoints the
|
|
19
|
+
* wire contract (`./cloud/api.ts`, mirrored from cleo-nexus) does not yet
|
|
20
|
+
* carry; every object is loose so a newer server's extra fields survive.
|
|
21
|
+
*
|
|
22
|
+
* @task T12336
|
|
23
|
+
* @task T12337
|
|
24
|
+
* @task T12338
|
|
25
|
+
* @epic T12322
|
|
26
|
+
*/
|
|
27
|
+
import { z } from 'zod';
|
|
28
|
+
import type { CloudWarning } from './nexus-cloud.js';
|
|
29
|
+
/** `GET /v1/account/keys` (only the fields the vault reads). */
|
|
30
|
+
export declare const nexusUserKeysSchema: z.ZodObject<{
|
|
31
|
+
keyVersion: z.ZodNumber;
|
|
32
|
+
masterKeyVerifier: z.ZodString;
|
|
33
|
+
}, z.core.$loose>;
|
|
34
|
+
/** `GET /v1/projects/:projectId/keys`: the caller's wrapped project keys, newest first. */
|
|
35
|
+
export declare const nexusProjectKeysSchema: z.ZodObject<{
|
|
36
|
+
keys: z.ZodArray<z.ZodObject<{
|
|
37
|
+
wrappedProjectKey: z.ZodString;
|
|
38
|
+
keyVersion: z.ZodNumber;
|
|
39
|
+
}, z.core.$loose>>;
|
|
40
|
+
}, z.core.$loose>;
|
|
41
|
+
/** The lease role of the vault's single writer. */
|
|
42
|
+
export declare const NEXUS_VAULT_LEASE_ROLE = "writer";
|
|
43
|
+
/** A lease as `POST /v1/streams/:streamId/leases` answers it (parsed leniently). */
|
|
44
|
+
export declare const nexusLeaseSchema: z.ZodObject<{
|
|
45
|
+
streamId: z.ZodString;
|
|
46
|
+
role: z.ZodString;
|
|
47
|
+
replicaId: z.ZodString;
|
|
48
|
+
expiresAt: z.ZodISODateTime;
|
|
49
|
+
forkedFromReplicaId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
}, z.core.$loose>;
|
|
51
|
+
/** `POST /v1/streams/:streamId/leases`. */
|
|
52
|
+
export declare const nexusLeaseAcquireSchema: z.ZodObject<{
|
|
53
|
+
lease: z.ZodObject<{
|
|
54
|
+
streamId: z.ZodString;
|
|
55
|
+
role: z.ZodString;
|
|
56
|
+
replicaId: z.ZodString;
|
|
57
|
+
expiresAt: z.ZodISODateTime;
|
|
58
|
+
forkedFromReplicaId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
}, z.core.$loose>;
|
|
60
|
+
}, z.core.$loose>;
|
|
61
|
+
/** `GET /v1/streams/:streamId`. */
|
|
62
|
+
export declare const nexusStreamHeadSchema: z.ZodObject<{
|
|
63
|
+
streamId: z.ZodString;
|
|
64
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
65
|
+
headSeq: z.ZodNumber;
|
|
66
|
+
headCheckpointId: z.ZodNullable<z.ZodString>;
|
|
67
|
+
/**
|
|
68
|
+
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
69
|
+
* Absent from an older server.
|
|
70
|
+
*/
|
|
71
|
+
maxSchemaVersion: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
}, z.core.$loose>;
|
|
73
|
+
/** One audit event of the caller's own activity. */
|
|
74
|
+
export declare const nexusActivityEventSchema: z.ZodObject<{
|
|
75
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
76
|
+
at: z.ZodISODateTime;
|
|
77
|
+
actorUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
actorDeviceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
action: z.ZodString;
|
|
81
|
+
target: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
detail: z.ZodOptional<z.ZodUnknown>;
|
|
83
|
+
}, z.core.$loose>;
|
|
84
|
+
/** `GET /v1/account/activity`, one page. */
|
|
85
|
+
export declare const nexusActivityPageSchema: z.ZodObject<{
|
|
86
|
+
events: z.ZodArray<z.ZodObject<{
|
|
87
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
88
|
+
at: z.ZodISODateTime;
|
|
89
|
+
actorUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
+
actorDeviceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
+
requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
action: z.ZodString;
|
|
93
|
+
target: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
detail: z.ZodOptional<z.ZodUnknown>;
|
|
95
|
+
}, z.core.$loose>>;
|
|
96
|
+
nextBefore: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
97
|
+
}, z.core.$loose>;
|
|
98
|
+
/** Parsed activity event. */
|
|
99
|
+
export type NexusActivityEvent = z.infer<typeof nexusActivityEventSchema>;
|
|
100
|
+
/** Which store a vault command acts on: the current project, or this account's global store. */
|
|
101
|
+
export type CloudVaultScope = 'project' | 'global';
|
|
102
|
+
/** One table of a snapshot manifest. */
|
|
103
|
+
export interface CloudVaultTable {
|
|
104
|
+
/** Manifest key (the table name). */
|
|
105
|
+
table: string;
|
|
106
|
+
/** Row count. */
|
|
107
|
+
rows: number;
|
|
108
|
+
/** Keyed hash of the rows (hex). */
|
|
109
|
+
hash: string;
|
|
110
|
+
}
|
|
111
|
+
/** A per-table comparison line. */
|
|
112
|
+
export interface CloudVaultTableDiff {
|
|
113
|
+
table: string;
|
|
114
|
+
/** Rows on this machine, or `null` when the table is absent here. */
|
|
115
|
+
localRows: number | null;
|
|
116
|
+
/** Rows in the compared snapshot, or `null` when absent there. */
|
|
117
|
+
cloudRows: number | null;
|
|
118
|
+
/** Rows and hash both equal. */
|
|
119
|
+
match: boolean;
|
|
120
|
+
}
|
|
121
|
+
/** One snapshot (checkpoint) in a stream's lineage. */
|
|
122
|
+
export interface CloudVaultSnapshot {
|
|
123
|
+
checkpointId: string;
|
|
124
|
+
parentCheckpointId: string | null;
|
|
125
|
+
deviceId: string;
|
|
126
|
+
/** The device's name, when the account's device list has it. */
|
|
127
|
+
deviceName: string | null;
|
|
128
|
+
replicaId: string;
|
|
129
|
+
coversSeq: number;
|
|
130
|
+
createdAt: string | null;
|
|
131
|
+
sizeBytes: number;
|
|
132
|
+
/** Total rows over the manifest. */
|
|
133
|
+
rows: number;
|
|
134
|
+
/** Devices that endorsed (co-signed) it. */
|
|
135
|
+
endorsedBy: string[];
|
|
136
|
+
}
|
|
137
|
+
/** A live lease on the stream. */
|
|
138
|
+
export interface CloudVaultLease {
|
|
139
|
+
role: string;
|
|
140
|
+
replicaId: string;
|
|
141
|
+
deviceId: string | null;
|
|
142
|
+
deviceName: string | null;
|
|
143
|
+
expiresAt: string;
|
|
144
|
+
/** Set when the lease was taken by force: a labelled fork. */
|
|
145
|
+
forkedFromReplicaId: string | null;
|
|
146
|
+
/** When the current holder took it, when the server says. */
|
|
147
|
+
acquiredAt?: string | null;
|
|
148
|
+
/** This machine holds it. */
|
|
149
|
+
mine: boolean;
|
|
150
|
+
}
|
|
151
|
+
/** `cleo cloud push`. */
|
|
152
|
+
export interface CloudPushResult {
|
|
153
|
+
apiUrl: string;
|
|
154
|
+
scope: CloudVaultScope;
|
|
155
|
+
streamId: string;
|
|
156
|
+
/** `pushed`: a new snapshot; `up-to-date`: nothing changed since the head snapshot. */
|
|
157
|
+
status: 'pushed' | 'up-to-date';
|
|
158
|
+
snapshot: CloudVaultSnapshot | null;
|
|
159
|
+
/** The snapshot this one descends from. */
|
|
160
|
+
parentCheckpointId: string | null;
|
|
161
|
+
/** The delta segment appended so the counts reconcile, if one was needed. */
|
|
162
|
+
deltaSegmentSeq: number | null;
|
|
163
|
+
/** The lease this push holds. */
|
|
164
|
+
lease: CloudVaultLease | null;
|
|
165
|
+
/**
|
|
166
|
+
* A labelled fork: pushed with `--force` over a head this store had not synced, or after
|
|
167
|
+
* taking another device's live lease. The label is on the snapshot itself (T13007).
|
|
168
|
+
*/
|
|
169
|
+
forked: boolean;
|
|
170
|
+
warnings: CloudWarning[];
|
|
171
|
+
}
|
|
172
|
+
/** `cleo cloud pull` / `cleo cloud restore`. */
|
|
173
|
+
export interface CloudRestoreResult {
|
|
174
|
+
apiUrl: string;
|
|
175
|
+
scope: CloudVaultScope;
|
|
176
|
+
streamId: string;
|
|
177
|
+
/** `restored`: the snapshot was activated; `up-to-date`: this machine already holds the head. */
|
|
178
|
+
status: 'restored' | 'up-to-date';
|
|
179
|
+
snapshot: CloudVaultSnapshot | null;
|
|
180
|
+
/** Where the store was placed (project root, or the CLEO home for global). */
|
|
181
|
+
target: string;
|
|
182
|
+
/** Every table's count and hash matched the manifest before activation. */
|
|
183
|
+
verified: boolean;
|
|
184
|
+
/** Tables checked. */
|
|
185
|
+
tables: number;
|
|
186
|
+
/** Local safety backup taken before activation, if any. */
|
|
187
|
+
safetyBackup: string | null;
|
|
188
|
+
warnings: CloudWarning[];
|
|
189
|
+
}
|
|
190
|
+
/** `cleo cloud verify`. */
|
|
191
|
+
export interface CloudVerifyResult {
|
|
192
|
+
apiUrl: string;
|
|
193
|
+
scope: CloudVaultScope;
|
|
194
|
+
streamId: string;
|
|
195
|
+
/** `match`: local equals the head snapshot; `ahead`: local changed since this machine's last snapshot; `behind`: the cloud has a newer snapshot; `diverged`: both; `empty`: no snapshot yet; `untrusted`: the head snapshot's signature does not verify against a trusted device key (nothing is compared with it). */
|
|
196
|
+
verdict: 'match' | 'ahead' | 'behind' | 'diverged' | 'empty' | 'untrusted';
|
|
197
|
+
/** What to do about a verdict other than `match` (or a failed integrity check); `null` when nothing. */
|
|
198
|
+
remedy: string | null;
|
|
199
|
+
/** Local store passed SQLite integrity_check. */
|
|
200
|
+
localIntegrity: boolean;
|
|
201
|
+
head: CloudVaultSnapshot | null;
|
|
202
|
+
/** This machine's last pushed or restored snapshot. */
|
|
203
|
+
lastSynced: string | null;
|
|
204
|
+
/** Local vs head snapshot, per table. */
|
|
205
|
+
tables: CloudVaultTableDiff[];
|
|
206
|
+
/** The newest snapshot each device wrote, and whether its manifest equals the head's. */
|
|
207
|
+
devices: Array<{
|
|
208
|
+
deviceId: string;
|
|
209
|
+
deviceName: string | null;
|
|
210
|
+
checkpointId: string;
|
|
211
|
+
createdAt: string | null;
|
|
212
|
+
matchesHead: boolean;
|
|
213
|
+
}>;
|
|
214
|
+
warnings: CloudWarning[];
|
|
215
|
+
}
|
|
216
|
+
/** `cleo cloud vault` (status of the vault for the current store). */
|
|
217
|
+
export interface CloudVaultStatusResult {
|
|
218
|
+
apiUrl: string;
|
|
219
|
+
scope: CloudVaultScope;
|
|
220
|
+
streamId: string;
|
|
221
|
+
headSeq: number;
|
|
222
|
+
head: CloudVaultSnapshot | null;
|
|
223
|
+
/** Newest first, at most 100 (the server's list ceiling). */
|
|
224
|
+
lineage: CloudVaultSnapshot[];
|
|
225
|
+
/** Newest snapshot per device. */
|
|
226
|
+
lastPushByDevice: Array<{
|
|
227
|
+
deviceId: string;
|
|
228
|
+
deviceName: string | null;
|
|
229
|
+
checkpointId: string;
|
|
230
|
+
createdAt: string | null;
|
|
231
|
+
}>;
|
|
232
|
+
/** Tables whose local rows or hash differ from this machine's last snapshot. */
|
|
233
|
+
pendingChanges: CloudVaultTableDiff[];
|
|
234
|
+
lastSynced: string | null;
|
|
235
|
+
leases: CloudVaultLease[];
|
|
236
|
+
warnings: CloudWarning[];
|
|
237
|
+
}
|
|
238
|
+
/** `cleo cloud lease release`. */
|
|
239
|
+
export interface CloudLeaseReleaseResult {
|
|
240
|
+
apiUrl: string;
|
|
241
|
+
scope: CloudVaultScope;
|
|
242
|
+
streamId: string;
|
|
243
|
+
released: boolean;
|
|
244
|
+
warnings: CloudWarning[];
|
|
245
|
+
}
|
|
246
|
+
/** One line of `cleo cloud activity`. */
|
|
247
|
+
export interface CloudActivityItem {
|
|
248
|
+
at: string;
|
|
249
|
+
action: string;
|
|
250
|
+
target: string | null;
|
|
251
|
+
deviceId: string | null;
|
|
252
|
+
deviceName: string | null;
|
|
253
|
+
/** This machine did it. */
|
|
254
|
+
thisDevice: boolean;
|
|
255
|
+
}
|
|
256
|
+
/** `cleo cloud activity`. */
|
|
257
|
+
export interface CloudActivityResult {
|
|
258
|
+
apiUrl: string;
|
|
259
|
+
/** The project the list is filtered to, if any. */
|
|
260
|
+
projectId: string | null;
|
|
261
|
+
items: CloudActivityItem[];
|
|
262
|
+
/** The server has older events (`--before` this). */
|
|
263
|
+
nextBefore: string | null;
|
|
264
|
+
warnings: CloudWarning[];
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=nexus-vault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus-vault.d.ts","sourceRoot":"","sources":["../src/nexus-vault.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAOrD,gEAAgE;AAChE,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AAEH,2FAA2F;AAC3F,eAAO,MAAM,sBAAsB;;;;;iBAIjC,CAAC;AAIH,mDAAmD;AACnD,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAE/C,oFAAoF;AACpF,eAAO,MAAM,gBAAgB;;;;;;iBAM3B,CAAC;AAEH,2CAA2C;AAC3C,eAAO,MAAM,uBAAuB;;;;;;;;iBAA6C,CAAC;AAElF,mCAAmC;AACnC,eAAO,MAAM,qBAAqB;;;;;IAKhC;;;OAGG;;iBAEH,CAAC;AAIH,oDAAoD;AACpD,eAAO,MAAM,wBAAwB;;;;;;;;;iBASnC,CAAC;AAEH,4CAA4C;AAC5C,eAAO,M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BAAmB,EAAE,CAAC;IACtC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,kCAAkC;AAClC,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,2BAA2B;IAC3B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,6BAA6B;AAC7B,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,qDAAqD;IACrD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud vault contracts: `cleo cloud push | pull | restore | verify | activity | lease`.
|
|
3
|
+
*
|
|
4
|
+
* The vault keeps encrypted snapshots of a project's (or this account's
|
|
5
|
+
* global) CLEO state on Cleo Nexus, as checkpoints on the project's journal
|
|
6
|
+
* stream (or the account's `home:` stream). The server stores ciphertext plus
|
|
7
|
+
* a plaintext manifest of per-table row counts and keyed hashes, and refuses a
|
|
8
|
+
* snapshot that does not descend from the stream head or whose counts do not
|
|
9
|
+
* reconcile with the journal.
|
|
10
|
+
*
|
|
11
|
+
* Keys (owner decision 2026-10-01): adding a device needs only `cleo login`
|
|
12
|
+
* and the one-time browser approval. The account master key is escrowed on
|
|
13
|
+
* the server (stored encrypted under a server-held key, cleo-nexus T082) and
|
|
14
|
+
* released only to an approved, active device, sealed to that device's X25519
|
|
15
|
+
* key (`GET /v1/account/keys/escrow`). Snapshots are encrypted, but with keys
|
|
16
|
+
* the server can recover: server-escrowed encryption, not zero-knowledge.
|
|
17
|
+
*
|
|
18
|
+
* The response schemas here parse what the API returns for the endpoints the
|
|
19
|
+
* wire contract (`./cloud/api.ts`, mirrored from cleo-nexus) does not yet
|
|
20
|
+
* carry; every object is loose so a newer server's extra fields survive.
|
|
21
|
+
*
|
|
22
|
+
* @task T12336
|
|
23
|
+
* @task T12337
|
|
24
|
+
* @task T12338
|
|
25
|
+
* @epic T12322
|
|
26
|
+
*/
|
|
27
|
+
import { z } from 'zod';
|
|
28
|
+
const isoTime = z.iso.datetime({ offset: true });
|
|
29
|
+
const uuid = z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
|
|
30
|
+
// ---------- wire: reads the vault parses leniently ----------
|
|
31
|
+
/** `GET /v1/account/keys` (only the fields the vault reads). */
|
|
32
|
+
export const nexusUserKeysSchema = z.looseObject({
|
|
33
|
+
keyVersion: z.number().int().positive(),
|
|
34
|
+
masterKeyVerifier: z.string(),
|
|
35
|
+
});
|
|
36
|
+
/** `GET /v1/projects/:projectId/keys`: the caller's wrapped project keys, newest first. */
|
|
37
|
+
export const nexusProjectKeysSchema = z.looseObject({
|
|
38
|
+
keys: z.array(z.looseObject({ wrappedProjectKey: z.string(), keyVersion: z.number().int().positive() })),
|
|
39
|
+
});
|
|
40
|
+
// ---------- wire: leases (cleo-nexus T083) ----------
|
|
41
|
+
/** The lease role of the vault's single writer. */
|
|
42
|
+
export const NEXUS_VAULT_LEASE_ROLE = 'writer';
|
|
43
|
+
/** A lease as `POST /v1/streams/:streamId/leases` answers it (parsed leniently). */
|
|
44
|
+
export const nexusLeaseSchema = z.looseObject({
|
|
45
|
+
streamId: z.string(),
|
|
46
|
+
role: z.string(),
|
|
47
|
+
replicaId: uuid,
|
|
48
|
+
expiresAt: isoTime,
|
|
49
|
+
forkedFromReplicaId: uuid.nullable().optional(),
|
|
50
|
+
});
|
|
51
|
+
/** `POST /v1/streams/:streamId/leases`. */
|
|
52
|
+
export const nexusLeaseAcquireSchema = z.looseObject({ lease: nexusLeaseSchema });
|
|
53
|
+
/** `GET /v1/streams/:streamId`. */
|
|
54
|
+
export const nexusStreamHeadSchema = z.looseObject({
|
|
55
|
+
streamId: z.string(),
|
|
56
|
+
kind: z.string().optional(),
|
|
57
|
+
headSeq: z.number().int().nonnegative(),
|
|
58
|
+
headCheckpointId: z.string().nullable(),
|
|
59
|
+
/**
|
|
60
|
+
* The highest segment `schemaVersion` the stream holds (the server raises it on every append).
|
|
61
|
+
* Absent from an older server.
|
|
62
|
+
*/
|
|
63
|
+
maxSchemaVersion: z.number().int().nonnegative().optional(),
|
|
64
|
+
});
|
|
65
|
+
// ---------- wire: activity (E18 `GET /v1/account/activity`) ----------
|
|
66
|
+
/** One audit event of the caller's own activity. */
|
|
67
|
+
export const nexusActivityEventSchema = z.looseObject({
|
|
68
|
+
id: z.union([z.string(), z.number()]),
|
|
69
|
+
at: isoTime,
|
|
70
|
+
actorUserId: z.string().nullable().optional(),
|
|
71
|
+
actorDeviceId: z.string().nullable().optional(),
|
|
72
|
+
requestId: z.string().nullable().optional(),
|
|
73
|
+
action: z.string(),
|
|
74
|
+
target: z.string().nullable().optional(),
|
|
75
|
+
detail: z.unknown().optional(),
|
|
76
|
+
});
|
|
77
|
+
/** `GET /v1/account/activity`, one page. */
|
|
78
|
+
export const nexusActivityPageSchema = z.looseObject({
|
|
79
|
+
events: z.array(nexusActivityEventSchema),
|
|
80
|
+
nextBefore: z.union([z.string(), z.number()]).nullable().optional(),
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=nexus-vault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus-vault.js","sourceRoot":"","sources":["../src/nexus-vault.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;AAEjG,+DAA+D;AAE/D,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,WAAW,CAAC;IAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACvC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;CAC9B,CAAC,CAAC;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CAAC;IAClD,IAAI,EAAE,CAAC,CAAC,KAAK,CACX,CAAC,CAAC,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAC1F;CACF,CAAC,CAAC;AAEH,uDAAuD;AAEvD,mDAAmD;AACnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAE/C,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,CAAC,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MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACxC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,4CAA4C;AAC5C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC;IACnD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IACzC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACpE,CAAC,CAAC"}
|
|
@@ -66,6 +66,11 @@ export interface PortableFileEntry {
|
|
|
66
66
|
sha256: string;
|
|
67
67
|
/** True when the file was classified as a secret (only present in encrypted bundles). */
|
|
68
68
|
secret: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* True when the exporting checkout's git tracks this path (the cloud vault
|
|
71
|
+
* leaves tracked files to git, T13019). Absent otherwise.
|
|
72
|
+
*/
|
|
73
|
+
gitTracked?: boolean;
|
|
69
74
|
}
|
|
70
75
|
/** A symbolic link inside the root whose target also stays inside the root. */
|
|
71
76
|
export interface PortableSymlinkEntry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portable-bundle.d.ts","sourceRoot":"","sources":["../src/portable-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAMxF;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAM3E;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,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,SAAS,GAAG,QAAQ,CAAC;QAC1F,cAAc;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,4BAA4B;IAC5B,QAAQ,EAAE,2BAA2B,EAAE,CAAC;IACxC,2FAA2F;IAC3F,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,eAAe,EAAE,OAAO,CAAC;IACzB,gEAAgE;IAChE,eAAe,EAAE,KAAK,CAAC,mBAAmB,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClE;;;OAGG;IACH,WAAW,CAAC,EAAE;QACZ,QAAQ,EAAE,KAAK,CAAC,oBAAoB,GAAG;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC5D,OAAO,EAAE,KAAK,CAAC,iBAAiB,GAAG;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACzD,CAAC;CACH"}
|
|
@@ -44,6 +44,19 @@ export type ResourceClass = 'interactive-cli' | 'agent-session' | 'llm-call' | '
|
|
|
44
44
|
export declare const RESOURCE_CLASSES: readonly ResourceClass[];
|
|
45
45
|
/** Error code emitted when an acquire is denied because no slot is available. */
|
|
46
46
|
export declare const RESOURCE_DEFERRED_CODE: "E_RESOURCE_DEFERRED";
|
|
47
|
+
/**
|
|
48
|
+
* `cleo run`: the admitted command exited non-zero, was killed by a signal, or
|
|
49
|
+
* could not be started. The envelope's `details` carry the exit code/signal.
|
|
50
|
+
* @task T12979
|
|
51
|
+
*/
|
|
52
|
+
export declare const RUN_COMMAND_FAILED_CODE: "E_COMMAND_FAILED";
|
|
53
|
+
/**
|
|
54
|
+
* `cleo run` exit code for "not admitted, nothing started"
|
|
55
|
+
* (sysexits EX_TEMPFAIL). Note a child may itself exit 75; the envelope's
|
|
56
|
+
* `error.code` tells the two apart.
|
|
57
|
+
* @task T12980
|
|
58
|
+
*/
|
|
59
|
+
export declare const RUN_DEFERRED_EXIT_CODE = 75;
|
|
47
60
|
/**
|
|
48
61
|
* Soft-signal code raised on the next admit when the host enters `backoff` —
|
|
49
62
|
* asks granted work to checkpoint. Existing grants are NEVER revoked.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-governor.d.ts","sourceRoot":"","sources":["../src/resource-governor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,eAAe,GACf,UAAU,GACV,UAAU,GACV,cAAc,GACd,YAAY,GACZ,UAAU,GACV,uBAAuB,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EASnD,CAAC;AAEH,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,EAAG,qBAA8B,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAG,yBAAkC,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC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QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,sFAAsF;IACtF,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC5C,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,kFAAkF;IAClF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,iGAAiG;IACjG,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACxD,oFAAoF;IACpF,QAAQ,CAAC,cAAc,CAAC,EAAE,iCAAiC,CAAC;IAC5D,uFAAuF;IACvF,QAAQ,CAAC,YAAY,EAAE,eAAe,GAAG,cAAc,CAAC;IACxD,oGAAoG;IACpG,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC;IAC/B,iFAAiF;IACjF,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,+EAA+E;IAC/E,QAAQ,CAAC,kBAAkB,EACvB,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,YAAY,CAAC;IACjB,0FAA0F;IAC1F,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C"}
|
|
@@ -31,6 +31,19 @@ export const RESOURCE_CLASSES = Object.freeze([
|
|
|
31
31
|
]);
|
|
32
32
|
/** Error code emitted when an acquire is denied because no slot is available. */
|
|
33
33
|
export const RESOURCE_DEFERRED_CODE = 'E_RESOURCE_DEFERRED';
|
|
34
|
+
/**
|
|
35
|
+
* `cleo run`: the admitted command exited non-zero, was killed by a signal, or
|
|
36
|
+
* could not be started. The envelope's `details` carry the exit code/signal.
|
|
37
|
+
* @task T12979
|
|
38
|
+
*/
|
|
39
|
+
export const RUN_COMMAND_FAILED_CODE = 'E_COMMAND_FAILED';
|
|
40
|
+
/**
|
|
41
|
+
* `cleo run` exit code for "not admitted, nothing started"
|
|
42
|
+
* (sysexits EX_TEMPFAIL). Note a child may itself exit 75; the envelope's
|
|
43
|
+
* `error.code` tells the two apart.
|
|
44
|
+
* @task T12980
|
|
45
|
+
*/
|
|
46
|
+
export const RUN_DEFERRED_EXIT_CODE = 75;
|
|
34
47
|
/**
|
|
35
48
|
* Soft-signal code raised on the next admit when the host enters `backoff` —
|
|
36
49
|
* asks granted work to checkpoint. Existing grants are NEVER revoked.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-governor.js","sourceRoot":"","sources":["../src/resource-governor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAmCH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B,MAAM,CAAC,MAAM,CAAC;IACtE,iBAAiB;IACjB,eAAe;IACf,UAAU;IACV,UAAU;IACV,cAAc;IACd,YAAY;IACZ,UAAU;IACV,uBAAuB;CACxB,CAAC,CAAC;AAEH,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAA8B,CAAC;AAErE;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAkC,CAAC;AA0C7E;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAErD,mEAAmE;AACnE,MAAM,UAAU,eAAe,CAAC,CAAkB;IAChD,OAAO,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC;AAC9B,CAAC"}
|
|
1
|
+
{"version":3,"file":"resource-governor.js","sourceRoot":"","sources":["../src/resource-governor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAmCH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B,MAAM,CAAC,MAAM,CAAC;IACtE,iBAAiB;IACjB,eAAe;IACf,UAAU;IACV,UAAU;IACV,cAAc;IACd,YAAY;IACZ,UAAU;IACV,uBAAuB;CACxB,CAAC,CAAC;AAEH,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAA8B,CAAC;AAErE;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAA2B,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAkC,CAAC;AA0C7E;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAErD,mEAAmE;AACnE,MAAM,UAAU,eAAe,CAAC,CAAkB;IAChD,OAAO,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sync schema version: one numbering for the data on a Cleo Nexus journal
|
|
3
|
+
* stream (`project:<id>`, `home:<userId>`), shared by both of its writers
|
|
4
|
+
* (cleo-dev decision on T13034).
|
|
5
|
+
*
|
|
6
|
+
* - The change journal stamps it as each segment's `schemaVersion` (journal
|
|
7
|
+
* spec §2.9: `schemaVersion = SYNC_SCHEMA_VERSION`), and a receiver refuses
|
|
8
|
+
* a higher one (`E_SCHEMA_AHEAD`) until it upgrades.
|
|
9
|
+
* - The cloud vault stamps it on its `cleo-vault-delta/v1` segments and its
|
|
10
|
+
* checkpoint manifests.
|
|
11
|
+
*
|
|
12
|
+
* Until the journal's sealer stamps segments, only the vault uses it. T13040
|
|
13
|
+
* (`SYNC_SET_VERSION`, which feeds the segment `schemaVersion`) must import
|
|
14
|
+
* this constant rather than define a second number, and test that a sealed
|
|
15
|
+
* segment's `schemaVersion` equals it.
|
|
16
|
+
*
|
|
17
|
+
* One number for both, so a vault segment inside a journal window is never a
|
|
18
|
+
* schema rise of its own: the server pins every rise in a checkpoint/v3
|
|
19
|
+
* manifest (`replayPin.transitions`) and holds a v3 manifest's `schemaVersion`
|
|
20
|
+
* at or above the parent's and the window's last rise. Bump it once, for both
|
|
21
|
+
* writers, when the synced data changes shape. It is not the vault's manifest
|
|
22
|
+
* computation format (`VAULT_MANIFEST_FORMAT_VERSION` in `@cleocode/core`),
|
|
23
|
+
* which never reaches the wire.
|
|
24
|
+
*
|
|
25
|
+
* This file is const data only (arch gate 10). Not part of `./cloud`: the
|
|
26
|
+
* server mirrors that directory and only bounds this number
|
|
27
|
+
* (`MAX_SCHEMA_VERSION`); the numbering is the client's.
|
|
28
|
+
*
|
|
29
|
+
* @task T13034
|
|
30
|
+
* @epic T12323
|
|
31
|
+
*/
|
|
32
|
+
/** The `schemaVersion` the change journal and the cloud vault stamp on what they write. */
|
|
33
|
+
export declare const SYNC_SCHEMA_VERSION = 2;
|
|
34
|
+
//# sourceMappingURL=sync-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-schema.d.ts","sourceRoot":"","sources":["../src/sync-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,2FAA2F;AAC3F,eAAO,MAAM,mBAAmB,IAAI,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sync schema version: one numbering for the data on a Cleo Nexus journal
|
|
3
|
+
* stream (`project:<id>`, `home:<userId>`), shared by both of its writers
|
|
4
|
+
* (cleo-dev decision on T13034).
|
|
5
|
+
*
|
|
6
|
+
* - The change journal stamps it as each segment's `schemaVersion` (journal
|
|
7
|
+
* spec §2.9: `schemaVersion = SYNC_SCHEMA_VERSION`), and a receiver refuses
|
|
8
|
+
* a higher one (`E_SCHEMA_AHEAD`) until it upgrades.
|
|
9
|
+
* - The cloud vault stamps it on its `cleo-vault-delta/v1` segments and its
|
|
10
|
+
* checkpoint manifests.
|
|
11
|
+
*
|
|
12
|
+
* Until the journal's sealer stamps segments, only the vault uses it. T13040
|
|
13
|
+
* (`SYNC_SET_VERSION`, which feeds the segment `schemaVersion`) must import
|
|
14
|
+
* this constant rather than define a second number, and test that a sealed
|
|
15
|
+
* segment's `schemaVersion` equals it.
|
|
16
|
+
*
|
|
17
|
+
* One number for both, so a vault segment inside a journal window is never a
|
|
18
|
+
* schema rise of its own: the server pins every rise in a checkpoint/v3
|
|
19
|
+
* manifest (`replayPin.transitions`) and holds a v3 manifest's `schemaVersion`
|
|
20
|
+
* at or above the parent's and the window's last rise. Bump it once, for both
|
|
21
|
+
* writers, when the synced data changes shape. It is not the vault's manifest
|
|
22
|
+
* computation format (`VAULT_MANIFEST_FORMAT_VERSION` in `@cleocode/core`),
|
|
23
|
+
* which never reaches the wire.
|
|
24
|
+
*
|
|
25
|
+
* This file is const data only (arch gate 10). Not part of `./cloud`: the
|
|
26
|
+
* server mirrors that directory and only bounds this number
|
|
27
|
+
* (`MAX_SCHEMA_VERSION`); the numbering is the client's.
|
|
28
|
+
*
|
|
29
|
+
* @task T13034
|
|
30
|
+
* @epic T12323
|
|
31
|
+
*/
|
|
32
|
+
/** The `schemaVersion` the change journal and the cloud vault stamp on what they write. */
|
|
33
|
+
export const SYNC_SCHEMA_VERSION = 2;
|
|
34
|
+
//# sourceMappingURL=sync-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-schema.js","sourceRoot":"","sources":["../src/sync-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC"}
|
package/dist/task.d.ts
CHANGED
|
@@ -238,6 +238,30 @@ export type EvidenceAtom = {
|
|
|
238
238
|
passCount: number;
|
|
239
239
|
failCount: number;
|
|
240
240
|
skipCount: number;
|
|
241
|
+
/**
|
|
242
|
+
* HEAD of the checkout the report was bound to at verify time (T12965):
|
|
243
|
+
* the task's change-set root (its worktree when one is registered), the
|
|
244
|
+
* root `cleo done` and `cleo complete` recompute the tree in. Absent when
|
|
245
|
+
* that root is not a git checkout, and on atoms recorded before T12965.
|
|
246
|
+
*/
|
|
247
|
+
headSha?: string;
|
|
248
|
+
/**
|
|
249
|
+
* Git tree of that checkout at verify time, as the tool cache computes
|
|
250
|
+
* it (T12958): HEAD's tree with every uncommitted, not-ignored change
|
|
251
|
+
* applied (T12965). `cleo complete` refuses the atom once the tree no
|
|
252
|
+
* longer matches, unless `ci:<pr>` or a full tool run carries the gate.
|
|
253
|
+
*/
|
|
254
|
+
treeHash?: string;
|
|
255
|
+
/** Test files the report covered, relative to the bound checkout (capped, T12965). */
|
|
256
|
+
testFiles?: string[];
|
|
257
|
+
/** Total test files the report covered; exceeds `testFiles.length` when capped. */
|
|
258
|
+
testFileCount?: number;
|
|
259
|
+
/**
|
|
260
|
+
* Affected packages (changed, or depending on a changed one) with no
|
|
261
|
+
* test file, so no report could cover them — recorded like
|
|
262
|
+
* `tool:test-affected`'s `untestedPackages` (T12965 review).
|
|
263
|
+
*/
|
|
264
|
+
untestedPackages?: string[];
|
|
241
265
|
} | {
|
|
242
266
|
kind: 'tool';
|
|
243
267
|
tool: string;
|
|
@@ -258,14 +282,38 @@ export type EvidenceAtom = {
|
|
|
258
282
|
* `affected`: the run covered only the packages the branch diff touches
|
|
259
283
|
* plus their dependents (D11150, T12635). It satisfies testsPassed before
|
|
260
284
|
* merge; merged CI (`ci:`) or a full `tool:test` supersedes it.
|
|
285
|
+
*
|
|
286
|
+
* `full`: a scope-aware `tool:test` ran the whole suite (T12959) —
|
|
287
|
+
* no affected template is declared, the project opted out
|
|
288
|
+
* (`testing.preferAffected: false`), the change has merged, or the
|
|
289
|
+
* affected planner refused; `scopeReason` says which when known.
|
|
290
|
+
*/
|
|
291
|
+
scope?: 'affected' | 'full';
|
|
292
|
+
/**
|
|
293
|
+
* With `scope: 'full'`: why a scope-aware `tool:test` ran the full suite.
|
|
294
|
+
* With `scope: 'affected'`: what the scope rests on — dependents come
|
|
295
|
+
* only from declared workspace package dependencies (T12959).
|
|
261
296
|
*/
|
|
262
|
-
|
|
297
|
+
scopeReason?: string;
|
|
263
298
|
/** The packages the affected run covered (with `scope: 'affected'`). */
|
|
264
299
|
affectedPackages?: string[];
|
|
265
300
|
/** The test projects the affected run actually selected (incl. non-package projects). */
|
|
266
301
|
affectedProjects?: string[];
|
|
267
302
|
/** Affected DEPENDENT packages with no test project (a changed one refuses the scope). */
|
|
268
303
|
untestedPackages?: string[];
|
|
304
|
+
/**
|
|
305
|
+
* Test files that failed and then passed on their single retry
|
|
306
|
+
* (T12961). The run counts as a pass; this marks it as a FLAKY pass so
|
|
307
|
+
* it stays visible instead of reading as a clean one.
|
|
308
|
+
*/
|
|
309
|
+
flaky?: string[];
|
|
310
|
+
/**
|
|
311
|
+
* Git tree of the source the run measured (T12958): HEAD's tree with
|
|
312
|
+
* every uncommitted, not-ignored change applied.
|
|
313
|
+
*/
|
|
314
|
+
treeHash?: string;
|
|
315
|
+
/** `true` when the result was served from the tool cache (no spawn). */
|
|
316
|
+
cacheHit?: boolean;
|
|
269
317
|
} | {
|
|
270
318
|
kind: 'url';
|
|
271
319
|
url: string;
|