Self-healing agent (supervisor, recovery, login fixes, operator mail) and Portal sage redesign

Snapshot of D:\Ecw Process a11c9ff (2026-10-30).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ManikandanandClaude Opus 5.5 committed 2026-10-30 10:58:35 +05:30
1 parent fafa5285eb
commit d500f750da
26 files changed
+1704 -357

No files matched your search

+20
View File
@@ -235,6 +235,15 @@ IMAP_PASSWORD = _env("IMAP_PASSWORD")
IMAP_FOLDER = _env("IMAP_FOLDER", "INBOX")
IMAP_SSL = _env_bool("IMAP_SSL", True)
# The agent's email to the operator (core/notify.py, operator 2026-10-30):
# sent from the 2FA mailbox's own account over SMTP, so no new credential.
# Blank NOTIFY_EMAIL_TO = no mail at all.
NOTIFY_EMAIL_TO = _env("NOTIFY_EMAIL_TO")
SMTP_HOST = _env("SMTP_HOST") or IMAP_HOST
SMTP_PORT = _env_int("SMTP_PORT", 465)
SMTP_USERNAME = _env("SMTP_USERNAME") or IMAP_USERNAME
SMTP_PASSWORD = _env("SMTP_PASSWORD") or IMAP_PASSWORD
# How long to keep polling the mailbox for the OTP mail, and how often.
#
# Ten minutes. eCW's push mail is DELAYED, not dropped — proven by delivery
@@ -272,6 +281,12 @@ OTP_LINK_AGE_WARN_SECONDS = _env_int("OTP_LINK_AGE_WARN_SECONDS", 540)
# for that and stops with it as the stated reason.
OTP_RESEND_ATTEMPTS = _env_int("OTP_RESEND_ATTEMPTS", 1)
OTP_RESEND_WAIT_SECONDS = _env_int("OTP_RESEND_WAIT_SECONDS", 600)
# A link approved but never picked up by the login page (live 2026-10-29: mail
# 6 to 8.5 minutes late, page still on "sent a notification", Resend still
# there): wait this long for the page to move on, then Resend and approve the
# new mail, up to OTP_PICKUP_RESENDS times. eCW allows three resends a login.
OTP_PICKUP_SECONDS = _env_int("OTP_PICKUP_SECONDS", 60)
OTP_PICKUP_RESENDS = _env_int("OTP_PICKUP_RESENDS", 2)
# Ignore anything already sitting in the inbox from before the login attempt.
OTP_MAX_AGE_SECONDS = _env_int("OTP_MAX_AGE_SECONDS", 300)
@@ -516,6 +531,11 @@ NOTIFY_UNMAPPED_PAYERS = _env_bool("NOTIFY_UNMAPPED_PAYERS", True)
# Accepted on purpose — a path in .env that points at nothing is a config
# mistake whichever program reads the file (unit B fix round 1, 2026-10-05).
TEST_CLAIM_IDS_FILE = _env("TEST_CLAIM_IDS_FILE", "")
# Set by the agent (flows/supervisor.py), not by hand: the claims of today's
# live queue still pending after an earlier pass stopped. Run like the live
# queue — no TEST label, the live Charge Summary — but from this list, with
# no fresh export.
RESUME_CLAIM_IDS_FILE = _env("RESUME_CLAIM_IDS_FILE", "")
# ── Per-claim processing ──────────────────────────────────────────────────────