@claudian-collab/protocol 4.1.4 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/CollabCloudBinding.d.ts +8 -2
- package/dist/CollabCloudBinding.js +25 -13
- package/dist/CollabConstants.d.ts +1 -1
- package/dist/CollabConstants.js +1 -1
- package/dist/CollabMemberMentionParser.js +7 -5
- package/dist/CollabProjectBackupCheckpoint.js +50 -46
- package/dist/CollabProjectCheckpoint.js +4 -3
- package/dist/CollabTicketReferenceParser.js +18 -3
- package/dist/esm/CollabCloudBinding.mjs +25 -13
- package/dist/esm/CollabConstants.mjs +1 -1
- package/dist/esm/CollabMemberMentionParser.mjs +7 -5
- package/dist/esm/CollabProjectBackupCheckpoint.mjs +50 -46
- package/dist/esm/CollabProjectCheckpoint.mjs +4 -3
- package/dist/esm/CollabTicketReferenceParser.mjs +18 -3
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ or compatibility rules.
|
|
|
20
20
|
- Shared limits that client and server must agree on (`COLLAB_LIMITS`)
|
|
21
21
|
- Protocol-version negotiation (`COLLAB_PROTOCOL_VERSION`, envelope decoding)
|
|
22
22
|
- Canonical Project checkpoint profiles, logical records, authority-generation transfer, exact membership claims, target-signed redemption receipts, offline backup operational continuity, and Project retirement contracts
|
|
23
|
-
- Cloud binding
|
|
23
|
+
- Cloud binding v5 route construction/matching, bounded checkpoint streams, capability negotiation, strict success/error envelopes, private-development bootstrap, Project snapshot, and redacted event contracts
|
|
24
24
|
- Markdown-derived Ticket-reference and Member-mention semantics shared by
|
|
25
25
|
client rendering and authority derivation
|
|
26
26
|
|
|
@@ -37,7 +37,7 @@ fixed part of the detail so the whole detail stays within
|
|
|
37
37
|
has one compatible final-serialization limit. Request comments and Ticket
|
|
38
38
|
accepted relations also have shared authority-enforced total limits; summary
|
|
39
39
|
counts let complete consumers reject partial or cross-snapshot assembly.
|
|
40
|
-
Cloud binding
|
|
40
|
+
Cloud binding v5 retains the authority-neutral Project snapshot, nine redacted durable event kinds plus `snapshot.required`, eighteen capability tokens, the exact ordinary Project/Git route catalog, bounded authority-transfer artifact routes, and six private-development bootstrap bindings. Wire v9 retains target-confirmed Cloud-to-LAN invalidation and cleanup to the existing authority-transfer contract. Its domain-separated Ed25519 proof binds the exact target Member, source and target generations, checkpoint, stage, current claim batch when present, and cleanup digest; Manager cancellation, timeout, disconnect, or target absence does not prove cleanup. The shared checkpoint container is exactly `checkpoint.json`, `coordination.ndjson`, and `repository.bundle`; authority-transfer and export use wire-visible coordination format v1, and offline backup uses format v3. Portable profiles exclude engine storage, paths, credentials, tokens, private keys, and operational refs, and backups exclude plaintext invitation secrets, raw claims, and private keys. Existing LAN Join, invitation, endpoint, membership lifecycle, Host-transfer, snapshot, event, and HTTP bindings remain independently application-owned; the dedicated LAN authority-transfer transport binds shared payloads without creating another shared operation registry.
|
|
41
41
|
|
|
42
42
|
Backup coordination artifacts are limited to 256 MiB of actual UTF-8 bytes, including the final newline. The decoder, encoder, and consistency checker apply this same inclusive limit without rewriting principals into an intermediate format. Valid current-format artifacts at the limit are accepted; an additional byte is rejected.
|
|
43
43
|
|
|
@@ -64,12 +64,13 @@ part of the public surface.
|
|
|
64
64
|
|
|
65
65
|
Package SemVer, canonical wire version, and Cloud binding version are independent concepts.
|
|
66
66
|
|
|
67
|
-
- **Package version** (this `package.json`): `4.1
|
|
68
|
-
- **Wire version** (`COLLAB_PROTOCOL_VERSION`): currently `
|
|
69
|
-
- **Cloud binding version** (`COLLAB_CLOUD_BINDING_VERSION`): currently `
|
|
67
|
+
- **Package version** (this `package.json`): `4.2.1`. Behavior-preserving implementation refactors and reviewed compatible defect corrections may use a patch release when public declarations, runtime exports, and accepted wire/binding semantics remain unchanged. Minor releases may add backward-compatible API. Removing or incompatibly changing an existing declaration, export, runtime behavior, codec, error, limit, ref rule, operation, or compatibility rule requires a major release. Package API SemVer is classified independently from the wire and Cloud binding contracts, but a compatible package addition cannot exempt a changed wire contract from a wire-version increase or a changed Cloud binding contract from a binding-version increase. The package version never signals wire compatibility by itself.
|
|
68
|
+
- **Wire version** (`COLLAB_PROTOCOL_VERSION`): currently `9`. The supported range is exactly `[9, 9]`. This is independent from Cloud binding version `5` and the application-owned LAN bindings. Any change to an existing envelope, DTO, operation payload shape, or operation definition requires a new wire-protocol version. This includes additive operations: every wire-contract change increases the canonical wire version.
|
|
69
|
+
- **Cloud binding version** (`COLLAB_CLOUD_BINDING_VERSION`): currently `5`. It versions Cloud routes, bounded transfer streams, and capabilities independently from package and wire versions. Every Cloud binding-contract change increases this version. Bindings before v5 and wire versions before v9 are unsupported rather than translated or dual-interpreted.
|
|
70
70
|
|
|
71
71
|
### Compatibility behavior
|
|
72
72
|
|
|
73
|
+
- A Cloud error envelope may carry `mutationOutcome: 'rejected'` only when the authority has checked the exact request's retained result and nonterminal journal under its Project write lane and durable state prevents that request from ever applying. A persisted rejection fence or a strictly advanced monotone expected-state value can establish that guarantee; a later snapshot, missing row, ordinary rejection code, timeout, or diagnostic reason cannot. The envelope's request ID binds the proof to the submitted operation and request. Without this property, clients must preserve ambiguous mutation recovery. The authority must preserve the facts establishing this guarantee in backup/restore and delayed-duplicate handling.
|
|
73
74
|
- Envelope decoders reject unknown fields (`protocol-payload-invalid`).
|
|
74
75
|
Operation request and response compatibility is
|
|
75
76
|
decoder-defined and pinned by package fixtures; decoded DTOs are reconstructed
|
|
@@ -2,7 +2,7 @@ import { COLLAB_PROTOCOL_VERSION } from './CollabConstants';
|
|
|
2
2
|
import { CollabError, type CollabDiagnosticContext, type CollabErrorCode, type CollabRecoveryAction } from './CollabError';
|
|
3
3
|
import { COLLAB_PROJECT_CHECKPOINT_ARTIFACTS } from './CollabProjectCheckpoint';
|
|
4
4
|
import type { CollabIsoTimestamp, CollabProjectId } from './types';
|
|
5
|
-
export declare const COLLAB_CLOUD_BINDING_VERSION:
|
|
5
|
+
export declare const COLLAB_CLOUD_BINDING_VERSION: 5;
|
|
6
6
|
export declare const COLLAB_CLOUD_CAPABILITY_DOCUMENT_SCHEMA_VERSION: 2;
|
|
7
7
|
export declare const COLLAB_CLOUD_CAPABILITIES: readonly ["accept", "authority-transfer", "cloud-imported-membership-claims", "cloud-project-create", "cloud-project-invitations", "cloud-project-join", "cloud-project-leave", "cloud-project-manager-responsibility", "cloud-project-membership", "development-bootstrap", "git-receive-pack-personal-ref", "git-upload-pack", "project-checkpoint-export", "project-events", "project-retirement", "project-snapshot", "requests", "tickets"];
|
|
8
8
|
export type CollabCloudCapability = typeof COLLAB_CLOUD_CAPABILITIES[number];
|
|
@@ -122,6 +122,12 @@ export interface CollabCloudWireError {
|
|
|
122
122
|
}
|
|
123
123
|
export interface CollabCloudErrorEnvelope {
|
|
124
124
|
readonly error: CollabCloudWireError;
|
|
125
|
+
/**
|
|
126
|
+
* Exact request-correlated proof of no retained success or nonterminal journal,
|
|
127
|
+
* and durable authority state preventing this request from applying later.
|
|
128
|
+
* Omission leaves the mutation outcome unknown, regardless of the error code.
|
|
129
|
+
*/
|
|
130
|
+
readonly mutationOutcome?: 'rejected';
|
|
125
131
|
readonly protocolVersion: typeof COLLAB_PROTOCOL_VERSION;
|
|
126
132
|
readonly requestId: string;
|
|
127
133
|
}
|
|
@@ -142,5 +148,5 @@ export declare function collabCloudCapabilityDocument(capabilities: readonly Col
|
|
|
142
148
|
export declare function collabCloudCapabilitySupported(document: CollabCloudCapabilityDocument, capability: CollabCloudCapability): boolean;
|
|
143
149
|
export declare function collabCloudSuccessEnvelope<T>(requestId: string, data: T): CollabCloudSuccessEnvelope<T>;
|
|
144
150
|
export declare function decodeCollabCloudSuccessEnvelope<T = unknown>(value: unknown): CollabCloudSuccessEnvelope<T>;
|
|
145
|
-
export declare function collabCloudErrorEnvelope(requestId: string, error: CollabError): CollabCloudErrorEnvelope;
|
|
151
|
+
export declare function collabCloudErrorEnvelope(requestId: string, error: CollabError, mutationOutcome?: CollabCloudErrorEnvelope['mutationOutcome']): CollabCloudErrorEnvelope;
|
|
146
152
|
export declare function decodeCollabCloudErrorEnvelope(value: unknown): CollabCloudErrorEnvelope;
|
|
@@ -23,7 +23,7 @@ const CollabControlOperationCodecs_1 = require("./CollabControlOperationCodecs")
|
|
|
23
23
|
const CollabError_1 = require("./CollabError");
|
|
24
24
|
const CollabValidation_1 = require("./CollabValidation");
|
|
25
25
|
const CollabProjectCheckpoint_1 = require("./CollabProjectCheckpoint");
|
|
26
|
-
exports.COLLAB_CLOUD_BINDING_VERSION =
|
|
26
|
+
exports.COLLAB_CLOUD_BINDING_VERSION = 5;
|
|
27
27
|
exports.COLLAB_CLOUD_CAPABILITY_DOCUMENT_SCHEMA_VERSION = 2;
|
|
28
28
|
exports.COLLAB_CLOUD_CAPABILITIES = Object.freeze([
|
|
29
29
|
'accept',
|
|
@@ -188,7 +188,7 @@ function collabCloudProjectOperationRoute(projectId, operation) {
|
|
|
188
188
|
assertProjectId(projectId);
|
|
189
189
|
if (!isCloudJsonOperation(operation))
|
|
190
190
|
invalidRoute();
|
|
191
|
-
return route('POST', `/
|
|
191
|
+
return route('POST', `/v5/projects/${projectId}/operations/${operation}`, {
|
|
192
192
|
kind: 'project-operation',
|
|
193
193
|
operation,
|
|
194
194
|
projectId,
|
|
@@ -198,7 +198,7 @@ function collabCloudProjectEventsRoute(projectId, afterSequence) {
|
|
|
198
198
|
assertProjectId(projectId);
|
|
199
199
|
if (!Number.isSafeInteger(afterSequence) || afterSequence < 0)
|
|
200
200
|
invalidRoute();
|
|
201
|
-
return route('GET', `/
|
|
201
|
+
return route('GET', `/v5/projects/${projectId}/events?afterSequence=${afterSequence}`, {
|
|
202
202
|
afterSequence,
|
|
203
203
|
kind: 'project-events',
|
|
204
204
|
projectId,
|
|
@@ -209,11 +209,11 @@ function collabCloudGitRoute(projectId, routeKind, service) {
|
|
|
209
209
|
if (routeKind === 'info-refs') {
|
|
210
210
|
if (service !== 'git-upload-pack' && service !== 'git-receive-pack')
|
|
211
211
|
invalidRoute();
|
|
212
|
-
return route('GET', `/
|
|
212
|
+
return route('GET', `/v5/projects/${projectId}/repository.git/info/refs?service=${service}`, { kind: 'git-info-refs', projectId, service });
|
|
213
213
|
}
|
|
214
214
|
if (service !== undefined)
|
|
215
215
|
invalidRoute();
|
|
216
|
-
return route('POST', `/
|
|
216
|
+
return route('POST', `/v5/projects/${projectId}/repository.git/${routeKind}`, {
|
|
217
217
|
kind: routeKind,
|
|
218
218
|
projectId,
|
|
219
219
|
});
|
|
@@ -224,7 +224,7 @@ function collabCloudAuthorityTransferArtifactRoute(projectId, transferId, direct
|
|
|
224
224
|
if (direction !== 'download' && direction !== 'upload'
|
|
225
225
|
|| !COLLAB_PROJECT_CHECKPOINT_ARTIFACTS_SET.has(artifact))
|
|
226
226
|
invalidRoute();
|
|
227
|
-
return route(direction === 'upload' ? 'PUT' : 'GET', `/
|
|
227
|
+
return route(direction === 'upload' ? 'PUT' : 'GET', `/v5/projects/${projectId}/authority-transfers/${transferId}/checkpoint/${artifact}`, {
|
|
228
228
|
artifact,
|
|
229
229
|
direction,
|
|
230
230
|
kind: 'authority-transfer-artifact',
|
|
@@ -237,7 +237,7 @@ function collabCloudProjectCheckpointExportArtifactRoute(projectId, exportId, ar
|
|
|
237
237
|
assertAttemptId(exportId);
|
|
238
238
|
if (!COLLAB_PROJECT_CHECKPOINT_ARTIFACTS_SET.has(artifact))
|
|
239
239
|
invalidRoute();
|
|
240
|
-
return route('GET', `/
|
|
240
|
+
return route('GET', `/v5/projects/${projectId}/checkpoint-exports/${exportId}/checkpoint/${artifact}`, {
|
|
241
241
|
artifact,
|
|
242
242
|
exportId,
|
|
243
243
|
kind: 'project-checkpoint-export-artifact',
|
|
@@ -249,7 +249,7 @@ function collabCloudProjectCheckpointExportRoute(projectId, exportId, operation)
|
|
|
249
249
|
assertAttemptId(exportId);
|
|
250
250
|
if (operation !== 'begin' && operation !== 'status')
|
|
251
251
|
invalidRoute();
|
|
252
|
-
return route(operation === 'begin' ? 'POST' : 'GET', `/
|
|
252
|
+
return route(operation === 'begin' ? 'POST' : 'GET', `/v5/projects/${projectId}/checkpoint-exports/${exportId}`, { exportId, kind: 'project-checkpoint-export', operation, projectId });
|
|
253
253
|
}
|
|
254
254
|
function decodeCollabCloudProjectCheckpointExportStatus(value) {
|
|
255
255
|
const source = exactRecord(value, 'checkpointExport', [
|
|
@@ -287,7 +287,7 @@ function decodeCollabCloudProjectCheckpointExportStatus(value) {
|
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
289
|
function collabDevelopmentBootstrapRoute(operation, attemptId) {
|
|
290
|
-
const base = '/
|
|
290
|
+
const base = '/v5/development/bootstrap/attempts';
|
|
291
291
|
if (operation === 'beginDevelopmentBootstrap') {
|
|
292
292
|
if (attemptId !== undefined)
|
|
293
293
|
invalidRoute();
|
|
@@ -346,7 +346,7 @@ function matchCollabCloudRoute(method, target) {
|
|
|
346
346
|
&& url.pathname === '/collab/capabilities'
|
|
347
347
|
&& exactQuery(url, []))
|
|
348
348
|
return { kind: 'capabilities' };
|
|
349
|
-
if (segments[0] === '
|
|
349
|
+
if (segments[0] === 'v5'
|
|
350
350
|
&& segments[1] === 'projects'
|
|
351
351
|
&& (0, CollabValidation_1.isCollabProjectId)(segments[2])) {
|
|
352
352
|
const projectId = segments[2];
|
|
@@ -425,7 +425,7 @@ function matchCollabCloudRoute(method, target) {
|
|
|
425
425
|
&& exactQuery(url, []))
|
|
426
426
|
return { kind: segments[4], projectId };
|
|
427
427
|
}
|
|
428
|
-
if (segments[0] !== '
|
|
428
|
+
if (segments[0] !== 'v5'
|
|
429
429
|
|| segments[1] !== 'development'
|
|
430
430
|
|| segments[2] !== 'bootstrap'
|
|
431
431
|
|| segments[3] !== 'attempts'
|
|
@@ -533,21 +533,32 @@ function decodeCollabCloudSuccessEnvelope(value) {
|
|
|
533
533
|
requestId: source.requestId,
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
|
-
function collabCloudErrorEnvelope(requestId, error) {
|
|
536
|
+
function collabCloudErrorEnvelope(requestId, error, mutationOutcome) {
|
|
537
537
|
if (!(0, CollabValidation_1.isCollabOpaqueId)(requestId))
|
|
538
538
|
throw invalidPayload('requestId');
|
|
539
|
+
if (mutationOutcome !== undefined && mutationOutcome !== 'rejected') {
|
|
540
|
+
throw invalidPayload('mutationOutcome');
|
|
541
|
+
}
|
|
539
542
|
return Object.freeze({
|
|
540
543
|
error: Object.freeze({
|
|
541
544
|
code: error.code,
|
|
542
545
|
recoveryActions: Object.freeze([...error.recoveryActions]),
|
|
543
546
|
safeContext: error.safeContext,
|
|
544
547
|
}),
|
|
548
|
+
...(mutationOutcome === undefined ? {} : { mutationOutcome }),
|
|
545
549
|
protocolVersion: CollabConstants_1.COLLAB_PROTOCOL_VERSION,
|
|
546
550
|
requestId,
|
|
547
551
|
});
|
|
548
552
|
}
|
|
549
553
|
function decodeCollabCloudErrorEnvelope(value) {
|
|
550
|
-
const source =
|
|
554
|
+
const source = record(value, 'envelope');
|
|
555
|
+
const hasOutcome = Object.hasOwn(source, 'mutationOutcome');
|
|
556
|
+
if (!hasExactKeys(source, hasOutcome
|
|
557
|
+
? ['error', 'mutationOutcome', 'protocolVersion', 'requestId']
|
|
558
|
+
: ['error', 'protocolVersion', 'requestId']))
|
|
559
|
+
throw invalidPayload('envelope');
|
|
560
|
+
if (hasOutcome && source.mutationOutcome !== 'rejected')
|
|
561
|
+
throw invalidPayload('mutationOutcome');
|
|
551
562
|
const wireError = exactRecord(source.error, 'error', [
|
|
552
563
|
'code',
|
|
553
564
|
'recoveryActions',
|
|
@@ -573,6 +584,7 @@ function decodeCollabCloudErrorEnvelope(value) {
|
|
|
573
584
|
]),
|
|
574
585
|
safeContext,
|
|
575
586
|
}),
|
|
587
|
+
...(hasOutcome ? { mutationOutcome: 'rejected' } : {}),
|
|
576
588
|
protocolVersion: CollabConstants_1.COLLAB_PROTOCOL_VERSION,
|
|
577
589
|
requestId: source.requestId,
|
|
578
590
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const COLLAB_PROTOCOL_VERSION:
|
|
1
|
+
export declare const COLLAB_PROTOCOL_VERSION: 9;
|
|
2
2
|
export declare const COLLAB_MAIN_REF: "refs/heads/main";
|
|
3
3
|
export declare const COLLAB_MEMBER_REF_PREFIX: "refs/heads/members/";
|
|
4
4
|
export declare const COLLAB_LIMITS: Readonly<{
|
package/dist/CollabConstants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.COLLAB_LIMITS = exports.COLLAB_MEMBER_REF_PREFIX = exports.COLLAB_MAIN_REF = exports.COLLAB_PROTOCOL_VERSION = void 0;
|
|
4
|
-
exports.COLLAB_PROTOCOL_VERSION =
|
|
4
|
+
exports.COLLAB_PROTOCOL_VERSION = 9;
|
|
5
5
|
exports.COLLAB_MAIN_REF = 'refs/heads/main';
|
|
6
6
|
exports.COLLAB_MEMBER_REF_PREFIX = 'refs/heads/members/';
|
|
7
7
|
exports.COLLAB_LIMITS = Object.freeze({
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseCollabMemberMentions = parseCollabMemberMentions;
|
|
4
4
|
const CollabMarkdownProse_1 = require("./CollabMarkdownProse");
|
|
5
|
-
const
|
|
5
|
+
const MENTION_PRECEDING_CHARACTER = /[\p{L}\p{N}_@-]$/u;
|
|
6
|
+
const MENTION_FOLLOWING_CHARACTER = /^[\p{L}\p{N}_@-]/u;
|
|
6
7
|
function parseCollabMemberMentions(markdown, targets) {
|
|
7
8
|
const candidates = mentionCandidates(targets);
|
|
8
9
|
if (candidates.length === 0)
|
|
@@ -15,14 +16,15 @@ function parseCollabMemberMentions(markdown, targets) {
|
|
|
15
16
|
if (mentionStart < 0)
|
|
16
17
|
break;
|
|
17
18
|
searchFrom = mentionStart + 1;
|
|
18
|
-
const preceding = prose
|
|
19
|
-
if (
|
|
19
|
+
const preceding = prose.slice(Math.max(0, mentionStart - 2), mentionStart);
|
|
20
|
+
if (MENTION_PRECEDING_CHARACTER.test(preceding))
|
|
20
21
|
continue;
|
|
21
22
|
const candidate = candidates.find(entry => {
|
|
22
23
|
if (!prose.startsWith(entry.name, mentionStart + 1))
|
|
23
24
|
return false;
|
|
24
|
-
const
|
|
25
|
-
|
|
25
|
+
const followingOffset = mentionStart + entry.name.length + 1;
|
|
26
|
+
const following = prose.slice(followingOffset, followingOffset + 2);
|
|
27
|
+
return !MENTION_FOLLOWING_CHARACTER.test(following);
|
|
26
28
|
});
|
|
27
29
|
if (!candidate)
|
|
28
30
|
continue;
|
|
@@ -1384,6 +1384,13 @@ function validateContinuity(records) {
|
|
|
1384
1384
|
const terminalResponders = new Map(records
|
|
1385
1385
|
.filter((item) => (item.kind === 'terminal-responder'))
|
|
1386
1386
|
.map(item => [item.value.operationId, item]));
|
|
1387
|
+
const terminalMembers = new Map([...terminalResponders].map(([operationId, terminal]) => [
|
|
1388
|
+
operationId,
|
|
1389
|
+
{
|
|
1390
|
+
acknowledgements: new Map(terminal.value.acknowledgements.map(item => [item.memberId, item])),
|
|
1391
|
+
eligibleMemberIds: new Set(terminal.value.eligibleMemberIds),
|
|
1392
|
+
},
|
|
1393
|
+
]));
|
|
1387
1394
|
const terminalPrincipals = new Map(records
|
|
1388
1395
|
.filter((item) => (item.kind === 'terminal-principal'))
|
|
1389
1396
|
.map(item => [`${item.value.operationId}:${item.value.memberId}`, item]));
|
|
@@ -1400,6 +1407,9 @@ function validateContinuity(records) {
|
|
|
1400
1407
|
.filter((item) => (item.kind === 'protected-invitation-envelope'))
|
|
1401
1408
|
.map(item => [item.value.invitationId, item]));
|
|
1402
1409
|
const claimOverrides = records.filter((item) => (item.kind === 'transferred-membership-claim-override'));
|
|
1410
|
+
const redeemedOverrideIdentities = new Set(claimOverrides
|
|
1411
|
+
.filter(item => item.value.state === 'redeemed')
|
|
1412
|
+
.map(item => (`${item.value.transferId}:${item.value.memberId}:${item.value.claimSha256}:${item.value.redemptionReceiptId}`)));
|
|
1403
1413
|
const claimOverrideEnvelopes = new Map(records
|
|
1404
1414
|
.filter((item) => (item.kind === 'protected-claim-override-envelope'))
|
|
1405
1415
|
.map(item => [
|
|
@@ -1412,6 +1422,28 @@ function validateContinuity(records) {
|
|
|
1412
1422
|
.filter((item) => (item.kind === 'project-membership-recovery'))
|
|
1413
1423
|
.map(item => [item.value.operationId, item]));
|
|
1414
1424
|
const secretReplayTombstones = records.filter((item) => (item.kind === 'secret-replay-tombstone'));
|
|
1425
|
+
const secretTombstonesByIdentity = new Map(secretReplayTombstones.map(item => [
|
|
1426
|
+
`${item.recordId}:${item.value.requestFingerprint}`,
|
|
1427
|
+
item,
|
|
1428
|
+
]));
|
|
1429
|
+
const liveSecretIdentities = new Set();
|
|
1430
|
+
for (const invitation of invitations.values()) {
|
|
1431
|
+
if (invitationEnvelopes.has(invitation.value.invitationId)) {
|
|
1432
|
+
liveSecretIdentities.add(`createProjectInvitation:${invitation.value.issuedByMemberId}:${invitation.value.idempotencyKey}`);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
for (const override of claimOverrides) {
|
|
1436
|
+
if (claimOverrideEnvelopes.has(override.recordId)) {
|
|
1437
|
+
liveSecretIdentities.add(`reissueTransferredMembershipClaim:${override.value.managerMemberId}:${override.value.idempotencyKey}`);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
const liveIdempotencyIdentities = new Set(records
|
|
1441
|
+
.filter(item => item.kind === 'idempotency-result')
|
|
1442
|
+
.map(item => `${item.value.operation}:${item.value.memberId}:${item.value.idempotencyKey}`));
|
|
1443
|
+
for (const offer of managerOffers) {
|
|
1444
|
+
liveIdempotencyIdentities.add(`createManagerResponsibilityOffer:${offer.value.sourceManagerMemberId}:${offer.value.idempotencyKey}`);
|
|
1445
|
+
}
|
|
1446
|
+
const claimOverrideRecordIds = new Set(claimOverrides.map(item => item.recordId));
|
|
1415
1447
|
const nonterminalLifecycles = [...lifecycles.values()].filter(item => (item.value.state === 'active' || item.value.state === 'recovery-required'));
|
|
1416
1448
|
if (nonterminalLifecycles.length > 1
|
|
1417
1449
|
|| principalBindingRecords.some(item => (memberRecords.get(item.value.memberId)?.value.status !== 'active'))
|
|
@@ -1664,13 +1696,8 @@ function validateContinuity(records) {
|
|
|
1664
1696
|
const recovery = recoveries.get(claim.value.transferId);
|
|
1665
1697
|
const member = memberRecords.get(claim.value.memberId);
|
|
1666
1698
|
const redemptionReceipt = redemptionReceipts.get(`${claim.value.transferId}:${claim.value.memberId}`);
|
|
1667
|
-
const
|
|
1668
|
-
|
|
1669
|
-
: claimOverrides.find(item => (item.value.transferId === claim.value.transferId
|
|
1670
|
-
&& item.value.memberId === claim.value.memberId
|
|
1671
|
-
&& item.value.state === 'redeemed'
|
|
1672
|
-
&& item.value.claimSha256 === redemptionReceipt.value.receipt.claimSha256
|
|
1673
|
-
&& item.value.redemptionReceiptId === redemptionReceipt.value.receipt.receiptId));
|
|
1699
|
+
const hasRedeemedOverride = redemptionReceipt !== undefined
|
|
1700
|
+
&& redeemedOverrideIdentities.has(`${claim.value.transferId}:${claim.value.memberId}:${redemptionReceipt.value.receipt.claimSha256}:${redemptionReceipt.value.receipt.receiptId}`);
|
|
1674
1701
|
if (member?.value.status !== 'active'
|
|
1675
1702
|
|| recovery === undefined
|
|
1676
1703
|
|| Date.parse(member.value.createdAt) > Date.parse(recovery.value.createdAt)
|
|
@@ -1684,8 +1711,8 @@ function validateContinuity(records) {
|
|
|
1684
1711
|
|| (claim.value.state === 'redeemed' && redemptionReceipt === undefined)
|
|
1685
1712
|
|| (redemptionReceipt !== undefined
|
|
1686
1713
|
&& claim.value.state !== 'redeemed'
|
|
1687
|
-
&&
|
|
1688
|
-
|| (claim.value.state === 'redeemed' &&
|
|
1714
|
+
&& !hasRedeemedOverride)
|
|
1715
|
+
|| (claim.value.state === 'redeemed' && hasRedeemedOverride)) {
|
|
1689
1716
|
throw invalidPayload('records');
|
|
1690
1717
|
}
|
|
1691
1718
|
}
|
|
@@ -1728,10 +1755,7 @@ function validateContinuity(records) {
|
|
|
1728
1755
|
}
|
|
1729
1756
|
for (const invitation of invitations.values()) {
|
|
1730
1757
|
const envelope = invitationEnvelopes.get(invitation.value.invitationId);
|
|
1731
|
-
const tombstone =
|
|
1732
|
-
&& item.value.actorMemberId === invitation.value.issuedByMemberId
|
|
1733
|
-
&& item.value.idempotencyKey === invitation.value.idempotencyKey
|
|
1734
|
-
&& item.value.requestFingerprint === invitation.value.requestFingerprint));
|
|
1758
|
+
const tombstone = secretTombstonesByIdentity.get(`createProjectInvitation:${invitation.value.issuedByMemberId}:${invitation.value.idempotencyKey}:${invitation.value.requestFingerprint}`);
|
|
1735
1759
|
if (!members.has(invitation.value.issuedByMemberId)
|
|
1736
1760
|
|| (envelope === undefined) === (tombstone === undefined)
|
|
1737
1761
|
|| (tombstone !== undefined
|
|
@@ -1752,10 +1776,7 @@ function validateContinuity(records) {
|
|
|
1752
1776
|
values.push(override);
|
|
1753
1777
|
overridesByMember.set(identity, values);
|
|
1754
1778
|
const envelope = claimOverrideEnvelopes.get(`${identity}:${override.value.claimGeneration}`);
|
|
1755
|
-
const tombstone =
|
|
1756
|
-
&& item.value.actorMemberId === override.value.managerMemberId
|
|
1757
|
-
&& item.value.idempotencyKey === override.value.idempotencyKey
|
|
1758
|
-
&& item.value.requestFingerprint === override.value.requestFingerprint));
|
|
1779
|
+
const tombstone = secretTombstonesByIdentity.get(`reissueTransferredMembershipClaim:${override.value.managerMemberId}:${override.value.idempotencyKey}:${override.value.requestFingerprint}`);
|
|
1759
1780
|
if (!members.has(override.value.memberId)
|
|
1760
1781
|
|| !members.has(override.value.managerMemberId)
|
|
1761
1782
|
|| (envelope === undefined) === (tombstone === undefined)
|
|
@@ -1810,9 +1831,7 @@ function validateContinuity(records) {
|
|
|
1810
1831
|
throw invalidPayload('records');
|
|
1811
1832
|
}
|
|
1812
1833
|
for (const envelope of claimOverrideEnvelopes.values()) {
|
|
1813
|
-
if (!
|
|
1814
|
-
&& item.value.memberId === envelope.value.memberId
|
|
1815
|
-
&& item.value.claimGeneration === envelope.value.claimGeneration)))
|
|
1834
|
+
if (!claimOverrideRecordIds.has(envelope.recordId))
|
|
1816
1835
|
throw invalidPayload('records');
|
|
1817
1836
|
}
|
|
1818
1837
|
const currentOffers = managerOffers.filter(item => (item.value.state === 'offered' || item.value.state === 'acknowledged'));
|
|
@@ -1825,26 +1844,14 @@ function validateContinuity(records) {
|
|
|
1825
1844
|
!== currentOffers.length)
|
|
1826
1845
|
throw invalidPayload('records');
|
|
1827
1846
|
for (const tombstone of secretReplayTombstones) {
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
&& item.value.idempotencyKey === tombstone.value.idempotencyKey
|
|
1831
|
-
&& invitationEnvelopes.has(item.value.invitationId)))
|
|
1832
|
-
: claimOverrides.some(item => (item.value.managerMemberId === tombstone.value.actorMemberId
|
|
1833
|
-
&& item.value.idempotencyKey === tombstone.value.idempotencyKey
|
|
1834
|
-
&& claimOverrideEnvelopes.has(`${item.value.transferId}:${item.value.memberId}:${item.value.claimGeneration}`)));
|
|
1835
|
-
if (!members.has(tombstone.value.actorMemberId) || liveSecretRecord) {
|
|
1847
|
+
if (!members.has(tombstone.value.actorMemberId)
|
|
1848
|
+
|| liveSecretIdentities.has(tombstone.recordId)) {
|
|
1836
1849
|
throw invalidPayload('records');
|
|
1837
1850
|
}
|
|
1838
1851
|
}
|
|
1839
1852
|
for (const tombstone of membershipIdempotencyTombstones) {
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
&& item.value.operation === tombstone.value.operation
|
|
1843
|
-
&& item.value.idempotencyKey === tombstone.value.idempotencyKey));
|
|
1844
|
-
const exactOffer = tombstone.value.operation === 'createManagerResponsibilityOffer'
|
|
1845
|
-
&& managerOffers.some(item => (item.value.sourceManagerMemberId === tombstone.value.actorMemberId
|
|
1846
|
-
&& item.value.idempotencyKey === tombstone.value.idempotencyKey));
|
|
1847
|
-
if (!members.has(tombstone.value.actorMemberId) || exactResult || exactOffer) {
|
|
1853
|
+
if (!members.has(tombstone.value.actorMemberId)
|
|
1854
|
+
|| liveIdempotencyIdentities.has(tombstone.recordId)) {
|
|
1848
1855
|
throw invalidPayload('records');
|
|
1849
1856
|
}
|
|
1850
1857
|
}
|
|
@@ -1901,18 +1908,14 @@ function validateContinuity(records) {
|
|
|
1901
1908
|
const lifecycle = lifecycles.get(receipt.transferId);
|
|
1902
1909
|
const terminalPrincipal = terminalPrincipals.get(identity);
|
|
1903
1910
|
const lanToCloud = recovery?.value.sourceAuthority.kind === 'lan';
|
|
1904
|
-
const
|
|
1905
|
-
&& item.value.memberId === receipt.memberId
|
|
1906
|
-
&& item.value.state === 'redeemed'
|
|
1907
|
-
&& item.value.claimSha256 === receipt.claimSha256
|
|
1908
|
-
&& item.value.redemptionReceiptId === receipt.receiptId));
|
|
1911
|
+
const hasRedeemedOverride = redeemedOverrideIdentities.has(`${receipt.transferId}:${receipt.memberId}:${receipt.claimSha256}:${receipt.receiptId}`);
|
|
1909
1912
|
const matchesSourceClaim = claim?.value.state === 'redeemed'
|
|
1910
1913
|
&& claim.value.claimSha256 === receipt.claimSha256
|
|
1911
1914
|
&& claim.value.checkpointSha256 === receipt.checkpointSha256
|
|
1912
1915
|
&& claim.value.operationIntentId === receipt.operationIntentId
|
|
1913
1916
|
&& claim.value.redemptionReceiptId === receipt.receiptId;
|
|
1914
1917
|
const matchesOverride = claim !== undefined
|
|
1915
|
-
&&
|
|
1918
|
+
&& hasRedeemedOverride
|
|
1916
1919
|
&& claim.value.checkpointSha256 === receipt.checkpointSha256;
|
|
1917
1920
|
if (recovery === undefined
|
|
1918
1921
|
|| lifecycle === undefined
|
|
@@ -1932,7 +1935,8 @@ function validateContinuity(records) {
|
|
|
1932
1935
|
}
|
|
1933
1936
|
if (item.kind === 'terminal-principal') {
|
|
1934
1937
|
const terminal = terminalResponders.get(item.value.operationId);
|
|
1935
|
-
const
|
|
1938
|
+
const terminalMemberIndex = terminalMembers.get(item.value.operationId);
|
|
1939
|
+
const acknowledgement = terminalMemberIndex?.acknowledgements.get(item.value.memberId);
|
|
1936
1940
|
const expectedOperationKind = terminal?.value.operation === 'getProjectAuthorityTransfer'
|
|
1937
1941
|
? 'authority-transfer'
|
|
1938
1942
|
: terminal?.value.operation === 'retireProject'
|
|
@@ -1941,7 +1945,7 @@ function validateContinuity(records) {
|
|
|
1941
1945
|
if (!members.has(item.value.memberId)
|
|
1942
1946
|
|| terminal === undefined
|
|
1943
1947
|
|| expectedOperationKind !== item.value.operationKind
|
|
1944
|
-
|| !
|
|
1948
|
+
|| !terminalMemberIndex?.eligibleMemberIds.has(item.value.memberId)
|
|
1945
1949
|
|| (item.value.acknowledgedAt === null) !== (acknowledgement === undefined)
|
|
1946
1950
|
|| (acknowledgement !== undefined && (acknowledgement.acknowledgedAt !== item.value.acknowledgedAt
|
|
1947
1951
|
|| acknowledgement.principalId !== item.value.principalId))
|
|
@@ -2097,8 +2101,8 @@ function decodeCollabProjectBackupCheckpointCoordinationNdjson(value) {
|
|
|
2097
2101
|
}
|
|
2098
2102
|
function encodeCollabProjectBackupCheckpointCoordinationNdjson(records) {
|
|
2099
2103
|
const value = records.map(item => JSON.stringify(item)).join('\n') + '\n';
|
|
2100
|
-
|
|
2101
|
-
|
|
2104
|
+
decodeCollabProjectBackupCheckpointCoordinationNdjson(value);
|
|
2105
|
+
return value;
|
|
2102
2106
|
}
|
|
2103
2107
|
function validateCollabProjectBackupCheckpointConsistency(manifest, records) {
|
|
2104
2108
|
const decodedManifest = decodeCollabProjectBackupCheckpointManifest(manifest);
|
|
@@ -939,9 +939,10 @@ function terminalResponderRecord(source, recordId, revision, deferPrincipals) {
|
|
|
939
939
|
: token(acknowledgement, 'principalId'),
|
|
940
940
|
};
|
|
941
941
|
});
|
|
942
|
+
const eligibleMemberIdSet = new Set(eligibleMemberIds);
|
|
942
943
|
const acknowledgementPrincipals = new Set();
|
|
943
944
|
acknowledgements.forEach((item, index) => {
|
|
944
|
-
if (!
|
|
945
|
+
if (!eligibleMemberIdSet.has(item.memberId)
|
|
945
946
|
|| (index > 0 && acknowledgements[index - 1].memberId.localeCompare(item.memberId, 'en-US') >= 0)
|
|
946
947
|
|| (!deferPrincipals && acknowledgementPrincipals.has(item.principalId)))
|
|
947
948
|
throw invalidPayload('acknowledgements');
|
|
@@ -1313,8 +1314,8 @@ function decodeCollabProjectCheckpointCoordinationNdjson(value, profile) {
|
|
|
1313
1314
|
}
|
|
1314
1315
|
function encodeCollabProjectCheckpointCoordinationNdjson(records, profile) {
|
|
1315
1316
|
const encoded = records.map(record => JSON.stringify(record)).join('\n') + '\n';
|
|
1316
|
-
|
|
1317
|
-
|
|
1317
|
+
decodeCollabProjectCheckpointCoordinationNdjson(encoded, profile);
|
|
1318
|
+
return encoded;
|
|
1318
1319
|
}
|
|
1319
1320
|
function checkpointRecordGitOids(checkpointRecord) {
|
|
1320
1321
|
switch (checkpointRecord.kind) {
|
|
@@ -4,11 +4,26 @@ exports.parseCollabTicketReferences = parseCollabTicketReferences;
|
|
|
4
4
|
exports.scanCollabTicketReferences = scanCollabTicketReferences;
|
|
5
5
|
const CollabConstants_1 = require("./CollabConstants");
|
|
6
6
|
const CollabMarkdownProse_1 = require("./CollabMarkdownProse");
|
|
7
|
-
const CLOSING_KEYWORD_PATTERN =
|
|
7
|
+
const CLOSING_KEYWORD_PATTERN = /^(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)$/i;
|
|
8
8
|
const TICKET_REFERENCE_PATTERN = /(^|[^#0-9A-Za-z_])#([1-9][0-9]*)(?![#0-9A-Za-z_])/gm;
|
|
9
9
|
function relationKindBefore(maskedDescription, referenceOffset) {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
let wordEnd = referenceOffset;
|
|
11
|
+
while (maskedDescription[wordEnd - 1] === ' ' || maskedDescription[wordEnd - 1] === '\t') {
|
|
12
|
+
wordEnd -= 1;
|
|
13
|
+
}
|
|
14
|
+
if (maskedDescription[wordEnd - 1] === ':') {
|
|
15
|
+
wordEnd -= 1;
|
|
16
|
+
while (maskedDescription[wordEnd - 1] === ' ' || maskedDescription[wordEnd - 1] === '\t') {
|
|
17
|
+
wordEnd -= 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
let wordStart = wordEnd;
|
|
21
|
+
while (wordStart > 0 && /[A-Za-z]/.test(maskedDescription[wordStart - 1])) {
|
|
22
|
+
wordStart -= 1;
|
|
23
|
+
}
|
|
24
|
+
return CLOSING_KEYWORD_PATTERN.test(maskedDescription.slice(wordStart, wordEnd))
|
|
25
|
+
? 'resolves'
|
|
26
|
+
: 'references';
|
|
12
27
|
}
|
|
13
28
|
function parseCollabTicketReferences(description) {
|
|
14
29
|
if (new TextEncoder().encode(description).byteLength >
|
|
@@ -3,7 +3,7 @@ import { COLLAB_CONTROL_OPERATION_CODECS, } from './CollabControlOperationCodecs
|
|
|
3
3
|
import { COLLAB_ERROR_CODES, CollabError, sanitizeCollabDiagnosticContext, } from './CollabError.mjs';
|
|
4
4
|
import { isCollabOpaqueId, isCollabProjectId, } from './CollabValidation.mjs';
|
|
5
5
|
import { COLLAB_CHECKPOINT_ARTIFACT_LIMITS, COLLAB_PROJECT_CHECKPOINT_ARTIFACTS, } from './CollabProjectCheckpoint.mjs';
|
|
6
|
-
export const COLLAB_CLOUD_BINDING_VERSION =
|
|
6
|
+
export const COLLAB_CLOUD_BINDING_VERSION = 5;
|
|
7
7
|
export const COLLAB_CLOUD_CAPABILITY_DOCUMENT_SCHEMA_VERSION = 2;
|
|
8
8
|
export const COLLAB_CLOUD_CAPABILITIES = Object.freeze([
|
|
9
9
|
'accept',
|
|
@@ -168,7 +168,7 @@ export function collabCloudProjectOperationRoute(projectId, operation) {
|
|
|
168
168
|
assertProjectId(projectId);
|
|
169
169
|
if (!isCloudJsonOperation(operation))
|
|
170
170
|
invalidRoute();
|
|
171
|
-
return route('POST', `/
|
|
171
|
+
return route('POST', `/v5/projects/${projectId}/operations/${operation}`, {
|
|
172
172
|
kind: 'project-operation',
|
|
173
173
|
operation,
|
|
174
174
|
projectId,
|
|
@@ -178,7 +178,7 @@ export function collabCloudProjectEventsRoute(projectId, afterSequence) {
|
|
|
178
178
|
assertProjectId(projectId);
|
|
179
179
|
if (!Number.isSafeInteger(afterSequence) || afterSequence < 0)
|
|
180
180
|
invalidRoute();
|
|
181
|
-
return route('GET', `/
|
|
181
|
+
return route('GET', `/v5/projects/${projectId}/events?afterSequence=${afterSequence}`, {
|
|
182
182
|
afterSequence,
|
|
183
183
|
kind: 'project-events',
|
|
184
184
|
projectId,
|
|
@@ -189,11 +189,11 @@ export function collabCloudGitRoute(projectId, routeKind, service) {
|
|
|
189
189
|
if (routeKind === 'info-refs') {
|
|
190
190
|
if (service !== 'git-upload-pack' && service !== 'git-receive-pack')
|
|
191
191
|
invalidRoute();
|
|
192
|
-
return route('GET', `/
|
|
192
|
+
return route('GET', `/v5/projects/${projectId}/repository.git/info/refs?service=${service}`, { kind: 'git-info-refs', projectId, service });
|
|
193
193
|
}
|
|
194
194
|
if (service !== undefined)
|
|
195
195
|
invalidRoute();
|
|
196
|
-
return route('POST', `/
|
|
196
|
+
return route('POST', `/v5/projects/${projectId}/repository.git/${routeKind}`, {
|
|
197
197
|
kind: routeKind,
|
|
198
198
|
projectId,
|
|
199
199
|
});
|
|
@@ -204,7 +204,7 @@ export function collabCloudAuthorityTransferArtifactRoute(projectId, transferId,
|
|
|
204
204
|
if (direction !== 'download' && direction !== 'upload'
|
|
205
205
|
|| !COLLAB_PROJECT_CHECKPOINT_ARTIFACTS_SET.has(artifact))
|
|
206
206
|
invalidRoute();
|
|
207
|
-
return route(direction === 'upload' ? 'PUT' : 'GET', `/
|
|
207
|
+
return route(direction === 'upload' ? 'PUT' : 'GET', `/v5/projects/${projectId}/authority-transfers/${transferId}/checkpoint/${artifact}`, {
|
|
208
208
|
artifact,
|
|
209
209
|
direction,
|
|
210
210
|
kind: 'authority-transfer-artifact',
|
|
@@ -217,7 +217,7 @@ export function collabCloudProjectCheckpointExportArtifactRoute(projectId, expor
|
|
|
217
217
|
assertAttemptId(exportId);
|
|
218
218
|
if (!COLLAB_PROJECT_CHECKPOINT_ARTIFACTS_SET.has(artifact))
|
|
219
219
|
invalidRoute();
|
|
220
|
-
return route('GET', `/
|
|
220
|
+
return route('GET', `/v5/projects/${projectId}/checkpoint-exports/${exportId}/checkpoint/${artifact}`, {
|
|
221
221
|
artifact,
|
|
222
222
|
exportId,
|
|
223
223
|
kind: 'project-checkpoint-export-artifact',
|
|
@@ -229,7 +229,7 @@ export function collabCloudProjectCheckpointExportRoute(projectId, exportId, ope
|
|
|
229
229
|
assertAttemptId(exportId);
|
|
230
230
|
if (operation !== 'begin' && operation !== 'status')
|
|
231
231
|
invalidRoute();
|
|
232
|
-
return route(operation === 'begin' ? 'POST' : 'GET', `/
|
|
232
|
+
return route(operation === 'begin' ? 'POST' : 'GET', `/v5/projects/${projectId}/checkpoint-exports/${exportId}`, { exportId, kind: 'project-checkpoint-export', operation, projectId });
|
|
233
233
|
}
|
|
234
234
|
export function decodeCollabCloudProjectCheckpointExportStatus(value) {
|
|
235
235
|
const source = exactRecord(value, 'checkpointExport', [
|
|
@@ -267,7 +267,7 @@ export function decodeCollabCloudProjectCheckpointExportStatus(value) {
|
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
269
|
export function collabDevelopmentBootstrapRoute(operation, attemptId) {
|
|
270
|
-
const base = '/
|
|
270
|
+
const base = '/v5/development/bootstrap/attempts';
|
|
271
271
|
if (operation === 'beginDevelopmentBootstrap') {
|
|
272
272
|
if (attemptId !== undefined)
|
|
273
273
|
invalidRoute();
|
|
@@ -326,7 +326,7 @@ export function matchCollabCloudRoute(method, target) {
|
|
|
326
326
|
&& url.pathname === '/collab/capabilities'
|
|
327
327
|
&& exactQuery(url, []))
|
|
328
328
|
return { kind: 'capabilities' };
|
|
329
|
-
if (segments[0] === '
|
|
329
|
+
if (segments[0] === 'v5'
|
|
330
330
|
&& segments[1] === 'projects'
|
|
331
331
|
&& isCollabProjectId(segments[2])) {
|
|
332
332
|
const projectId = segments[2];
|
|
@@ -405,7 +405,7 @@ export function matchCollabCloudRoute(method, target) {
|
|
|
405
405
|
&& exactQuery(url, []))
|
|
406
406
|
return { kind: segments[4], projectId };
|
|
407
407
|
}
|
|
408
|
-
if (segments[0] !== '
|
|
408
|
+
if (segments[0] !== 'v5'
|
|
409
409
|
|| segments[1] !== 'development'
|
|
410
410
|
|| segments[2] !== 'bootstrap'
|
|
411
411
|
|| segments[3] !== 'attempts'
|
|
@@ -513,21 +513,32 @@ export function decodeCollabCloudSuccessEnvelope(value) {
|
|
|
513
513
|
requestId: source.requestId,
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
|
-
export function collabCloudErrorEnvelope(requestId, error) {
|
|
516
|
+
export function collabCloudErrorEnvelope(requestId, error, mutationOutcome) {
|
|
517
517
|
if (!isCollabOpaqueId(requestId))
|
|
518
518
|
throw invalidPayload('requestId');
|
|
519
|
+
if (mutationOutcome !== undefined && mutationOutcome !== 'rejected') {
|
|
520
|
+
throw invalidPayload('mutationOutcome');
|
|
521
|
+
}
|
|
519
522
|
return Object.freeze({
|
|
520
523
|
error: Object.freeze({
|
|
521
524
|
code: error.code,
|
|
522
525
|
recoveryActions: Object.freeze([...error.recoveryActions]),
|
|
523
526
|
safeContext: error.safeContext,
|
|
524
527
|
}),
|
|
528
|
+
...(mutationOutcome === undefined ? {} : { mutationOutcome }),
|
|
525
529
|
protocolVersion: COLLAB_PROTOCOL_VERSION,
|
|
526
530
|
requestId,
|
|
527
531
|
});
|
|
528
532
|
}
|
|
529
533
|
export function decodeCollabCloudErrorEnvelope(value) {
|
|
530
|
-
const source =
|
|
534
|
+
const source = record(value, 'envelope');
|
|
535
|
+
const hasOutcome = Object.hasOwn(source, 'mutationOutcome');
|
|
536
|
+
if (!hasExactKeys(source, hasOutcome
|
|
537
|
+
? ['error', 'mutationOutcome', 'protocolVersion', 'requestId']
|
|
538
|
+
: ['error', 'protocolVersion', 'requestId']))
|
|
539
|
+
throw invalidPayload('envelope');
|
|
540
|
+
if (hasOutcome && source.mutationOutcome !== 'rejected')
|
|
541
|
+
throw invalidPayload('mutationOutcome');
|
|
531
542
|
const wireError = exactRecord(source.error, 'error', [
|
|
532
543
|
'code',
|
|
533
544
|
'recoveryActions',
|
|
@@ -553,6 +564,7 @@ export function decodeCollabCloudErrorEnvelope(value) {
|
|
|
553
564
|
]),
|
|
554
565
|
safeContext,
|
|
555
566
|
}),
|
|
567
|
+
...(hasOutcome ? { mutationOutcome: 'rejected' } : {}),
|
|
556
568
|
protocolVersion: COLLAB_PROTOCOL_VERSION,
|
|
557
569
|
requestId: source.requestId,
|
|
558
570
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { maskCollabMarkdownProse } from './CollabMarkdownProse.mjs';
|
|
2
|
-
const
|
|
2
|
+
const MENTION_PRECEDING_CHARACTER = /[\p{L}\p{N}_@-]$/u;
|
|
3
|
+
const MENTION_FOLLOWING_CHARACTER = /^[\p{L}\p{N}_@-]/u;
|
|
3
4
|
export function parseCollabMemberMentions(markdown, targets) {
|
|
4
5
|
const candidates = mentionCandidates(targets);
|
|
5
6
|
if (candidates.length === 0)
|
|
@@ -12,14 +13,15 @@ export function parseCollabMemberMentions(markdown, targets) {
|
|
|
12
13
|
if (mentionStart < 0)
|
|
13
14
|
break;
|
|
14
15
|
searchFrom = mentionStart + 1;
|
|
15
|
-
const preceding = prose
|
|
16
|
-
if (
|
|
16
|
+
const preceding = prose.slice(Math.max(0, mentionStart - 2), mentionStart);
|
|
17
|
+
if (MENTION_PRECEDING_CHARACTER.test(preceding))
|
|
17
18
|
continue;
|
|
18
19
|
const candidate = candidates.find(entry => {
|
|
19
20
|
if (!prose.startsWith(entry.name, mentionStart + 1))
|
|
20
21
|
return false;
|
|
21
|
-
const
|
|
22
|
-
|
|
22
|
+
const followingOffset = mentionStart + entry.name.length + 1;
|
|
23
|
+
const following = prose.slice(followingOffset, followingOffset + 2);
|
|
24
|
+
return !MENTION_FOLLOWING_CHARACTER.test(following);
|
|
23
25
|
});
|
|
24
26
|
if (!candidate)
|
|
25
27
|
continue;
|
|
@@ -1374,6 +1374,13 @@ function validateContinuity(records) {
|
|
|
1374
1374
|
const terminalResponders = new Map(records
|
|
1375
1375
|
.filter((item) => (item.kind === 'terminal-responder'))
|
|
1376
1376
|
.map(item => [item.value.operationId, item]));
|
|
1377
|
+
const terminalMembers = new Map([...terminalResponders].map(([operationId, terminal]) => [
|
|
1378
|
+
operationId,
|
|
1379
|
+
{
|
|
1380
|
+
acknowledgements: new Map(terminal.value.acknowledgements.map(item => [item.memberId, item])),
|
|
1381
|
+
eligibleMemberIds: new Set(terminal.value.eligibleMemberIds),
|
|
1382
|
+
},
|
|
1383
|
+
]));
|
|
1377
1384
|
const terminalPrincipals = new Map(records
|
|
1378
1385
|
.filter((item) => (item.kind === 'terminal-principal'))
|
|
1379
1386
|
.map(item => [`${item.value.operationId}:${item.value.memberId}`, item]));
|
|
@@ -1390,6 +1397,9 @@ function validateContinuity(records) {
|
|
|
1390
1397
|
.filter((item) => (item.kind === 'protected-invitation-envelope'))
|
|
1391
1398
|
.map(item => [item.value.invitationId, item]));
|
|
1392
1399
|
const claimOverrides = records.filter((item) => (item.kind === 'transferred-membership-claim-override'));
|
|
1400
|
+
const redeemedOverrideIdentities = new Set(claimOverrides
|
|
1401
|
+
.filter(item => item.value.state === 'redeemed')
|
|
1402
|
+
.map(item => (`${item.value.transferId}:${item.value.memberId}:${item.value.claimSha256}:${item.value.redemptionReceiptId}`)));
|
|
1393
1403
|
const claimOverrideEnvelopes = new Map(records
|
|
1394
1404
|
.filter((item) => (item.kind === 'protected-claim-override-envelope'))
|
|
1395
1405
|
.map(item => [
|
|
@@ -1402,6 +1412,28 @@ function validateContinuity(records) {
|
|
|
1402
1412
|
.filter((item) => (item.kind === 'project-membership-recovery'))
|
|
1403
1413
|
.map(item => [item.value.operationId, item]));
|
|
1404
1414
|
const secretReplayTombstones = records.filter((item) => (item.kind === 'secret-replay-tombstone'));
|
|
1415
|
+
const secretTombstonesByIdentity = new Map(secretReplayTombstones.map(item => [
|
|
1416
|
+
`${item.recordId}:${item.value.requestFingerprint}`,
|
|
1417
|
+
item,
|
|
1418
|
+
]));
|
|
1419
|
+
const liveSecretIdentities = new Set();
|
|
1420
|
+
for (const invitation of invitations.values()) {
|
|
1421
|
+
if (invitationEnvelopes.has(invitation.value.invitationId)) {
|
|
1422
|
+
liveSecretIdentities.add(`createProjectInvitation:${invitation.value.issuedByMemberId}:${invitation.value.idempotencyKey}`);
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
for (const override of claimOverrides) {
|
|
1426
|
+
if (claimOverrideEnvelopes.has(override.recordId)) {
|
|
1427
|
+
liveSecretIdentities.add(`reissueTransferredMembershipClaim:${override.value.managerMemberId}:${override.value.idempotencyKey}`);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
const liveIdempotencyIdentities = new Set(records
|
|
1431
|
+
.filter(item => item.kind === 'idempotency-result')
|
|
1432
|
+
.map(item => `${item.value.operation}:${item.value.memberId}:${item.value.idempotencyKey}`));
|
|
1433
|
+
for (const offer of managerOffers) {
|
|
1434
|
+
liveIdempotencyIdentities.add(`createManagerResponsibilityOffer:${offer.value.sourceManagerMemberId}:${offer.value.idempotencyKey}`);
|
|
1435
|
+
}
|
|
1436
|
+
const claimOverrideRecordIds = new Set(claimOverrides.map(item => item.recordId));
|
|
1405
1437
|
const nonterminalLifecycles = [...lifecycles.values()].filter(item => (item.value.state === 'active' || item.value.state === 'recovery-required'));
|
|
1406
1438
|
if (nonterminalLifecycles.length > 1
|
|
1407
1439
|
|| principalBindingRecords.some(item => (memberRecords.get(item.value.memberId)?.value.status !== 'active'))
|
|
@@ -1654,13 +1686,8 @@ function validateContinuity(records) {
|
|
|
1654
1686
|
const recovery = recoveries.get(claim.value.transferId);
|
|
1655
1687
|
const member = memberRecords.get(claim.value.memberId);
|
|
1656
1688
|
const redemptionReceipt = redemptionReceipts.get(`${claim.value.transferId}:${claim.value.memberId}`);
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1659
|
-
: claimOverrides.find(item => (item.value.transferId === claim.value.transferId
|
|
1660
|
-
&& item.value.memberId === claim.value.memberId
|
|
1661
|
-
&& item.value.state === 'redeemed'
|
|
1662
|
-
&& item.value.claimSha256 === redemptionReceipt.value.receipt.claimSha256
|
|
1663
|
-
&& item.value.redemptionReceiptId === redemptionReceipt.value.receipt.receiptId));
|
|
1689
|
+
const hasRedeemedOverride = redemptionReceipt !== undefined
|
|
1690
|
+
&& redeemedOverrideIdentities.has(`${claim.value.transferId}:${claim.value.memberId}:${redemptionReceipt.value.receipt.claimSha256}:${redemptionReceipt.value.receipt.receiptId}`);
|
|
1664
1691
|
if (member?.value.status !== 'active'
|
|
1665
1692
|
|| recovery === undefined
|
|
1666
1693
|
|| Date.parse(member.value.createdAt) > Date.parse(recovery.value.createdAt)
|
|
@@ -1674,8 +1701,8 @@ function validateContinuity(records) {
|
|
|
1674
1701
|
|| (claim.value.state === 'redeemed' && redemptionReceipt === undefined)
|
|
1675
1702
|
|| (redemptionReceipt !== undefined
|
|
1676
1703
|
&& claim.value.state !== 'redeemed'
|
|
1677
|
-
&&
|
|
1678
|
-
|| (claim.value.state === 'redeemed' &&
|
|
1704
|
+
&& !hasRedeemedOverride)
|
|
1705
|
+
|| (claim.value.state === 'redeemed' && hasRedeemedOverride)) {
|
|
1679
1706
|
throw invalidPayload('records');
|
|
1680
1707
|
}
|
|
1681
1708
|
}
|
|
@@ -1718,10 +1745,7 @@ function validateContinuity(records) {
|
|
|
1718
1745
|
}
|
|
1719
1746
|
for (const invitation of invitations.values()) {
|
|
1720
1747
|
const envelope = invitationEnvelopes.get(invitation.value.invitationId);
|
|
1721
|
-
const tombstone =
|
|
1722
|
-
&& item.value.actorMemberId === invitation.value.issuedByMemberId
|
|
1723
|
-
&& item.value.idempotencyKey === invitation.value.idempotencyKey
|
|
1724
|
-
&& item.value.requestFingerprint === invitation.value.requestFingerprint));
|
|
1748
|
+
const tombstone = secretTombstonesByIdentity.get(`createProjectInvitation:${invitation.value.issuedByMemberId}:${invitation.value.idempotencyKey}:${invitation.value.requestFingerprint}`);
|
|
1725
1749
|
if (!members.has(invitation.value.issuedByMemberId)
|
|
1726
1750
|
|| (envelope === undefined) === (tombstone === undefined)
|
|
1727
1751
|
|| (tombstone !== undefined
|
|
@@ -1742,10 +1766,7 @@ function validateContinuity(records) {
|
|
|
1742
1766
|
values.push(override);
|
|
1743
1767
|
overridesByMember.set(identity, values);
|
|
1744
1768
|
const envelope = claimOverrideEnvelopes.get(`${identity}:${override.value.claimGeneration}`);
|
|
1745
|
-
const tombstone =
|
|
1746
|
-
&& item.value.actorMemberId === override.value.managerMemberId
|
|
1747
|
-
&& item.value.idempotencyKey === override.value.idempotencyKey
|
|
1748
|
-
&& item.value.requestFingerprint === override.value.requestFingerprint));
|
|
1769
|
+
const tombstone = secretTombstonesByIdentity.get(`reissueTransferredMembershipClaim:${override.value.managerMemberId}:${override.value.idempotencyKey}:${override.value.requestFingerprint}`);
|
|
1749
1770
|
if (!members.has(override.value.memberId)
|
|
1750
1771
|
|| !members.has(override.value.managerMemberId)
|
|
1751
1772
|
|| (envelope === undefined) === (tombstone === undefined)
|
|
@@ -1800,9 +1821,7 @@ function validateContinuity(records) {
|
|
|
1800
1821
|
throw invalidPayload('records');
|
|
1801
1822
|
}
|
|
1802
1823
|
for (const envelope of claimOverrideEnvelopes.values()) {
|
|
1803
|
-
if (!
|
|
1804
|
-
&& item.value.memberId === envelope.value.memberId
|
|
1805
|
-
&& item.value.claimGeneration === envelope.value.claimGeneration)))
|
|
1824
|
+
if (!claimOverrideRecordIds.has(envelope.recordId))
|
|
1806
1825
|
throw invalidPayload('records');
|
|
1807
1826
|
}
|
|
1808
1827
|
const currentOffers = managerOffers.filter(item => (item.value.state === 'offered' || item.value.state === 'acknowledged'));
|
|
@@ -1815,26 +1834,14 @@ function validateContinuity(records) {
|
|
|
1815
1834
|
!== currentOffers.length)
|
|
1816
1835
|
throw invalidPayload('records');
|
|
1817
1836
|
for (const tombstone of secretReplayTombstones) {
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
&& item.value.idempotencyKey === tombstone.value.idempotencyKey
|
|
1821
|
-
&& invitationEnvelopes.has(item.value.invitationId)))
|
|
1822
|
-
: claimOverrides.some(item => (item.value.managerMemberId === tombstone.value.actorMemberId
|
|
1823
|
-
&& item.value.idempotencyKey === tombstone.value.idempotencyKey
|
|
1824
|
-
&& claimOverrideEnvelopes.has(`${item.value.transferId}:${item.value.memberId}:${item.value.claimGeneration}`)));
|
|
1825
|
-
if (!members.has(tombstone.value.actorMemberId) || liveSecretRecord) {
|
|
1837
|
+
if (!members.has(tombstone.value.actorMemberId)
|
|
1838
|
+
|| liveSecretIdentities.has(tombstone.recordId)) {
|
|
1826
1839
|
throw invalidPayload('records');
|
|
1827
1840
|
}
|
|
1828
1841
|
}
|
|
1829
1842
|
for (const tombstone of membershipIdempotencyTombstones) {
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
&& item.value.operation === tombstone.value.operation
|
|
1833
|
-
&& item.value.idempotencyKey === tombstone.value.idempotencyKey));
|
|
1834
|
-
const exactOffer = tombstone.value.operation === 'createManagerResponsibilityOffer'
|
|
1835
|
-
&& managerOffers.some(item => (item.value.sourceManagerMemberId === tombstone.value.actorMemberId
|
|
1836
|
-
&& item.value.idempotencyKey === tombstone.value.idempotencyKey));
|
|
1837
|
-
if (!members.has(tombstone.value.actorMemberId) || exactResult || exactOffer) {
|
|
1843
|
+
if (!members.has(tombstone.value.actorMemberId)
|
|
1844
|
+
|| liveIdempotencyIdentities.has(tombstone.recordId)) {
|
|
1838
1845
|
throw invalidPayload('records');
|
|
1839
1846
|
}
|
|
1840
1847
|
}
|
|
@@ -1891,18 +1898,14 @@ function validateContinuity(records) {
|
|
|
1891
1898
|
const lifecycle = lifecycles.get(receipt.transferId);
|
|
1892
1899
|
const terminalPrincipal = terminalPrincipals.get(identity);
|
|
1893
1900
|
const lanToCloud = recovery?.value.sourceAuthority.kind === 'lan';
|
|
1894
|
-
const
|
|
1895
|
-
&& item.value.memberId === receipt.memberId
|
|
1896
|
-
&& item.value.state === 'redeemed'
|
|
1897
|
-
&& item.value.claimSha256 === receipt.claimSha256
|
|
1898
|
-
&& item.value.redemptionReceiptId === receipt.receiptId));
|
|
1901
|
+
const hasRedeemedOverride = redeemedOverrideIdentities.has(`${receipt.transferId}:${receipt.memberId}:${receipt.claimSha256}:${receipt.receiptId}`);
|
|
1899
1902
|
const matchesSourceClaim = claim?.value.state === 'redeemed'
|
|
1900
1903
|
&& claim.value.claimSha256 === receipt.claimSha256
|
|
1901
1904
|
&& claim.value.checkpointSha256 === receipt.checkpointSha256
|
|
1902
1905
|
&& claim.value.operationIntentId === receipt.operationIntentId
|
|
1903
1906
|
&& claim.value.redemptionReceiptId === receipt.receiptId;
|
|
1904
1907
|
const matchesOverride = claim !== undefined
|
|
1905
|
-
&&
|
|
1908
|
+
&& hasRedeemedOverride
|
|
1906
1909
|
&& claim.value.checkpointSha256 === receipt.checkpointSha256;
|
|
1907
1910
|
if (recovery === undefined
|
|
1908
1911
|
|| lifecycle === undefined
|
|
@@ -1922,7 +1925,8 @@ function validateContinuity(records) {
|
|
|
1922
1925
|
}
|
|
1923
1926
|
if (item.kind === 'terminal-principal') {
|
|
1924
1927
|
const terminal = terminalResponders.get(item.value.operationId);
|
|
1925
|
-
const
|
|
1928
|
+
const terminalMemberIndex = terminalMembers.get(item.value.operationId);
|
|
1929
|
+
const acknowledgement = terminalMemberIndex?.acknowledgements.get(item.value.memberId);
|
|
1926
1930
|
const expectedOperationKind = terminal?.value.operation === 'getProjectAuthorityTransfer'
|
|
1927
1931
|
? 'authority-transfer'
|
|
1928
1932
|
: terminal?.value.operation === 'retireProject'
|
|
@@ -1931,7 +1935,7 @@ function validateContinuity(records) {
|
|
|
1931
1935
|
if (!members.has(item.value.memberId)
|
|
1932
1936
|
|| terminal === undefined
|
|
1933
1937
|
|| expectedOperationKind !== item.value.operationKind
|
|
1934
|
-
|| !
|
|
1938
|
+
|| !terminalMemberIndex?.eligibleMemberIds.has(item.value.memberId)
|
|
1935
1939
|
|| (item.value.acknowledgedAt === null) !== (acknowledgement === undefined)
|
|
1936
1940
|
|| (acknowledgement !== undefined && (acknowledgement.acknowledgedAt !== item.value.acknowledgedAt
|
|
1937
1941
|
|| acknowledgement.principalId !== item.value.principalId))
|
|
@@ -2087,8 +2091,8 @@ export function decodeCollabProjectBackupCheckpointCoordinationNdjson(value) {
|
|
|
2087
2091
|
}
|
|
2088
2092
|
export function encodeCollabProjectBackupCheckpointCoordinationNdjson(records) {
|
|
2089
2093
|
const value = records.map(item => JSON.stringify(item)).join('\n') + '\n';
|
|
2090
|
-
|
|
2091
|
-
|
|
2094
|
+
decodeCollabProjectBackupCheckpointCoordinationNdjson(value);
|
|
2095
|
+
return value;
|
|
2092
2096
|
}
|
|
2093
2097
|
export function validateCollabProjectBackupCheckpointConsistency(manifest, records) {
|
|
2094
2098
|
const decodedManifest = decodeCollabProjectBackupCheckpointManifest(manifest);
|
|
@@ -924,9 +924,10 @@ function terminalResponderRecord(source, recordId, revision, deferPrincipals) {
|
|
|
924
924
|
: token(acknowledgement, 'principalId'),
|
|
925
925
|
};
|
|
926
926
|
});
|
|
927
|
+
const eligibleMemberIdSet = new Set(eligibleMemberIds);
|
|
927
928
|
const acknowledgementPrincipals = new Set();
|
|
928
929
|
acknowledgements.forEach((item, index) => {
|
|
929
|
-
if (!
|
|
930
|
+
if (!eligibleMemberIdSet.has(item.memberId)
|
|
930
931
|
|| (index > 0 && acknowledgements[index - 1].memberId.localeCompare(item.memberId, 'en-US') >= 0)
|
|
931
932
|
|| (!deferPrincipals && acknowledgementPrincipals.has(item.principalId)))
|
|
932
933
|
throw invalidPayload('acknowledgements');
|
|
@@ -1298,8 +1299,8 @@ export function decodeCollabProjectCheckpointCoordinationNdjson(value, profile)
|
|
|
1298
1299
|
}
|
|
1299
1300
|
export function encodeCollabProjectCheckpointCoordinationNdjson(records, profile) {
|
|
1300
1301
|
const encoded = records.map(record => JSON.stringify(record)).join('\n') + '\n';
|
|
1301
|
-
|
|
1302
|
-
|
|
1302
|
+
decodeCollabProjectCheckpointCoordinationNdjson(encoded, profile);
|
|
1303
|
+
return encoded;
|
|
1303
1304
|
}
|
|
1304
1305
|
function checkpointRecordGitOids(checkpointRecord) {
|
|
1305
1306
|
switch (checkpointRecord.kind) {
|
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
import { COLLAB_LIMITS } from './CollabConstants.mjs';
|
|
2
2
|
import { maskCollabMarkdownProse } from './CollabMarkdownProse.mjs';
|
|
3
|
-
const CLOSING_KEYWORD_PATTERN =
|
|
3
|
+
const CLOSING_KEYWORD_PATTERN = /^(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)$/i;
|
|
4
4
|
const TICKET_REFERENCE_PATTERN = /(^|[^#0-9A-Za-z_])#([1-9][0-9]*)(?![#0-9A-Za-z_])/gm;
|
|
5
5
|
function relationKindBefore(maskedDescription, referenceOffset) {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
let wordEnd = referenceOffset;
|
|
7
|
+
while (maskedDescription[wordEnd - 1] === ' ' || maskedDescription[wordEnd - 1] === '\t') {
|
|
8
|
+
wordEnd -= 1;
|
|
9
|
+
}
|
|
10
|
+
if (maskedDescription[wordEnd - 1] === ':') {
|
|
11
|
+
wordEnd -= 1;
|
|
12
|
+
while (maskedDescription[wordEnd - 1] === ' ' || maskedDescription[wordEnd - 1] === '\t') {
|
|
13
|
+
wordEnd -= 1;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
let wordStart = wordEnd;
|
|
17
|
+
while (wordStart > 0 && /[A-Za-z]/.test(maskedDescription[wordStart - 1])) {
|
|
18
|
+
wordStart -= 1;
|
|
19
|
+
}
|
|
20
|
+
return CLOSING_KEYWORD_PATTERN.test(maskedDescription.slice(wordStart, wordEnd))
|
|
21
|
+
? 'resolves'
|
|
22
|
+
: 'references';
|
|
8
23
|
}
|
|
9
24
|
export function parseCollabTicketReferences(description) {
|
|
10
25
|
if (new TextEncoder().encode(description).byteLength >
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudian-collab/protocol",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "Canonical Collab wire and Cloud binding contract for Claudian clients and servers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -39,14 +39,13 @@
|
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig.esm.json && node scripts/finalize-esm.mjs",
|
|
41
41
|
"check:compatibility": "node scripts/run-compatibility-check.mjs",
|
|
42
|
-
"check:migration-provenance": "node scripts/check-migration-provenance.mjs --verify-standalone",
|
|
43
42
|
"clean": "node scripts/clean.mjs",
|
|
44
43
|
"lint": "eslint src tests scripts",
|
|
45
44
|
"prepack": "npm run build",
|
|
46
45
|
"release:candidate": "node scripts/release-candidate.mjs --output .context/release",
|
|
47
46
|
"test": "jest && node --test tests/*.test.mjs",
|
|
48
47
|
"typecheck": "tsc --noEmit -p tsconfig.jest.json",
|
|
49
|
-
"verify": "npm run lint && npm run typecheck && npm run release:candidate && npm run test && npm run check:compatibility && npm run
|
|
48
|
+
"verify": "npm run lint && npm run typecheck && npm run release:candidate && npm run test && npm run check:compatibility && npm run verify:pack",
|
|
50
49
|
"verify:pack": "node scripts/verify-pack.mjs"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|