Loading
fix(r2): edit a partner's agreement in place instead of replacing it
Federation Manager now keeps one agreement per partner (oop/code/federation-manager!40): a second POST /internal/agreements gets 409 agreement-exists. fm_partners.py posted a new agreement whenever the inventory terms changed and suspended the old one, so a re-run with changed zones or terms failed. agree() now PATCHes the partner's agreement with only what differs: API types, zones (always with their terms), terms, status back to active, no end date, and a start date no later than now. With no agreement it still POSTs one. An FM from before one-per-partner may hold several; the one it applies is edited and other active ones are suspended, as before. Validation on test-op1 (FM develop + fix/zone-sync-limits), partner operator-2: - old script, changed terms: 409, playbook step fails - same terms on an agreement with an end date: updated valid_until - re-run: unchanged - added flavour: updated zone_resources; removing it again: same - suspended agreement: updated status; FM sent ZONES REMOVE then ADD, both delivered to OP-2 The testbed agreement was restored afterwards. Co-Authored-By:Claude Opus 5.5 <noreply@anthropic.com>