dsh-hive-runner 1.0.18 → 1.0.19
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/CHANGELOG.md +21 -0
- package/SPEC.md +4 -0
- package/index.js +2 -1
- package/lib/commands.js +22 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
Version 0.6.0 is the first public snapshot; 0.1.0-0.5.0 were local development
|
|
8
8
|
iterations of the plugin before this repository was published.
|
|
9
9
|
|
|
10
|
+
## [1.0.19] - 2026-12-05
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Task titles are mechanically validated before any card is created: `hive_tasks`
|
|
15
|
+
`add`/`edit`, every `split` replacement card (and `hive_intervene` cards through the
|
|
16
|
+
same command layer) reject titles starting with a repository/stage prefix plus id or
|
|
17
|
+
a bare numeric id plus colon, with the exact rule text `标题只写结果本身:不要仓库/阶段
|
|
18
|
+
前缀与编号(编号由 id 承载),例如用『实现背景音乐生成』而不是『ai/A5:实现背景音乐生成』`.
|
|
19
|
+
- The `hive_tasks` tool description and `title` parameter now carry the rule so the
|
|
20
|
+
model rewrites the title immediately instead of retrying the same shape.
|
|
21
|
+
|
|
22
|
+
### Tests
|
|
23
|
+
|
|
24
|
+
- Prefix/id rejection, normal result-only titles, split child validation, and the tool
|
|
25
|
+
description rule; 277 tests pass.
|
|
26
|
+
|
|
10
27
|
## [1.0.18] - 2026-12-05
|
|
11
28
|
|
|
12
29
|
### Fixed
|
|
@@ -29,6 +46,10 @@ iterations of the plugin before this repository was published.
|
|
|
29
46
|
Also verifies the service declaration reaches the round runner's worker prompt.
|
|
30
47
|
274 tests pass.
|
|
31
48
|
|
|
49
|
+
### Published
|
|
50
|
+
|
|
51
|
+
- npm: `dsh-hive-runner@1.0.18` on 2026-12-05.
|
|
52
|
+
|
|
32
53
|
## [1.0.17] - 2026-12-05
|
|
33
54
|
|
|
34
55
|
### Added
|
package/SPEC.md
CHANGED
|
@@ -237,6 +237,10 @@ for `idleBackoffMs` without consuming the failure budget.
|
|
|
237
237
|
All tools return a JSON string. `repo` defaults to `config.cwd` and must be a configured
|
|
238
238
|
repository unless it is that default.
|
|
239
239
|
|
|
240
|
+
Task titles contain only the result: `hive_tasks add/edit` and every `split` card reject
|
|
241
|
+
repository/stage prefixes and `编号:` prefixes (the id carries the number), e.g.
|
|
242
|
+
`实现背景音乐生成`, not `ai/A5:实现背景音乐生成`.
|
|
243
|
+
|
|
240
244
|
| Tool | Parameters | Output |
|
|
241
245
|
| --- | --- | --- |
|
|
242
246
|
| `hive_run_round` | `repo`, `ttl`, `agent` | Per-task results, role state and remaining queue |
|
package/index.js
CHANGED
|
@@ -567,6 +567,7 @@ export function apply(ctx, config = {}) {
|
|
|
567
567
|
+ 'supersede marks a task (including a claimed/running one) as superseded without changing its state and requires a reason; '
|
|
568
568
|
+ 'reopen resets any task to pending with an attempt+1 and an optional reason; retry moves a failed task back to pending; '
|
|
569
569
|
+ 'rm deletes a task (the CLI refuses a claimed task — reopen or wait for the claim to expire first). '
|
|
570
|
+
+ 'TITLE RULE (enforced for add/edit/split cards): write only the result itself — no repo/stage prefix and no number prefix; the id carries the number. Use 『实现背景音乐生成』, never 『ai/A5:实现背景音乐生成』. '
|
|
570
571
|
+ 'The queen uses these for ordering, splitting, goal evolution and remediation; workers alone claim and finish tasks.',
|
|
571
572
|
parameters: {
|
|
572
573
|
repo: repoParameter,
|
|
@@ -578,7 +579,7 @@ export function apply(ctx, config = {}) {
|
|
|
578
579
|
id: { type: 'string', description: 'Task id (show/edit/split/supersede/reopen/retry/rm).' },
|
|
579
580
|
state: { type: 'string', enum: ['pending', 'claimed', 'done', 'failed'], description: 'list: state filter.' },
|
|
580
581
|
role: { type: 'string', description: 'list/add/edit: role filter or new role for the task(s).' },
|
|
581
|
-
title: { type: 'string', description: 'add/edit: task title.' },
|
|
582
|
+
title: { type: 'string', description: 'add/edit: task title — only the result itself; never a repo/stage prefix or number prefix (the id carries it), e.g. 实现背景音乐生成 not ai/A5:实现背景音乐生成.' },
|
|
582
583
|
goal: { type: 'string', description: 'add: goal of the task (hive-tasks 1.9 edit cannot change it).' },
|
|
583
584
|
scope: { type: 'array', items: { type: 'string' }, description: 'add/edit: paths or resource keys (edit replaces the list; the runner translates it to scope add/remove).' },
|
|
584
585
|
after: { type: 'array', items: { type: 'string' }, description: 'add/edit: task ids that must be done first (edit replaces the list).' },
|
package/lib/commands.js
CHANGED
|
@@ -23,6 +23,25 @@ export class HiveCommandError extends Error {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/** Exact title rule shown to the model and used in the mechanical rejection. */
|
|
27
|
+
export const TASK_TITLE_MESSAGE = '标题只写结果本身:不要仓库/阶段前缀与编号(编号由 id 承载),例如用『实现背景音乐生成』而不是『ai/A5:实现背景音乐生成』';
|
|
28
|
+
|
|
29
|
+
const PREFIXED_TITLE_RE = /^[^\s::/]+\/[^\s::]*\d+\s*[::]/u;
|
|
30
|
+
const NUMBERED_TITLE_RE = /^(?:[A-Za-z]+[-_]?)?\d+\s*[::]/u;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Reject repository/stage prefixes and numeric ids in task titles. The id
|
|
34
|
+
* carries the number; the title must describe only the result.
|
|
35
|
+
* @param {string} title
|
|
36
|
+
* @returns {string} the trimmed title
|
|
37
|
+
*/
|
|
38
|
+
export function validateTaskTitle(title) {
|
|
39
|
+
const value = typeof title === 'string' ? title.trim() : '';
|
|
40
|
+
if (PREFIXED_TITLE_RE.test(value) || NUMBERED_TITLE_RE.test(value)) {
|
|
41
|
+
throw new HiveCommandError('hive/invalid-argument', TASK_TITLE_MESSAGE);
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
26
45
|
export const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
27
46
|
export const AGENT_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
28
47
|
export const TTL_RE = /^\d{1,4}[smhd]$/;
|
|
@@ -221,7 +240,7 @@ export function buildCommand(verb, args = {}, bins = {}) {
|
|
|
221
240
|
+ (role === null ? '' : ' --role ' + quote(role));
|
|
222
241
|
}
|
|
223
242
|
case 'add': {
|
|
224
|
-
const title = textArg(args.title, 'add.title', 300);
|
|
243
|
+
const title = validateTaskTitle(textArg(args.title, 'add.title', 300));
|
|
225
244
|
const parts = [tasks, 'add', '--json', '--title', quote(title)];
|
|
226
245
|
const role = args.role === undefined || args.role === null || args.role === ''
|
|
227
246
|
? null
|
|
@@ -256,7 +275,7 @@ export function buildCommand(verb, args = {}, bins = {}) {
|
|
|
256
275
|
const parts = [tasks, 'edit', quote(id), '--json'];
|
|
257
276
|
let changes = 0;
|
|
258
277
|
const title = optionalText(args.title, 'edit.title', 300);
|
|
259
|
-
if (title !== null) { parts.push('--title', quote(title)); changes += 1; }
|
|
278
|
+
if (title !== null) { parts.push('--title', quote(validateTaskTitle(title))); changes += 1; }
|
|
260
279
|
if (args.role !== undefined && args.role !== null && args.role !== '') {
|
|
261
280
|
parts.push('--role', quote(needMatch(CARD_ROLE_RE, args.role, 'edit.role')));
|
|
262
281
|
changes += 1;
|
|
@@ -318,7 +337,7 @@ export function buildCommand(verb, args = {}, bins = {}) {
|
|
|
318
337
|
);
|
|
319
338
|
}
|
|
320
339
|
}
|
|
321
|
-
const card = { title: textArg(entry.title, 'split.cards[' + index + '].title', 300) };
|
|
340
|
+
const card = { title: validateTaskTitle(textArg(entry.title, 'split.cards[' + index + '].title', 300)) };
|
|
322
341
|
if (entry.role !== undefined) card.role = needMatch(CARD_ROLE_RE, entry.role, 'split.cards[' + index + '].role');
|
|
323
342
|
if (entry.scope !== undefined) card.scope = listArg(entry.scope, 'split.cards[' + index + '].scope');
|
|
324
343
|
if (entry.acceptance !== undefined) card.acceptance = textArg(entry.acceptance, 'split.cards[' + index + '].acceptance');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hive-runner",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "DSH host plugin for Hive: a resident supervisor that runs one DSH subagent per ready task card, with per-role worker limits, pause/resume and Hive tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|