fix: name no date after the run in what a historical run reads

- coverage and withholding notices named where a vendor's coverage starts or today's date
- the instrument context named today's date in every analyst prompt
This commit is contained in:
Yijia-Xiao
2026-09-24 04:31:05 +00:00
parent f142e79660
commit a58aa613fc
6 changed files with 33 additions and 9 deletions
+3 -3
View File
@@ -183,9 +183,9 @@ def build_instrument_context(
today = get_current_date()
if curr_date and str(curr_date) < today:
context += (
f" This identity is how the vendor describes the instrument today "
f"({today}), not necessarily on {curr_date}: a name or "
f"classification changed since then would read as the current one."
f" This identity is how the vendor describes the instrument today, "
f"not necessarily on {curr_date}: a name or classification changed "
f"since then would read as the current one."
)
if is_crypto:
+2 -2
View File
@@ -53,7 +53,7 @@ def coverage_gap(
if datetime.strptime(end_date, "%Y-%m-%d").date() > now.date():
reason = "the window extends past today"
elif oldest.date() > datetime.strptime(start_date, "%Y-%m-%d").date():
reason = f"it only serves recent items (coverage starts {oldest:%Y-%m-%d})"
reason = "it only serves recent items"
else:
return None
return f"<{source} unavailable for {start_date}..{end_date}: {reason}, so this is not an absence of {subject}>"
@@ -111,7 +111,7 @@ def withhold_live_profile(curr_date: str | None, label: str) -> str | None:
f"# Company Fundamentals for {label}\n"
f"# Point-in-time as of: {curr_date}\n\n"
f"Profile fundamentals are withheld for this date. This vendor serves "
f"only present-day values ({today}) with no historical vintage: market "
f"only present-day values with no historical vintage: market "
f"cap, valuation multiples, the 52-week range and TTM income move with "
f"today's quote, and even the name, sector and industry reflect today "
f"rather than {curr_date} (companies rename and get reclassified). "
+1 -1
View File
@@ -442,7 +442,7 @@ def get_insider_transactions(
if kept.empty:
return (
f"<insider transactions unavailable for {canonical} as of {curr_date}: "
f"Yahoo serves recent transactions only (coverage starts {traded.min():%Y-%m-%d})>"
"Yahoo serves recent transactions only>"
)
data = kept