@claudian-collab/protocol 4.1.0 → 4.1.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 CHANGED
@@ -64,7 +64,7 @@ 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.0`. 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.
67
+ - **Package version** (this `package.json`): `4.1.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
68
  - **Wire version** (`COLLAB_PROTOCOL_VERSION`): currently `8`. The supported range is exactly `[8, 8]`. This is independent from Cloud binding version `4` 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
69
  - **Cloud binding version** (`COLLAB_CLOUD_BINDING_VERSION`): currently `4`. 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 v4 and wire versions before v8 are unsupported rather than translated or dual-interpreted.
70
70
 
@@ -1358,9 +1358,15 @@ function validateContinuity(records) {
1358
1358
  const recoveries = new Map(records
1359
1359
  .filter((item) => (item.kind === 'authority-transfer-recovery'))
1360
1360
  .map(item => [item.value.transferId, item]));
1361
- const keys = new Map(records
1362
- .filter((item) => (item.kind === 'transfer-receipt-key'))
1361
+ const keyRecords = records.filter((item) => (item.kind === 'transfer-receipt-key'));
1362
+ const keys = new Map(keyRecords
1363
1363
  .map(item => [`${item.value.transferId}:${item.value.receiptKeyId}`, item]));
1364
+ const keysByTransfer = new Map();
1365
+ for (const key of keyRecords) {
1366
+ const existing = keysByTransfer.get(key.value.transferId) ?? [];
1367
+ existing.push(key);
1368
+ keysByTransfer.set(key.value.transferId, existing);
1369
+ }
1364
1370
  const claimRecords = records
1365
1371
  .filter((item) => (item.kind === 'transferred-membership-claim'));
1366
1372
  const claims = new Map(claimRecords
@@ -1603,11 +1609,17 @@ function validateContinuity(records) {
1603
1609
  for (const key of keys.values()) {
1604
1610
  const recovery = recoveries.get(key.value.transferId);
1605
1611
  const evidence = recovery?.value.sourceEvidence ?? recovery?.value.targetEvidence;
1612
+ const isEvidenceKey = evidence !== null
1613
+ && evidence !== undefined
1614
+ && evidence.receiptKeyId === key.value.receiptKeyId
1615
+ && evidence.receiptPublicKey === key.value.receiptPublicKey;
1616
+ const isCloudSourceProofVerifier = recovery?.value.sourceAuthority.kind === 'cloud'
1617
+ && recovery.value.relinquishmentProof !== null
1618
+ && keysByTransfer.get(key.value.transferId)?.length === 2;
1606
1619
  if (recovery === undefined
1607
1620
  || evidence === null
1608
1621
  || evidence === undefined
1609
- || evidence.receiptKeyId !== key.value.receiptKeyId
1610
- || evidence.receiptPublicKey !== key.value.receiptPublicKey)
1622
+ || (!isEvidenceKey && !isCloudSourceProofVerifier))
1611
1623
  throw invalidPayload('records');
1612
1624
  }
1613
1625
  for (const claim of claims.values()) {
@@ -1348,9 +1348,15 @@ function validateContinuity(records) {
1348
1348
  const recoveries = new Map(records
1349
1349
  .filter((item) => (item.kind === 'authority-transfer-recovery'))
1350
1350
  .map(item => [item.value.transferId, item]));
1351
- const keys = new Map(records
1352
- .filter((item) => (item.kind === 'transfer-receipt-key'))
1351
+ const keyRecords = records.filter((item) => (item.kind === 'transfer-receipt-key'));
1352
+ const keys = new Map(keyRecords
1353
1353
  .map(item => [`${item.value.transferId}:${item.value.receiptKeyId}`, item]));
1354
+ const keysByTransfer = new Map();
1355
+ for (const key of keyRecords) {
1356
+ const existing = keysByTransfer.get(key.value.transferId) ?? [];
1357
+ existing.push(key);
1358
+ keysByTransfer.set(key.value.transferId, existing);
1359
+ }
1354
1360
  const claimRecords = records
1355
1361
  .filter((item) => (item.kind === 'transferred-membership-claim'));
1356
1362
  const claims = new Map(claimRecords
@@ -1593,11 +1599,17 @@ function validateContinuity(records) {
1593
1599
  for (const key of keys.values()) {
1594
1600
  const recovery = recoveries.get(key.value.transferId);
1595
1601
  const evidence = recovery?.value.sourceEvidence ?? recovery?.value.targetEvidence;
1602
+ const isEvidenceKey = evidence !== null
1603
+ && evidence !== undefined
1604
+ && evidence.receiptKeyId === key.value.receiptKeyId
1605
+ && evidence.receiptPublicKey === key.value.receiptPublicKey;
1606
+ const isCloudSourceProofVerifier = recovery?.value.sourceAuthority.kind === 'cloud'
1607
+ && recovery.value.relinquishmentProof !== null
1608
+ && keysByTransfer.get(key.value.transferId)?.length === 2;
1596
1609
  if (recovery === undefined
1597
1610
  || evidence === null
1598
1611
  || evidence === undefined
1599
- || evidence.receiptKeyId !== key.value.receiptKeyId
1600
- || evidence.receiptPublicKey !== key.value.receiptPublicKey)
1612
+ || (!isEvidenceKey && !isCloudSourceProofVerifier))
1601
1613
  throw invalidPayload('records');
1602
1614
  }
1603
1615
  for (const claim of claims.values()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudian-collab/protocol",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Canonical Collab wire and Cloud binding contract for Claudian clients and servers.",
5
5
  "license": "MIT",
6
6
  "repository": {