name: Qualitative Sell Strategy (Read-Only, SQLite Canonical) on: schedule: - cron: "0 10 * * 1-5" # KST 19:00-ish daily post-close batch window (UTC 10:00) workflow_dispatch: jobs: evaluate-qualitative-sell: runs-on: self-hosted steps: - name: Checkout Code run: | if [ -d .git ]; then git remote set-url origin http://x-access-token:${{ secrets.GITHUB_TOKEN }}@192.168.123.100:8418/KimJaeHyun/myfinance.git else git init git remote add origin http://x-access-token:${{ secrets.GITHUB_TOKEN }}@192.168.123.100:8418/KimJaeHyun/myfinance.git fi git fetch origin main --depth=1 git reset --hard FETCH_HEAD - name: Configure Runtime Paths run: | export PATH=/usr/local/bin:$PATH echo "/usr/local/bin" >> $GITHUB_PATH /usr/bin/python3 --version - name: Setup Python Environment run: | VENV_BASE=/volume1/gitea/python_venv REQ_HASH=$(md5sum tools/build_qualitative_sell_inputs_v1.py 2>/dev/null | cut -d' ' -f1 || echo "qual-default") VENV="$VENV_BASE/$REQ_HASH" if [ ! -f "$VENV/bin/python" ]; then mkdir -p "$VENV_BASE" /usr/bin/python3 -m venv "$VENV" "$VENV/bin/pip" install --upgrade pip --quiet "$VENV/bin/pip" install requests beautifulsoup4 pyyaml openpyxl --quiet fi echo "$VENV/bin" >> $GITHUB_PATH - name: "[CRITICAL] No Direct API Trading Gate" run: python3 tools/validate_no_direct_api_trading_v1.py - name: "[CRITICAL] Validate KIS API Credentials (mock)" env: KIS_APP_Key_TEST: ${{ secrets.KIS_APP_KEY_TEST }} KIS_APP_Secret_TEST: ${{ secrets.KIS_APP_SECRET_TEST }} run: python3 tools/validate_kis_api_credentials_v1.py --account mock --ticker 005930 - name: Build Qualitative Sell Inputs (batch) env: KIS_APP_Key: ${{ secrets.KIS_APP_KEY }} KIS_APP_Secret: ${{ secrets.KIS_APP_SECRET }} run: | if [ -f GatherTradingData.xlsx ]; then python3 tools/build_qualitative_sell_inputs_v1.py \ --batch \ --workbook GatherTradingData.xlsx \ --kis-account real \ --apply else echo "GatherTradingData.xlsx missing -> skip batch build" fi - name: Build Satellite Recommendations run: | if [ -f GatherTradingData.xlsx ]; then python3 tools/build_satellite_candidate_recommendations_v1.py \ --workbook GatherTradingData.xlsx \ --apply else echo "GatherTradingData.xlsx missing -> skip satellite build" fi - name: Evaluate Qualitative Sell Accuracy run: | if [ -f outputs/qualitative_sell_strategy/qualitative_sell_strategy.db ]; then python3 tools/evaluate_qualitative_sell_strategy_accuracy_v1.py \ --sqlite-db outputs/qualitative_sell_strategy/qualitative_sell_strategy.db else echo "qualitative_sell_strategy.db missing -> skip accuracy evaluation" fi