Files
gavindiazandClaude Code 3a005ddcc6
Docs / Validate documentation (push) Canceled after 0s
Docs / Deploy GitHub Pages (push) Canceled after 0s
CI Final Summary (AI) / AI Final Summary (push) Canceled after 0s
CI Final Summary (AI) / Push/PR event feed (push) Canceled after 0s
CI / CI Integrity and Change Classification (push) Canceled after 0s
CI / Code Quality & Tests (push) Canceled after 0s
Dependency Lock & Migration Safety / Dependency drift (lock vs pyproject) (push) Canceled after 0s
Dependency Lock & Migration Safety / Migration safety (fail-loud + version postconditions) (push) Canceled after 0s
JS Tests / Frontend JS Unit Tests (push) Canceled after 0s
Security / CodeQL Analysis (push) Canceled after 0s
Security / Trivy Vulnerability Scan (push) Canceled after 0s
Tests (OS Matrix) / Py Tests (macos-latest) (push) Canceled after 0s
Tests (OS Matrix) / Py Tests (windows-latest) (push) Canceled after 0s
CI / Extended Validation (Tier 2) (push) Canceled after 0s
CI / Heavy CI (database-provider) (push) Canceled after 0s
CI / Heavy CI (e2e) (push) Canceled after 0s
CI / Heavy CI (integration) (push) Canceled after 0s
CI / Heavy CI (model-validation) (push) Canceled after 0s
CI / Heavy CI (research-backtest) (push) Canceled after 0s
CI / Aggregate CI Results (push) Canceled after 0s
chore(repo): initial import of Nexus Trading Forex Bot into self-hosted hosting
Full project import for the self-hosted code hosting
(https://code.aifunny.ltd/gavindiaz/my-NexusTradingForexBot.git).

Includes the live-freshness + scaler-hash fixes for the permanent
STALE dashboard (tick_pipeline now_utc stamps; infer_probabilities
computes model_input_hash on the actual scaled 70D tensor), the
data-fetch default-path fix, the g29 web-auth test fixes, and a
Chinese user manual (使用手册.md) for the web dashboard.

Scratch diagnostic scripts (check*.py, contain a live web-auth token)
and the .kilo/ agent-worktree directory are gitignored, not committed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-23 23:24:54 +08:00

68 lines
3.0 KiB
Bash

#!/usr/bin/env bash
# Canonical local pre-push validation gate (Linux/macOS/Bash wrapper).
#
# ONE canonical implementation lives in scripts/ci/check_local.py; the
# platform scripts (this file and beforePush.ps1) are thin wrappers that
# resolve the repository Python interpreter and delegate. The validation
# LOGIC (ruff lint/format, mypy, critical-suite manifest, push contract)
# is intentionally NOT duplicated here — see docs/LOCAL_QUALITY_GATE.md.
#
# Optional passthrough args are forwarded verbatim:
# ./beforePush.sh --all # whole-tree scope
# ./beforePush.sh --staged # staged files only
# ./beforePush.sh --fix # safe mechanical fixes
# ./beforePush.sh --json # machine-readable envelope
# ./beforePush.sh --prepush # canonical push-time contract (default
# # behavior is already push-scope)
# Exit codes mirror check_local.py: 0 pass, 1 failure, 2 usage/config error.
set -euo pipefail
# ---------------------------------------------------------------------------
# Resolve repo root = directory containing this script (portable; no
# platform-specific venv path is hard-coded).
# ---------------------------------------------------------------------------
SCRIPT_PATH="${BASH_SOURCE[0]}"
while [ -L "$SCRIPT_PATH" ]; do
SCRIPT_DIR="$(cd -P "$(dirname "$SCRIPT_PATH")" && pwd)"
SCRIPT_PATH="$(readlink "$SCRIPT_PATH")"
[[ "$SCRIPT_PATH" != /* ]] && SCRIPT_PATH="$SCRIPT_DIR/$SCRIPT_PATH"
done
REPO_ROOT="$(cd -P "$(dirname "$SCRIPT_PATH")" && pwd)"
# On MSYS/git-bash, $REPO_ROOT is a POSIX path (/c/Users/...). When the
# resolved interpreter is a native Windows executable, hand it a native
# path instead — MSYS path conversion is disabled for command arguments
# that already look like paths, and C:/... form is valid for both worlds.
if [ -n "${MSYSTEM:-}" ] && [ -x "$REPO_ROOT/.venv/Scripts/python.exe" ]; then
REPO_ROOT="$(cygpath -m "$REPO_ROOT")"
fi
# ---------------------------------------------------------------------------
# Resolve the repository Python: repo venv (POSIX layout first, then the
# Windows layout for WSL/git-bash venvs), else python3 from PATH. The
# canonical runner picks the right tool modules from whichever interpreter
# hosts it (scripts/ci/check_local.py::_tool_cmd).
# ---------------------------------------------------------------------------
PYTHON_BIN="${PYTHON_BIN:-}"
if [ -z "$PYTHON_BIN" ]; then
for candidate in \
"$REPO_ROOT/.venv/bin/python" \
"$REPO_ROOT/.venv/Scripts/python.exe" \
"$(command -v python3 || true)"; do
if [ -n "$candidate" ] && [ -x "$candidate" ]; then
PYTHON_BIN="$candidate"
break
fi
done
fi
if [ -z "$PYTHON_BIN" ]; then
echo "beforePush.sh: no repository Python found (.venv missing, python3 absent)" >&2
exit 2
fi
echo "[beforePush] repo: $REPO_ROOT"
echo "[beforePush] python: $PYTHON_BIN"
echo "[beforePush] delegating to canonical gate: scripts/ci/check_local.py --prepush $*"
exec "$PYTHON_BIN" "$REPO_ROOT/scripts/ci/check_local.py" --prepush "$@"