feat(evolution): E1 生产闭环 + 多租户隔离修复 - #159
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 因子候选池 /candidates 移除 auth:false:factor 服务要求 JWT,缺 Authorization 头 被误报为「未连接数据库」 - 活动流 permissions 走默认 auth(649f948 后需 JWT,否则审批列表消失) - 活动流移除系统级 scheduler runs(非账户事件,跨账户泄露),仅保留 /scheduler/jobs 做 KPI Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
多用户上线后发现风控日志跨账户泄露:risk_locks 表无 account_id 列,/risk/locks 只按 get_current_user 认证不按账户过滤;RiskGuard.check 写锁也不带 account_id, 导致 A 用户的锁拦到 B 用户下单,且 B 用户能在风控面板看到 A 的锁。 - 0040 迁移:risk_locks 补 account_id TEXT + (account_id, locked_at DESC) 索引 - storage/risk_locks 各函数加可选 account_id 过滤(默认 None 不过滤,兼容 backtest/reconciler) - RiskGuard / RiskGuardFactory 注入账户归属;API 层按 account_id_from_user 过滤 - 新增跨账户隔离测试 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying inalpha-web with
|
| Latest commit: |
512f5ff
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://150ae95e.inalpha-web.pages.dev |
| Branch Preview URL: | https://feat-e1-evolution-production.inalpha-web.pages.dev |
…duction # Conflicts: # packages/orchestration/src/hooks/with-hooks.ts # packages/orchestration/src/mastra/wired-tools.ts
|
Review base: 14928f0 🤖 DeepSeek V4 Pro PR Review |
added 3 commits
August 25, 2026 14:08
alembic.ini 的 script_location=. 相对 CWD 解析;原在 services/evolver 下 用 -c ../../infra/migrations/alembic.ini 会找 services/evolver/env.py。 改为 working-directory: infra/migrations + uv run --project ../../services/evolver, 与生产容器(cd /app/migrations && uv --project /app/paper run alembic)和 迁移测试 helper(cwd=ROOT)保持一致。
- alembic 步骤迁移到 inalpha_migration_ci_test(CI service 已创建), 而不是无人创建的 inalpha_test - 新增 EVOLVER_TEST_DATABASE_URL 指向同一库,让 evolver 存储/E2E 测试 能连上已迁移 schema 的数据库(此前缺省连 5433/inalpha_evo_test,CI 无此库)
conftest 用 TEST_JWT_SECRET 签 token 并 setdefault;job env 的 ci-test-secret-do-not-use 会覆盖它导致服务端验签失败 → 119 个 401。 改为与 conftest 完全一致的测试密钥。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
E1 演化生产闭环收口:单代演化持久化异步闭环、显式审批闸门、候选源码隔离执行,并在多用户试用中修复 4 个多租户隔离问题。
多租户隔离修复(本次新增)
factor服务要求 JWT,前端backendFetch却带auth: false,缺 Authorization 头被误报为「未连接数据库」。移除auth: false。/permissions/*仍走auth: false导致审批拉不到。改走默认 auth。risk_locks表无account_id,A 用户的锁会拦到 B 用户下单、B 能看到 A 的锁。新增 0040 迁移补account_id+ 索引,存储层 / RiskGuard / API 全链路按账户过滤。/scheduler/jobs只读状态做 KPI。说明
down_revision指向 0038;0039(evolutionllm_snapshot)为并行 WIP、未含在本次 PR,后并 main 者需按约定修链,勿留双头。owner_llm/approval/llm_snapshot等)属并行 WIP,不在本次 PR 范围。🤖 Generated with Claude Code