Commit Graph

5 Commits

Author SHA1 Message Date
geometrybase 7cbdd533b0 Add A/H share-class mapping workflow
Request:
- Add a repeatable mechanism so HK IPO reports detect issuers that already have Mainland A shares.
- Include a third internet/official-exchange cross-check layer beyond structured history and prospectus scans.

Changes:
- Add listed_share_classes schema support for same-issuer A-share mappings and evidence links.
- Add scripts/archive_a_share_mappings.py to scan prospectus extracted text, reject sponsor/portfolio/cornerstone false positives, archive optional official web evidence and A-share/FX quote evidence, and export snapshots on write.
- Surface a_share_* fields in the analysis dataset and single-ticker report output.
- Update hk-ipo analyst/archivist skill rules and scheduled refresh prompt to require the three-layer A/H mapping check.

Verification:
- python3 -m py_compile scripts/archive_a_share_mappings.py scripts/build_analysis_dataset.py scripts/generate_ipo_report.py
- .venv/bin/python scripts/archive_a_share_mappings.py --as-of 2026-06-24T00:00:00Z --tickers 00668,01688,03661,09630 --dry-run
- .venv/bin/python scripts/build_analysis_dataset.py --db /tmp/hk_ipo_ah_dataset_test.sqlite --dataset /tmp/hk_ipo_ah_dataset_test.csv --report /tmp/hk_ipo_ah_model_test.md --as-of 2026-06-24T00:00:00Z
- .venv/bin/python scripts/generate_ipo_report.py 09630 --dataset /tmp/hk_ipo_ah_dataset_test.csv --stdout --as-of 2026-06-24T00:00:00Z
- git diff --check

Next useful context:
- Dry-run detected 00668->300866.SZ, 01688->002600.SZ, 03661->300661.SZ, and 09630->688630.SH.
- A false positive 01688->300476.SZ from a cornerstone investor parent was rejected by the issuer-context filter.
2026-06-24 07:21:21 +00:00
geometrybase 40d748cda8 Keep unconfirmed D1 IPOs in risk tables
Request:
Ensure the break-probability, risk/reward, and capital-efficiency section includes IPOs without confirmed D1 break/non-break outcomes, even after subscription closes.

Changes:
- Update the hk-ipo-analyst skill so broad reports keep all current or recently closed unresolved D1 names in the probability/risk section.
- Update the scheduled analyst prompt to preserve this coverage during automated refreshes.
- Refresh the latest report and README with a D1-unconfirmed risk table covering current actionable names plus closed/waiting names.

Verification:
- python3 /root/.codex/skills/.system/skill-creator/scripts/quick_validate.py .agents/skills/hk-ipo-analyst
- bash -n scripts/run_hk_ipo_analyst_once.sh
- git diff --check
- Python check that reports/README.md matches the dated latest report and includes the closed/waiting D1-unconfirmed tickers
2026-06-23 11:30:36 +00:00
geometrybase a0e7775284 Fix scheduled Codex option order
Request:
- Fix hk-ipo-analyst.service failing with 'unexpected argument -a' when the scheduled runner invokes Codex.

Changes:
- Moved Codex global options before the exec subcommand in scripts/run_hk_ipo_analyst_once.sh.
- Kept the existing scheduled prompt and systemd units unchanged.
- Reset the failed hk-ipo-analyst.service state after the previous invalid-argument failure.

Verification:
- Ran bash -n scripts/run_hk_ipo_analyst_once.sh.
- Ran git diff --cached --check.
- Confirmed 'codex --search -s danger-full-access -a never exec -C /root/projects/hk-ipo --help' parses successfully.
- Ran systemd-analyze verify for the service and timer; only unrelated system xfs unit warnings were reported.

Next useful context:
- I did not start hk-ipo-analyst.service after this fix to avoid triggering a full analyst refresh outside the timer window.
2026-06-22 15:46:46 +00:00
geometrybase 907aeeee9b Codify latest IPO report refresh
Request:
- Make each scheduled analyst run refresh the latest IPO universe and all report-relevant online facts, especially subscription/margin multiples.
- Mirror the latest dated IPO candidate report to reports/README.md.
- Add this latest-report behavior to the hk-ipo-analyst skill instructions.

Changes:
- Expanded the scheduled analyst runner prompt to require online candidate refresh, market-heat/subscription-multiple refresh, official T1 updates when available, complete latest report regeneration, and reports/README.md mirroring.
- Added a Latest Candidate Report Refresh section to hk-ipo-analyst documenting the refresh flow, stage-safe market-heat handling, official T1 boundaries, and README mirror contract.
- Added reports/README.md as a copy of the current latest dated candidate report.

Verification:
- Ran bash -n scripts/run_hk_ipo_analyst_once.sh.
- Ran git diff --check and git diff --cached --check.
- Confirmed reports/README.md matches reports/2026-06-22_latest_ipo_candidates_analysis.md with cmp.
- Confirmed hk-ipo-analyst.timer still points to 2026-06-22 23:00:00 UTC as the next run.

Next useful context:
- reports/README.md is intentionally overwriteable on each latest candidate refresh; dated reports remain the historical copies.
- Unofficial subscription multiples should stay in ipo_market_heat and not be copied into official T1 demand fields.
2026-06-22 15:41:49 +00:00
geometrybase af6f8ed721 Add scheduled HK IPO analyst runner
Request:
- Install systemd-based scheduling for the hk-ipo-analyst automation to run three times per day without overlapping executions.

Changes:
- Added an executable wrapper script that resolves the repository root, acquires a non-blocking flock lock, builds a scheduled analyst prompt, and invokes codex exec with the hk-ipo-analyst skill.
- The installed systemd service and timer live under /etc/systemd/system and are not part of this repository commit.

Verification:
- Ran bash -n scripts/run_hk_ipo_analyst_once.sh.
- Ran git diff --cached --check.
- Ran systemd-analyze verify for hk-ipo-analyst.service and hk-ipo-analyst.timer; only unrelated xfs unit deprecation warnings were reported.
- Enabled hk-ipo-analyst.timer and confirmed the next trigger is 2026-06-22 23:00:00 UTC.

Next useful context:
- The timer schedule is explicit UTC: 07:00, 15:00, and 23:00 UTC daily.
- The wrapper exits successfully without starting a second run when another analyst process holds /run/hk-ipo/analyst.lock.
2026-06-22 15:36:08 +00:00