FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
v4.0.3 update
tilakpatel22f18a2e88c916
diff --git a/.github/workflows/macos-codesign-check.yml b/.github/workflows/macos-codesign-check.ymlnew file mode 100644index 000000000..b28e00119--- /dev/null+++ b/.github/workflows/macos-codesign-check.yml@@ -0,0 +1,344 @@+name: macOS — Codesign Smoke Test++# Build a minimal arm64 .app bundle, run macdeployqt + lipo-thin, then sign+# with Developer ID Application + hardened runtime + secure timestamp, and+# run the same pre-flight checks the release pipeline does. Stops short of+# notarization / DMG / upload, so this is a fast (~10 min) signal of whether+# the sign step itself is healthy on the current runner image + Qt version.+#+# Does NOT embed Python.framework: that's a meaningful chunk of the real+# bundle but it's also the slowest staging step and not what we want to+# validate here. The Qt frameworks + plugins + Fincept main binary still+# exercise every relevant codesign path (nested frameworks, sign inside-out,+# hardened-runtime propagation, timestamp acquisition).+#+# Triggered manually via the Actions tab → "Run workflow".++on:+ workflow_dispatch:++env:+ BUILD_TYPE: Release+ QT_VERSION: "6.8.3"+ QT_MODULES: "qtcharts qtwebsockets qtmultimedia"+ APP_NAME: FinceptTerminal+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true++jobs:+ codesign-smoke:+ name: Build + Sign (no notary)+ runs-on: macos-15++ steps:+ - name: Checkout+ uses: actions/checkout@v4+ with:+ submodules: recursive+ fetch-depth: 1++ - name: Set up ccache+ uses: hendrikmuhs/ccache-action@v1+ with:+ key: macos-codesign-smoke-${{ env.QT_VERSION }}+ max-size: 500M++ - name: Install build tools+ run: brew install ninja cmake || brew upgrade ninja cmake || true++ - name: Install Qt ${{ env.QT_VERSION }}+ uses: jurplel/install-qt-action@v4+ with:+ version: ${{ env.QT_VERSION }}+ arch: clang_64+ modules: ${{ env.QT_MODULES }}+ cache: true+ cache-key-prefix: qt-macos-codesign-smoke++ - name: Install Python 3.12+ run: brew install [email protected] || brew upgrade [email protected] || true++ - name: Generate .icns icon+ working-directory: fincept-qt+ run: |+ ICO="resources/fincept.ico"+ ICNS="resources/fincept.icns"+ if [ -f "${ICNS}" ]; then+ echo ".icns already exists"+ elif [ -f "${ICO}" ]; then+ ICONSET="$(mktemp -d)/fincept.iconset"+ mkdir -p "${ICONSET}"+ sips -s format png "${ICO}" --out "${ICONSET}/icon_512x512.png" \+ --resampleHeightWidth 512 512 2>/dev/null || true+ iconutil -c icns -o "${ICNS}" "${ICONSET}" || true+ fi++ - name: Configure CMake+ working-directory: fincept-qt+ run: |+ cmake -B build -G Ninja \+ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \+ -DCMAKE_PREFIX_PATH="${QT_ROOT_DIR}" \+ -DCMAKE_OSX_ARCHITECTURES=arm64 \+ -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0 \+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache++ - name: Build+ working-directory: fincept-qt+ run: cmake --build build --config ${{ env.BUILD_TYPE }} -j $(sysctl -n hw.logicalcpu)++ - name: Verify binary+ working-directory: fincept-qt+ run: |+ if [ -f "build/${{ env.APP_NAME }}.app/Contents/MacOS/${{ env.APP_NAME }}" ]; then+ BINARY="build/${{ env.APP_NAME }}.app/Contents/MacOS/${{ env.APP_NAME }}"+ elif [ -f "build/${{ env.APP_NAME }}" ]; then+ BINARY="build/${{ env.APP_NAME }}"+ else+ echo "::error::Binary not found"+ find build -maxdepth 3 -name "${{ env.APP_NAME }}*" || true+ exit 1+ fi+ echo "Binary: $BINARY ($(du -sh "$BINARY" | cut -f1))"+ lipo -info "$BINARY"++ - name: Ensure .app bundle layout exists+ working-directory: fincept-qt+ run: |+ set -euo pipefail+ BUILD_DIR="build"+ APP_BUNDLE="${BUILD_DIR}/${{ env.APP_NAME }}.app"+ if [ ! -d "${APP_BUNDLE}" ]; then+ mkdir -p "${APP_BUNDLE}/Contents/MacOS"+ cp "${BUILD_DIR}/${{ env.APP_NAME }}" "${APP_BUNDLE}/Contents/MacOS/${{ env.APP_NAME }}"+ chmod +x "${APP_BUNDLE}/Contents/MacOS/${{ env.APP_NAME }}"+ cat > "${APP_BUNDLE}/Contents/Info.plist" <<'PLIST'+ <?xml version="1.0" encoding="UTF-8"?>+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+ <plist version="1.0"><dict>+ <key>CFBundleExecutable</key><string>FinceptTerminal</string>+ <key>CFBundleIdentifier</key><string>com.fincept.terminal</string>+ <key>CFBundleName</key><string>FinceptTerminal</string>+ <key>CFBundlePackageType</key><string>APPL</string>+ <key>CFBundleShortVersionString</key><string>4.0.3</string>+ <key>CFBundleVersion</key><string>4.0.3</string>+ <key>LSMinimumSystemVersion</key><string>13.0</string>+ <key>NSHighResolutionCapable</key><true/>+ </dict></plist>+ PLIST+ fi++ - name: Canonicalise bundle layout (move non-Mach-Os out of MacOS/)+ working-directory: fincept-qt+ run: |+ set -euo pipefail+ APP_BUNDLE="build/${{ env.APP_NAME }}.app"+ RES="${APP_BUNDLE}/Contents/Resources"+ mkdir -p "${RES}"+ # CMake's POST_BUILD copies scripts/, resources/, yt-dlp into+ # Contents/MacOS — codesign refuses to sign a bundle with non-+ # Mach-Os there. Move them aside before signing.+ for entry in "${APP_BUNDLE}/Contents/MacOS"/*; do+ [ -e "$entry" ] || continue+ base="$(basename "$entry")"+ [ "$base" = "${{ env.APP_NAME }}" ] && continue+ if file -h "$entry" 2>/dev/null | grep -q "Mach-O"; then+ continue+ fi+ mv "$entry" "${RES}/${base}"+ done++ - name: Run macdeployqt+ working-directory: fincept-qt+ run: |+ set -euo pipefail+ APP_BUNDLE="build/${{ env.APP_NAME }}.app"+ MACDEPLOYQT="${QT_ROOT_DIR}/bin/macdeployqt"+ if [ ! -x "${MACDEPLOYQT}" ]; then+ echo "::error::macdeployqt not found at ${MACDEPLOYQT}"+ exit 1+ fi+ "${MACDEPLOYQT}" "${APP_BUNDLE}" -verbose=1 -always-overwrite || \+ echo "::warning::macdeployqt exited non-zero — continuing"++ - name: Thin universal Mach-Os to arm64+ working-directory: fincept-qt+ run: |+ set -euo pipefail+ APP_BUNDLE="build/${{ env.APP_NAME }}.app"+ THINNED_COUNT=0+ while IFS= read -r f; do+ file -h "$f" 2>/dev/null | grep -q "Mach-O" || continue+ ARCHS=$(file -h "$f" 2>/dev/null | grep -oE "(arm64|x86_64|i386|ppc)" | sort -u | tr '\n' ',' | sed 's/,$//')+ [ "${ARCHS}" = "arm64" ] && continue+ if ! echo "${ARCHS}" | grep -q "arm64"; then+ echo "::warning::no arm64 slice in $f (archs: ${ARCHS}) — leaving as-is"+ continue+ fi+ chmod u+w "$f" 2>/dev/null || true+ if lipo -thin arm64 "$f" -output "$f" 2>/dev/null; then+ THINNED_COUNT=$((THINNED_COUNT + 1))+ else+ echo "::warning::lipo -thin arm64 failed for $f"+ fi+ done < <(find "${APP_BUNDLE}" -type f 2>/dev/null)+ echo " thinned ${THINNED_COUNT} Mach-O(s) to arm64"++ - name: Import Developer ID certificate+ env:+ P12_BASE64: ${{ secrets.MACOS_CERT_P12_BASE64 }}+ P12_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}+ run: |+ set -euo pipefail+ if [ -z "${P12_BASE64}" ] || [ -z "${P12_PASSWORD}" ]; then+ echo "::error::MACOS_CERT_P12_BASE64 / MACOS_CERT_PASSWORD secrets not set"+ exit 1+ fi+ KEYCHAIN_PATH="$RUNNER_TEMP/build.keychain-db"+ P12_PATH="$RUNNER_TEMP/cert.p12"+ echo "$P12_BASE64" | base64 -d > "$P12_PATH"+ security create-keychain -p "$P12_PASSWORD" "$KEYCHAIN_PATH"+ security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"+ security unlock-keychain -p "$P12_PASSWORD" "$KEYCHAIN_PATH"+ security import "$P12_PATH" -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"+ security list-keychains -d user -s "$KEYCHAIN_PATH" $(security list-keychains -d user | tr -d '"')+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$P12_PASSWORD" "$KEYCHAIN_PATH"+ IDENTITY=$(security find-identity -v -p codesigning "$KEYCHAIN_PATH" | \+ grep -oE '"Developer ID Application:[^"]+"' | head -1 | tr -d '"')+ if [ -z "${IDENTITY}" ]; then+ echo "::error::No Developer ID Application identity found in imported keychain"+ security find-identity -v "$KEYCHAIN_PATH" || true+ exit 1+ fi+ echo "Using identity: ${IDENTITY}"+ echo "SIGNING_IDENTITY=${IDENTITY}" >> "$GITHUB_ENV"+ rm -f "$P12_PATH"++ - name: Sign bundle with hardened runtime+ working-directory: fincept-qt+ run: |+ set -euo pipefail+ APP_BUNDLE="build/${{ env.APP_NAME }}.app"+ ENT="$RUNNER_TEMP/entitlements.plist"+ cat > "$ENT" <<'EOF'+ <?xml version="1.0" encoding="UTF-8"?>+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+ <plist version="1.0"><dict>+ <key>com.apple.security.cs.allow-jit</key><true/>+ <key>com.apple.security.cs.allow-unsigned-executable-memory</key><true/>+ <key>com.apple.security.cs.allow-dyld-environment-variables</key><true/>+ <key>com.apple.security.cs.disable-library-validation</key><true/>+ <key>com.apple.security.network.client</key><true/>+ <key>com.apple.security.network.server</key><true/>+ </dict></plist>+ EOF++ echo "Stripping extended attributes..."+ xattr -cr "${APP_BUNDLE}" 2>/dev/null || true++ SIGN_FLAGS=(--force --options runtime --timestamp --sign "$SIGNING_IDENTITY")++ # Enumerate every Mach-O EXCEPT the bundle's main executable.+ MACHO_LIST="$RUNNER_TEMP/macho-files.txt"+ MAIN_EXE="${APP_BUNDLE}/Contents/MacOS/${{ env.APP_NAME }}"+ : > "${MACHO_LIST}"+ while IFS= read -r f; do+ [ "$f" = "${MAIN_EXE}" ] && continue+ if file -h "$f" 2>/dev/null | grep -q "Mach-O"; then+ printf '%s\n' "$f" >> "${MACHO_LIST}"+ fi+ done < <(find "${APP_BUNDLE}" -type f 2>/dev/null)+ MACHO_COUNT=$(wc -l < "${MACHO_LIST}" | tr -d ' ')+ echo " ${MACHO_COUNT} Mach-O(s) to sign (main exe is signed at bundle root)"++ echo "Removing any pre-existing signatures..."+ while IFS= read -r f; do+ codesign --remove-signature "$f" 2>/dev/null || true+ done < "${MACHO_LIST}"+ codesign --remove-signature "${MAIN_EXE}" 2>/dev/null || true+ codesign --remove-signature "${APP_BUNDLE}" 2>/dev/null || true++ echo "Signing every Mach-O leaf..."+ while IFS= read -r f; do+ codesign "${SIGN_FLAGS[@]}" "$f" >/dev/null+ done < "${MACHO_LIST}"++ echo "Signing nested frameworks / .app bundles (deepest first)..."+ BUNDLE_COUNT=0+ while IFS= read -r d; do+ codesign "${SIGN_FLAGS[@]}" "$d" >/dev/null+ BUNDLE_COUNT=$((BUNDLE_COUNT + 1))+ done < <(find "${APP_BUNDLE}/Contents" -mindepth 1 -depth -type d \+ \( -name "*.framework" -o -name "*.app" \) 2>/dev/null)+ echo " signed ${BUNDLE_COUNT} nested bundles"++ echo "Signing top-level bundle with entitlements..."+ codesign --force --options runtime --timestamp \+ --entitlements "$ENT" \+ --sign "$SIGNING_IDENTITY" \+ "${APP_BUNDLE}"++ echo "Verifying signature..."+ codesign --verify --deep --strict --verbose=2 "${APP_BUNDLE}"+ codesign --display --verbose=2 "${APP_BUNDLE}" 2>&1 | head -20++ - name: Pre-flight checks (no notary)+ working-directory: fincept-qt+ run: |+ set -euo pipefail+ APP_BUNDLE="build/${{ env.APP_NAME }}.app"+ MAIN_EXE="${APP_BUNDLE}/Contents/MacOS/${{ env.APP_NAME }}"+ MACHO_LIST="$RUNNER_TEMP/preflight-macho.txt"+ : > "${MACHO_LIST}"+ while IFS= read -r f; do+ if file -h "$f" 2>/dev/null | grep -q "Mach-O"; then+ printf '%s\n' "$f" >> "${MACHO_LIST}"+ fi+ done < <(find "${APP_BUNDLE}" -type f 2>/dev/null)+ MACHO_COUNT=$(wc -l < "${MACHO_LIST}" | tr -d ' ')++ BAD_RUNTIME=()+ BAD_TIMESTAMP=()+ BAD_ARCH=()+ while IFS= read -r f; do+ DISPLAY=$(codesign --display --verbose=2 "$f" 2>&1 || true)+ echo "${DISPLAY}" | grep -q "flags=.*runtime" || BAD_RUNTIME+=("$f")+ echo "${DISPLAY}" | grep -q "Timestamp=" || BAD_TIMESTAMP+=("$f")+ ARCHS=$(file -h "$f" 2>/dev/null | grep -oE "(arm64|x86_64|i386|ppc)" | sort -u | tr '\n' ',' | sed 's/,$//')+ [ "${ARCHS}" = "arm64" ] || BAD_ARCH+=("${f} [${ARCHS}]")+ done < "${MACHO_LIST}"++ OK=1+ if [ "${#BAD_RUNTIME[@]}" -gt 0 ]; then+ OK=0+ echo "::error::${#BAD_RUNTIME[@]} Mach-O(s) missing hardened runtime:"+ printf ' %s\n' "${BAD_RUNTIME[@]}" | head -30+ fi+ if [ "${#BAD_TIMESTAMP[@]}" -gt 0 ]; then+ OK=0+ echo "::error::${#BAD_TIMESTAMP[@]} Mach-O(s) missing secure timestamp:"+ printf ' %s\n' "${BAD_TIMESTAMP[@]}" | head -30+ fi+ if [ "${#BAD_ARCH[@]}" -gt 0 ]; then+ OK=0+ echo "::error::${#BAD_ARCH[@]} Mach-O(s) with unexpected arch (this build is arm64-only):"+ printf ' %s\n' "${BAD_ARCH[@]}" | head -30+ fi+ if codesign --display --entitlements - "${APP_BUNDLE}" 2>/dev/null | grep -q "get-task-allow"; then+ OK=0+ echo "::error::get-task-allow entitlement present — would block notarization"+ fi++ if [ "${OK}" -ne 1 ]; then+ echo "::error::Pre-flight FAILED"+ exit 1+ fi+ echo "Pre-flight PASSED: ${MACHO_COUNT} Mach-O(s), all arm64 + hardened-runtime + timestamped"++ - name: Upload signed bundle (zipped)+ if: always()+ uses: actions/upload-artifact@v4+ with:+ name: FinceptTerminal-signed-macos-arm64+ path: fincept-qt/build/FinceptTerminal.app+ retention-days: 7diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 348c1cf5b..40e190345 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -930,6 +930,43 @@ jobs:echo "=== Bundle Frameworks/ contents ==="ls -la "${FRAMEWORKS}" | head -50+ # ── Thin universal Mach-Os to arm64 ─────────────────────────────────+ # jurplel/install-qt-action@v4 / aqtinstall ships Qt 6.x macOS as a+ # universal (arm64+x86_64) binary — Qt 6.2+ only publishes one macOS+ # archive labelled `clang_64` that contains both slices fused with+ # lipo. macdeployqt copies those frameworks/plugins into the bundle+ # untouched, which leaves ~36 fat Mach-Os in Contents/Frameworks/+ # and Contents/PlugIns/ while the app binary itself was built+ # arm64-only via -DCMAKE_OSX_ARCHITECTURES=arm64.+ #+ # The pre-flight architecture check below requires exactly one+ # arm64 slice per Mach-O (we ship an arm64-only DMG), so we walk+ # every Mach-O and strip x86_64 with `lipo -thin arm64`. Must run+ # BEFORE codesign — any signature applied before thinning is+ # invalidated the moment we rewrite the file.+ echo "Thinning universal Mach-Os to arm64..."+ THINNED_COUNT=0+ while IFS= read -r f; do+ file -h "$f" 2>/dev/null | grep -q "Mach-O" || continue+ # Skip if already single-arch (saves a fork+exec per file).+ ARCHS=$(file -h "$f" 2>/dev/null | grep -oE "(arm64|x86_64|i386|ppc)" | sort -u | tr '\n' ',' | sed 's/,$//')+ [ "${ARCHS}" = "arm64" ] && continue+ # Skip files with no arm64 slice at all (shouldn't happen for+ # Qt's universal build, but guard against surprises in third-+ # party dylibs that bundle_external_deps may have pulled in).+ if ! echo "${ARCHS}" | grep -q "arm64"; then+ echo "::warning::no arm64 slice in $f (archs: ${ARCHS}) — leaving as-is"+ continue+ fi+ chmod u+w "$f" 2>/dev/null || true+ if lipo -thin arm64 "$f" -output "$f" 2>/dev/null; then+ THINNED_COUNT=$((THINNED_COUNT + 1))+ else+ echo "::warning::lipo -thin arm64 failed for $f"+ fi+ done < <(find "${APP_BUNDLE}" -type f 2>/dev/null)+ echo " thinned ${THINNED_COUNT} Mach-O(s) to arm64"+# ── Import Developer ID certificate into a temp keychain ──────────────# The cert + private key live in repo secrets (base64-encoded .p12).# We provision a throwaway keychain for this job so the runner's