@godv61/dsh-task-engine 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.acceptance.mjs +9 -4
  2. package/.assessment-batch1.mjs +14 -11
  3. package/.codex-project-test.mjs +80 -0
  4. package/.enforce-test.mjs +11 -12
  5. package/.evidence-test.mjs +8 -8
  6. package/.filter-test.mjs +3 -5
  7. package/.freeze-test.mjs +40 -31
  8. package/.p0-test.mjs +16 -19
  9. package/.preset-test.mjs +11 -1
  10. package/.revision-test.mjs +16 -16
  11. package/.roundtrip-test.mjs +247 -259
  12. package/.workflow-test.mjs +117 -119
  13. package/README.md +12 -10
  14. package/cordis.patch.yml +158 -9
  15. package/defaults/eng.json +1 -97
  16. package/docs/CHANGELOG.md +39 -26
  17. package/docs/configuration.md +21 -22
  18. package/docs/development.md +1 -1
  19. package/docs/faq.md +5 -5
  20. package/docs/manual.html +41 -59
  21. package/docs/resource-install.md +2 -0
  22. package/docs/roadmap.md +2 -2
  23. package/hooks/commit-msg +4 -33
  24. package/lib/client.js +94 -108
  25. package/lib/client.js.map +3 -3
  26. package/lib/controller.d.ts +4 -3
  27. package/lib/controller.js +12 -6
  28. package/lib/controller.js.map +1 -1
  29. package/lib/dev-task.js +33 -27
  30. package/lib/dev-task.js.map +1 -1
  31. package/lib/engine.d.ts +2 -3
  32. package/lib/engine.js +2 -2
  33. package/lib/engine.js.map +1 -1
  34. package/lib/shipped-skills.d.ts +2 -4
  35. package/lib/shipped-skills.js +2 -4
  36. package/lib/shipped-skills.js.map +1 -1
  37. package/lib/skill-audit.d.ts +4 -4
  38. package/lib/skill-audit.js +19 -14
  39. package/lib/skill-audit.js.map +1 -1
  40. package/lib/workflows.d.ts +3 -4
  41. package/lib/workflows.js +2 -41
  42. package/lib/workflows.js.map +1 -1
  43. package/package.json +13 -15
  44. package/preset/agent.cordis.yml +3 -3
  45. package/preset/persona.md +2 -2
  46. package/scripts/verify-package.mjs +2 -0
  47. package/skills/eng-delivery/SKILL.md +17 -17
  48. package/rules/coding-conventions.md +0 -7
  49. package/rules/commit-conventions.md +0 -6
  50. package/rules/security-redlines.md +0 -6
  51. package/skills/code-commit/SKILL.md +0 -13
  52. package/skills/code-implement/SKILL.md +0 -24
  53. package/skills/code-review/SKILL.md +0 -13
  54. package/skills/code-verify/SKILL.md +0 -20
  55. package/skills/requirement-analysis/SKILL.md +0 -16
  56. package/skills/solution-design/SKILL.md +0 -19
@@ -4,20 +4,20 @@ import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from 'node:fs'
4
4
  import { tmpdir } from 'node:os'
5
5
  import { join, resolve, sep } from 'node:path'
6
6
  import { registerDevTask } from './lib/dev-task.js'
7
- import { newTask, validateWorkflow } from './lib/engine.js'
8
- import { adoptRecommendation, resolveFlow, retainStageBindings } from './lib/workflows.js'
9
- import Controller from './lib/controller.js'
10
- import { registerShippedSkills } from './lib/shipped-skills.js'
11
-
12
- test('switching to minimal drops only stages outside its graph', () => {
13
- const requirement = { skills: [{ skill: { source: 'project', name: 'requirements' }, rules: [] }] }
14
- const development = { skills: [{ skill: { source: 'project', name: 'implement' }, rules: [] }] }
15
- const result = retainStageBindings('minimal', { '需求': requirement, '开发': development })
16
- assert.deepEqual(result.dropped, ['需求'])
17
- assert.deepEqual(result.bindings, { '开发': development })
18
- const resolved = resolveFlow('minimal', { flow: 'minimal', stage_bindings: result.bindings })
19
- assert.deepEqual(validateWorkflow(resolved.config), [])
20
- })
7
+ import { newTask, validateWorkflow } from './lib/engine.js'
8
+ import { adoptRecommendation, resolveFlow, retainStageBindings } from './lib/workflows.js'
9
+ import Controller from './lib/controller.js'
10
+ import { registerShippedSkills } from './lib/shipped-skills.js'
11
+
12
+ test('switching to minimal drops only stages outside its graph', () => {
13
+ const requirement = { skills: [{ skill: { source: 'project', name: 'requirements' }, rules: [] }] }
14
+ const development = { skills: [{ skill: { source: 'project', name: 'implement' }, rules: [] }] }
15
+ const result = retainStageBindings('minimal', { '需求': requirement, '开发': development })
16
+ assert.deepEqual(result.dropped, ['需求'])
17
+ assert.deepEqual(result.bindings, { '开发': development })
18
+ const resolved = resolveFlow('minimal', { flow: 'minimal', stage_bindings: result.bindings })
19
+ assert.deepEqual(validateWorkflow(resolved.config), [])
20
+ })
21
21
 
