Files
DuncanandWill Pfleger fe7efd8aab fix(acp): ACK-gated sentinel lifecycle, D7 admission, NIP-AO docs
Implements the frozen ACK-waiter contract for the ask permission policy:

- Publishing→Pending→Writing/Terminal lifecycle: entry inserted as
  Publishing before publish; transitions to Pending only on relay
  OK accepted=true.  Non-accepted outcomes (Rejected, timeout at
  min(10s, expiresAt), socket failure) deny immediately (fail closed).
- Registration-before-send via register_publish_ack: background relay
  task inserts the ACK waiter before sending the EVENT frame.
- Early-decision buffering: an authorized decision arriving while still
  in Publishing is stored in early_decision and applied on admission
  with no additional round trip.
- Exactly-once terminal consumption: ack_result_rx arm, timeout
  check, and cancel path each consume the record exactly once via
  finish_permission / finish_permission_sync.
- Remove the D7 !relay_active escape hatch: admission now requires
  publisher AND byte-equal initiator==owner; missing relay context
  denies synchronously with the D7 diagnostic, zero card events.
- Store wire expiresAt once in PermissionEntry at build time;
  kind-40003 resolved edit reuses it with no recompute drift.
- Add test_pair_rejecting, test_pair_silent, test_pair_dead to
  RelayEventPublisher for the ACK lifecycle test matrix.
- Fix test compile errors: IdleTimeout(Duration), remove
  test_from_cmd_tx dependency, add allow(collapsible_match).
- NIP-AO: replace published-immediately with ACK-gated admission
  semantics including fail-closed paths and early-decision note.

Tests: 746 pass / 0 fail (cargo test -p buzz-acp)
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-08 15:56:39 -04:00
..
2026-07-21 17:16:23 +00:00