Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2026-02-14 12:26:16 -06:00
parent cd042f105b
commit 45835d808f
6 changed files with 61 additions and 6 deletions

View File

@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SETUP_SCRIPT="$ROOT_DIR/run.sh"
BUILD_APP_SCRIPT="$ROOT_DIR/scripts/build_selfcontained_mac_app.sh"
BUILD_DMG_SCRIPT="$ROOT_DIR/scripts/create_installer_dmg.sh"
VENV_PYTHON="$ROOT_DIR/.venv/bin/python"
BUILD_DIR="${BUILD_DIR:-$ROOT_DIR/build}"
DMG_DIR="${DMG_DIR:-$BUILD_DIR/dmg}"
if [[ ! -x "$VENV_PYTHON" ]]; then
echo "Virtual environment missing. Running setup..."
"$SETUP_SCRIPT" --setup-only
fi
if ! command -v create-dmg >/dev/null 2>&1; then
echo "create-dmg not found. Install with: brew install create-dmg" >&2
exit 1
fi
app_marker="$(mktemp)"
touch "$app_marker"
echo "Building fresh self-contained app (includes embedded backend rebuild)..."
"$BUILD_APP_SCRIPT"
APP_BUNDLE_PATH="$(find "$ROOT_DIR/dist-mac" -type d -name "*.app" -newer "$app_marker" | sort | tail -n 1 || true)"
rm -f "$app_marker"
if [[ -z "$APP_BUNDLE_PATH" || ! -d "$APP_BUNDLE_PATH" ]]; then
echo "Build succeeded but no freshly built app bundle was found in dist-mac." >&2
exit 1
fi
dmg_marker="$(mktemp)"
touch "$dmg_marker"
echo "Packaging DMG from freshly built app:"
echo " $APP_BUNDLE_PATH"
APP_BUNDLE_PATH="$APP_BUNDLE_PATH" "$BUILD_DMG_SCRIPT"
DMG_PATH="$(find "$DMG_DIR" -type f -name "*.dmg" -newer "$dmg_marker" | sort | tail -n 1 || true)"
rm -f "$dmg_marker"
if [[ -n "$DMG_PATH" && -f "$DMG_PATH" ]]; then
echo "Fresh installer ready:"
echo " $DMG_PATH"
else
echo "DMG packaging step completed, but new DMG path could not be auto-detected." >&2
echo "Check: $DMG_DIR"
fi

View File

@ -98,6 +98,8 @@ Tip: sign and notarize before sharing broadly, so macOS trust prompts are reduce
- red X: example loss/flat exit - red X: example loss/flat exit
## 6) Training Mode (New) ## 6) Training Mode (New)
Training toggles are OFF by default.
Use these toggles in sidebar `Training & Guidance`: Use these toggles in sidebar `Training & Guidance`:
- `Show live decision guide`: summarizes current bias, signal status, and invalidation rule. - `Show live decision guide`: summarizes current bias, signal status, and invalidation rule.
- `Show past behavior examples`: shows historical hypothetical trades and outcomes. - `Show past behavior examples`: shows historical hypothetical trades and outcomes.

View File

@ -40,9 +40,9 @@ Normalization constraints:
- `volume_sma_window`: `[2, 100]`, fallback `20` - `volume_sma_window`: `[2, 100]`, fallback `20`
- `volume_multiplier`: `[0.1, 3.0]`, rounded to 0.1, fallback `1.0` - `volume_multiplier`: `[0.1, 3.0]`, rounded to 0.1, fallback `1.0`
- `refresh_sec`: `[10, 600]`, fallback `60` - `refresh_sec`: `[10, 600]`, fallback `60`
- `show_live_guide`: boolean, fallback `true` - `show_live_guide`: boolean, fallback `false`
- `show_past_behavior`: boolean, fallback `true` - `show_past_behavior`: boolean, fallback `false`
- `show_trade_markers`: boolean, fallback `true` - `show_trade_markers`: boolean, fallback `false`
- `focus_chart_on_selected_example`: boolean, fallback `false` - `focus_chart_on_selected_example`: boolean, fallback `false`
- `max_training_examples`: `[5, 100]`, fallback `20` - `max_training_examples`: `[5, 100]`, fallback `20`
- booleans normalized from common truthy/falsy strings and numbers - booleans normalized from common truthy/falsy strings and numbers

View File

@ -71,9 +71,9 @@ def normalize_web_settings(raw: dict[str, Any] | None) -> dict[str, Any]:
"volume_multiplier": 1.0, "volume_multiplier": 1.0,
"gray_fake": True, "gray_fake": True,
"hide_market_closed_gaps": True, "hide_market_closed_gaps": True,
"show_live_guide": True, "show_live_guide": False,
"show_past_behavior": True, "show_past_behavior": False,
"show_trade_markers": True, "show_trade_markers": False,
"focus_chart_on_selected_example": False, "focus_chart_on_selected_example": False,
"max_training_examples": 20, "max_training_examples": 20,
"enable_auto_refresh": False, "enable_auto_refresh": False,

View File

@ -29,6 +29,7 @@
</ol> </ol>
<h2>How To Use The New Training Features</h2> <h2>How To Use The New Training Features</h2>
<p>Training toggles are OFF by default.</p>
<h3>1) Live Decision Guide (what to do now)</h3> <h3>1) Live Decision Guide (what to do now)</h3>
<ul> <ul>