feat(v2): 补齐模型连接与会议反馈闭环并完成真实模拟联调

This commit is contained in:
2026-10-01 14:13:58 +08:00
parent fa4163b2d0
commit 8c5999c786
21 changed files with 392 additions and 15 deletions
+21
View File
@@ -0,0 +1,21 @@
param([int]$FrontendPort=3220,[int]$BackendPort=8020)
$ErrorActionPreference='Stop'
$projectRoot=Split-Path $PSScriptRoot -Parent
$python=Join-Path $projectRoot 'backend/venv/Scripts/python.exe'
$next=Join-Path $projectRoot 'node_modules/next/dist/bin/next'
if(!(Test-Path -LiteralPath $python) -or !(Test-Path -LiteralPath $next)){throw '请先安装项目依赖,必须使用backend/venv。'}
if(!(Test-Path -LiteralPath (Join-Path $projectRoot '.next/BUILD_ID'))){throw '请先在项目根目录执行npm run build。'}
foreach($port in @($FrontendPort,$BackendPort)){
if(Get-NetTCPConnection -State Listen -LocalPort $port -ErrorAction SilentlyContinue){throw "端口$port已占用;本脚本不会停止现有服务。"}
}
$evidence=Join-Path $projectRoot 'test-evidence'
New-Item -ItemType Directory -Path $evidence -Force | Out-Null
$stamp=Get-Date -Format 'yyyyMMdd-HHmmss'
$env:NO_PROXY='*';$env:HTTP_PROXY='';$env:HTTPS_PROXY='';$env:ALL_PROXY=''
$env:RISK_AGENT_BACKEND_URL="http://127.0.0.1:$BackendPort"
$env:XINGBANG_DEMO_ROLE_LOGIN='1'
$backend=Start-Process -FilePath $python -ArgumentList '-m','uvicorn','app:app','--host','127.0.0.1','--port',"$BackendPort" -WorkingDirectory (Join-Path $projectRoot 'backend') -WindowStyle Hidden -RedirectStandardOutput (Join-Path $evidence "$stamp-backend.out.log") -RedirectStandardError (Join-Path $evidence "$stamp-backend.err.log") -PassThru
$frontend=Start-Process -FilePath (Get-Command node).Source -ArgumentList $next,'start','--hostname','127.0.0.1','--port',"$FrontendPort" -WorkingDirectory $projectRoot -WindowStyle Hidden -RedirectStandardOutput (Join-Path $evidence "$stamp-frontend.out.log") -RedirectStandardError (Join-Path $evidence "$stamp-frontend.err.log") -PassThru
@{backend_launcher_pid=$backend.Id;frontend_pid=$frontend.Id;frontend_port=$FrontendPort;backend_port=$BackendPort;created_at=$stamp} | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $evidence "$stamp-preview-processes.json")
Write-Output "新版入口:http://127.0.0.1:$FrontendPort/experience-center"
Write-Output '日志与本任务进程信息已保存到test-evidence;旧版服务没有停止。'
+11
View File
@@ -0,0 +1,11 @@
const assert=require('node:assert/strict'),fs=require('node:fs');
const read=p=>fs.readFileSync(p,'utf8');
const model=read('src/components/xingbang/ModelConnectionPanel.tsx');
for(const route of ['/library/model-settings','/library/model-settings/probe'])assert(model.includes(route));
assert(model.includes('type="password"'));assert(model.includes('managed_by'));assert(model.includes('api_key:key||null'));
const feedback=read('src/components/xingbang/MeetingFeedbackPanel.tsx');assert(feedback.includes('/feedback'));assert(feedback.includes('rate===null'));assert(feedback.includes('report.excluded'));
assert(read('src/app/trajectory-center/page.tsx').includes('<MeetingFeedbackPanel'));
assert(read('src/components/xingbang/LeaseLibraryWorkbench.tsx').includes('<ModelConnectionPanel'));
assert(read('src/components/xingbang/TrajectoryPanel.tsx').includes('mapping_confirmed'));
const publish=read('src/components/xingbang/ImprovementPanel.tsx').match(/const canPublish[^;]+/)[0];assert(publish.includes('"admin"'));assert(!publish.includes('reviewer'));
console.log('completion-ui: PASS (source guards; not browser verification)');
+1
View File
@@ -218,6 +218,7 @@ def main() -> int:
("module-shell-ui", [executable("node"), "scripts/test_module_shell_ui.cjs"], ROOT),
("improvement-panel-ui", [executable("node"), "scripts/test_improvement_panel.cjs"], ROOT),
("v2-sqlite-workbench-ui", [executable("node"), "scripts/test_v2_sqlite_workbench.cjs"], ROOT),
("completion-ui", [executable("node"), "scripts/test_completion_ui.cjs"], ROOT),
("frontend-build", [npm, "run", "build"], ROOT),
("compose-local-config", [docker, "compose", "-f", "docker-compose.yml", "config", "--quiet"], ROOT),
("compose-aliyun-config", [docker, "compose", "--env-file", "deploy/aliyun.env.example", "-f", "deploy/docker-compose.aliyun.yml", "config", "--quiet"], ROOT),