From 877723ab4a52ea54531be01551a2f470bc04061a Mon Sep 17 00:00:00 2001 From: claude_dev Date: Fri, 9 Oct 2026 11:51:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(api+frontend):=20D7=20=E8=90=BD=E6=88=90?= =?UTF-8?q?=E8=BE=B9=E4=BA=AE=E7=81=AF=E2=80=94=E2=80=94=E5=81=87=E8=AE=BE?= =?UTF-8?q?=E2=86=92=E5=9B=A0=E5=AD=90=E8=BE=B9=E5=8F=AF=E8=A7=81=E6=80=A7?= =?UTF-8?q?=E4=B8=89=E5=A4=84=20[vps]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 体验稿(8823)逐条过审拍板后动工,不造新机器只做可见性: 件① 三件套(spec §7): - 1a 卡片已产因子清单:列表项内联 factors(registry hypothesis 血统反查:名/表达式/origin/落成日);单因子名 factorId 前端退役 - 1b 分解批次历史:GET /pipeline/hypotheses/{id}/decompose-jobs 台账新→旧(QA tasks/list 端点形状照抄),卡片折叠区按需拉取 - 1c 轮次进度:run_decompose 每轮 on_progress 回调→内存 job progress(currentRound/totalRounds/passed/regen;真轮数非 QA 摆设), 台账仍只记起跑+终态;worker 协议改收 job_id 件② 工厂来源列:factors 端点带 origin/hypothesis 血统, ⚡decomposer/✍manual 徽标+回链假设池 件③ 琥珀待办:todos 聚合加 queued/data_check 卡(已确认未分解), 分解转 building 即消行——人工卡点②显性化 件④ 结果持久落卡:前端一次性弹层退役,终态摘要+清单+批次全在卡 测试:后端 TestD7Visibility 六件(历史端点/内联清单/进度中飞可见/ 终态不带过程态/琥珀消行/工厂血统)+前端三件套三测;8 目录 2780 绿 --- ...2026-10-08-pipeline-console-ux-redesign.md | 1 + frontend/src/api/pipeline.smoke.spec.ts | 2 +- frontend/src/api/pipeline.ts | 29 +++ frontend/src/views/pipeline/FactorFactory.vue | 18 ++ .../src/views/pipeline/HypothesisPool.spec.ts | 71 +++++- .../src/views/pipeline/HypothesisPool.vue | 204 +++++++++++++----- sanguo_api/decompose_jobs.py | 23 +- sanguo_api/hypothesis_decompose.py | 13 +- sanguo_api/routes_pipeline.py | 63 +++++- sanguo_portfolio/pipeline_store.py | 31 ++- tests/api/test_routes_pipeline_hypotheses.py | 138 ++++++++++++ 11 files changed, 521 insertions(+), 72 deletions(-) diff --git a/docs/superpowers/specs/2026-10-08-pipeline-console-ux-redesign.md b/docs/superpowers/specs/2026-10-08-pipeline-console-ux-redesign.md index ee738ead..9c73af4f 100644 --- a/docs/superpowers/specs/2026-10-08-pipeline-console-ux-redesign.md +++ b/docs/superpowers/specs/2026-10-08-pipeline-console-ux-redesign.md @@ -121,3 +121,4 @@ spec 逐节拍板 → writing-plans 出实施计划 → 分域派单:②权重 - 2026-10-08 v0.5 初稿落档(81adfbc,与调研报告同 commit;备案 69cff60 补挂 [nas] 标签) - 2026-10-08 晚:D7 定案(落成边亮灯——「机器在灯没开」定谳 + 可见性四件 + 出厂验收线 + 供给源可插拔);新增 §7,原 §7-§10 顺延为 §8-§11;QuantaAlpha 因子出生边调研报告入库。同日用户 VPS 实测「AI 生成草稿」报 LLM 上游异常——修复先行于改造(调通后按 spec 对比验收) - 2026-10-09:LLM 链两连修上产(端点错配 85d14a1 + client 全流式化 acc273b,QA 同款);**生产首批 origin:decomposer 因子落册**(高管增持卡,D7 零实绩破局);终局诊断=响应孤儿化(服务端成功+浏览器断连无感知),治本=**分解 job 化**(QA 任务字典范式:202 立返+后台任务+卡片 decomposeJob 轮询+decompose_jobs 台账表)——§7 件④地基落,总设计 §13 P5.3 同步;生产全程验证通过(job-20261009101513:202 秒回→3 轮 2m43s→8 因子 0 失败);件①扩为三件套(产物清单+批次历史+轮次进度,QA 调研:progress 字段结构/tasks-list 端点照抄,currentRound 摆设我们用真轮数,WS 直播归 D2) +- 2026-10-09 晚:**D7 真实现落地**(8823 体验稿逐条过审拍板后动工):件①1a=列表项内联 `factors` 清单(registry hypothesis 血统反查:名/表达式/origin/落成日;卡片单因子名 factorId 前端退役);1b=新端点 `GET /pipeline/hypotheses/{id}/decompose-jobs`(台账新→旧,QA tasks/list 形状)+卡片折叠区按需拉取;1c=`run_decompose` 每轮 `on_progress` 回调→内存 job `progress`(currentRound/totalRounds/passed/regen/message;台账仍只记起跑+终态),worker 协议改收 job_id;件②=factors 端点带 origin/hypothesis+工厂「来源」列(⚡decomposer/✍manual 徽标+回链假设池);件③=todos 聚合加 queued/data_check 卡琥珀待办(分解转 building 即消行,人工卡点②显性化);件④=前端一次性结果弹层退役,结果持久落卡。测试=后端 TestD7Visibility 六件+前端三件套三测 diff --git a/frontend/src/api/pipeline.smoke.spec.ts b/frontend/src/api/pipeline.smoke.spec.ts index 7a0e1a13..1d84d2c2 100644 --- a/frontend/src/api/pipeline.smoke.spec.ts +++ b/frontend/src/api/pipeline.smoke.spec.ts @@ -8,7 +8,7 @@ describe('api/pipeline 契约', () => { api.getCompositeVersions, api.getLadder, api.getAttribution, api.getResearchCard, api.getIcTrend, api.getLlmConfig, api.updateLlmConfig, api.testLlmConnection, - api.startDecompose, + api.startDecompose, api.getDecomposeJobs, api.getEnvStatus, api.getMonthlyStatus, ]) { expect(typeof fn).toBe('function') diff --git a/frontend/src/api/pipeline.ts b/frontend/src/api/pipeline.ts index ba914bd9..ed0d0156 100644 --- a/frontend/src/api/pipeline.ts +++ b/frontend/src/api/pipeline.ts @@ -24,6 +24,16 @@ export interface Hypothesis { factorId?: string deathReason?: string decomposeJob?: DecomposeJob | null + factors?: HypothesisFactor[] +} + +// D7 件①1a:卡片已产因子清单(registry hypothesis 血统反查,内联于列表) +export interface HypothesisFactor { + name: string + expression: string | null + origin: string + createdAt: string | null + status: string } export type FactorStatus = 'incubating' | 'assessable' | 'promoted' | 'decaying' | 'retired' @@ -33,6 +43,8 @@ export interface PipelineFactor { category: 'fundamental' | 'pledge' | 'research' | 'sentiment' | 'technical' version: string status: FactorStatus + origin?: string // D7 件②:decomposer/manual 身份戳 + hypothesis?: string | null // 来源假设卡回链血统 icRecentT: number | null icFullT: number | null promotedAtT: number | null @@ -317,6 +329,16 @@ export interface DecomposeJob { error: string | null startedAt: string | null finishedAt: string | null + // D7 件①1c:在飞轮次进度(内存态,终态为 null/缺省) + progress?: DecomposeProgress | null +} + +export interface DecomposeProgress { + currentRound: number + totalRounds: number + passed: number + regen: number + message: string } // 分解 job 化(10-09,QA 范式):POST 立返 202+后台任务,浏览器不再扛 @@ -328,6 +350,13 @@ export async function startDecompose(id: string): Promise { return data.job } +// D7 件①1b:该卡分解批次历史(台账新→旧,卡片折叠区按需拉取) +export async function getDecomposeJobs(id: string): Promise { + const { data } = await apiClient.get<{ items: DecomposeJob[] }>( + `/pipeline/hypotheses/${id}/decompose-jobs`) + return data.items +} + // —— P5.2/P5.6 设置页状态卡(只读,spec §13)—— export interface EnvStatusItem { diff --git a/frontend/src/views/pipeline/FactorFactory.vue b/frontend/src/views/pipeline/FactorFactory.vue index d27614a5..8ed2d222 100644 --- a/frontend/src/views/pipeline/FactorFactory.vue +++ b/frontend/src/views/pipeline/FactorFactory.vue @@ -1,5 +1,6 @@