@claudian-collab/protocol 4.1.2 → 4.1.3

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.2`. 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.3`. 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
 
@@ -1608,18 +1608,33 @@ function validateContinuity(records) {
1608
1608
  }
1609
1609
  for (const key of keys.values()) {
1610
1610
  const recovery = recoveries.get(key.value.transferId);
1611
+ const lifecycle = lifecycles.get(key.value.transferId);
1611
1612
  const evidence = recovery?.value.sourceEvidence ?? recovery?.value.targetEvidence;
1612
1613
  const isEvidenceKey = evidence !== null
1613
1614
  && evidence !== undefined
1614
1615
  && evidence.receiptKeyId === key.value.receiptKeyId
1615
1616
  && 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;
1617
+ const effectivePhase = lifecycle?.value.state === 'recovery-required'
1618
+ ? lifecycle.value.recoveryFromPhase
1619
+ : lifecycle?.value.phase;
1620
+ const cancellationIndex = effectivePhase === null || effectivePhase === undefined
1621
+ ? undefined
1622
+ : CANCELLATION_PHASE_INDEX.get(effectivePhase);
1623
+ const normalPhaseIndex = lifecycle?.value.direction === 'cloud-to-lan'
1624
+ ? CollabAuthorityTransfer_1.COLLAB_CLOUD_TO_LAN_TRANSFER_PHASES.indexOf(effectivePhase)
1625
+ : -1;
1626
+ const isCloudSourceVerifier = recovery?.value.sourceAuthority.kind === 'cloud'
1627
+ && lifecycle?.value.direction === 'cloud-to-lan'
1628
+ && keysByTransfer.get(key.value.transferId)?.length === 2
1629
+ && (recovery.value.relinquishmentProof !== null
1630
+ || (cancellationIndex === undefined && normalPhaseIndex >= 2)
1631
+ || (cancellationIndex !== undefined
1632
+ && cancellationIndex <= 1
1633
+ && lifecycle.value.checkpointSha256 !== null));
1619
1634
  if (recovery === undefined
1620
1635
  || evidence === null
1621
1636
  || evidence === undefined
1622
- || (!isEvidenceKey && !isCloudSourceProofVerifier))
1637
+ || (!isEvidenceKey && !isCloudSourceVerifier))
1623
1638
  throw invalidPayload('records');
1624
1639
  }
1625
1640
  for (const claim of claims.values()) {
@@ -1598,18 +1598,33 @@ function validateContinuity(records) {
1598
1598
  }
1599
1599
  for (const key of keys.values()) {
1600
1600
  const recovery = recoveries.get(key.value.transferId);
1601
+ const lifecycle = lifecycles.get(key.value.transferId);
1601
1602
  const evidence = recovery?.value.sourceEvidence ?? recovery?.value.targetEvidence;
1602
1603
  const isEvidenceKey = evidence !== null
1603
1604
  && evidence !== undefined
1604
1605
  && evidence.receiptKeyId === key.value.receiptKeyId
1605
1606
  && 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;
1607
+ const effectivePhase = lifecycle?.value.state === 'recovery-required'
1608
+ ? lifecycle.value.recoveryFromPhase
1609
+ : lifecycle?.value.phase;
1610
+ const cancellationIndex = effectivePhase === null || effectivePhase === undefined
1611
+ ? undefined
1612
+ : CANCELLATION_PHASE_INDEX.get(effectivePhase);
1613
+ const normalPhaseIndex = lifecycle?.value.direction === 'cloud-to-lan'
1614
+ ? COLLAB_CLOUD_TO_LAN_TRANSFER_PHASES.indexOf(effectivePhase)
1615
+ : -1;
1616
+ const isCloudSourceVerifier = recovery?.value.sourceAuthority.kind === 'cloud'
1617
+ && lifecycle?.value.direction === 'cloud-to-lan'
1618
+ && keysByTransfer.get(key.value.transferId)?.length === 2
1619
+ && (recovery.value.relinquishmentProof !== null
1620
+ || (cancellationIndex === undefined && normalPhaseIndex >= 2)
1621
+ || (cancellationIndex !== undefined
1622
+ && cancellationIndex <= 1
1623
+ && lifecycle.value.checkpointSha256 !== null));
1609
1624
  if (recovery === undefined
1610
1625
  || evidence === null
1611
1626
  || evidence === undefined
1612
- || (!isEvidenceKey && !isCloudSourceProofVerifier))
1627
+ || (!isEvidenceKey && !isCloudSourceVerifier))
1613
1628
  throw invalidPayload('records');
1614
1629
  }
1615
1630
  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.2",
3
+ "version": "4.1.3",
4
4
  "description": "Canonical Collab wire and Cloud binding contract for Claudian clients and servers.",
5
5
  "license": "MIT",
6
6
  "repository": {