feat: add confirmed DSH task management and execution control
This commit is contained in:
1 parent
be382a117d
commit
f861a3d386
25 files changed
+1190
-25
No files matched your search
@@ -0,0 +1,11 @@
|
||||
# DSH task lifecycle implementation
|
||||
|
||||
The user approved conversational task management, execution preflight and execution control. Extend the existing native Harness integration, retaining natural intent inference through function schemas and the existing CAD service boundaries.
|
||||
|
||||
1. Add Qt-free lifecycle reads, previews and atomic confirmed edits. List real task IDs, patch task metadata and existing mapping rules, archive to the recycle bin, and copy configuration through the existing project-selection dialog. Include all batch-rule members in previews and stale-state checks. Persist mutation receipts to prevent replay.
|
||||
2. Add execution preflight based on saved task contexts, interrupted state, project availability, enabled scope and pending resources. Report actual blockers without claiming a CAD connectivity check. Freeze execution plan hashes and check them inside the existing task-queue lease before any executor runs.
|
||||
3. Add a bounded parent-process request/result bridge and native lifecycle controller. Native dialogs show affected tasks, fields and execution scope. Start/continue use the existing serial task queue; pause uses the active StopControl. Return actual queue results and distinguish paused, failed, completed and no-match outcomes.
|
||||
4. Expose catalog, preflight, management and execution schemas to interactive sessions. Automatic incident sessions remain snapshot-only. Keep business prompts free of tool routing. Show lifecycle state in the existing right-hand native slot.
|
||||
5. Write failing domain/UI tests before implementation, then verify atomicity, stale previews, cancellation, copy, execution and pause. Extend CLI policy probes and run a real-model Qt/CDP acceptance using fixture engineering files and a controlled executor. Run relevant regressions and record validation limits.
|
||||
|
||||
Implementation is inline in this already-authorized session. No deployment, release binary or real engineering mutation is included.
|
||||
@@ -0,0 +1,52 @@
|
||||
# DSH conversational task lifecycle acceptance
|
||||
|
||||
Implemented on `codex/dsh`: real task lookup and selection, metadata and existing mapping edits with native batch-impact preview, configuration copy through the native project selector, recycle-bin archive, execution preflight, confirmed serial execution/continuation and safe StopControl pause.
|
||||
|
||||
The model receives six bounded backend schemas. Business prompts contain no tool names or routing instructions. Automatic incident sessions remain limited to their event-bound snapshot; management, catalog, preflight, creation and execution requests are denied before desktop emission.
|
||||
|
||||
## Automated verification
|
||||
|
||||
Targeted tests cover real SQLite records, shared-rule propagation, persistent duplicate-request receipts, stale previews, missing projects, deleted tasks, native cancellation, cancellation while reading, retention of receipts during confirmed writes, disabled rule copying, StopControl scope and real controlled queue results. Queue tests reject changed confirmed plan hashes inside the queue lease before the executor runs. Derived target Cell resets and custom Value enablement are included in the preview and committed from the same normalized patch.
|
||||
|
||||
The complete relevant regression command is:
|
||||
|
||||
```powershell
|
||||
pytest -q tests/dsh tests/ui tests/packaging/test_dx_part_replace_build.py tests/trial_task_center/test_application.py tests/trial_task_center/test_quick_run.py tests/v1_1/test_task_queue.py tests/v1_1/test_diagnostics_bundle.py tests/v1_1/test_project_context.py
|
||||
node tools/verify_dsh_runtime.mjs
|
||||
```
|
||||
|
||||
`tools/verify_dsh_auto_runtime.mjs` was run with the configured test provider. It verified a real model turn, immutable incident binding and rejection of every new capability in an automatic session. CLI policy checks verified the exact six-tool roster, desktop-only operations, unauthorized tools, authentication and stale/cross-task routes.
|
||||
|
||||
Final verification in the isolated `codex/dsh` worktree: **160 passed in 63.80 seconds**; the real Harness CLI check returned `status: passed`. A credential scan of all 25 changed files found neither the configured model API key nor the prefilled issue token. Runtime dependencies are reused through an ignored local junction; the token bootstrap remains ignored.
|
||||
|
||||
## Real model and desktop acceptance
|
||||
|
||||
Command:
|
||||
|
||||
```powershell
|
||||
python tools/accept_dsh_lifecycle.py --output build/dsh-lifecycle-accepted --provider-config "$env:LOCALAPPDATA/DxProductivity/trial-task-center/dsh" --port 9235
|
||||
```
|
||||
|
||||
Provider: `skyworth-deepseek-v4.1-flash` through the previously configured test API. Credentials were passed through the existing local encrypted configuration, never through the prompt or report.
|
||||
|
||||
The passing run used the real main window, official Harness page, Chromium Input events and Qt QTest mouse clicks. Eight natural-language messages triggered 20 real backend calls. The run:
|
||||
|
||||
1. Found and selected Board-A, changed its name and note, and modified a shared mapping after confirming both affected tasks.
|
||||
2. Read execution readiness without claiming a CAD connectivity check.
|
||||
3. Confirmed execution scope in Qt, opened another conversation and requested a safe pause through natural language. The actual StopControl stopped after the current queue item.
|
||||
4. Confirmed continuation and executed the remaining item exactly once. The receipts reported saved 0, failed 0, no-match 2; no-match was not presented as a replacement save.
|
||||
5. Copied configuration to a newly selected Board-C project through the real directory scan and confirmation controls; received a new persisted task ID.
|
||||
6. Archived only the copy, preserving the original task.
|
||||
7. Clicked Cancel on a proposed rename and confirmed that the original database name remained unchanged.
|
||||
|
||||
Final database metadata, shared rules, task bindings, archive target and executor call count were independently checked. All three source fixture hashes were unchanged. Clean shutdown was recorded without uncaught or unexpected UI errors.
|
||||
|
||||
Artifacts are under `build/dsh-lifecycle-accepted/`: `desktop-report.json`, `report.json`, native confirmation captures, `dsh-execution-results.png`, `dsh-lifecycle-in-tool.png` and the isolated SQLite data directory. The full passing artifacts were generated in the shared checkout before moving the same verified source into the isolated `codex/dsh` worktree.
|
||||
|
||||
## Limits and review
|
||||
|
||||
The executor was controlled to produce two no-match results; no real DxDesigner process or user engineering file was modified. This verifies integration and control flow, not CAD connectivity or successful part replacement. No release EXE was built.
|
||||
|
||||
Independent read-only review found a cancellation receipt race and an omitted derived Cell reset in previews. Both were corrected and covered by tests. The final review reported no remaining Critical or Important findings.
|
||||
|
||||
Configuration copy deliberately confirms a displayed draft; later edits to the source do not rewrite that draft. A continuation reconfirms the requested scope and order and starts a queue checkpoint over the same tasks' saved execution progress. It preserves completed task steps rather than reusing an unrelated native group checkpoint.
|
||||
@@ -24,18 +24,32 @@
|
||||
|
||||
目录提示只预填窗口,不由模型自动扫描;工程范围以原生窗口勾选为准。确认前取消窗口或中止对话不会创建任务;确认后已提交的事务以真实回执为准。一个请求内的新任务、规则和回执事务提交,失败全部回滚;同一请求重放不重复创建,已有未完成任务的工程不被改名或改规则。创建上限为 100 个工程、30 条规则;活动执行时不创建。
|
||||
|
||||
### 在对话中管理和执行任务
|
||||
|
||||
可以直接说“找到电源板任务,把备注改为本周验证,旧料号 A 对应的新料号改成 B”。助手查找真实记录和规则,展示名称、备注、Value 策略及规则变更;同批规则会列出全部受影响任务。更换料号导致的旧封装选择清空、自定义 Value 开启等连带变化也会出现在预览中。确认时若任务已被其他操作修改,旧预览失效,需重新核对。
|
||||
|
||||
“复制这个任务到新工程”会复制规则配置和启用状态、备注及 Value 策略,然后打开原生工程选择窗口。确认的是窗口里展示的配置草稿;不会复制执行证据。新工程已有未完成任务时保持原配置。“归档这个任务”只把所选任务移入回收站,保留规则和证据,不永久删除。切换任务只改变任务中心选择,不操作工程。
|
||||
|
||||
“检查这个任务能否执行”会核对保存的配置、工程文件可用性、启用规则或位号、失败/中断证据和待释放后台资源,返回具体阻断原因。预检不连接 CAD,不代表许可、备份、替换或保存已经成功。
|
||||
|
||||
“按顺序执行这几个任务”或“继续这个任务未完成的部分”会展示真实任务编号、工程路径、启用范围,并等待原生确认。一次最多选择 20 个不同任务;执行计划在进入原队列租约后再次核对。继续使用原任务保存的执行进度,重新确认本次范围与顺序,创建本次队列检查点;不重复已经收尾的步骤。未保存的位号编辑、待核验中断和未准备的失败重试会阻断执行。
|
||||
|
||||
执行中可请求“安全暂停当前执行”,程序只设置当前运行的 StopControl,等待当前项安全收尾;“已请求暂停”与“已经暂停”分别返回。执行回执包含真实保存、失败、未命中和待核验状态。未命中不是已替换保存;确认后中止模型等待也不会撤销已经提交的配置事务,最终结果以持久回执和任务证据为准。
|
||||
|
||||
### 自动异常介入
|
||||
|
||||
任务操作报错、单任务收尾有失败项,或批次包含失败/阻断任务时,会自动切入 DSH助手并创建专属诊断会话,不需要手动提问。原执行收尾后,AI 读取出错任务绑定的快照和脱敏事件;即使切换任务,诊断也不会串到另一个任务。
|
||||
|
||||
已经由用户确认执行的任务,遇到已知可重试错误且现有服务确认“可重试、没有待核验结果”时,AI 可建议一次自动重试。程序通过原服务准备失败项、执行并重新读取真实进度;只有队列完成、失败为零且没有中断标记,才显示处理通过。模型建议或重试准备成功都不算解决;暂停请求会阻止继续重试。
|
||||
|
||||
未解决时,AI 再做一轮复盘,保存结论、依据、未知项和后续验证方法,并尝试提交 Git 工单。事件以任务、原执行轮次和错误码去重;同一任务同一原执行轮次的不同错误码共享一次重试额度,执行前持久记录,重启不重置。未知错误、未授权执行和未核验状态仅诊断取证,不自动重放工程写入。
|
||||
|
||||
- 普通对话注册 `dx_task_snapshot`(快照)和 `dx_task_create`(原生确认后创建任务);自动异常诊断会话只允许快照,创建调用在工具执行前被拒绝。Shell、通用文件访问、插件安装、子智能体及模型直接 CAD 写入工具均未注册;额外工具会被 guard 阻断。
|
||||
- 普通对话开放快照、创建、任务列表及详情、预检、任务管理、受控执行六项能力;自动异常诊断会话只允许事件快照,其他调用在执行前被拒绝。Shell、通用文件访问、插件安装、子智能体及模型直接 CAD 写入工具均未注册;额外工具会被 guard 阻断。
|
||||
- **刷新任务上下文**重新发布当前任务快照。
|
||||
- 手动点击 **准备失败项重试**须在任务中心确认,并通过现有重试按钮的状态检查;该按钮只准备重试。自动介入使用上文限定的一次重试闭环。
|
||||
- **安全暂停**须确认且当前确有执行控制器,使用原队列的安全边界暂停。
|
||||
- 跨任务、过期版本、未知参数、未知动作及同一版本的重复动作请求均拒绝。网页请求必须经过本机 Harness 的登录与 Origin 校验。
|
||||
- 规则修改、工程写入和不确定状态恢复仍从任务中心原流程进行,不新增模型直接执行入口。UI 显示“已提交”不表示工程已保存或核验成功。
|
||||
- 规则修改与工程写入通过上述原生确认和现有任务中心服务;不确定状态恢复仍从任务中心原流程进行。模型不能提供“已确认”参数来跳过确认,UI 显示“已提交”不表示工程已保存或核验成功。
|
||||
|
||||
Harness 使用任务中心数据目录下独立的 `dsh/harness-home` 保存会话和设置,浏览器偏好在 `dsh/browser`;不加载个人 Harness profile 或 Codex 凭据。服务只监听回环地址,遥测关闭;关闭主工具时先结束所属运行时。上述限制由应用的插件组合和 guard 实现,不是操作系统沙箱。
|
||||
|
||||
|
||||
Reference in new issue
Block a user