diff --git a/CHANGELOG.md b/CHANGELOG.md index be8b62e1..edbb02bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2026-11-15 · 简化新建深度测评 + +- 将允许范围调整为「补充限制与排除项(选填)」,验收条件也标记选填,提供简短说明和示例。 +- 两项留空时沿用完整目标,显式填写的内容保持独立;保存草稿与原批量任务行为不变。 + ## 2026-11-15 · 深度测评关联跳转实机修复 - 定时刷新保留已展开的独立复核记录和探索图来源引用,避免返回链接在阅读时消失。 diff --git a/docs/zh-CN/deep-assessments.md b/docs/zh-CN/deep-assessments.md index 85412f28..37088838 100644 --- a/docs/zh-CN/deep-assessments.md +++ b/docs/zh-CN/deep-assessments.md @@ -4,7 +4,7 @@ ## 持续执行 -新建只填写名称、目标、范围、验收条件,可选模型、角色、项目、并行步骤和重启恢复。保存为草稿,点击「开始 / 继续」才执行。 +新建填写名称和目标即可。「补充限制与排除项」「验收条件」均为选填,留空或仅有空白字符时沿用目标;填写的补充内容会独立保留。表单提供简短说明与填写示例。模型、角色、项目、并行步骤和重启恢复也可选配。保存为草稿,点击「开始 / 继续」才执行。 **任务没有时间窗口、累计 Token、规划轮数、总步骤数或累计执行分段次数上限。** Token 和轮次保留为观测统计,不触发任务结束。任务围绕验收条件推进,直到完成、用户暂停/停止,或需要用户补充信息、核对结果不明的操作。 diff --git a/internal/deepassessment/types.go b/internal/deepassessment/types.go index c00f0989..361e7c82 100644 --- a/internal/deepassessment/types.go +++ b/internal/deepassessment/types.go @@ -107,12 +107,17 @@ type Runtime interface { } func (t *Task) Validate() error { + criteriaLimit := 8000 + // Inheriting the objective must not truncate or reject an otherwise valid goal. + if t.Criteria == t.Objective { + criteriaLimit = 16000 + } for _, f := range []struct { value string max int name string }{ - {t.Name, 200, "name"}, {t.Objective, 16000, "objective"}, {t.Scope, 16000, "scope"}, {t.Criteria, 8000, "criteria"}, + {t.Name, 200, "name"}, {t.Objective, 16000, "objective"}, {t.Scope, 16000, "scope"}, {t.Criteria, criteriaLimit, "criteria"}, } { if strings.TrimSpace(f.value) == "" || utf8.RuneCountInString(f.value) > f.max { return fmt.Errorf("%s is required (maximum %d characters)", f.name, f.max) diff --git a/internal/handler/deep_assessment.go b/internal/handler/deep_assessment.go index 9c4d3fef..7bf87a7f 100644 --- a/internal/handler/deep_assessment.go +++ b/internal/handler/deep_assessment.go @@ -176,6 +176,9 @@ func (h *AgentHandler) CreateDeepAssessment(c *gin.Context) { c.JSON(403, gin.H{"error": "无权访问项目"}) return } + if strings.TrimSpace(req.Scope) == "" { + req.Scope = req.Objective + } if strings.TrimSpace(req.Criteria) == "" { req.Criteria = req.Objective } diff --git a/internal/handler/deep_assessment_test.go b/internal/handler/deep_assessment_test.go index 5d863c2e..d5bae816 100644 --- a/internal/handler/deep_assessment_test.go +++ b/internal/handler/deep_assessment_test.go @@ -239,6 +239,63 @@ func TestDeepAssessmentCreateOnlySavesDraftAndRejectsOversizedBody(t *testing.T) } } +func TestDeepAssessmentOptionalFieldsInheritObjective(t *testing.T) { + h, owner := deepAssessmentFixture(t) + router := assessmentRouter(h, owner.OwnerID) + for _, tc := range []struct { + name, objective string + extra map[string]string + wantScope, wantCriteria string + wantStatus int + }{ + {"omitted", " inspect fixture ", nil, "inspect fixture", "inspect fixture", 201}, + {"whitespace", "inspect fixture", map[string]string{"scope": " \n\t ", "criteria": " \t "}, "inspect fixture", "inspect fixture", 201}, + {"custom scope", "inspect fixture", map[string]string{"scope": " exclude payments "}, "exclude payments", "inspect fixture", 201}, + {"custom criteria", "inspect fixture", map[string]string{"criteria": " report evidence "}, "inspect fixture", "report evidence", 201}, + {"both supplied", "inspect fixture", map[string]string{"scope": " local only ", "criteria": " original evidence "}, "local only", "original evidence", 201}, + {"long inherited goal", strings.Repeat("目", 9000), nil, strings.Repeat("目", 9000), strings.Repeat("目", 9000), 201}, + {"missing goal", "", nil, "", "", 400}, + {"explicit criteria too long", "inspect fixture", map[string]string{"criteria": strings.Repeat("x", 8001)}, "", "", 400}, + } { + t.Run(tc.name, func(t *testing.T) { + values := map[string]string{"name": "optional " + tc.name, "objective": tc.objective} + for k, v := range tc.extra { + values[k] = v + } + body, err := json.Marshal(values) + if err != nil { + t.Fatal(err) + } + request := httptest.NewRequest("POST", "/api/deep-assessments", strings.NewReader(string(body))) + request.Header.Set("Content-Type", "application/json") + w := httptest.NewRecorder() + router.ServeHTTP(w, request) + if w.Code != tc.wantStatus { + t.Fatalf("status=%d want=%d", w.Code, tc.wantStatus) + } + if w.Code != 201 { + return + } + var result struct { + Task deepassessment.Task `json:"task"` + } + if err = json.Unmarshal(w.Body.Bytes(), &result); err != nil { + t.Fatal(err) + } + saved, err := h.deepAssessments.Store.Get(result.Task.ID) + if err != nil { + t.Fatal(err) + } + if saved.Scope != tc.wantScope || saved.Criteria != tc.wantCriteria || saved.Objective != strings.TrimSpace(tc.objective) { + t.Fatal("optional fields were not inherited or explicit values were changed") + } + if saved.Status != "draft" || saved.Rounds != 0 || len(saved.Steps) != 0 { + t.Fatal("creating an optional-fields draft started execution") + } + }) + } +} + func TestDeepAssessmentModelRetryClassification(t *testing.T) { for _, text := range []string{"429 rate limit", "502 upstream", "connection reset"} { if !transientDeepAssessmentModelError(fmt.Errorf("%s", text)) { diff --git a/scripts/assessment-findings-browser.test.cjs b/scripts/assessment-findings-browser.test.cjs index 65435533..ba57e132 100644 --- a/scripts/assessment-findings-browser.test.cjs +++ b/scripts/assessment-findings-browser.test.cjs @@ -47,7 +47,15 @@ async function fixture(t){ if(url.pathname==='/api/vulnerabilities/filter-options')return send(200,{vulnerability_ids:['finding-1','batch-finding'],task_ids:['same-id'],queue_ids:['batch-queue'],assessment_ids:['same-id'],conversation_ids:[],conversation_tags:[],task_tags:[]}); let items=[finding,batch];if(url.searchParams.get('assessment_id'))items=items.filter(v=>v.assessment_id===url.searchParams.get('assessment_id'));if(url.searchParams.get('id'))items=items.filter(v=>v.id===url.searchParams.get('id')); if(url.pathname==='/api/vulnerabilities/stats')return send(200,{total:items.length,by_severity:{high:items.filter(v=>v.severity==='high').length,medium:items.filter(v=>v.severity==='medium').length},by_status:{open:items.length}}); - if(url.pathname==='/api/vulnerabilities')return send(200,{vulnerabilities:items,total:items.length,page:1,page_size:20,total_pages:1}); + if(url.pathname==='/api/vulnerabilities'){ + // Full navigation is separate from the selected page of finding records. + const navigation=items.map(v=>v.assessment_id + ? {key:'assessment:'+v.assessment_id,label:v.assessment_name,count:1,severities:{[v.severity]:1}} + : {key:'queue:'+v.task_queue_id,label:v.task_queue_title,count:1,severities:{[v.severity]:1},children:[{key:'task:'+v.task_id,label:v.task_id,count:1,severities:{[v.severity]:1}}]}); + const selection=url.searchParams.get('selection')||''; + if(selection)items=items.filter(v=>selection==='assessment:'+v.assessment_id||selection==='queue:'+v.task_queue_id||selection==='task:'+v.task_id); + return send(200,{vulnerabilities:items,total:items.length,page:1,page_size:20,total_pages:1,navigation,selection}); + } if(url.pathname==='/api/vulnerabilities/finding-1/context')return send(200,{vulnerability:{...finding,assessment_can_open:state.canOpen},history:[],members:[],assets:[]}); if(url.pathname==='/api/vulnerabilities/finding-1')return send(200,{...finding,assessment_can_open:state.canOpen}); return send(404,{error:'unhandled fixture route '+url.pathname}); @@ -94,7 +102,8 @@ test('task grouping separates assessment IDs from batch IDs and disabled source await page.locator('#vulnerabilities-list [data-host-key="assessment:same-id"]').waitFor(); assert.match(await page.locator('[data-host-key="assessment:same-id"]').innerText(),/域名深度测评/); assert.match(await page.locator('[data-host-key="queue:batch-queue"]').innerText(),/原批量队列/); - await page.locator('[data-host-key="assessment:same-id"]').click();await page.waitForFunction(()=>document.querySelectorAll('#vulnerability-host-table [data-vuln-id]').length>0); + await page.locator('[data-host-key="assessment:same-id"]').click(); + await page.waitForFunction(()=>document.querySelector('[data-host-key="assessment:same-id"]').getAttribute('aria-pressed')==='true' && document.getElementById('vulnerability-card-finding-1') && !document.getElementById('vulnerability-card-batch-finding')); assert.equal(await page.locator('#vulnerability-host-table #vulnerability-card-batch-finding').count(),0); state.canOpen=false; await page.locator('#vulnerability-host-table #vulnerability-card-finding-1 .vulnerability-record-main').click(); diff --git a/scripts/deep-assessments-browser.test.cjs b/scripts/deep-assessments-browser.test.cjs index 4ec15d65..e9f563f5 100644 --- a/scripts/deep-assessments-browser.test.cjs +++ b/scripts/deep-assessments-browser.test.cjs @@ -71,10 +71,19 @@ test('deep assessment is independent, paginates and only creates drafts',async t assert.equal(await page.locator('.da-list-item').count(),20); await page.locator('[data-da-action="next"]').click();await page.waitForFunction(()=>document.querySelectorAll('.da-list-item').length===4); await page.locator('[data-da-action="create"]').click(); - await page.locator('[name="name"]').fill('Two day fixture');await page.locator('[name="objective"]').fill('Read fixture evidence');await page.locator('[name="scope"]').fill('Isolated fixture only'); + await page.locator('[name="name"]').fill('Two day fixture');await page.locator('[name="objective"]').fill('Read fixture evidence'); + const scope=page.getByRole('textbox',{name:'补充限制与排除项(选填)',exact:true}); + const criteria=page.getByRole('textbox',{name:'验收条件(选填)',exact:true}); + assert.equal(await scope.getAttribute('required'),null);assert.equal(await criteria.getAttribute('required'),null); + assert.match(await scope.getAttribute('placeholder'),/例如:排除支付接口/); + assert.match(await criteria.getAttribute('placeholder'),/例如:报告列明已测范围/); + assert.match(await page.locator('#da-scope-hint').innerText(),/留空沿用目标/); + assert.match(await page.locator('#da-criteria-hint').innerText(),/留空沿用目标/); + assert.equal(await scope.inputValue(),'');assert.equal(await criteria.inputValue(),''); + assert.equal(await page.locator('#da-create-form').evaluate(form=>form.checkValidity()),true); assert.equal(await page.locator('[name="hours"],[name="token_budget"],[name="max_rounds"]').count(),0); await page.locator('#da-create-form button[type="submit"]').click();await page.waitForFunction(()=>document.querySelector('#da-title').textContent.includes('Two day fixture')); - const create=state.requests.find(r=>r.method==='POST'&&r.path==='/api/deep-assessments');assert.equal(create.body.remaining_seconds,undefined);assert.equal(create.body.token_budget,undefined);assert.equal(create.body.max_rounds,undefined);assert.equal(create.body.auto_resume,true); + const create=state.requests.find(r=>r.method==='POST'&&r.path==='/api/deep-assessments');assert.equal(create.body.remaining_seconds,undefined);assert.equal(create.body.token_budget,undefined);assert.equal(create.body.max_rounds,undefined);assert.equal(create.body.auto_resume,true);assert.equal(create.body.scope,'');assert.equal(create.body.criteria,''); assert.equal(state.requests.filter(r=>r.path.endsWith('/control/start')).length,0); await page.locator('[data-da-action="start"]').click();await page.locator('[data-da-action="pause"]').waitFor(); await page.locator('#da-guidance').fill('Keep this unsent text');await page.evaluate(()=>DeepAssessments.refresh());assert.equal(await page.locator('#da-guidance').inputValue(),'Keep this unsent text'); diff --git a/web/static/css/deep-assessments.css b/web/static/css/deep-assessments.css index 991f7cfa..861009a9 100644 --- a/web/static/css/deep-assessments.css +++ b/web/static/css/deep-assessments.css @@ -121,6 +121,7 @@ body.da-drawer-open { overflow: hidden; } .da-form-body label { display: block; margin: 12px 0; font-size: 14px; } .da-form-body label > .form-control { margin-top: 6px; } .da-form-body textarea { resize: vertical; } +.da-form-body .da-field-hint { margin: -4px 0 16px; } .da-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; } .da-form-body label.da-check { display: flex; gap: 8px; align-items: flex-start; } .da-form-body input[type="checkbox"] { margin-top: 3px; } diff --git a/web/static/i18n/en-US.json b/web/static/i18n/en-US.json index dbe9f569..e40db130 100644 --- a/web/static/i18n/en-US.json +++ b/web/static/i18n/en-US.json @@ -26,7 +26,7 @@ "chatModuleMissing": "Chat module not loaded yet" }, "common": { - "expandPanel": "Expand panel", + "expandPanel": "Expand panel", "ok": "OK", "cancel": "Cancel", "refresh": "Refresh", @@ -5278,7 +5278,7 @@ "next": "Next", "name": "Name", "objective": "Objective", - "scope": "Allowed scope and exclusions", + "scope": "Additional restrictions and exclusions", "criteria": "Acceptance criteria", "model": "Model channel", "project": "Project", @@ -5445,7 +5445,13 @@ "exposes": "exposes", "associated_with": "associated with", "serves": "serves" - } + }, + "scopeOptional": "Additional restrictions and exclusions (optional)", + "criteriaOptional": "Acceptance criteria (optional)", + "scopeHint": "Add only restrictions not stated in the objective. Leave blank to use the objective.", + "scopeExample": "Example: Exclude payment endpoints; do not modify production data or run load tests.", + "criteriaHint": "Describe what counts as complete. Leave blank to use the objective.", + "criteriaExample": "Example: Report tested areas, untested areas and reasons; include reproduction steps and original evidence for confirmed findings." }, "assessmentFindingLinks": { "source": "Source assessment", diff --git a/web/static/i18n/ru-RU.json b/web/static/i18n/ru-RU.json index 13edf7aa..664c4db6 100644 --- a/web/static/i18n/ru-RU.json +++ b/web/static/i18n/ru-RU.json @@ -26,7 +26,7 @@ "chatModuleMissing": "Модуль чата ещё не загружен" }, "common": { - "expandPanel": "Развернуть панель", + "expandPanel": "Развернуть панель", "ok": "ОК", "cancel": "Отмена", "refresh": "Обновить", @@ -5291,7 +5291,7 @@ "next": "Next", "name": "Name", "objective": "Objective", - "scope": "Allowed scope and exclusions", + "scope": "Дополнительные ограничения и исключения", "criteria": "Acceptance criteria", "model": "Model channel", "project": "Project", @@ -5458,7 +5458,13 @@ "exposes": "предоставляет", "associated_with": "связан с", "serves": "обслуживает" - } + }, + "scopeOptional": "Дополнительные ограничения и исключения (необязательно)", + "criteriaOptional": "Критерии приёмки (необязательно)", + "scopeHint": "Укажите только ограничения, которых нет в цели. Пустое поле наследует цель.", + "scopeExample": "Например: исключить платёжные API; не изменять рабочие данные и не проводить нагрузочные тесты.", + "criteriaHint": "Опишите, что считать завершением. Пустое поле наследует цель.", + "criteriaExample": "Например: указать проверенные и непроверенные области и причины; приложить шаги воспроизведения и исходные доказательства подтверждённых уязвимостей." }, "assessmentFindingLinks": { "source": "Исходная оценка", diff --git a/web/static/i18n/zh-CN.json b/web/static/i18n/zh-CN.json index 5de2bb73..83067e83 100644 --- a/web/static/i18n/zh-CN.json +++ b/web/static/i18n/zh-CN.json @@ -26,7 +26,7 @@ "chatModuleMissing": "对话模块尚未加载" }, "common": { - "expandPanel": "展开面板", + "expandPanel": "展开面板", "ok": "确定", "cancel": "取消", "refresh": "刷新", @@ -5266,7 +5266,7 @@ "next": "下一页", "name": "测评名称", "objective": "目标", - "scope": "允许范围与排除项", + "scope": "补充限制与排除项", "criteria": "验收条件", "model": "模型渠道", "project": "关联项目", @@ -5385,7 +5385,13 @@ "facts": "事实", "priority": "优先级", "linkedAssets": "目标资产", - "intentSources": "来源节点" + "intentSources": "来源节点", + "scopeOptional": "补充限制与排除项(选填)", + "criteriaOptional": "验收条件(选填)", + "scopeHint": "仅补充目标中未说明的限制;留空沿用目标。", + "scopeExample": "例如:排除支付接口;不修改生产数据;不做压力测试。", + "criteriaHint": "说明什么结果算完成;留空沿用目标。", + "criteriaExample": "例如:报告列明已测范围、未测部分及原因;确认的漏洞附复现步骤和原始证据。" }, "assessmentFindingLinks": { "source": "来源深度测评", diff --git a/web/static/js/deep-assessments.js b/web/static/js/deep-assessments.js index 1e502edc..fe8afd07 100644 --- a/web/static/js/deep-assessments.js +++ b/web/static/js/deep-assessments.js @@ -2,7 +2,7 @@ (function () { 'use strict'; const S = { extra: null, intentAsset: '', intentStatus: '', intentCounts: {}, routeKey: '', focusStepId: '', focusedStep: null, originFindingId: '', originFinding: null, findings: [], findingOffset: 0, findingMore: false, findingTotal: 0, id: '', task: null, tab: 'graph', graph: null, graphScope: '', graphOffset: 0, graphNode: null, nodeOffset: 0, nodeMore: false, nodeRequest: 0, stepOffset: 0, stepTotal: 0, stepMore: false, page: 0, more: false, busy: false, epoch: 0, timer: null, mounted: false, drawerEpoch: 0, events: [], receipts: [], receiptOffset: 0, receiptMore: false }; - const labels = { assets: '资产图', facts: '事实', priority: '优先级', linkedAssets: '目标资产', intentSources: '来源节点', findings: '关联漏洞', noFindings: '暂未登记漏洞。', openFinding: '在漏洞管理查看', allFindings: '在漏洞管理查看本次测评', reproduction: '复现步骤', findingEvidence: '复现证据', sourceStep: '来源步骤', allSteps: '显示全部步骤与回执', sourceFinding: '关联漏洞', graph: '探索图', continuous: '持续执行', mode: '运行模式', elapsed: '已运行', graphHint: '摘要用于续接;原始观察和执行回执可随时展开。', graphVisible: '当前页节点', graphFolded: '已折叠节点', graphHome: '全图概览', graphExpand: '展开关联节点', graphFit: '适应画布', graphSelect: '点击节点查看原始内容与来源。', graphMore: '继续读取原文', status: '状态', updatedAt: '更新时间', loading: '正在读取测评…', contextUsage:'上下文 / 窗口', toolDefinitions:'工具定义', title: '深度测评', subtitle: '围绕一个目标持续探索,保存证据与进度,跨会话继续执行。', create: '新建测评', refresh: '刷新', search: '搜索测评名称', all: '全部状态', empty: '暂无测评,先创建一个目标。', select: '选择测评,查看探索进度与证据。', previous: '上一页', next: '下一页', name: '测评名称', objective: '目标', scope: '允许范围与排除项', criteria: '验收条件', model: '模型渠道', project: '关联项目', role: '角色', default: '系统默认', none: '不关联', tokens: '累计 Token', rounds: '规划轮次', concurrency: '并行步骤', autoResume: '服务重启后自动恢复结果明确的步骤', save: '保存草稿', close: '关闭', start: '开始 / 继续', pause: '暂停', cancel: '停止', delete: '删除', report: '下载报告', overview: '概览', plan: '意图队列', evidence: '证据回执', activity: '运行记录', quality: '上下文与用量', guidance: '补充线索或调整方向', send: '提交方向', answer: '答复并继续', retry: '恢复此步骤', conversation: '查看执行会话', unknown: '请先核对回执,确认上次操作结果及执行资源状态。', reconcile: '我已核对上次调用结果,允许从原会话继续', confirmStop: '停止后将保留已有结果,结束本次测评。', confirmDelete: '删除本条测评?关联执行会话仍保留。', strategy: '当前路线', summary: '当前结论 / 缺口', question: '待补充信息', dependencies: '前置步骤', segments: '执行分段', evidenceIDs: '证据引用', noSteps: '开始后由规划器逐步生成探索方向。', noRecords: '暂无记录', calls: '工具调用', compactions: '上下文压缩', activeTools: '当前可见工具', session: '会话', tokenNote: '累计用量包含 Pi 压缩,不作为任务自动结束条件。', recoveryNote: '结果不明的调用会暂停等待核对,已完成步骤不会自动重做。', saved: '已保存', updated: '已更新', retryNote: '恢复会保留原 Pi 会话及历史证据。' }; + const labels = { scopeOptional: "补充限制与排除项(选填)", criteriaOptional: "验收条件(选填)", scopeHint: "仅补充目标中未说明的限制;留空沿用目标。", scopeExample: "例如:排除支付接口;不修改生产数据;不做压力测试。", criteriaHint: "说明什么结果算完成;留空沿用目标。", criteriaExample: "例如:报告列明已测范围、未测部分及原因;确认的漏洞附复现步骤和原始证据。", assets: '资产图', facts: '事实', priority: '优先级', linkedAssets: '目标资产', intentSources: '来源节点', findings: '关联漏洞', noFindings: '暂未登记漏洞。', openFinding: '在漏洞管理查看', allFindings: '在漏洞管理查看本次测评', reproduction: '复现步骤', findingEvidence: '复现证据', sourceStep: '来源步骤', allSteps: '显示全部步骤与回执', sourceFinding: '关联漏洞', graph: '探索图', continuous: '持续执行', mode: '运行模式', elapsed: '已运行', graphHint: '摘要用于续接;原始观察和执行回执可随时展开。', graphVisible: '当前页节点', graphFolded: '已折叠节点', graphHome: '全图概览', graphExpand: '展开关联节点', graphFit: '适应画布', graphSelect: '点击节点查看原始内容与来源。', graphMore: '继续读取原文', status: '状态', updatedAt: '更新时间', loading: '正在读取测评…', contextUsage:'上下文 / 窗口', toolDefinitions:'工具定义', title: '深度测评', subtitle: '围绕一个目标持续探索,保存证据与进度,跨会话继续执行。', create: '新建测评', refresh: '刷新', search: '搜索测评名称', all: '全部状态', empty: '暂无测评,先创建一个目标。', select: '选择测评,查看探索进度与证据。', previous: '上一页', next: '下一页', name: '测评名称', objective: '目标', scope: '补充限制与排除项', criteria: '验收条件', model: '模型渠道', project: '关联项目', role: '角色', default: '系统默认', none: '不关联', tokens: '累计 Token', rounds: '规划轮次', concurrency: '并行步骤', autoResume: '服务重启后自动恢复结果明确的步骤', save: '保存草稿', close: '关闭', start: '开始 / 继续', pause: '暂停', cancel: '停止', delete: '删除', report: '下载报告', overview: '概览', plan: '意图队列', evidence: '证据回执', activity: '运行记录', quality: '上下文与用量', guidance: '补充线索或调整方向', send: '提交方向', answer: '答复并继续', retry: '恢复此步骤', conversation: '查看执行会话', unknown: '请先核对回执,确认上次操作结果及执行资源状态。', reconcile: '我已核对上次调用结果,允许从原会话继续', confirmStop: '停止后将保留已有结果,结束本次测评。', confirmDelete: '删除本条测评?关联执行会话仍保留。', strategy: '当前路线', summary: '当前结论 / 缺口', question: '待补充信息', dependencies: '前置步骤', segments: '执行分段', evidenceIDs: '证据引用', noSteps: '开始后由规划器逐步生成探索方向。', noRecords: '暂无记录', calls: '工具调用', compactions: '上下文压缩', activeTools: '当前可见工具', session: '会话', tokenNote: '累计用量包含 Pi 压缩,不作为任务自动结束条件。', recoveryNote: '结果不明的调用会暂停等待核对,已完成步骤不会自动重做。', saved: '已保存', updated: '已更新', retryNote: '恢复会保留原 Pi 会话及历史证据。' }; const states = { draft: '草稿', running: '执行中', pending: '待执行', completed: '已完成', blocked: '受阻', failed: '失败', paused: '已暂停', pausing: '暂停中', cancelling: '停止中', cancelled: '已停止', recovering: '待恢复', waiting_retry: '等待模型恢复', waiting_input: '待答复', needs_review: '待核对', uncertain: '结果不明', waiting_progress: '等待新进展', interrupted: '已中断', cleanup_unconfirmed: '待确认资源停止', retired: '已撤下', reconciled: '已核对', yielded: '分段完成' }; const tr = (key, fallback) => { const v = typeof window.t === 'function' ? window.t('deepAssessments.' + key) : ''; return v && v !== 'deepAssessments.' + key ? v : fallback; }; const L = key => tr(key, labels[key] || key); @@ -266,7 +266,7 @@ const epoch = ++S.drawerEpoch; const opts = await json('/options'); if (epoch !== S.drawerEpoch || !$('page-deep-assessments')?.classList.contains('active')) return; - showForm(L('create'), `
${field('name', L('name'), '', 'text', 'maxlength="200" required')}
${choices('model', L('model'), opts.models || [], L('default'))}${choices('role', L('role'), opts.roles || [], L('default'))}${choices('project_id', L('project'), opts.projects || [], L('none'))}${field('concurrency', L('concurrency'), 2, 'number', 'min="1" max="4" required')}

${esc(L('recoveryNote'))}

`); + showForm(L('create'), `
${field('name', L('name'), '', 'text', 'maxlength="200" required')}

${esc(L('scopeHint'))}

${esc(L('criteriaHint'))}

${choices('model', L('model'), opts.models || [], L('default'))}${choices('role', L('role'), opts.roles || [], L('default'))}${choices('project_id', L('project'), opts.projects || [], L('none'))}${field('concurrency', L('concurrency'), 2, 'number', 'min="1" max="4" required')}

${esc(L('recoveryNote'))}

`); } async function saveCreate(form) { if (S.busy || !can('write')) return; diff --git a/web/templates/index.html b/web/templates/index.html index 62495cba..ce89423e 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -50,7 +50,7 @@ - + @@ -7143,7 +7143,7 @@ - +