mirror of
https://github.com/ZhuLinsen/daily_stock_analysis
synced 2026-09-20 10:53:33 +08:00
feat: add lightweight AlphaSift screening integration (#1443)
* feat: add lightweight AlphaSift screening integration * fix(review-feedback-1443): 解决冲突后重新确认受影响文件和 CI 结果 and Restrict install spec before executing pip * fix(review-feedback-1443): add a feature/auth gate before invoking installation side effects * fix: repair AlphaSift enable flow * fix(review-feedback-1443): Enable config before calling AlphaSift install * fix(review-feedback-1443): re-fetch status in the error path to avoid this UI/backend state * fix(review-feedback-1443): 补充对应回归测试 * fix(review-feedback-1443): 补充对应测试 * fix(review-feedback-1443): api/v1/endpoints/alphasift.py 的状态接口会返回 ALPHASIFT INSTALL SPEC,而项目默认 * fix(review-feedback-1443): 补一个前端用例覆盖 * fix(review-feedback-1443): 解决冲突后再合入 * fix(review-feedback-1443): 解决后再重新确认 diff 与 CI 结果 * fix(review-feedback-1443): 解决冲突并确认解决后的 diff 未引入新风险 * fix(review-feedback-1443): Read picks from AlphaSift ScreenResult and Use AlphaSift's actual * fix(review-feedback-1443): 修正 * fix(review-feedback-1443): 解决冲突并重新确认 CI/Web gate 结果 * fix(review-feedback-1443): 解决冲突并重新确认 CI/Web gate,另外需要澄清本次 diff 中 LLM 配置相关改动是否属于本 PR 范围及其兼容性影响 * fix(review-feedback-1443): 解决冲突,并补齐受影响前端构建/测试验证后再合入 * fix(review-feedback-1443): 解决冲突,并补齐受影响前端 Web gate 或等价 CI 证据后再合入 * fix(review-feedback-1443): 解决冲突,并补齐受影响 Web gate 与兼容性验证说明后再合入 * fix(review-feedback-1443): mark this field sensitive and/or display only a masked/sanitized source * fix(review-feedback-1443): 解决冲突,并补齐受影响前端验证与外部兼容性说明后再合入 * fix(review-feedback-1443): 解决冲突,并补齐冲突解决后的验证结果后再合入 * fix(review-feedback-1443): 解决冲突,并补齐受影响后端/Web 验证证据后再合入 * fix(review-feedback-1443): 解决冲突后基于最终 head 重新给出验证结论,否则无法确认最终合入内容与当前审查内容一致 * fix(review-feedback-1443): 解决冲突并补齐冲突后的验证结论 * fix(review-feedback-1443): Clear stale candidates when strategy changes * fix(review-feedback-1443): preserve TestClient cookies across requests * fix(review-feedback-1443): 解决冲突并基于冲突后的最终 head 重新确认受影响验证,当前不能直接合入 * fix(review-feedback-1443): 补回归测试 * fix(review-feedback-1443): 补后端回归测试 * fix(review-feedback-1443): 解决冲突,并在解决后重新给出基于最终 head 的验证结果 * fix(review-feedback-1443): 解决冲突并基于最终 diff 重新确认验证结果 * fix(review-feedback-1443): 解决冲突,并在冲突解决后的最终 head 上重新给出后端与 Web 相关验证结论 * fix(review-feedback-1443): 解决冲突,并在最终 head 上重新确认后端、Web 和文档改动仍一致 * fix(review-feedback-1443): 当前 PR 存在合并冲突,虽然 CI 摘要为 success,但冲突解决后的最终代码和验证结果尚未形成,当前不能直接合入 * fix(review-feedback-1443): 解决冲突并补齐验证 * fix(review-feedback-1443): 解决冲突 * fix(review-feedback-1443): 修正测试客户端生命周期问题,并补齐前端 lint/build 验证 * fix(review-feedback-1443): 解决冲突 * feat: refine AlphaSift adapter integration * fix: restore settings help metadata for CI * fix(review-feedback-1443): Do not run lifespan for non-context TestClient requests * fix(review-feedback-1443): Pin AlphaSift install source to an immutable ref * fix(review-feedback-1443): 补齐后再合入 * fix: harden alphasift review feedback * fix(review-feedback-1443): api/v1/endpoints/alphasift.py:自动安装路径在 adapter 可导入但 get status 返回 * fix: package alphasift endpoint in desktop build * fix: bundle alphasift in desktop builds * fix(review-feedback-1443): docs/alphasift-integration.md 中 AlphaSift adapter contract / * fix: honor empty alphasift install spec * fix: bundle alphasift in docker image
This commit is contained in:
@@ -46,11 +46,26 @@ if ($LASTEXITCODE -ne 0) {
|
||||
throw "pip install -r requirements.txt failed with exit code $LASTEXITCODE."
|
||||
}
|
||||
|
||||
Write-Host 'Bundling AlphaSift desktop dependency...'
|
||||
$alphaSiftInstallSpec = (& $pythonBin -c "from src.config import DEFAULT_ALPHASIFT_INSTALL_SPEC; print(DEFAULT_ALPHASIFT_INSTALL_SPEC)").Trim()
|
||||
if ([string]::IsNullOrWhiteSpace($alphaSiftInstallSpec)) {
|
||||
throw 'DEFAULT_ALPHASIFT_INSTALL_SPEC is empty; cannot bundle AlphaSift for desktop.'
|
||||
}
|
||||
& $pythonBin -m pip install $alphaSiftInstallSpec
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "pip install AlphaSift failed with exit code $LASTEXITCODE."
|
||||
}
|
||||
|
||||
Write-Host 'Checking python-multipart availability...'
|
||||
if (-not (Test-PythonCode -Python $pythonBin -Code "import multipart, multipart.multipart")) {
|
||||
throw 'python-multipart is not importable in the selected Python environment.'
|
||||
}
|
||||
|
||||
Write-Host 'Checking AlphaSift adapter availability...'
|
||||
if (-not (Test-PythonCode -Python $pythonBin -Code "import alphasift.dsa_adapter")) {
|
||||
throw 'alphasift.dsa_adapter is not importable after installing AlphaSift.'
|
||||
}
|
||||
|
||||
if (Test-Path 'dist\backend') {
|
||||
Remove-Item -Recurse -Force 'dist\backend'
|
||||
}
|
||||
@@ -81,6 +96,9 @@ $hiddenImports = @(
|
||||
'api.v1.endpoints.history',
|
||||
'api.v1.endpoints.stocks',
|
||||
'api.v1.endpoints.health',
|
||||
'api.v1.endpoints.alphasift',
|
||||
'alphasift',
|
||||
'alphasift.dsa_adapter',
|
||||
'api.v1.schemas',
|
||||
'api.v1.schemas.analysis',
|
||||
'api.v1.schemas.history',
|
||||
@@ -114,7 +132,8 @@ $pyInstallerArgs = @(
|
||||
'--add-data', 'static;static',
|
||||
'--add-data', 'strategies;strategies',
|
||||
'--collect-data', 'litellm',
|
||||
'--collect-data', 'tiktoken'
|
||||
'--collect-data', 'tiktoken',
|
||||
'--collect-all', 'alphasift'
|
||||
)
|
||||
$pyInstallerArgs += $hiddenImportArgs
|
||||
$pyInstallerArgs += 'main.py'
|
||||
|
||||
Reference in New Issue
Block a user