Prefer stock display names in IPO reports

Request:
Rename the report display-name rule from 中文名 to 股票名, prefer Chinese stock-style short names, and allow sourced English stock names such as MERDEKAGOLD-DRS when no Chinese short name exists.

Changes:
- Update the hk-ipo-analyst skill to require a 股票名 column and document English stock-name fallback.
- Derive missing stock_short_name values from archived market-heat source-page stock names in the analysis dataset.
- Preserve source-page stock names into ipo_master when future market-heat archives encounter blank stock_short_name values.
- Rename the single-ticker report display helper to stock_display_name.
- Refresh the latest report and README so 06228 displays as MERDEKAGOLD-DRS and tables use 股票名.

Verification:
- python3 /root/.codex/skills/.system/skill-creator/scripts/quick_validate.py .agents/skills/hk-ipo-analyst
- git diff --check
- .venv/bin/python -m py_compile scripts/archive_t0_5_market_heat.py scripts/build_analysis_dataset.py scripts/generate_ipo_report.py
- Rebuilt analysis_model_v0_dataset.csv for 2026-06-23T10:59:36Z
- Verified 06228 stock_short_name is MERDEKAGOLD-DRS and latest README matches the dated report
This commit is contained in:
2026-06-23 11:24:50 +00:00
parent 2b08ad8689
commit aa31244f0a
7 changed files with 51 additions and 29 deletions
+11 -1
View File
@@ -71,6 +71,14 @@ def offer_size_hkd_m(row: sqlite3.Row) -> float | None:
return None
def stock_name_from_market_heat_notes(notes: str | None) -> str | None:
if not notes or "Stock name on source page:" not in notes:
return None
value = notes.split("Stock name on source page:", 1)[1].strip()
value = value.split(". Prospectus URL shown by source:", 1)[0].strip()
return value or None
def success_rate(row: sqlite3.Row) -> float | None:
valid = as_int(row["valid_applications"])
successful = as_int(row["successful_applications"])
@@ -420,6 +428,7 @@ def fetch_rows(conn: sqlite3.Connection) -> list[sqlite3.Row]:
h.provider AS t0_5_provider,
h.margin_subscription_multiple AS t0_5_margin_subscription_multiple,
h.source_id AS t0_5_source_id,
h.notes AS market_heat_notes,
eh.one_hand_win_rate_pct AS external_one_hand_win_rate_pct,
eh.public_oversubscription_times AS external_public_oversubscription_times,
eh.grey_market_return_pct AS external_grey_market_return_pct,
@@ -461,13 +470,14 @@ def build_records(rows: list[sqlite3.Row], as_of: str) -> list[dict[str, Any]]:
total_score = t0_score_value + (t1_score_value if structured_t1 else 0)
t0_plus_t0_5_score = t0_score_value + t0_5_score_value if t0_5_score_value is not None else None
size = offer_size_hkd_m(row)
stock_short_name = row["stock_short_name"] or stock_name_from_market_heat_notes(row["market_heat_notes"])
record: dict[str, Any] = {
"model_version": MODEL_VERSION,
"analysis_as_of": as_of,
"ticker": row["ticker"],
"company_name_en": row["company_name_en"],
"company_name_zh": row["company_name_zh"],
"stock_short_name": row["stock_short_name"],
"stock_short_name": stock_short_name,
"board": row["board"],
"status": row["status"],
"listing_date": row["listing_date"],