Problem
crates/peryx-ha-distributed/src/authority_transfer.rs:154 is one of the lines LLVM counts as missed under the total that #2162 enforces, and it is one of only two in the crate that no monomorphization of the enclosing function runs. It is undriven, not unreachable, and which of the two it is decides whether the fix is a test or a code change.
let sealed = receipt
.transfer_audit
.ok_or_else(|| TransferDriveError::Unsealed(id.clone()))?;
commit_transfer always submits an intent, so the arm cannot fire through the in-process path:
authority_transfer.rs:132-141 builds ControlCommand::TransferAuthority { intent: Some(TransferIntent { .. }), .. }, with no branch that leaves intent unset.
ownership.rs:395-415 returns None from seal_transfer_audit for exactly two shapes, a command that is not TransferAuthority (line 402) and a TransferAuthority whose intent is None (line 404). Neither arises from the call above.
ownership.rs:378-390 puts that sealed audit on the receipt, so a transfer resolved by the ownership state machine always carries one.
The consensus executor is the other half, and it answers differently:
consensus_runtime.rs:862-871 matches ControlCommand::TransferAuthority { authority, new_home, .. } and forwards OwnershipCommand::RecordTransfer. The .. drops intent.
- That call returns through
submit_ownership at consensus_runtime.rs:995-999, which builds its receipt with committed_receipt.
committed_receipt at consensus_runtime.rs:1094-1108 sets transfer_audit: None unconditionally.
So a commit_transfer driven through the clustered executor reaches line 154 and returns TransferDriveError::Unsealed.
The open question
What is not established here is whether that is the intended outcome. Two readings fit the code and they need different fixes:
- The clustered path is expected to answer
Unsealed, some later pass recovers the audit through recover_transfer_audits, and the line needs a test that drives commit_transfer against the consensus executor and asserts that error.
- The clustered path is supposed to return the audit its state machine sealed, and the receipt built at
consensus_runtime.rs:999 drops it. Then the line is a symptom and the fix is in the receipt, not in a test.
Reading 2 is worth checking first, because seal_transfer_audit would return None at ownership.rs:404 for the forwarded command in any case: RecordTransfer carries no intent to seal, so the audit the caller asked for cannot be built from what the executor forwards.
Required change
Decide between the two readings, then either drive the arm from a test against the consensus executor, or carry the sealed audit back onto the receipt and drive the arm that remains.
Boundary
consensus_runtime.rs:913 is the crate's other line that no monomorphization runs and is tracked separately as #2201. Every other missed line in peryx-ha-distributed is run by a different instantiation of the same function and is not a behaviour gap.
Problem
crates/peryx-ha-distributed/src/authority_transfer.rs:154is one of the lines LLVM counts as missed under the total that #2162 enforces, and it is one of only two in the crate that no monomorphization of the enclosing function runs. It is undriven, not unreachable, and which of the two it is decides whether the fix is a test or a code change.commit_transferalways submits an intent, so the arm cannot fire through the in-process path:authority_transfer.rs:132-141buildsControlCommand::TransferAuthority { intent: Some(TransferIntent { .. }), .. }, with no branch that leavesintentunset.ownership.rs:395-415returnsNonefromseal_transfer_auditfor exactly two shapes, a command that is notTransferAuthority(line 402) and aTransferAuthoritywhoseintentisNone(line 404). Neither arises from the call above.ownership.rs:378-390puts that sealed audit on the receipt, so a transfer resolved by the ownership state machine always carries one.The consensus executor is the other half, and it answers differently:
consensus_runtime.rs:862-871matchesControlCommand::TransferAuthority { authority, new_home, .. }and forwardsOwnershipCommand::RecordTransfer. The..dropsintent.submit_ownershipatconsensus_runtime.rs:995-999, which builds its receipt withcommitted_receipt.committed_receiptatconsensus_runtime.rs:1094-1108setstransfer_audit: Noneunconditionally.So a
commit_transferdriven through the clustered executor reaches line 154 and returnsTransferDriveError::Unsealed.The open question
What is not established here is whether that is the intended outcome. Two readings fit the code and they need different fixes:
Unsealed, some later pass recovers the audit throughrecover_transfer_audits, and the line needs a test that drivescommit_transferagainst the consensus executor and asserts that error.consensus_runtime.rs:999drops it. Then the line is a symptom and the fix is in the receipt, not in a test.Reading 2 is worth checking first, because
seal_transfer_auditwould returnNoneatownership.rs:404for the forwarded command in any case:RecordTransfercarries no intent to seal, so the audit the caller asked for cannot be built from what the executor forwards.Required change
Decide between the two readings, then either drive the arm from a test against the consensus executor, or carry the sealed audit back onto the receipt and drive the arm that remains.
Boundary
consensus_runtime.rs:913is the crate's other line that no monomorphization runs and is tracked separately as #2201. Every other missed line inperyx-ha-distributedis run by a different instantiation of the same function and is not a behaviour gap.