22
22
  /**
23
23
  * The preset as a project would actually run it: the skeleton plus the shipped
@@ -34,7 +34,7 @@ function adoptedFlow(id, extra) {
34
34
  }
35
35
 
36
36
 
37
- function fixture(stage = '开发', extra = {}, services = {}) {
37
+ function fixture(stage = '开发', extra = {}, services = {}) {
38
38
  const cwd = resolve('test-project')
39
39
  // A project running the standard flow: the skeleton plus the adopted
40
40
  // recommendation, with one extra skill mounted on 完成 for the tests that need
@@ -46,15 +46,15 @@ function fixture(stage = '开发', extra = {}, services = {}) {
46
46
  ...adopted,
47
47
  stage_bindings: {
48
48
  ...adopted.stage_bindings,
49
- 完成: { skills: [{ skill: { source: 'project', name: 'software-testing' }, rules: [] }] },
49
+ 完成: { skills: [{ skill: { source: 'project', name: 'software-testing' }, rules: [] }] },
50
50
  },
51
51
  }).config
52
52
  const state = newTask({ id: 'LIVE-1', title: 'EAM regression', branch: 'test', work_size: 'standard', risk_level: 'standard', flow: { flow: 'standard', version: 3, config }, root: cwd })
53
53
  Object.assign(state, { stage, execution_version: 1, files: ['app.js'], requirement_confirmed: true, solution_confirmed: true, ...extra })
54
- const records = new Map([[join(cwd, '.dsh/task-LIVE-1.json'), JSON.stringify(state)],
55
- [join(cwd, 'app.js'), 'source'],
56
- [join(cwd, '.dsh/skills/software-testing/SKILL.md'), 'test instructions'],
57
- [join(cwd, '.dsh/skills/human-check/SKILL.md'), 'manual check instructions']])
54
+ const records = new Map([[join(cwd, '.dsh/task-LIVE-1.json'), JSON.stringify(state)],
55
+ [join(cwd, 'app.js'), 'source'],
56
+ [join(cwd, '.dsh/skills/software-testing/SKILL.md'), 'test instructions'],
57
+ [join(cwd, '.dsh/skills/human-check/SKILL.md'), 'manual check instructions']])
58
58
  const events = [], runs = []
59
59
  const session = { id: 'test-session', header: { cwd }, snapshotEvents: () => events }
60
60
  const policy = { mode: 'workspace-write', workspaceRoot: cwd, sessionId: session.id }
@@ -86,99 +86,99 @@ function fixture(stage = '开发', extra = {}, services = {}) {
86
86
  }
87
87
  return { call: args => execute(JSON.parse(JSON.stringify({ task_id: 'LIVE-1', ...args })), exec), load, runs, policy, exec, records, cwd,
88
88
  state: () => JSON.parse(records.get(join(cwd, '.dsh/task-LIVE-1.json'))) }
89
- }
90
-
91
- test('manual skill evidence is approved by the host without a shell command', async () => {
92
- const config = resolveFlow('minimal', { flow: 'minimal', stage_bindings: {
93
- '开发': { skills: [{ skill: { source: 'project', name: 'human-check' }, rules: [], evidence: 'manual' }] },
94
- } }).config
95
- const approvals = []
96
- const f = fixture('开发', { flow: { flow: 'minimal', version: 3, config } }, {
97
- approval: { request: async request => { approvals.push(request); return 'allowed-once' } },
98
- })
99
- f.load('human-check')
100
- await f.call({ operation: 'skill_result', skill_name: 'human-check', evidence: ['checked by owner'] })
101
- assert.equal(f.runs.length, 0)
102
- assert.equal(approvals.length, 1)
103
- assert.equal(f.state().skill_results['开发']['human-check'].approved, true)
104
- assert.deepEqual(JSON.parse(await f.call({ operation: 'status' })).skill_blockers, [])
105
- const denied = fixture('开发', { flow: { flow: 'minimal', version: 3, config } }, {
106
- approval: { request: async () => 'rejected' },
107
- })
108
- denied.load('human-check')
109
- await assert.rejects(denied.call({ operation: 'skill_result', skill_name: 'human-check', evidence: ['claimed approval'] }), /not approved/)
110
- assert.equal(denied.state().skill_results?.['开发']?.['human-check'], undefined)
111
- })
112
-
113
- test('completion rejects unresolved terminal skills and rules', async () => {
114
- const config = resolveFlow('minimal', { flow: 'minimal', stage_bindings: {
115
- '交付': { skills: [{ skill: { source: 'project', name: 'must-run' }, rules: [{ source: 'project', name: 'missing' }], evidence: 'command' }] },
116
- } }).config
117
- const f = fixture('交付', {
118
- flow: { flow: 'minimal', version: 3, config },
119
- items: [{ id: 'A', title: 'small', status: 'done', review: { spec: { outcome: 'pass' }, quality: { outcome: 'pass' } } }],
120
- commits: [{ label: 'TASK', hash: 'abcdef1' }],
121
- })
122
- const status = JSON.parse(await f.call({ operation: 'status' }))
123
- assert.ok(status.skill_blockers.length > 0)
124
- assert.ok(status.missing_rules.length > 0)
125
- await assert.rejects(f.call({ operation: 'complete' }), /cannot complete.*must-run|cannot complete.*missing/)
126
- assert.equal(f.state().completed, undefined)
127
- })
128
-
129
- test('same-named skill and rule freeze separately and disclose the rule body', async () => {
130
- const f = fixture()
131
- f.records.delete(join(f.cwd, '.dsh/task-LIVE-1.json'))
132
- f.records.set(join(f.cwd, '.dsh/eng.json'), JSON.stringify({ flow: 'minimal', stage_bindings: {
133
- '开发': { skills: [{ skill: { source: 'project', name: 'custom' }, rules: [{ source: 'project', name: 'custom' }], evidence: 'none' }] },
134
- } }))
135
- f.records.set(join(f.cwd, '.dsh/skills/custom/SKILL.md'), 'SKILL BODY')
136
- f.records.set(join(f.cwd, '.dsh/rules/custom.md'), 'RULE BODY')
137
- await f.call({ operation: 'create', title: 'collision', branch: 'main', files: ['app.js'] })
138
- const resources = f.state().flow.resources.filter(resource => resource.ref.name === 'custom')
139
- assert.deepEqual(resources.map(resource => resource.kind).sort(), ['rule', 'skill'])
140
- assert.equal(JSON.parse(await f.call({ operation: 'status' })).bindings.rules[0].content, 'RULE BODY')
141
- f.records.set(join(f.cwd, '.dsh/skills/custom/SKILL.md'), 'CHANGED SKILL')
142
- const status = JSON.parse(await f.call({ operation: 'status' }))
143
- assert.equal(status.bindings.skill_contents[0].content, 'CHANGED SKILL')
144
- assert.ok(status.changed_source_skills.some(ref => ref.includes('project:custom')))
145
- f.records.delete(join(f.cwd, '.dsh/skills/custom/SKILL.md'))
146
- const missing = JSON.parse(await f.call({ operation: 'status' }))
147
- assert.ok(missing.missing_skills.includes('project:custom'))
148
- assert.equal(missing.bindings.skill_contents.length, 0)
149
- })
150
-
151
- test('task creation applies skill_profiles rules even when legacy inline bindings are empty', async () => {
152
- const f = fixture()
153
- const skill = { source: 'project', name: 'custom' }
154
- const rule = { source: 'project', name: 'my-rule' }
155
- f.records.delete(join(f.cwd, '.dsh/task-LIVE-1.json'))
156
- f.records.set(join(f.cwd, '.dsh/eng.json'), JSON.stringify({ flow: 'minimal',
157
- stage_bindings: {
158
- '开发': { skills: [{ skill, rules: [], evidence: 'none' }] },
159
- '交付': { skills: [{ skill, rules: [], evidence: 'none' }] },
160
- },
161
- skill_profiles: { 'project:custom': { rules: [rule], evidence: 'none' } },
162
- }))
163
- f.records.set(join(f.cwd, '.dsh/skills/custom/SKILL.md'), 'SKILL BODY')
164
- await assert.rejects(f.call({ operation: 'create', title: 'profile regression', branch: 'main', files: ['app.js'] }), /rule:project:my-rule/)
165
- f.records.set(join(f.cwd, '.dsh/rules/my-rule.md'), 'RULE BODY')
166
- await f.call({ operation: 'create', title: 'profile regression', branch: 'main', files: ['app.js'] })
167
- assert.deepEqual(f.state().flow.config.stage_bindings['开发'].skills[0].rules, [rule])
168
- assert.deepEqual(f.state().flow.config.stage_bindings['交付'].skills[0].rules, [rule])
169
- assert.equal(f.state().flow.resources.find(resource => resource.kind === 'rule')?.content, 'RULE BODY')
170
- assert.equal(JSON.parse(await f.call({ operation: 'status' })).bindings.rules[0].content, 'RULE BODY')
171
- })
172
-
173
- test('task creation rejects an unavailable skill or rule before writing a record', async () => {
174
- const f = fixture()
175
- f.records.delete(join(f.cwd, '.dsh/task-LIVE-1.json'))
176
- f.records.set(join(f.cwd, '.dsh/eng.json'), JSON.stringify({ flow: 'minimal', stage_bindings: {
177
- '开发': { skills: [{ skill: { source: 'project', name: 'missing-skill' }, rules: [] }] },
178
- } }))
179
- await assert.rejects(f.call({ operation: 'create', title: 'missing', branch: 'main' }), /unreadable bound resources/)
180
- assert.equal(f.records.has(join(f.cwd, '.dsh/task-LIVE-1.json')), false)
181
- })
89
+ }
90
+
91
+ test('manual skill evidence is approved by the host without a shell command', async () => {
92
+ const config = resolveFlow('minimal', { flow: 'minimal', stage_bindings: {
93
+ '开发': { skills: [{ skill: { source: 'project', name: 'human-check' }, rules: [], evidence: 'manual' }] },
94
+ } }).config
95
+ const approvals = []
96
+ const f = fixture('开发', { flow: { flow: 'minimal', version: 3, config } }, {
97
+ approval: { request: async request => { approvals.push(request); return 'allowed-once' } },
98
+ })
99
+ f.load('human-check')
100
+ await f.call({ operation: 'skill_result', skill_name: 'human-check', evidence: ['checked by owner'] })
101
+ assert.equal(f.runs.length, 0)
102
+ assert.equal(approvals.length, 1)
103
+ assert.equal(f.state().skill_results['开发']['human-check'].approved, true)
104
+ assert.deepEqual(JSON.parse(await f.call({ operation: 'status' })).skill_blockers, [])
105
+ const denied = fixture('开发', { flow: { flow: 'minimal', version: 3, config } }, {
106
+ approval: { request: async () => 'rejected' },
107
+ })
108
+ denied.load('human-check')
109
+ await assert.rejects(denied.call({ operation: 'skill_result', skill_name: 'human-check', evidence: ['claimed approval'] }), /not approved/)
110
+ assert.equal(denied.state().skill_results?.['开发']?.['human-check'], undefined)
111
+ })
112
+
113
+ test('completion rejects unresolved terminal skills and rules', async () => {
114
+ const config = resolveFlow('minimal', { flow: 'minimal', stage_bindings: {
115
+ '交付': { skills: [{ skill: { source: 'project', name: 'must-run' }, rules: [{ source: 'project', name: 'missing' }], evidence: 'command' }] },
116
+ } }).config
117
+ const f = fixture('交付', {
118
+ flow: { flow: 'minimal', version: 3, config },
119
+ items: [{ id: 'A', title: 'small', status: 'done', review: { spec: { outcome: 'pass' }, quality: { outcome: 'pass' } } }],
120
+ commits: [{ label: 'TASK', hash: 'abcdef1' }],
121
+ })
122
+ const status = JSON.parse(await f.call({ operation: 'status' }))
123
+ assert.ok(status.skill_blockers.length > 0)
124
+ assert.ok(status.missing_rules.length > 0)
125
+ await assert.rejects(f.call({ operation: 'complete' }), /cannot complete.*must-run|cannot complete.*missing/)
126
+ assert.equal(f.state().completed, undefined)
127
+ })
128
+
129
+ test('same-named skill and rule freeze separately and disclose the rule body', async () => {
130
+ const f = fixture()
131
+ f.records.delete(join(f.cwd, '.dsh/task-LIVE-1.json'))
132
+ f.records.set(join(f.cwd, '.dsh/eng.json'), JSON.stringify({ flow: 'minimal', stage_bindings: {
133
+ '开发': { skills: [{ skill: { source: 'project', name: 'custom' }, rules: [{ source: 'project', name: 'custom' }], evidence: 'none' }] },
134
+ } }))
135
+ f.records.set(join(f.cwd, '.dsh/skills/custom/SKILL.md'), 'SKILL BODY')
136
+ f.records.set(join(f.cwd, '.dsh/rules/custom.md'), 'RULE BODY')
137
+ await f.call({ operation: 'create', title: 'collision', branch: 'main', files: ['app.js'] })
138
+ const resources = f.state().flow.resources.filter(resource => resource.ref.name === 'custom')
139
+ assert.deepEqual(resources.map(resource => resource.kind).sort(), ['rule', 'skill'])
140
+ assert.equal(JSON.parse(await f.call({ operation: 'status' })).bindings.rules[0].content, 'RULE BODY')
141
+ f.records.set(join(f.cwd, '.dsh/skills/custom/SKILL.md'), 'CHANGED SKILL')
142
+ const status = JSON.parse(await f.call({ operation: 'status' }))
143
+ assert.equal(status.bindings.skill_contents[0].content, 'CHANGED SKILL')
144
+ assert.ok(status.changed_source_skills.some(ref => ref.includes('project:custom')))
145
+ f.records.delete(join(f.cwd, '.dsh/skills/custom/SKILL.md'))
146
+ const missing = JSON.parse(await f.call({ operation: 'status' }))
147
+ assert.ok(missing.missing_skills.includes('project:custom'))
148
+ assert.equal(missing.bindings.skill_contents.length, 0)
149
+ })
150
+
151
+ test('task creation applies skill_profiles rules even when legacy inline bindings are empty', async () => {
152
+ const f = fixture()
153
+ const skill = { source: 'project', name: 'custom' }
154
+ const rule = { source: 'project', name: 'my-rule' }
155
+ f.records.delete(join(f.cwd, '.dsh/task-LIVE-1.json'))
156
+ f.records.set(join(f.cwd, '.dsh/eng.json'), JSON.stringify({ flow: 'minimal',
157
+ stage_bindings: {
158
+ '开发': { skills: [{ skill, rules: [], evidence: 'none' }] },
159
+ '交付': { skills: [{ skill, rules: [], evidence: 'none' }] },
160
+ },
161
+ skill_profiles: { 'project:custom': { rules: [rule], evidence: 'none' } },
162
+ }))
163
+ f.records.set(join(f.cwd, '.dsh/skills/custom/SKILL.md'), 'SKILL BODY')
164
+ await assert.rejects(f.call({ operation: 'create', title: 'profile regression', branch: 'main', files: ['app.js'] }), /rule:project:my-rule/)
165
+ f.records.set(join(f.cwd, '.dsh/rules/my-rule.md'), 'RULE BODY')
166
+ await f.call({ operation: 'create', title: 'profile regression', branch: 'main', files: ['app.js'] })
167
+ assert.deepEqual(f.state().flow.config.stage_bindings['开发'].skills[0].rules, [rule])
168
+ assert.deepEqual(f.state().flow.config.stage_bindings['交付'].skills[0].rules, [rule])
169
+ assert.equal(f.state().flow.resources.find(resource => resource.kind === 'rule')?.content, 'RULE BODY')
170
+ assert.equal(JSON.parse(await f.call({ operation: 'status' })).bindings.rules[0].content, 'RULE BODY')
171
+ })
172
+
173
+ test('task creation rejects an unavailable skill or rule before writing a record', async () => {
174
+ const f = fixture()
175
+ f.records.delete(join(f.cwd, '.dsh/task-LIVE-1.json'))
176
+ f.records.set(join(f.cwd, '.dsh/eng.json'), JSON.stringify({ flow: 'minimal', stage_bindings: {
177
+ '开发': { skills: [{ skill: { source: 'project', name: 'missing-skill' }, rules: [] }] },
178
+ } }))
179
+ await assert.rejects(f.call({ operation: 'create', title: 'missing', branch: 'main' }), /unreadable bound resources/)
180
+ assert.equal(f.records.has(join(f.cwd, '.dsh/task-LIVE-1.json')), false)
181
+ })
182
182
 
183
183
  test('审查通过后更新状态并激活下一项,保留已完成项的审计', async () => {
184
184
  const f = fixture()
@@ -309,10 +309,8 @@ test('记录字段来自冻结流程,精简流程不硬编码标准字段,
309
309
  assert.deepEqual(JSON.parse(await fixture('设计').call({ operation: 'status' })).artifact_requirements[0].fields, ['approach', 'risks', 'impact'])
310
310
  })
311
311
 
312
- test('可选内置技能回执不会因范围变更升级成额外流转门禁', async () => {
312
+ test('空绑定流程不会因范围变更产生额外技能门禁', async () => {
313
313
  const f = fixture('需求评审', { artifacts: { requirement: { scope: 'device picker', acceptance_criteria: 'contract and selection' } } })
314
- f.load('requirement-analysis')
315
- await f.call({ operation: 'skill_result', skill_name: 'requirement-analysis', command: 'check', evidence: ['optional check'] })
316
314
  await f.call({ operation: 'scope', files: ['app.js', 'new-vo.java'] })
317
315
  await f.call({ operation: 'advance', target_stage: '设计' })
318
316
  assert.equal(f.state().stage, '设计')
@@ -413,12 +411,12 @@ test('同名技能与规则在项目和个人目录各自保留管理入口', as
413
411
  assert.match(read.content, /Run tests/)
414
412
  })
415
413
 
416
- test('安装包的七个内置技能实际注册且可在资源目录发现', async () => {
414
+ test('安装包只注册会话编排技能,阶段目录不展示它', async () => {
417
415
  const registered = []
418
416
  registerShippedSkills({ get: name => name === 'skills' ? { register: skill => { registered.push(skill); return () => {} } } : undefined })
419
- const expected = ['code-commit', 'code-implement', 'code-review', 'code-verify', 'eng-delivery', 'requirement-analysis', 'solution-design']
417
+ const expected = ['eng-delivery']
420
418
  assert.deepEqual(registered.map(skill => skill.name).sort(), expected)
421
419
  assert.ok(registered.every(skill => skill.content.trim().length > 0))
422
420
  const catalog = await Controller.prototype.listSkills.call({ authorizedPath: async path => path }, '')
423
- assert.deepEqual(catalog.skills.filter(skill => skill.source === 'bundled').map(skill => skill.name).sort(), expected)
421
+ assert.deepEqual(catalog.skills.filter(skill => skill.source === 'bundled').map(skill => skill.name).sort(), [])
424
422
  })
package/README.md CHANGED
@@ -27,7 +27,7 @@
27
27
  让 AI 修改代码时,你可以先明确需求,再检查方案、推进实施、验证结果,最后审核提交。DSH Task Engine 把这些步骤组织成可检查、可追踪的任务流程,适合在本机使用 DeepSeek Harness 开发个人项目。
28
28
 
29
29
  - **知道下一步做什么**:按所选流程推进,当前阶段需要的条件和产物清楚可查。
30
- - **复用自己的工作方法**:把技能和规则安装到项目或个人目录,将规则配置在技能下,再把技能挂到节点上;同一技能在任何节点都使用同一套约束。
30
+ - **复用自己的工作方法**:把技能和规则安装到项目或个人目录,将规则配置在技能下,再把技能挂到节点上;同一技能在任何节点都使用同一套约束。
31
31
  - **找得到过程记录**:任务台账集中查看阶段、实施项、验证与审核状态。
32
32
 
33
33
  ## 快速开始
@@ -53,22 +53,22 @@ dsh plugin --profile web add @godv61/dsh-task-engine
53
53
  | **项目初始化** | 查看或编辑 `AGENTS.md`,让 AI 生成项目说明,预览后保存。 |
54
54
  | **流程配置** | 选择流程骨架,给节点挂技能,并在技能上配置它遵循的规则。需要现成起点时可「采用推荐配置」。 |
55
55
  | **任务台账** | 查看实施、验证和审核记录,按关键词、阶段或风险筛选。 |
56
- | **技能** | 安装、编辑技能,并集中维护每个技能唯一的规则列表。 |
56
+ | **技能** | 安装、编辑技能,并集中维护每个技能唯一的规则列表。 |
57
57
  | **规则** | 选择 Markdown 文件安装规则,维护项目或个人开发约定。 |
58
58
 
59
- 内置技能和规则是只读样本,可用“以此为模板新建”复制正文到项目或个人目录后编辑;新资源的规则和阶段绑定由你单独配置。安装、删除都会明确展示目标位置。
59
+ 插件只内置负责会话编排的 `eng-delivery`。阶段技能和规则由使用者创建或安装,可放在项目或个人目录;安装、删除都会明确展示目标位置。
60
60
 
61
- **流程与工作方法是两回事。** 流程只决定工作怎么流转(阶段顺序与门禁),预设不自带任何技能或提交格式。要用什么技能、遵守哪些规则、提交信息写什么,都由你配置。「采用推荐配置」并保存时,内置样本各复制一份到项目目录,配置改为引用项目资源;之后可编辑,升级不覆盖。同一条规则仍可由多个技能共享。用户级技能及其规则配置由所有项目和会话共用。任务的流程与资源引用在创建时确定;Skill/Rule 正文在每次交互读取最新版本,创建时副本仅用于审计。[配置细节](docs/configuration.md)
61
+ **流程与工作方法是两回事。** 流程只决定工作怎么流转(阶段顺序与门禁),预设不自带任何技能或提交格式。要用什么技能、遵守哪些规则,都由你配置。「采用推荐配置」只填写可修改的提交文本、产物字段和评审深度,不改变技能与规则绑定。同一条规则可由多个技能共享。用户级技能及其规则配置由所有项目和会话共用。任务的流程与资源引用在创建时确定;Skill/Rule 正文在每次交互读取最新版本,创建时副本仅用于审计。[配置细节](docs/configuration.md)
62
62
 
63
63
  ## 选择适合这次任务的流程
64
64
 
65
65
  | 预设 | 阶段顺序 | 适用场景 |
66
66
  | :--- | :--- | :--- |
67
- | **完整研发** `standard` | 需求评审 → 设计 → 开发 → 交付 → 代码审核 → 完成 | 需要需求、方案和交付检查的完整开发任务。 |
68
- | **日常迭代** `agile` | 需求 → 开发 → 交付 → 审查 | 目标明确的日常开发任务。 |
69
- | **快速修改** `minimal` | 开发 → 交付 | 已明确做法的小改动。 |
67
+ | **完整研发** `standard` | 需求评审 → 设计 → 开发 → 交付 → 代码审核 → 完成 | 需要需求、方案和交付检查的完整开发任务。 |
68
+ | **日常迭代** `agile` | 需求 → 开发 → 交付 → 审查 | 目标明确的日常开发任务。 |
69
+ | **快速修改** `minimal` | 开发 → 交付 | 已明确做法的小改动。 |
70
70
 
71
- 阶段顺序和检查条件由预设固定;技能与规则由用户配置。选择流程不会强制加入内置技能;需要现成起点时可显式采用推荐配置。**可视化自定义流程不在计划内**,详见[功能规划](docs/roadmap.md)。
71
+ 阶段顺序和检查条件由预设固定;技能与规则由用户配置。空绑定也能运行流程。需要提交文本和产物字段的起点时可显式采用推荐配置。**可视化自定义流程不在计划内**,详见[功能规划](docs/roadmap.md)。
72
72
 
73
73
  ## 把自己的技能和规则带进来
74
74
 
@@ -78,9 +78,11 @@ dsh plugin --profile web add @godv61/dsh-task-engine
78
78
 
79
79
  | 安装范围 | 存放位置 | 用途 |
80
80
  | :--- | :--- | :--- |
81
- | 项目 | 工作区 `.dsh/skills`、`.dsh/rules` | 当前项目的工作方法与约定。 |
81
+ | 项目 | 工作区 `.dsh/skills`、`.dsh/rules` | 当前项目的工作方法与约定;工作台新建资源默认写在这里。 |
82
82
  | 个人 | `$DSH_HOME/skills`、`$DSH_HOME/rules` | 在这台电脑上的多个项目间复用。 |
83
83
 
84
+ 工作台也会发现同一项目 `.agents/skills/<名称>/SKILL.md` 中的 Codex 项目技能,可将它绑定到流程节点,并在技能下配置 DSH 规则;它的正文仍留在原目录。运行时使用 `dev_task` 的 `load_skill` 操作读取该技能及其规则,下一次读取会取得文件的最新内容。[Codex 项目技能说明](docs/configuration.md#技能与规则)
85
+
84
86
  技能的脚本、模板和附件会一并保留。文件格式、大小限制和故障处理见[技能与规则安装指南](docs/resource-install.md)。
85
87
 
86
88
  ## 使用文档
@@ -98,7 +100,7 @@ dsh plugin --profile web add @godv61/dsh-task-engine
98
100
 
99
101
  ## 能力说明
100
102
 
101
- `dev_task` 按配置检查阶段、产物和提交条件。新任务的验证要求真实命令回执;技能可按自身配置要求命令、产物、审核、人工批准或无需额外证据,执行义务可在任务状态中查看。任务保存创建时的流程与资源引用;之后修改流程配置不会改变进行中任务的状态机,编辑所引用资源的正文会从下一次交互生效。
103
+ `dev_task` 按配置检查阶段、产物和提交条件。新任务的验证要求真实命令回执;技能可按自身配置要求命令、产物、审核、人工批准或无需额外证据,执行义务可在任务状态中查看。任务保存创建时的流程与资源引用;之后修改流程配置不会改变进行中任务的状态机,编辑所引用资源的正文会从下一次交互生效。
102
104
 
103
105
  审核结论、实施项完成情况和测试覆盖面仍需要你判断。本地提交钩子提供即时检查,不能替代人工审核或项目自己的 CI。详细说明见[常见问题](docs/faq.md)。
104
106
 
package/cordis.patch.yml CHANGED
@@ -1,11 +1,160 @@
1
- # dsh-task-engine bundle: one host-plane row that mounts the `task-engine`
2
- # Remote namespace (what the browser workbench reads/writes) plus, via
3
- # `dsh.client`, the workbench UI. This host row registers NO model-facing tool
4
- # and NO skill — `dev_task` and the shipped skills live on the AGENT plane,
5
- # behind the `@godv61/dsh-task-engine/agent` entry. A preset's
6
- # `agent.cordis.yml` names that agent row to activate the flow for its
7
- # sessions; presets that never name it get neither the tool nor the skills
8
- # (the workbench stays available so a human can still configure the flow).
1
+ # dsh-task-engine bundle: mount the host controller and contribute an
2
+ # engineering preset using DSH 0.2's declarative preset plugin.
9
3
  - insert:
10
4
  - id: task-engine
11
- name: '@godv61/dsh-task-engine'
5
+ name: '@godv61/dsh-task-engine'
6
+
7
+ # Engineering preset derived from DSH 0.2's shipped standard preset.
8
+ # Keep this declaration in sync with the target DSH release.
9
+ # `config.plugins` by id from the profile patch.
10
+ - insert:
11
+ - id: preset-eng
12
+ name: '@deepseek-ai/dsh-agent-preset'
13
+ config:
14
+ id: eng
15
+ name: 工程化开发引擎
16
+ description: 通过 dev_task 持有工程任务阶段、证据和提交门禁。
17
+ order: 2
18
+ plugins:
19
+ - id: persona
20
+ name: '@deepseek-ai/dsh-persona'
21
+ config:
22
+ prefix: |-
23
+ You are an engineering-delivery coding agent, powered by the {{model}} model, running on DeepSeek Harness. Your working directory is {{cwd}}.
24
+
25
+ 本仓库使用 `dev_task` 管理工程任务的状态机。项目根 `.dsh/eng.json` 选择流程骨架,并可配置阶段技能、技能规则、产物字段和提交文本;没有配置的业务方法不能自动补齐。任何开发类请求开始前,先加载 `eng-delivery` 并读取当前任务状态。
26
+
27
+ 阶段流转、确认、验证、评审、任务完成及受控提交通过 `dev_task`;它拒绝时按返回的条件修正,不绕过。具体工作方法以当前任务冻结的用户配置为准,远程操作或发布由用户明确决定。
28
+ - id: agent-instructions
29
+ name: '@deepseek-ai/dsh-agent-instructions'
30
+ config:
31
+ maxBytes: 65536
32
+ - id: tool-bash
33
+ name: '@deepseek-ai/dsh-tool-bash'
34
+ disabled: !!js process.platform === 'win32'
35
+ - id: tool-pwsh
36
+ name: '@deepseek-ai/dsh-tool-pwsh'
37
+ disabled: !!js process.platform !== 'win32'
38
+ - id: tool-fs
39
+ name: '@deepseek-ai/dsh-tool-fs'
40
+ - id: tool-fs-search
41
+ name: '@deepseek-ai/dsh-tool-fs-search'
42
+ config:
43
+ sampleOverCapGlobResults: false
44
+ - id: tool-jobs
45
+ name: '@deepseek-ai/dsh-tool-jobs'
46
+ - id: skill-filesystem
47
+ name: '@deepseek-ai/dsh-skill-filesystem'
48
+ - id: tool-skill
49
+ name: '@deepseek-ai/dsh-tool-skill'
50
+ - id: command-goal
51
+ name: '@deepseek-ai/dsh-command-goal'
52
+ - id: tool-goal
53
+ name: '@deepseek-ai/dsh-tool-goal'
54
+ - id: planning
55
+ name: cordis:group
56
+ group: true
57
+ isolate:
58
+ planMode: true
59
+ config:
60
+ - id: plan-mode
61
+ name: '@deepseek-ai/dsh-plan-mode'
62
+ config:
63
+ section: |
64
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
65
+
66
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
67
+
68
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
69
+
70
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
71
+
72
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
73
+
74
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
75
+ - id: compaction
76
+ name: cordis:group
77
+ group: true
78
+ isolate:
79
+ compaction: true
80
+ toolResultPruner: true
81
+ config:
82
+ - id: compaction-basic
83
+ name: '@deepseek-ai/dsh-compaction-basic'
84
+ - id: command-compact
85
+ name: '@deepseek-ai/dsh-command-compact'
86
+ - id: tool-result-pruner
87
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
88
+ config:
89
+ thresholdChars: 8192
90
+ headChars: 4096
91
+ tailChars: 1024
92
+ - id: delegation
93
+ name: cordis:group
94
+ group: true
95
+ isolate:
96
+ workflowEngine: true
97
+ config:
98
+ - id: tool-subagent-control
99
+ name: '@deepseek-ai/dsh-tool-subagent-control'
100
+ - id: tool-subagent-list-agents
101
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
102
+ - id: tool-subagent
103
+ name: '@deepseek-ai/dsh-tool-subagent'
104
+ config:
105
+ provider: spawn
106
+ toolName: subagent
107
+ modelSelectionSettings: true
108
+ backgroundMode: continuable
109
+ - id: tool-subagent-fork
110
+ name: '@deepseek-ai/dsh-tool-subagent'
111
+ config:
112
+ provider: fork
113
+ toolName: subagent_fork
114
+ backgroundMode: continuable
115
+ - id: tool-subagent-codex
116
+ name: '@deepseek-ai/dsh-tool-subagent'
117
+ disabled: true
118
+ config:
119
+ provider: codex
120
+ toolName: subagent_codex
121
+ backgroundMode: one-shot
122
+ maxDepth: provider-managed
123
+ - id: tool-subagent-claude-code
124
+ name: '@deepseek-ai/dsh-tool-subagent'
125
+ disabled: true
126
+ config:
127
+ provider: claude-code
128
+ toolName: subagent_claude_code
129
+ backgroundMode: one-shot
130
+ maxDepth: provider-managed
131
+ - id: workflow-ptc
132
+ name: '@deepseek-ai/dsh-workflow-ptc'
133
+ config:
134
+ provider: spawn
135
+ - id: tool-workflow
136
+ name: '@deepseek-ai/dsh-tool-workflow'
137
+ - id: tool-ralph
138
+ name: '@deepseek-ai/dsh-tool-ralph'
139
+ disabled: true
140
+ config:
141
+ subagentProvider: spawn
142
+ maxRounds: 64
143
+ - id: tool-ask-user
144
+ name: '@deepseek-ai/dsh-tool-ask-user'
145
+ - id: tool-todo
146
+ name: '@deepseek-ai/dsh-tool-todo'
147
+ config:
148
+ allowParallelInProgress: true
149
+ - id: tool-web
150
+ name: '@deepseek-ai/dsh-tool-web'
151
+ config:
152
+ fetch: true
153
+ searchTimeoutMs: 60000
154
+ - id: present
155
+ name: '@deepseek-ai/dsh-tool-present'
156
+ - id: tool-plugin-manager
157
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
158
+ disabled: true
159
+ - id: task-engine-agent
160
+ name: '@godv61/dsh-task-engine/agent'
package/defaults/eng.json CHANGED
@@ -1,97 +1 @@
1
- {
2
- "flow": "standard",
3
- "stage_bindings": {
4
- "需求评审": {
5
- "skill_refs": [
6
- {
7
- "source": "bundled",
8
- "name": "requirement-analysis"
9
- }
10
- ]
11
- },
12
- "设计": {
13
- "skill_refs": [
14
- {
15
- "source": "bundled",
16
- "name": "solution-design"
17
- }
18
- ]
19
- },
20
- "开发": {
21
- "skill_refs": [
22
- {
23
- "source": "bundled",
24
- "name": "code-implement"
25
- }
26
- ]
27
- },
28
- "交付": {
29
- "skill_refs": [
30
- {
31
- "source": "bundled",
32
- "name": "code-verify"
33
- }
34
- ]
35
- },
36
- "代码审核": {
37
- "skill_refs": [
38
- {
39
- "source": "bundled",
40
- "name": "code-review"
41
- },
42
- {
43
- "source": "bundled",
44
- "name": "code-commit"
45
- }
46
- ]
47
- }
48
- },
49
- "skill_profiles": {
50
- "bundled:requirement-analysis": {
51
- "rules": [
52
- {
53
- "source": "bundled",
54
- "name": "security-redlines"
55
- }
56
- ]
57
- },
58
- "bundled:solution-design": {
59
- "rules": []
60
- },
61
- "bundled:code-implement": {
62
- "rules": [
63
- {
64
- "source": "bundled",
65
- "name": "coding-conventions"
66
- },
67
- {
68
- "source": "bundled",
69
- "name": "security-redlines"
70
- }
71
- ]
72
- },
73
- "bundled:code-verify": {
74
- "rules": []
75
- },
76
- "bundled:code-review": {
77
- "rules": [
78
- {
79
- "source": "bundled",
80
- "name": "coding-conventions"
81
- },
82
- {
83
- "source": "bundled",
84
- "name": "security-redlines"
85
- }
86
- ]
87
- },
88
- "bundled:code-commit": {
89
- "rules": [
90
- {
91
- "source": "bundled",
92
- "name": "commit-conventions"
93
- }
94
- ]
95
- }
96
- }
97
- }
1
+ {"flow":"standard"}