pramodmisra Claude Opus 4.8 (1M context) commited on
Commit
bcc1fcc
Β·
1 Parent(s): 405515a

Stop force-deactivating the standalone Emerging Markets agreement on boot

Browse files

Per product decision (reversal of the earlier "keep EM deactivated"): the
standalone "Emerging Markets Agreement" is now admin-owned. Removed the R6.3
self-healing block that re-set it to Inactive on every Space restart (which
undid any admin reactivation overnight), plus the related legacy
"Emerging Markets - House Standard" force-deactivation. No agreement is
force-deactivated on boot anymore; active/inactive is controlled from the
admin panel and persists. EMB stays a separate active agreement.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files changed (2) hide show
  1. OPERATIONS.md +8 -0
  2. start.py +9 -18
OPERATIONS.md CHANGED
@@ -208,6 +208,14 @@ leaves every other table untouched.)
208
  `FIXED_PAIR_AGREEMENTS` mechanism distinct from the CE/CCP-disabling locked pairs).
209
  Both Fitch producers are added to the standing-producer re-activation list so the
210
  daily refresh never deactivates them.
 
 
 
 
 
 
 
 
211
  - **NOCEA1 "No Client Executive"** β€” CE-list placeholder (0% / 0%, no email). On **CL
212
  and Bond** accounts the form replaces the "Add CE" checkbox with a required CE
213
  dropdown that defaults to NOCEA1; on all other departments the checkbox stays
 
208
  `FIXED_PAIR_AGREEMENTS` mechanism distinct from the CE/CCP-disabling locked pairs).
209
  Both Fitch producers are added to the standing-producer re-activation list so the
210
  daily refresh never deactivates them.
211
+ - **Agreement is_active is ADMIN-OWNED (2026-06-23).** start.py no longer force-
212
+ deactivates any agreement on boot. Removed: the R6.3 block that retired the
213
+ standalone **"Emerging Markets Agreement"** and the legacy "Emerging Markets -
214
+ House Standard" deactivation β€” both flipped agreements back to Inactive every
215
+ restart, undoing admin reactivations overnight. The standalone Emerging Markets
216
+ Agreement is now toggled from the admin panel like every other type and stays put.
217
+ (EMB = `Referral / Origination Fee Agreement - EMB` remains a separate active
218
+ agreement; the duplicate `… - Emerging Markets` row is left Inactive by choice.)
219
  - **NOCEA1 "No Client Executive"** β€” CE-list placeholder (0% / 0%, no email). On **CL
220
  and Bond** accounts the form replaces the "Add CE" checkbox with a required CE
221
  dropdown that defaults to NOCEA1; on all other departments the checkbox stays
start.py CHANGED
@@ -170,14 +170,10 @@ for r in deprecated_rules:
170
  if deprecated_rules:
171
  s.commit()
172
 
173
- # 2. Deactivate the obsolete combined "Emerging Markets - House Standard" agreement
174
- em_house = s.query(CommissionAgreement).filter(
175
- CommissionAgreement.name == "Emerging Markets - House Standard"
176
- ).first()
177
- if em_house and em_house.is_active:
178
- em_house.is_active = False
179
- s.commit()
180
- print(" Deactivated 'Emerging Markets - House Standard' (replaced by 'House Standard Agreement').")
181
 
182
  # 3. Ensure standalone "House Standard Agreement" exists (P1 hidden, routes to Bella)
183
  house_std = s.query(CommissionAgreement).filter(
@@ -525,16 +521,11 @@ if referral:
525
  s.commit()
526
  print(" Repaired Middle Market referral β€” restored Originating Producer (P2) tiers.")
527
 
528
- # R6.3 β€” Retire the standalone "Emerging Markets Agreement" (only applies inside EMB now).
529
- # Deactivate (don't delete) so historical submissions stay intact. EMB's tier *label*
530
- # of the same text is independent and unaffected.
531
- em = s.query(CommissionAgreement).filter(
532
- CommissionAgreement.name == "Emerging Markets Agreement"
533
- ).first()
534
- if em and em.is_active:
535
- em.is_active = False
536
- s.commit()
537
- print(" Deactivated standalone 'Emerging Markets Agreement' (now EMB-only).")
538
 
539
  print("Round 6 migrations complete.")
540
 
 
170
  if deprecated_rules:
171
  s.commit()
172
 
173
+ # 2. REMOVED 2026-06-23 β€” no longer force-deactivate the legacy combined
174
+ # "Emerging Markets - House Standard" agreement. Agreement active/inactive
175
+ # state is admin-owned (see R6.3 note below). If that legacy row exists, the
176
+ # admin can deactivate it from the panel and it will stick.
 
 
 
 
177
 
178
  # 3. Ensure standalone "House Standard Agreement" exists (P1 hidden, routes to Bella)
179
  house_std = s.query(CommissionAgreement).filter(
 
521
  s.commit()
522
  print(" Repaired Middle Market referral β€” restored Originating Producer (P2) tiers.")
523
 
524
+ # R6.3 β€” REMOVED 2026-06-23. The standalone "Emerging Markets Agreement" is now
525
+ # ADMIN-OWNED: its active/inactive state is controlled from the admin panel and is
526
+ # no longer force-deactivated on boot. Previously this block flipped it back to
527
+ # Inactive every restart, so any admin reactivation was undone overnight. EMB
528
+ # (Referral / Origination Fee Agreement - EMB) remains a separate active agreement.
 
 
 
 
 
529
 
530
  print("Round 6 migrations complete.")
531