#32 authenticated target lease API and authoritative fencing - #101
#32 authenticated target lease API and authoritative fencing#101lost-rob0t wants to merge 58 commits into
Conversation
6e53bae to
9542055
Compare
|
RAGE/ADADR governance reconciliation (2026-08-25): this PR is still draft and currently non-mergeable at head Do not treat this as a request to weaken or discard the existing fencing regressions. The implemented RED/green evidence remains useful. Before realizing the remaining provenance/outbox architecture, reconcile |
Work in progress for #32. The branch targets canonical
master;devis not used.Implemented
/api/v1/target-leasesacquire/renew/release/get/list/revoke routes;current-target-lease-authority, carry only the server-owned lease record into dispatch envelopes, and fence before persistence/scheduling;Remaining blocker: trusted target-ingress provenance
#32 is not complete.
The production target path is still
POST /new/target/:actor->documents.ingest.target-> CouchDB durable outbox ->documents.new.target.*-> target consumer. The authenticated HTTP publish boundary creates server-owned Rabbit service-context/authorization headers, butcouchdb-process-outbox-mutationpersists the document/event payload andpublish-outbox-eventlater republishes the target event with only content type, delivery mode, and message id. By the timehandle-target/accept-target-deliveryruns, the trusted principal/service context needed bycurrent-target-lease-authorityis gone.The fenced-intent readback substrate now gives the target consumer a way to verify a server-created immutable receipt, but the receipt is not yet wired across the durable outbox path and receipt existence alone is never authority. The consumer must still resolve the current lease and require an exact receipt value match before persistence, scheduling, or publication.
Do not fix this by trusting lease/principal fields copied from the target document or arbitrary Rabbit headers. Lease id/fencing token are locators, not authority. The next coherent slice must preserve or re-establish a server-owned authenticated provenance receipt across the durable outbox boundary, or move authoritative lease resolution to an earlier authenticated acceptance boundary while preserving crash-safe target persistence/recovery semantics.
The old recovery path also still carries legacy
lease_owner/lease_expires_atfields and calls compatibilitysubmit-target; it now fails closed rather than inventing authority, but #33 still needs startup reconciliation against the real lease store.A separate Valkey preflight followed by an unconditional CouchDB/Rabbit write remains a TOCTOU race and is not an acceptable solution.