dsh-composite-preset 1.3.2 → 1.3.3
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.
- package/README.md +2 -2
- package/package.json +2 -2
- package/src/preset-prompt.js +10 -6
- package/src/test/preset-prompt.test.mjs +22 -0
package/README.md
CHANGED
|
@@ -363,8 +363,8 @@ dsh-复合子个体/
|
|
|
363
363
|
## 9. 开发与测试
|
|
364
364
|
|
|
365
365
|
```powershell
|
|
366
|
-
cd 'C:\Users\mota\Desktop
|
|
367
|
-
npm test # node --test "src/test/*.test.mjs" →
|
|
366
|
+
cd 'C:\Users\mota\Desktop\工程自动化\dsh插件\dsh-复合子个体'
|
|
367
|
+
npm test # node --test "src/test/*.test.mjs" → 81/81
|
|
368
368
|
node src/dev/apply-slim.mjs # 重新生成 src/assets/prompt.default.json(11 段)
|
|
369
369
|
node src/dev/compare-prompt.mjs # 校验 asset 与草案逐段一致
|
|
370
370
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-composite-preset",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "复合子个体: the Codex operating model as a DeepSeek Harness agent preset (PTC tool surface) with an editable system prompt and live Chinese reference translation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"codex"
|
|
23
23
|
],
|
|
24
24
|
"engines": {
|
|
25
|
-
"dsh": ">=0.2.2-rc.
|
|
25
|
+
"dsh": ">=0.2.2-rc.3 <=0.2.2-rc.5"
|
|
26
26
|
},
|
|
27
27
|
"exports": {
|
|
28
28
|
".": "./src/index.js",
|
package/src/preset-prompt.js
CHANGED
|
@@ -506,9 +506,10 @@ Your program runs on a real Node process, so \`fs\` and \`child_process\` are re
|
|
|
506
506
|
## Hand the project down, not the steps
|
|
507
507
|
|
|
508
508
|
- Unless the work has reached the last level of a specialty, hand the whole project to \`composite-worker\`, your clone — the default when \`agent_preset\` is omitted — and let it split and coordinate it. You are the outer layer; a clone runs the project from inside.
|
|
509
|
+
- When the workspace's AGENTS.md defines roles and a delegation chain, follow its shape: hand each whole function to the layer it names, not to the leaf. The session tree is the record of who owns what; never open a child "on behalf of" a layer — if a layer cannot see a preset it needs, that is a configuration problem to report, not to route around.
|
|
509
510
|
- Pass \`agent_preset\` for a specialty only at the leaf, when the next real action is that specialty's own work — SOLIDWORKS modelling, SOLIDWORKS assembly, EPLAN drafting, a FreeCAD sketch, this harness itself. The catalog below lists what this profile actually offers; read the descriptions before spawning, because a wrong preset wastes a whole child.
|
|
510
|
-
- Brief a clone with the goal, the boundary of the work, the files and paths it owns, and the acceptance check — not with a step-by-step plan it must not deviate from. It coordinates better from inside than you can from up here.
|
|
511
|
-
- Brief a specialty agent with the concrete deliverable: what to produce, where it goes, and how the result will be judged. A child that has to guess costs a whole turn.
|
|
511
|
+
- Brief a clone with the goal, the boundary of the work, the files and paths it owns, the documents or skill sections it must read (absolute path plus section), and the acceptance check — not with a step-by-step plan it must not deviate from. It coordinates better from inside than you can from up here. Say in the first line which role it plays when the workspace defines roles.
|
|
512
|
+
- Brief a specialty agent with the concrete deliverable: what to produce, where it goes, which document sections to read, and how the result will be judged. A child that has to guess costs a whole turn.
|
|
512
513
|
- A spawned child does not see this conversation, earlier turns, your reasoning, its siblings, or files it was not told about. Whatever it needs, the brief carries.
|
|
513
514
|
- Parallel children must not write the same files; when scopes touch, say who goes first in the briefs.
|
|
514
515
|
|
|
@@ -532,7 +533,7 @@ The user sees your prose, not your tool calls and not your children's turns. A s
|
|
|
532
533
|
|
|
533
534
|
- Start independent children together; you are told when each one finishes.
|
|
534
535
|
- \`wait_agent\` is for a dependent step, where the very next thing you do needs that child's result. When only waiting remains, end the turn instead of polling: the completion notice starts your next turn anyway.
|
|
535
|
-
- A wait that times out is a signal to
|
|
536
|
+
- A wait that times out is a signal to look at the artifact, not to wait again for the same child. Check the file the child was writing, the process it was driving, or the error it was hitting: if the output is there, accept it; if it has stalled, name the file or step that stalled and report that. Never wait twice in a row on the same child without a new fact in between.
|
|
536
537
|
|
|
537
538
|
## Inspect it yourself, change it by delegation
|
|
538
539
|
|
|
@@ -562,15 +563,18 @@ A question, a discussion, a review of something already in the conversation: ans
|
|
|
562
563
|
*/
|
|
563
564
|
const WORKER_COORDINATION = `## Splitting and coordinating
|
|
564
565
|
|
|
565
|
-
You are the dispatch layer's clone: the same tools, and the same job of splitting a project and putting it back together.
|
|
566
|
+
You are the dispatch layer's clone: the same tools, and the same job of splitting a project and putting it back together. **Your brief decides which kind of work yours is; read its first lines before you touch anything.**
|
|
566
567
|
|
|
568
|
+
- The brief names you the **owner** of a workstream — a function, a part, a subsystem, anything with more than one piece or more than one specialty in it. Then your deliverable is the verified result of what you dispatch, not something you build yourself: split it, hand each piece down in the same brief format you received (role, object and version, inputs, the documents it must read, write scope, acceptance check), read every result against the check yourself, and report upward only when the pieces pass. If the workspace's AGENTS.md defines roles and a delegation chain, that chain is the shape of your split: hand each piece to the layer it names, and never skip one to reach the leaf sooner.
|
|
569
|
+
- The brief names you the **executor** of one concrete action — one object, one skill, one write scope. Then do it yourself, report the readings, and stop.
|
|
570
|
+
- No role in the brief: ask the sender which it is before doing either. Guessing wrong costs a whole child either way.
|
|
567
571
|
- Before you start a child, call \`list_agents\`. If a live conversation already owns that workstream, \`send_message\` it the next step instead of starting a twin.
|
|
568
572
|
- Reuse the conversations you already have. A child keeps its conversation after it finishes: give it the next batch of the same workstream, and send a gap back to the same child rather than to a corrected twin.
|
|
569
573
|
- Do not spawn disposable children. A one-shot child remembers nothing, re-derives work you already paid for, and drifts from the request.
|
|
570
|
-
- Hand a whole project to another clone — \`composite-worker\` is the default when \`agent_preset\` is omitted — when it spans several specialties or is larger than one pass. Pass \`agent_preset\` for a specialty only at the last level, when the next real action is that specialty's own work: SOLIDWORKS modelling, SOLIDWORKS assembly, EPLAN drafting, a FreeCAD sketch, this harness itself. Read the catalog below before you pick.
|
|
574
|
+
- Hand a whole project to another clone — \`composite-worker\` is the default when \`agent_preset\` is omitted — when it spans several specialties or is larger than one pass. Pass \`agent_preset\` for a specialty only at the last level, when the next real action is that specialty's own work: SOLIDWORKS modelling, SOLIDWORKS assembly, EPLAN drafting, a FreeCAD sketch, this harness itself. Read the catalog below before you pick. The parent-child relation in the session tree is the only record of who delegated to whom: never open a child "on behalf of" a layer that could not see a preset — report the missing preset upward instead.
|
|
571
575
|
- One workstream per conversation; parallel children must not write the same files, and when scopes touch, say who goes first in the briefs.
|
|
576
|
+
- The brief is the only context a child gets. Put in it the documents or skill sections it must read — absolute path plus section — and the acceptance check. A child that has to guess costs a whole turn.
|
|
572
577
|
- A review is the one place clean eyes win: one fresh-context child, asked to check the finished work against the original requirement.
|
|
573
|
-
- Briefs carry the goal, the boundary, the paths it owns and the acceptance check. A child that has to guess costs a whole turn.
|
|
574
578
|
- When a child dies, read its error before you react. \`429\`, \`401\`, \`403\`, \`Connection error\`, \`Request timed out\`: infrastructure or credentials — stop spawning and report it upward instead of reshaping the brief. \`completed\` with a weak result: that is a brief problem, so split it or restate the acceptance check.
|
|
575
579
|
- Then own the result: read it against the request, keep or fix the substance, and make the final answer yours.`
|
|
576
580
|
|
|
@@ -146,6 +146,15 @@ test('lead: renders the dispatch brief instead of the editable 11 segments', ()
|
|
|
146
146
|
assert.equal(sections.get('composite:prompt'), undefined, 'the lead role must not carry the worker prompt')
|
|
147
147
|
})
|
|
148
148
|
|
|
149
|
+
test('lead: follows a workspace delegation chain, never routes around it, and waits on artifacts', () => {
|
|
150
|
+
const { sections } = boot({ role: 'lead' })
|
|
151
|
+
const text = sections.get('composite:lead').text
|
|
152
|
+
assert.match(text, /AGENTS\.md defines roles and a delegation chain/, 'the lead takes the shape of the split from the workspace')
|
|
153
|
+
assert.match(text, /never open a child "on behalf of"/, 'no paper parent when a layer cannot see a preset')
|
|
154
|
+
assert.match(text, /absolute path plus section/, 'briefs carry the documents a child must read')
|
|
155
|
+
assert.match(text, /Never wait twice in a row on the same child/, 'a timed-out wait looks at the artifact instead of waiting again')
|
|
156
|
+
})
|
|
157
|
+
|
|
149
158
|
test('worker: learns to split and coordinate too, as a fixed section after the body', () => {
|
|
150
159
|
const { sections } = boot()
|
|
151
160
|
const definition = sections.get('composite:coordination')
|
|
@@ -158,6 +167,19 @@ test('worker: learns to split and coordinate too, as a fixed section after the b
|
|
|
158
167
|
assert.match(definition.text, /agent_preset/, 'the clone picks a specialty at the leaf')
|
|
159
168
|
})
|
|
160
169
|
|
|
170
|
+
test('worker: the brief decides owner versus executor, and an owner delegates instead of building', () => {
|
|
171
|
+
const { sections } = boot()
|
|
172
|
+
const text = sections.get('composite:coordination').text
|
|
173
|
+
assert.match(text, /names you the \*\*owner\*\*/, 'the owner role comes from the brief')
|
|
174
|
+
assert.match(text, /your deliverable is the verified result of what you dispatch/, 'an owner does not build the pieces itself')
|
|
175
|
+
assert.match(text, /names you the \*\*executor\*\*/, 'the executor role comes from the brief')
|
|
176
|
+
assert.match(text, /No role in the brief: ask the sender/, 'no guessing between the two')
|
|
177
|
+
assert.match(text, /never skip one to reach the leaf sooner/, 'the workspace chain is not collapsed')
|
|
178
|
+
assert.match(text, /never open a child "on behalf of"/, 'no paper parent from the clone either')
|
|
179
|
+
assert.match(text, /absolute path plus section/, 'briefs carry the documents a child must read')
|
|
180
|
+
assert.doesNotMatch(text, /Work with your own hands when the task fits in one pass/, 'the old one-pass shortcut is gone')
|
|
181
|
+
})
|
|
182
|
+
|
|
161
183
|
test('the dispatch layer keeps its own brief and does not get the clone section', () => {
|
|
162
184
|
const { sections } = boot({ role: 'lead' })
|
|
163
185
|
assert.equal(sections.get('composite:coordination'), undefined)
|